You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
194 KiB

System.register(["./chunk-vendor.js","./chunk-frameworks.js"],(function(e,t){"use strict";var n,o,s,r,i,a,c,l,u,d,m,f,h,p,g,b,y,v,w,j,L,S,k,E,T,q,A,x,M,C,H,_,I,P,R,D,$,N,O,B,F,W,z,U,V,X,K,J,G,Y,Q,Z,ee,te,ne,oe,se,re,ie,ae,ce,le,ue,de,me,fe,he,pe,ge,be,ye,ve,we,je,Le,Se,ke,Ee,Te,qe,Ae,xe,Me,Ce,He,_e,Ie,Pe,Re,De,$e,Ne,Oe,Be,Fe,We,ze,Ue,Ve,Xe,Ke,Je,Ge,Ye,Qe,Ze,et,tt,nt,ot,st,rt,it,at,ct,lt,ut,dt,mt,ft,ht,pt,gt,bt,yt,vt,wt,jt,Lt,St,kt,Et;return{setters:[function(e){n=e._,o=e.t,s=e.g,r=e.c,i=e.I,a=e.R,c=e.C,l=e.o,u=e.r,d=e.f,m=e.a,f=e.A,h=e.d,p=e.j,g=e.s,b=e.k,y=e.l,v=e.m,w=e.n,j=e.F,L=e.p,S=e.q,k=e.v,E=e.h,T=e.w,q=e.x,A=e.y,x=e.z,M=e.B,C=e.E,H=e.G,_=e.H,I=e.J,P=e.K,R=e.M,D=e.L,$=e.N,N=e.O,O=e.b,B=e.e,F=e.P,W=e.Q,z=e.U,U=e.V,V=e.W,X=e.X},function(e){K=e.h,J=e.s,G=e.c,Y=e.v,Q=e.b,Z=e.d,ee=e.p,te=e.e,ne=e.o,oe=e.g,se=e.f,re=e.r,ie=e.i,ae=e.j,ce=e.k,le=e.l,ue=e.n,de=e.q,me=e.t,fe=e.u,he=e.D,pe=e.w,ge=e.x,be=e.y,ye=e.z,ve=e.A,we=e.B,je=e.C,Le=e.E,Se=e.F,ke=e.a,Ee=e.G,Te=e.H,qe=e.I,Ae=e.J,xe=e.m,Me=e.K,Ce=e.L,He=e.M,_e=e.N,Ie=e.O,Pe=e.P,Re=e.Q,De=e.R,$e=e.S,Ne=e.T,Oe=e.U,Be=e.V,Fe=e.W,We=e.X,ze=e.Y,Ue=e.Z,Ve=e._,Xe=e.$,Ke=e.a0,Je=e.a1,Ge=e.a2,Ye=e.a3,Qe=e.a4,Ze=e.a5,et=e.a6,tt=e.a7,nt=e.a8,ot=e.a9,st=e.aa,rt=e.ab,it=e.ac,at=e.ad,ct=e.ae,lt=e.af,ut=e.ag,dt=e.ah,mt=e.ai,ft=e.aj,ht=e.ak,pt=e.al,gt=e.am,bt=e.an,yt=e.ao,vt=e.ap,wt=e.aq,jt=e.ar,Lt=e.as,St=e.at,kt=e.au,Et=e.av}],execute:function(){const e=new Map(Object.entries({"profile-pins":()=>t.import("./chunk-profile-pins-element.js"),"insights-graph":()=>t.import("./chunk-insights-graph.js"),"emoji-picker":()=>t.import("./chunk-emoji-picker-element.js")}));function Tt(t){for(const n of e.keys())customElements.get(n)?e.delete(n):(t.querySelector(n)||t.matches(n))&&(e.get(n)(),e.delete(n))}function qt(){Tt(document.body);new MutationObserver((t=>{if(e.size)for(const e of t)for(const t of e.addedNodes)t instanceof Element&&Tt(t)})).observe(document,{subtree:!0,childList:!0})}"interactive"===document.readyState||"complete"===document.readyState?qt():document.addEventListener("DOMContentLoaded",qt);let At=class GitCloneHelpElement extends HTMLElement{updateURL(e){const t=e.currentTarget,n=t.getAttribute("data-url")||"";if(this.helpField.value=n,t.matches(".js-git-protocol-clone-url"))for(const o of this.helpTexts)o.textContent=n;for(const o of this.cloneURLButtons)o.classList.remove("selected");t.classList.add("selected")}};n([o],At.prototype,"helpField",void 0),n([s],At.prototype,"helpTexts",void 0),n([s],At.prototype,"cloneURLButtons",void 0),At=n([r],At);const xt=new IntersectionObserver((e=>{for(const t of e){const e=(t.target.getAttribute("toggle-class")||"").split(" ");0!==e.length&&(t.isIntersecting&&t.intersectionRatio>=t.target.intersectionRatio?t.target.classList.add(...e):t.target.classList.remove(...e))}}),{root:null,rootMargin:"0px",threshold:[.1,.2,.3,.4,.5]});class InViewportElement extends HTMLElement{connectedCallback(){xt.observe(this)}get intersectionRatio(){return(Number(this.getAttribute("threshold"))||10)/100}}window.customElements.get("in-viewport")||(window.InViewportElement=InViewportElement,window.customElements.define("in-viewport",InViewportElement));let Mt=class NotificationIndicatorElement extends HTMLElement{constructor(){super(),this.addEventListener("socket:message",this.update.bind(this))}update(e){const t=e.detail.data;this.link.setAttribute("aria-label",t.aria_label),this.link.setAttribute("data-ga-click",t.ga_click),this.modifier.setAttribute("class",t.span_class)}};n([o],Mt.prototype,"link",void 0),n([o],Mt.prototype,"modifier",void 0),Mt=n([r],Mt);let Ct=class NotificationsListSubscriptionFormElement extends HTMLElement{async submitCustomForm(e){await this.submitForm(e),this.closeMenu()}async submitForm(e){e.preventDefault(),K();const t=e.currentTarget,n=new FormData(t),o=await self.fetch(t.action,{method:t.method,body:n,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!o.ok)return void J();const s=await o.json(),r=n.get("do");"string"==typeof r&&this.updateCheckedState(r),"string"==typeof r&&this.updateMenuButtonCopy(r),this.updateSocialCount(s.count),this.applyInputsCheckedPropertiesToAttributesForNextFormReset()}updateMenuButtonCopy(e){this.unwatchButtonCopy.hidden=!("subscribed"===e||"custom"===e),this.stopIgnoringButtonCopy.hidden=!("ignore"===e),this.watchButtonCopy.hidden=!("subscribed"!==e&&"custom"!==e&&"ignore"!==e)}applyInputsCheckedPropertiesToAttributesForNextFormReset(){for(const e of[...this.threadTypeCheckboxes])e.toggleAttribute("checked",e.checked)}updateCheckedState(e){for(const t of this.subscriptionButtons)t.setAttribute("aria-checked",t.value===e?"true":"false");if("custom"===e)this.customButton.setAttribute("aria-checked","true");else{this.customButton.setAttribute("aria-checked","false");for(const e of[...this.threadTypeCheckboxes])G(e,!1)}}updateSocialCount(e){this.socialCount&&(this.socialCount.textContent=e)}openCustomDialog(e){e.preventDefault(),e.stopPropagation(),this.menu.toggleAttribute("hidden",!0),this.customDialog.toggleAttribute("hidden",!1),setTimeout((()=>{var e;null===(e=this.customDialog.querySelector("input[type=checkbox][autofocus]"))||void 0===e||e.focus()}),0)}closeCustomDialog(e){e.preventDefault(),e.stopPropagation(),this.menu.toggleAttribute("hidden",!1),this.customDialog.toggleAttribute("hidden",!0),setTimeout((()=>{this.customButton.focus()}),0)}detailsToggled(){this.menu.toggleAttribute("hidden",!1),this.customDialog.toggleAttribute("hidden",!0)}submitCustom(e){e.preventDefault(),this.details.toggleAttribute("open",!1)}threadTypeCheckboxesUpdated(){const e=!this.threadTypeCheckboxes.some((e=>e.checked));this.customSubmit.disabled=e}closeMenu(){this.details.toggleAttribute("open",!1)}};n([o],Ct.prototype,"details",void 0),n([o],Ct.prototype,"menu",void 0),n([o],Ct.prototype,"customButton",void 0),n([o],Ct.prototype,"customDialog",void 0),n([s],Ct.prototype,"subscriptionButtons",void 0),n([o],Ct.prototype,"socialCount",void 0),n([o],Ct.prototype,"unwatchButtonCopy",void 0),n([o],Ct.prototype,"stopIgnoringButtonCopy",void 0),n([o],Ct.prototype,"watchButtonCopy",void 0),n([s],Ct.prototype,"threadTypeCheckboxes",void 0),n([o],Ct.prototype,"customSubmit",void 0),Ct=n([r],Ct);class PasswordStrengthElement extends HTMLElement{connectedCallback(){this.addEventListener("input",Ht)}disconnectedCallback(){this.removeEventListener("input",Ht)}}function Ht(e){const t=e.currentTarget;if(!(t instanceof PasswordStrengthElement))return;const n=e.target;if(!(n instanceof HTMLInputElement))return;const o=n.form;if(!(o instanceof HTMLFormElement))return;const s=function(e,t){const n={valid:!1,hasMinimumCharacterCount:e.length>=t.minimumCharacterCount,hasMinimumPassphraseLength:0!==t.passphraseLength&&e.length>=t.passphraseLength,hasLowerCase:/[a-z]/.test(e),hasNumber:/\d/.test(e)};return n.valid=n.hasMinimumPassphraseLength||n.hasMinimumCharacterCount&&n.hasLowerCase&&n.hasNumber,n}(n.value,{minimumCharacterCount:Number(t.getAttribute("minimum-character-count")),passphraseLength:Number(t.getAttribute("passphrase-length"))});if(s.valid){n.setCustomValidity("");const e=t.querySelector("dl.form-group");e&&(e.classList.remove("errored"),e.classList.add("successed"))}else n.setCustomValidity(t.getAttribute("invalid-message"));!function(e,t){const n=e.querySelector("[data-more-than-n-chars]"),o=e.querySelector("[data-min-chars]"),s=e.querySelector("[data-number-requirement]"),r=e.querySelector("[data-letter-requirement]"),i=e.getAttribute("error-class").split(" ").filter((e=>e.length>0)),a=e.getAttribute("pass-class").split(" ").filter((e=>e.length>0));for(const c of[n,o,s,r])null==c||c.classList.remove(...i,...a);if(t.hasMinimumPassphraseLength&&n)n.classList.add(...a);else if(t.valid)o.classList.add(...a),s.classList.add(...a),r.classList.add(...a);else{const e=t.hasMinimumCharacterCount?a:i,c=t.hasNumber?a:i,l=t.hasLowerCase?a:i;null==n||n.classList.add(...i),o.classList.add(...e),s.classList.add(...c),r.classList.add(...l)}}(t,s),Y(o)}window.customElements.get("password-strength")||(window.PasswordStrengthElement=PasswordStrengthElement,window.customElements.define("password-strength",PasswordStrengthElement));class PollIncludeFragmentElement extends i{async fetch(e,t=1e3){const n=await super.fetch(e);return 202===n.status?(await new Promise((e=>setTimeout(e,t))),this.fetch(e,1.5*t)):n}}window.customElements.get("poll-include-fragment")||(window.PollIncludeFragmentElement=PollIncludeFragmentElement,window.customElements.define("poll-include-fragment",PollIncludeFragmentElement));class PreciseTimeAgoElement extends a{connectedCallback(){_t.push(this),It||(Pt(),It=window.setInterval(Pt,1e3))}disconnectedCallback(){const e=_t.indexOf(this);-1!==e&&_t.splice(e,1),_t.length||(window.clearInterval(It),It=void 0)}getFormattedDate(){const e=this.date;if(!e)return;const t=(new Date).getTime()-e.getTime(),n=Math.floor(t/1e3),o=Math.floor(n/60),s=Math.floor(o/60),r=Math.floor(s/24),i=n-60*o,a=o-60*s,c=s-24*r;return o<1?this.applyPrecision([n+"s"]):s<1?this.applyPrecision([o+"m",i+"s"]):r<1?this.applyPrecision([s+"h",a+"m",i+"s"]):this.applyPrecision([r+"d",c+"h",a+"m",i+"s"])}applyPrecision(e){const t=Number(this.getAttribute("data-precision")||e.length);return e.slice(0,t).join(" ")}}const _t=[];let It;function Pt(){for(const e of _t)e.textContent=e.getFormattedDate()||""}window.customElements.get("precise-time-ago")||(window.PreciseTimeAgoElement=PreciseTimeAgoElement,window.customElements.define("precise-time-ago",PreciseTimeAgoElement));const Rt=/\s|\(|\[/;function Dt(e,t,n){const o=e.lastIndexOf(t,n-1);if(-1===o)return;if(e.lastIndexOf(" ",n-1)>o)return;const s=e[o-1];if(s&&!Rt.test(s))return;return{word:e.substring(o+t.length,n),position:o+t.length,beginningOfLine:$t(s)}}const $t=e=>void 0===e||/\n/.test(e),Nt=["position:absolute;","overflow:auto;","word-wrap:break-word;","top:0px;","left:-9999px;"],Ot=["box-sizing","font-family","font-size","font-style","font-variant","font-weight","height","letter-spacing","line-height","max-height","min-height","padding-bottom","padding-left","padding-right","padding-top","border-bottom","border-left","border-right","border-top","text-decoration","text-indent","text-transform","width","word-spacing"],Bt=new WeakMap;function Ft(e,t=e.selectionEnd){const{mirror:n,marker:o}=function(e,t){const n=e.nodeName.toLowerCase();if("textarea"!==n&&"input"!==n)throw new Error("expected textField to a textarea or input");let o=Bt.get(e);if(o&&o.parentElement===e.parentElement)o.innerHTML="";else{o=document.createElement("div"),Bt.set(e,o);const t=window.getComputedStyle(e),s=Nt.slice(0);"textarea"===n?s.push("white-space:pre-wrap;"):s.push("white-space:nowrap;");for(let e=0,n=Ot.length;e<n;e++){const n=Ot[e];s.push(`${n}:${t.getPropertyValue(n)};`)}o.style.cssText=s.join(" ")}const s=document.createElement("span");let r,i;if(s.style.cssText="position: absolute;",s.innerHTML="&nbsp;","number"==typeof t){let n=e.value.substring(0,t);n&&(r=document.createTextNode(n)),n=e.value.substring(t),n&&(i=document.createTextNode(n))}else{const t=e.value;t&&(r=document.createTextNode(t))}if(r&&o.appendChild(r),o.appendChild(s),i&&o.appendChild(i),!o.parentElement){if(!e.parentElement)throw new Error("textField must have a parentElement to mirror");e.parentElement.insertBefore(o,e)}return o.scrollTop=e.scrollTop,o.scrollLeft=e.scrollLeft,{mirror:o,marker:s}}(e,t),s=n.getBoundingClientRect(),r=o.getBoundingClientRect();return setTimeout((()=>{n.remove()}),5e3),{top:r.top-s.top,left:r.left-s.left}}const Wt=new WeakMap;class SlashCommandExpander{constructor(e,t){this.expander=e,this.input=t,this.combobox=null,this.menu=null,this.match=null,this.justPasted=!1,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithMenu=!1,t.addEventListener("paste",this.onpaste),t.addEventListener("input",this.oninput),t.addEventListener("keydown",this.onkeydown),t.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}activate(e,t){this.input===document.activeElement&&this.setMenu(e,t)}deactivate(){const e=this.menu,t=this.combobox;return!(!e||!t)&&(this.menu=null,this.combobox=null,e.removeEventListener("combobox-commit",this.oncommit),e.removeEventListener("mousedown",this.onmousedown),t.destroy(),e.remove(),!0)}setMenu(e,t){this.deactivate(),this.menu=t,t.id||(t.id="text-expander-"+Math.floor(1e5*Math.random()).toString()),this.expander.append(t);const n=t.querySelector(".js-slash-command-menu-items");this.combobox=new c(this.input,n||t);const{top:o,left:s}=Ft(this.input,e.position),r=parseInt(window.getComputedStyle(this.input).fontSize);t.style.top=o+r+"px",t.style.left=s+"px",this.combobox.start(),t.addEventListener("combobox-commit",this.oncommit),t.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1)}setValue(e){if(null==e)return;const t=this.match;if(!t)return;const n=this.input.value.substring(0,t.position-t.key.length),o=this.input.value.substring(t.position+t.text.length);let{cursor:s,value:r}=this.replaceCursorMark(e);r=0===(null==r?void 0:r.length)?r:r+" ",this.input.value=n+r+o,this.deactivate(),this.input.focus(),s=n.length+(s||r.length),this.input.selectionStart=s,this.input.selectionEnd=s}replaceCursorMark(e){const t=/%cursor%/gm,n=t.exec(e);return n?{cursor:n.index,value:e.replace(t,"")}:{cursor:null,value:e}}onCommit({target:e}){const t=e;if(!(t instanceof HTMLElement))return;if(!this.combobox)return;const n=this.match;if(!n)return;const o={item:t,key:n.key,value:null};!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:o}))||o.value&&this.setValue(o.value)}onBlur(){this.interactingWithMenu?this.interactingWithMenu=!1:this.deactivate()}onPaste(){this.justPasted=!0}async delay(e){return new Promise((t=>setTimeout(t,e)))}async onInput(){if(this.justPasted)return void(this.justPasted=!1);const e=this.findMatch();if(e){if(this.match=e,await this.delay(this.appropriateDelay(this.match)),this.match!==e)return;const t=await this.notifyProviders(e);if(!this.match)return;t?this.activate(e,t):this.deactivate()}else this.match=null,this.deactivate()}appropriateDelay(e){return e.beginningOfLine||""!==e.text?0:250}findMatch(){const e=this.input.selectionEnd,t=this.input.value;for(const n of this.expander.keys){const o=Dt(t,n,e);if(o)return{text:o.word,key:n,position:o.position,beginningOfLine:o.beginningOfLine}}}async notifyProviders(e){const t=[];if(!this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:e=>t.push(e),text:e.text,key:e.key}})))return;return(await Promise.all(t)).filter((e=>e.matched)).map((e=>e.fragment))[0]}onMousedown(){this.interactingWithMenu=!0}onKeydown(e){"Escape"===e.key&&this.deactivate()&&(e.stopImmediatePropagation(),e.preventDefault())}}class SlashCommandExpanderElement extends HTMLElement{get keys(){const e=this.getAttribute("keys");return e?e.split(" "):[]}connectedCallback(){const e=this.querySelector('input[type="text"], textarea');if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))return;const t=new SlashCommandExpander(this,e);Wt.set(this,t)}disconnectedCallback(){const e=Wt.get(this);e&&(e.destroy(),Wt.delete(this))}setValue(e){const t=Wt.get(this);t&&t.setValue(e)}setMenu(e,t=!1){const n=Wt.get(this);n&&n.match&&(t&&(n.interactingWithMenu=!0),n.setMenu(n.match,e))}closeMenu(){const e=Wt.get(this);e&&e.setValue("")}isLoading(){const e=this.getElementsByClassName("js-slash-command-expander-loading")[0];if(e){const t=e.cloneNode(!0);t.classList.remove("d-none"),this.setMenu(t)}}}window.customElements.get("slash-command-expander")||(window.SlashCommandExpanderElement=SlashCommandExpanderElement,window.customElements.define("slash-command-expander",SlashCommandExpanderElement)),l("deprecatedAjaxSend","[data-remote]",(function(e){e.currentTarget===e.target&&(e.defaultPrevented||e.currentTarget.classList.add("loading"))})),l("deprecatedAjaxComplete","[data-remote]",(function(e){e.currentTarget===e.target&&e.currentTarget.classList.remove("loading")})),u("form.js-ajax-pagination, .js-ajax-pagination form",(async function(e,t){const n=e.closest(".js-ajax-pagination");let o;try{o=await t.html()}catch(s){if(s.response&&404===s.response.status)return void n.remove();throw s}n.replaceWith(o.html),d(e,"page:loaded")}));const zt=new WeakMap;function Ut(e,t){var n,o,s,r,i,a;t.classList.remove("is-loading","successed","errored","warn"),e.classList.remove("is-autocheck-loading","is-autocheck-successful","is-autocheck-errored");const c=t.querySelector("p.note");if(c){const e=zt.get(c);e&&(c.innerHTML=e)}"DL"===t.tagName?(null===(n=t.querySelector("dd.error"))||void 0===n||n.remove(),null===(o=t.querySelector("dd.warning"))||void 0===o||o.remove(),null===(s=t.querySelector("dd.success"))||void 0===s||s.remove()):(null===(r=t.querySelector("div.error"))||void 0===r||r.remove(),null===(i=t.querySelector("div.warning"))||void 0===i||i.remove(),null===(a=t.querySelector("div.success"))||void 0===a||a.remove())}function Vt(e){const t=e.closest("form");if(!t)return;const n=t.querySelector(".js-auto-complete-button");n instanceof HTMLButtonElement&&(n.disabled=!e.value)}m("auto-check",(function(e){const t=e.querySelector("input");if(!t)return;const n=t.closest(".form-group")||e,o=t.form;let s;function r(){return s||(s="input-check-"+(1e4*Math.random()).toFixed(0)),s}const i=t.getAttribute("aria-describedby");t.addEventListener("focusout:delay",(()=>{t.setAttribute("aria-describedby",[s,i].join(" "))}));const a=n.querySelector("p.note");a&&(a.id||(a.id=r()),zt.set(a,a.innerHTML)),e.addEventListener("loadstart",(()=>{Ut(t,n),n.classList.add("is-loading"),t.classList.add("is-autocheck-loading"),Y(o)})),e.addEventListener("loadend",(()=>{n.classList.remove("is-loading"),t.classList.remove("is-autocheck-loading")})),t.addEventListener("auto-check-success",(async e=>{t.classList.add("is-autocheck-successful"),n.classList.add("successed"),Y(o);const{response:s}=e.detail;if(!s)return;const i=await s.text();if(i){if(a instanceof HTMLElement)a.innerHTML=i,Q(a);else{const e=200===s.status,o="DL"===n.tagName?"dd":"div",a=document.createElement(o);a.id=r(),a.classList.add(e?"success":"warning"),a.innerHTML=i,n.append(a),n.classList.add(e?"successed":"warn"),Q(a),e&&(a.hidden=document.activeElement!==t)}d(t,"auto-check-message-updated")}})),t.addEventListener("auto-check-error",(async e=>{t.classList.add("is-autocheck-errored"),n.classList.add("errored"),Y(o);const{response:s}=e.detail;if(!s)return;const i=await s.text();if(a instanceof HTMLElement)a.innerHTML=i||"Something went wrong",Q(a);else{const e="DL"===n.tagName?"dd":"div",t=document.createElement(e);t.id=r(),t.classList.add("error"),t.innerHTML=i||"Something went wrong",n.append(t),Q(t)}})),t.addEventListener("input",(()=>{t.removeAttribute("aria-describedby"),t.value||Ut(t,n)})),t.addEventListener("blur",(()=>{const e=n.querySelector(".success");e&&(e.hidden=!0)})),t.addEventListener("focus",(()=>{const e=n.querySelector(".success");e&&(e.hidden=!1)})),o.addEventListener("reset",(()=>{Ut(t,n)}))})),m("auto-complete",(function(e){e.addEventListener("loadstart",(()=>e.classList.add("is-auto-complete-loading"))),e.addEventListener("loadend",(()=>e.classList.remove("is-auto-complete-loading")))})),m("auto-complete",{constructor:f,initialize:Vt}),l("auto-complete-change","auto-complete",(function(e){Vt(e.currentTarget)}));let Xt=null;function Kt(e){const t=e.target;if(!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))return;const n=t.form;re(n)}l("submit","[data-autosearch-results-container]",(async function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))return;e.preventDefault(),null==Xt||Xt.abort(),t.classList.add("is-sending");const n=new URL(t.action,window.location.origin),o=t.method,s=Z(t);let r=null;"get"===o?n.search=s:r=new FormData(t);const{signal:i}=Xt=new AbortController,a=new Request(n.toString(),{method:o,body:r,signal:i,headers:{Accept:"text/html","X-Requested-With":"XMLHttpRequest"}});let c;try{c=await fetch(a)}catch(d){}if(t.classList.remove("is-sending"),!c||!c.ok||i.aborted)return;const l=t.getAttribute("data-autosearch-results-container"),u=l?document.getElementById(l):null;u&&(u.innerHTML="",u.appendChild(ee(document,await c.text()))),te(null,"","?"+s)})),ne("input[data-autoselect], textarea[data-autoselect]",(async function(e){await oe(),e.select()})),l("change","form[data-autosubmit]",(function(e){const t=e.currentTarget;re(t)})),l("change","input[data-autosubmit], select[data-autosubmit]",Kt);const Jt=h(Kt,300);async function Gt(e){const t=e.getAttribute("data-url")||"";if(await async function(e){const t=e;if(!t)return!1;try{const e=await fetch(t,{headers:{Accept:"application/json"}});if(!e.ok)return!1;return(await e.json()).has_gravatar}catch(n){return!1}}(t)){const t=e.getAttribute("data-gravatar-text");null!=t&&(e.textContent=t)}}m("input[data-throttled-autosubmit]",{subscribe:e=>se(e,"input",Jt)}),m(".js-detect-gravatar",(function(e){Gt(e)}));let Yt=null;async function Qt(e){const t=e.getAttribute("data-item-name")||"items",n=e.value,o=parseInt(e.getAttribute("data-item-minimum"))||0,s=parseInt(e.getAttribute("data-item-maximum"))||300,r=parseInt(e.getAttribute("data-item-count"))||0,i=Math.max(o,parseInt(n)||0),a=i>s,c=document.querySelector(".js-downgrade-button");c instanceof HTMLButtonElement&&(c.disabled=i===r);const l=new URL(e.getAttribute("data-url"),window.location.origin),u=new URLSearchParams(l.search.slice(1));u.append(t,i.toString());document.querySelector(".js-transform-user")&&u.append("transform_user","1"),l.search=u.toString(),null==Yt||Yt.abort();const{signal:d}=Yt=new AbortController;let m=null;try{const e=await fetch(l.toString(),{signal:d,headers:{Accept:"application/json"}});if(!e.ok)return;m=await e.json()}catch(L){}if(d.aborted)return;if(!m)return;const f=document.querySelector(".js-contact-us");f&&f.classList.toggle("d-none",!a);const h=document.querySelector(".js-payment-summary");h&&h.classList.toggle("d-none",a);const p=document.querySelector(".js-submit-billing");p instanceof HTMLElement&&(p.hidden=a);const g=document.querySelector(".js-billing-section");g&&g.classList.toggle("has-removed-contents",m.free||m.is_enterprise_cloud_trial);const b=document.querySelector(".js-upgrade-info");b&&b.classList.toggle("d-none",i<=0);const y=document.querySelector(".js-downgrade-info");y&&y.classList.toggle("d-none",i>=0);const v=document.querySelector(".js-extra-seats-line-item");v&&v.classList.toggle("d-none",m.no_additional_seats);document.querySelector(".js-seat-field")&&function(e){for(const t of document.querySelectorAll(".js-seat-field"))t.value=e}(n);const w=document.querySelector(".js-minimum-seats-disclaimer");w&&(w.classList.toggle("tooltipped",5===m.seats),w.classList.toggle("tooltipped-nw",5===m.seats));const j=m.selectors;for(const S in j)for(const e of document.querySelectorAll(S))e.innerHTML=j[S];te(ce(),"",m.url)}l("click",".js-org-signup-duration-change",(e=>{e.preventDefault();const t=e.currentTarget.getAttribute("data-plan-duration");!function(e){const t="year"===e?"month":"year";for(const n of document.querySelectorAll(".js-plan-duration-text"))n.innerHTML=e;for(const n of document.querySelectorAll(".unstyled-available-plan-duration-adjective"))n.innerHTML=e+"ly";for(const n of document.querySelectorAll(".js-org-signup-duration-change"))n.setAttribute("data-plan-duration",t)}(t),function(e){for(const t of document.querySelectorAll(".js-seat-field")){const n=new URL(t.getAttribute("data-url"),window.location.origin),o=new URLSearchParams(n.search.slice(1));o.delete("plan_duration"),o.append("plan_duration",e),n.search=o.toString(),t.setAttribute("data-url",n.toString())}}(t);for(const n of document.querySelectorAll(".js-seat-field"))Qt(n);!function(){for(const e of document.querySelectorAll(".js-unit-price"))e.hidden=!e.hidden}()})),m(".js-addon-purchase-field",{constructor:HTMLInputElement,add(e){ie(e)&&Qt(e),ae(e,(function(){Qt(e)}))}}),m(".js-addon-downgrade-field",{constructor:HTMLSelectElement,add(e){ie(e)&&Qt(e),e.addEventListener("change",(function(){Qt(e)}))}}),l("details-menu-selected",".js-organization-container",(function(e){const t=document.querySelector(".js-addon-purchase-field"),n=e.target.querySelector("input:checked");if(t instanceof HTMLInputElement&&n instanceof HTMLInputElement){const e=n.getAttribute("data-upgrade-url");e&&(t.setAttribute("data-url",e),t.value="0",Qt(t))}}),{capture:!0}),le(".js-csv-filter-field",(function(e){const t=e.target.value.toLowerCase();for(const n of document.querySelectorAll(".js-csv-data tbody tr"))n instanceof HTMLElement&&n.textContent&&(n.hidden=!!t&&!n.textContent.toLowerCase().includes(t))}));let Zt=!1;function en(e,t){return document.querySelector(`#${e}LC${t}`)}function tn({blobRange:e,anchorPrefix:t}){if(0!==document.querySelectorAll(".js-file-line").length&&(function(){for(const e of document.querySelectorAll(".js-file-line.highlighted"))e.classList.remove("highlighted");for(const e of document.querySelectorAll(".js-file-line .highlighted")){const t=e.closest(".js-file-line");e.replaceWith(...e.childNodes),t.normalize()}}(),e))if(null===e.start.column||null===e.end.column)for(let n=e.start.line;n<=e.end.line;n+=1){const e=en(t,n);e&&e.classList.add("highlighted")}else if(e.start.line===e.end.line&&null!=e.start.column&&null!=e.end.column){const n=he(e,(e=>en(t,e)));if(n){const e=document.createElement("span");e.classList.add("highlighted"),pe(n,e)}}}function nn(){const e=de(window.location.hash);tn(e),function(){const e=document.querySelector(".js-file-line-actions");if(!e)return;const t=document.querySelectorAll(".js-file-line.highlighted"),n=t[0];if(n){!function(e){const t=[];for(const o of e)t.push(o.textContent);const n=document.getElementById("js-copy-lines");if(n instanceof p){n.textContent="Copy "+(1===e.length?"line":"lines"),n.value=t.join("\n");const o="Blob, copyLines, numLines:"+e.length.toString();n.setAttribute("data-ga-click",o)}}(t),function(e){const t=document.getElementById("js-view-git-blame");if(!t)return;t.setAttribute("data-ga-click","Blob, viewGitBlame, numLines:"+e.toString())}(t.length);const o=function(e){const t=document.querySelector(".js-permalink-shortcut");if(t instanceof HTMLAnchorElement){const n=`${t.href}${window.location.hash}`,o=document.getElementById("js-copy-permalink");if(o instanceof p){o.value=n;const t="Blob, copyPermalink, numLines:"+e.toString();o.setAttribute("data-ga-click",t)}return n}}(t.length);o&&function(e,t){const n=document.getElementById("js-new-issue");if(n instanceof HTMLAnchorElement){if(!n.href)return;const o=new URL(n.href,window.location.origin),s=new URLSearchParams(o.search.slice(1));s.set("permalink",e),o.search=s.toString(),n.href=o.toString(),n.setAttribute("data-ga-click","Blob, newIssue, numLines:"+t.toString())}}(o,t.length),e.style.top=n.offsetTop-2+"px",e.classList.remove("d-none")}else e.classList.add("d-none")}();const{blobRange:t,anchorPrefix:n}=e,o=t&&en(n,t.start.line);if(!Zt&&o){o.scrollIntoView();o.closest(".blob-wrapper, .js-blob-wrapper").scrollLeft=0}Zt=!1}ue((function(){if(document.querySelector(".js-file-line-container")){setTimeout(nn,0);const e=window.location.hash;for(const t of document.querySelectorAll(".js-update-url-with-hash"))if(t instanceof HTMLAnchorElement)t.hash=e;else if(t instanceof HTMLFormElement){const n=new URL(t.action,window.location.origin);n.hash=e,t.action=n.toString()}}})),l("click",".js-line-number",(function(e){const t=de(e.currentTarget.id),{blobRange:n}=t,o=me(window.location.hash);o&&e.shiftKey&&(t.blobRange={start:o.start,end:n.end}),function(e){const t=window.scrollY;Zt=!0,e(),window.scrollTo(0,t)}((()=>{window.location.hash=fe(t)}))})),l("submit",".js-jump-to-line-form",(function(e){const t=e.currentTarget.querySelector(".js-jump-to-line-field").value.replace(/[^\d-]/g,"").split("-").map((e=>parseInt(e,10))).filter((e=>e>0)).sort(((e,t)=>e-t));t.length&&(window.location.hash="L"+t.join("-L")),e.preventDefault()}));let on,sn=null;function rn(e){const t=document.querySelector(".js-membership-tabs");if(t){const n=e.querySelectorAll(".js-bulk-actions-toggle:checked");t.classList.toggle("d-none",n.length>0)}}function an(e,t){try{return window.localStorage.setItem(e,JSON.stringify(t)),{kind:"ok",value:null}}catch(n){return{kind:"err",value:n}}}function cn(){const e=function(){const e={};for(const t of document.getElementsByTagName("script")){const n=t.src.match(/\/([\w-]+)-[0-9a-f]{8,}\.js$/);n&&(e[n[1]+".js"]=t.src)}for(const t of document.getElementsByTagName("link")){const n=t.href.match(/\/([\w-]+)-[0-9a-f]{8,}\.css$/);n&&(e[n[1]+".css"]=t.href)}return e}(),t=function(e){try{const t=window.localStorage.getItem(e);return{kind:"ok",value:t?JSON.parse(t):null}}catch(t){return{kind:"err",value:t}}}("bundle-urls");if("err"===t.kind)return void an("bundle-urls",e);const n=t.value||{},o=Object.keys(e).filter((t=>n[t]!==e[t]));if(o.length){"ok"===an("bundle-urls",Object.assign(Object.assign({},n),e)).kind&&be({downloadedBundles:o})}}l("change",".js-bulk-actions-toggle",(function(e){const t=e.currentTarget.closest(".js-bulk-actions-container");d(t,"bulk-actions:update")})),l("bulk-actions:update",".js-bulk-actions-container",h((async function(e){const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.querySelector(".js-bulk-actions"),o=!!t.querySelector(".js-bulk-actions-toggle:checked");null==sn||sn.abort();const{signal:s}=sn=new AbortController;let r="";try{const e=await fetch(function(e){const t=new URL(e.getAttribute("data-bulk-actions-url"),window.location.origin),n=new URLSearchParams(t.search.slice(1)),o=e.getAttribute("data-bulk-actions-parameter"),s=Array.from(e.querySelectorAll(".js-bulk-actions-toggle:checked"));if(o){const e=s.map((e=>e.closest(".js-bulk-actions-item").getAttribute("data-bulk-actions-id"))).sort();for(const t of e)n.append(o+"[]",t)}else for(const r of s.sort(((e,t)=>e.value>t.value?1:-1)))n.append(r.name,r.value);return t.search=n.toString(),t.toString()}(t),{signal:s,headers:{"X-Requested-With":"XMLHttpRequest"}});if(!e.ok)return;r=await e.text()}catch(i){}s.aborted||r&&(o?(rn(t),n.innerHTML=r):(n.innerHTML=r,rn(t)),d(t,"bulk-actions:updated"))}),100)),(async()=>{await ge,window.requestIdleCallback(cn)})();let ln=!1;function un(){on=document.activeElement,document.body&&document.body.classList.toggle("intent-mouse",ln)}function dn(e){e.preventDefault(),e.stopPropagation()}document.addEventListener("mousedown",(function(){ln=!0,on===document.activeElement&&un()}),{capture:!0}),document.addEventListener("keydown",(function(){ln=!1}),{capture:!0}),document.addEventListener("focusin",un,{capture:!0}),m("a.btn.disabled",{subscribe:e=>se(e,"click",dn)}),m(".js-check-all-container",{constructor:HTMLElement,subscribe:g});function mn(e){const t=e.querySelector(".js-clipboard-clippy-icon"),n=e.querySelector(".js-clipboard-check-icon");e.classList.toggle("ClipboardButton--success"),t&&t.classList.toggle("d-none"),n&&n.classList.toggle("d-none")}l("clipboard-copy","[data-copy-feedback]",(e=>{const t=e.currentTarget,n=t.getAttribute("data-copy-feedback"),o=t.getAttribute("aria-label"),s=t.getAttribute("data-tooltip-direction")||"s";t.setAttribute("aria-label",n),t.classList.add("tooltipped","tooltipped-"+s),t instanceof HTMLElement&&(Q(t),setTimeout((()=>{o?t.setAttribute("aria-label",o):t.removeAttribute("aria-label"),t.classList.remove("tooltipped","tooltipped-"+s)}),2e3))})),l("clipboard-copy",".js-clipboard-copy",(function({currentTarget:e}){e instanceof HTMLElement&&(mn(e),setTimeout(mn,2e3,e))})),m(".js-file-line-container, .js-code-block-container",{constructor:HTMLElement,subscribe(e){const t=document.querySelector(".js-tagsearch-popover");if(!(t instanceof HTMLElement))return{unsubscribe(){}};const n=t.querySelector(".js-tagsearch-popover-content"),o=new WeakMap,s=new WeakMap;let r;async function i(n){const r=function(e,t,n){let o,s;if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t,n);e&&(o=e.offsetNode,s=e.offset)}else if(document.caretRangeFromPoint){const e=document.caretRangeFromPoint(t,n);e&&(o=e.startContainer,s=e.startOffset)}if(!o||"number"!=typeof s||o.nodeType!==Node.TEXT_NODE)return;const r=o.textContent;if(!r)return null;const i=function(e,t,n){let o;for(;o=t.exec(e);){const e=o.index+o[0].length;if(o.index<=n&&n<e)return[o[0],o.index,e]}return null}(r,e,s);if(!i)return null;const a=document.createRange();return a.setStart(o,i[1]),a.setEnd(o,i[2]),a}(/\w+[!?]?/g,n.clientX,n.clientY);if(!r)return;const i=r.commonAncestorContainer.parentElement;for(const e of i.classList)if(["pl-token","pl-c","pl-s","pl-k"].includes(e))return;const a=r.toString();if(!a||a.match(/\n|\s|[();&.=",]/))return;let l=s.get(i);if(l||(l=new Set,s.set(i,l)),l.has(a))return;l.add(a);let u=t.getAttribute("data-tagsearch-lang");if("HTML+ERB"===u){if(!i.closest(".pl-sre"))return;u="Ruby"}if(e.classList.contains("js-code-block-container")&&(u=function(e){const t=e.closest(".highlight");if(t)for(const n of t.classList)switch(n){case"highlight-source-go":return"Go";case"highlight-source-js":return"JavaScript";case"highlight-source-python":return"Python";case"highlight-source-ruby":return"Ruby";case"highlight-source-ts":return"TypeScript"}return null}(i),!u))return;const d=function(e){let t=e.startContainer,n=e.startOffset;for(;;){let e=t.previousSibling;for(;e;)n+=(e.textContent||"").length,e=e.previousSibling;const o=t.parentElement;if(!o)return[0,0];if(o.classList.contains("js-file-line")){const e=o.previousElementSibling;if(!e.classList.contains("js-line-number"))throw new Error("invariant");return[parseInt(e.getAttribute("data-line-number")||"1",10)-1,n]}t=o}}(r),m=await async function(e,t,n,o){const s=e.getAttribute("data-tagsearch-url"),r=e.getAttribute("data-tagsearch-path"),i=e.getAttribute("data-tagsearch-ref"),a=new URL(s,window.location.origin),c=new URLSearchParams;c.set("q",t),c.set("blob_path",r),c.set("ref",i),c.set("language",n),c.set("row",o[0].toString()),c.set("col",o[1].toString()),a.search=c.toString();const l=await fetch(a.toString(),{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!l.ok)return"";const u=await l.text();return/js-tagsearch-no-definitions/.test(u)?"":u}(t,a,u,d);if(!m)return;const f=document.createElement("span");f.classList.add("pl-token"),f.addEventListener("click",c),f.setAttribute("data-hydro-click",t.getAttribute("data-hydro-click")),f.setAttribute("data-hydro-click-hmac",t.getAttribute("data-hydro-click-hmac")),o.set(f,m),r.surroundContents(f)}function a(){n.scrollTop=0}function c(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const s=e.currentTarget;s===r?u():(function(e){r&&r.classList.remove("active");r=e,r.classList.add("active"),n.innerHTML=o.get(e)||"",l(e)}(s),function(){if(!t.hidden)return void a();t.hidden=!1,a(),document.addEventListener("click",m),document.addEventListener("keyup",f),window.addEventListener("resize",d)}()),e.preventDefault()}function l(e){const n=e.getClientRects()[0]||{bottom:0,left:0};t.style.position="absolute",t.style.top=window.scrollY+n.bottom+7+"px",t.style.left=window.scrollX+n.left+"px"}function u(){t.hidden||(t.hidden=!0,r&&r.classList.remove("active"),r=void 0,document.removeEventListener("click",m),document.removeEventListener("keyup",f),window.removeEventListener("resize",d))}function d(){r instanceof HTMLElement&&l(r)}function m(e){const{target:n}=e;n instanceof Node&&(t.contains(n)||r.contains(n)||u())}function f(e){switch(e.key){case"Escape":u()}}return e.addEventListener("mousemove",i),{unsubscribe(){e.removeEventListener("mousemove",i)}}}});const fn={}.hasOwnProperty,hn={host:"",type:"page_view",dimensions:{},measures:{},context:{},actor:{},image:new Image,performance:{},expectedPerformanceTimingKeys:["connectEnd","connectStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domainLookupEnd","domainLookupStart","fetchStart","loadEventEnd","loadEventStart","navigationStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","unloadEventEnd","unloadEventStart"],recordPageView(){return this.applyMetaTags(),null!=this.app&&(null==this.host?(console&&console.warn&&console.warn("Host not set, you are doing something wrong"),!1):(this.image.src=this._src(),this._clearPerformance(),!0))},setHost(e){this.host=e},setApp(e){this.app=e},setDimensions(e){this.dimensions=e},addDimensions(e){let t;null==this.dimensions&&(this.dimensions={});const n=[];for(t in e){if(!fn.call(e,t))continue;const o=e[t];n.push(this.dimensions[t]=o)}return n},setMeasures(e){this.measures=e},addMeasures(e){let t;null==this.measures&&(this.measures={});const n=[];for(t in e){if(!fn.call(e,t))continue;const o=e[t];n.push(this.measures[t]=o)}return n},setContext(e){this.context=e},addContext(e){let t;null==this.context&&(this.context={});const n=[];for(t in e){if(!fn.call(e,t))continue;const o=e[t];n.push(this.context[t]=o)}return n},setActor(e){this.actor=e},push(e){return this.applyCall(e)},enablePerformance(){this.performance=this._performanceTiming()},_recordSrc(e,t,n,o){return`//${this.host}/${this.app}/${e}?${this._queryString(t,n,o)}`},_src(){return`//${this.host}/${this.app}/${this.type}?${this._queryString()}`},_queryString(e,t,n){let o,s;const r=this._params(),i=[];for(o in r)s=r[o],i.push(`dimensions[${o}]=${s}`);return i.push(this._encodeObject("dimensions",Object.assign({},this.dimensions,e))),i.push(this._encodeObject("measures",Object.assign({},this.measures,t))),null!=this.performance&&i.push(this._encodeObject("measures",{performance_timing:String(this.performance)})),i.push(this._encodeObject("context",Object.assign({},this.context,n))),i.push(this._actor()),i.push(this._encodeObject("dimensions",{cid:this._clientId()})),i.join("&")},_clearPerformance(){this.performance=null},_performanceTiming(){if(null==window.performance||null==window.performance.timing||null==window.performance.timing.navigationStart)return null;const e=this.expectedPerformanceTimingKeys.reduce(((e,t)=>{const n=window.performance.timing[t];return e[t]="number"==typeof n?n:0,e}),{}),t=[],n=e.navigationStart;for(const o in e){const s=e[o],r=0===s?null:s-n;t.push(r)}return"1-"+t.join("-")},_params(){return{page:this._encode(this._page()),title:this._encode(this._title()),referrer:this._encode(this._referrer()),user_agent:this._encode(this._agent()),screen_resolution:this._encode(this._screenResolution()),pixel_ratio:this._encode(this._pixelRatio()),browser_resolution:this._encode(this._browserResolution()),tz_seconds:this._encode(this._tzSeconds()),timestamp:(new Date).getTime()}},_page(){try{const e=document.querySelector("meta[name=octolytics-location]");return e instanceof HTMLMetaElement?document.location.origin+e.content:document.location.href}catch(e){}},_title(){try{return document.title}catch(e){}},_referrer(){let e="";try{e=window.top.document.referrer}catch(t){if(window.parent)try{e=window.parent.document.referrer}catch(t){}}return""===e&&(e=document.referrer),e},_agent(){try{return navigator.userAgent}catch(e){}},_screenResolution(){try{return`${screen.width}x${screen.height}`}catch(e){return"unknown"}},_pixelRatio:()=>window.devicePixelRatio,_browserResolution(){let e=0,t=0;try{return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):null!=document.documentElement&&null!=document.documentElement.clientWidth?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):null!=document.body&&null!=document.body.clientWidth&&(t=document.body.clientWidth,e=document.body.clientHeight),`${t}x${e}`}catch(n){return"unknown"}},_tzSeconds(){try{return-60*(new Date).getTimezoneOffset()}catch(e){return""}},_encodeObject(e,t){const n=[];if(Array.isArray(t))for(const o of t)n.push(this._encodeObject(e+"[]",o));else if("object"==typeof t)for(const o in t)n.push(this._encodeObject(`${e}[${o}]`,t[o]));else n.push(`${e}=${this._encode(t)}`);return n.join("&")},_actor(){let e,t,n;const o=[],s=this.actor;for(t in s){const r=s[t],i=`dimensions[actor_${t}]`;if(Array.isArray(r))for(e=0,n=r.length;e<n;e++){const t=r[e];o.push(`${i}[]=${this._encode(t)}`)}else o.push(`${i}=${this._encode(r)}`)}return o.join("&")},_clientId(){let e=ye();return""===e&&(e=ve()),e},_encode:e=>null!=e?window.encodeURIComponent(e):"",applyQueuedCalls(e){const t=[];for(const n of e)t.push(this.applyCall(n));return t},applyCall(e){const t=e[0],n=e.slice(1);return"function"==typeof this[t]?this[t](...n):console&&console.warn&&console.warn(t+" is not a valid method")},applyMetaTags(){const e=this.loadMetaTags();return e.host&&this.setHost(e.host),e.app&&this.setApp(e.app),this._objectIsEmpty(e.actor)||this.setActor(e.actor),this.addDimensions(e.dimensions),this.addMeasures(e.measures),this.addContext(e.context)},loadMetaTags(){let e,t;const n={dimensions:{},measures:{},context:{},actor:{}},o=document.getElementsByTagName("meta");for(e=0,t=o.length;e<t;e++){const t=o[e];if(t.name&&t.content){const e=t.name.match(this.octolyticsMetaTagName);if(e)switch(e[1]){case"host":n.host=t.content;break;case"app-id":case"app":n.app=t.content;break;case"dimension":this._addField(n.dimensions,e[2],t);break;case"measure":this._addField(n.measures,e[2],t);break;case"context":this._addField(n.context,e[2],t);break;case"actor":this._addField(n.actor,e[2],t)}}}const s=document.querySelector("meta[name=visitor-payload]");if(s instanceof HTMLMetaElement){const e=JSON.parse(atob(s.content));this.addDimensions(e)}return n},_addField(e,t,n){e[t]=n.content},_objectIsEmpty(e){let t;for(t in e)if(fn.call(e,t))return!1;return!0},octolyticsMetaTagName:/^octolytics-(host|app-id|app|dimension|measure|context|actor)-?(.*)/};if(window._octo){if(window._octo.slice){const e=window._octo.slice(0);window._octo=hn,window._octo.applyQueuedCalls(e)}}else window._octo=hn;function pn(e){let t=!0,n="dark";"true"===e.getAttribute("aria-checked")&&(t=!1,n="light"),e.setAttribute("aria-checked",String(t)),jn(n);const o=document.querySelector(".js-promo-color-modes-wrapper");o&&o.setAttribute("data-color-mode-unset","false");const s=document.querySelector(".js-promo-color-modes-banner-popover");s&&"dark"===n&&setTimeout((()=>{s.removeAttribute("hidden"),setTimeout((()=>s.classList.add("shown")),100)}),3500);const r=document.querySelector(".js-promo-color-modes-banner-profile.isInitialToggle");r&&r.classList.remove("isInitialToggle");const i=document.querySelector(".js-promo-color-modes-form"),a=new FormData(i);a.set("color_mode",n),fetch(i.action,{method:i.method,body:a,headers:{"X-Requested-With":"XMLHttpRequest"}})}let gn,bn,yn,vn,wn;function jn(e){const t=document.querySelector("html[data-color-mode]");t&&t.setAttribute("data-color-mode",e)}function Ln(){const e=document.querySelector("html[data-color-mode]");if(!e)return;const t=e.getAttribute("data-color-mode");return"auto"===t?function(){if(Sn("dark"))return"dark";if(Sn("light"))return"light";return}():t}function Sn(e){return window.matchMedia&&window.matchMedia(`(prefers-color-scheme: ${e})`).matches}!async function(){await we;const e=document.querySelector(".js-promo-color-modes-toggle");if(e&&"auto"===function(){const e=document.querySelector("html[data-color-mode]");if(!e)return;return e.getAttribute("data-color-mode")}()){"dark"===Ln()&&e.setAttribute("aria-checked","true")}}(),async function(){await we;document.querySelector(".js-color-mode-settings")&&window.history.replaceState({},document.title,document.URL.split("?")[0])}(),l("submit",".profile-color-modes .js-notice-dismiss",(()=>{const e=document.querySelector(".js-promo-color-modes-banner-popover");e&&e.classList.remove("shown")})),l("click",".js-promo-color-modes-toggle",(e=>{pn(e.currentTarget)})),je("keydown",".js-promo-color-modes-toggle",(e=>{if("Space"===e.code||"Enter"===e.code){e.preventDefault();pn(e.currentTarget)}})),m(".js-promo-color-modes-banner",(()=>{gn=document.querySelector(".js-promo-color-modes-banner"),bn=document.querySelector(".js-promo-color-modes-toggle"),yn=document.querySelector(".js-promo-color-modes-thumb");let e=!1;function t(){"dark"!==Ln()&&yn.classList.add("anim-wiggle")}document.querySelector('[data-color-mode-unset="true"]')&&setTimeout((()=>{vn||t()}),2e3),gn.addEventListener("mouseenter",(()=>{e=!0,vn=!0,t()})),gn.addEventListener("mouseleave",(()=>{vn=!1})),yn.addEventListener("animationend",(()=>{yn.classList.remove("anim-wiggle"),vn?wn=setTimeout((()=>{vn&&t()}),2e3):e||(e=!0,setTimeout(t,2e3))})),bn.addEventListener("mouseenter",(()=>{vn=!1,clearTimeout(wn),yn.style.transform=window.getComputedStyle(yn).transform,yn.classList.remove("anim-wiggle"),setTimeout((()=>yn.style.transform=""),50)}))})),l("change",".js-color-mode-settings input[type=radio]",(async e=>{jn(e.currentTarget.value)})),l("submit",".js-color-mode-settings",(async e=>{e.preventDefault();const t=e.currentTarget,n=new FormData(t);fetch(t.action,{method:t.method,body:n,headers:{"X-Requested-With":"XMLHttpRequest"}})})),l("submit",".js-color-mode-keyboard-toggle",(async e=>{e.preventDefault();const t=Ln();if(!t)return;const n="light"===t?"dark":"light";jn(n);const o=e.currentTarget,s=new FormData(o);s.set("color_mode",n),fetch(o.action,{method:o.method,body:s,headers:{"X-Requested-With":"XMLHttpRequest"}})})),l("click",".errored.js-remove-error-state-on-click",(function({currentTarget:e}){e.classList.remove("errored")})),u(".js-new-comment-form",(async function(e,t){let n;!function(e){const t=e.querySelector(".js-comment-form-error");t instanceof HTMLElement&&(t.hidden=!0)}(e);try{n=await t.json()}catch(r){!function(e,t){let n="You can't comment at this time";if(t.response&&422===t.response.status){const e=t.response.json;e.errors&&(Array.isArray(e.errors)?n+=" — your comment "+e.errors.join(", "):n=e.errors)}n+=". ";const o=e.querySelector(".js-comment-form-error");if(o instanceof HTMLElement){o.textContent=n,o.hidden=!1;const e=o.closest("div.form-group.js-remove-error-state-on-click");e&&e.classList.add("errored")}}(e,r)}if(!n)return;e.reset();for(const i of e.querySelectorAll(".js-resettable-field"))G(i,i.getAttribute("data-reset-value")||"");const o=e.querySelector(".js-write-tab");o instanceof HTMLElement&&o.click();const s=n.json.updateContent;for(const i in s){const e=s[i],t=document.querySelector(i);t instanceof HTMLElement?Le(t,e):console.warn(`couldn't find ${i} for immediate update`)}d(e,"comment:success")}));m(".js-comment-and-button",{constructor:HTMLButtonElement,initialize(e){const t=e.form.querySelector(".js-comment-field"),n=(e=>{let t;return n=>{const o=n.currentTarget.value.trim();o!==t&&(t=o,((e,t)=>{const n=e.querySelector(".js-form-action-text")||e;n.textContent=t?e.getAttribute("data-comment-text"):n.getAttribute("data-default-action-text")})(e,Boolean(o)))}})(e);return{add(){t.addEventListener("input",n),t.addEventListener("change",n)},remove(){t.removeEventListener("input",n),t.removeEventListener("change",n)}}}});let kn=[];function En(e){const t=e.querySelector("ol");if(t){t.innerHTML="";const e=kn.map((e=>{const t=document.createElement("li");return t.textContent=e,t}));for(const n of e)t.appendChild(n)}e.hidden=!1}function Tn(e,t){const n=e.closest(".js-write-bucket");n&&n.classList.toggle("focused",t)}function qn(e){const t=e.currentTarget;t instanceof Element&&Tn(t,!1)}l("click",".js-comment-edit-button",(function(e){var t;const n=e.currentTarget.closest(".js-comment");n.classList.add("is-comment-editing");const o=n.querySelector("#subtasks");o&&(o.classList.add("is-comment-editing"),null===(t=n.querySelector(".js-comment-form-actions"))||void 0===t||t.remove()),n.querySelector(".js-write-tab").click();const s=n.querySelector(".js-comment-field");s.focus(),d(s,"change");const r=e.currentTarget.closest(".js-dropdown-details");r&&r.removeAttribute("open")})),l("click",".js-comment-hide-button",(function(e){const t=e.currentTarget.closest(".js-comment").querySelector(".js-minimize-comment");t&&t.classList.remove("d-none");const n=e.currentTarget.closest(".js-dropdown-details");n&&n.removeAttribute("open")})),l("click",".js-comment-hide-minimize-form",(function(e){e.currentTarget.closest(".js-minimize-comment").classList.add("d-none")})),l("click",".js-comment-cancel-button",(function(e){const t=e.currentTarget.closest("form"),n=e.currentTarget.getAttribute("data-confirm-text");if(Se(t)&&!confirm(n))return!1;for(const s of t.querySelectorAll("input, textarea")){const e=s;e.value=e.defaultValue,e.classList.contains("session-resumable-canceled")&&(e.classList.add("js-session-resumable"),e.classList.remove("session-resumable-canceled"))}const o=e.currentTarget.closest(".js-comment");o&&o.classList.remove("is-comment-editing")})),l("click",".js-cancel-issue-edit",(function(e){e.currentTarget.closest(".js-details-container").querySelector(".js-comment-form-error").hidden=!0})),u(".js-comment-delete, .js-comment .js-comment-update, .js-issue-update, .js-comment-minimize, .js-comment-unminimize",(function(e,t,n){const o=e.closest(".js-comment");o.classList.add("is-comment-loading");const s=o.getAttribute("data-body-version");s&&n.headers.set("X-Body-Version",s)})),u(".js-comment .js-comment-update",(async function(e,t){let n;const o=e.closest(".js-comment"),s=o.querySelector(".js-comment-update-error"),r=o.querySelector(".js-comment-body-error");s instanceof HTMLElement&&(s.hidden=!0),r instanceof HTMLElement&&(r.hidden=!0),kn=[];try{n=await t.json()}catch(d){if(422!==d.response.status)throw d;{const e=JSON.parse(d.response.text);if(e.errors)return void(s instanceof HTMLElement&&(s.textContent="There was an error posting your comment: "+e.errors.join(", "),s.hidden=!1))}}if(!n)return;const i=n.json;i.errors&&i.errors.length>0&&(kn=i.errors,En(r));const a=o.querySelector(".js-comment-body");a&&i.body&&(a.innerHTML=i.body);const c=o.querySelector("#subtasks");c&&(c.classList.remove("is-comment-editing"),o.classList.remove("is-dirty")),o.setAttribute("data-body-version",i.newBodyVersion);const l=o.querySelector(".js-body-version");l instanceof HTMLInputElement&&(l.value=i.newBodyVersion);for(const m of o.querySelectorAll("input, textarea")){const e=m;e.defaultValue=e.value}o.classList.remove("is-comment-stale","is-comment-editing");const u=o.querySelector(".js-comment-edit-history");if(u){const e=await ke(document,i.editUrl);u.innerHTML="",u.append(e)}})),m(".js-comment-body-error",{add:e=>{kn&&kn.length>0&&En(e)}}),u(".js-comment .js-comment-delete, .js-comment .js-comment-update, .js-comment-minimize, .js-comment-unminimize",(async function(e,t){const n=e.closest(".js-comment");try{await t.text()}catch(o){if(422!==o.response.status)throw o;{let e;try{e=JSON.parse(o.response.text)}catch(s){}e&&e.stale&&n.classList.add("is-comment-stale")}}n.classList.remove("is-comment-loading")})),u(".js-discussion-comment-unminimize, .js-discussion-comment-minimize",(async function(e,t){const n=e.closest(".js-discussion-comment"),o=n.querySelector(".js-discussion-comment-error");o&&(o.hidden=!0);try{const e=await t.html();n.replaceWith(e.html)}catch(s){if(!(s.response.status>=400&&s.response.status<500))throw s;if(s.response.html){const e=s.response.html.querySelector(".js-discussion-comment").getAttribute("data-error");o instanceof HTMLElement&&(o.textContent=e,o.hidden=!1)}}})),u(".js-comment-delete",(async function(e,t){await t.json();let n=e.closest(".js-comment-delete-container");n||(n=e.closest(".js-comment-container")||e.closest(".js-line-comments"),n&&1!==n.querySelectorAll(".js-comment").length&&(n=e.closest(".js-comment"))),n.remove()})),u(".js-issue-update",(async function(e,t){var n,o,s;const r=e.closest(".js-details-container"),i=r.querySelector(".js-comment-form-error");let a;try{a=await t.json()}catch(l){i.textContent=(null===(s=null===(o=null===(n=l.response)||void 0===n?void 0:n.json)||void 0===o?void 0:o.errors)||void 0===s?void 0:s[0])||"Something went wrong. Please try again.",i.hidden=!1}if(!a)return;r.classList.remove("open"),i.hidden=!0;const c=a.json;if(null!=c.issue_title){r.querySelector(".js-issue-title").textContent=c.issue_title;const e=r.closest(".js-issues-results");if(e){if(e.querySelector(".js-merge-pr.is-merging")){const t=e.querySelector(".js-merge-pull-request textarea");t instanceof HTMLTextAreaElement&&t.value===t.defaultValue&&(t.value=t.defaultValue=c.issue_title)}else if(e.querySelector(".js-merge-pr.is-squashing")){const t=e.querySelector(".js-merge-pull-request .js-merge-title");t instanceof HTMLInputElement&&t.value===t.defaultValue&&(t.value=t.defaultValue=c.default_squash_commit_title)}const t=e.querySelector("button[value=merge]");t&&t.setAttribute("data-input-message-value",c.issue_title);const n=e.querySelector("button[value=squash]");n&&n.setAttribute("data-input-title-value",c.default_squash_commit_title)}}document.title=c.page_title;for(const u of e.elements)(u instanceof HTMLInputElement||u instanceof HTMLTextAreaElement)&&(u.defaultValue=u.value)})),u(".js-comment-minimize",(async function(e,t){await t.json();const n=e.closest(".js-comment"),o=n.querySelector(".js-minimize-comment");if(o&&o.classList.contains("js-update-minimized-content")){const t=e.querySelector("input[type=submit], button[type=submit]");t&&t.classList.add("disabled");const o=n.closest(".js-comment-container");o&&await Ee(o)}else{o&&o.classList.add("d-none");const t=e.closest(".unminimized-comment");t.classList.add("d-none"),t.classList.remove("js-comment");const n=e.closest(".js-minimizable-comment-group").querySelector(".minimized-comment");n&&n.classList.remove("d-none"),n&&n.classList.add("js-comment")}})),u(".js-comment-unminimize",(async function(e,t){await t.json();const n=e.closest(".js-minimizable-comment-group"),o=n.querySelector(".unminimized-comment"),s=n.querySelector(".minimized-comment");if(o)o.classList.remove("d-none"),o.classList.add("js-comment"),s&&s.classList.add("d-none"),s&&s.classList.remove("js-comment");else{if(s){const e=s.querySelector(".timeline-comment-actions");e&&e.classList.add("d-none"),s.classList.remove("js-comment")}const e=n.closest(".js-comment-container");await Ee(e)}})),l("details-menu-select",".js-comment-edit-history-menu",(e=>{const t=e.detail.relatedTarget.getAttribute("data-edit-history-url");if(!t)return;e.preventDefault();const n=ke(document,t);Te({content:n,dialogClass:"Box-overlay--wide"})}),{capture:!0}),ne(".js-comment-field",(function(e){Tn(e,!0),e.addEventListener("blur",qn,{once:!0})}));class PNGScanner{constructor(e){this.dataview=new DataView(e),this.pos=0}static fromFile(e){return new Promise((function(t,n){const o=new FileReader;o.onload=function(){t(new PNGScanner(o.result))},o.onerror=function(){n(o.error)},o.readAsArrayBuffer(e)}))}advance(e){this.pos+=e}readInt(e){const t=this,n=function(){switch(e){case 1:return t.dataview.getUint8(t.pos);case 2:return t.dataview.getUint16(t.pos);case 4:return t.dataview.getUint32(t.pos);default:throw new Error("bytes parameter must be 1, 2 or 4")}}();return this.advance(e),n}readChar(){return this.readInt(1)}readShort(){return this.readInt(2)}readLong(){return this.readInt(4)}readString(e){const t=[];for(let n=0;n<e;n++)t.push(String.fromCharCode(this.readChar()));return t.join("")}scan(e){if(2303741511!==this.readLong())throw new Error("invalid PNG");for(this.advance(4);;){const t=this.readLong(),n=this.readString(4),o=this.pos+t+4;if(!1===e.call(this,n,t)||"IEND"===n)break;this.pos=o}}}function An(e){return["video/mp4","video/quicktime"].includes(e.file.type)}function xn(e){if(An(e))return`\nUploading ${e.file.name}\n`;return`${e.isImage()?"!":""}[Uploading ${e.file.name}…]()`}m(".js-paste-markdown",{constructor:HTMLElement,subscribe:b});function Mn(e){const t=e.closest(".js-previewable-comment-form"),n=e.classList.contains("js-preview-tab");if(n){const e=t.querySelector(".js-write-bucket"),n=t.querySelector(".js-preview-body");e.clientHeight>0&&(n.style.minHeight=e.clientHeight+"px")}t.classList.toggle("preview-selected",n),t.classList.toggle("write-selected",!n);const o=t.querySelector('.tabnav-tab.selected, .tabnav-tab[aria-selected="true"]');o.setAttribute("aria-selected","false"),o.classList.remove("selected"),e.classList.add("selected"),e.setAttribute("aria-selected","true");const s=t.querySelector(".js-write-tab");return n?s.setAttribute("data-hotkey","Control+P,Meta+Shift+p"):s.removeAttribute("data-hotkey"),t}function Cn(e){var t,n,o,s,r,i,a,c,l;const u=e.querySelector(".js-comment-field").value,d=null===(t=e.querySelector(".js-path"))||void 0===t?void 0:t.value,m=null===(n=e.querySelector(".js-line-number"))||void 0===n?void 0:n.value,f=null===(o=e.querySelector(".js-start-line-number"))||void 0===o?void 0:o.value,h=null===(s=e.querySelector(".js-side"))||void 0===s?void 0:s.value,p=null===(r=e.querySelector(".js-start-side"))||void 0===r?void 0:r.value,g=null===(i=e.querySelector(".js-start-commit-oid"))||void 0===i?void 0:i.value,b=null===(a=e.querySelector(".js-end-commit-oid"))||void 0===a?void 0:a.value,y=null===(c=e.querySelector(".js-base-commit-oid"))||void 0===c?void 0:c.value,v=null===(l=e.querySelector(".js-comment-id"))||void 0===l?void 0:l.value,w=new FormData;return w.append("text",u),w.append("authenticity_token",function(e){const t=e.querySelector(".js-data-preview-url-csrf"),n=e.closest("form").elements.namedItem("authenticity_token");if(t instanceof HTMLInputElement)return t.value;if(n instanceof HTMLInputElement)return n.value;throw new Error("Comment preview authenticity token not found")}(e)),d&&w.append("path",d),m&&w.append("line_number",m),f&&w.append("start_line_number",f),h&&w.append("side",h),p&&w.append("start_side",p),g&&w.append("start_commit_oid",g),b&&w.append("end_commit_oid",b),y&&w.append("base_commit_oid",y),v&&w.append("comment_id",v),w}function Hn(e){const t=e.getAttribute("data-preview-url"),n=Cn(e);return d(e,"preview:setup",{data:n}),_n(t,n)}l("upload:setup",".js-upload-markdown-image",(function(e){const t=e.currentTarget.querySelector(".js-comment-field");t.setCustomValidity("uploading"),qe(t,xn(e.detail.attachment)+"\n")})),l("upload:complete",".js-upload-markdown-image",(async function(e){const{attachment:t}=e.detail,n=e.currentTarget.querySelector(".js-comment-field");let o;o=t.isImage()?await async function(e){const t=await async function(e){var t;const n={width:0,height:0,ppi:0};try{return null!==(t=await async function(e){if("image/png"!==e.type)return null;const t=e.slice(0,10240,e.type),n=await PNGScanner.fromFile(t),o={width:0,height:0,ppi:1};return n.scan((function(e){switch(e){case"IHDR":return o.width=this.readLong(),o.height=this.readLong(),!0;case"pHYs":{const e=this.readLong(),t=this.readLong();let n;return 1===this.readChar()&&(n=.0254),n&&(o.ppi=Math.round((e+t)/2*n)),!1}case"IDAT":return!1}return!0})),o}(e))&&void 0!==t?t:n}catch(o){return n}}(e.file),n=(s=e.file.name,function(e){return e.replace(/[[\]\\"<>&]/g,".").replace(/\.{2,}/g,".").replace(/^\.|\.$/gi,"")}(s).replace(/\.[^.]+$/,"").replace(/\./g," ")),o=e.href;var s;if(144===t.ppi){return`<img width="${Math.round(t.width/2)}" alt="${n}" src="${o}">`}return`![${n}](${o})`}(t):An(t)?function(e){return`\n${e.href}\n`}(t):function(e){return`[${e.file.name}](${e.href})`}(t),n.setCustomValidity(""),Ae(n,xn(t),o)})),l("upload:error",".js-upload-markdown-image",(function(e){const t=e.currentTarget.querySelector(".js-comment-field"),n=xn(e.detail.attachment);t.setCustomValidity(""),Ae(t,n,"")})),l("upload:invalid",".js-upload-markdown-image",(function(e){const t=e.currentTarget.querySelector(".js-comment-field"),n=xn(e.detail.attachment);t.setCustomValidity(""),Ae(t,n,"")})),l("click",".js-write-tab",(function(e){const t=e.currentTarget,n=t.closest(".js-previewable-comment-form");if(n instanceof y)return void setTimeout((()=>{n.querySelector(".js-comment-field").focus()}));const o=Mn(t);setTimeout((()=>{o.querySelector(".js-comment-field").focus()}));const s=n.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!1)})),l("click",".js-preview-tab",(function(e){const t=e.currentTarget,n=t.closest(".js-previewable-comment-form");if(n instanceof y)return;const o=Mn(t);setTimeout((()=>{Pn(o)}));const s=n.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!0),e.stopPropagation(),e.preventDefault()})),l("tab-container-change",".js-previewable-comment-form",(function(e){const t=e.detail.relatedTarget.classList.contains("js-preview-panel"),n=e.currentTarget,o=n.querySelector(".js-write-tab");if(t){const e=n.querySelector(".js-write-bucket"),t=n.querySelector(".js-preview-body");!t.hasAttribute("data-skip-sizing")&&e.clientHeight>0&&(t.style.minHeight=e.clientHeight+"px"),o.setAttribute("data-hotkey","Control+P,Meta+Shift+p"),Pn(n);const s=n.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!0)}else{o.removeAttribute("data-hotkey");const e=n.querySelector("markdown-toolbar");e instanceof HTMLElement&&(e.hidden=!1)}n.classList.toggle("preview-selected",t),n.classList.toggle("write-selected",!t)})),l("preview:render",".js-previewable-comment-form",(function(e){const t=Mn(e.target.querySelector(".js-preview-tab"));setTimeout((()=>{Pn(t);const e=t.querySelector("markdown-toolbar");e instanceof HTMLElement&&(e.hidden=!0)}))}));const _n=xe((async function(e,t){null==In||In.abort();const{signal:n}=In=new AbortController,o=await fetch(e,{method:"post",body:t,signal:n});if(!o.ok)throw new Error("something went wrong");return o.text()}),{hash:function(e,t){const n=[...t.entries()].toString();return`${e}:${n}`}});let In=null;async function Pn(e){const t=e.querySelector(".comment-body");t.innerHTML="<p>Loading preview&hellip;</p>";try{const n=await Hn(e);t.innerHTML=n||"<p>Nothing to preview</p>"}catch(n){"AbortError"!==n.name&&(t.innerHTML="<p>Error rendering preview</p>")}}m(".js-preview-tab",(function(e){e.addEventListener("mouseenter",(async()=>{const t=e.closest(".js-previewable-comment-form");try{await Hn(t)}catch(n){}}))})),je("keydown",".js-comment-field",(function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.shiftKey&&"P"===e.key.toUpperCase()){const n=t.closest(".js-previewable-comment-form");n.classList.contains("write-selected")&&(n instanceof y?n.querySelector(".js-preview-tab").click():(t.blur(),n.dispatchEvent(new CustomEvent("preview:render",{bubbles:!0,cancelable:!1}))),e.preventDefault(),e.stopImmediatePropagation())}}));const Rn=/^(\+1|-1|:\+1?|:-1?)$/;function Dn(e){const t=e.target,n=t.value,o=t.closest(".js-reaction-suggestion");if(o)if((e=>{let t=!1;for(const n of e.split("\n")){const e=n.trim();if(e&&!e.startsWith(">")){if(t&&!1===Rn.test(e))return!1;!t&&Rn.test(e)&&(t=!0)}}return t})(n)){o.classList.remove("hide-reaction-suggestion"),o.classList.add("reaction-suggestion");const e=o.getAttribute("data-reaction-markup");o.setAttribute("data-reaction-suggestion-message",e)}else $n(o)}function $n(e){e.classList.remove("reaction-suggestion"),e.classList.add("hide-reaction-suggestion"),e.removeAttribute("data-reaction-suggestion-message")}l("focusout","#new_comment_field",(function(e){const t=e.currentTarget.closest(".js-reaction-suggestion");t&&$n(t)})),l("focusin","#new_comment_field",(function(e){Dn(e)})),je("keyup","#new_comment_field",(function(e){Dn(e)})),l("navigation:keydown",".js-commits-list-item",(function(e){e.target instanceof Element&&"c"===e.detail.hotkey&&e.target.querySelector(".js-navigation-open").click()})),document.addEventListener("click",(function(e){if(!(e.target instanceof Element))return;const t=e.target.closest("a[data-confirm], input[type=submit][data-confirm], input[type=checkbox][data-confirm], button[data-confirm]");if(!t)return;const n=t.getAttribute("data-confirm");n&&(t instanceof HTMLInputElement&&t.hasAttribute("data-confirm-checked")&&!t.checked||confirm(n)||(e.stopImmediatePropagation(),e.preventDefault()))}),!0),le(".js-company-name-input",(function(e){const t=e.target,n=t.form,o=n.querySelectorAll(".js-company-name-text");if(0===o.length)return;const s=n.querySelector(".js-corp-tos-link"),r=n.querySelector(".js-tos-link");r&&(r.classList.add("d-none"),r.setAttribute("aria-hidden","true"),s&&(s.classList.remove("d-none"),s.setAttribute("aria-hidden","false")));for(const i of o)if(t.value){if(i.hasAttribute("data-wording")){const e=i.getAttribute("data-wording");i.textContent=` ${e} ${t.value}`}else i.textContent=t.value}else i.textContent=""})),m(".js-company-owned:not(:checked)",{constructor:HTMLInputElement,add(e){const t=e.form.querySelector(".js-company-name-input"),n=document.querySelector(".js-company-name-text"),o=document.querySelector(".js-corp-tos-link"),s=document.querySelector(".js-tos-link");e.getAttribute("data-optional")&&t.removeAttribute("required"),G(t,""),s.classList.remove("d-none"),s.setAttribute("aria-hidden","false"),o.classList.add("d-none"),o.setAttribute("aria-hidden","true"),n.textContent=""}}),m(".js-company-owned:checked",{constructor:HTMLInputElement,add(e){const t=e.form.querySelector(".js-company-name-input");t&&(t.setAttribute("required",""),d(t,"focus"),d(t,"input"))}}),m(".js-company-owned-autoselect",{constructor:HTMLInputElement,add(e){const t=e;function n(){if(t.checked&&t.form){const e=t.form.querySelector(".js-company-owned");G(e,!0)}}t.addEventListener("change",n),n()}}),m(".js-content-attachment .max--md",(function(e){const t=e.querySelector(".markdown-body");var n;(t.clientHeight<188||""===((n=t).textContent||"").trim()&&1===(n.querySelectorAll("img")||[]).length)&&(e.classList.remove("max--md"),e.querySelector(".Details-content--closed").hidden=!0,e.querySelector(".Details-content--open").hidden=!0)})),l("click",".js-hide-content-attachment",(function(e){e.preventDefault();const t=e.currentTarget,n=t.closest(".js-content-attachment"),o=t.closest("[data-unfurl-hide-url]"),s=o.getAttribute("data-unfurl-hide-url"),r=o.querySelector(".js-data-unfurl-hide-url-csrf"),i=t.getAttribute("data-id"),a=new XMLHttpRequest;a.onload=function(){a.status>=200&&a.status<300&&n.remove()},a.open("POST",s);const c=new FormData;c.append("id",i),c.append("authenticity_token",r.value),a.send(c)}));let Nn=null;function On({currentTarget:e}){const t=e;if(t.hasAttribute("open")){const e=t.querySelector("[autofocus]");e&&e.focus()}else{const e=t.querySelector("summary");e&&e.focus()}}function Bn({currentTarget:e}){const t=e;t.hasAttribute("open")?(Nn&&Nn!==t&&Nn.removeAttribute("open"),Nn=t):t===Nn&&(Nn=null)}function Fn({currentTarget:e}){if(!(e instanceof Element))return;const t=e.closest("details"),n=t.getAttribute("data-deferred-details-content-url");t.removeAttribute("data-deferred-details-content-url");t.querySelector("include-fragment, poll-include-fragment").src=n}async function Wn({currentTarget:e}){const t=e,n=t.hasAttribute("open");d(t,n?"menu:activate":"menu:deactivate"),await oe(),d(t,n?"menu:activated":"menu:deactivated")}document.addEventListener("keydown",(function(e){!e.defaultPrevented&&"Escape"===e.key&&Nn&&Nn.removeAttribute("open")})),m(".js-dropdown-details",{subscribe:e=>Me(se(e,"toggle",Bn),se(e,"toggle",On))}),m("[data-deferred-details-content-url]:not([data-details-no-preload-on-hover])",{subscribe:e=>{const t=e.querySelector("summary");return se(t,"mouseenter",Fn)}}),m("[data-deferred-details-content-url]",{subscribe:e=>se(e,"toggle",Fn)}),l("click","[data-toggle-for]",(function(e){const t=e.currentTarget.getAttribute("data-toggle-for")||"",n=document.getElementById(t);n&&(n.hasAttribute("open")?n.removeAttribute("open"):n.setAttribute("open","open"))})),ue((function({target:e}){if(!e||e.closest("summary"))return;let t=e.parentElement;for(;t;)t=t.closest("details"),t&&(t.hasAttribute("open")||t.setAttribute("open",""),t=t.parentElement)})),l("details-dialog-close","[data-disable-dialog-dismiss]",(function(e){e.preventDefault()})),m("details.select-menu details-menu include-fragment",(function(e){const t=e.closest("details");t&&(e.addEventListener("loadstart",(function(){t.classList.add("is-loading"),t.classList.remove("has-error")})),e.addEventListener("error",(function(){t.classList.add("has-error")})),e.addEventListener("loadend",(function(){t.classList.remove("is-loading");const e=t.querySelector(".js-filterable-field");e&&d(e,"filterable:change")})))})),m("details details-menu .js-filterable-field",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t.addEventListener("toggle",(function(){t.hasAttribute("open")||(e.value="",d(e,"filterable:change"))}))}}),m("details-menu[role=menu] [role=menu]",(e=>{const t=e.closest("details-menu[role]");t&&t!==e&&t.removeAttribute("role")})),m("details details-menu remote-input input",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t.addEventListener("toggle",(function(){t.hasAttribute("open")||(e.value="")}))}}),m("form details-menu",(e=>{const t=e.closest("form");t.addEventListener("reset",(()=>{setTimeout((()=>function(e){const t=e.querySelectorAll("details-menu [role=menuitemradio] input[type=radio]:checked");for(const n of t)d(n,"change")}(t)),0)}))})),je("keypress","details-menu .js-filterable-field, details-menu filter-input input",(e=>{if("Enter"===e.key){const t=e.currentTarget.closest("details-menu").querySelector('[role^="menuitem"]:not([hidden])');t instanceof HTMLElement&&t.click(),e.preventDefault()}})),l("details-menu-selected","details-menu",(e=>{const t=e.currentTarget.querySelector(".js-filterable-field");t instanceof HTMLInputElement&&t.value&&t.focus()}),{capture:!0}),l("details-menu-selected","[data-menu-input]",(e=>{if(!(e.target instanceof Element))return;const t=e.target.getAttribute("data-menu-input"),n=document.getElementById(t);(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&(n.value=e.detail.relatedTarget.value)}),{capture:!0}),m("details-menu remote-input",{constructor:v,initialize(e){const t=document.getElementById(e.getAttribute("aria-owns")||"");if(!t)return;let n=null;e.addEventListener("load",(()=>{n=document.activeElement&&t.contains(document.activeElement)&&document.activeElement.id?document.activeElement.id:null})),e.addEventListener("loadend",(()=>{if(n){const o=t.querySelector("#"+n)||t.querySelector('[role^="menu"]');o instanceof HTMLElement?o.focus():e.input&&e.input.focus()}}))}}),l("details-menu-selected","details-menu[data-menu-max-options]",(e=>{const t=+e.currentTarget.getAttribute("data-menu-max-options")===e.currentTarget.querySelectorAll('[role="menuitemcheckbox"][aria-checked="true"]').length;e.currentTarget.querySelector("[data-menu-max-options-warning]").hidden=!t;for(const n of e.currentTarget.querySelectorAll('[role="menuitemcheckbox"] input'))n.disabled=t&&!n.checked}),{capture:!0}),m("details > details-menu",{subscribe(e){const t=e.closest("details");return se(t,"toggle",Wn)}});const zn=new WeakMap,Un=["input[type=submit][data-disable-with]","button[data-disable-with]"].join(", ");function Vn(e,t){e instanceof HTMLInputElement?e.value=t:e.innerHTML=t}function Xn(e){for(const t of e.querySelectorAll(Un)){const n=zn.get(t);null!=n&&(Vn(t,n),t.hasAttribute("data-disable-invalid")&&!e.checkValidity()||(t.disabled=!1),zn.delete(t))}}function Kn(e){return Array.from(e.types).indexOf("Files")>=0}l("submit","form",(function(e){for(const n of e.currentTarget.querySelectorAll(Un)){zn.set(n,(t=n)instanceof HTMLInputElement?t.value||"Submit":t.innerHTML||"");const e=n.getAttribute("data-disable-with");e&&Vn(n,e),n.disabled=!0}var t}),{capture:!0}),l("deprecatedAjaxComplete","form",(function({currentTarget:e,target:t}){e===t&&Xn(e)})),w(Xn),m(".js-document-dropzone",{constructor:HTMLElement,add(e){document.body.addEventListener("dragstart",to),document.body.addEventListener("dragend",no),document.body.addEventListener("dragenter",Gn),document.body.addEventListener("dragover",Gn),document.body.addEventListener("dragleave",Yn),e.addEventListener("drop",Qn)},remove(e){document.body.removeEventListener("dragstart",to),document.body.removeEventListener("dragend",no),document.body.removeEventListener("dragenter",Gn),document.body.removeEventListener("dragover",Gn),document.body.removeEventListener("dragleave",Yn),e.removeEventListener("drop",Qn)}});let Jn=null;function Gn(e){if(eo)return;const t=e.currentTarget;Jn&&window.clearTimeout(Jn),Jn=window.setTimeout((()=>t.classList.remove("dragover")),200);const n=e.dataTransfer;n&&Kn(n)&&(n.dropEffect="copy",t.classList.add("dragover"),e.stopPropagation(),e.preventDefault())}function Yn(e){if(e.target instanceof Element&&e.target.classList.contains("js-document-dropzone")){e.currentTarget.classList.remove("dragover")}}function Qn(e){const t=e.currentTarget;t.classList.remove("dragover"),document.body.classList.remove("dragover");const n=e.dataTransfer;n&&Kn(n)&&(d(t,"document:drop",{transfer:n}),e.stopPropagation(),e.preventDefault())}let Zn,eo=!1;function to(){eo=!0}function no(){eo=!1}function oo(e,t){const n=document.querySelector('.js-site-favicon[type="image/svg+xml"]'),o=document.querySelector('.js-site-favicon[type="image/png"]');t||(t="light");const s="light"===t?"":"-dark";if(n&&o)if(null==Zn&&(Zn=n.href),e){e=`${e=e.substr(0,e.lastIndexOf("."))}${s}.svg`,n.href=e;const t=n.href.substr(0,n.href.lastIndexOf("."));o.href=t+".png"}else{const e=n.href.indexOf("-dark.svg"),t=n.href.substr(0,-1!==e?e:n.href.lastIndexOf("."));n.href=`${t}${s}.svg`,o.href=`${t}${s}.png`}}function so(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}l("submit","form.js-encrypt-submit",(async function(e){const n=e.currentTarget;if(e.defaultPrevented||!n.checkValidity())return;const o=n.elements.namedItem("secret_value");if(o.disabled=!0,!o.value)return;e.preventDefault();const s=function(e){const t=atob(e).split("").map((e=>e.charCodeAt(0)));return Uint8Array.from(t)}(n.getAttribute("data-public-key"));n.elements.namedItem("encrypted_value").value=function(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}(await async function(e,n){const o=(new TextEncoder).encode(n),{seal:s}=await t.import("./chunk-tweetsodium.js");return s(o,e)}(s,o.value)),n.submit()})),m("[data-favicon-override]",{add(e){const t=e.getAttribute("data-favicon-override");setTimeout((()=>oo(t,so()?"dark":"light")))},remove(){null!=Zn&&oo(Zn,so()?"dark":"light")}}),so()&&oo(void 0,"dark"),window.matchMedia("(prefers-color-scheme: dark)").addListener((()=>{oo(void 0,so()?"dark":"light")})),m(".js-feature-preview-indicator-container",(e=>{!async function(e){const t=e.getAttribute("data-feature-preview-indicator-src"),n=await async function(e){try{const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)return!1;return(await t.json()).show_indicator}catch(t){return!1}}(t),o=e.querySelectorAll(".js-feature-preview-indicator");for(const s of o)s.hidden=!n}(e)})),l("click","[data-feature-preview-trigger-url]",(async e=>{const t=e.currentTarget,n=t.getAttribute("data-feature-preview-trigger-url"),o=await Te({content:ke(document,n),dialogClass:"feature-preview-dialog"}),s=t.getAttribute("data-feature-preview-close-details"),r=t.getAttribute("data-feature-preview-close-hmac");o.addEventListener("dialog:remove",(()=>{be({hydroEventPayload:s,hydroEventHmac:r},!0)}));const i=document.querySelectorAll(".js-feature-preview-indicator");for(const a of i)a.hidden=!0})),u(".js-feature-preview-unenroll",(async(e,t)=>{await t.text();const n=e.querySelector(".js-feature-preview-slug").value;d(e,"feature-preview-unenroll:"+n)})),u(".js-feature-preview-enroll",(async(e,t)=>{await t.text();const n=e.querySelector(".js-feature-preview-slug").value;d(e,"feature-preview-enroll:"+n)}));class AttachmentUpload{constructor(e,t){this.attachment=e,this.policy=t}async process(e){var t,n,o,s;const r=window.performance.now(),i=new Headers(this.policy.header||{}),a=new XMLHttpRequest;a.open("POST",this.policy.upload_url,!0);for(const[l,u]of i)a.setRequestHeader(l,u);a.onloadstart=()=>{e.attachmentUploadDidStart(this.attachment,this.policy)},a.upload.onprogress=t=>{if(t.lengthComputable){const n=Math.round(t.loaded/t.total*100);e.attachmentUploadDidProgress(this.attachment,n)}},await function(e,t){return new Promise(((n,o)=>{e.onload=()=>n(e),e.onerror=o,e.send(t)}))}(a,function(e,t){const n=new FormData;t.same_origin&&n.append("authenticity_token",t.upload_authenticity_token);for(const o in t.form)n.append(o,t.form[o]);return n.append("file",e.file),n}(this.attachment,this.policy)),204===a.status?(ro(this.policy),e.attachmentUploadDidComplete(this.attachment,this.policy,{})):201===a.status?(ro(this.policy),e.attachmentUploadDidComplete(this.attachment,this.policy,JSON.parse(a.responseText))):e.attachmentUploadDidError(this.attachment,{status:a.status,body:a.responseText});const c={duration:window.performance.now()-r,size:null===(n=null===(t=this.attachment)||void 0===t?void 0:t.file)||void 0===n?void 0:n.size,fileType:null===(s=null===(o=this.attachment)||void 0===o?void 0:o.file)||void 0===s?void 0:s.type,success:204===a.status||201===a.status};be({uploadTiming:c},!0)}}function ro(e){const t="string"==typeof e.asset_upload_url?e.asset_upload_url:null,n="string"==typeof e.asset_upload_authenticity_token?e.asset_upload_authenticity_token:null;if(!t||!n)return;const o=new FormData;o.append("authenticity_token",n),fetch(t,{method:"PUT",body:o,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}async function io(e,t){const n=function(e,t){return{attachmentUploadDidStart(n,o){n.saving(0),uo(t,"is-uploading"),d(t,"upload:start",{batch:e,attachment:n,policy:o})},attachmentUploadDidProgress(n,o){n.saving(o),d(t,"upload:progress",{batch:e,attachment:n})},attachmentUploadDidComplete(n,o,s){n.saved(function(e,t){const n=(null==e.id?null:String(e.id))||(null==t.asset.id?null:String(t.asset.id)),o=("string"==typeof e.href?e.href:null)||("string"==typeof t.asset.href?t.asset.href:null);return{id:n,href:o,name:t.asset.name}}(s,o)),d(t,"upload:complete",{batch:e,attachment:n}),uo(t,"is-default")},attachmentUploadDidError(n,o){d(t,"upload:error",{batch:e,attachment:n});const s=co(o);uo(t,s)}}}(e,t);for(const s of e.attachments){const r=await ao(e,s,t);if(!r)return;try{const e=new AttachmentUpload(s,r);await e.process(n)}catch(o){return d(t,"upload:error",{batch:e,attachment:s}),void uo(t,"is-failed")}}}async function ao(e,t,n){const o=function(e,t){const n=t.querySelector(".js-data-upload-policy-url-csrf").value,o=t.getAttribute("data-upload-repository-id"),s=t.getAttribute("data-subject-type"),r=t.getAttribute("data-subject-param"),i=e.file,a=new FormData;a.append("name",i.name),a.append("size",String(i.size)),a.append("content_type",i.type),a.append("authenticity_token",n),s&&a.append("subject_type",s);r&&a.append("subject",r);o&&a.append("repository_id",o);e.directory&&a.append("directory",e.directory);return a}(t,n),s=[];d(n,"upload:setup",{batch:e,attachment:t,form:o,preprocess:s});try{await Promise.all(s);const r=await fetch(function(e,t){return new Request(t.getAttribute("data-upload-policy-url"),{method:"POST",body:e,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}(o,n));if(r.ok)return await r.json();d(n,"upload:invalid",{batch:e,attachment:t});const i=await r.text(),a=r.status;uo(n,co({status:a,body:i},t.file))}catch(r){d(n,"upload:invalid",{batch:e,attachment:t}),uo(n,"is-failed")}return null}function co(e,t){if(400===e.status)return"is-bad-file";if(422!==e.status)return"is-failed";const n=JSON.parse(e.body);if(!n||!n.errors)return"is-failed";for(const o of n.errors)switch(o.field){case"size":{const e=t?t.size:null;return null!=e&&0===e?"is-empty":"is-too-big"}case"file_count":return"is-too-many";case"width":case"height":return"is-bad-dimensions";case"name":return"already_exists"===o.code?"is-duplicate-filename":"is-bad-file";case"content_type":return"is-bad-file";case"uploader_id":return"is-bad-permissions";case"repository_id":return"is-repository-required";case"format":return"is-bad-format"}return"is-failed"}const lo=["is-default","is-uploading","is-bad-file","is-duplicate-filename","is-too-big","is-too-many","is-hidden-file","is-failed","is-bad-dimensions","is-empty","is-bad-permissions","is-repository-required","is-bad-format"];function uo(e,t){e.classList.remove(...lo),e.classList.add(t)}class Batch{constructor(e){this.attachments=e,this.size=this.attachments.length,this.total=mo(this.attachments,(e=>e.file.size))}percent(){const e=mo(this.attachments,(e=>e.file.size*e.percent/100));return Math.round(e/this.total*100)}uploaded(){return mo(this.attachments,(e=>e.isSaved()?1:0))}isFinished(){return this.attachments.every((e=>e.isSaved()))}}function mo(e,t){return e.reduce(((e,n)=>e+t(n)),0)}m("file-attachment[hover]",{add(e){e.classList.add("dragover")},remove(e){e.classList.remove("dragover")}}),l("file-attachment-accept","file-attachment",(function(e){const{attachments:t}=e.detail;0===t.length&&(uo(e.currentTarget,"is-hidden-file"),e.preventDefault())})),l("file-attachment-accepted","file-attachment",(function(e){const{attachments:t}=e.detail;io(new Batch(t),e.currentTarget)}));let fo=0;function ho(e){return Array.from(e.types).indexOf("Files")>=0}function po(e){const t=e.dataTransfer;t&&ho(t)&&e.preventDefault()}function go(e){const t=e.dataTransfer;t&&ho(t)&&e.preventDefault()}function bo({currentTarget:e}){uo(e.querySelector("file-attachment"),"is-default")}function yo(e,t,n,o={}){var s;const r=null!==(s=o.limit)&&void 0!==s?s:1/0;let i=0;for(const a of e.children){const e=n(a,t);null==e||(e&&i<r?(i++,vo(a,!0)):vo(a,!1))}return i}function vo(e,t){e.style.display=t?"":"none",e.hidden=!t}m("file-attachment",{add(e){0==fo++&&(document.addEventListener("drop",po),document.addEventListener("dragover",go));const t=e.closest("form");t&&t.addEventListener("reset",bo)},remove(e){0==--fo&&(document.removeEventListener("drop",po),document.removeEventListener("dragover",go));const t=e.closest("form");t&&t.removeEventListener("reset",bo)}}),l("filter-input-updated","filter-input",(e=>{const t=e.currentTarget.input;if(!document.activeElement||document.activeElement!==t)return;const{count:n,total:o}=e.detail;Ce(`Found ${n} out of ${o} ${1===o?"item":"items"}`)})),l("toggle","details",(e=>{setTimeout((()=>function(e){const t=e.querySelector("filter-input");t&&!e.hasAttribute("open")&&t.reset()}(e.target)),0)}),{capture:!0}),l("tab-container-changed","tab-container",(e=>{if(!(e.target instanceof HTMLElement))return;const{relatedTarget:t}=e.detail,n=e.target.querySelector("filter-input");n instanceof j&&n.setAttribute("aria-owns",t.id)}),{capture:!0});const wo=new WeakMap;let jo=new AbortController;const Lo=new WeakMap,So=new WeakMap,ko=new WeakMap;async function Eo(e,t,n){n&&!Lo.has(e)&&function(e){Lo.set(e,{lastSearchResult:{suggestions:[],users:[]},lastSearchText:"",cachedSuggestions:[],userResultCache:new Map})}(e);const o=await async function(e,t,n){const o=new URL(e.getAttribute("data-filterable-src"),window.location.origin);if(n){const n=Lo.get(e),s=t.trim();if(n.lastSearchText===s)return n.lastSearchResult;if(n.lastSearchText=s,jo.abort(),""===s)n.lastSearchResult={suggestions:[],users:[]};else{jo=new AbortController;const e={headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"},signal:jo.signal},s=o.searchParams||new URLSearchParams;s.set("q",t),s.set("typeAhead","true"),o.search=s.toString();const r=await fetch(o.toString(),e);n.lastSearchResult=await r.json()}return n.lastSearchResult}{const e={headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}},t=await fetch(o.toString(),e);return await t.json()}}(e,t,n);return n&&(o.suggestions=function(e){const t=Lo.get(e);if(e.querySelectorAll(".js-filterable-suggested-user").length>0){t.cachedSuggestions=[],t.userResultCache.clear();for(const n of e.querySelectorAll(".js-filterable-suggested-user"))n.classList.remove("js-filterable-suggested-user"),t.cachedSuggestions.push({name:n.querySelector(".js-description").textContent,login:n.querySelector(".js-username").textContent,selected:Boolean(n.getAttribute("aria-checked")),element:n,suggestion:!0})}return t.cachedSuggestions}(e)),o}async function To(e,t){const n=parseInt(e.getAttribute("data-filterable-limit"),10)||null;let o=0;switch(e.getAttribute("data-filterable-type")){case"fuzzy":{const s=t.toLowerCase();o=function(e,t,n){const o=t.toLowerCase(),s=n.limit;let r=wo.get(e);const i=e.querySelector('input[type="radio"]:checked'),a=Array.from(e.children);r||(r=Array.from(e.children),wo.set(e,r));for(const h of a)e.removeChild(h),h instanceof HTMLElement&&(h.style.display="");const c=o?He(r,n.sortKey,_e):r,l=null==s?c:c.slice(0,s),u=l.length,d=document.createDocumentFragment();for(const h of l)d.appendChild(h);let m=!1;if(i instanceof HTMLInputElement)for(const h of d.querySelectorAll('input[type="radio"]:checked'))h instanceof HTMLInputElement&&h.value!==i.value&&(h.checked=!1,m=!0);e.appendChild(d),i&&m&&i.dispatchEvent(new Event("change",{bubbles:!0}));const f=e.querySelectorAll(".js-divider");for(const h of f)h.classList.toggle("d-none",Boolean(o&&o.trim().length>0));return u}(e,t,{limit:n,sortKey:e=>{const t=(n=e).hasAttribute("data-filter-value")?n.getAttribute("data-filter-value").toLowerCase().trim():n.textContent.toLowerCase().trim();var n;const o=Re(t,s);return o>0?{score:o,text:t}:null}});break}case"substring":o=yo(e,t.toLowerCase(),Ao,{limit:n});break;case"substring-memory":o=await async function(e,t,n){ko.set(e,t),await Ie();const o=e.hasAttribute("data-filterable-show-suggestion-header"),s=e.hasAttribute("data-filterable-type-ahead");let r=So.get(e);if(!r)try{r=await Eo(e,t,s),s||So.set(e,r)}catch(b){if("AbortError"===b.name)return-1;throw b}if(!s&&ko.get(e)!==t)return-1;const i=n.limit,a=e.querySelector("template"),c={};for(const y of e.querySelectorAll("input[type=hidden]"))c[`${y.name}${y.value}`]=y;let l=a.nextElementSibling;for(;l;){const e=l;l=e.nextElementSibling,e instanceof HTMLElement&&(s||"true"===e.getAttribute("aria-checked")||e.classList.contains("select-menu-divider"))?e.hidden=!0:e.remove()}let u=0,d=document.createDocumentFragment();const m=e.querySelector(".js-divider-suggestions"),f=e.querySelector(".js-divider-rest"),h=Lo.get(e);function p(e){const n=`${e.login} ${e.name}`.toLowerCase().trim().includes(t),o=!(null!=i&&u>=i)&&n;if(o||e.selected||e.suggestion){const t=function(e,t,n,o){if(null!=e.element)return e.element;if(null==o?void 0:o.userResultCache.has(e.id))return o.userResultCache.get(e.id);const s=t.content.cloneNode(!0),r=s.querySelector("input[type=checkbox], input[type=radio]");e.type&&(r.name=`reviewer_${e.type}_ids[]`),r.value=e.id;const i=`${r.name}${e.id}`;let a=e.selected;n[i]&&(a=!0,n[i].remove(),delete n[i]);const c=s.querySelector("[role^=menuitem]");a&&(c.setAttribute("aria-checked","true"),r.checked=!0),e.disabled&&c.setAttribute("aria-disabled","true");const l=s.querySelector(".js-username");l&&(l.textContent=e.login);const u=s.querySelector(".js-description");u&&(u.textContent=e.name);const d=s.querySelector(".js-extended-description");d&&(e.description?d.textContent=e.description:d.remove());const m=s.querySelector(".js-avatar");return m.className=`${m.className} ${e.class}`,m.src=e.avatar,e.element=c,null==o||o.userResultCache.set(e.id,c),e.element}(e,a,c,h);t.hidden=!o,o&&u++,d.appendChild(t)}}if(m&&r.suggestions){for(const e of r.suggestions)p(e);d.childNodes.length&&(m.after(d),m.hidden=0===u||s&&""!==t.trim(),d=document.createDocumentFragment())}else m&&o&&(m.hidden=""!==t.trim());const g=u;for(const y of r.users)p(y);return e.append(d),f&&(f.hidden=u===g||0===g),u}(e,t,{limit:n});break;default:o=yo(e,t.toLowerCase(),qo,{limit:n})}return e.classList.toggle("filterable-active",t.length>0),e.classList.toggle("filterable-empty",0===o),o}function qo(e,t){return e.textContent.toLowerCase().trim().startsWith(t)}function Ao(e,t){if(e.classList.contains("select-menu-no-results"))return null;return(e.querySelector("[data-filterable-item-text]")||e).textContent.toLowerCase().trim().includes(t)}m(".js-filterable-field",{constructor:HTMLInputElement,initialize(e){e.autocomplete||(e.autocomplete="off");let t=e.value;async function n(e){t!==e.value&&(t=e.value,await oe(),d(e,"filterable:change"))}async function o(){t=e.value,await oe(),d(e,"filterable:change")}return{add(e){e.addEventListener("focus",o),ae(e,n),document.activeElement===e&&o()},remove(e){e.removeEventListener("focus",o),Pe(e,n)}}}}),l("filterable:change",".js-filterable-field",(async function(e){const t=e.currentTarget,n=t.value.trim().toLowerCase(),o=document.querySelectorAll(`[data-filterable-for="${t.id}"]`);for(const s of o){const e=await To(s,n);if(-1===e)return;document.activeElement&&t===document.activeElement&&Ce(e+" results found."),s.dispatchEvent(new CustomEvent("filterable:change",{bubbles:!0,cancelable:!1,detail:{inputField:t}}))}})),l("filterable:change","details-menu .select-menu-list",(function(e){const t=e.currentTarget,n=t.querySelector(".js-new-item-form");n&&function(e,t,n){const o=n.length>0&&!function(e,t){for(const n of e.querySelectorAll("[data-menu-button-text]")){if(n.textContent.toLowerCase().trim()===t.toLowerCase())return!0}return!1}(e,n);if(e.classList.toggle("is-showing-new-item-form",o),!o)return;t.querySelector(".js-new-item-name").textContent=n;const s=t.querySelector(".js-new-item-value");(s instanceof HTMLInputElement||s instanceof HTMLButtonElement)&&(s.value=n)}(t,n,e.detail.inputField.value)})),m("tab-container .select-menu-list .filterable-empty, details-menu .select-menu-list .filterable-empty",{add(e){e.closest(".select-menu-list").classList.add("filterable-empty")},remove(e){e.closest(".select-menu-list").classList.remove("filterable-empty")}});const xo=navigator.userAgent.match(/Firefox\/(\d+)/);function Mo(e){return"ArrowDown"===e.key||"ArrowUp"===e.key}function Co(e){const t=e.closest("label");t.hasAttribute("data-role")||t.setAttribute("data-role",t.getAttribute("role")),t.setAttribute("role",t.getAttribute("data-role")),e.removeAttribute("role")}function Ho(){De(document)&&$e(document)}xo&&Number(xo[1])<76&&(m('details-menu label[tabindex][role^="menuitem"]',(e=>{const t=e.querySelector("input");if(!t)return;const n=e.classList.contains("select-menu-item"),o=t.classList.contains("d-none"),s=n||o||t.hidden;n&&t.classList.add("d-block"),o&&t.classList.remove("d-none"),s&&(t.classList.add("sr-only"),t.hidden=!1),e.removeAttribute("tabindex")})),l("focus",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',(e=>{const t=e.currentTarget.closest("label");t.classList.contains("select-menu-item")&&t.classList.add("navigation-focus"),t.classList.contains("SelectMenu-item")&&t.classList.add("hx_menuitem--focus"),t.classList.contains("dropdown-item")&&t.classList.add("hx_menuitem--focus"),e.currentTarget.addEventListener("blur",(()=>{t.classList.contains("select-menu-item")&&t.classList.remove("navigation-focus"),t.classList.contains("SelectMenu-item")&&t.classList.remove("hx_menuitem--focus"),t.classList.contains("dropdown-item")&&t.classList.remove("hx_menuitem--focus")}),{once:!0})}),{capture:!0}),je("keydown",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',(async function(e){if(Mo(e))e.currentTarget instanceof Element&&function(e){const t=e.closest("label");t.hasAttribute("data-role")||t.setAttribute("data-role",t.getAttribute("role"));e.setAttribute("role",t.getAttribute("data-role")),t.removeAttribute("role")}(e.currentTarget);else if("Enter"===e.key){const t=e.currentTarget;e.preventDefault(),await oe(),t instanceof HTMLInputElement&&t.click()}})),l("blur",'details-menu label input[role="menuitemradio"], details-menu label input[role="menuitemcheckbox"]',(e=>{Co(e.currentTarget)}),{capture:!0}),je("keyup",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',(e=>{Mo(e)&&e.currentTarget instanceof Element&&Co(e.currentTarget)}))),ue(Ho),l("click",'a[href^="#"]',(function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&setTimeout(Ho,0)})),l("click",".js-flash-close",(function(e){const t=e.currentTarget.closest(".flash-messages");e.currentTarget.closest(".flash").remove(),t&&!t.querySelector(".flash")&&t.remove()}));const _o=["flash-notice","flash-error","flash-message","flash-warn"];m("template.js-flash-template",{constructor:HTMLTemplateElement,add(e){!function(e){for(const{key:n,value:o}of _o.flatMap(Ne)){let s;Oe(n);try{s=atob(decodeURIComponent(o))}catch(t){continue}e.after(new L(e,{className:n,message:s}))}}(e)}});const Io=new WeakMap;function Po(e){e instanceof CustomEvent&&Ce(e.detail+" results found.")}document.addEventListener("focus",(function(e){const t=e.target;t instanceof Element&&!Io.get(t)&&(d(t,"focusin:delay"),Io.set(t,!0))}),{capture:!0}),document.addEventListener("blur",(function(e){setTimeout((function(){const t=e.target;t instanceof Element&&t!==document.activeElement&&(d(t,"focusout:delay"),Io.delete(t))}),200)}),{capture:!0}),u(".js-form-toggle-target",(async function(e,t){await t.text();e.closest(".js-form-toggle-container").querySelector(".js-form-toggle-target[hidden]").hidden=!1,e.hidden=!0})),m("fuzzy-list",{constructor:Be,subscribe:e=>se(e,"fuzzy-list-sorted",Po)}),l("click",".email-hidden-toggle",(function(e){const t=e.currentTarget.nextElementSibling;t instanceof HTMLElement&&(t.style.display="",t.classList.toggle("expanded"),e.preventDefault())})),l("click",".js-skip-to-content",(function(e){const t=document.getElementById("start-of-content");if(t){const e=t.nextElementSibling;e instanceof HTMLElement&&(e.setAttribute("tabindex","-1"),e.focus())}e.preventDefault()}));const Ro="ontouchstart"in document;for(const t of document.querySelectorAll(".HeaderMenu-details"))t.addEventListener("toggle",$o),Ro||(t.addEventListener("mouseover",No),t.addEventListener("mouseleave",No));let Do=!1;function $o(e){if(!Do){Do=!0;for(const t of document.querySelectorAll(".HeaderMenu-details"))t!==e.currentTarget&&t.removeAttribute("open");setTimeout((()=>Do=!1))}}function No(e){const{currentTarget:t}=e;t instanceof HTMLElement&&window.innerWidth>1012&&("mouseover"===e.type&&e instanceof MouseEvent?e.target instanceof Node&&e.relatedTarget instanceof Node&&t.contains(e.target)&&!t.contains(e.relatedTarget)&&t.setAttribute("open",""):t.removeAttribute("open"))}function Oo(e){const t=document.querySelectorAll(".js-hook-event-checkbox");for(const n of t)n.checked=n.matches(e)}m(".js-hook-url-field",{constructor:HTMLInputElement,add(e){function t(){const t=e.form;if(!t)return;let n;try{n=new URL(e.value)}catch(i){}const o=t.querySelector(".js-invalid-url-notice");o instanceof HTMLElement&&(o.hidden=!!(""===e.value||n&&/^https?:/.test(n.protocol)));const s=t.querySelector(".js-insecure-url-notice");s instanceof HTMLElement&&n&&e.value&&(s.hidden=/^https:$/.test(n.protocol));const r=t.querySelector(".js-ssl-hook-fields");r instanceof HTMLElement&&(r.hidden=!(n&&"https:"===n.protocol))}ae(e,t),t()}}),l("change",".js-hook-event-choice",(function(e){const t=e.currentTarget,n=t.checked&&"custom"===t.value,o=t.closest(".js-hook-events-field");if(o&&o.classList.toggle("is-custom",n),t.checked)if(n){document.querySelector(".js-hook-wildcard-event").checked=!1}else"push"===t.value?Oo('[value="push"]'):"all"===t.value&&Oo(".js-hook-wildcard-event")})),l("details:toggled",".js-hook-secret",(function(e){const t=e.currentTarget,n=t.querySelector(".hook-secret-field > input[type=text]");t.classList.contains("open")&&n.focus()})),l("click",".js-hook-deliveries-pagination-button",(async function(e){const t=e.currentTarget;t.disabled=!0;const n=t.parentElement,o=t.getAttribute("data-url");n.before(await ke(document,o)),n.remove()})),u(".js-redeliver-hook-form",(async function(e,t){let n;try{n=await t.html()}catch(o){return void e.classList.add("failed")}document.querySelector(".js-hook-deliveries-container").replaceWith(n.html)})),u(".js-test-hook-form",(async function(e,t){const n=document.querySelector(".js-test-hook-message");n.classList.remove("error","success");try{await t.text()}catch(o){n.classList.add("error");const e=n.querySelector(".js-test-hook-message-errors");if(null!=o.response){const t=await o.response.json();e.textContent=t.errors}else e.textContent=e.getAttribute("data-network-error-message")||"";return}n.classList.add("success")})),m("[data-hotkey]",{constructor:HTMLElement,add(e){S(e)},remove(e){k(e)}});const Bo=document.querySelector(".js-hovercard-content"),Fo=xe(ke);let Wo,zo,Uo=null,Vo=0;function Xo(e){return"Popover-message--"+e}function Ko(){Bo instanceof HTMLElement&&(Bo.style.display="none",Bo.children[0].innerHTML="",Uo=null,Wo=null)}function Jo(e){const{width:t,height:n}=Bo.getBoundingClientRect(),{left:o,top:s,height:r,width:i}=function(e){const t=e.getClientRects();let n=t[0]||{top:0,left:0,height:0,width:0};for(const o of t)if(o.left<Vo&&o.right>Vo){n=o;break}return n}(e),a=s>n;if(e.classList.contains("js-hovercard-left")){const e=s+r/2;return{containerTop:a?e-n+17+8:e-17-8,containerLeft:o-t-12,contentClassSuffix:a?"right-bottom":"right-top"}}{const e=window.innerWidth-o>t,c=o+i/2;return{containerTop:a?s-n-12:s+r+12,containerLeft:e?c-24:c-t+24,contentClassSuffix:a?e?"bottom-left":"bottom-right":e?"top-left":"top-right"}}}function Go(e,t){if(!(Bo instanceof HTMLElement))return;const n=Bo.children[0];n.innerHTML="";const o=document.createElement("div");for(const s of e.children)o.appendChild(s.cloneNode(!0));n.appendChild(o),function(e,t){if(!(Bo instanceof HTMLElement))return;Bo.style.visibility="hidden",Bo.style.display="block",t.classList.remove(Xo("bottom-left"),Xo("bottom-right"),Xo("right-top"),Xo("right-bottom"),Xo("top-left"),Xo("top-right"));const{containerTop:n,containerLeft:o,contentClassSuffix:s}=Jo(e);t.classList.add(Xo(s)),Bo.style.top=n+window.pageYOffset+"px",Bo.style.left=o+window.pageXOffset+"px",function(e,t){const n=e.getAttribute("data-hovercard-z-index-override");t.style.zIndex=n||"100"}(e,Bo),Bo.style.visibility=""}(t,n),function(e){setTimeout((()=>{if(document.body&&document.body.contains(e)){const t=e.querySelector("[data-hovercard-tracking]");if(t){const e=t.getAttribute("data-hovercard-tracking");if(e){const t={event_type:"user-hovercard-load"};t.dimensions=JSON.parse(e),Fe(t)}}const n=e.querySelector("[data-hydro-view]");n instanceof HTMLElement&&We(n)}}),500)}(o),Bo.style.display="block"}function Yo(e){const t=e.getAttribute("data-hovercard-url");if(t){const n=function(e){const t=e.closest("[data-hovercard-subject-tag]");if(t)return t.getAttribute("data-hovercard-subject-tag");const n=document.head&&document.head.querySelector('meta[name="hovercard-subject-tag"]');return n?n.getAttribute("content"):null}(e);if(n){const e=new URL(t,window.location.origin),o=new URLSearchParams(e.search.slice(1));return o.append("subject",n),o.append("current_path",window.location.pathname+window.location.search),e.search=o.toString(),e.toString()}return t}return""}function Qo(e){!async function(e,t){const n=e.currentTarget;if(e instanceof MouseEvent&&(Vo=e.clientX),!(n instanceof Element))return;if(Wo===n)return;if(n.closest(".js-hovercard-content"))return;if(!function(e){const t=e.getAttribute("data-hovercard-type");return"pull_request"===t||"issue"===t?!!e.closest("[data-issue-and-pr-hovercards-enabled]"):"team"===t?!!e.closest("[data-team-hovercards-enabled]"):"repository"===t?!!e.closest("[data-repository-hovercards-enabled]"):"commit"===t?!!e.closest("[data-commit-hovercards-enabled]"):"project"===t?!!e.closest("[data-project-hovercards-enabled]"):"discussion"===t?!!e.closest("[data-discussion-hovercards-enabled]"):"acv_badge"!==t||!!e.closest("[data-acv-badge-hovercards-enabled]")}(n))return;Ko(),Wo=n,Uo=document.activeElement;const o=Yo(n);let s;try{const e=new Promise((e=>window.setTimeout(e,t,0)));s=await Fo(document,o),await e}catch(r){const e=r.response;if(e&&404===e.status){const e="Hovercard is unavailable";n.setAttribute("aria-label",e),n.classList.add("tooltipped","tooltipped-ne")}else if(e&&410===e.status){const t=await e.clone().json();n.setAttribute("aria-label",t.message),n.classList.add("tooltipped","tooltipped-ne")}return}n===Wo&&(Go(s,n),e instanceof KeyboardEvent&&Bo instanceof HTMLElement&&Bo.focus())}(e,250)}function Zo(e){if(Wo){if(e instanceof MouseEvent&&e.relatedTarget instanceof HTMLElement){const t=e.relatedTarget;if(t.closest(".js-hovercard-content")||t.closest("[data-hovercard-url]"))return}else e instanceof KeyboardEvent&&Uo instanceof HTMLElement&&Uo.focus();Ko()}}function es(e){const t=Wo;zo=window.setTimeout((()=>{Wo===t&&Zo(e)}),100)}function ts(e){if(e instanceof KeyboardEvent)switch(e.key){case"Escape":Zo(e)}}function ns(){zo&&clearTimeout(zo)}function os(e,t){const n=e.currentTarget;if(n instanceof Element){for(const e of n.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of n.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)}}function ss(e){os(e,!1)}function rs(e){os(e,!0)}function is(){t.import("./chunk-jump-to.js")}Bo&&(m("[data-hovercard-url]",{subscribe:e=>Me(se(e,"mouseover",Qo),se(e,"mouseleave",es),se(e,"keyup",ts))}),m("[data-hovercard-url]",{remove(e){Wo===e&&Ko()}}),m(".js-hovercard-content",{subscribe:e=>Me(se(e,"mouseover",ns),se(e,"mouseleave",Zo),se(e,"keyup",ts))}),m(".js-hovercard-include-fragment",{constructor:HTMLTemplateElement,add(e){Wo&&Go(e.content,Wo)}}),l("menu:activated","details",Ko),window.addEventListener("statechange",Ko)),l("click","[data-hydro-click]",(function(e){const t=e.currentTarget,n=t.getAttribute("data-hydro-click")||"",o=t.getAttribute("data-hydro-click-hmac")||"",s=t.getAttribute("data-hydro-client-context")||"";ze(n,o,s)})),l("click","[data-optimizely-hydro-click]",(function(e){const t=e.currentTarget,n=t.getAttribute("data-optimizely-hydro-click")||"",o=t.getAttribute("data-optimizely-hydro-click-hmac")||"";ze(n,o,"")})),u(".js-immediate-updates",(async function(e,t){let n;try{n=(await t.json()).json.updateContent}catch(o){o.response.json&&(n=o.response.json.updateContent)}if(n)for(const s in n){const e=n[s],t=document.querySelector(s);t instanceof HTMLElement&&Le(t,e)}})),m("include-fragment, poll-include-fragment",{subscribe:e=>Me(se(e,"error",rs),se(e,"loadstart",ss))}),l("click","include-fragment button[data-retry-button]",(({currentTarget:e})=>{const t=e.closest("include-fragment"),n=t.src;t.src="",t.src=n})),l("click",".js-timeout-flash-close",(function(e){e.target instanceof HTMLElement&&(e.target.closest(".js-interactive-component-timeout").hidden=!0)})),l("click",".js-interactive-component-button",(function(e){const t=e.target;if(t instanceof HTMLButtonElement){const e=t.querySelector(".js-loading-spinner");e instanceof HTMLElement&&(e.hidden=!1)}})),u(".js-interactive-component-form",(async function(e,t){const n=e.querySelector(".js-interactive-component-timeout"),o=e.closest(".js-component-container");if(n){n.hidden=!0;const t=o.querySelectorAll(".js-interactive-component-button");for(const e of t)e.disabled=!0;const s=parseInt(e.getAttribute("data-timeout"));setTimeout((()=>{if(n){n.hidden=!1;const e=o.querySelectorAll(".js-interactive-component-button[disabled]");for(const t of e){t.disabled=!1;const e=t.querySelector(".loading-spinner");e instanceof HTMLElement&&(e.hidden=!0)}}}),s)}await t.text()})),m("[data-indeterminate]",{constructor:HTMLInputElement,initialize(e){e.indeterminate=!0}}),m(".js-jump-to-field",{constructor:HTMLInputElement,add(e){e.addEventListener("focusin",is,{once:!0}),Ue(window.location.pathname)}});let as=!1;async function cs(){if(as)return;as=!0;const e={contexts:document.querySelector("meta[name=github-keyboard-shortcuts]").content},t="/site/keyboard_shortcuts?"+new URLSearchParams(e).toString();(await Te({content:ke(document,t),dialogClass:"hx_Box--overlay--wide"})).addEventListener("dialog:remove",(function(){as=!1}),{once:!0})}function ls(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=parseInt(t.getAttribute("data-input-max-length")||"",10),o=parseInt(t.getAttribute("data-warning-length")||"",10)||5,s=t.value.replace(/(\r\n|\n|\r)/g,"\r\n");let r=n-s.length;if(r<=0){let e=s.substr(0,n);e.endsWith("\r")?(e=e.substr(0,n-1),r=1):r=0,t.value=e}const i=t.getAttribute("data-warning-text"),a=t.closest(".js-length-limited-input-container").querySelector(".js-length-limited-input-warning");r<=o?(a.textContent=i.replace(new RegExp("{{remaining}}","g"),""+r),a.classList.remove("d-none")):(a.textContent="",a.classList.add("d-none"))}l("click",".js-keyboard-shortcuts",cs),document.addEventListener("keydown",(e=>{e.target instanceof Node&&Ve(e.target)||"?"===E(e)&&cs()})),m(".js-modifier-key",{constructor:HTMLElement,add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.textContent;t&&(t=t.replace(/ctrl/,"⌘"),t=t.replace(/alt/,"⌥"),e.textContent=t)}}}),m(".js-modifier-label-key",{add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.getAttribute("aria-label");t=t.replace(/ctrl\+/,"cmd-"),t=t.replace(/alt\+/,"option-"),e.setAttribute("aria-label",t)}}}),m(".js-length-limited-input",{add(e){e.addEventListener("input",ls),e.addEventListener("change",ls)},remove(e){e.removeEventListener("input",ls),e.removeEventListener("change",ls)}}),m("link[rel=prefetch-viewed]",{initialize(){window.requestIdleCallback((()=>{fetch(location.href,{method:"HEAD",credentials:"same-origin",headers:{Purpose:"prefetch-viewed"}})}))}}),l("click",".js-member-search-filter",(function(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-filter"),n=e.currentTarget.closest("[data-filter-on]").getAttribute("data-filter-on"),o=document.querySelector(".js-member-filter-field"),s=o.value,r=new RegExp(n+":(?:[a-z]|_|((').*(')))+"),i=s.toString().trim().replace(r,"");o.value=`${i} ${t}`.replace(/\s\s/," ").trim(),o.focus(),d(o,"input")})),l("auto-check-success",".js-new-organization-name",(function(e){const t=e.target,n=t.closest("dd").querySelector(".js-field-hint-name");n&&(n.textContent=t.value)})),u(".js-notice-dismiss",(async function(e,t){await t.text();e.closest(".js-notice").remove()})),async function(){await ge,window._octo&&(window._octo.push(["enablePerformance"]),window._octo.push(["recordPageView"]))}(),document.addEventListener("pjax:complete",(function(){window._octo&&window._octo.push(["recordPageView"])})),l("click",".js-permalink-shortcut",(function(e){const t=e.currentTarget;try{te(null,"",t.href+window.location.hash)}catch(n){window.location.href=t.href+window.location.hash}e.preventDefault()})),u(".js-permission-menu-form",(async function(e,t){const n=e.querySelector(".js-permission-success"),o=e.querySelector(".js-permission-error");let s;n.hidden=!0,o.hidden=!0,e.classList.add("is-loading");try{s=await t.json()}catch(i){return e.classList.remove("is-loading"),void(o.hidden=!1)}e.classList.remove("is-loading"),n.hidden=!1;const r=e.closest(".js-org-repo");if(r){const e=s.json;r.classList.toggle("with-higher-access",e.members_with_higher_access)}})),async function(){await we;const e=document.querySelector(".js-pjax-loader-bar");if(!e)return;const t=e.firstElementChild;if(!(t instanceof HTMLElement))return;let n=0,o=null,s=null;function r(e){t instanceof HTMLElement&&(0===e&&(null==s&&(s=getComputedStyle(t).transition),t.style.transition="none"),n=e,t.style.width=n+"%",0===e&&(t.clientWidth,t.style.transition=s||""))}function i(){0===n&&(n=12),r(Math.min(n+3,95)),o=window.setTimeout(i,500)}document.addEventListener("pjax:start",(function(){r(0),e&&e.classList.add("is-loading"),o=window.setTimeout(i,0)})),document.addEventListener("pjax:end",(function(){o&&clearTimeout(o),r(100),e&&e.classList.remove("is-loading")}))}();let us=null;const ds="last_pjax_request",ms="pjax_start",fs="pjax_end";"getEntriesByName"in window.performance&&(document.addEventListener("pjax:start",(function(e){e instanceof CustomEvent&&e.detail&&e.detail.url&&(window.performance.mark(ms),us=e.detail.url)})),document.addEventListener("pjax:end",(async function(){if(await oe(),!window.performance.getEntriesByName(ms).length)return;window.performance.mark(fs),window.performance.measure(ds,ms,fs);const e=window.performance.getEntriesByName(ds).pop(),t=e?e.duration:null;t&&(us&&be({requestUrl:us,pjaxDuration:Math.round(t)}),window.performance.clearMarks(ms),window.performance.clearMarks(fs),window.performance.clearMeasures(ds))}))),document.addEventListener("pjax:click",(function(e){if(window.onbeforeunload)return e.preventDefault()}));let hs=null;function ps(e){if(e instanceof window.Window)return"window";if(e instanceof window.Document)return"#document";const t=[e.nodeName.toLowerCase()],n=e.id;if(n&&t.push("#"+n),"function"==typeof e.getAttribute&&e.getAttribute("class")){const n=(e.getAttribute("class")||"").trim().split(/\s+/).join(".");n&&t.push("."+n)}return t.join("")}function gs(e,t){const n=e.closest("[data-pjax-container]");if(!n)throw new Error("no pjax container for "+function(e){const t=[];let n=e;for(;n&&(t.push(ps(n)),!(n instanceof window.Window))&&9!==n.nodeType&&!n.id;){if(n.parentNode instanceof Document){t.push("#document");break}if(!(n.parentNode instanceof HTMLElement))break;n=n.parentNode}return t.reverse().join(" > ")}(e));const o=function(e){if(e.id)return"#"+e.id;throw new Error("pjax container has no id")}(n),s=new URL(e.href,window.location.origin),r=new URLSearchParams(s.search.slice(1));return r.append("_pjax",encodeURIComponent(o)),s.search=r.toString(),fetch(s.href,{headers:Object.assign({Accept:"text/html","X-PJAX":"true","X-PJAX-Container":o,"X-Requested-With":"XMLHttpRequest"},t&&t.headers)})}function bs(e){return null==e.getAttribute("data-pjax-preserve-scroll")&&0}function ys(e){let t=e;for(;t;){const e=t.getAttribute("data-pjax");if(e&&"true"!==e)return document.querySelector(e);t=t.parentElement&&t.parentElement.closest("[data-pjax]")}return e.closest("[data-pjax-container]")}function vs(e){return e.href.replace(/#.*/,"")}l("pjax:click",".js-pjax-capture-input",(function(){hs=function(e){const t=e.createElement("textarea");return t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",e.body.appendChild(t),t.focus(),()=>(t.blur(),t.remove(),t.value)}(document)})),l("pjax:end","#js-repo-pjax-container",(function(){if(hs){const e=hs(),t=document.querySelector(".js-pjax-restore-captured-input");t instanceof HTMLInputElement&&e&&G(t,e),hs=null}})),l("pjax:click","#js-repo-pjax-container a[href]",(function(e){const t=e.currentTarget.pathname;var n,o;n=t,o=location.pathname,n.split("/",3).join("/")!==o.split("/",3).join("/")&&e.preventDefault()})),l("pjax:click",".js-comment-body",(function(e){const t=e.target;t instanceof HTMLAnchorElement&&"files"===t.pathname.split("/")[3]&&e.preventDefault()})),l("pjax:click",".js-pjax-history-navigate",(function(e){e.currentTarget instanceof HTMLAnchorElement&&(e.currentTarget.href===Xe()?(history.back(),e.detail.relatedEvent.preventDefault(),e.preventDefault()):e.currentTarget.href===Ke()&&(history.forward(),e.detail.relatedEvent.preventDefault(),e.preventDefault()))})),m("[data-pjax-container] link[rel=pjax-prefetch]",{constructor:HTMLLinkElement,initialize(e){const t=gs(e,{headers:{Purpose:"prefetch"}});Je("JS_HTTP_CACHE_HEADERS")||Ge(e,t)}}),l("click","[data-pjax] a, a[data-pjax]",(function(e){const t=e.currentTarget;if(t instanceof HTMLAnchorElement){if(null!=t.getAttribute("data-skip-pjax"))return;if(null!=t.getAttribute("data-remote"))return;const n=ys(t);n&&function(e,t){const n=e.currentTarget;if(0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;if(location.protocol!==n.protocol||location.hostname!==n.hostname)return;if(n.href.indexOf("#")>-1&&vs(n)===vs(location))return;if(e.defaultPrevented)return;const o=Object.assign({url:n.href,target:n},t),s=new CustomEvent("pjax:click",{bubbles:!0,cancelable:!0,detail:{options:o,relatedEvent:e}});n.dispatchEvent(s)&&(Ye(o),e.preventDefault(),n.dispatchEvent(new CustomEvent("pjax:clicked",{bubbles:!0,cancelable:!0,detail:{options:o}})))}(e,{container:n,scrollTo:bs(t)})}})),l("change","select[data-pjax]",(function(e){const t=e.currentTarget,n=ys(t);n&&Ye({url:t.value,container:n})})),l("submit","form[data-pjax]",(function(e){const t=e.currentTarget,n=ys(t);if(!n)return;const o=bs(t),s={type:(t.method||"GET").toUpperCase(),url:t.action,target:t,scrollTo:o,container:n};if("GET"===s.type){if(t.querySelector("input[type=file]"))return;const e=function(e){const t=document.createElement("a");return t.href=e,t}(s.url);e.search+=(e.search?"&":"")+Z(t),s.url=e.toString()}else s.data=new FormData(t);Ye(s),e.preventDefault()})),m("body.js-print-popup",(()=>{window.print(),setTimeout(window.close,1e3)})),m("poll-include-fragment[data-redirect-url]",(function(e){const t=e.getAttribute("data-redirect-url");e.addEventListener("load",(function(){window.location.href=t}))})),m("poll-include-fragment[data-reload]",(function(e){e.addEventListener("load",(function(){window.location.reload()}))}));let ws=!1,js=0;const Ls=Date.now();function Ss(e){var t;const n=function(e){return T(e.stack||"").map((e=>({filename:e.file||"",function:String(e.methodName),lineno:(e.lineNumber||0).toString(),colno:(e.column||0).toString()})))}(e),o=null!==(t=e.framesToPop)&&void 0!==t?t:0;return 0===o?n:n.slice(o)}const ks=/(chrome|moz|safari)-extension:\/\//;function Es(){var e,t;const n=null===(t=null===(e=document.head)||void 0===e?void 0:e.querySelector('meta[name="user-login"]'))||void 0===t?void 0:t.content;if(n)return n;const o=ye();return o?"anonymous-"+o:null}let Ts=!1;window.addEventListener("pageshow",(()=>Ts=!1)),window.addEventListener("pagehide",(()=>Ts=!0));const qs=document.querySelector("meta[name=js-proxy-site-detection-payload]"),As=document.querySelector("meta[name=expected-hostname]");if(qs instanceof HTMLMetaElement&&As instanceof HTMLMetaElement&&Ze(document)){const e={url:window.location.href,expectedHostname:As.content,documentHostname:document.location.hostname,proxyPayload:qs.content},t=new Error,n={};n.$__=btoa(JSON.stringify(e)),function(e,t={}){!async function(e){var t,n;if(!(!Ts&&!ws&&js<10&&"function"==typeof Blob&&"undefined"!=typeof Intl&&"undefined"!=typeof MutationObserver&&"undefined"!=typeof URLSearchParams&&"undefined"!=typeof WebSocket&&"undefined"!=typeof IntersectionObserver&&"undefined"!=typeof AbortController&&"undefined"!=typeof queueMicrotask&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder&&"undefined"!=typeof customElements&&"undefined"!=typeof HTMLDetailsElement&&"entries"in FormData.prototype&&"toggleAttribute"in Element.prototype&&"flatMap"in Array.prototype)||Ze(document))return;const o=null===(n=null===(t=document.head)||void 0===t?void 0:t.querySelector('meta[name="browser-errors-url"]'))||void 0===n?void 0:n.content;if(o)if(e.error.stacktrace.some((e=>ks.test(e.filename)||ks.test(e.function))))ws=!0;else{js++;try{await fetch(o,{method:"post",body:JSON.stringify(e)})}catch(s){}}}(function(e,t={}){return Object.assign({error:e,sanitizedUrl:Qe()||window.location.href,readyState:document.readyState,referrer:document.referrer,timeSinceLoad:Math.round(Date.now()-Ls),user:Es()||void 0},t)}(function(e){return{type:e.name,value:e.message,stacktrace:Ss(e)}}(e),t))}(t,n)}function xs(e){return"DIV"===e.nodeName&&e.classList.contains("highlight")}je("keydown",".js-quick-submit",(function(e){!function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&"Enter"===e.key){const n=t.form,o=n.querySelector("input[type=submit], button[type=submit]");if(e.shiftKey){const e=n.querySelector(".js-quick-submit-alternative");(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&!e.disabled&&re(n,e)}else(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&o.disabled||re(n);e.preventDefault()}}(e)})),m(".js-quote-selection-container",{subscribe:e=>q(e,{quoteMarkdown:e.hasAttribute("data-quote-markdown"),scopeSelector:e.getAttribute("data-quote-markdown")||"",copyMarkdown:!1})}),m(".js-comment-quote-reply-deferred",(function(e){const t=A(e);t&&(t.querySelector(".js-inline-comment-form-container")||x(t))&&e.classList.remove("d-none")})),document.addEventListener("quote-selection-markdown",(function(e){const t=e.detail,{fragment:n,range:o,unwrap:s}=t,r=o.startContainer.parentElement,i=r&&r.closest("pre");if(i instanceof HTMLElement&&!s){const e=i.parentElement;if(e&&xs(e)){const t=document.createElement("div");t.className=e.className,t.appendChild(n),n.appendChild(t)}}!function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.nodeName in Ms&&function(e){return"IMG"===e.nodeName||null!=e.firstChild}(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),n=[];let o=t.nextNode();for(;o;)o instanceof HTMLElement&&n.push(o),o=t.nextNode();n.reverse();for(const s of n)s.replaceWith(Ms[s.nodeName](s))}(n)}));const Ms={PRE(e){const t=e.parentElement;if(t&&xs(t)){const n=t.className.match(/highlight-source-(\S+)/),o=n?n[1]:"",s=(e.textContent||"").replace(/\n+$/,"");e.textContent=`\`\`\`${o}\n${s}\n\`\`\``,e.append("\n\n")}return e},A(e){const t=e.textContent||"";return e.classList.contains("user-mention")||e.classList.contains("team-mention")||e.classList.contains("issue-link")&&/^#\d+$/.test(t)?t:e},IMG(e){const t=e.getAttribute("alt");return t&&e.classList.contains("emoji")?t:e},DIV(e){if(e.classList.contains("js-suggested-changes-blob"))e.remove();else if(e.classList.contains("blob-wrapper-embedded")){const t=e.parentElement,n=t.querySelector("a[href]"),o=document.createElement("p");o.textContent=n.href,t.replaceWith(o)}return e}};let Cs,Hs;function _s(e){const t=e.target,n=t.getAttribute("data-reaction-label"),o=t.closest(".js-add-reaction-popover").querySelector(".js-reaction-description");o.hasAttribute("data-default-text")||o.setAttribute("data-default-text",o.textContent||""),o.textContent=n}function Is(e){const t=e.target.closest(".js-add-reaction-popover").querySelector(".js-reaction-description"),n=t.getAttribute("data-default-text");n&&(t.textContent=n)}l("click",".js-comment-quote-reply",(function({currentTarget:e}){const t=e.closest(".js-comment").querySelector(".js-comment-body");if(Hs&&"Range"===Hs.type&&t.contains(Hs.anchorNode))M(Hs.text,Hs.range);else{const e=window.getSelection();e.removeAllRanges(),e.selectAllChildren(t),M(e.toString(),e.getRangeAt(0))}})),document.addEventListener("selectionchange",h((function(){const e=window.getSelection();let t;try{t=e.getRangeAt(0)}catch(n){return void(Cs=null)}Cs={type:e.type,anchorNode:e.anchorNode,text:e.toString(),range:t}}),100)),document.addEventListener("toggle",(function(e){const t=e.target;if(!(t instanceof Element&&t.hasAttribute("open")))return;Hs=Cs;const n=t.querySelector(".js-comment-quote-reply.d-none");if(!n)return;const o=A(t);o&&(o.querySelector(".js-inline-comment-form-container")||x(o))&&n.classList.remove("d-none")}),{capture:!0}),u(".js-pick-reaction",(async function(e,t){const n=await t.json(),o=e.closest(".js-comment"),s=o.querySelector(".js-reactions-container"),r=o.querySelector(".js-comment-header-reaction-button"),i=ee(document,n.json.reactions_container.trim()),a=ee(document,n.json.comment_header_reaction_button.trim());s.replaceWith(i),r.replaceWith(a),o.classList.remove("is-reacting")})),l("toggle",".js-reaction-popover-container",(function(e){const t=e.currentTarget.hasAttribute("open");for(const n of e.target.querySelectorAll(".js-reaction-option-item"))t?(n.addEventListener("mouseenter",_s),n.addEventListener("mouseleave",Is)):(n.removeEventListener("mouseenter",_s),n.removeEventListener("mouseleave",Is));e.target.closest(".js-comment").classList.toggle("is-reacting",t)}),{capture:!0}),l("click",["form button:not([type])","form button[type=submit]","form input[type=submit]"].join(", "),(function(e){const t=e.currentTarget;t.form&&!e.defaultPrevented&&et(t)})),u("form[data-remote]",(function(e,t,n){"json"===e.getAttribute("data-type")&&n.headers.set("Accept","application/json"),d(e,"deprecatedAjaxSend",{request:n}),t.text().catch((e=>{if(e.response)return e.response;throw e})).then((t=>{t.status<300?d(e,"deprecatedAjaxSuccess"):d(e,"deprecatedAjaxError",{error:t.statusText,status:t.status,text:t.text})}),(t=>{d(e,"deprecatedAjaxError",{error:t.message,status:0,text:null})})).then((()=>{d(e,"deprecatedAjaxComplete")}))})),l("deprecatedAjaxComplete","form",(function({currentTarget:e}){const t=tt(e);t&&t.remove()})),w((e=>{const t=tt(e);t&&t.remove()})),C(Ie);let Ps=class RemotePaginationElement extends HTMLElement{constructor(){super(...arguments),this.loaderWasFocused=!1}connectedCallback(){this.setPaginationUrl(this.list)}get hasNextPage(){return!this.form.hidden}loadNextPage(){this.hasNextPage&&re(this.form)}get disabled(){return this.submitButton.hasAttribute("aria-disabled")}set disabled(e){e?this.submitButton.setAttribute("aria-disabled","true"):this.submitButton.removeAttribute("aria-disabled"),this.submitButton.classList.toggle("disabled",e)}loadstart(e){e.target.addEventListener("focus",(()=>{this.loaderWasFocused=!0}),{once:!0}),e.target.addEventListener("include-fragment-replaced",(()=>{var e;this.setPaginationUrl(this.list),this.loaderWasFocused&&(null===(e=this.focusMarkers.pop())||void 0===e||e.focus()),this.loaderWasFocused=!1}),{once:!0})}async submit(e){var t;if(e.preventDefault(),this.disabled)return;let n;this.disabled=!0;try{const e=await fetch(this.form.action);if(!e.ok)return;n=await e.text()}catch(s){return}const o=ee(document,n);this.setPaginationUrl(o),this.list.append(o),null===(t=this.focusMarkers.pop())||void 0===t||t.focus(),this.disabled=!1,this.dispatchEvent(new CustomEvent("remote-pagination-load"))}setPaginationUrl(e){const t=e.querySelector("[data-pagination-src]");if(!t)return;const n=t.getAttribute("data-pagination-src");n?(this.form.action=n,this.form.hidden=!1):this.form.hidden=!0}};n([o],Ps.prototype,"form",void 0),n([o],Ps.prototype,"list",void 0),n([s],Ps.prototype,"focusMarkers",void 0),n([o],Ps.prototype,"submitButton",void 0),Ps=n([r],Ps),m(".has-removed-contents",(function(){let e;return{add(t){e=Array.from(t.childNodes);for(const o of e)t.removeChild(o);const n=t.closest("form");n&&d(n,"change")},remove(t){for(const o of e)t.appendChild(o);const n=t.closest("form");n&&d(n,"change")}}}));const Rs=["is-render-pending","is-render-ready","is-render-loading","is-render-loaded"],Ds=new WeakMap;function $s(e){const t=Ds.get(e);null!=t&&(t.load=t.hello=null,t.helloTimer&&(clearTimeout(t.helloTimer),t.helloTimer=null),t.loadTimer&&(clearTimeout(t.loadTimer),t.loadTimer=null))}function Ns(e){e.classList.remove(...Rs),e.classList.add("is-render-failed"),$s(e)}function Os(e,t=!1){var n;!ie(e)||e.classList.contains("is-render-ready")||e.classList.contains("is-render-failed")||e.classList.contains("is-render-failed-fatally")||t&&!(null===(n=Ds.get(e))||void 0===n?void 0:n.hello)||Ns(e)}function Bs(e,t){e&&e.postMessage&&e.postMessage(JSON.stringify(t),"*")}m(".js-render-target",(function(e){var t;(null===(t=Ds.get(e))||void 0===t?void 0:t.load)||($s(e),Ds.get(e)||(Ds.set(e,{load:Date.now(),hello:null,helloTimer:window.setTimeout(Os,1e4,e,!0),loadTimer:window.setTimeout(Os,45e3,e)}),e.classList.add("is-render-automatic","is-render-requested")))})),window.addEventListener("message",(function(e){var t;let n=e.data;if(!n)return;if("string"==typeof n)try{n=JSON.parse(n)}catch(c){return}if("string"!=typeof n.type&&"render"!==n.type)return;const o=n.type;if("string"!=typeof n.identity)return;const s=n.identity;if("string"!=typeof n.body)return;const r=n.body;let i;for(const l of document.querySelectorAll(".js-render-target"))if(!s||l.getAttribute("data-identity")===s){i=l;break}if(!i)return;if(e.origin!==i.getAttribute("data-host"))return;const a=null!=n.payload?n.payload:void 0;switch(r){case"hello":{(Ds.get(i)||{untimed:!0}).hello=Date.now();const e={type:"render:cmd",body:{cmd:"ack",ack:!0}},n={type:"render:cmd",body:{cmd:"branding",branding:!1}},o=null===(t=i.querySelector("iframe"))||void 0===t?void 0:t.contentWindow;if(!o)return;if(Bs(o,e),Bs(o,n),i.classList.contains("is-local")){const e=i.closest(".js-code-editor"),t=e instanceof HTMLElement?nt(e):null;if(t){let e=null;const n=(n,s)=>{if(s&&"setValue"===s.origin)return;const r=t.code();r!==e&&(e=r,Bs(o,{type:"render:data",body:r}))};t.editor.on("change",n),n()}}}break;case"error":Ns(i);break;case"error:fatal":Ns(i),i.classList.add("is-render-failed-fatal");break;case"error:invalid":Ns(i),i.classList.add("is-render-failed-invalid");break;case"loading":i.classList.remove(...Rs),i.classList.add("is-render-loading");break;case"loaded":i.classList.remove(...Rs),i.classList.add("is-render-loaded");break;case"ready":i.classList.remove(...Rs),i.classList.add("is-render-ready"),a&&"number"==typeof a.height&&(i.style.height=a.height+"px"),d(i,"render:hook:afterready",{container:i,payload:a});break;case"resize":a&&"number"==typeof a.height&&(i.style.height=a.height+"px");break;case"data":d(i,"edit:visual",a);break;default:d(i,"render:hook:message",{type:o,body:r,payload:a})}})),u("form[data-replace-remote-form]",(async function(e,t){e.classList.remove("is-error"),e.classList.add("is-loading");try{let n=e;const o=await t.html(),s=e.closest("[data-replace-remote-form-target]");if(s){const e=s.getAttribute("data-replace-remote-form-target");n=e?document.getElementById(e):s}n.replaceWith(o.html)}catch(n){e.classList.remove("is-loading"),e.classList.add("is-error")}}));const Fs=new WeakMap;function Ws(e,t){e.style.visibility=t?"hidden":"";const n=e.getAttribute("data-tab-item");n&&(document.querySelector(`[data-menu-item=${n}]`).hidden=!t)}function zs(e,t){const n=e.querySelector(".js-responsive-underlinenav-overflow");let o=!1;for(const s of t){const t=ot(s,e);if(t){const r=e.offsetWidth-(t.left+s.offsetWidth)<=n.offsetWidth;Ws(s,r),o=o||r}}n.style.visibility=o?"":"hidden"}function Us(e){const t=e||window.location,n=document.head&&document.head.querySelector("meta[name=session-resume-id]");return n instanceof HTMLMetaElement&&n.content||t.pathname}l("click",".js-markdown-link-button",(async function({currentTarget:e}){const t=document.querySelector(".js-markdown-link-dialog").content.cloneNode(!0);if(!(t instanceof DocumentFragment))return;const n=await Te({content:t});var o;e instanceof HTMLElement&&Fs.set(n,(o=e,o.closest("markdown-toolbar").field).selectionEnd)})),l("click",".js-markdown-link-insert",(({currentTarget:e})=>{const t=e.closest("details-dialog"),n=document.querySelector("#"+e.getAttribute("data-for-textarea")),o=Fs.get(t)||0,s=t.querySelector("#js-dialog-link-href").value,r=`[${t.querySelector("#js-dialog-link-text").value}](${s}) `,i=n.value.slice(0,o),a=n.value.slice(o);n.value=i+r+a,n.focus(),n.selectionStart=n.selectionEnd=o+r.length})),m(".js-responsive-underlinenav",{constructor:HTMLElement,subscribe:e=>{const t=e.querySelectorAll(".js-responsive-underlinenav-item");return async function(e,t){await ge,zs(e,t)}(e,t),se(window,"resize",(()=>zs(e,t)))}}),l("details-menu-select",".js-saved-reply-menu",(function(e){if(!(e.target instanceof Element))return;const t=e.detail.relatedTarget.querySelector(".js-saved-reply-body");if(!t)return;const n=(t.textContent||"").trim(),o=e.target.closest(".js-previewable-comment-form").querySelector("textarea.js-comment-field");qe(o,n),setTimeout((()=>o.focus()),0)}),{capture:!0}),je("keydown",".js-saved-reply-shortcut-comment-field",(function(e){if("Control+."===E(e)){e.target.closest(".js-previewable-comment-form").querySelector(".js-saved-reply-container").setAttribute("open",""),e.preventDefault()}})),je("keydown",".js-saved-reply-filter-input",(function(e){if(/^Control\+[1-9]$/.test(E(e))){const t=e.target.closest(".js-saved-reply-container").querySelectorAll('[role="menuitem"]')[Number(e.key)-1];t instanceof HTMLElement&&(t.click(),e.preventDefault())}})),m(".js-highlight-code-snippet-columns",(function(e){const t=function(e){const t=parseInt(e.getAttribute("data-start-line")),n=parseInt(e.getAttribute("data-end-line")),o=parseInt(e.getAttribute("data-start-column")),s=parseInt(e.getAttribute("data-end-column"));return t!==n||t===n&&o===s?null:{start:{line:t,column:o},end:{line:n,column:0!==s?s:null}}}(e);null!==t&&function(e,t){const n=he(e,(e=>function(e,t){return e.querySelector("#LC"+t)}(t,e)));if(n){const e=document.createElement("span");e.classList.add("bg-yellow-2"),pe(n,e)}}(t,e)})),l("click",".js-segmented-nav-button",(function(e){e.preventDefault();const t=e.currentTarget,n=t.getAttribute("data-selected-tab"),o=t.closest(".js-segmented-nav"),s=o.parentElement;for(const r of o.querySelectorAll(".js-segmented-nav-button"))r.classList.remove("selected");t.classList.add("selected");for(const r of s.querySelectorAll(".js-selected-nav-tab"))r.parentElement===s&&r.classList.remove("active");document.querySelector("."+n).classList.add("active")})),window.addEventListener("submit",H,{capture:!0}),window.addEventListener("pageshow",(function(){_(Us())})),window.addEventListener("pjax:end",(function(){_(Us())})),window.addEventListener("pagehide",(function(){I(Us(),{selector:".js-session-resumable"})})),window.addEventListener("pjax:beforeReplace",(function(e){const t=e.detail.previousState,n=t?t.url:null;if(n)I(Us(new URL(n,window.location.origin)),{selector:".js-session-resumable"});else{const e=new Error("pjax:beforeReplace event.detail.previousState.url is undefined");setTimeout((function(){throw e}))}})),document.addEventListener("pjax:end",(function(){const e=document.querySelector('meta[name="selected-link"]'),t=e&&e.getAttribute("value");if(t)for(const n of document.querySelectorAll(".js-sidenav-container-pjax .js-selected-navigation-item")){const e=(n.getAttribute("data-selected-links")||"").split(" ").indexOf(t)>=0;n.classList.toggle("selected",e)}}));const Vs=["notification_referrer_id","notifications_before","notifications_after","notifications_query"],Xs="notification_shelf";function Ks(e,t=null){return e.has("notification_referrer_id")?(function(e,t){const n=Js(t);if(!n)return;const o={pathname:n};for(const s of Vs){const t=e.get(s);t&&(o[s]=t)}it(Xs,JSON.stringify(o))}(e,t),function(e){for(const t of Vs)e.delete(t);return e}(e)):null}function Js(e){const t=(e=e||window.location.pathname).match(/^(\/[^/]+\/[^/]+\/pull\/[^/]+)/);return t?t[0]:null}async function Gs(e){try{await e.text()}catch(t){}}function Ys(e,t){if(function(e){return!!e.closest(".js-jump-to-field")}(e))return;const n=document.querySelector(".js-site-search-form");let o,s;document.querySelector(".js-site-search").classList.toggle("scoped-search",t),t?(o=n.getAttribute("data-scoped-search-url"),s=e.getAttribute("data-scoped-placeholder")):(o=n.getAttribute("data-unscoped-search-url"),s=e.getAttribute("data-unscoped-placeholder")),n.setAttribute("action",o),e.setAttribute("placeholder",s)}!async function(){u(".js-notification-shelf .js-notification-action form",(async function(e,t){if(e.hasAttribute("data-redirect-to-inbox-on-submit")){await Gs(t);const e=document.querySelector(".js-notifications-back-to-inbox");e&&e.click()}else at(e,e),await Gs(t)}))}(),function(){const e=function(){const e=Ks(new URLSearchParams(window.location.search));if(e){const t=new URL(window.location.href,window.location.origin);return t.search=e.toString(),t.toString()}}();e&&te(null,"",e)}(),m(".js-notification-shelf-include-fragment",(function(e){if(!(e instanceof i))return;const t=function(e=null){const t=Js(e);if(!t)return st(Xs),null;try{const e=rt(Xs);if(!e)return null;const n=JSON.parse(e);if(!n||!n.pathname)throw new Error("Must have a pathname");if(n.pathname!==t)throw new Error("Stored pathname does not match current pathname.");const o={};for(const t of Vs)o[t]=n[t];return o}catch(n){return st(Xs),null}}();if(!t)return;const n=e.getAttribute("data-base-src");if(!n)return;const o=new URL(n,window.location.origin),s=new URLSearchParams(o.search);for(const[r,i]of Object.entries(t))"string"==typeof i&&s.set(r,i);o.search=s.toString(),e.setAttribute("src",o.toString())})),l("submit",".js-mark-notification-form",(async function(e){const t=e.currentTarget;e.preventDefault();try{await fetch(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}catch(n){}})),async function(){await ge;const e=document.querySelector(".js-mark-notification-form");e instanceof HTMLFormElement&&re(e)}(),je("keyup",".js-site-search-field",(function(e){const t=e.target,n=0===t.value.length;n&&"Backspace"===e.key&&t.classList.contains("is-clearable")&&Ys(t,!1),n&&"Escape"===e.key&&Ys(t,!0),t.classList.toggle("is-clearable",n)})),ne(".js-site-search-focus",(function(e){const t=e.closest(".js-chromeless-input-container");t.classList.add("focus"),e.addEventListener("blur",(function n(){t.classList.remove("focus"),0===e.value.length&&e.classList.contains("js-site-search-field")&&Ys(e,!0),e.removeEventListener("blur",n)}))})),l("submit",".js-site-search-form",(function(e){if(!(e.target instanceof Element))return;e.target.querySelector(".js-site-search-type-field").value=new URLSearchParams(window.location.search).get("type")||""})),m("textarea.js-size-to-fit",{constructor:HTMLTextAreaElement,subscribe:P}),l("click",".js-smoothscroll-anchor",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))return;const n=ct(document,t.hash);n&&(n.scrollIntoView({behavior:"smooth"}),e.preventDefault())})),u(".js-social-form",(async function(e,t){const n=await t.json(),o=e.closest(".js-social-container");for(const s of o.querySelectorAll(".js-social-count"))s.textContent=n.json.count}));class SubscriptionSet{constructor(){this.subscriptions=new R,this.signatures=new Map}add(...e){const t=[];for(const{subscriber:n,topic:o}of e)this.subscriptions.has(o.name)||(t.push(o),this.signatures.set(o.name,o)),this.subscriptions.set(o.name,n);return t}delete(...e){const t=[];for(const{subscriber:n,topic:o}of e){this.subscriptions.delete(o.name,n)&&!this.subscriptions.has(o.name)&&(t.push(o),this.signatures.delete(o.name))}return t}drain(...e){const t=[];for(const n of e)for(const e of this.subscriptions.drain(n)){const n=this.signatures.get(e);this.signatures.delete(e),t.push(n)}return t}topics(){return this.signatures.values()}topic(e){return this.signatures.get(e)||null}subscribers(e){return this.subscriptions.get(e).values()}}class Topic{constructor(e,t){this.name=e,this.signed=t,this.offset=""}static parse(e){const[t,n]=e.split("--");if(!t||!n)return null;const o=JSON.parse(atob(t));return o.c&&o.t?new Topic(o.c,e):null}}class AliveSession{constructor(e,t,n,o){this.subscriptions=new SubscriptionSet,this.state="online",this.retrying=null,this.refreshUrl=t,this.notify=o,this.shared=n,this.socket=this.connect(e)}subscribe(e){const t=this.subscriptions.add(...e);this.sendSubscribe(t)}unsubscribe(e){const t=this.subscriptions.delete(...e);this.sendUnsubscribe(t)}unsubscribeAll(...e){const t=this.subscriptions.drain(...e);this.sendUnsubscribe(t)}online(){var e;this.state="online",null===(e=this.retrying)||void 0===e||e.abort(),this.socket.open()}offline(){var e;this.state="offline",null===(e=this.retrying)||void 0===e||e.abort(),this.socket.close()}socketDidOpen(){this.sendSubscribe(this.subscriptions.topics())}socketDidClose(){}socketDidFinish(){"offline"!==this.state&&this.reconnect()}socketDidReceiveMessage(e,t){const n=JSON.parse(t);switch(n.e){case"ack":this.handleAck(n);break;case"msg":this.handleMessage(n)}}handleAck(e){for(const t of this.subscriptions.topics())t.offset=e.off}handleMessage(e){const t=e.ch,n=this.subscriptions.topic(t);n&&(n.offset=e.off,e.data.wait||(e.data.wait=0),this.notify(this.subscriptions.subscribers(t),t,e.data))}async reconnect(){if(!this.retrying)try{this.retrying=new AbortController;const e=()=>async function(e){const t=await async function(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(t.ok)return t.json();throw new Error("fetch error")}(e);return t.url&&t.token?async function(e,t){const n=await fetch(e,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":t}});if(n.ok)return n.text();throw new Error("fetch error")}(t.url,t.token):null}(this.refreshUrl),t=await lt(e,1/0,6e4,this.retrying.signal);t&&(this.socket=this.connect(t))}catch(e){if("AbortError"!==e.name)throw e}finally{this.retrying=null}}connect(e){const t=new URL(e,self.location.origin);t.searchParams.set("shared",this.shared.toString());const n=new D(t.toString(),this,{timeout:4e3,attempts:7});return n.open(),n}sendSubscribe(e){const t=Array.from(e,(e=>[e.signed,e.offset]));for(const n of ut(t,25))this.socket.send(JSON.stringify({subscribe:Object.fromEntries(n)}))}sendUnsubscribe(e){const t=Array.from(e,(e=>e.signed));for(const n of ut(t,25))this.socket.send(JSON.stringify({unsubscribe:n}))}}function Qs(e){return(e.getAttribute("data-channel")||"").trim().split(/\s+/).map(Topic.parse).filter(Zs)}function Zs(e){return null!=e}function er(e,t,n){for(const o of e)o.dispatchEvent(new CustomEvent("socket:message",{bubbles:!1,cancelable:!1,detail:{name:t,data:n}}))}class AliveSessionProxy{constructor(e,t,n,o){this.subscriptions=new SubscriptionSet,this.notify=o,this.worker=new SharedWorker(e,"github-socket-worker-v1"),this.worker.port.onmessage=({data:e})=>this.receive(e),this.worker.port.postMessage({connect:{url:t,refreshUrl:n}})}subscribe(e){const t=this.subscriptions.add(...e);t.length&&this.worker.port.postMessage({subscribe:t})}unsubscribeAll(...e){const t=this.subscriptions.drain(...e);t.length&&this.worker.port.postMessage({unsubscribe:t})}online(){this.worker.port.postMessage({online:!0})}offline(){this.worker.port.postMessage({online:!1})}hangup(){this.worker.port.postMessage({hangup:!0})}receive(e){const{name:t,data:n}=e;this.notify(this.subscriptions.subscribers(t),t,n)}}function tr(){const e=null!==(n=null===(t=document.head.querySelector("link[rel=shared-web-socket-src]"))||void 0===t?void 0:t.href)&&void 0!==n?n:null;var t,n;if(!e)return;const o=function(){var e,t;return null!==(t=null===(e=document.head.querySelector("link[rel=shared-web-socket]"))||void 0===e?void 0:e.href)&&void 0!==t?t:null}();if(!o)return;const s=function(){var e,t;return null!==(t=null===(e=document.head.querySelector("link[rel=shared-web-socket]"))||void 0===e?void 0:e.getAttribute("data-refresh-url"))&&void 0!==t?t:null}();if(!s)return;const r="SharedWorker"in window?new AliveSessionProxy(e,o,s,er):new AliveSession(o,s,!1,er),i=dt((e=>r.subscribe(e.flat()))),a=dt((e=>r.unsubscribeAll(...e)));m(".js-socket-channel[data-channel]",{add:e=>i(function(e){return Qs(e).map((t=>({subscriber:e,topic:t})))}(e)),remove:e=>a(e)}),window.addEventListener("online",(()=>r.online())),window.addEventListener("offline",(()=>r.offline())),window.addEventListener("unload",(()=>{"hangup"in r&&r.hangup()}))}(async()=>{await we,tr()})();const nr=new Map;function or(e,t){const n=[];for(const o of e){const e=nr.get(o.name);e&&e.arrived>t&&n.push(e)}return n}function sr(e){const t=document.querySelector(".js-stale-session-flash"),n=t.querySelector(".js-stale-session-flash-signed-in"),o=t.querySelector(".js-stale-session-flash-signed-out");t.hidden=!1,n.hidden="false"===e,o.hidden="true"===e,window.addEventListener("popstate",(function(e){e.state&&null!=e.state.container&&location.reload()})),document.addEventListener("submit",(function(e){e.preventDefault()}))}let rr;if(document.addEventListener("socket:message",(function(e){const{name:t,data:n,cached:o}=e.detail;if(o)return;const s={name:t,data:Object.assign({},n),arrived:Date.now()};s.data.wait=0,nr.set(t,s)}),{capture:!0}),document.addEventListener("pjax:popstate",(function(e){const t=e.target,n=e.detail.cachedAt;n&&setTimeout((()=>function(e,t){for(const n of e.querySelectorAll(".js-socket-channel[data-channel]"))for(const e of or(Qs(n),t))n.dispatchEvent(new CustomEvent("socket:message",{bubbles:!1,cancelable:!1,detail:{name:e.name,data:e.data,cached:!0}}))}(t,n)))})),m("form.js-auto-replay-enforced-sso-request",{constructor:HTMLFormElement,initialize(e){re(e)}}),"function"==typeof BroadcastChannel)try{rr=new BroadcastChannel("stale-session"),rr.onmessage=e=>{"string"==typeof e.data&&sr(e.data)}}catch(Ni){}if(!rr){let e=!1;rr={postMessage(t){e=!0;try{window.localStorage.setItem("logged-in",t)}finally{e=!1}}},window.addEventListener("storage",(function(t){if(!e&&t.storageArea===window.localStorage&&"logged-in"===t.key)try{"true"!==t.newValue&&"false"!==t.newValue||sr(t.newValue)}finally{window.localStorage.removeItem(t.key)}}))}const ir=document.querySelector(".js-stale-session-flash[data-signedin]");if(ir){const e=ir.getAttribute("data-signedin")||"";rr.postMessage(e)}function ar(e,t,n){const o=e.getBoundingClientRect().height,s=t.getBoundingClientRect(),r=n.getBoundingClientRect();let i=r.top;i+s.height+10>=o&&(i=Math.max(o-s.height-10,0));let a=r.right;null!=n.closest(".js-build-status-to-the-left")&&(a=Math.max(r.left-s.width-10,0)),t.style.top=i+"px",t.style.left=a+"px",t.style.right="auto"}async function cr(e){const t=e.querySelector(".js-dropdown-details"),n=e.querySelector(".js-status-dropdown-menu")||e.closest(".js-status-dropdown-menu");if(!(n instanceof HTMLElement))return;const o=n.querySelector(".js-status-loader");if(!o)return;const s=n.querySelector(".js-status-loading"),r=n.querySelector(".js-status-error"),i=o.getAttribute("data-contents-url");let a;s.classList.remove("d-none"),r.classList.add("d-none");try{await Ie(),a=await ke(document,i)}catch(c){s.classList.add("d-none"),r.classList.remove("d-none")}a&&(o.replaceWith(a),n.querySelector(".js-details-container").classList.add("open"),t&&n.classList.contains("js-append-menu-to-body")&&ar(document.body,n,t))}function lr(e){cr(e.currentTarget)}async function ur(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;e.stopPropagation(),e.preventDefault();await mt()&&(t.removeAttribute("data-sudo-required"),t instanceof HTMLFormElement?re(t):t.click())}l("toggle",".js-build-status .js-dropdown-details",(function(e){const t=e.currentTarget,n=t.querySelector(".js-status-dropdown-menu");function o(){t.hasAttribute("open")||r()}function s(e){n.contains(e.target)||r()}function r(){t.removeAttribute("open"),n.classList.add("d-none"),t.appendChild(n),t.removeEventListener("toggle",o),window.removeEventListener("scroll",s)}n&&(t.addEventListener("toggle",o),n.classList.contains("js-close-menu-on-scroll")&&window.addEventListener("scroll",s,{capture:!0}),n.classList.remove("d-none"),n.querySelector(".js-details-container").classList.add("open"),n.classList.contains("js-append-menu-to-body")&&(document.body.appendChild(n),ar(document.body,n,t)))}),{capture:!0}),l("click",".js-status-retry",(({currentTarget:e})=>{cr(e)})),m(".js-build-status",{add(e){e.addEventListener("mouseenter",lr,{once:!0})},remove(e){e.removeEventListener("mouseenter",lr)}}),l("click","button[data-sudo-required], summary[data-sudo-required]",ur),m("form[data-sudo-required]",{constructor:HTMLFormElement,subscribe:e=>se(e,"submit",ur)});const dr={"actor:":"ul.js-user-suggestions","user:":"ul.js-user-suggestions","operation:":"ul.js-operation-suggestions","org:":"ul.js-org-suggestions","action:":"ul.js-action-suggestions","repo:":"ul.js-repo-suggestions","country:":"ul.js-country-suggestions"};function mr(e){const t=e.detail;if(!pr(t.key))return;const n=t.item.getAttribute("data-value");t.value=`${t.key}${n}`}function fr(e){const{key:t,provide:n,text:o}=e.detail;if(!pr(t))return;n(async function(e,t,n){const o=(await gr(e)).querySelector(function(e){const t=dr[e];if(!t)throw new Error("Unknown audit log expander key: "+e);return t}(t));if(!o)return{matched:!1};const s=function(e,t){const n=t.toLowerCase(),o=e=>{const t=e.textContent.toLowerCase().trim(),o=Re(t,n);return o>0?{score:o,text:t}:null};return n?He(e,o,_e):e}(hr(o),n).slice(0,5),r=o.cloneNode(!1);r.innerHTML="";for(const i of s)r.append(i);return{fragment:r,matched:s.length>0}}(e.target.getAttribute("data-audit-url"),t,o))}m("text-expander[data-audit-url]",{subscribe:e=>Me(se(e,"text-expander-change",fr),se(e,"text-expander-value",mr))});const hr=xe((e=>[...e.children]),{hash:e=>e.className});function pr(e){return Object.getOwnPropertyNames(dr).includes(e)}const gr=xe((async function(e){const t=await ke(document,e),n=document.createElement("div");return n.append(t),n}));function br(e){const t=e.detail;":"===t.key&&(t.value=function(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&"G-EMOJI"===t.tagName&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")}(t.item))}function yr(e){const{key:t,provide:n,text:o}=e.detail;if(":"!==t)return;n(async function(e,t){const[n,o]=await vr(e),s=function(e,t){const n=" "+t.toLowerCase().replace(/_/g," ");return He(e,(e=>{const t=e.getAttribute("data-emoji-name"),o=function(e,t){const n=e.indexOf(t);return n>-1?1e3-n:0}(function(e){return" "+e.getAttribute("data-text").trim().toLowerCase().replace(/_/g," ")}(e),n);return o>0?{score:o,text:t}:null}),_e)}(o,t).slice(0,5);n.innerHTML="";for(const r of s)n.append(r);return{fragment:n,matched:s.length>0}}(e.target.getAttribute("data-emoji-url"),o))}m("text-expander[data-emoji-url]",{subscribe:e=>Me(se(e,"text-expander-change",yr),se(e,"text-expander-value",br))});const vr=xe((async function(e){const t=(await ke(document,e)).firstElementChild;return[t,[...t.children]]}));function wr(e){const t=e.detail;if("#"!==t.key)return;const n=t.item.getAttribute("data-value");t.value="#"+n}function jr(e){const{key:t,provide:n,text:o}=e.detail;if("#"!==t)return;if("#"===o)return void Lr(e.target);n(async function(e,t){const n=await Er(e),o=document.createElement("div"),s=function(e,t){if(!t)return e;const n=new RegExp("\\b"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),o=/^\d+$/.test(t)?e=>function(e,t){const n=e.search(t);return n>-1?1e3-n:0}(e,n):e=>Re(e,t);return He(e,(e=>{const t=function(e){return`${e.number} ${e.title.trim().toLowerCase()}`}(e),n=o(t);return n>0?{score:n,text:t}:null}),_e)}(n.suggestions,t).slice(0,5);!function(e,t,n){const o=e=>{const t=e.type in n?ee(document,n[e.type]):"";return N`
<li role="option" id="suggester-issue-${e.id}" data-value="${e.number}">
<span class="d-inline-block mr-1">${t}</span> <small>#${e.number}</small> ${e.title}
</li>
`};$(N`
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
${e.map(o)}
</ul>
`,t)}(s,o,n.icons);return{fragment:o.firstElementChild,matched:s.length>0}}(e.target.getAttribute("data-issue-url"),o))}function Lr(e){if(!e)return;const t=e.closest("text-expander");t&&t.dismiss()}function Sr(e){Lr(e.target)}function kr(e){const{key:t}=e;["ArrowRight","ArrowLeft"].indexOf(t)<0||Lr(e.target)}m("text-expander[data-issue-url]",{subscribe:e=>{const t=[se(e,"text-expander-change",jr),se(e,"text-expander-value",wr)];return Je("MULTI_WORD_SUGGESTER")&&t.push(se(e,"keydown",kr),se(e,"click",Sr)),Me(...t)}});const Er=xe((async function(e){const t=await self.fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!t.ok){const e=new Error,n=t.statusText?" "+t.statusText:"";throw e.message=`HTTP ${t.status}${n}`,e}return t.json()}));function Tr(e,t){if(!t)return e;const n=function(e){if(!e)return()=>2;const t=e.toLowerCase().split("");return n=>{if(!n)return 0;const o=function(e,t){let n,o,s,r;const i=function(e,t){let n=0;const o=[];for(;(n=e.indexOf(t,n))>-1;)o.push(n++);return o}(e,t[0]);if(0===i.length)return null;if(1===t.length)return[i[0],1,[]];for(r=null,o=0,s=i.length;o<s;o++){const s=i[o];if(!(n=qr(e,t,s+1)))continue;const a=n[n.length-1]-s;(!r||a<r[1])&&(r=[s,a,n])}return r}(n,t);if(!o)return 0;return e.length/o[1]/(o[0]/2+1)}}(t);return He(e,(e=>{const t=function(e){return e.description?`${e.name} ${e.description}`.trim().toLowerCase():`${e.login} ${e.name}`.trim().toLowerCase()}(e),o=n(t);return o>0?{score:o,text:t}:null}),_e)}function qr(e,t,n){let o=n;const s=[];for(let r=1;r<t.length;r+=1){if(o=e.indexOf(t[r],o),-1===o)return;s.push(o++)}return s}function Ar(e){const t=e.detail;if("@"!==t.key)return;const n=t.item.getAttribute("data-value");t.value="@"+n}function xr(e){const{key:t,provide:n,text:o}=e.detail;if("@"!==t)return;if((null==o?void 0:o.split(" ").length)>1)return;n(async function(e,t){const n=await Mr(e),o=document.createElement("div"),s=Tr(n,t).slice(0,5);!function(e,t){const n=e=>{const t="user"===e.type?e.login:e.name,n="user"===e.type?e.name:e.description;return B`
<li role="option" id="suggester-${e.id}-${e.type}-${t}" data-value="${t}">
<span>${t}</span>
<small>${n}</small>
</li>
`};O(B`
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
${e.map(n)}
</ul>
`,t)}(s,o);return{fragment:o.firstElementChild,matched:s.length>0}}(e.target.getAttribute("data-mention-url"),o))}m("text-expander[data-mention-url]",{subscribe:e=>Me(se(e,"text-expander-change",xr),se(e,"text-expander-value",Ar))});const Mr=xe((async function(e){const t=await self.fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!t.ok){const e=new Error,n=t.statusText?" "+t.statusText:"";throw e.message=`HTTP ${t.status}${n}`,e}return t.json()}));async function Cr(e){const t=e.detail,{key:n,item:o}=t;if("/"!==n)return;const s=o.getAttribute("data-url");if(!s)return;const r=e.currentTarget,i=o.querySelector(".js-slash-command-suggestion-form");if(!i)return;const a=i.querySelector(".js-data-url-csrf");if(!a)return;const c=new FormData(i);r.isLoading();const l=await ke(document,s,{method:"PATCH",body:c,headers:{Accept:"text/html","Scoped-CSRF-Token":a.value}});l&&Hr(r,l)}function Hr(e,t){const n=t.firstElementChild;if(!n)return;t.children.length>1&&function(e,t){var n,o;const s=null===(n=t.parentElement)||void 0===n?void 0:n.parentElement;if(!s)return;const r=s.querySelector(".drag-and-drop .default");let i=!1;r&&(i=r.hidden,r.hidden=!0);null===(o=null==r?void 0:r.parentElement)||void 0===o||o.prepend(e),setTimeout((()=>{r&&(r.hidden=i),e.remove()}),5e3)}(t.lastElementChild,e),n.hasAttribute("data-reload-suggestions")&&(Br=xe(Or));const o=n.getAttribute("data-component-type");"fill"===o?e.setValue(n.innerHTML.trim()):"menu"===o?e.setMenu(n.querySelector(".js-slash-command-menu")):"action"===o?e.closeMenu():"embedded_form"===o?function(e,t){const n=e.closest(".js-slash-command-surface"),o=e.closest("form"),s=n||o;if(!s)return;s.hidden=!0;const r=t.querySelector('[data-component="form"]');s.insertAdjacentElement("afterend",r);const i=document.activeElement;Pr(r);const a=()=>{s.hidden=!1,r.remove()};Rr(r,a);Dr(r.getElementsByTagName("form")[0],r,i,a),$r(r,e,a)}(e,n):"dialog_form"===o?function(e,t){const n=t.querySelector(".js-slash-command-menu");e.setMenu(n,!0);const o=n.querySelector("form"),s=document.activeElement;Pr(o);const r=()=>{e.closeMenu()};Dr(o,o,s,r),Rr(o,r),$r(o,e,r)}(e,n):"modal_form"===o&&function(e,t){const n=e.closest("form");if(!n)return;const o=t.querySelector('[data-component="form"]');n.insertAdjacentElement("afterend",o);const s=document.activeElement;Pr(o);const r=()=>{n.hidden=!1,o.remove()};Rr(o,r);Dr(o.getElementsByTagName("form")[0],o,s,r),$r(o,e,r)}(e,n)}function _r(e){if(!e.metaKey||"Enter"!==e.key)return;e.preventDefault(),e.stopPropagation();const t=e.target,n=null==t?void 0:t.form;if(n)if(n.requestSubmit)n.requestSubmit();else{const e=n.querySelector("[type='submit']");null==e||e.click()}}function Ir(e){const t=new FormData(e);let n="";for(const o of t)n+=o[0],n+=o[1].toString();return n}function Pr(e){let t=!1;for(const n of e.querySelectorAll("select,input,textarea")){const e=n;"hidden"!==e.type&&(t||(e.focus(),t=!0),e.addEventListener("keydown",_r))}}function Rr(e,t){const n=e.querySelectorAll("[data-close-dialog]");for(const o of n)o.addEventListener("click",(e=>{e.preventDefault(),t()}))}function Dr(e,t,n,o){const s=Ir(e);t.addEventListener("keydown",(t=>{if("Escape"===t.key){const t="Would you like to clear the form?",r=Ir(e);(s===r||confirm(t))&&(o(),n&&n.focus())}}))}function $r(e,t,n){e.addEventListener("submit",(async e=>{e.preventDefault();const o=e.target,s=o.querySelector(".js-data-url-csrf");if(!s)return;const r=o.getAttribute("action");if(!r)return;const i=new FormData(o),a=await ke(document,r,{method:"PATCH",body:i,headers:{Accept:"text/html","Scoped-CSRF-Token":s.value}});n(),a&&Hr(t,a)}))}m("slash-command-expander[data-slash-command-url]",{subscribe:e=>Me(se(e,"text-expander-change",Nr),se(e,"text-expander-value",Cr))}),l("click",".js-slash-command-toolbar-button",(async e=>{if(!(e.target instanceof Element))return;const t=e.target.closest(".js-previewable-comment-form");if(!t)return;const n=t.querySelector("textarea.js-comment-field");if(!n)return;const o=n.selectionEnd||0,s=n.value.substring(0,o),r=n.value.substring(o),i=""===n.value||s.match(/\s$/)?"":" ",a=o+"/".length+1;n.value=s+i+"/"+r,n.selectionStart=a,n.selectionEnd=a,n.focus(),d(n,"input")}));function Nr(e){const{key:t,provide:n,text:o}=e.detail;if("/"!==t)return;const s=e.target;s.isLoading();n(async function(e,t){const[n,o]=await Br(e),s=n.querySelector(".js-slash-command-menu-items"),r=function(e,t){const n=t.toLowerCase().trim();return n?He(e,(e=>{const t=(e.getAttribute("data-text")||"").trim().toLowerCase(),o=Re(t,n);return o>0?{score:o,text:t}:null}),_e):e}(o,t);if(s){s.innerHTML="";for(const e of r)s.append(e)}return{fragment:n,matched:r.length>0}}(s.getAttribute("data-slash-command-url"),o))}async function Or(e){const t=(await ke(document,e)).firstElementChild,n=t.querySelectorAll(".js-slash-command-menu-items li");return[t,[...n]]}let Br=xe(Or);l("click",".js-dismiss-sparkle-onboarding-notice-button",(async function(){const e=document.querySelector(".js-dismiss-sparkle-onboarding-notice");if(!e)return;const t=e.parentElement;t instanceof HTMLDetailsElement&&(t.open=!1)}));let Fr,Wr=!1;function zr(e,t){const n=e.closest(".js-survey-question-form"),o=n.querySelector("input.js-survey-other-text"),s=t&&!n.classList.contains("is-other-selected");n.classList.toggle("is-other-selected",s),o.hidden=!t,s?(o.required=!0,o.focus()):o.required=!1,d(o,"change")}l("click",".js-sparkle-button",(async function(e){if(!(e.target instanceof Element))return;const t=e.currentTarget.getAttribute("data-sparkle-command");if(!t)return;const n=e.target.closest(".js-previewable-comment-form");if(!n)return;!function(e,t){const n=e.querySelector("textarea.js-comment-field");n&&(qe(n,t),n.focus(),d(n,"input"))}(n,t);if(!e.currentTarget.hasAttribute("data-url"))return;const o=e.currentTarget.getAttribute("data-url");if(!o)return;const s=e.currentTarget.parentElement;s&&async function(e,t){let n;try{n=await ke(document,e)}catch(o){return}t.appendChild(n)}(o,s)})),le("[data-sparkles-enabled] .js-comment-field",(async function(e){const t=e.target,n=t.form,o=document.querySelector(".js-sparkle-metadata");if(!o)return;const s=o.getAttribute("data-keyword"),r=o.getAttribute("data-count-url"),i=n.querySelector(".js-button-sparkle-emoji");new RegExp("^/"+s).exec(t.value)?((async e=>{const t=document.querySelector(".js-sparkles-remaining-container");if(!t)return null;if(Fr)return void(Fr.hidden=!1);if(Wr)return null;Wr=!0;const n=(await ke(document,e)).querySelector(".js-sparkles-remaining-container");if(!(n instanceof HTMLElement))return null;t.replaceWith(n),n.hidden=!1,Fr=n})(r),i.hidden=!1):Fr&&(Fr.hidden=!0,i.hidden=!0)})),l("comment:success","form",(function(){Fr&&(Fr.hidden=!0,Wr=!1,Fr=null)})),l("change","input.js-survey-radio",(function({currentTarget:e}){zr(e,e.classList.contains("js-survey-radio-other"))})),l("change","input.js-survey-checkbox-other",(function({currentTarget:e}){zr(e,!0)})),l("change","input.js-survey-contact-checkbox",(function(e){const t=e.currentTarget,n=t.closest(".js-survey-question-form").querySelector(".js-survey-contact-checkbox-hidden");t.checked?n.setAttribute("disabled","true"):n.removeAttribute("disabled")})),l("details-menu-selected",".js-sync-select-menu-text",(function(e){const t=document.querySelector(".js-sync-select-menu-button"),n=e.detail.relatedTarget.querySelector("span[data-menu-button-text]").textContent;t.textContent=n,t.focus()}),{capture:!0}),l("click",'tab-container [role="tab"]',(function(e){const{currentTarget:t}=e,n=t.closest("tab-container").querySelector(".js-filterable-field, [data-filter-placeholder-input]");if(n instanceof HTMLInputElement){const e=t.getAttribute("data-filter-placeholder");e&&n.setAttribute("placeholder",e),n.focus()}})),l("tab-container-changed","tab-container",(function(e){const t=e.detail.relatedTarget,n=t.getAttribute("data-fragment-url"),o=t.querySelector("include-fragment");n&&o&&!o.hasAttribute("src")&&(o.src=n)}));class TagInput{constructor(e){this.container=e.container,this.selections=e.selections,this.inputWrap=e.inputWrap,this.input=e.input,this.tagTemplate=e.tagTemplate,this.form=this.input.form,this.autoComplete=e.autoComplete}setup(){this.container.addEventListener("click",(e=>{e.target.closest(".js-remove")?this.removeTag(e):this.onFocus()})),this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.addEventListener("blur",this.onBlur.bind(this)),this.input.addEventListener("keydown",this.onKeyDown.bind(this)),this.form.addEventListener("submit",this.onSubmit.bind(this)),this.autoComplete.addEventListener("auto-complete-change",(()=>{this.selectTag(this.autoComplete.value)}))}onFocus(){this.inputWrap.classList.add("focus"),this.input!==document.activeElement&&this.input.focus()}onBlur(){this.inputWrap.classList.remove("focus"),this.autoComplete.open||this.onSubmit()}onSubmit(){this.input.value&&(this.selectTag(this.input.value),this.autoComplete.open=!1)}onKeyDown(e){switch(E(e)){case"Backspace":this.onBackspace();break;case"Enter":case"Tab":this.taggifyValueWhenSuggesterHidden(e);break;case",":case" ":this.taggifyValue(e)}}taggifyValueWhenSuggesterHidden(e){!this.autoComplete.open&&this.input.value&&(e.preventDefault(),this.selectTag(this.input.value))}taggifyValue(e){this.input.value&&(e.preventDefault(),this.selectTag(this.input.value),this.autoComplete.open=!1)}selectTag(e){const t=this.normalizeTag(e),n=this.selectedTags();t&&n.indexOf(t)<0&&(this.selections.appendChild(this.templateTag(t)),this.input.value="",d(this.form,"tags:changed"))}removeTag(e){const t=e.target;e.preventDefault();t.closest(".js-tag-input-tag").remove(),d(this.form,"tags:changed")}templateTag(e){const t=this.tagTemplate.cloneNode(!0);t.querySelector("input").value=e;return t.querySelector(".js-placeholder-tag-name").replaceWith(e),t.classList.remove("d-none","js-template"),t}normalizeTag(e){return e.toLowerCase().trim().replace(/[\s,']+/g,"-")}onBackspace(){if(!this.input.value){const e=this.selections.querySelector("li:last-child .js-remove");e instanceof HTMLElement&&e.click()}}selectedTags(){const e=this.selections.querySelectorAll("input");return Array.from(e).map((e=>e.value)).filter((e=>e.length>0))}}async function Ur(e){const t=e.currentTarget;if(function(e){return!!e.getAttribute("data-hovercard-url")&&!!e.closest("[data-team-hovercards-enabled]")}(t))return void t.classList.remove("tooltipped");const n=t.getAttribute("data-url");if(!n)return;const o=await fetch(n,{headers:{Accept:"application/json"}});if(!o.ok)return;const s=await o.json(),r=t.getAttribute("data-id"),i=document.querySelectorAll(`.js-team-mention[data-id='${r}']`);for(const c of i)c.removeAttribute("data-url");try{0===s.total?s.members.push("This team has no members"):s.total>s.members.length&&s.members.push(s.total-s.members.length+" more"),Vr(i,function(e){if("ListFormat"in Intl){return(new Intl.ListFormat).format(e)}if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return e.join(" and ");{const t=e[e.length-1];return e.slice(0,-1).concat("and "+t).join(", ")}}(s.members))}catch(a){const e=a.response?a.response.status:500;Vr(i,t.getAttribute(404===e?"data-permission-text":"data-error-text"))}}function Vr(e,t){for(const n of e)n instanceof HTMLElement&&(n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline"))}function Xr(e){if(function(e){let t;try{t=new URL(e.url)}catch(n){return!0}return t.host!==window.location.host}(e)||function(e){return/[?&]_pjax=/.test(e.url)}(e))return;const t=function(){const e=document.querySelector(".js-timeline-marker");return null!=e?e.getAttribute("data-last-modified"):null}();t&&e.headers.set("X-Timeline-Last-Modified",t)}function Kr(e){!function(e){const t=e.closest("details, .js-details-container");if(!t)return;"DETAILS"===t.nodeName?t.setAttribute("open","open"):ht(t)||pt(t)}(e);const t=e.querySelector(`[href='#${e.id}']`);t&&t.click()}async function Jr(e,t){if(!t)return;const n=t.getAttribute("data-timeline-item-src");if(!n)return;const o=new URL(n,window.location.origin),s=new URLSearchParams(o.search.slice(1));let r;s.append("anchor",e),o.search=s.toString();try{r=await ke(document,o.toString())}catch(l){return}const i=r.querySelector(".js-timeline-item");if(!i)return;const a=i.getAttribute("data-gid");if(!a)return;const c=document.querySelector(`.js-timeline-item[data-gid='${a}']`);if(c){c.replaceWith(i);const t=document.getElementById(e);t&&Kr(t)}else{const t=document.getElementById("js-progressive-timeline-item-container");t&&t.replaceWith(r);const n=document.getElementById(e);n&&Kr(n)}}function Gr(){return window.location.hash.slice(1)}function Yr(e){const{name:t,value:n}=e,o={name:window.location.href};switch(t){case"CLS":o.cls=n;break;case"FCP":o.fcp=n;break;case"FID":o.fid=n;break;case"LCP":o.lcp=n;break;case"TTFB":o.ttfb=n}be({webVitalTimings:[o]})}function Qr(e,t){for(const n of document.querySelectorAll(".js-u2f-message"))n instanceof HTMLElement&&(n.hidden=!0);if(document.querySelector(e).hidden=!1,t){const e=document.querySelector(".js-use-security-key");e.textContent=e.getAttribute("data-retry-message")}}m(".js-tag-input-container",{constructor:HTMLElement,initialize(e){new TagInput({container:e,inputWrap:e.querySelector(".js-tag-input-wrapper"),input:e.querySelector('input[type="text"], input:not([type])'),selections:e.querySelector(".js-tag-input-selected-tags"),tagTemplate:e.querySelector(".js-template"),autoComplete:e.querySelector("auto-complete")}).setup()}}),document.addEventListener("keydown",(e=>{if("Escape"!==e.key)return;if(e.target!==document.body)return;const t=document.querySelector(".js-targetable-element:target");t&&ft(t,(()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)}))})),document.addEventListener("click",(e=>{const t=document.querySelector(".js-targetable-element:target");t&&(e.target instanceof HTMLAnchorElement||e.target instanceof HTMLElement&&(t.contains(e.target)||ft(t,(()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)}))))})),m(".js-team-mention",(function(e){e.addEventListener("mouseenter",Ur)})),u(".js-needs-timeline-marker-header",(function(e,t,n){Xr(n)})),l("deprecatedAjaxSend","[data-remote]",(function(e){const{request:t}=e.detail;Xr(t)})),ue((function({target:e}){const t=Gr();if(t&&!e){const e=document.querySelector("#js-timeline-progressive-loader");e&&Jr(t,e)}})),m(".js-timeline-progressive-focus-container",(function(e){const t=Gr();if(!t)return;const n=document.getElementById(t);n&&e.contains(n)&&Kr(n)})),m("#js-timeline-progressive-loader",{constructor:HTMLElement,add:e=>{const t=Gr();if(!t)return;document.getElementById(t)||Jr(t,e)}}),m("#js-discussions-timeline-anchor-loader",{constructor:HTMLElement,add:e=>{if(document.querySelector("#js-timeline-progressive-loader"))return;const t=Gr();if(!t)return;document.getElementById(t)||Jr(t,e)}}),m(".js-discussion",(function(){let e=new WeakSet;function t(){e=new WeakSet(document.querySelectorAll(".js-timeline-item"))}t(),document.addEventListener("pjax:end",t),m(".js-timeline-item",(t=>{t instanceof HTMLElement&&(e.has(t)||Q(t))}))})),async function(){if(!(window.performance&&window.performance.timing&&window.performance.getEntriesByType))return;await ge,await new Promise((e=>setTimeout(e)));const e=window.performance.getEntriesByType("resource");e.length&&be({resourceTimings:e});const t=window.performance.getEntriesByType("navigation");t.length&&be({navigationTimings:t})}(),F(Yr),W(Yr),z(Yr),U(Yr),V(Yr),l("click",".js-toggler-container .js-toggler-target",(function(e){if(0!==e.button)return;const t=e.currentTarget.closest(".js-toggler-container");t&&t.classList.toggle("on")})),u(".js-toggler-container",(async(e,t)=>{e.classList.remove("success","error"),e.classList.add("loading");try{await t.text(),e.classList.add("success")}catch(n){e.classList.add("error")}finally{e.classList.remove("loading")}})),window.requestIdleCallback((()=>{const e=gt();e&&bt("tz",encodeURIComponent(e))})),m(".js-u2f-auth-form-body",(function(e){const t=yt();if(e.classList.toggle("unavailable",!t),t){const e=document.querySelector(".js-use-security-key");e.hidden=!1,e.classList.contains("js-webauthn-autofocus")&&e.focus()}})),l("click",".js-use-security-key",(async function(e){if(e&&e.preventDefault(),yt())try{Qr(".js-webauthn-auth-waiting",!1);const e=JSON.parse(document.querySelector(".js-u2f-auth-form").getAttribute("data-webauthn-sign-request")),t=await vt(e);Qr(".js-webauthn-auth-success",!1),document.querySelector(".js-use-security-key").disabled=!0;const n=document.querySelector(".js-u2f-auth-form");n.querySelector(".js-u2f-auth-response").value=JSON.stringify(t),re(n)}catch(t){throw Qr(".js-webauthn-auth-error",!0),t}}));let Zr=0;const ei="IntersectionObserver"in window?new IntersectionObserver((function(e){for(const t of e)t.isIntersecting&&ti(t.target)}),{root:null,rootMargin:"0px",threshold:1}):null;function ti(e){e.classList.remove("js-unread-item","unread-item")}m(".js-unread-item",{constructor:HTMLElement,add(e){Zr++,ei&&ei.observe(e)},remove(e){Zr--,ei&&ei.unobserve(e),0===Zr&&function(){if(!document.hasFocus())return;const e=document.querySelector(".js-timeline-marker-form");e&&e instanceof HTMLFormElement&&re(e)}()}}),m(".js-discussion[data-channel-target]",{subscribe:e=>se(e,"socket:message",(function(e){const t=e.target,n=e.detail.data;if(t.getAttribute("data-channel-target")===n.gid)for(const o of document.querySelectorAll(".js-unread-item"))ti(o)}))});let ni=0;const oi=/^\(\d+\)\s+/;function si(){const e=ni?`(${ni}) `:"";document.title.match(oi)?document.title=document.title.replace(oi,e):document.title=`${e}${document.title}`}m(".js-unread-item",{add(){ni++,si()},remove(){ni--,si()}}),m(".js-socket-channel.js-updatable-content",{subscribe:e=>se(e,"socket:message",(function(e){const{gid:t,wait:n}=e.detail.data,o=e.target,s=t?function(e,t){if(e.getAttribute("data-gid")===t)return e;for(const n of e.querySelectorAll("[data-url][data-gid]"))if(n.getAttribute("data-gid")===t)return n;return null}(o,t):o;s&&setTimeout(Ee,n||0,s)}))}),window.addEventListener("beforeunload",(function(){if(Object.keys(wt).length>0){const e=history.state||{};e.staleRecords=wt,te(e,"",location.href)}}));try{!async function(){if(history.state&&history.state.staleRecords){await we;for(const e in history.state.staleRecords)for(const t of document.querySelectorAll(`.js-updatable-content [data-url='${e}'], .js-updatable-content[data-url='${e}']`)){const n=history.state.staleRecords[e];t instanceof HTMLElement&&Le(t,n,!0)}te(null,"",location.href)}}()}catch(Ni){}function ri(){if(document.querySelector(":target"))return;const e=jt(location.hash).toLowerCase(),t=Lt(document,"user-content-"+e);t&&t.scrollIntoView()}async function ii(e){const n=e.currentTarget,{init:o}=await t.import("./chunk-user-status-submit.js");o(n)}function ai(e){const t=e.currentTarget;Se(t)?function(e){const t=e.getAttribute("data-warn-unsaved-changes")||"Changes you made may not be saved.";window.onbeforeunload=function(e){return e.returnValue=t,t}}(t):ci()}function ci(){window.onbeforeunload=null}function li({currentTarget:e}){e.hasAttribute("open")||ci()}function ui(e){const t=e.currentTarget;if(!t.closest("details[open]"))return;let n=!0;const o=t.querySelectorAll("form[data-warn-unsaved-changes]");for(const s of o)if(Se(s)){const e=s.getAttribute("data-warn-unsaved-changes");n=confirm(e);break}n||e.preventDefault()}function di(e){e.target.classList.remove("will-transition-once")}async function mi(e){const t=e.currentTarget,n=t.getAttribute("data-url");if(!n||function(e){switch(e.getAttribute("data-hovercard-type")){case"issue":case"pull_request":return!!e.closest("[data-issue-and-pr-hovercards-enabled]");case"discussion":return!!e.closest("[data-discussion-hovercards-enabled]");default:return!1}}(t))return;const o=t.getAttribute("data-id")||"",s=t.textContent,r=document.querySelectorAll(`.js-issue-link[data-id='${o}']`);for(const a of r)a.removeAttribute("data-url");try{const e=await fetch(n,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!e.ok){const t=new Error,n=e.statusText?" "+e.statusText:"";throw t.message=`HTTP ${e.status}${n}`,t}fi(r,`${s}, ${(await e.json()).title}`)}catch(i){const e=(null!=i.response?i.response.status:void 0)||500;fi(r,(()=>{switch(e){case 404:return t.getAttribute("data-permission-text");default:return t.getAttribute("data-error-text")}})()||"")}}function fi(e,t){for(const n of e)n instanceof HTMLElement&&(n.classList.add("tooltipped","tooltipped-ne"),n.setAttribute("aria-label",t))}l("upload:setup",".js-upload-avatar-image",(function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-alambic-organization"),o=e.currentTarget.getAttribute("data-alambic-owner-type"),s=e.currentTarget.getAttribute("data-alambic-owner-id");n&&t.append("organization_id",n),o&&t.append("owner_type",o),s&&t.append("owner_id",s)})),l("upload:complete",".js-upload-avatar-image",(function(e){const{attachment:t}=e.detail,n="/settings/avatars/"+t.id;Te({content:ke(document,n)})})),window.addEventListener("hashchange",ri),document.addEventListener("pjax:success",ri),async function(){await we,ri()}(),l("click","a[href]",(function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&t.href===location.href&&location.hash.length>1&&setTimeout((function(){e.defaultPrevented||ri()}))})),m(".js-user-status-container",{subscribe:e=>se(e,"click",ii,{once:!0})}),m("[data-warn-unsaved-changes]",{add(e){e.addEventListener("input",ai),e.addEventListener("change",ai),e.addEventListener("submit",ci);const t=e.closest("details-dialog");t&&(t.closest("details").addEventListener("toggle",li),t.addEventListener("details-dialog-close",ui))},remove(e){e.removeEventListener("input",ai),e.removeEventListener("change",ai),e.removeEventListener("submit",ci);const t=e.closest("details-dialog");t&&(t.closest("details").removeEventListener("toggle",li),t.removeEventListener("details-dialog-close",ui),ci())}}),m(".will-transition-once",{constructor:HTMLElement,subscribe:e=>se(e,"transitionend",di)}),l("click",".js-video-play, .js-video-close",(function(e){e.preventDefault();const t=e.currentTarget,n=t.classList.contains("js-video-play"),o=t.closest(".js-video-container"),s=o.querySelector(".js-video-iframe"),r=document.querySelector(".js-video-bg");n?s.src=s.getAttribute("data-src")||"":s.removeAttribute("src"),o.classList.toggle("is-expanded",n),null!=r&&r.classList.toggle("is-expanded",n),function(e,t=0){const n=e.getBoundingClientRect(),o=n.top-t,s=n.bottom-window.innerHeight+t;o<0?window.scrollBy(0,o):s>0&&window.scrollBy(0,s)}(s,20)})),m(".js-issue-link",{subscribe:e=>se(e,"mouseenter",mi)}),t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var hi=X(Object.freeze({__proto__:null}));const pi={};for(const t of Object.keys(hi))pi[hi[t]]=t;const gi={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};var bi=gi;for(const t of Object.keys(gi)){if(!("channels"in gi[t]))throw new Error("missing channels property: "+t);if(!("labels"in gi[t]))throw new Error("missing channel labels property: "+t);if(gi[t].labels.length!==gi[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=gi[t];delete gi[t].channels,delete gi[t].labels,Object.defineProperty(gi[t],"channels",{value:e}),Object.defineProperty(gi[t],"labels",{value:n})}function yi(e){const t=function(){const e={},t=Object.keys(bi);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),o=Object.keys(bi[e]);for(let s=o.length,r=0;r<s;r++){const s=o[r],i=t[s];-1===i.distance&&(i.distance=t[e].distance+1,i.parent=e,n.unshift(s))}}return t}function vi(e,t){return function(n){return t(e(n))}}function wi(e,t){const n=[t[e].parent,e];let o=bi[t[e].parent][e],s=t[e].parent;for(;t[s].parent;)n.unshift(t[s].parent),o=vi(bi[t[s].parent][s],o),s=t[s].parent;return o.conversion=n,o}gi.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,o=e[2]/255,s=Math.min(t,n,o),r=Math.max(t,n,o),i=r-s;let a,c;r===s?a=0:t===r?a=(n-o)/i:n===r?a=2+(o-t)/i:o===r&&(a=4+(t-n)/i),a=Math.min(60*a,360),a<0&&(a+=360);const l=(s+r)/2;return c=r===s?0:l<=.5?i/(r+s):i/(2-r-s),[a,100*c,100*l]},gi.rgb.hsv=function(e){let t,n,o,s,r;const i=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(i,a,c),u=l-Math.min(i,a,c),d=function(e){return(l-e)/6/u+.5};return 0===u?(s=0,r=0):(r=u/l,t=d(i),n=d(a),o=d(c),i===l?s=o-n:a===l?s=1/3+t-o:c===l&&(s=2/3+n-t),s<0?s+=1:s>1&&(s-=1)),[360*s,100*r,100*l]},gi.rgb.hwb=function(e){const t=e[0],n=e[1];let o=e[2];const s=gi.rgb.hsl(e)[0],r=1/255*Math.min(t,Math.min(n,o));return o=1-1/255*Math.max(t,Math.max(n,o)),[s,100*r,100*o]},gi.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,o=e[2]/255,s=Math.min(1-t,1-n,1-o);return[100*((1-t-s)/(1-s)||0),100*((1-n-s)/(1-s)||0),100*((1-o-s)/(1-s)||0),100*s]},gi.rgb.keyword=function(e){const t=pi[e];if(t)return t;let n,o=1/0;for(const i of Object.keys(hi)){const t=hi[i],a=(r=t,((s=e)[0]-r[0])**2+(s[1]-r[1])**2+(s[2]-r[2])**2);a<o&&(o=a,n=i)}var s,r;return n},gi.keyword.rgb=function(e){return hi[e]},gi.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,o=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92;return[100*(.4124*t+.3576*n+.1805*o),100*(.2126*t+.7152*n+.0722*o),100*(.0193*t+.1192*n+.9505*o)]},gi.rgb.lab=function(e){const t=gi.rgb.xyz(e);let n=t[0],o=t[1],s=t[2];n/=95.047,o/=100,s/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;return[116*o-16,500*(n-o),200*(o-s)]},gi.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,o=e[2]/100;let s,r,i;if(0===n)return i=255*o,[i,i,i];s=o<.5?o*(1+n):o+n-o*n;const a=2*o-s,c=[0,0,0];for(let l=0;l<3;l++)r=t+1/3*-(l-1),r<0&&r++,r>1&&r--,i=6*r<1?a+6*(s-a)*r:2*r<1?s:3*r<2?a+(s-a)*(2/3-r)*6:a,c[l]=255*i;return c},gi.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,o=e[2]/100,s=n;const r=Math.max(o,.01);o*=2,n*=o<=1?o:2-o,s*=r<=1?r:2-r;return[t,100*(0===o?2*s/(r+s):2*n/(o+n)),100*((o+n)/2)]},gi.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let o=e[2]/100;const s=Math.floor(t)%6,r=t-Math.floor(t),i=255*o*(1-n),a=255*o*(1-n*r),c=255*o*(1-n*(1-r));switch(o*=255,s){case 0:return[o,c,i];case 1:return[a,o,i];case 2:return[i,o,c];case 3:return[i,a,o];case 4:return[c,i,o];case 5:return[o,i,a]}},gi.hsv.hsl=function(e){const t=e[0],n=e[1]/100,o=e[2]/100,s=Math.max(o,.01);let r,i;i=(2-n)*o;const a=(2-n)*s;return r=n*s,r/=a<=1?a:2-a,r=r||0,i/=2,[t,100*r,100*i]},gi.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,o=e[2]/100;const s=n+o;let r;s>1&&(n/=s,o/=s);const i=Math.floor(6*t),a=1-o;r=6*t-i,0!=(1&i)&&(r=1-r);const c=n+r*(a-n);let l,u,d;switch(i){default:case 6:case 0:l=a,u=c,d=n;break;case 1:l=c,u=a,d=n;break;case 2:l=n,u=a,d=c;break;case 3:l=n,u=c,d=a;break;case 4:l=c,u=n,d=a;break;case 5:l=a,u=n,d=c}return[255*l,255*u,255*d]},gi.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,o=e[2]/100,s=e[3]/100;return[255*(1-Math.min(1,t*(1-s)+s)),255*(1-Math.min(1,n*(1-s)+s)),255*(1-Math.min(1,o*(1-s)+s))]},gi.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,o=e[2]/100;let s,r,i;return s=3.2406*t+-1.5372*n+-.4986*o,r=-.9689*t+1.8758*n+.0415*o,i=.0557*t+-.204*n+1.057*o,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,s=Math.min(Math.max(0,s),1),r=Math.min(Math.max(0,r),1),i=Math.min(Math.max(0,i),1),[255*s,255*r,255*i]},gi.xyz.lab=function(e){let t=e[0],n=e[1],o=e[2];t/=95.047,n/=100,o/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;return[116*n-16,500*(t-n),200*(n-o)]},gi.lab.xyz=function(e){let t,n,o;n=(e[0]+16)/116,t=e[1]/500+n,o=n-e[2]/200;const s=n**3,r=t**3,i=o**3;return n=s>.008856?s:(n-16/116)/7.787,t=r>.008856?r:(t-16/116)/7.787,o=i>.008856?i:(o-16/116)/7.787,t*=95.047,n*=100,o*=108.883,[t,n,o]},gi.lab.lch=function(e){const t=e[0],n=e[1],o=e[2];let s;s=360*Math.atan2(o,n)/2/Math.PI,s<0&&(s+=360);return[t,Math.sqrt(n*n+o*o),s]},gi.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI;return[t,n*Math.cos(o),n*Math.sin(o)]},gi.rgb.ansi16=function(e,t=null){const[n,o,s]=e;let r=null===t?gi.rgb.hsv(e)[2]:t;if(r=Math.round(r/50),0===r)return 30;let i=30+(Math.round(s/255)<<2|Math.round(o/255)<<1|Math.round(n/255));return 2===r&&(i+=60),i},gi.hsv.ansi16=function(e){return gi.rgb.ansi16(gi.hsv.rgb(e),e[2])},gi.rgb.ansi256=function(e){const t=e[0],n=e[1],o=e[2];if(t===n&&n===o)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5)},gi.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},gi.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},gi.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},gi.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map((e=>e+e)).join(""));const o=parseInt(n,16);return[o>>16&255,o>>8&255,255&o]},gi.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,o=e[2]/255,s=Math.max(Math.max(t,n),o),r=Math.min(Math.min(t,n),o),i=s-r;let a,c;return a=i<1?r/(1-i):0,c=i<=0?0:s===t?(n-o)/i%6:s===n?2+(o-t)/i:4+(t-n)/i,c/=6,c%=1,[360*c,100*i,100*a]},gi.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,o=n<.5?2*t*n:2*t*(1-n);let s=0;return o<1&&(s=(n-.5*o)/(1-o)),[e[0],100*o,100*s]},gi.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,o=t*n;let s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],100*o,100*s]},gi.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,o=e[2]/100;if(0===n)return[255*o,255*o,255*o];const s=[0,0,0],r=t%1*6,i=r%1,a=1-i;let c=0;switch(Math.floor(r)){case 0:s[0]=1,s[1]=i,s[2]=0;break;case 1:s[0]=a,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=i;break;case 3:s[0]=0,s[1]=a,s[2]=1;break;case 4:s[0]=i,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=a}return c=(1-n)*o,[255*(n*s[0]+c),255*(n*s[1]+c),255*(n*s[2]+c)]},gi.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let o=0;return n>0&&(o=t/n),[e[0],100*o,100*n]},gi.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let o=0;return n>0&&n<.5?o=t/(2*n):n>=.5&&n<1&&(o=t/(2*(1-n))),[e[0],100*o,100*n]},gi.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},gi.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,o=n-t;let s=0;return o<1&&(s=(n-o)/(1-o)),[e[0],100*o,100*s]},gi.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},gi.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},gi.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},gi.gray.hsl=function(e){return[0,0,e[0]]},gi.gray.hsv=gi.gray.hsl,gi.gray.hwb=function(e){return[0,100,e[0]]},gi.gray.cmyk=function(e){return[0,0,0,e[0]]},gi.gray.lab=function(e){return[e[0],0,0]},gi.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},gi.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};const ji={};Object.keys(bi).forEach((e=>{ji[e]={},Object.defineProperty(ji[e],"channels",{value:bi[e].channels}),Object.defineProperty(ji[e],"labels",{value:bi[e].labels});const t=function(e){const t=yi(e),n={},o=Object.keys(t);for(let s=o.length,r=0;r<s;r++){const e=o[r];null!==t[e].parent&&(n[e]=wi(e,t))}return n}(e);Object.keys(t).forEach((n=>{const o=t[n];ji[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const o=e(t);if("object"==typeof o)for(let e=o.length,s=0;s<e;s++)o[s]=Math.round(o[s]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}(o),ji[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)}))}));var Li=ji;function Si(){return[Math.floor(255*Math.random()+0),Math.floor(255*Math.random()+0),Math.floor(255*Math.random()+0)]}function ki(e,t){const n=Li.rgb.hsl(t);e.style.setProperty("--label-r",t[0].toString()),e.style.setProperty("--label-g",t[1].toString()),e.style.setProperty("--label-b",t[2].toString()),e.style.setProperty("--label-h",n[0].toString()),e.style.setProperty("--label-s",n[1].toString()),e.style.setProperty("--label-l",n[2].toString())}function Ei(e,t){e.blur();const n=e.closest("form"),o=n.querySelector(".js-new-label-color-input");G(o,"#"+Li.rgb.hex(t));ki(n.querySelector(".js-new-label-color"),t)}function Ti(e,t,n){const o=t.querySelector(e);o&&(n?function(e,t){e.closest(".js-label-error-container").classList.add("errored"),e.textContent=t,e.hidden=!1}(o,n[0]):function(e){e.closest(".js-label-error-container").classList.remove("errored"),e.hidden=!0}(o))}function qi(e,t){Ti(".js-label-name-error",e,t.name),Ti(".js-label-description-error",e,t.description),Ti(".js-label-color-error",e,t.color)}function Ai(e){Ti(".js-label-name-error",e,null),Ti(".js-label-description-error",e,null),Ti(".js-label-color-error",e,null)}async function xi(e){const t=e.closest(".js-label-preview-container");if(!t)return;const n=e.closest(".js-label-form"),o=n.querySelector(".js-new-label-error"),s=n.getAttribute("data-label-id"),r=t.querySelector(".js-label-preview"),i=function(e,t){let n=e.querySelector(".js-new-label-name-input").value.trim();return n.length<1&&(n=t.getAttribute("data-default-name")),n}(n,r),a=function(e){const t=e.querySelector(".js-new-label-color-input");return t.checkValidity()?t.value.trim().replace(/^#/,""):"ededed"}(n),c=function(e){let t=null;const n=e.querySelector(".js-new-label-description-input");return n instanceof HTMLInputElement&&n.value.trim().length>0&&(t=n.value.trim()),t}(n),l=function(e,t,n,o,s){const r=new URL(`${e}${encodeURIComponent(t)}`,window.location.origin),i=new URLSearchParams(r.search.slice(1));return i.append("color",n),o&&i.append("description",o),s&&i.append("id",s),r.search=i.toString(),r.toString()}(r.getAttribute("data-url-template"),i,a,c,s);if(t.hasAttribute("data-last-preview-url")){if(l===t.getAttribute("data-last-preview-url"))return}let u;try{u=await ke(document,l)}catch(d){const e=await d.response.json();return qi(n,e),void(o&&(o.textContent=e.message,o.hidden=!1))}o&&(o.textContent="",o.hidden=!0),Ai(n),r.innerHTML="",r.appendChild(u),t.setAttribute("data-last-preview-url",l)}function Mi(e,t){e.closest(".js-details-container").classList.toggle("is-empty",t)}function Ci(e){const t=document.querySelector(".js-labels-count"),n=Number(t.textContent)+e;t.textContent=n.toString();const o=document.querySelector(".js-labels-label");return o.textContent=o.getAttribute(1===n?"data-singular-string":"data-plural-string"),n}async function Hi(e){const t=e.querySelector(".js-new-label-name-input");if(!t)return;const n=e.querySelector(".js-new-label-color-input"),o=Si(),s="#"+Li.rgb.hex(o);n.value=s;const r=e.querySelector(".js-new-label-color");ki(r,o);const i=document.querySelector(".js-new-label-name").textContent;G(t,i),St(t),xi(r)}le(".js-label-filter-field",(function(e){const t=e.target,n=t.closest("details-menu").querySelector(".js-new-label-name");if(!n)return;const o=t.value.trim();n.textContent=o})),l("filterable:change",".js-filterable-issue-labels",(function(e){const t=e.currentTarget.closest("details-menu"),n=t.querySelector(".js-add-label-button");if(!n)return;const o=e.detail.inputField.value.trim().toLowerCase();let s=!1;for(const r of t.querySelectorAll('input[name="issue[labels][]"]')){if((r.getAttribute("data-label-name")||"").toLowerCase()===o){s=!0;break}}n.hidden=0===o.length||s})),ne(".js-new-label-color-input",(function(e){const t=e.closest("form").querySelector(".js-new-label-swatches");t.hidden=!1,e.addEventListener("blur",(function(){t.hidden=!0}),{once:!0})})),le(".js-new-label-color-input",(function(e){const t=e.target;let n=t.value.trim();if(!(n.length<1))if(0!==n.indexOf("#")&&(n="#"+n,t.value=n),t.checkValidity()){t.classList.remove("text-red");ki(t.closest("form").querySelector(".js-new-label-color"),Li.hex.rgb(n))}else t.classList.add("text-red")})),je("keyup",".js-new-label-color-input",(function(e){const t=e.target;let n=t.value.trim();if(0!==n.indexOf("#")&&(n="#"+n,t.value=n),t.checkValidity()){ki(t.closest("form").querySelector(".js-new-label-color"),Li.hex.rgb(n))}d(t,"change",!1);Ai(t.closest("form"))})),je("keyup",".js-new-label-description-input",(function(e){Ai(e.target.form)})),je("keyup",".js-new-label-color-input",(function(e){Ai(e.target.form)})),l("click",".js-new-label-color",(async function(e){const t=e.currentTarget;Ei(t,Si()),xi(t)})),l("mousedown",".js-new-label-color-swatch",(function(e){const t=e.currentTarget,n=t.getAttribute("data-color");Ei(t,Li.hex.rgb(n)),xi(t);t.closest(".js-new-label-swatches").hidden=!0})),l("toggle",".js-new-label-modal",(function(e){e.target.hasAttribute("open")&&Hi(e.target)}),{capture:!0}),u(".js-new-label-modal-form",(async function(e,t){const n=e.querySelector(".js-new-label-error");let o;try{o=await t.html()}catch(a){const e=a.response.json;n.textContent=e.message,n.hidden=!1}if(!o)return;n.hidden=!0,document.querySelector(".js-new-label-modal").removeAttribute("open");const s=document.querySelector(".js-filterable-issue-labels"),r=o.html.querySelector("input");s.prepend(o.html),r&&r.dispatchEvent(new Event("change",{bubbles:!0}));const i=document.querySelector(".js-label-filter-field");i.value=i.defaultValue,i.focus()})),l("click",".js-edit-label-cancel",(function(e){const t=e.target.closest("form");Ai(t),t.reset();const n=t.querySelector(".js-new-label-color-input"),o=n.value;ki(t.querySelector(".js-new-label-color"),Li.hex.rgb(o)),kt(t),xi(n);const s=e.currentTarget.closest(".js-labels-list-item");if(s){s.querySelector(".js-update-label").classList.add("d-none");const e=s.querySelector(".js-label-preview");if(e){e.classList.add("d-none");s.querySelector(".js-label-link").classList.remove("d-none")}const t=s.querySelectorAll(".js-hide-on-label-edit");for(const n of t)n.hidden=!n.hidden}})),u(".js-update-label",(async function(e,t){let n;try{n=await t.html()}catch(o){return void qi(e,o.response.json)}Ai(e);e.closest(".js-labels-list-item").replaceWith(n.html)})),u(".js-create-label",(async function(e,t){let n;try{n=await t.html()}catch(s){return void qi(e,s.response.json)}e.reset(),Ai(e),document.querySelector(".js-label-list").prepend(n.html),Ci(1),Mi(e,!1);Ei(e.querySelector(".js-new-label-color"),Si()),xi(e.querySelector(".js-new-label-name-input")),kt(e);const o=e.closest(".js-details-container");o instanceof HTMLElement&&pt(o)})),l("click",".js-details-target-new-label",(function(){document.querySelector(".js-create-label").querySelector(".js-new-label-name-input").focus()})),l("click",".js-edit-label",(function(e){const t=e.currentTarget.closest(".js-labels-list-item"),n=t.querySelector(".js-update-label");n.classList.remove("d-none");n.querySelector(".js-new-label-name-input").focus();const o=t.querySelector(".js-label-preview");if(o){o.classList.remove("d-none");t.querySelector(".js-label-link").classList.add("d-none")}const s=t.querySelectorAll(".js-hide-on-label-edit");for(const r of s)r.hidden=!r.hidden})),u(".js-delete-label",(async function(e,t){const n=e.closest(".js-labels-list-item");n.querySelector(".js-label-delete-spinner").hidden=!1,await t.text();Mi(e,0===Ci(-1)),n.remove()}));const _i=h((function(e){xi(e.target)}),500);function Ii(){const e=document.querySelector(".js-reveal-custom-thread-settings").checked,t=!document.querySelector(".js-custom-thread-notification-option:checked"),n=document.querySelector(".js-custom-thread-settings"),o=document.querySelector("[data-custom-option-required-text]"),s=e&&t?o.getAttribute("data-custom-option-required-text"):"";o.setCustomValidity(s),n.hidden=!e}function Pi(e){e instanceof HTMLFormElement?re(e):Di(e)}function Ri(e){const t=e.currentTarget;Pi(t.closest(".js-issue-sidebar-form")||t.querySelector(".js-issue-sidebar-form"))}async function Di(e,t="post",n){const o=function(e){const t=e.closest("form"),n=new FormData(t).entries(),o=new FormData;for(const[s,r]of n)e.contains($i(t,s,r.toString()))&&o.append(s,r);return o}(e);n&&o.append(n.name,n.value);const s=e.getAttribute("data-url");if(!s)return;const r=e.querySelector(".js-data-url-csrf"),i=await fetch(s,{method:t,body:o,mode:"same-origin",headers:{"Scoped-CSRF-Token":r.value,"X-Requested-With":"XMLHttpRequest"}});if(!i.ok)return;const a=await i.text();!function(e,t){e.replaceWith(ee(document,t))}(e.closest(".js-discussion-sidebar-item"),a)}function $i(e,t,n){for(const o of e.elements)if((o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLButtonElement)&&o.name===t&&o.value===n)return o;return null}l("suggester:complete",".js-new-label-name-input",_i),le(".js-new-label-name-input",_i),le(".js-new-label-description-input",_i),le(".js-new-label-color-input",_i),je("keypress",".js-new-label-name-input",(function(e){const t=e.target,n=parseInt(t.getAttribute("data-maxlength"));Et(t.value)>=n&&e.preventDefault()})),l("click",".js-issues-label-select-menu-item",(function(e){e.altKey&&(e.preventDefault(),e.stopPropagation(),window.location.href=e.currentTarget.getAttribute("data-excluded-url"))})),je("keydown",".js-issues-label-select-menu-item",(function(e){if("Enter"!==e.key)return;if(!e.altKey)return;const t=e.currentTarget;e.preventDefault(),e.stopPropagation(),t instanceof HTMLAnchorElement&&(window.location.href=t.getAttribute("data-excluded-url"))})),l("click",".js-open-label-creation-modal",(async function(e){e.stopImmediatePropagation();Hi(await Te({content:document.querySelector(".js-label-creation-template").content.cloneNode(!0),detailsClass:"js-new-label-modal"}))}),{capture:!0}),l("change",".js-thread-notification-setting",Ii),l("change",".js-custom-thread-notification-option",Ii),l("reset",".js-custom-thread-settings-form",Ii),l("details-menu-selected",".js-discussion-sidebar-menu",(function(e){const t=e.detail.relatedTarget,n=e.currentTarget,o=t.closest(".js-issue-sidebar-form"),s=n.hasAttribute("data-multiple");if(t.hasAttribute("data-clear-assignees")){const e=n.querySelectorAll('input[name="issue[user_assignee_ids][]"]:checked');for(const t of e)t.disabled=!1,t.checked=!1;Pi(o)}else s?n.closest("details").addEventListener("toggle",Ri,{once:!0}):Pi(o)}),{capture:!0}),u(".js-issue-sidebar-form",(async function(e,t){const n=await t.html();e.closest(".js-discussion-sidebar-item").replaceWith(n.html)})),l("click","div.js-issue-sidebar-form .js-suggested-reviewer",(function(e){const t=e.currentTarget;Di(t.closest(".js-issue-sidebar-form"),"post",{name:t.name,value:t.value}),e.preventDefault()})),l("click","div.js-issue-sidebar-form .js-issue-assign-self",(function(e){const t=e.currentTarget;Di(t.closest(".js-issue-sidebar-form"),"post",{name:t.name,value:t.value}),e.preventDefault()})),l("click",".js-issue-unassign-self",(function(e){Di(e.currentTarget.closest(".js-issue-sidebar-form"),"delete"),e.preventDefault()})),u(".js-pages-preview-toggle-form",(async function(e,t){const n=await t.json();e.querySelector("button.btn").textContent=n.json.new_button_value})),l("change",".js-project-menu-checkbox",(function(e){const t=e.currentTarget,n=t.closest(".js-project-menu-container");for(const o of n.querySelectorAll(".js-project-menu-checkbox"))if(o!==t&&o.name===t.name){o.checked=t.checked;const e=o.closest(".js-navigation-item");e&&e.classList.toggle("selected",t.checked);const n=o.closest("label[aria-checked]");n&&n.setAttribute("aria-checked",t.checked.toString())}})),l("click","div.js-project-column-menu-container .js-project-column-menu-item button",(async function(e){const t=e.currentTarget;!function(e){const t=e.closest(".js-project-column-menu-dropdown").querySelector(".js-project-column-menu-summary"),n=e.getAttribute("data-column-name");t.textContent=n}(t);const n=t.getAttribute("data-url"),o=t.parentElement.querySelector(".js-data-url-csrf"),s=t.getAttribute("data-card-id"),r=new FormData;r.append("card_id",s),r.append("use_automation_prioritization","true"),e.preventDefault();if(!(await fetch(n,{method:"PUT",mode:"same-origin",body:r,headers:{"Scoped-CSRF-Token":o.value,"X-Requested-With":"XMLHttpRequest"}})).ok)return;const i=document.activeElement,a=t.closest(".js-project-column-menu-dropdown");if(i&&a.contains(i))try{i.blur()}catch(c){}})),l("click",".js-prompt-dismiss",(function(e){e.currentTarget.closest(".js-prompt").remove()})),l("click",".js-convert-to-draft",(function(e){const t=e.currentTarget.getAttribute("data-url"),n=e.currentTarget.parentElement.querySelector(".js-data-url-csrf");fetch(t,{method:"POST",mode:"same-origin",headers:{"Scoped-CSRF-Token":n.value,"X-Requested-With":"XMLHttpRequest"}})}))}}}));
//# sourceMappingURL=behaviors-cc07249e.js.map