System.register(["./chunk-vendor.js","./chunk-frameworks.js","./chunk-notification-list-focus.js","./chunk-cookies.js","./chunk-edit.js","./chunk-responsive-underlinenav.js","./chunk-tag-input.js"],function(Iv,L){"use strict";var y,oe,I,p,f,se,Gr,Qi,Jr,P,v,Yi,ze,Pe,Qr,Zi,ea,ta,na,ra,oa,sa,ia,aa,kn,ca,Yr,la,Zr,ua,Tn,da,fa,ma,pa,ha,It,Ot,ga,ba,ya,va,wa,eo,Ea,to,Ft,ja,Sa,La,_a,ka,Ta,Ca,C,xa,Aa,N,Cn,Pa,Me,$e,Rt,Dt,Ve,Ke,no,fe,Xe,Ht,Ge,j,W,Nt,xn,Ma,me,Bt,ro,oo,so,$a,qa,Ut,ye,An,Pn,Mn,Wt,io,z,pe,ie,ve,Je,Qe,$n,Ia,zt,Oa,Fa,Ra,Da,Ha,Na,ao,co,Ba,Ua,Vt,Wa,za,qn,Va,lo,Ka,Xa,uo,fo,Ga,Ja,Qa,Ya,In,Za,ec,On,tc,mo,nc,po,rc,oc,sc,ho,ic,ac,cc,Kt,lc,go,uc,dc,fc,bo,yo,mc;return{setters:[function(u){y=u.t,oe=u.b,I=u.c,p=u.o,f=u.a,se=u.j,Gr=u.I,Qi=u.R,Jr=u.C,P=u.r,v=u.f,Yi=u.A,ze=u.k,Pe=u.e,Qr=u.l,Zi=u.s,ea=u.m,ta=u.n,na=u.q,ra=u.v,oa=u.w,sa=u.x,ia=u.y,aa=u.z,kn=u.B,ca=u.E,Yr=u.F,la=u.G,Zr=u.H,ua=u.J,Tn=u.h,da=u.K,fa=u.Q,ma=u.M,pa=u.L,ha=u.N,It=u.O,Ot=u.P,ga=u.U,ba=u.V,ya=u.W,va=u.X,wa=u.Y,eo=u.Z,Ea=u._,to=u.$,Ft=u.a0,ja=u.a1,Sa=u.a2,La=u.a3,_a=u.a4,ka=u.a5,Ta=u.a6,Ca=u.a7,C=u.a8},function(u){xa=u.p,Aa=u.k,N=u.e,Cn=u.l,Pa=u.n,Me=u.j,$e=u.q,Rt=u.v,Dt=u.t,Ve=u.w,Ke=u.x,no=u.i,fe=u.y,Xe=u.z,Ht=u.o,Ge=u.A,j=u.c,W=u.r,Nt=u.B,xn=u.C,Ma=u.D,me=u.E,Bt=u.F,ro=u.G,oo=u.H,so=u.I,$a=u.J,qa=u.K,Ut=u.L,ye=u.a,An=u.M,Pn=u.N,Mn=u.O,Wt=u.P,io=u.Q,z=u.R,pe=u.m,ie=u.S,ve=u.g,Je=u.T,Qe=u.U,$n=u.V,Ia=u.W,zt=u.X,Oa=u.Y,Fa=u.Z,Ra=u._,Da=u.$,Ha=u.a0,Na=u.a1,ao=u.a2,co=u.a3,Ba=u.a4,Ua=u.a5,Vt=u.a6,Wa=u.a7,za=u.a8,qn=u.a9,Va=u.aa,lo=u.ab,Ka=u.ac,Xa=u.ad,uo=u.ae,fo=u.af,Ga=u.ag,Ja=u.ah,Qa=u.ai,Ya=u.aj,In=u.u,Za=u.ak,ec=u.s,On=u.al,tc=u.am,mo=u.an,nc=u.ao,po=u.ap,rc=u.aq,oc=u.ar,sc=u.as,ho=u.at,ic=u.au,ac=u.av,cc=u.aw,Kt=u.h,lc=u.ax,go=u.ay,uc=u.az},function(u){dc=u.g,fc=u.r},function(u){bo=u.g,yo=u.d,mc=u.s},function(){},function(){},function(){}],execute:function(){const u=function(){return document.readyState==="complete"?Promise.resolve():new Promise(e=>{window.addEventListener("load",e)})}();class pc extends HTMLElement{async connectedCallback(){await u,this.content&&await Np(this.lines,this.content,this.characterDelay,this.lineDelay),this.cursor&&(this.cursor.hidden=!0),this.dispatchEvent(new CustomEvent("typing:complete",{bubbles:!0,cancelable:!0}))}get content(){return this.querySelector('[data-target="typing-effect.content"]')}get cursor(){return this.querySelector('[data-target="typing-effect.cursor"]')}get lines(){const t=this.getAttribute("data-lines");try{return t?JSON.parse(t):[]}catch(n){return[]}}get prefersReducedMotion(){return window.matchMedia("(prefers-reduced-motion)").matches}get characterDelay(){return this.prefersReducedMotion?0:Math.max(0,Math.min(Math.floor(Number(this.getAttribute("data-character-delay"))),2147483647))||40}set characterDelay(t){if(t>2147483647||t<0)throw new DOMException("Value is negative or greater than the allowed amount");this.setAttribute("data-character-delay",String(t))}get lineDelay(){return this.prefersReducedMotion?0:Math.max(0,Math.min(Math.floor(Number(this.getAttribute("data-line-delay"))),2147483647))||40}set lineDelay(t){if(t>2147483647||t<0)throw new DOMException("Value is negative or greater than the allowed amount");this.setAttribute("data-line-delay",String(t))}}window.customElements.get("typing-effect")||(window.TypingEffectElement=pc,window.customElements.define("typing-effect",pc));async function Np(e,t,n,r){for(let o=0;o{setTimeout(t,e)})}const Bp=2e3;function gc(e){e.style.display="inline-block"}function bc(e){e.style.display="none"}function Up(e){const[t,n]=e.querySelectorAll(".octicon");!t||!n||(gc(t),bc(n))}function Wp(e){const[t,n]=e.querySelectorAll(".octicon");!t||!n||(bc(t),gc(n))}const Fn=new WeakMap;document.addEventListener("clipboard-copy",function({target:e}){if(!(e instanceof HTMLElement)||!e.hasAttribute("data-view-component"))return;const t=Fn.get(e);t?(clearTimeout(t),Fn.delete(e)):Wp(e),Fn.set(e,setTimeout(()=>{Up(e),Fn.delete(e)},Bp))});var zp=Object.defineProperty,Vp=(e,t)=>zp(e,"name",{value:t,configurable:!0}),yc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},T=(e,t,n)=>(yc(e,t,"read from private field"),n?n.call(e):t.get(e)),Ye=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},we=(e,t,n,r)=>(yc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ze,X,qe,ae,Xt,vo,mt;class wo extends HTMLElement{constructor(){super(...arguments);Ye(this,Ze,!1),Ye(this,X,new Set),Ye(this,qe,new Map),Ye(this,ae,1/0),Ye(this,Xt,new Map),Ye(this,vo,new Map),Ye(this,mt,0)}static get observedAttributes(){return["data-updating"]}get updating(){return this.getAttribute("data-updating")==="lazy"?"lazy":"eager"}set updating(t){this.setAttribute("data-updating",t)}get size(){return T(this,X).size}get range(){const t=this.getBoundingClientRect().height,{scrollTop:n}=this,r=`${n}-${t}`;if(T(this,Xt).has(r))return T(this,Xt).get(r);let o=0,s=0,i=0,a=0;const c=T(this,qe);for(const l of T(this,X)){const d=c.get(l)||T(this,ae);if(i+d=t)break}return[o,s]}attributeChangedCallback(t,n,r){if(n===r||!this.isConnected)return;const o=t==="data-updating"&&r==="eager",s=t==="data-sorted"&&this.hasAttribute("data-sorted");(o||s)&&this.update()}connectedCallback(){this.addEventListener("scroll",()=>this.update()),this.updateSync=this.updateSync.bind(this)}update(){T(this,mt)&&cancelAnimationFrame(T(this,mt)),!T(this,Ze)&&this.hasAttribute("data-sorted")?we(this,mt,requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("virtual-list-sort",{cancelable:!0}))&&this.sort()})):we(this,mt,requestAnimationFrame(this.updateSync))}renderItem(t){const n={item:t,fragment:document.createDocumentFragment()};return this.dispatchEvent(new CustomEvent("virtual-list-render-item",{detail:n})),n.fragment.children[0]}recalculateHeights(t){const n=this.querySelector("ul, ol, tbody");n&&(n.append(this.renderItem(t)),we(this,ae,n.children[0].getBoundingClientRect().height),T(this,qe).set(t,T(this,ae)),n.replaceChildren())}updateSync(){const t=this.querySelector("ul, ol");if(!t)return;const[n,r]=this.range;if(rr){c=!1;break}let _=null;if(i.has(w))_=i.get(w);else{if(_=this.renderItem(w),!_)continue;i.set(w,_)}s.set(w,_)}t.replaceChildren(...s.values()),t.style.paddingTop=`${l}px`;const d=this.size*T(this,ae);t.style.height=`${d||0}px`;let m=!1;const h=this.getBoundingClientRect().bottom;for(const[w,_]of s){const{height:x,bottom:E}=_.getBoundingClientRect();m=m||E>=h,T(this,qe).set(w,x)}if(!c&&this.size>s.size&&!m)return T(this,Xt).delete(`${this.scrollTop}-${this.getBoundingClientRect().height}`),this.update();this.dispatchEvent(new CustomEvent("virtual-list-updated"))}has(t){return T(this,X).has(t)}add(t){return T(this,X).add(t),we(this,Ze,!1),Number.isFinite(T(this,ae))||this.recalculateHeights(t),this.updating==="eager"&&this.update(),this}delete(t){const n=T(this,X).delete(t);return we(this,Ze,!1),T(this,qe).delete(t),this.updating==="eager"&&this.update(),n}clear(){T(this,X).clear(),T(this,qe).clear(),we(this,ae,1/0),we(this,Ze,!0),this.updating==="eager"&&this.update()}forEach(t,n){for(const r of this)t.call(n,r,r,this)}entries(){return T(this,X).entries()}values(){return T(this,X).values()}keys(){return T(this,X).keys()}[Symbol.iterator](){return T(this,X)[Symbol.iterator]()}sort(t){return we(this,X,new Set(Array.from(this).sort(t))),we(this,Ze,!0),this.updating==="eager"&&this.update(),this}}Vp(wo,"VirtualListElement"),Ze=new WeakMap,X=new WeakMap,qe=new WeakMap,ae=new WeakMap,Xt=new WeakMap,vo=new WeakMap,mt=new WeakMap,window.customElements.get("virtual-list")||(window.VirtualListElement=wo,window.customElements.define("virtual-list",wo));var Kp=Object.defineProperty,Eo=(e,t)=>Kp(e,"name",{value:t,configurable:!0}),vc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ie=(e,t,n)=>(vc(e,t,"read from private field"),n?n.call(e):t.get(e)),Rn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Oe=(e,t,n,r)=>(vc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),pt,ht,et,Gt;function wc(e){return Boolean(e instanceof Set||e&&typeof e=="object"&&"size"in e&&"add"in e&&"delete"in e&&"clear"in e)}Eo(wc,"isSetAlike");class jo extends HTMLElement{constructor(){super(...arguments);Rn(this,pt,0),Rn(this,ht,null),Rn(this,et,void 0),Rn(this,Gt,new Set),this.filtered=new Set,this.filter=Eo((t,n)=>String(t).includes(n),"filter")}static get observedAttributes(){return["src","loading","data-property","aria-owns"]}get input(){return this.querySelector("input, textarea")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get loading(){return this.getAttribute("loading")==="lazy"?"lazy":"eager"}set loading(t){this.setAttribute("loading",t)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",t)}get property(){return this.getAttribute("data-property")||""}set property(t){this.setAttribute("data-property",t)}reset(){this.filtered.clear(),Oe(this,Gt,new Set)}clear(){!this.input||(this.input.value="",this.input.dispatchEvent(new Event("input")))}attributeChangedCallback(t,n,r){const o=this.isConnected&&this.src,s=this.loading==="eager",i=t==="src"||t==="loading"||t==="accept"||t==="data-property",a=t==="src"||t==="data-property",c=n!==r;if(a&&c&&(Oe(this,ht,null),Ie(this,et)&&clearTimeout(Ie(this,et))),o&&s&&i&&c)cancelAnimationFrame(Ie(this,pt)),Oe(this,pt,requestAnimationFrame(()=>this.load()));else if(t==="aria-owns"){const l=this.ownerDocument.getElementById(r);if(!l)return;wc(l)&&(this.filtered=l)}}connectedCallback(){this.src&&this.loading==="eager"&&(cancelAnimationFrame(Ie(this,pt)),Oe(this,pt,requestAnimationFrame(()=>this.load())));const t=this.input;if(!t)return;const n=this.getAttribute("aria-owns");n!==null&&this.attributeChangedCallback("aria-owns","",n),t.setAttribute("autocomplete","off"),t.setAttribute("spellcheck","false"),this.src&&this.loading==="lazy"&&(document.activeElement===t?this.load():t.addEventListener("focus",()=>{this.load()},{once:!0})),t.addEventListener("input",this)}disconnectedCallback(){var t;(t=this.input)==null||t.removeEventListener("input",this)}handleEvent(t){var n,r;t.type==="input"&&(Ie(this,et)&&clearTimeout(Ie(this,et)),Oe(this,et,window.setTimeout(()=>this.filterItems(),((r=(n=this.input)==null?void 0:n.value)==null?void 0:r.length)||0<3?300:100)))}async load(){if(!this.src)throw new Error("missing src");await new Promise(t=>setTimeout(t,0)),this.dispatchEvent(new Event("loadstart"));try{const t=await this.fetch(this.request());if(location.origin+this.src!==t.url)return;if(!t.ok)throw new Error(`Failed to load resource: the server responded with a status of ${t.status}`);Oe(this,Gt,new Set((await t.json())[this.property])),Oe(this,ht,null),this.dispatchEvent(new Event("loadend"))}catch(t){throw(async()=>{this.dispatchEvent(new Event("error")),this.dispatchEvent(new Event("loadend"))})(),t}this.filtered.clear(),this.filterItems()}request(){return new Request(this.src,{method:"GET",credentials:"same-origin",headers:{Accept:this.accept||"application/json"}})}fetch(t){return fetch(t)}filterItems(){var t,n;const r=(n=(t=this.input)==null?void 0:t.value.trim())!=null?n:"",o=Ie(this,ht);if(Oe(this,ht,r),r===o)return;this.dispatchEvent(new CustomEvent("virtual-filter-input-filter"));let s;o&&r.includes(o)?s=this.filtered:(s=Ie(this,Gt),this.filtered.clear());for(const i of s)this.filter(i,r)?this.filtered.add(i):this.filtered.delete(i);this.dispatchEvent(new CustomEvent("virtual-filter-input-filtered"))}}Eo(jo,"VirtualFilterInputElement"),pt=new WeakMap,ht=new WeakMap,et=new WeakMap,Gt=new WeakMap,window.customElements.get("virtual-filter-input")||(window.VirtualFilterInputElement=jo,window.customElements.define("virtual-filter-input",jo));var Xp=Object.defineProperty,Ec=(e,t)=>Xp(e,"name",{value:t,configurable:!0}),jc=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},tt=(e,t,n)=>(jc(e,t,"read from private field"),n?n.call(e):t.get(e)),Dn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Hn=(e,t,n,r)=>(jc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Nn,Bn,gt,Jt;function Sc(e,t){const n=[];let r=0;for(let o=0;othis.handleEvent()))}handleEvent(){tt(this,Jt)&&cancelAnimationFrame(tt(this,Jt)),Hn(this,Jt,requestAnimationFrame(()=>this.mark()))}disconnectedCallback(){var t;(t=this.ownerInput)==null||t.removeEventListener("input",this),tt(this,gt).disconnect()}mark(){const t=this.textContent||"",n=this.query;if(t===tt(this,Nn)&&n===tt(this,Bn))return;Hn(this,Nn,t),Hn(this,Bn,n),tt(this,gt).disconnect();let r=0;const o=document.createDocumentFragment();for(const s of(this.positions||Sc)(n,t)){if(Number(s)!==s||st.length)continue;t.slice(r,s)!==""&&o.appendChild(document.createTextNode(t.slice(r,s))),r=s+1;const a=document.createElement("mark");a.textContent=t[s],o.appendChild(a)}o.appendChild(document.createTextNode(t.slice(r))),this.replaceChildren(o),tt(this,gt).observe(this,{attributes:!0,childList:!0,subtree:!0})}}Ec(Un,"MarkedTextElement"),Nn=new WeakMap,Bn=new WeakMap,gt=new WeakMap,Jt=new WeakMap,Un.observedAttributes=["query","data-owner-input"],window.customElements.get("marked-text")||(window.MarkedTextElement=Un,window.customElements.define("marked-text",Un));var Lc=Object.defineProperty,Gp=Object.getOwnPropertyDescriptor,Jp=(e,t)=>Lc(e,"name",{value:t,configurable:!0}),Wn=(e,t,n,r)=>{for(var o=r>1?void 0:r?Gp(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Lc(t,n,o),o};let bt=class 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 r of this.helpTexts)r.textContent=n;for(const r of this.cloneURLButtons)r.classList.remove("selected");t.classList.add("selected")}};Jp(bt,"GitCloneHelpElement"),Wn([y],bt.prototype,"helpField",2),Wn([oe],bt.prototype,"helpTexts",2),Wn([oe],bt.prototype,"cloneURLButtons",2),bt=Wn([I],bt);var _c=Object.defineProperty,Qp=Object.getOwnPropertyDescriptor,Yp=(e,t)=>_c(e,"name",{value:t,configurable:!0}),So=(e,t,n,r)=>{for(var o=r>1?void 0:r?Qp(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&_c(t,n,o),o};let Qt=class 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)}};Yp(Qt,"NotificationIndicatorElement"),So([y],Qt.prototype,"link",2),So([y],Qt.prototype,"modifier",2),Qt=So([I],Qt);var kc=Object.defineProperty,Zp=Object.getOwnPropertyDescriptor,eh=(e,t)=>kc(e,"name",{value:t,configurable:!0}),Lo=(e,t,n,r)=>{for(var o=r>1?void 0:r?Zp(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&kc(t,n,o),o};let Yt=class extends HTMLElement{connectedCallback(){this.addEventListener("socket:message",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)})}toggleSidebar(){const e=new CustomEvent("notification-focus:toggle-sidebar",{bubbles:!0});this.dispatchEvent(e)}};eh(Yt,"NotificationFocusIndicatorElement"),Lo([y],Yt.prototype,"link",2),Lo([y],Yt.prototype,"modifier",2),Yt=Lo([I],Yt);var Tc=Object.defineProperty,th=Object.getOwnPropertyDescriptor,nh=(e,t)=>Tc(e,"name",{value:t,configurable:!0}),_o=(e,t,n,r)=>{for(var o=r>1?void 0:r?th(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Tc(t,n,o),o};let Zt=class extends HTMLElement{changeFilter(e){e.preventDefault(),this.detailsContainer.removeAttribute("open");const t=e.currentTarget;this.setFilterTitle(t.innerHTML),this.dispatchEvent(new CustomEvent("focus-mode-filter-change",{detail:{url:t.href}}))}setFilterTitle(e){this.filterTitle.innerHTML=e}};nh(Zt,"NotificationFocusFiltersElement"),_o([y],Zt.prototype,"detailsContainer",2),_o([y],Zt.prototype,"filterTitle",2),Zt=_o([I],Zt);var Cc=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,oh=(e,t)=>Cc(e,"name",{value:t,configurable:!0}),Fe=(e,t,n,r)=>{for(var o=r>1?void 0:r?rh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Cc(t,n,o),o};let he=class extends HTMLElement{connectedCallback(){p(".js-notification-focus-list",()=>{this.setupPaginationObserver()}),f("pjax:end","#js-repo-pjax-container",()=>{this.toggleCurrentFocusedNotification()})}disconnectedCallback(){this.disconnectCurrentObserver()}deactivateNavigation(){xa(this.container)}activateNavigation(){Aa(this.container)}replaceContent(e){this.container.innerHTML="",this.container.appendChild(e),this.setupPaginationObserver()}onRemoveItem(e){var t,n,r;const o=e.detail.notificationId,s=dc(this.container,".js-navigation-item.navigation-focus");(r=(n=(t=this.listElements)==null?void 0:t.find(i=>i.notificationId===o))==null?void 0:n.closest("li"))==null||r.remove(),this.listElements.length===0?(this.blankSlate.hidden=!1,this.list.hidden=!0):fc(s,this.container)}toggleCurrentFocusedNotification(){for(const e of this.listElements){const t=window.location.href.includes(e.url());e.setFocusedState(t)}}setupPaginationObserver(){!!window.IntersectionObserver&&this.nextPageItem&&(this.currentObserver=new IntersectionObserver(e=>{!e[0].isIntersecting||(this.disconnectCurrentObserver(),this.loadNextPage())},{root:this.container,threshold:0}),this.currentObserver.observe(this.nextPageItem))}async loadNextPage(){if(!this.nextPageItem)return;const e=this.nextPageItem.getAttribute("data-next-page-url");if(e){this.nextPageItemSpinner.hidden=!1;const t=await N(document,e);this.nextPageItem.remove();const n=t.querySelectorAll("ul > li.focus-notification-item");for(const o of n)this.list.appendChild(o);const r=t.querySelector("ul > li.focus-pagination-next-item");r&&this.list.appendChild(r),this.setupPaginationObserver()}}disconnectCurrentObserver(){this.currentObserver&&this.currentObserver.disconnect()}};oh(he,"NotificationFocusListElement"),Fe([y],he.prototype,"container",2),Fe([y],he.prototype,"includeFragment",2),Fe([y],he.prototype,"list",2),Fe([y],he.prototype,"blankSlate",2),Fe([oe],he.prototype,"listElements",2),Fe([y],he.prototype,"nextPageItem",2),Fe([y],he.prototype,"nextPageItemSpinner",2),he=Fe([I],he);var xc=Object.defineProperty,sh=Object.getOwnPropertyDescriptor,ih=(e,t)=>xc(e,"name",{value:t,configurable:!0}),nt=(e,t,n,r)=>{for(var o=r>1?void 0:r?sh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&xc(t,n,o),o};let Ee=class extends HTMLElement{constructor(){super(...arguments);this.notificationId="",this.isUnread=!1}connectedCallback(){var e,t;(e=this.closest(".js-navigation-item"))==null||e.addEventListener("navigation:keydown",this.handleCustomKeybindings.bind(this)),(t=this.closest(".js-navigation-item"))==null||t.addEventListener("navigation:keyopen",this.handleKeyOpen.bind(this))}url(){var e;return(e=this.notificationLink)==null?void 0:e.href}handleCustomKeybindings(e){const t=e.detail;!Cn(t.originalEvent)||(t.hotkey==="e"?this.doneForm.dispatchEvent(new Event("submit")):t.hotkey==="M"&&this.unsubscribeForm.dispatchEvent(new Event("submit")))}handleKeyOpen(){this.notificationLink.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}setFocusedState(e){var t,n,r;e&&this.isUnread&&(this.isUnread=!1,(t=this.closest(".js-navigation-item"))==null||t.classList.remove("color-bg-default"),(n=this.closest(".js-navigation-item"))==null||n.classList.add("color-bg-subtle")),(r=this.closest(".js-navigation-item"))==null||r.classList.toggle("current-focused-item",e),this.notificationTitle.classList.toggle("text-bold",e||this.isUnread)}async runRemoveAction(e){e.preventDefault();const t=e.currentTarget,n=new FormData(t),r=t.method,o=t.action,{ok:s}=await fetch(o,{body:n,method:r});s&&this.dispatchEvent(new CustomEvent("focus-mode-remove-item",{bubbles:!0,detail:{notificationId:this.notificationId}}))}};ih(Ee,"NotificationFocusListItemElement"),nt([se],Ee.prototype,"notificationId",2),nt([se],Ee.prototype,"isUnread",2),nt([y],Ee.prototype,"doneForm",2),nt([y],Ee.prototype,"unsubscribeForm",2),nt([y],Ee.prototype,"notificationLink",2),nt([y],Ee.prototype,"notificationTitle",2),Ee=nt([I],Ee);var Ac=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,ch=(e,t)=>Ac(e,"name",{value:t,configurable:!0}),zn=(e,t,n,r)=>{for(var o=r>1?void 0:r?ah(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Ac(t,n,o),o};let yt=class extends HTMLElement{connectedCallback(){this.addEventListener("notification-focus:toggle-sidebar",this.toggleSidebar.bind(this),!0),window.localStorage.getItem("focus-sidebar-active")==="true"&&this.toggleSidebar()}toggleSidebar(){this.adjustSidebarPosition(),this.sidebar.classList.contains("active")?(this.listElement.deactivateNavigation(),this.sidebar.classList.remove("active"),window.localStorage.removeItem("focus-sidebar-active")):(this.listElement.activateNavigation(),this.sidebar.classList.add("active"),window.localStorage.setItem("focus-sidebar-active","true"))}async onFocusFilterChange(e){const t=e.detail;if(t.url){this.listElement.deactivateNavigation();const n=await N(document,t.url);this.listElement.replaceContent(n),this.listElement.activateNavigation()}}adjustSidebarPosition(){const e=document.querySelector("header[role=banner]");if(e){const t=e.offsetTop+e.offsetHeight;this.sidebar.style.top=`${t-10}px`}}};ch(yt,"NotificationFocusSidebarElement"),zn([y],yt.prototype,"sidebar",2),zn([y],yt.prototype,"listElement",2),zn([y],yt.prototype,"filtersElement",2),yt=zn([I],yt);var Pc=Object.defineProperty,lh=Object.getOwnPropertyDescriptor,uh=(e,t)=>Pc(e,"name",{value:t,configurable:!0}),ne=(e,t,n,r)=>{for(var o=r>1?void 0:r?lh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Pc(t,n,o),o};let G=class extends HTMLElement{async submitCustomForm(e){await this.submitForm(e),this.closeMenu()}async submitForm(e){e.preventDefault(),Pa();const t=e.currentTarget,n=new FormData(t),r=await self.fetch(t.action,{method:t.method,body:n,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!r.ok){Me();return}const o=await r.json(),s=n.get("do");typeof s=="string"&&this.updateCheckedState(s),typeof s=="string"&&this.updateMenuButtonCopy(s),this.updateSocialCount(o.count),this.applyInputsCheckedPropertiesToAttributesForNextFormReset()}updateMenuButtonCopy(e){this.unwatchButtonCopy.hidden=!(e==="subscribed"||e==="custom"),this.stopIgnoringButtonCopy.hidden=e!=="ignore",this.watchButtonCopy.hidden=!(e!=="subscribed"&&e!=="custom"&&e!=="ignore")}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(e==="custom")this.customButton.setAttribute("aria-checked","true");else{this.customButton.setAttribute("aria-checked","false");for(const t of[...this.threadTypeCheckboxes])$e(t,!1)}}updateSocialCount(e){this.socialCount&&(this.socialCount.textContent=e,this.socialCount.setAttribute("aria-label",`${this.pluralizeUsers(e)} watching this repository`))}pluralizeUsers(e){return parseInt(e)===1?"1 user is":`${e} users are`}openCustomDialog(e){e.preventDefault(),e.stopPropagation(),this.menu.toggleAttribute("hidden",!0),this.customDialog.toggleAttribute("hidden",!1),setTimeout(()=>{var t;(t=this.customDialog.querySelector("input[type=checkbox][autofocus]"))==null||t.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(t=>t.checked);this.customSubmit.disabled=e}closeMenu(){this.details.toggleAttribute("open",!1)}};uh(G,"NotificationsListSubscriptionFormElement"),ne([y],G.prototype,"details",2),ne([y],G.prototype,"menu",2),ne([y],G.prototype,"customButton",2),ne([y],G.prototype,"customDialog",2),ne([oe],G.prototype,"subscriptionButtons",2),ne([y],G.prototype,"socialCount",2),ne([y],G.prototype,"unwatchButtonCopy",2),ne([y],G.prototype,"stopIgnoringButtonCopy",2),ne([y],G.prototype,"watchButtonCopy",2),ne([oe],G.prototype,"threadTypeCheckboxes",2),ne([y],G.prototype,"customSubmit",2),G=ne([I],G);var Mc=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,fh=(e,t)=>Mc(e,"name",{value:t,configurable:!0}),$c=(e,t,n,r)=>{for(var o=r>1?void 0:r?dh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Mc(t,n,o),o};let Vn=class extends HTMLElement{closeMenu(){this.details.toggleAttribute("open",!1)}};fh(Vn,"NotificationsTeamSubscriptionFormElement"),$c([y],Vn.prototype,"details",2),Vn=$c([I],Vn);var mh=Object.defineProperty,Kn=(e,t)=>mh(e,"name",{value:t,configurable:!0});class Xn extends HTMLElement{connectedCallback(){this.addEventListener("input",ko)}disconnectedCallback(){this.removeEventListener("input",ko)}}Kn(Xn,"PasswordStrengthElement"),window.customElements.get("password-strength")||(window.PasswordStrengthElement=Xn,window.customElements.define("password-strength",Xn));function ko(e){const t=e.currentTarget;if(!(t instanceof Xn))return;const n=e.target;if(!(n instanceof HTMLInputElement))return;const r=n.form;if(!(r instanceof HTMLFormElement))return;const o=qc(n.value,{minimumCharacterCount:Number(t.getAttribute("minimum-character-count")),passphraseLength:Number(t.getAttribute("passphrase-length"))});if(o.valid){n.setCustomValidity("");const s=t.querySelector("dl.form-group");s&&(s.classList.remove("errored"),s.classList.add("successed"))}else n.setCustomValidity(t.getAttribute("invalid-message")||"Invalid");Ic(t,o),Rt(r)}Kn(ko,"onInput");function qc(e,t){const n={valid:!1,hasMinimumCharacterCount:e.length>=t.minimumCharacterCount,hasMinimumPassphraseLength:t.passphraseLength!==0&&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}Kn(qc,"validatePassword");function Ic(e,t){var n,r;const o=e.querySelector("[data-more-than-n-chars]"),s=e.querySelector("[data-min-chars]"),i=e.querySelector("[data-number-requirement]"),a=e.querySelector("[data-letter-requirement]"),c=((n=e.getAttribute("error-class"))==null?void 0:n.split(" ").filter(d=>d.length>0))||[],l=((r=e.getAttribute("pass-class"))==null?void 0:r.split(" ").filter(d=>d.length>0))||[];for(const d of[o,s,i,a])d==null||d.classList.remove(...c,...l);if(t.hasMinimumPassphraseLength&&o)o.classList.add(...l);else if(t.valid)s.classList.add(...l),i.classList.add(...l),a.classList.add(...l);else{const d=t.hasMinimumCharacterCount?l:c,m=t.hasNumber?l:c,h=t.hasLowerCase?l:c;o==null||o.classList.add(...c),s.classList.add(...d),i.classList.add(...m),a.classList.add(...h)}}Kn(Ic,"highlightPasswordStrengthExplainer");var ph=Object.defineProperty,hh=(e,t)=>ph(e,"name",{value:t,configurable:!0});class To extends Gr{async fetch(t,n=1e3){const r=await super.fetch(t);return r.status===202?(await new Promise(o=>setTimeout(o,n)),this.fetch(t,n*1.5)):r}}hh(To,"PollIncludeFragmentElement"),window.customElements.get("poll-include-fragment")||(window.PollIncludeFragmentElement=To,window.customElements.define("poll-include-fragment",To));var gh=Object.defineProperty,Oc=(e,t)=>gh(e,"name",{value:t,configurable:!0});class Co extends Qi{connectedCallback(){en.push(this),Gn||(xo(),Gn=window.setInterval(xo,1e3))}disconnectedCallback(){const t=en.indexOf(this);t!==-1&&en.splice(t,1),en.length||(window.clearInterval(Gn),Gn=void 0)}getFormattedDate(){const t=this.date;if(!t)return;const n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),o=Math.floor(r/60),s=Math.floor(o/60),i=Math.floor(s/24),a=r-o*60,c=o-s*60,l=s-i*24;return o<1?this.applyPrecision([`${r}s`]):s<1?this.applyPrecision([`${o}m`,`${a}s`]):i<1?this.applyPrecision([`${s}h`,`${c}m`,`${a}s`]):this.applyPrecision([`${i}d`,`${l}h`,`${c}m`,`${a}s`])}applyPrecision(t){const n=Number(this.getAttribute("data-precision")||t.length);return t.slice(0,n).join(" ")}}Oc(Co,"PreciseTimeAgoElement");const en=[];let Gn;function xo(){for(const e of en)e.textContent=e.getFormattedDate()||""}Oc(xo,"updateNowElements"),window.customElements.get("precise-time-ago")||(window.PreciseTimeAgoElement=Co,window.customElements.define("precise-time-ago",Co));var bh=Object.defineProperty,Fc=(e,t)=>bh(e,"name",{value:t,configurable:!0});const yh=/\s|\(|\[/;function Rc(e,t,n){const r=e.lastIndexOf(t,n-1);if(r===-1||e.lastIndexOf(" ",n-1)>r)return;const s=e[r-1];return s&&!yh.test(s)?void 0:{word:e.substring(r+t.length,n),position:r+t.length,beginningOfLine:vh(s)}}Fc(Rc,"keyword");const vh=Fc(e=>e===void 0||/\n/.test(e),"isBeginningOfLine");var wh=Object.defineProperty,Eh=(e,t)=>wh(e,"name",{value:t,configurable:!0});const jh=["position:absolute;","overflow:auto;","word-wrap:break-word;","top:0px;","left:-9999px;"],Dc=["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"],Hc=new WeakMap;function Nc(e,t){const n=e.nodeName.toLowerCase();if(n!=="textarea"&&n!=="input")throw new Error("expected textField to a textarea or input");let r=Hc.get(e);if(r&&r.parentElement===e.parentElement)r.innerHTML="";else{r=document.createElement("div"),Hc.set(e,r);const a=window.getComputedStyle(e),c=jh.slice(0);n==="textarea"?c.push("white-space:pre-wrap;"):c.push("white-space:nowrap;");for(let l=0,d=Dc.length;lSh(e,"name",{value:t,configurable:!0});function Bc(e,t=e.selectionEnd){const{mirror:n,marker:r}=Nc(e,t),o=n.getBoundingClientRect(),s=r.getBoundingClientRect();return setTimeout(()=>{n.remove()},5e3),{top:s.top-o.top,left:s.left-o.left}}Lh(Bc,"textFieldSelectionPosition");var _h=Object.defineProperty,Ao=(e,t)=>_h(e,"name",{value:t,configurable:!0});const vt=new WeakMap;class Uc{constructor(t,n){this.expander=t,this.input=n,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,n.addEventListener("paste",this.onpaste),n.addEventListener("input",this.oninput),n.addEventListener("keydown",this.onkeydown),n.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(t,n){this.input===document.activeElement&&this.setMenu(t,n)}deactivate(){const t=this.menu,n=this.combobox;return!t||!n?!1:(this.menu=null,this.combobox=null,t.removeEventListener("combobox-commit",this.oncommit),t.removeEventListener("mousedown",this.onmousedown),n.destroy(),t.remove(),!0)}setMenu(t,n){this.deactivate(),this.menu=n,n.id||(n.id=`text-expander-${Math.floor(Math.random()*1e5).toString()}`),this.expander.append(n);const r=n.querySelector(".js-slash-command-menu-items");r?this.combobox=new Jr(this.input,r):this.combobox=new Jr(this.input,n);const{top:o,left:s}=Bc(this.input,t.position),i=parseInt(window.getComputedStyle(this.input).fontSize);n.style.top=`${o+i}px`,n.style.left=`${s}px`,this.combobox.start(),n.addEventListener("combobox-commit",this.oncommit),n.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1)}setValue(t){if(t==null)return;const n=this.match;if(!n)return;const r=this.input.value.substring(0,n.position-n.key.length),o=this.input.value.substring(n.position+n.text.length);let{cursor:s,value:i}=this.replaceCursorMark(t);i=(i==null?void 0:i.length)===0?i:`${i} `,this.input.value=r+i+o,this.deactivate(),this.input.focus(),s=r.length+(s||i.length),this.input.selectionStart=s,this.input.selectionEnd=s}replaceCursorMark(t){const n=/%cursor%/gm,r=n.exec(t);return r?{cursor:r.index,value:t.replace(n,"")}:{cursor:null,value:t}}onCommit({target:t}){const n=t;if(!(n instanceof HTMLElement)||!this.combobox)return;const r=this.match;if(!r)return;const o={item:n,key:r.key,value:null};!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:o}))||o.value&&this.setValue(o.value)}onBlur(){if(this.interactingWithMenu){this.interactingWithMenu=!1;return}this.deactivate()}onPaste(){this.justPasted=!0}async delay(t){return new Promise(n=>setTimeout(n,t))}async onInput(){if(this.justPasted){this.justPasted=!1;return}const t=this.findMatch();if(t){if(this.match=t,await this.delay(this.appropriateDelay(this.match)),this.match!==t)return;const n=await this.notifyProviders(t);if(!this.match)return;n?this.activate(t,n):this.deactivate()}else this.match=null,this.deactivate()}appropriateDelay(t){return t.beginningOfLine||t.text!==""?0:250}findMatch(){const t=this.input.selectionEnd,n=this.input.value;for(const r of this.expander.keys){const o=Rc(n,r,t);if(o)return{text:o.word,key:r,position:o.position,beginningOfLine:o.beginningOfLine}}}async notifyProviders(t){const n=[],r=Ao(a=>n.push(a),"provide");return this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:r,text:t.text,key:t.key}}))?(await Promise.all(n)).filter(a=>a.matched).map(a=>a.fragment)[0]:void 0}onMousedown(){this.interactingWithMenu=!0}onKeydown(t){t.key==="Escape"&&this.deactivate()&&(t.stopImmediatePropagation(),t.preventDefault())}}Ao(Uc,"SlashCommandExpander");class Po extends HTMLElement{get keys(){const t=this.getAttribute("keys");return t?t.split(" "):[]}connectedCallback(){const t=this.querySelector('input[type="text"], textarea');if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=new Uc(this,t);vt.set(this,n)}disconnectedCallback(){const t=vt.get(this);!t||(t.destroy(),vt.delete(this))}setValue(t){const n=vt.get(this);!n||n.setValue(t)}setMenu(t,n=!1){const r=vt.get(this);!r||!r.match||(n&&(r.interactingWithMenu=!0),r.setMenu(r.match,t))}closeMenu(){const t=vt.get(this);!t||t.setValue("")}isLoading(){const t=this.getElementsByClassName("js-slash-command-expander-loading")[0];if(t){const n=t.cloneNode(!0);n.classList.remove("d-none"),this.setMenu(n)}}showError(){const t=this.getElementsByClassName("js-slash-command-expander-error")[0];if(t){const n=t.cloneNode(!0);n.classList.remove("d-none"),this.setMenu(n)}}}Ao(Po,"SlashCommandExpanderElement"),window.customElements.get("slash-command-expander")||(window.SlashCommandExpanderElement=Po,window.customElements.define("slash-command-expander",Po)),f("deprecatedAjaxSend","[data-remote]",function(e){e.currentTarget===e.target&&(e.defaultPrevented||e.currentTarget.classList.add("loading"))}),f("deprecatedAjaxComplete","[data-remote]",function(e){e.currentTarget===e.target&&e.currentTarget.classList.remove("loading")}),P("form.js-ajax-pagination, .js-ajax-pagination form",async function(e,t){const n=e.closest(".js-ajax-pagination");let r;try{r=await t.html()}catch(o){if(o.response&&o.response.status===404){n.remove();return}else throw o}n.replaceWith(r.html),v(e,"page:loaded")});const kh="analytics.click";f("click","[data-analytics-event]",e=>{const n=e.currentTarget.getAttribute("data-analytics-event");if(!n)return;const r=JSON.parse(n);Dt(kh,r)}),document.addEventListener("pjax:start",function(){Ve("Loading page")}),document.addEventListener("pjax:error",function(){Ve("Loading failed")}),document.addEventListener("pjax:end",function(){Ve("Loading complete")});var Th=Object.defineProperty,Wc=(e,t)=>Th(e,"name",{value:t,configurable:!0});const zc=new WeakMap;p("auto-check",function(e){if(e.classList.contains("js-prevent-default-behavior"))return;const t=e.querySelector("input");if(!t)return;const n=t.closest(".form-group")||e,r=t.form;let o;function s(){return o||(o=`input-check-${(Math.random()*1e4).toFixed(0)}`),o}Wc(s,"generateId");const i=t.getAttribute("aria-describedby");t.addEventListener("focusout:delay",()=>{t.setAttribute("aria-describedby",[o,i].join(" "))});const a=n.querySelector("p.note");a&&(a.id||(a.id=s()),zc.set(a,a.innerHTML)),e.addEventListener("loadstart",()=>{Jn(t,n),n.classList.add("is-loading"),t.classList.add("is-autocheck-loading"),Rt(r)}),e.addEventListener("loadend",()=>{n.classList.remove("is-loading"),t.classList.remove("is-autocheck-loading")}),t.addEventListener("auto-check-success",async c=>{t.classList.add("is-autocheck-successful"),n.classList.add("successed"),Rt(r);const{response:l}=c.detail;if(!l)return;const d=await l.text();if(!!d){if(a instanceof HTMLElement)a.innerHTML=d,Ke(a);else{const m=l.status===200,h=n.tagName==="DL"?"dd":"div",g=document.createElement(h);g.id=s(),g.classList.add(m?"success":"warning"),g.innerHTML=d,n.append(g),n.classList.add(m?"successed":"warn"),Ke(g),m&&(g.hidden=document.activeElement!==t)}v(t,"auto-check-message-updated")}}),t.addEventListener("auto-check-error",async c=>{t.classList.add("is-autocheck-errored"),n.classList.add("errored"),Rt(r);const{response:l}=c.detail;if(!l)return;const d=await l.text();if(a instanceof HTMLElement)a.innerHTML=d||"Something went wrong",Ke(a);else{const m=n.tagName==="DL"?"dd":"div",h=document.createElement(m);h.id=s(),h.classList.add("error"),h.innerHTML=d||"Something went wrong",n.append(h),Ke(h)}}),t.addEventListener("input",()=>{t.removeAttribute("aria-describedby"),t.value||Jn(t,n)}),t.addEventListener("blur",()=>{const c=n.querySelector(".success");c&&(c.hidden=!0)}),t.addEventListener("focus",()=>{const c=n.querySelector(".success");c&&(c.hidden=!1)}),r.addEventListener("reset",()=>{Jn(t,n)})});function Jn(e,t){var n,r,o,s,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 l=zc.get(c);l&&(c.innerHTML=l)}t.tagName==="DL"?((n=t.querySelector("dd.error"))==null||n.remove(),(r=t.querySelector("dd.warning"))==null||r.remove(),(o=t.querySelector("dd.success"))==null||o.remove()):((s=t.querySelector("div.error"))==null||s.remove(),(i=t.querySelector("div.warning"))==null||i.remove(),(a=t.querySelector("div.success"))==null||a.remove())}Wc(Jn,"reset");var Ch=Object.defineProperty,xh=(e,t)=>Ch(e,"name",{value:t,configurable:!0});p("auto-complete",function(e){e.addEventListener("loadstart",()=>e.classList.add("is-auto-complete-loading")),e.addEventListener("loadend",()=>e.classList.remove("is-auto-complete-loading"))}),p("auto-complete",{constructor:Yi,initialize:Mo}),f("auto-complete-change","auto-complete",function(e){Mo(e.currentTarget)});function Mo(e){const t=e.closest("form");if(!t)return;const n=t.querySelector(".js-auto-complete-button");n instanceof HTMLButtonElement&&(n.disabled=!e.value)}xh(Mo,"toggleSubmitButton");let $o=null;f("submit","[data-autosearch-results-container]",async function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))return;e.preventDefault(),$o==null||$o.abort(),t.classList.add("is-sending");const n=new URL(t.action,window.location.origin),r=t.method,o=no(t);let s=null;r==="get"?n.search=o:s=new FormData(t);const{signal:i}=$o=new AbortController,a=new Request(n.toString(),{method:r,body:s,signal:i,headers:{Accept:"text/html","X-Requested-With":"XMLHttpRequest"}});let c;try{c=await fetch(a)}catch(m){}if(t.classList.remove("is-sending"),!c||!c.ok||i.aborted)return;const l=t.getAttribute("data-autosearch-results-container"),d=l?document.getElementById(l):null;d&&(d.innerHTML="",d.appendChild(fe(document,await c.text()))),Xe(null,"",`?${o}`)}),Ht("input[data-autoselect], textarea[data-autoselect]",async function(e){await Ge(),e.select()});var Ah=Object.defineProperty,Ph=(e,t)=>Ah(e,"name",{value:t,configurable:!0});f("change","form[data-autosubmit]",function(e){const t=e.currentTarget;W(t)}),f("change","input[data-autosubmit], select[data-autosubmit]",qo);function qo(e){const t=e.target;if(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLSelectElement))return;const n=t.form;W(n)}Ph(qo,"submit");const Mh=ze(qo,300);p("input[data-throttled-autosubmit]",{subscribe:e=>j(e,"input",Mh)});var $h=Object.defineProperty,Vc=(e,t)=>$h(e,"name",{value:t,configurable:!0});async function Kc(e){const t=e.getAttribute("data-url")||"";if(await Xc(t)){const r=e.getAttribute("data-gravatar-text");r!=null&&(e.textContent=r)}}Vc(Kc,"detectGravatar"),p(".js-detect-gravatar",function(e){Kc(e)});async function Xc(e){const t=e;if(!t)return!1;try{const n=await fetch(t,{headers:{Accept:"application/json"}});return n.ok?(await n.json()).has_gravatar:!1}catch(n){return!1}}Vc(Xc,"fetchGravatarInfo");var Gc=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Io=(e,t)=>Gc(e,"name",{value:t,configurable:!0}),Oo=(e,t,n,r)=>{for(var o=r>1?void 0:r?qh(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Gc(t,n,o),o};class Jc{constructor(t=50,n=30){this.elements=[],this.timer=null,this.callbacks=[],this.csrf=null,this.timeout=t,this.limit=n}push(t){if(this.timer&&(window.clearTimeout(this.timer),this.timer=null),t instanceof HTMLElement){const n=t.querySelector("[data-csrf]");n!==null&&(this.csrf=n.value)}this.elements.length>=this.limit&&this.flush(),this.elements.push(t),this.timer=window.setTimeout(()=>{this.flush()},this.timeout)}onFlush(t){this.callbacks.push(t)}async flush(){const t=this.elements.splice(0,this.limit);t.length!==0&&await Promise.all(this.callbacks.map(n=>n(t)))}}Io(Jc,"AutoFlushingQueue");async function Qc(e,t){const n=await fetch(e,{method:"POST",body:t,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}});if(n.ok){const r=await n.json(),o=new Map;for(const s in r)o.set(s,r[s]);return o}else return new Map}Io(Qc,"fetchContents");const Yc=new Map;let tn=class extends HTMLElement{constructor(){super(...arguments);this.url=""}connectedCallback(){this.queue.push(this)}get queue(){let e=Yc.get(this.url);return e||(e=this.buildAutoFlushingQueue(),Yc.set(this.url,e),e)}buildAutoFlushingQueue(){const e=new Jc;return e.onFlush(async t=>{const n=new Map,r=new FormData;e.csrf!==null&&r.set("authenticity_token",e.csrf);for(const s in t){const i=t[s],a=`item-${s}`;n.set(a,i);for(const c of i.inputs)r.append(`items[${a}][${c.name}]`,c.value)}const o=await Qc(this.url,r);for(const[s,i]of o.entries())n.get(s).replaceWith(fe(document,i))}),e}};Io(tn,"BatchDeferredContentElement"),Oo([se],tn.prototype,"url",2),Oo([oe],tn.prototype,"inputs",2),tn=Oo([I],tn);var Ih=Object.defineProperty,wt=(e,t)=>Ih(e,"name",{value:t,configurable:!0});let Fo=null;f("click",".js-org-signup-duration-change",e=>{e.preventDefault();const n=e.currentTarget.getAttribute("data-plan-duration");el(n),nl(n);for(const r of document.querySelectorAll(".js-seat-field"))rt(r);Zc()});async function rt(e){const t=e.getAttribute("data-item-name")||"items",n=e.value,r=parseInt(e.getAttribute("data-item-minimum"))||0,o=parseInt(e.getAttribute("data-item-maximum"))||300,s=parseInt(e.getAttribute("data-item-count"))||0,i=Math.max(r,parseInt(n)||0),a=i>o,c=document.querySelector(".js-downgrade-button");c instanceof HTMLButtonElement&&(c.disabled=i===s);const l=new URL(e.getAttribute("data-url"),window.location.origin),d=new URLSearchParams(l.search.slice(1));d.append(t,i.toString()),document.querySelector(".js-transform-user")&&d.append("transform_user","1"),l.search=d.toString(),Fo==null||Fo.abort();const{signal:h}=Fo=new AbortController;let g=null;try{const O=await fetch(l.toString(),{signal:h,headers:{Accept:"application/json"}});if(!O.ok)return;g=await O.json()}catch(O){}if(h.aborted||!g)return;const w=document.querySelector(".js-contact-us");w&&w.classList.toggle("d-none",!a);const _=document.querySelector(".js-payment-summary");_&&_.classList.toggle("d-none",a);const x=document.querySelector(".js-submit-billing");x instanceof HTMLElement&&(x.hidden=a);const E=document.querySelector(".js-billing-section");E&&E.classList.toggle("has-removed-contents",g.free||g.is_enterprise_cloud_trial);const M=document.querySelector(".js-upgrade-info");M&&M.classList.toggle("d-none",i<=0);const A=document.querySelector(".js-downgrade-info");A&&A.classList.toggle("d-none",i>=0);const $=document.querySelector(".js-extra-seats-line-item");$&&$.classList.toggle("d-none",g.no_additional_seats),document.querySelector(".js-seat-field")&&tl(n);const k=document.querySelector(".js-minimum-seats-disclaimer");k&&(k.classList.toggle("tooltipped",g.seats===5),k.classList.toggle("tooltipped-nw",g.seats===5));const We=g.selectors;for(const O in We)for(const qt of document.querySelectorAll(O))qt.innerHTML=We[O];Xe(Ma(),"",g.url)}wt(rt,"updateTotals");function Zc(){for(const e of document.querySelectorAll(".js-unit-price"))e.hidden=!e.hidden}wt(Zc,"toggleDurationUnitPrices");function el(e){const t=e==="year"?"month":"year";for(const o of document.querySelectorAll(".js-plan-duration-text"))o.innerHTML=e;for(const o of document.querySelectorAll(".unstyled-available-plan-duration-adjective"))o.innerHTML=`${e}ly`;for(const o of document.querySelectorAll(".js-org-signup-duration-change"))o.setAttribute("data-plan-duration",t);const n=document.getElementById("signup-plan-duration");n&&(n.value=e);const r=document.querySelector(".js-signup-duration-title");r&&(r.innerHTML=`${e}ly Subscription`)}wt(el,"updateDurationFields");function tl(e){for(const t of document.querySelectorAll(".js-seat-field"))t.value=e}wt(tl,"updateSeatFields");function nl(e){for(const t of document.querySelectorAll(".js-seat-field")){const n=new URL(t.getAttribute("data-url"),window.location.origin),r=new URLSearchParams(n.search.slice(1));r.delete("plan_duration"),r.append("plan_duration",e),n.search=r.toString(),t.setAttribute("data-url",n.toString())}}wt(nl,"updateSeatFieldURLs"),p(".js-addon-purchase-field",{constructor:HTMLInputElement,add(e){Nt(e)&&rt(e),xn(e,function(){rt(e)})}}),p(".js-addon-downgrade-field",{constructor:HTMLSelectElement,add(e){Nt(e)&&rt(e),e.addEventListener("change",function(){rt(e)})}});function rl(e){const t=document.querySelector(".js-addon-purchase-field"),n=e.target.querySelector("input:checked");if(t instanceof HTMLInputElement&&n instanceof HTMLInputElement){const r=n.getAttribute("data-upgrade-url");r&&(t.setAttribute("data-url",r),t.value="0",rt(t))}}wt(rl,"handleOrgChange"),f("details-menu-selected",".js-organization-container",rl,{capture:!0}),me(".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)))});var Oh=Object.defineProperty,J=(e,t)=>Oh(e,"name",{value:t,configurable:!0});let Ro=!1;function Qn(e,t){return document.querySelector(`#${e}LC${t}`)}J(Qn,"queryLineElement");function ol({blobRange:e,anchorPrefix:t}){if(document.querySelectorAll(".js-file-line").length!==0&&(sl(),!!e)){if(e.start.column===null||e.end.column===null)for(let r=e.start.line;r<=e.end.line;r+=1){const o=Qn(t,r);o&&o.classList.add("highlighted")}else if(e.start.line===e.end.line&&e.start.column!=null&&e.end.column!=null){const r=ro(e,o=>Qn(t,o));if(r){const o=document.createElement("span");o.classList.add("highlighted"),oo(r,o)}}}}J(ol,"highlightLines");function sl(){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()}}J(sl,"clearHighlights");function il(){const e=so(window.location.hash);ol(e),fl();const{blobRange:t,anchorPrefix:n}=e,r=t&&Qn(n,t.start.line);if(!Ro&&r){r.scrollIntoView();const o=r.closest(".blob-wrapper, .js-blob-wrapper");o.scrollLeft=0}Ro=!1}J(il,"scrollLinesIntoView"),Bt(function(){if(document.querySelector(".js-file-line-container")){setTimeout(il,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()}}});function al(e){const t=[];for(const r of e)t.push(r.textContent);const n=document.getElementById("js-copy-lines");if(n instanceof Qr){n.textContent=`Copy ${e.length===1?"line":"lines"}`,n.value=t.join(` `);const r=`Blob, copyLines, numLines:${e.length.toString()}`;n.setAttribute("data-ga-click",r)}}J(al,"setCopyLines");function cl(e){const t=document.querySelector(".js-permalink-shortcut");if(t instanceof HTMLAnchorElement){const n=`${t.href}${window.location.hash}`,r=document.getElementById("js-copy-permalink");if(r instanceof Qr){r.value=n;const o=`Blob, copyPermalink, numLines:${e.toString()}`;r.setAttribute("data-ga-click",o)}return n}}J(cl,"setPermalink");function ll(e,t){const n=document.getElementById("js-new-issue");if(n instanceof HTMLAnchorElement){if(!n.href)return;const r=new URL(n.href,window.location.origin),o=new URLSearchParams(r.search);o.set("permalink",e),r.search=o.toString(),n.href=r.toString(),n.setAttribute("data-ga-click",`Blob, newIssue, numLines:${t.toString()}`)}}J(ll,"setOpenIssueLink");function ul(e,t){const n=document.getElementById("js-new-discussion");if(!(n instanceof HTMLAnchorElement)||!(n==null?void 0:n.href))return;const r=new URL(n.href,window.location.origin),o=new URLSearchParams(r.search);o.set("permalink",e),r.search=o.toString(),n.href=r.toString(),n.setAttribute("data-ga-click",`Blob, newDiscussion, numLines:${t.toString()}`)}J(ul,"setOpenDiscussionLink");function dl(e){const t=document.getElementById("js-view-git-blame");!t||t.setAttribute("data-ga-click",`Blob, viewGitBlame, numLines:${e.toString()}`)}J(dl,"setViewGitBlame");function fl(){const e=document.querySelector(".js-file-line-actions");if(!e)return;const t=document.querySelectorAll(".js-file-line.highlighted"),n=t[0];if(n){al(t),dl(t.length);const r=cl(t.length);r&&ll(r,t.length),r&&ul(r,t.length),e.style.top=`${n.offsetTop-2}px`,e.classList.remove("d-none")}else e.classList.add("d-none")}J(fl,"showOrHideLineActions");function ml(e){const t=window.scrollY;Ro=!0,e(),window.scrollTo(0,t)}J(ml,"preserveLineNumberScrollPosition"),f("click",".js-line-number",function(e){const t=so(e.currentTarget.id),{blobRange:n}=t,r=$a(window.location.hash);r&&e.shiftKey&&(t.blobRange={start:r.start,end:n.end}),ml(()=>{window.location.hash=qa(t)})}),f("submit",".js-jump-to-line-form",function(e){const r=e.currentTarget.querySelector(".js-jump-to-line-field").value.replace(/[^\d-]/g,"").split("-").map(o=>parseInt(o,10)).filter(o=>o>0).sort((o,s)=>o-s);r.length&&(window.location.hash=`L${r.join("-L")}`),e.preventDefault()}),p(".js-check-bidi",gl);const Fh=/[\u202A-\u202E]|[\u2066-\u2069]/,pl={"\u202A":"U+202A","\u202B":"U+202B","\u202C":"U+202C","\u202D":"U+202D","\u202E":"U+202E","\u2066":"U+2066","\u2067":"U+2067","\u2068":"U+2068","\u2069":"U+2069"};function Do(e,t){if(e.nodeType===Node.TEXT_NODE)return hl(e,t);if(!e.childNodes||!e.childNodes.length)return!1;let n=!1;for(const r of e.childNodes)if(n||(n=Do(r,t)),n&&!t)break;return n}J(Do,"checkNodeForBidiCharacters");function hl(e,t){let n=!1;if(e.nodeValue)for(let r=e.nodeValue.length-1;r>=0;r--){const o=e.nodeValue.charAt(r);if(pl[o]){if(n=!0,!t)break;const s=new Pe(t,{revealedCharacter:pl[o]}),i=new Range;i.setStart(e,r),i.setEnd(e,r+1),i.deleteContents(),i.insertNode(s)}}return n}J(hl,"checkTextNodeForBidiCharacters");function gl(e){let t=!1;const n=performance.now(),r=e.textContent||"";if(Fh.test(r)){const i=e.querySelectorAll(".diff-table .blob-code-inner, .js-file-line-container .js-file-line, .js-suggested-changes-blob .blob-code-inner"),a=document.querySelector(".js-line-alert-template"),c=document.querySelector(".js-revealed-character-template");for(const l of i)if(Do(l,c)&&(t=!0,a)){const d=new Pe(a,{});e.getAttribute("data-line-alert")==="before"?l.before(d):l.after(d)}}const s={durationMs:(performance.now()-n).toString(),result:t.toString()};if(Dt("blob_js_check_bidi_character",s),t){const i=document.querySelector(".js-file-alert-template");if(i){const a=new URL(window.location.href,window.location.origin);a.searchParams.get("h")==="1"?a.searchParams.delete("h"):a.searchParams.set("h","1");const c=new Pe(i,{revealButtonHref:a.href});e.prepend(c)}}e.classList.remove("js-check-bidi")}J(gl,"alertOnBidiCharacter");var Rh=Object.defineProperty,Dh=(e,t)=>Rh(e,"name",{value:t,configurable:!0});function bl(e){const t=e.target,n=t==null?void 0:t.closest(".js-branch-protection-integration-select"),r=n==null?void 0:n.querySelector(".js-branch-protection-integration-select-current"),o=t==null?void 0:t.closest(".js-branch-protection-integration-select-item"),s=o==null?void 0:o.querySelector(".js-branch-protection-integration-select-label");r&&s&&n&&(r.innerHTML=s.innerHTML,n.open=!1)}Dh(bl,"changeSelection"),f("change",".js-branch-protection-integration-select-input",bl);var Hh=Object.defineProperty,Ho=(e,t)=>Hh(e,"name",{value:t,configurable:!0});function yl(e){const t=new URL(e.getAttribute("data-bulk-actions-url"),window.location.origin),n=new URLSearchParams(t.search.slice(1)),r=e.getAttribute("data-bulk-actions-parameter"),o=Array.from(e.querySelectorAll(".js-bulk-actions-toggle:checked"));if(r){const s=o.map(i=>i.closest(".js-bulk-actions-item").getAttribute("data-bulk-actions-id")).sort();for(const i of s)n.append(`${r}[]`,i)}else for(const s of o.sort((i,a)=>i.value>a.value?1:-1))n.append(s.name,s.value);return t.search=n.toString(),t.toString()}Ho(yl,"bulkUrl");let No=null;async function vl(e){const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.querySelector(".js-bulk-actions"),r=!!t.querySelector(".js-bulk-actions-toggle:checked");No==null||No.abort();const{signal:o}=No=new AbortController;let s="";try{const i=await fetch(yl(t),{signal:o,headers:{"X-Requested-With":"XMLHttpRequest"}});if(!i.ok)return;s=await i.text()}catch(i){}o.aborted||!s||(r?(Bo(t),n.innerHTML=s):(n.innerHTML=s,Bo(t)),v(t,"bulk-actions:updated"))}Ho(vl,"updateBulkActions");function Bo(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)}}Ho(Bo,"toggleMembershipTabs"),f("change",".js-bulk-actions-toggle",function(e){const n=e.currentTarget.closest(".js-bulk-actions-container");v(n,"bulk-actions:update")}),f("bulk-actions:update",".js-bulk-actions-container",ze(vl,100));var wl=Object.defineProperty,El=Object.getOwnPropertySymbols,Nh=Object.prototype.hasOwnProperty,Bh=Object.prototype.propertyIsEnumerable,jl=(e,t,n)=>t in e?wl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Sl=(e,t)=>{for(var n in t||(t={}))Nh.call(t,n)&&jl(e,n,t[n]);if(El)for(var n of El(t))Bh.call(t,n)&&jl(e,n,t[n]);return e},Yn=(e,t)=>wl(e,"name",{value:t,configurable:!0});function Ll(e){try{const t=window.localStorage.getItem(e);return{kind:"ok",value:t?JSON.parse(t):null}}catch(t){return{kind:"err",value:t}}}Yn(Ll,"getLocalJSON");function Uo(e,t){try{return window.localStorage.setItem(e,JSON.stringify(t)),{kind:"ok",value:null}}catch(n){return{kind:"err",value:n}}}Yn(Uo,"setLocalJSON");function _l(){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}Yn(_l,"gatherBundleURLs");function kl(){const e=_l(),t=Ll("bundle-urls");if(t.kind==="err"){Uo("bundle-urls",e);return}const n=t.value||{},r=Object.keys(e).filter(o=>n[o]!==e[o]);r.length&&Uo("bundle-urls",Sl(Sl({},n),e)).kind==="ok"&&ye({downloadedBundles:r})}Yn(kl,"report"),(async()=>{await Ut,window.requestIdleCallback(kl)})();var Uh=Object.defineProperty,Wh=(e,t)=>Uh(e,"name",{value:t,configurable:!0});let Tl,Wo=!1;function zo(){Tl=document.activeElement,document.body&&document.body.classList.toggle("intent-mouse",Wo)}Wh(zo,"setClass"),document.addEventListener("mousedown",function(){Wo=!0,Tl===document.activeElement&&zo()},{capture:!0}),document.addEventListener("keydown",function(){Wo=!1},{capture:!0}),document.addEventListener("focusin",zo,{capture:!0});var zh=Object.defineProperty,Vh=(e,t)=>zh(e,"name",{value:t,configurable:!0});function Cl(e){e.preventDefault(),e.stopPropagation()}Vh(Cl,"cancelEvent"),p("a.btn.disabled",{subscribe:e=>j(e,"click",Cl)}),p(".js-check-all-container",{constructor:HTMLElement,subscribe:Zi});var Kh=Object.defineProperty,xl=(e,t)=>Kh(e,"name",{value:t,configurable:!0});const Al="logout-was-successful";function Pl(){for(const e of[sessionStorage,localStorage])try{e.clear()}catch(t){}}xl(Pl,"clearData");function Ml(){bo(Al).length>0&&(Pl(),yo(Al))}xl(Ml,"clearDataIfJustLoggedOut"),Ml();var Xh=Object.defineProperty,$l=(e,t)=>Xh(e,"name",{value:t,configurable:!0});const ql=2e3;f("clipboard-copy","[data-copy-feedback]",e=>{const t=e.currentTarget,n=t.getAttribute("data-copy-feedback"),r=t.getAttribute("aria-label"),o=t.getAttribute("data-tooltip-direction")||"s";t.setAttribute("aria-label",n),t.classList.add("tooltipped",`tooltipped-${o}`),t instanceof HTMLElement&&(Ke(t),setTimeout(()=>{r?t.setAttribute("aria-label",r):t.removeAttribute("aria-label"),t.classList.remove("tooltipped",`tooltipped-${o}`)},ql))});function Il(e){Ko.delete(e),Vo(e)}$l(Il,"timerCallback");function Vo(e){const t=e.querySelector(".js-clipboard-copy-icon"),n=e.querySelector(".js-clipboard-check-icon");e.classList.toggle("ClipboardButton--success"),t&&t.classList.toggle("d-none"),n&&(n.classList.contains("d-sm-none")?n.classList.toggle("d-sm-none"):n.classList.toggle("d-none"))}$l(Vo,"toggleCopyButton");const Ko=new WeakMap;f("clipboard-copy",".js-clipboard-copy:not([data-view-component])",function({currentTarget:e}){if(!(e instanceof HTMLElement))return;const t=Ko.get(e);t?clearTimeout(t):Vo(e),Ko.set(e,setTimeout(Il,ql,e))});var Gh=Object.defineProperty,V=(e,t)=>Gh(e,"name",{value:t,configurable:!0});f("click",".js-code-nav-retry",async function(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const t=document.querySelector(".js-tagsearch-popover");if(!t)return;const n=t.querySelector(".js-tagsearch-popover-content");if(!n)return;let r;const o=e.currentTarget;o.getAttribute("data-code-nav-kind")==="definitions"?r=t.querySelector(".js-tagsearch-popover-content"):r=t.querySelector(".js-code-nav-references");const i=o.getAttribute("data-code-nav-url"),a=new URL(i,window.location.origin),c=await fetch(a.toString(),{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!c.ok)return;const l=await c.text();!l||(r.innerHTML=l,n.scrollTop=0)}),p(".js-code-nav-container",{constructor:HTMLElement,subscribe(e){const t=e,n=document.querySelector(".js-tagsearch-popover");if(!(n instanceof HTMLElement))return{unsubscribe(){}};const r=n.querySelector(".js-tagsearch-popover-content"),o=new WeakMap,s=new WeakMap;let i;async function a(E){const M=Fl(/\w+[!?]?/g,E.clientX,E.clientY);if(!M)return;const A=M.commonAncestorContainer.parentElement;for(const qv of A.classList)if(["pl-token","pl-c","pl-s","pl-k"].includes(qv))return;if(A.closest(".js-skip-tagsearch"))return;const $=M.toString();if(!$||$.match(/\n|\s|[();&.=",]/))return;let Ue=s.get(A);if(Ue||(Ue=new Set,s.set(A,Ue)),Ue.has($))return;Ue.add($);const k=A.closest(".js-tagsearch-file");if(!k)return;const We=k.getAttribute("data-tagsearch-path")||"";let O=k.getAttribute("data-tagsearch-lang")||"";if(O==="HTML+ERB")if(A.closest(".pl-sre"))O="Ruby";else return;if(e.classList.contains("js-code-block-container")&&(O=Dl(A)||"",!O))return;const qt=Hl(M),te=await Ol(n,$,O,qt,We);if(!te)return;const Xr=document.createElement("span");Xr.classList.add("pl-token"),Xr.addEventListener("click",l),o.set(Xr,te),M.surroundContents(Xr)}V(a,"onMouseMove");function c(){r.scrollTop=0}V(c,"resetScrollTop");function l(E){if(E.altKey||E.ctrlKey||E.metaKey||E.shiftKey)return;const M=E.currentTarget;M===i?g():(d(M),h()),E.preventDefault()}V(l,"onClick");function d(E){i&&i.classList.remove("active"),i=E,i.classList.add("active"),r.innerHTML=o.get(E)||"",m(E)}V(d,"populatePopover");function m(E){const M=t.getClientRects()[0],A=E.getClientRects()[0];n.style.position="absolute",t.classList.contains("position-relative")?(n.style.top=`${A.bottom-M.top+7}px`,n.style.left=`${A.left-M.left-10}px`):(n.style.top=`${window.scrollY+A.bottom+7}px`,n.style.left=`${window.scrollX+A.left-10}px`)}V(m,"positionPopover");function h(){if(!n.hidden){c();return}n.hidden=!1,c(),document.addEventListener("click",_),document.addEventListener("keyup",x),window.addEventListener("resize",w)}V(h,"showPopover");function g(){n.hidden||(n.hidden=!0,i&&i.classList.remove("active"),i=void 0,document.removeEventListener("click",_),document.removeEventListener("keyup",x),window.removeEventListener("resize",w))}V(g,"hidePopover");function w(){i instanceof HTMLElement&&m(i)}V(w,"onResize");function _(E){const{target:M}=E;M instanceof Node&&!n.contains(M)&&!i.contains(M)&&g()}V(_,"onDocumentClick");function x(E){switch(E.key){case"Escape":g();break}}return V(x,"onKeyup"),e.addEventListener("mousemove",a),{unsubscribe(){e.removeEventListener("mousemove",a)}}}});async function Ol(e,t,n,r,o){const s=e.getAttribute("data-tagsearch-url"),i=e.getAttribute("data-tagsearch-ref"),a=new URL(s,window.location.origin),c=new URLSearchParams;c.set("q",t),c.set("blob_path",o),c.set("ref",i),c.set("language",n),c.set("row",r[0].toString()),c.set("col",r[1].toString()),a.search=c.toString();const l=await fetch(a.toString(),{headers:{"X-Requested-With":"XMLHttpRequest"}});if(!l.ok)return"";const d=await l.text();return/js-tagsearch-no-definitions/.test(d)?"":d}V(Ol,"fetchPopoverContents");function Fl(e,t,n){let r,o;if(document.caretPositionFromPoint){const c=document.caretPositionFromPoint(t,n);c&&(r=c.offsetNode,o=c.offset)}else if(document.caretRangeFromPoint){const c=document.caretRangeFromPoint(t,n);c&&(r=c.startContainer,o=c.startOffset)}if(!r||typeof o!="number"||r.nodeType!==Node.TEXT_NODE)return;const s=r.textContent;if(!s)return null;const i=Rl(s,e,o);if(!i)return null;const a=document.createRange();return a.setStart(r,i[1]),a.setEnd(r,i[2]),a}V(Fl,"matchFromPoint");function Rl(e,t,n){let r;for(;r=t.exec(e);){const o=r.index+r[0].length;if(r.index<=n&&nJh(e,"name",{value:t,configurable:!0});function Bl(e){const t=e.querySelector(".js-comment-form-error");t instanceof HTMLElement&&(t.hidden=!0)}Nl(Bl,"clearFormError"),f("click",".errored.js-remove-error-state-on-click",function({currentTarget:e}){e.classList.remove("errored")}),P(".js-new-comment-form",async function(e,t){let n;Bl(e);try{n=await t.json()}catch(s){Ul(e,s)}if(!n)return;e.reset();for(const s of e.querySelectorAll(".js-resettable-field"))$e(s,s.getAttribute("data-reset-value")||"");const r=e.querySelector(".js-write-tab");r instanceof HTMLElement&&r.click();const o=n.json.updateContent;for(const s in o){const i=o[s],a=document.querySelector(s);a instanceof HTMLElement?An(a,i):console.warn(`couldn't find ${s} for immediate update`)}v(e,"comment:success")});function Ul(e,t){let n="You can't comment at this time";if(t.response&&t.response.status===422){const o=t.response.json;o.errors&&(Array.isArray(o.errors)?n+=` \u2014 your comment ${o.errors.join(", ")}`:n=o.errors)}n+=". ";const r=e.querySelector(".js-comment-form-error");if(r instanceof HTMLElement){r.textContent=n,r.hidden=!1;const o=r.closest("div.form-group.js-remove-error-state-on-click");o&&o.classList.add("errored")}}Nl(Ul,"handleFormError");var Qh=Object.defineProperty,Wl=(e,t)=>Qh(e,"name",{value:t,configurable:!0});const Yh=Wl((e,t)=>{const n=e.querySelector(".js-form-action-text"),r=n||e;r.textContent=t?e.getAttribute("data-comment-text"):r.getAttribute("data-default-action-text")},"setButtonText"),Zh=Wl(e=>{let t;return n=>{const o=n.currentTarget.value.trim();o!==t&&(t=o,Yh(e,Boolean(o)))}},"createInputHandler");p(".js-comment-and-button",{constructor:HTMLButtonElement,initialize(e){const t=e.form.querySelector(".js-comment-field"),n=Zh(e);return{add(){t.addEventListener("input",n),t.addEventListener("change",n)},remove(){t.removeEventListener("input",n),t.removeEventListener("change",n)}}}});var eg=Object.defineProperty,zl=(e,t)=>eg(e,"name",{value:t,configurable:!0});function Xo(e,t){const n=e.closest(".js-write-bucket");n&&n.classList.toggle("focused",t)}zl(Xo,"toggleFocus");function Vl(e){const t=e.currentTarget;t instanceof Element&&Xo(t,!1)}zl(Vl,"blurred"),Ht(".js-comment-field",function(e){Xo(e,!0),e.addEventListener("blur",Vl,{once:!0})});var tg=Object.defineProperty,ng=(e,t)=>tg(e,"name",{value:t,configurable:!0});const rg=2303741511,og=4;class Zn{static fromFile(t){return new Promise(function(n,r){const o=new FileReader;o.onload=function(){n(new Zn(o.result))},o.onerror=function(){r(o.error)},o.readAsArrayBuffer(t)})}constructor(t){this.dataview=new DataView(t),this.pos=0}advance(t){this.pos+=t}readInt(t){const n=this,r=function(){switch(t){case 1:return n.dataview.getUint8(n.pos);case 2:return n.dataview.getUint16(n.pos);case 4:return n.dataview.getUint32(n.pos);default:throw new Error("bytes parameter must be 1, 2 or 4")}}();return this.advance(t),r}readChar(){return this.readInt(1)}readShort(){return this.readInt(2)}readLong(){return this.readInt(4)}readString(t){const n=[];for(let r=0;rsg(e,"name",{value:t,configurable:!0});const ag=.0254;async function Kl(e){if(e.type!=="image/png")return null;const t=e.slice(0,10240,e.type),n=await Zn.fromFile(t),r={width:0,height:0,ppi:1};return n.scan(function(o){switch(o){case"IHDR":return r.width=this.readLong(),r.height=this.readLong(),!0;case"pHYs":{const s=this.readLong(),i=this.readLong(),a=this.readChar();let c;return a===1&&(c=ag),c&&(r.ppi=Math.round((s+i)/2*c)),!1}case"IDAT":return!1}return!0}),r}ig(Kl,"imageDimensions");const cg=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],Xl=typeof window!="undefined"&&window.mozInnerScreenX!=null;function lg(e,t,n){const r=n&&n.debug||!1;if(r){const d=document.querySelector("#input-textarea-caret-position-mirror-div");d&&d.parentNode.removeChild(d)}const o=document.createElement("div");o.id="input-textarea-caret-position-mirror-div",document.body.appendChild(o);const s=o.style,i=window.getComputedStyle?window.getComputedStyle(e):e.currentStyle,a=e.nodeName==="INPUT";s.whiteSpace="pre-wrap",a||(s.wordWrap="break-word"),s.position="absolute",r||(s.visibility="hidden");for(const d of cg)if(a&&d==="lineHeight")if(i.boxSizing==="border-box"){const m=parseInt(i.height),h=parseInt(i.paddingTop)+parseInt(i.paddingBottom)+parseInt(i.borderTopWidth)+parseInt(i.borderBottomWidth),g=h+parseInt(i.lineHeight);m>g?s.lineHeight=`${m-h}px`:m===g?s.lineHeight=i.lineHeight:s.lineHeight=0}else s.lineHeight=i.height;else if(!a&&d==="width"&&i.boxSizing==="border-box"){let m=parseFloat(i.borderLeftWidth)+parseFloat(i.borderRightWidth),h=Xl?parseFloat(i[d])-m:e.clientWidth+m;s[d]=`${h}px`}else s[d]=i[d];Xl?e.scrollHeight>parseInt(i.height)&&(s.overflowY="scroll"):s.overflow="hidden",o.textContent=e.value.substring(0,t),a&&(o.textContent=o.textContent.replace(/\s/g,"\xA0"));const c=document.createElement("span");c.textContent=e.value.substring(t)||".",o.appendChild(c);const l={top:c.offsetTop+parseInt(i.borderTopWidth),left:c.offsetLeft+parseInt(i.borderLeftWidth),height:parseInt(i.lineHeight)};return r?c.style.backgroundColor="#aaa":document.body.removeChild(o),l}var ug=Object.defineProperty,ot=(e,t)=>ug(e,"name",{value:t,configurable:!0});const er=new WeakMap;class Gl{constructor(t,n,r){this.index=t,this.coords=n,this.textArea=r}get top(){return this.coords.top}get left(){return this.coords.left}get height(){return this.coords.height}currentChar(t=1){return this.textArea.value.substring(this.index-t,this.index)}checkLine(t){return tthis.coords.top+this.coords.height?1:0}xDistance(t){return Math.abs(this.left-t)}}ot(Gl,"CaretPosition");function je(e,t){let n;if(er.has(e)?n=er.get(e):(n=new Map,er.set(e,n)),n.has(t))return n.get(t);{const r=new Gl(t,lg(e,t),e);return n.set(t,r),r}}ot(je,"fetchCaretCoords");const nn=ot((e,t,n,r,o,s)=>{if(n===t)return n;const i=ot(d=>{const m=d.filter(h=>h.checkLine(o)===0).sort((h,g)=>h.xDistance(r)>g.xDistance(r)?1:-1);return m.length===0?n:m[0].index},"bestPosition");if(n-t==1){const d=je(e,t),m=je(e,n);return i([d,m])}if(n-t==2){const d=je(e,t),m=je(e,n-1),h=je(e,n);return i([d,m,h])}const a=Math.floor((n+t)/2);if(a===t||a===n)return a;const c=je(e,a);if(o>c.top+c.height)return nn(e,a+1,n,r,o,s+1);if(or?je(e,a-1).checkLine(o)!==0?a:nn(e,t,a-1,r,o,s+1):a},"binaryCursorSearch"),dg=ot((e,t,n)=>{const r=0,o=e.value.length-1;return nn(e,r,o,t,n,0)},"findCursorPosition");function Jl(e,t,n){const r=dg(e,t,n);e.setSelectionRange(r,r)}ot(Jl,"setCursorPosition");function Ql(e,t){const n=e.getBoundingClientRect();t.type==="dragenter"&&er.delete(e);const r=t.clientX-n.left,o=t.clientY-n.top+e.scrollTop;Jl(e,r,o)}ot(Ql,"updateCaret");var fg=Object.defineProperty,F=(e,t)=>fg(e,"name",{value:t,configurable:!0});p(".js-paste-markdown",{constructor:HTMLElement,add(e){ea(e),ta(e),Pn("LINKIFY_SELECTED_TEXT_ON_URL_PASTE")&&na(e),ra(e)},remove(e){oa(e),sa(e),Pn("LINKIFY_SELECTED_TEXT_ON_URL_PASTE")&&ia(e),aa(e)}});const Go=new WeakMap;function mg(e,t){Go.set(e,t)}F(mg,"cachePlaceholder");function Yl(e){return Go.get(e)||Qo(e)}F(Yl,"getPlaceholder");function tr(e){return["video/mp4","video/quicktime"].includes(e.file.type)}F(tr,"isVideo");function Zl(e){return e.replace(/[[\]\\"<>&]/g,".").replace(/\.{2,}/g,".").replace(/^\.|\.$/gi,"")}F(Zl,"parameterizeName");function Jo(e){return tr(e)?` Uploading ${e.file.name}\u2026 `:`${e.isImage()?"!":""}[Uploading ${e.file.name}\u2026]()`}F(Jo,"placeholderText");function eu(e){return Zl(e).replace(/\.[^.]+$/,"").replace(/\./g," ")}F(eu,"altText");const pg=72*2;function rn(e){const n=e.target.closest("form").querySelector(".btn-primary");n.disabled=!0}F(rn,"disableSubmit");function on(e){const n=e.target.closest("form").querySelector(".btn-primary");n.disabled=!1}F(on,"enableSubmit");async function tu(e){const{attachment:t}=e.detail,n=e.currentTarget;let r;t.isImage()?r=await ou(t):tr(t)?r=ru(t):r=nu(t),Zo("",r,e,n)}F(tu,"onUploadCompleted");function nu(e){return`[${e.file.name}](${e.href})`}F(nu,"mdLink");function ru(e){return` ${e.href} `}F(ru,"videoMarkdown");async function ou(e){const t=await su(e.file),n=eu(e.file.name),r=e.href;return t.ppi===pg?`${n}`:`![${n}](${r})`}F(ou,"imageTag");async function su(e){var t;const n={width:0,height:0,ppi:0};try{return(t=await Kl(e))!=null?t:n}catch(r){return n}}F(su,"imageSize");function Qo(e){const t=Jo(e);return tr(e)?` ${t} `:`${t} `}F(Qo,"replacementText");function Yo(e){const t=e.currentTarget.querySelector(".js-comment-field"),n=Yl(e.detail.attachment);if(t)t.setCustomValidity(""),Mn(t,n,"");else{const o=Wt(e.currentTarget.querySelector(".js-code-editor")).editor.getSearchCursor(n);o.findNext(),o.replace("")}}F(Yo,"removeFailedUpload");function Zo(e,t,n,r){const o=(r||n.currentTarget).querySelector(".js-comment-field"),s=(r||n.currentTarget).querySelector(".js-file-upload-loading-text"),i=Jo(n.detail.attachment),{batch:a}=n.detail;if(o){const c=o.value.substring(o.selectionStart,o.selectionEnd);if(e==="uploading"){let l;c.length?l=Mn(o,c,i):l=io(o,i,{appendNewline:!0}),Go.set(n.detail.attachment,l)}else Mn(o,i,t);a.isFinished()?on(n):rn(n)}else{const c=Wt((r||n.currentTarget).querySelector(".js-code-editor")).editor;if(e==="uploading")if(c.getSelection().length)c.replaceSelection(i);else{const l=c.getCursor(),d=Qo(n.detail.attachment);c.replaceRange(d,l)}else{const l=c.getSearchCursor(i);l.findNext(),l.replace(t)}a.isFinished()?on(n):rn(n)}if(s){const c=s.getAttribute("data-file-upload-message");s.textContent=`${c} (${a.uploaded()+1}/${a.size})`}}F(Zo,"setValidityAndLinkText"),f("upload:setup",".js-upload-markdown-image",function(e){Zo("uploading","",e)}),f("upload:complete",".js-upload-markdown-image",tu),f("upload:error",".js-upload-markdown-image",function(e){Yo(e);const{batch:t}=e.detail;t.isFinished()?on(e):rn(e)});function es(e){var t;e.stopPropagation();const n=e.currentTarget;if(!n)return;const r=n.querySelector(".js-comment-field");if(r)Ql(r,e);else{const o=(t=Wt(n.querySelector(".js-code-editor")))==null?void 0:t.editor;if(o){const s=o.coordsChar({left:e.pageX,top:e.pageY});o.setCursor(s)}}}F(es,"updateCursor"),f("dragenter","file-attachment",es),f("dragover","file-attachment",es),f("upload:invalid",".js-upload-markdown-image",function(e){Yo(e);const{batch:t}=e.detail;t.isFinished()?on(e):rn(e)});var hg=Object.defineProperty,st=(e,t)=>hg(e,"name",{value:t,configurable:!0});function iu(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")}st(iu,"token");function nr(e){const t=e.closest(".js-previewable-comment-form"),n=e.classList.contains("js-preview-tab");if(n){const s=t.querySelector(".js-write-bucket"),i=t.querySelector(".js-preview-body");s.clientHeight>0&&(i.style.minHeight=`${s.clientHeight}px`)}t.classList.toggle("preview-selected",n),t.classList.toggle("write-selected",!n);const r=t.querySelector('.tabnav-tab.selected, .tabnav-tab[aria-selected="true"]');r.setAttribute("aria-selected","false"),r.classList.remove("selected"),e.classList.add("selected"),e.setAttribute("aria-selected","true");const o=t.querySelector(".js-write-tab");return n?o.setAttribute("data-hotkey","Control+P,Meta+Shift+p"):o.removeAttribute("data-hotkey"),t}st(nr,"activateTab"),f("click",".js-write-tab",function(e){const t=e.currentTarget,n=t.closest(".js-previewable-comment-form");if(n instanceof kn){setTimeout(()=>{n.querySelector(".js-comment-field").focus()});return}const r=nr(t);setTimeout(()=>{r.querySelector(".js-comment-field").focus()});const o=n.querySelector("markdown-toolbar");o instanceof HTMLElement&&(o.hidden=!1)}),f("click",".js-preview-tab",function(e){const t=e.currentTarget,n=t.closest(".js-previewable-comment-form");if(n instanceof kn)return;const r=nr(t);setTimeout(()=>{rr(r)});const o=n.querySelector("markdown-toolbar");o instanceof HTMLElement&&(o.hidden=!0),e.stopPropagation(),e.preventDefault()}),f("tab-container-change",".js-previewable-comment-form",function(e){const t=e.detail.relatedTarget,n=t&&t.classList.contains("js-preview-panel"),r=e.currentTarget,o=r.querySelector(".js-write-tab");if(n){const s=r.querySelector(".js-write-bucket"),i=r.querySelector(".js-preview-body");!i.hasAttribute("data-skip-sizing")&&s.clientHeight>0&&(i.style.minHeight=`${s.clientHeight}px`),o.setAttribute("data-hotkey","Control+P,Meta+Shift+p"),rr(r);const c=r.querySelector("markdown-toolbar");c instanceof HTMLElement&&(c.hidden=!0)}else{o.removeAttribute("data-hotkey");const s=r.querySelector("markdown-toolbar");s instanceof HTMLElement&&(s.hidden=!1)}r.classList.toggle("preview-selected",n),r.classList.toggle("write-selected",!n)}),f("preview:render",".js-previewable-comment-form",function(e){const t=e.target.querySelector(".js-preview-tab"),n=nr(t);setTimeout(()=>{rr(n);const r=n.querySelector("markdown-toolbar");r instanceof HTMLElement&&(r.hidden=!0)})});function au(e){var t,n,r,o,s,i,a,c,l;const d=e.querySelector(".js-comment-field").value,m=(t=e.querySelector(".js-path"))==null?void 0:t.value,h=(n=e.querySelector(".js-line-number"))==null?void 0:n.value,g=(r=e.querySelector(".js-start-line-number"))==null?void 0:r.value,w=(o=e.querySelector(".js-side"))==null?void 0:o.value,_=(s=e.querySelector(".js-start-side"))==null?void 0:s.value,x=(i=e.querySelector(".js-start-commit-oid"))==null?void 0:i.value,E=(a=e.querySelector(".js-end-commit-oid"))==null?void 0:a.value,M=(c=e.querySelector(".js-base-commit-oid"))==null?void 0:c.value,A=(l=e.querySelector(".js-comment-id"))==null?void 0:l.value,$=new FormData;return $.append("text",d),$.append("authenticity_token",iu(e)),m&&$.append("path",m),h&&$.append("line_number",h),g&&$.append("start_line_number",g),w&&$.append("side",w),_&&$.append("start_side",_),x&&$.append("start_commit_oid",x),E&&$.append("end_commit_oid",E),M&&$.append("base_commit_oid",M),A&&$.append("comment_id",A),$}st(au,"previewForm");function ts(e){const t=e.getAttribute("data-preview-url"),n=au(e);return v(e,"preview:setup",{data:n}),gg(t,n)}st(ts,"fetchPreview");const gg=pe(cu,{hash:lu});let ns=null;async function cu(e,t){ns==null||ns.abort();const{signal:n}=ns=new AbortController,r=await fetch(e,{method:"post",body:t,signal:n});if(!r.ok)throw new Error("something went wrong");return r.text()}st(cu,"uncachedFetch");function lu(e,t){const n=[...t.entries()].toString();return`${e}:${n}`}st(lu,"hash");async function rr(e){const t=e.querySelector(".comment-body");t.innerHTML="

Loading preview…

";try{const n=await ts(e);t.innerHTML=n||"

Nothing to preview

"}catch(n){n.name!=="AbortError"&&(t.innerHTML="

Error rendering preview

")}}st(rr,"renderPreview"),p(".js-preview-tab",function(e){e.addEventListener("mouseenter",async()=>{const t=e.closest(".js-previewable-comment-form");try{await ts(t)}catch(n){}})}),z("keydown",".js-comment-field",function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.shiftKey&&e.key.toUpperCase()==="P"){const n=t.closest(".js-previewable-comment-form");n.classList.contains("write-selected")&&(n instanceof kn?n.querySelector(".js-preview-tab").click():(t.blur(),n.dispatchEvent(new CustomEvent("preview:render",{bubbles:!0,cancelable:!1}))),e.preventDefault(),e.stopImmediatePropagation())}});var bg=Object.defineProperty,rs=(e,t)=>bg(e,"name",{value:t,configurable:!0});const uu=/^(\+1|-1|:\+1?|:-1?)$/,yg=rs(e=>{let t=!1;for(const n of e.split(` `)){const r=n.trim();if(!(!r||r.startsWith(">"))){if(t&&uu.test(r)===!1)return!1;!t&&uu.test(r)&&(t=!0)}}return t},"isReactionLikeComment");f("focusout","#new_comment_field",function(e){const n=e.currentTarget.closest(".js-reaction-suggestion");n&&ss(n)}),f("focusin","#new_comment_field",function(e){os(e)}),z("keyup","#new_comment_field",function(e){os(e)});function os(e){const t=e.target,n=t.value,r=t.closest(".js-reaction-suggestion");if(!!r)if(yg(n)){r.classList.remove("hide-reaction-suggestion"),r.classList.add("reaction-suggestion");const o=r.getAttribute("data-reaction-markup");r.setAttribute("data-reaction-suggestion-message",o)}else ss(r)}rs(os,"toggleReactionSuggestion");function ss(e){e.classList.remove("reaction-suggestion"),e.classList.add("hide-reaction-suggestion"),e.removeAttribute("data-reaction-suggestion-message")}rs(ss,"clearReactionSuggestion"),f("navigation:keydown",".js-commits-list-item",function(e){!Cn(e.detail.originalEvent)||e.target instanceof Element&&e.detail.hotkey==="c"&&e.target.querySelector(".js-navigation-open").click()}),document.addEventListener("click",function(e){if(!(e.target instanceof Element))return;const t="a[data-confirm], input[type=submit][data-confirm], input[type=checkbox][data-confirm], button[data-confirm]",n=e.target.closest(t);if(!n)return;const r=n.getAttribute("data-confirm");!r||n instanceof HTMLInputElement&&n.hasAttribute("data-confirm-checked")&&!n.checked||confirm(r)||(e.stopImmediatePropagation(),e.preventDefault())},!0),me(".js-company-name-input",function(e){const t=e.target,n=t.form,r=n.querySelectorAll(".js-company-name-text");if(r.length===0)return;const o=n.querySelector(".js-corp-tos-link"),s=n.querySelector(".js-tos-link");s&&(s.classList.add("d-none"),s.setAttribute("aria-hidden","true"),o&&(o.classList.remove("d-none"),o.setAttribute("aria-hidden","false")));for(const i of r)if(t.value)if(i.hasAttribute("data-wording")){const c=i.getAttribute("data-wording");i.textContent=` ${c} ${t.value}`}else i.textContent=t.value;else i.textContent=""});var vg=Object.defineProperty,wg=(e,t)=>vg(e,"name",{value:t,configurable:!0});p(".js-company-owned:not(:checked)",{constructor:HTMLInputElement,add(e){const n=e.form.querySelector(".js-company-name-input"),r=document.querySelector(".js-company-name-text"),o=document.querySelector(".js-corp-tos-link"),s=document.querySelector(".js-tos-link");e.getAttribute("data-optional")&&n.removeAttribute("required"),$e(n,""),s.classList.remove("d-none"),s.setAttribute("aria-hidden","false"),o.classList.add("d-none"),o.setAttribute("aria-hidden","true"),r.textContent=""}}),p(".js-company-owned:checked",{constructor:HTMLInputElement,add(e){const n=e.form.querySelector(".js-company-name-input");n&&(n.setAttribute("required",""),v(n,"focus"),v(n,"input"))}}),p(".js-company-owned-autoselect",{constructor:HTMLInputElement,add(e){const t=e;function n(){if(t.checked&&t.form){const r=t.form.querySelector(".js-company-owned");$e(r,!0)}}wg(n,"autoselect"),t.addEventListener("change",n),n()}});var Eg=Object.defineProperty,is=(e,t)=>Eg(e,"name",{value:t,configurable:!0});let Re=null;document.addEventListener("keydown",function(e){!e.defaultPrevented&&e.key==="Escape"&&Re&&Re.removeAttribute("open")}),p(".js-dropdown-details",{subscribe:e=>ie(j(e,"toggle",fu),j(e,"toggle",du))});function du({currentTarget:e}){const t=e;if(t.hasAttribute("open")){const n=t.querySelector("[autofocus]");n&&n.focus()}else{const n=t.querySelector("summary");n&&n.focus()}}is(du,"autofocus");function fu({currentTarget:e}){const t=e;t.hasAttribute("open")?(Re&&Re!==t&&Re.removeAttribute("open"),Re=t):t===Re&&(Re=null)}is(fu,"closeCurrentDetailsDropdown"),p("[data-deferred-details-content-url]:not([data-details-no-preload-on-hover])",{subscribe:e=>{const t=e.querySelector("summary");return j(t,"mouseenter",as)}}),p("[data-deferred-details-content-url]",{subscribe:e=>j(e,"toggle",as)});function as({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");const r=t.querySelector("include-fragment, poll-include-fragment");r.src=n}is(as,"loadDeferredContent"),f("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"))}),Bt(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)}),f("details-dialog-close","[data-disable-dialog-dismiss]",function(e){e.preventDefault()});var jg=Object.defineProperty,mu=(e,t)=>jg(e,"name",{value:t,configurable:!0});p("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 n=t.querySelector(".js-filterable-field");n&&v(n,"filterable:change")}))}),p("details details-menu .js-filterable-field",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t.addEventListener("toggle",function(){t.hasAttribute("open")||(e.value="",v(e,"filterable:change"))})}}),p("details-menu[role=menu] [role=menu]",e=>{const t=e.closest("details-menu[role]");t&&t!==e&&t.removeAttribute("role")}),p("details details-menu remote-input input",{constructor:HTMLInputElement,add(e){const t=e.closest("details");t.addEventListener("toggle",function(){t.hasAttribute("open")||(e.value="")})}}),p("form details-menu",e=>{const t=e.closest("form");t.addEventListener("reset",()=>{setTimeout(()=>pu(t),0)})});function pu(e){const t=e.querySelectorAll("details-menu [role=menuitemradio] input[type=radio]:checked");for(const n of t)v(n,"change")}mu(pu,"resetMenus"),z("keypress","details-menu .js-filterable-field, details-menu filter-input input",e=>{if(e.key==="Enter"){const r=e.currentTarget.closest("details-menu").querySelector('[role^="menuitem"]:not([hidden])');r instanceof HTMLElement&&r.click(),e.preventDefault()}}),f("details-menu-selected","details-menu",e=>{const n=e.currentTarget.querySelector(".js-filterable-field");n instanceof HTMLInputElement&&n.value&&n.focus()},{capture:!0}),f("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}),p("details-menu remote-input",{constructor:ca,initialize(e){const t=document.getElementById(e.getAttribute("aria-owns")||"");if(!t)return;let n=null;e.addEventListener("load",()=>{document.activeElement&&t.contains(document.activeElement)&&document.activeElement.id?n=document.activeElement.id:n=null}),e.addEventListener("loadend",()=>{if(n){const r=t.querySelector(`#${n}`)||t.querySelector('[role^="menu"]');r instanceof HTMLElement?r.focus():e.input&&e.input.focus()}})}}),f("details-menu-selected","details-menu[data-menu-max-options]",e=>{const t=+e.currentTarget.getAttribute("data-menu-max-options"),n=e.currentTarget.querySelectorAll('[role="menuitemcheckbox"][aria-checked="true"]'),r=t===n.length;e.currentTarget.querySelector("[data-menu-max-options-warning]").hidden=!r;for(const o of e.currentTarget.querySelectorAll('[role="menuitemcheckbox"] input'))o.disabled=r&&!o.checked},{capture:!0}),p("details > details-menu",{subscribe(e){const t=e.closest("details");return j(t,"toggle",hu)}});async function hu({currentTarget:e}){const t=e,n=t.hasAttribute("open");v(t,n?"menu:activate":"menu:deactivate"),await Ge(),v(t,n?"menu:activated":"menu:deactivated")}mu(hu,"fireMenuToggleEvent");var Sg=Object.defineProperty,cs=(e,t)=>Sg(e,"name",{value:t,configurable:!0});const ls=new WeakMap,gu=["input[type=submit][data-disable-with]","button[data-disable-with]"].join(", ");function bu(e){return e instanceof HTMLInputElement?e.value||"Submit":e.innerHTML||""}cs(bu,"getButtonText");function us(e,t){e instanceof HTMLInputElement?e.value=t:e.innerHTML=t}cs(us,"setButtonText"),f("submit","form",function(e){for(const t of e.currentTarget.querySelectorAll(gu)){ls.set(t,bu(t));const n=t.getAttribute("data-disable-with");n&&us(t,n),t.disabled=!0}},{capture:!0});function ds(e){for(const t of e.querySelectorAll(gu)){const n=ls.get(t);n!=null&&(us(t,n),(!t.hasAttribute("data-disable-invalid")||e.checkValidity())&&(t.disabled=!1),ls.delete(t))}}cs(ds,"revert"),f("deprecatedAjaxComplete","form",function({currentTarget:e,target:t}){e===t&&ds(e)}),Yr(ds);var Lg=Object.defineProperty,Et=(e,t)=>Lg(e,"name",{value:t,configurable:!0});p(".js-document-dropzone",{constructor:HTMLElement,add(e){document.body.addEventListener("dragstart",bs),document.body.addEventListener("dragend",ys),document.body.addEventListener("dragenter",sn),document.body.addEventListener("dragover",sn),document.body.addEventListener("dragleave",ps),e.addEventListener("drop",hs)},remove(e){document.body.removeEventListener("dragstart",bs),document.body.removeEventListener("dragend",ys),document.body.removeEventListener("dragenter",sn),document.body.removeEventListener("dragover",sn),document.body.removeEventListener("dragleave",ps),e.removeEventListener("drop",hs)}});function fs(e){return Array.from(e.types).indexOf("Files")>=0}Et(fs,"hasFile");let ms=null;function sn(e){if(gs)return;const t=e.currentTarget;ms&&window.clearTimeout(ms),ms=window.setTimeout(()=>t.classList.remove("dragover"),200);const n=e.dataTransfer;!n||!fs(n)||(n.dropEffect="copy",t.classList.add("dragover"),e.stopPropagation(),e.preventDefault())}Et(sn,"onDragenter");function ps(e){e.target instanceof Element&&e.target.classList.contains("js-document-dropzone")&&e.currentTarget.classList.remove("dragover")}Et(ps,"onBodyDragleave");function hs(e){const t=e.currentTarget;t.classList.remove("dragover"),document.body.classList.remove("dragover");const n=e.dataTransfer;!n||!fs(n)||(v(t,"document:drop",{transfer:n}),e.stopPropagation(),e.preventDefault())}Et(hs,"onDrop");let gs=!1;function bs(){gs=!0}Et(bs,"onDragstart");function ys(){gs=!1}Et(ys,"onDragend");var _g=Object.defineProperty,or=(e,t)=>_g(e,"name",{value:t,configurable:!0});async function vs(e,t){const r=new TextEncoder().encode(t),{seal:o}=await L.import("./chunk-tweetsodium.js");return o(r,e)}or(vs,"encrypt");function ws(e){const t=atob(e).split("").map(n=>n.charCodeAt(0));return Uint8Array.from(t)}or(ws,"decode");function Es(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}or(Es,"encode"),f("submit","form.js-encrypt-submit",async function(e){const t=e.currentTarget;if(e.defaultPrevented||!t.checkValidity())return;const n=t.elements.namedItem("secret_value");if(n.disabled=!0,!n.value)return;e.preventDefault();const r=ws(t.getAttribute("data-public-key"));t.elements.namedItem("encrypted_value").value=Es(await vs(r,n.value)),t.submit()}),f("submit","form.js-encrypt-bulk-submit",js(!0)),f("submit","form.js-encrypt-bulk-submit-enable-empty",js(!1));function js(e){return async function(t){const n=t.currentTarget;if(t.defaultPrevented||!n.checkValidity())return;const r=ws(n.getAttribute("data-public-key"));t.preventDefault();for(const o of n.elements){const s=o;if(s.id.endsWith("secret")){if(s.disabled=!0,s.required&&!s.value){const a=`${s.name} is invalid!`,c=document.querySelector("template.js-flash-template");c.after(new Pe(c,{className:"flash-error",message:a}));return}const i=`${s.name}_encrypted_value`;if(!s.value){n.elements.namedItem(i).disabled=e;continue}n.elements.namedItem(i).value=Es(await vs(r,s.value))}}n.submit()}}or(js,"submitBulk");var kg=Object.defineProperty,Ss=(e,t)=>kg(e,"name",{value:t,configurable:!0});let sr;function an(e,t){const n=document.querySelector('.js-site-favicon[type="image/svg+xml"]'),r=document.querySelector('.js-site-favicon[type="image/png"]');t||(t="light");const o=t==="light"?"":"-dark";if(n&&r)if(sr==null&&(sr=n.href),e){e=e.substr(0,e.lastIndexOf(".")),e=`${e}${o}.svg`,n.href=e;const s=n.href.substr(0,n.href.lastIndexOf("."));r.href=`${s}.png`}else{const s=n.href.indexOf("-dark.svg"),i=n.href.substr(0,s!==-1?s:n.href.lastIndexOf("."));n.href=`${i}${o}.svg`,r.href=`${i}${o}.png`}}Ss(an,"updateFavicon");function cn(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}Ss(cn,"prefersDarkColorScheme");function yu(){sr!=null&&an(sr,cn()?"dark":"light")}Ss(yu,"resetIcon"),p("[data-favicon-override]",{add(e){const t=e.getAttribute("data-favicon-override");setTimeout(()=>an(t,cn()?"dark":"light"))},remove(){yu()}}),cn()&&an(void 0,"dark"),window.matchMedia("(prefers-color-scheme: dark)").addListener(()=>{an(void 0,cn()?"dark":"light")});var Tg=Object.defineProperty,vu=(e,t)=>Tg(e,"name",{value:t,configurable:!0});p(".js-feature-preview-indicator-container",e=>{wu(e)});async function wu(e){const t=e.getAttribute("data-feature-preview-indicator-src"),n=await Eu(t),r=e.querySelectorAll(".js-feature-preview-indicator");for(const o of r)o.hidden=!n}vu(wu,"fetchFeaturePreviewIndicator");async function Eu(e){try{const t=await fetch(e,{headers:{Accept:"application/json"}});return t.ok?(await t.json()).show_indicator:!1}catch(t){return!1}}vu(Eu,"fetchIndicator"),f("click","[data-feature-preview-trigger-url]",async e=>{const t=e.currentTarget,n=t.getAttribute("data-feature-preview-trigger-url"),r=await ve({content:N(document,n),dialogClass:"feature-preview-dialog"}),o=t.getAttribute("data-feature-preview-close-details"),s=t.getAttribute("data-feature-preview-close-hmac");r.addEventListener("dialog:remove",()=>{ye({hydroEventPayload:o,hydroEventHmac:s},!0)});const i=document.querySelectorAll(".js-feature-preview-indicator");for(const a of i)a.hidden=!0}),P(".js-feature-preview-unenroll",async(e,t)=>{await t.text();const n=e.querySelector(".js-feature-preview-slug").value;v(e,`feature-preview-unenroll:${n}`)}),P(".js-feature-preview-enroll",async(e,t)=>{await t.text();const n=e.querySelector(".js-feature-preview-slug").value;v(e,`feature-preview-enroll:${n}`)});var Cg=Object.defineProperty,ir=(e,t)=>Cg(e,"name",{value:t,configurable:!0});class ju{constructor(t,n){this.attachment=t,this.policy=n}async process(t){var n,r,o,s;const i=window.performance.now(),a=new Headers(this.policy.header||{}),c=new XMLHttpRequest;c.open("POST",this.policy.upload_url,!0);for(const[h,g]of a)c.setRequestHeader(h,g);c.onloadstart=()=>{t.attachmentUploadDidStart(this.attachment,this.policy)},c.upload.onprogress=h=>{if(h.lengthComputable){const g=Math.round(h.loaded/h.total*100);t.attachmentUploadDidProgress(this.attachment,g)}},await Su(c,Lu(this.attachment,this.policy)),c.status===204?(Ls(this.policy),t.attachmentUploadDidComplete(this.attachment,this.policy,{})):c.status===201?(Ls(this.policy),t.attachmentUploadDidComplete(this.attachment,this.policy,JSON.parse(c.responseText))):t.attachmentUploadDidError(this.attachment,{status:c.status,body:c.responseText});const m={duration:window.performance.now()-i,size:(r=(n=this.attachment)==null?void 0:n.file)==null?void 0:r.size,fileType:(s=(o=this.attachment)==null?void 0:o.file)==null?void 0:s.type,success:c.status===204||c.status===201};ye({uploadTiming:m},!0)}}ir(ju,"AttachmentUpload");function Su(e,t){return new Promise((n,r)=>{e.onload=()=>n(e),e.onerror=r,e.send(t)})}ir(Su,"send");function Lu(e,t){const n=new FormData;t.same_origin&&n.append("authenticity_token",t.upload_authenticity_token);for(const r in t.form)n.append(r,t.form[r]);return n.append("file",e.file),n}ir(Lu,"uploadForm");function Ls(e){const t=typeof e.asset_upload_url=="string"?e.asset_upload_url:null,n=typeof e.asset_upload_authenticity_token=="string"?e.asset_upload_authenticity_token:null;if(!(t&&n))return;const r=new FormData;r.append("authenticity_token",n),fetch(t,{method:"PUT",body:r,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}ir(Ls,"markComplete");var xg=Object.defineProperty,Se=(e,t)=>xg(e,"name",{value:t,configurable:!0});async function _u(e,t){const n=xu(e,t);for(const r of e.attachments){const o=await ku(e,r,t);if(!o)return;try{await new ju(r,o).process(n)}catch(s){v(t,"upload:error",{batch:e,attachment:r}),Le(t,"is-failed");return}}}Se(_u,"upload");async function ku(e,t,n){const r=Tu(t,n),o=[];v(n,"upload:setup",{batch:e,attachment:t,form:r,preprocess:o});try{await Promise.all(o);const s=await fetch(Cu(r,n));if(s.ok)return await s.json();v(n,"upload:invalid",{batch:e,attachment:t});const i=await s.text(),a=s.status,{state:c,messaging:l}=_s({status:a,body:i},t.file);Le(n,c,l)}catch(s){v(n,"upload:invalid",{batch:e,attachment:t}),Le(n,"is-failed")}return null}Se(ku,"validate");function Tu(e,t){const n=t.querySelector(".js-data-upload-policy-url-csrf").value,r=t.getAttribute("data-upload-repository-id"),o=t.getAttribute("data-subject-type"),s=t.getAttribute("data-subject-param"),i=e.file,a=new FormData;return a.append("name",i.name),a.append("size",String(i.size)),a.append("content_type",i.type),a.append("authenticity_token",n),o&&a.append("subject_type",o),s&&a.append("subject",s),r&&a.append("repository_id",r),e.directory&&a.append("directory",e.directory),a}Se(Tu,"policyForm");function Cu(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"}})}Se(Cu,"policyRequest");function xu(e,t){return{attachmentUploadDidStart(n,r){n.saving(0),Le(t,"is-uploading"),v(t,"upload:start",{batch:e,attachment:n,policy:r})},attachmentUploadDidProgress(n,r){n.saving(r),v(t,"upload:progress",{batch:e,attachment:n})},attachmentUploadDidComplete(n,r,o){n.saved(Au(o,r)),v(t,"upload:complete",{batch:e,attachment:n}),e.isFinished()&&Le(t,"is-default")},attachmentUploadDidError(n,r){v(t,"upload:error",{batch:e,attachment:n});const{state:o}=_s(r);Le(t,o)}}}Se(xu,"createDelegate");function Au(e,t){const n=(e.id==null?null:String(e.id))||(t.asset.id==null?null:String(t.asset.id)),r=(typeof e.href=="string"?e.href:null)||(typeof t.asset.href=="string"?t.asset.href:null);return{id:n,href:r,name:t.asset.name}}Se(Au,"savedAttributes");function _s(e,t){if(e.status===400)return{state:"is-bad-file"};if(e.status!==422)return{state:"is-failed"};const n=JSON.parse(e.body);if(!n||!n.errors)return{state:"is-failed"};for(const r of n.errors)switch(r.field){case"size":{const o=t?t.size:null;return o!=null&&o===0?{state:"is-empty"}:{state:"is-too-big",messaging:{message:Ag(r.message),target:".js-upload-too-big"}}}case"file_count":return{state:"is-too-many"};case"width":case"height":return{state:"is-bad-dimensions"};case"name":return r.code==="already_exists"?{state:"is-duplicate-filename"}:{state:"is-bad-file"};case"content_type":return{state:"is-bad-file"};case"uploader_id":return{state:"is-bad-permissions"};case"repository_id":return{state:"is-repository-required"};case"format":return{state:"is-bad-format"}}return{state:"is-failed"}}Se(_s,"policyErrorState");const Ag=Se(e=>e.startsWith("size")?e.substring(5):e,"trimSizeErrorMessage"),Pg=["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 Le(e,t,n){if(n){const{message:r,target:o}=n,s=e.querySelector(o);s&&(s.innerHTML=r)}e.classList.remove(...Pg),e.classList.add(t)}Se(Le,"resetState");var Mg=Object.defineProperty,ar=(e,t)=>Mg(e,"name",{value:t,configurable:!0});class Pu{constructor(t){this.attachments=t,this.size=this.attachments.length,this.total=cr(this.attachments,n=>n.file.size)}percent(){const t=ar(r=>r.file.size*r.percent/100,"bytes"),n=cr(this.attachments,t);return Math.round(n/this.total*100)}uploaded(){const t=ar(n=>n.isSaved()?1:0,"value");return cr(this.attachments,t)}isFinished(){return this.attachments.every(t=>t.isSaved())}}ar(Pu,"Batch");function cr(e,t){return e.reduce((n,r)=>n+t(r),0)}ar(cr,"sum");var $g=Object.defineProperty,lr=(e,t)=>$g(e,"name",{value:t,configurable:!0});p("file-attachment[hover]",{add(e){e.classList.add("dragover")},remove(e){e.classList.remove("dragover")}}),f("file-attachment-accept","file-attachment",function(e){const{attachments:t}=e.detail;t.length===0&&(Le(e.currentTarget,"is-hidden-file"),e.preventDefault())}),f("file-attachment-accepted","file-attachment",function(e){const t=e.currentTarget.querySelector(".drag-and-drop");if(t&&t.hidden)return;const{attachments:n}=e.detail;_u(new Pu(n),e.currentTarget)});let Mu=0;p("file-attachment",{add(e){Mu++==0&&(document.addEventListener("drop",Ts),document.addEventListener("dragover",Cs));const t=e.closest("form");t&&t.addEventListener("reset",xs)},remove(e){--Mu==0&&(document.removeEventListener("drop",Ts),document.removeEventListener("dragover",Cs));const t=e.closest("form");t&&t.removeEventListener("reset",xs)}});function ks(e){return Array.from(e.types).indexOf("Files")>=0}lr(ks,"hasFile");function Ts(e){const t=e.dataTransfer;t&&ks(t)&&e.preventDefault()}lr(Ts,"onDocumentDrop");function Cs(e){const t=e.dataTransfer;t&&ks(t)&&e.preventDefault()}lr(Cs,"onDocumentDragover");function xs({currentTarget:e}){const t=e.querySelector("file-attachment");Le(t,"is-default")}lr(xs,"onFormReset");var qg=Object.defineProperty,Ig=(e,t)=>qg(e,"name",{value:t,configurable:!0});f("filter-input-updated","filter-input",e=>{const t=e.currentTarget.input;if(!(document.activeElement&&document.activeElement===t))return;const{count:n,total:r}=e.detail;Ve(`Found ${n} out of ${r} ${r===1?"item":"items"}`)}),f("toggle","details",e=>{setTimeout(()=>$u(e.target),0)},{capture:!0}),f("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 la&&n.setAttribute("aria-owns",t.id)},{capture:!0});function $u(e){const t=e.querySelector("filter-input");t&&!e.hasAttribute("open")&&t.reset()}Ig($u,"resetFilter");var Og=Object.defineProperty,qu=(e,t)=>Og(e,"name",{value:t,configurable:!0});function As(e,t,n,r={}){var o;const s=(o=r.limit)!=null?o:1/0;let i=0;for(const a of e.children){const c=n(a,t);c==null||(c&&iFg(e,"name",{value:t,configurable:!0});const Iu=new WeakMap;function Ou(e,t,n){const r=t.toLowerCase(),o=n.limit;let s=Iu.get(e);const i=e.querySelector('input[type="radio"]:checked'),a=Array.from(e.children);s||(s=Array.from(e.children),Iu.set(e,s));for(const w of a)e.removeChild(w),w instanceof HTMLElement&&(w.style.display="");const c=r?Je(s,n.sortKey,Qe):s,l=o==null?c:c.slice(0,o),d=l.length,m=document.createDocumentFragment();for(const w of l)m.appendChild(w);let h=!1;if(i instanceof HTMLInputElement)for(const w of m.querySelectorAll('input[type="radio"]:checked'))w instanceof HTMLInputElement&&w.value!==i.value&&(w.checked=!1,h=!0);e.appendChild(m),i&&h&&i.dispatchEvent(new Event("change",{bubbles:!0}));const g=e.querySelectorAll(".js-divider");for(const w of g)w.classList.toggle("d-none",Boolean(r&&r.trim().length>0));return d}Rg(Ou,"filterSortList");var Dg=Object.defineProperty,it=(e,t)=>Dg(e,"name",{value:t,configurable:!0});let Ms=new AbortController;const ln=new WeakMap,Fu=new WeakMap,Ru=new WeakMap;async function Du(e,t,n,r){n&&!ln.has(e)&&Bu(e);const o=await Hu(e,t,n,r);return e.hasAttribute("data-filterable-data-pre-rendered")&&(o.suggestions=Nu(e,n)),o}it(Du,"getData");async function Hu(e,t,n,r){const o=new URL(e.getAttribute("data-filterable-src")||"",window.location.origin);if(o.pathname==="/")throw new Error("could not get data-filterable-src");if(n){const s=ln.get(e),i=t.trim();if(s.lastSearchText===i)return s.lastSearchResult;const a=s.lastSearchText===void 0;s.lastSearchText=i;const c=e.getAttribute("data-filterable-for")||"",l=document.getElementById(c);if(Ms.abort(),i===""&&!r)s.lastSearchResult={suggestions:[],users:[]};else{Ms=new AbortController;const d={headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"},signal:Ms.signal},m=o.searchParams||new URLSearchParams;m.set("q",t),m.set("typeAhead","true"),o.search=m.toString(),a||l==null||l.classList.add("is-loading");const h=await fetch(o.toString(),d);s.lastSearchResult=await h.json()}return l==null||l.classList.remove("is-loading"),s.lastSearchResult}else{const s={headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}};return await(await fetch(o.toString(),s)).json()}}it(Hu,"fetchQueryIfNeeded");function Nu(e,t){const n=[],r=e.querySelectorAll(".js-filterable-suggested-user");if(r.length>0)for(const o of e.querySelectorAll(".js-filterable-suggested-user"))o.classList.remove("js-filterable-suggested-user"),n.push({name:o.querySelector(".js-description").textContent,login:o.querySelector(".js-username").textContent,selected:o.getAttribute("aria-checked")==="true",element:o,suggestion:!0});if(t){const o=ln.get(e);return r.length>0&&(o.cachedSuggestions=n,o.userResultCache.clear()),o.cachedSuggestions}return n}it(Nu,"getPreRenderedUsers");function Bu(e){ln.set(e,{lastSearchResult:{suggestions:[],users:[]},cachedSuggestions:[],userResultCache:new Map})}it(Bu,"initializeTypeAheadCache");async function Uu(e,t,n){var r,o;Ru.set(e,t),await $n();const s=e.hasAttribute("data-filterable-show-suggestion-header"),i=e.hasAttribute("data-filterable-type-ahead"),a=e.hasAttribute("data-filterable-type-ahead-query-on-empty");let c=Fu.get(e);if(!c)try{c=await Du(e,t,i,a),i||Fu.set(e,c)}catch(k){if(k.name==="AbortError")return-1;throw k}if(!i&&Ru.get(e)!==t)return-1;const l=n.limit,d=e.querySelector("template"),m={};for(const k of e.querySelectorAll("input[type=hidden]"))m[`${k.name}${k.value}`]=k;let h=d.nextElementSibling;for(;h;){const k=h;h=k.nextElementSibling,k instanceof HTMLElement&&(i||k.getAttribute("aria-checked")==="true"||k.classList.contains("select-menu-divider"))?k.hidden=!0:k.remove()}let g=0;const w=t.trim()==="",_=document.createDocumentFragment(),x=e.querySelector(".js-divider-suggestions"),E=e.querySelector(".js-divider-rest"),M=ln.get(e);function A(k){const We=`${k.login} ${k.name}`.toLowerCase().trim().includes(t),O=!(l!=null&&g>=l)&&We;if(O||k.selected||k.suggestion){const te=Wu(k,d,m,M);te.hidden=!O,O&&g++,_.appendChild(te)}}it(A,"addItem");let $=!1;if(x&&(((r=c.suggestions)==null?void 0:r.length)>0||s&&c.users.length>0)){const k=(o=c.suggestions)!=null?o:[],We=k.filter(te=>te.selected),O=k.filter(te=>!te.selected);for(const te of We)A(te);_.appendChild(x);const qt=g;for(const te of O)A(te);$=g>qt,x.hidden=!$||i&&!w,s&&c.users.length>0&&(x.hidden=!w)}E&&_.appendChild(E);const Ue=g;for(const k of c.users)A(k);return E&&(E.hidden=Ue===g||!$),e.append(_),g}it(Uu,"substringMemoryFilterList");function Wu(e,t,n,r){if(e.element!=null)return e.element;if(r==null?void 0:r.userResultCache.has(e.id))return r.userResultCache.get(e.id);const o=t.content.cloneNode(!0),s=o.querySelector("input[type=checkbox], input[type=radio]");e.type&&(s.name=`reviewer_${e.type}_ids[]`),s.value=e.id;const i=`${s.name}${e.id}`;let a=e.selected;n[i]&&(a=!0,n[i].remove(),delete n[i]);const c=o.querySelector("[role^=menuitem]");a&&(c.setAttribute("aria-checked","true"),s.checked=!0),e.disabled&&c.setAttribute("aria-disabled","true");const l=o.querySelector(".js-username");l&&(l.textContent=e.login);const d=o.querySelector(".js-description");d&&(d.textContent=e.name);const m=o.querySelector(".js-extended-description");m&&(e.description?m.textContent=e.description:m.remove());const h=o.querySelector(".js-avatar");return h.className=`${h.className} ${e.class}`,h.src=e.avatar,e.element=c,r==null||r.userResultCache.set(e.id,c),e.element}it(Wu,"createReviewerItem");var Hg=Object.defineProperty,_e=(e,t)=>Hg(e,"name",{value:t,configurable:!0});p(".js-filterable-field",{constructor:HTMLInputElement,initialize(e){e.autocomplete||(e.autocomplete="off");const t=e.hasAttribute("type-ahead")?200:null;let n=e.value;async function r(s){n!==s.value&&(n=s.value,await Ge(),v(s,"filterable:change"))}_e(r,"onInputChange");async function o(){n=e.value,await Ge(),v(e,"filterable:change")}return _e(o,"onFocus"),{add(s){s.addEventListener("focus",o),xn(s,r,{wait:t}),document.activeElement===s&&o()},remove(s){s.removeEventListener("focus",o),Ia(s,r)}}}}),f("filterable:change",".js-filterable-field",async function(e){const t=e.currentTarget,n=t.value.trim().toLowerCase(),r=document.querySelectorAll(`[data-filterable-for="${t.id}"]`);for(const o of r){const s=await Vu(o,n);if(s===-1)return;document.activeElement&&t===document.activeElement&&Ve(`${s} results found.`),o.dispatchEvent(new CustomEvent("filterable:change",{bubbles:!0,cancelable:!1,detail:{inputField:t}}))}});function zu(e){return e.hasAttribute("data-filter-value")?e.getAttribute("data-filter-value").toLowerCase().trim():e.textContent.toLowerCase().trim()}_e(zu,"defaultText");async function Vu(e,t){const n=parseInt(e.getAttribute("data-filterable-limit"),10)||null;let r=0;switch(e.getAttribute("data-filterable-type")){case"fuzzy":{const o=t.toLowerCase();r=Ou(e,t,{limit:n,sortKey:_e(i=>{const a=zu(i),c=zt(a,o);return c>0?{score:c,text:a}:null},"sortKey")});break}case"substring":r=As(e,t.toLowerCase(),Xu,{limit:n});break;case"substring-memory":r=await Uu(e,t,{limit:n});break;default:r=As(e,t.toLowerCase(),Ku,{limit:n});break}return e.classList.toggle("filterable-active",t.length>0),e.classList.toggle("filterable-empty",r===0),r}_e(Vu,"filter");function Ku(e,t){return e.textContent.toLowerCase().trim().startsWith(t)}_e(Ku,"prefix");function Xu(e,t){return e.classList.contains("select-menu-no-results")?null:(e.querySelector("[data-filterable-item-text]")||e).textContent.toLowerCase().trim().includes(t)}_e(Xu,"substring"),f("filterable:change","details-menu .select-menu-list",function(e){const t=e.currentTarget,n=t.querySelector(".js-new-item-form");n&&Gu(t,n,e.detail.inputField.value)});function Gu(e,t,n){const r=n.length>0&&!Ju(e,n);if(e.classList.toggle("is-showing-new-item-form",r),!r)return;t.querySelector(".js-new-item-name").textContent=n;const o=t.querySelector(".js-new-item-value");(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&(o.value=n)}_e(Gu,"toggleForm");function Ju(e,t){for(const n of e.querySelectorAll("[data-menu-button-text]"))if(n.textContent.toLowerCase().trim()===t.toLowerCase())return!0;return!1}_e(Ju,"itemExists"),p("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")}});var Ng=Object.defineProperty,$s=(e,t)=>Ng(e,"name",{value:t,configurable:!0});const Qu=navigator.userAgent.match(/Firefox\/(\d+)/);Qu&&Number(Qu[1])<76&&(p('details-menu label[tabindex][role^="menuitem"]',e=>{const t=e.querySelector("input");if(!t)return;const n=e.classList.contains("select-menu-item"),r=t.classList.contains("d-none"),o=n||r||t.hidden;n&&t.classList.add("d-block"),r&&t.classList.remove("d-none"),o&&(t.classList.add("sr-only"),t.hidden=!1),e.removeAttribute("tabindex")}),f("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}),z("keydown",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',async function(e){if(qs(e))e.currentTarget instanceof Element&&Yu(e.currentTarget);else if(e.key==="Enter"){const t=e.currentTarget;e.preventDefault(),await Ge(),t instanceof HTMLInputElement&&t.click()}}),f("blur",'details-menu label input[role="menuitemradio"], details-menu label input[role="menuitemcheckbox"]',e=>{Is(e.currentTarget)},{capture:!0}),z("keyup",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{!qs(e)||e.currentTarget instanceof Element&&Is(e.currentTarget)}));function qs(e){return e.key==="ArrowDown"||e.key==="ArrowUp"}$s(qs,"isArrowKeys");function Yu(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")}$s(Yu,"switchRoleToInputForNavigation");function Is(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")}$s(Is,"switchRoleBackToOriginalState");var Bg=Object.defineProperty,Ug=(e,t)=>Bg(e,"name",{value:t,configurable:!0});function Os(){Oa(document)&&Fa(document)}Ug(Os,"scrollTargetIntoViewIfNeeded"),Bt(Os),f("click",'a[href^="#"]',function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&setTimeout(Os,0)}),f("click",".js-flash-close",function(e){const t=e.currentTarget.closest(".flash-messages");e.currentTarget.closest(".flash").remove(),t&&!t.querySelector(".flash")&&t.remove()});var Wg=Object.defineProperty,zg=(e,t)=>Wg(e,"name",{value:t,configurable:!0});const Vg=["flash-notice","flash-error","flash-message","flash-warn"];function Zu(e){for(const{key:t,value:n}of Vg.flatMap(bo)){yo(t);let r;try{r=atob(decodeURIComponent(n))}catch(o){continue}e.after(new Pe(e,{className:t,message:r}))}}zg(Zu,"displayFlash"),p("template.js-flash-template",{constructor:HTMLTemplateElement,add(e){Zu(e)}});const Fs=new WeakMap;document.addEventListener("focus",function(e){const t=e.target;t instanceof Element&&!Fs.get(t)&&(v(t,"focusin:delay"),Fs.set(t,!0))},{capture:!0}),document.addEventListener("blur",function(e){setTimeout(function(){const t=e.target;t instanceof Element&&t!==document.activeElement&&(v(t,"focusout:delay"),Fs.delete(t))},200)},{capture:!0}),P(".js-form-toggle-target",async function(e,t){try{await t.text()}catch(r){return}const n=e.closest(".js-form-toggle-container");n.querySelector(".js-form-toggle-target[hidden]").hidden=!1,e.hidden=!0});var Kg=Object.defineProperty,Xg=(e,t)=>Kg(e,"name",{value:t,configurable:!0});function ed(e){e instanceof CustomEvent&&Ve(`${e.detail} results found.`)}Xg(ed,"noticeHandler"),p("fuzzy-list",{constructor:Ra,subscribe:e=>j(e,"fuzzy-list-sorted",ed)}),f("click",".email-hidden-toggle",function(e){const t=e.currentTarget.nextElementSibling;t instanceof HTMLElement&&(t.style.display="",t.classList.toggle("expanded"),e.preventDefault())});var Gg=Object.defineProperty,td=(e,t)=>Gg(e,"name",{value:t,configurable:!0});p(".js-hook-url-field",{constructor:HTMLInputElement,add(e){function t(){const n=e.form;if(!n)return;let r;try{r=new URL(e.value)}catch(a){}const o=n.querySelector(".js-invalid-url-notice");o instanceof HTMLElement&&(o.hidden=!!(e.value===""||r&&/^https?:/.test(r.protocol)));const s=n.querySelector(".js-insecure-url-notice");s instanceof HTMLElement&&r&&e.value&&(s.hidden=/^https:$/.test(r.protocol));const i=n.querySelector(".js-ssl-hook-fields");i instanceof HTMLElement&&(i.hidden=!(r&&r.protocol==="https:"))}td(t,"checkUrl"),xn(e,t),t()}});function Rs(e){const t=document.querySelectorAll(".js-hook-event-checkbox");for(const n of t)n.checked=n.matches(e)}td(Rs,"chooseEvents"),f("change",".js-hook-event-choice",function(e){const t=e.currentTarget,n=t.checked&&t.value==="custom",r=t.closest(".js-hook-events-field");if(r&&r.classList.toggle("is-custom",n),t.checked)if(n){const o=document.querySelector(".js-hook-wildcard-event");o.checked=!1}else t.value==="push"?Rs('[value="push"]'):t.value==="all"&&Rs(".js-hook-wildcard-event")}),f("click",".js-hook-deliveries-pagination-button",async function(e){const t=e.currentTarget;t.disabled=!0;const n=t.parentElement,r=t.getAttribute("data-url");n.before(await N(document,r)),n.remove()}),P(".js-redeliver-hook-form",async function(e,t){let n;try{n=await t.html()}catch(o){e.classList.add("failed");return}document.querySelector(".js-hook-deliveries-container").replaceWith(n.html)});var Jg=Object.defineProperty,Qg=(e,t)=>Jg(e,"name",{value:t,configurable:!0});p("[data-hotkey]",{constructor:HTMLElement,add(e){if(Da())Zr(e);else{const t=e.getAttribute("data-hotkey");if(t){const n=nd(t);n.length>0&&(e.setAttribute("data-hotkey",n),Zr(e))}}},remove(e){ua(e)}});function nd(e){return e.split(",").filter(n=>Ha(n)).join(",")}Qg(nd,"filterOutCharacterKeyShortcuts");var Yg=Object.defineProperty,R=(e,t)=>Yg(e,"name",{value:t,configurable:!0});const D=document.querySelector(".js-hovercard-content"),Zg=pe(N);let ge,ur=null,Ds,Hs=0;const Ns=12,Bs=24,rd=Bs-7,od=16,eb=100,tb=250;function De(e){return"Popover-message--"+e}R(De,"contentClass");function sd(e){setTimeout(()=>{if(document.body&&document.body.contains(e)){const t=e.querySelector("[data-hovercard-tracking]");if(t){const r=t.getAttribute("data-hovercard-tracking");r&&Dt("user-hovercard-load",JSON.parse(r))}const n=e.querySelector("[data-hydro-view]");n instanceof HTMLElement&&Na(n)}},500)}R(sd,"trackLoad");function jt(){D instanceof HTMLElement&&(D.style.display="none",D.children[0].innerHTML="",ur=null,ge=null)}R(jt,"hideCard");function id(e){const t=e.getClientRects();let n=t[0]||e.getBoundingClientRect()||{top:0,left:0,height:0,width:0};if(t.length>0){for(const r of t)if(r.leftHs){n=r;break}}return n}R(id,"selectRectNearestMouse");function ad(e){const{width:t,height:n}=D.getBoundingClientRect(),{left:r,top:o,height:s,width:i}=id(e),a=o>n;if(e.classList.contains("js-hovercard-left")){const l=r-t-Ns,d=o+s/2;return{containerTop:a?d-n+rd+od/2:d-rd-od/2,containerLeft:l,contentClassSuffix:a?"right-bottom":"right-top"}}else{const l=window.innerWidth-r>t,d=r+i/2,m=l?d-Bs:d-t+Bs;return{containerTop:a?o-n-Ns:o+s+Ns,containerLeft:m,contentClassSuffix:a?l?"bottom-left":"bottom-right":l?"top-left":"top-right"}}}R(ad,"calculatePositions");function cd(e,t){if(!(D instanceof HTMLElement))return;D.style.visibility="hidden",D.style.display="block",t.classList.remove(De("bottom-left"),De("bottom-right"),De("right-top"),De("right-bottom"),De("top-left"),De("top-right"));const{containerTop:n,containerLeft:r,contentClassSuffix:o}=ad(e);t.classList.add(De(o)),D.style.top=`${n+window.pageYOffset}px`,D.style.left=`${r+window.pageXOffset}px`,gd(e,D),D.style.visibility=""}R(cd,"positionCard");function Us(e,t){if(!(D instanceof HTMLElement))return;const n=D.children[0];n.innerHTML="";const r=document.createElement("div");for(const o of e.children)r.appendChild(o.cloneNode(!0));n.appendChild(r),cd(t,n),sd(r),D.style.display="block"}R(Us,"showCard");function ld(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}R(ld,"determineEnclosingSubject");function ud(e){const t=e.getAttribute("data-hovercard-url");if(t){const n=ld(e);if(n){const r=new URL(t,window.location.origin),o=new URLSearchParams(r.search.slice(1));return o.append("subject",n),o.append("current_path",window.location.pathname+window.location.search),r.search=o.toString(),r.toString()}return t}return""}R(ud,"hovercardUrlFromTarget");function dd(e){const t=e.getAttribute("data-hovercard-type");return t==="pull_request"||t==="issue"?!!e.closest("[data-issue-and-pr-hovercards-enabled]"):t==="team"?!!e.closest("[data-team-hovercards-enabled]"):t==="repository"?!!e.closest("[data-repository-hovercards-enabled]"):t==="commit"?!!e.closest("[data-commit-hovercards-enabled]"):t==="project"?!!e.closest("[data-project-hovercards-enabled]"):t==="discussion"?!!e.closest("[data-discussion-hovercards-enabled]"):t==="acv_badge"?!!e.closest("[data-acv-badge-hovercards-enabled]"):t==="sponsors_listing"?!!e.closest("[data-sponsors-listing-hovercards-enabled]"):!0}R(dd,"hovercardsAreEnabledForType");async function fd(e,t){if("ontouchstart"in document)return;const r=e.currentTarget;if(e instanceof MouseEvent&&(Hs=e.clientX),!(r instanceof Element)||ge===r||r.closest(".js-hovercard-content")||!dd(r))return;jt(),ge=r,ur=document.activeElement;const o=ud(r);let s;try{const i=new Promise(a=>window.setTimeout(a,t,0));s=await Zg(document,o),await i}catch(i){const a=i.response;if(a&&a.status===404){const c="Hovercard is unavailable";r.setAttribute("aria-label",c),r.classList.add("tooltipped","tooltipped-ne")}else if(a&&a.status===410){const c=await a.clone().json();r.setAttribute("aria-label",c.message),r.classList.add("tooltipped","tooltipped-ne")}return}r===ge&&(Us(s,r),e instanceof KeyboardEvent&&D instanceof HTMLElement&&D.focus())}R(fd,"activateFn");function md(e){fd(e,tb)}R(md,"activateWithTimeoutFn");function dr(e){if(!!ge){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&&ur instanceof HTMLElement&&ur.focus();jt()}}R(dr,"deactivateFn");function pd(e){const t=ge;Ds=window.setTimeout(()=>{ge===t&&dr(e)},eb)}R(pd,"deactivateWithTimeoutFn");function Ws(e){if(e instanceof KeyboardEvent)switch(e.key){case"Escape":dr(e)}}R(Ws,"keyupFn");function hd(){Ds&&clearTimeout(Ds)}R(hd,"cancelDeactivation"),D&&(p("[data-hovercard-url]",{subscribe:e=>ie(j(e,"mouseover",md),j(e,"mouseleave",pd),j(e,"keyup",Ws))}),p("[data-hovercard-url]",{remove(e){ge===e&&jt()}}),p(".js-hovercard-content",{subscribe:e=>ie(j(e,"mouseover",hd),j(e,"mouseleave",dr),j(e,"keyup",Ws))}),p(".js-hovercard-include-fragment",{constructor:HTMLTemplateElement,add(e){ge&&Us(e.content,ge)}}),f("menu:activated","details",jt),window.addEventListener("statechange",jt));function gd(e,t){const n=e.getAttribute("data-hovercard-z-index-override");n?t.style.zIndex=n:t.style.zIndex="100"}R(gd,"setZIndexOverride"),async function(){document.addEventListener("pjax:complete",()=>ao({pjax:"true"})),await Ut,ao()}(),f("click","[data-octo-click]",function(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.getAttribute("data-octo-click")||"",r={};if(t.hasAttribute("data-ga-click")){const s=t.getAttribute("data-ga-click").split(",");r.category=s[0].trim(),r.action=s[1].trim()}if(t.hasAttribute("data-octo-dimensions")){const o=t.getAttribute("data-octo-dimensions").split(",");for(const s of o){const[i,a]=s.split(/:(.+)/);i&&(r[i]=a||"")}}Dt(n,r)}),f("click","[data-hydro-click]",function(e){const t=e.currentTarget,n=t.getAttribute("data-hydro-click")||"",r=t.getAttribute("data-hydro-click-hmac")||"",o=t.getAttribute("data-hydro-client-context")||"";co(n,r,o)}),f("click","[data-optimizely-hydro-click]",function(e){const t=e.currentTarget,n=t.getAttribute("data-optimizely-hydro-click")||"",r=t.getAttribute("data-optimizely-hydro-click-hmac")||"";co(n,r,"")}),P(".js-immediate-updates",async function(e,t){let n;try{n=(await t.json()).json.updateContent}catch(r){r.response.json&&(n=r.response.json.updateContent)}if(n)for(const r in n){const o=n[r],s=document.querySelector(r);s instanceof HTMLElement&&An(s,o)}});var nb=Object.defineProperty,zs=(e,t)=>nb(e,"name",{value:t,configurable:!0});p("include-fragment, poll-include-fragment",{subscribe:e=>ie(j(e,"error",yd),j(e,"loadstart",bd))}),f("click","include-fragment button[data-retry-button]",({currentTarget:e})=>{const t=e.closest("include-fragment"),n=t.src;t.src="",t.src=n});function Vs(e,t){const n=e.currentTarget;if(n instanceof Element){for(const r of n.querySelectorAll("[data-show-on-error]"))r instanceof HTMLElement&&(r.hidden=!t);for(const r of n.querySelectorAll("[data-hide-on-error]"))r instanceof HTMLElement&&(r.hidden=t)}}zs(Vs,"toggleElements");function bd(e){Vs(e,!1)}zs(bd,"onLoad");function yd(e){Vs(e,!0)}zs(yd,"onError"),p("[data-indeterminate]",{constructor:HTMLInputElement,initialize(e){e.indeterminate=!0}});var rb=Object.defineProperty,ob=(e,t)=>rb(e,"name",{value:t,configurable:!0});function vd(){L.import("./chunk-jump-to.js")}ob(vd,"load"),p(".js-jump-to-field",{constructor:HTMLInputElement,add(e){e.addEventListener("focusin",vd,{once:!0}),Ba(window.location.pathname)}});var sb=Object.defineProperty,ib=(e,t)=>sb(e,"name",{value:t,configurable:!0});let Ks=!1;async function Xs(){if(Ks)return;Ks=!0;const t={contexts:document.querySelector("meta[name=github-keyboard-shortcuts]").content},n=`/site/keyboard_shortcuts?${new URLSearchParams(t).toString()}`,r=await ve({content:N(document,n)});r.style.width="800px",r.addEventListener("dialog:remove",function(){Ks=!1},{once:!0})}ib(Xs,"showKeyboardShortcuts"),f("click",".js-keyboard-shortcuts",Xs),document.addEventListener("keydown",e=>{e instanceof KeyboardEvent&&(!Cn(e)||e.target instanceof Node&&Ua(e.target)||Tn(e)==="Shift+?"&&Xs())}),p(".js-modifier-key",{constructor:HTMLElement,add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.textContent;t&&(t=t.replace(/ctrl/,"\u2318"),t=t.replace(/alt/,"\u2325"),e.textContent=t)}}}),p(".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-"),t=t.replace(/shift\+/,"shift-"),e.setAttribute("aria-label",t)}}});var ab=Object.defineProperty,cb=(e,t)=>ab(e,"name",{value:t,configurable:!0});function un(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=parseInt(t.getAttribute("data-input-max-length")||"",10),r=parseInt(t.getAttribute("data-warning-length")||"",10)||5,s=t.value.replace(/(\r\n|\n|\r)/g,`\r `);let i=n-s.length;if(i<=0){let d=s.substr(0,n);d.endsWith("\r")?(d=d.substr(0,n-1),i=1):i=0,t.value=d}const a=t.getAttribute("data-warning-text"),l=t.closest(".js-length-limited-input-container").querySelector(".js-length-limited-input-warning");i<=r?(l.textContent=a.replace(new RegExp("{{remaining}}","g"),`${i}`),l.classList.remove("d-none")):(l.textContent="",l.classList.add("d-none"))}cb(un,"displayLengthWarning"),p(".js-length-limited-input",{add(e){e.addEventListener("input",un),e.addEventListener("change",un)},remove(e){e.removeEventListener("input",un),e.removeEventListener("change",un)}}),p("link[rel=prefetch-viewed]",{initialize(){window.requestIdleCallback(()=>{fetch(location.href,{method:"HEAD",credentials:"same-origin",headers:{Purpose:"prefetch-viewed"}})})}}),f("click",".js-member-search-filter",function(e){e.preventDefault();const t=e.currentTarget.getAttribute("data-filter"),r=e.currentTarget.closest("[data-filter-on]").getAttribute("data-filter-on"),o=document.querySelector(".js-member-filter-field"),s=o.value,i=new RegExp(`${r}:(?:[a-z]|_|((').*(')))+`),a=s.toString().trim().replace(i,"");o.value=`${a} ${t}`.replace(/\s\s/," ").trim(),o.focus(),v(o,"input")}),f("auto-check-success",".js-new-organization-name",function(e){const t=e.target,r=t.closest("dd").querySelector(".js-field-hint-name");!r||(r.textContent=t.value)}),P(".js-notice-dismiss",async function(e,t){await t.text(),e.closest(".js-notice").remove()}),f("submit",".js-notice-dismiss-remote",async function(e){const t=e.currentTarget;e.preventDefault();let n;try{n=await fetch(t.action,{method:t.method,body:new FormData(t),headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}catch(r){Me();return}n&&!n.ok?Me():t.closest(".js-notice").remove()});var lb=Object.defineProperty,ub=(e,t)=>lb(e,"name",{value:t,configurable:!0});function wd(e){try{const t=e.getBoundingClientRect();if(t.height===0&&t.width===0||e.style.opacity==="0"||e.style.visibility==="hidden")return!1}catch(t){}return!0}ub(wd,"isVisible"),f("click",".js-github-dev-shortcut",function(e){e.preventDefault();for(const n of document.querySelectorAll("textarea.js-comment-field"))if(n.value&&wd(n)&&!confirm("Are you sure you want to open github.dev?"))return;const t=e.currentTarget;t.pathname=window.location.pathname,t.hash=window.location.hash,window.location.href=t.href}),f("click",".js-github-dev-new-tab-shortcut",function(e){const t=e.currentTarget;t.pathname=window.location.pathname,t.hash=window.location.hash}),f("click",".js-permalink-shortcut",function(e){const t=e.currentTarget;try{Xe(null,"",t.href+window.location.hash)}catch(n){window.location.href=t.href+window.location.hash}for(const n of document.querySelectorAll(".js-permalink-replaceable-link"))n instanceof HTMLAnchorElement&&(n.href=n.getAttribute("data-permalink-href"));e.preventDefault()}),P(".js-permission-menu-form",async function(e,t){const n=e.querySelector(".js-permission-success"),r=e.querySelector(".js-permission-error");n.hidden=!0,r.hidden=!0,e.classList.add("is-loading");let o;try{o=await t.json()}catch(i){e.classList.remove("is-loading"),r.hidden=!1;return}e.classList.remove("is-loading"),n.hidden=!1;const s=e.closest(".js-org-repo");if(s){const i=o.json;s.classList.toggle("with-higher-access",i.members_with_higher_access)}});var db=Object.defineProperty,fr=(e,t)=>db(e,"name",{value:t,configurable:!0});(async function(){await Vt;const e=document.querySelector(".js-pjax-loader-bar");if(!e)return;const t=e.firstElementChild;if(!(t instanceof HTMLElement))return;let n=0,r=null,o=null;function s(){i(0),e&&e.classList.add("is-loading"),r=window.setTimeout(a,0)}fr(s,"initiateLoader");function i(l){t instanceof HTMLElement&&(l===0&&(o==null&&(o=getComputedStyle(t).transition),t.style.transition="none"),n=l,t.style.width=`${n}%`,l===0&&(t.clientWidth,t.style.transition=o||""))}fr(i,"setWidth");function a(){n===0&&(n=12),i(Math.min(n+3,95)),r=window.setTimeout(a,500)}fr(a,"increment");function c(){r&&clearTimeout(r),i(100),e&&e.classList.remove("is-loading")}fr(c,"finishLoader"),document.addEventListener("pjax:start",s),document.addEventListener("pjax:end",c)})();var fb=Object.defineProperty,Gs=(e,t)=>fb(e,"name",{value:t,configurable:!0});let Js=null;const Qs="last_pjax_request",mr="pjax_start",Ys="pjax_end";function Ed(e){e instanceof CustomEvent&&e.detail&&e.detail.url&&(window.performance.mark(mr),Js=e.detail.url)}Gs(Ed,"markPjaxStart");async function jd(){if(await Ge(),!window.performance.getEntriesByName(mr).length)return;window.performance.mark(Ys),window.performance.measure(Qs,mr,Ys);const t=window.performance.getEntriesByName(Qs).pop(),n=t?t.duration:null;!n||(Js&&ye({requestUrl:Js,pjaxDuration:Math.round(n)}),Sd())}Gs(jd,"trackPjaxTiming");function Sd(){window.performance.clearMarks(mr),window.performance.clearMarks(Ys),window.performance.clearMeasures(Qs)}Gs(Sd,"clearPjaxMarks"),"getEntriesByName"in window.performance&&(document.addEventListener("pjax:start",Ed),document.addEventListener("pjax:end",jd)),document.addEventListener("pjax:click",function(e){if(window.onbeforeunload)return e.preventDefault()});var mb=Object.defineProperty,pb=(e,t)=>mb(e,"name",{value:t,configurable:!0});function Ld(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)}pb(Ld,"captureKeypresses");let pr=null;f("pjax:click",".js-pjax-capture-input",function(){pr=Ld(document)}),f("pjax:end","#js-repo-pjax-container",function(){if(pr){const e=pr(),t=document.querySelector(".js-pjax-restore-captured-input");t instanceof HTMLInputElement&&e&&$e(t,e),pr=null}});var hb=Object.defineProperty,gb=(e,t)=>hb(e,"name",{value:t,configurable:!0});function _d(e,t){const n=e.split("/",3).join("/"),r=t.split("/",3).join("/");return n===r}gb(_d,"isSameRepo"),f("pjax:click","#js-repo-pjax-container a[href]",function(e){const t=e.currentTarget.pathname;_d(t,location.pathname)||e.preventDefault()}),f("pjax:click",".js-comment-body",function(e){const t=e.target;t instanceof HTMLAnchorElement&&t.pathname.split("/")[3]==="files"&&e.preventDefault()}),f("pjax:click",".js-pjax-history-navigate",function(e){e.currentTarget instanceof HTMLAnchorElement&&(e.currentTarget.href===Wa()?(history.back(),e.detail.relatedEvent.preventDefault(),e.preventDefault()):e.currentTarget.href===za()&&(history.forward(),e.detail.relatedEvent.preventDefault(),e.preventDefault()))});var bb=Object.defineProperty,kd=(e,t)=>bb(e,"name",{value:t,configurable:!0});function Zs(e){return e.getAttribute("data-pjax-preserve-scroll")!=null?!1:0}kd(Zs,"preserveScrollTo");function dn(e){let t=e;for(;t;){const n=t.getAttribute("data-pjax");if(n&&n!=="true")return document.querySelector(n);t=t.parentElement&&t.parentElement.closest("[data-pjax]")}return e.closest("[data-pjax-container]")}kd(dn,"detectContainer");var yb=Object.defineProperty,Td=(e,t)=>yb(e,"name",{value:t,configurable:!0});function Cd(e){if(e.id)return`#${e.id}`;throw new Error("pjax container has no id")}Td(Cd,"getContainerSelector");function xd(e,t){const n=dn(e),r=Cd(n),o=new URL(e.href,window.location.origin),s=new URLSearchParams(o.search.slice(1));return o.search=s.toString(),fetch(o.href,{headers:Object.assign({Accept:"text/html","X-PJAX":"true","X-PJAX-Container":r,"X-Requested-With":"XMLHttpRequest"},t&&t.headers)})}Td(xd,"pjaxFetch"),p("[data-pjax-container] link[rel=pjax-prefetch]",{constructor:HTMLLinkElement,initialize(e){xd(e,{headers:{Purpose:"prefetch"}})}});var Ad=Object.defineProperty,Pd=Object.getOwnPropertySymbols,vb=Object.prototype.hasOwnProperty,wb=Object.prototype.propertyIsEnumerable,Md=(e,t,n)=>t in e?Ad(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Eb=(e,t)=>{for(var n in t||(t={}))vb.call(t,n)&&Md(e,n,t[n]);if(Pd)for(var n of Pd(t))wb.call(t,n)&&Md(e,n,t[n]);return e},$d=(e,t)=>Ad(e,"name",{value:t,configurable:!0});f("click","[data-pjax] a, a[data-pjax]",function(e){const t=e.currentTarget;if(t instanceof HTMLAnchorElement){if(t.getAttribute("data-skip-pjax")!=null||t.getAttribute("data-remote")!=null)return;const n=dn(t);n&&qd(e,{container:n,scrollTo:Zs(t)})}}),f("change","select[data-pjax]",function(e){const t=e.currentTarget,n=dn(t);n&&qn({url:t.value,container:n})});function qd(e,t){const n=e.currentTarget;if(e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||location.protocol!==n.protocol||location.hostname!==n.hostname||n.href.indexOf("#")>-1&&ei(n)===ei(location)||e.defaultPrevented)return;const r=Eb({url:n.href,target:n},t),o=new CustomEvent("pjax:click",{bubbles:!0,cancelable:!0,detail:{options:r,relatedEvent:e}});n.dispatchEvent(o)&&(qn(r),e.preventDefault(),n.dispatchEvent(new CustomEvent("pjax:clicked",{bubbles:!0,cancelable:!0,detail:{options:r}})))}$d(qd,"click");function ei(e){return e.href.replace(/#.*/,"")}$d(ei,"stripHash");var jb=Object.defineProperty,Sb=(e,t)=>jb(e,"name",{value:t,configurable:!0});f("submit","form[data-pjax]",function(e){const t=e.currentTarget,n=dn(t);if(!n)return;const r=Zs(t),o={type:(t.method||"GET").toUpperCase(),url:t.action,target:t,scrollTo:r,container:n};if(o.type==="GET"){if(t.querySelector("input[type=file]"))return;const s=Id(o.url);s.search+=(s.search?"&":"")+no(t),o.url=s.toString()}else o.data=new FormData(t);qn(o),e.preventDefault()});function Id(e){const t=document.createElement("a");return t.href=e,t}Sb(Id,"parseURL"),p("body.js-print-popup",()=>{window.print(),setTimeout(window.close,1e3)}),p("poll-include-fragment[data-redirect-url]",function(e){const t=e.getAttribute("data-redirect-url");e.addEventListener("load",function(){window.location.href=t})}),p("poll-include-fragment[data-reload]",function(e){e.addEventListener("load",function(){window.location.reload()})});var Lb=Object.defineProperty,_b=(e,t)=>Lb(e,"name",{value:t,configurable:!0});function Od(){return typeof Blob=="function"&&typeof PerformanceObserver=="function"&&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!="undefined"&&"fromEntries"in Object&&"entries"in FormData.prototype&&"toggleAttribute"in Element.prototype&&"flatMap"in Array.prototype&&"replaceChildren"in Element.prototype}_b(Od,"capableBrowser");var kb=Object.defineProperty,ce=(e,t)=>kb(e,"name",{value:t,configurable:!0});let Fd=!1,Rd=0;const Tb=Date.now();function Cb(e){e.error&&hr(br(gr(e.error)))}ce(Cb,"reportEvent");async function xb(e){if(!!e.promise)try{await e.promise}catch(t){t&&t.name!=="AbortError"&&!(t.response instanceof Response)&&hr(br(gr(t)))}}ce(xb,"reportPromiseRejectionEvent");function ti(e,t={}){hr(br(gr(e),t))}ce(ti,"reportError");async function hr(e){var t,n;if(!Wd())return;const r=(n=(t=document.head)==null?void 0:t.querySelector('meta[name="browser-errors-url"]'))==null?void 0:n.content;if(!!r){if(Bd(e.error.stacktrace)){Fd=!0;return}Rd++;try{await fetch(r,{method:"post",body:JSON.stringify(e)})}catch(o){}}}ce(hr,"report");function gr(e){return{type:e.name,value:e.message,stacktrace:Dd(e)}}ce(gr,"formatError");function br(e,t={}){return Object.assign({error:e,sanitizedUrl:Va()||window.location.href,readyState:document.readyState,referrer:document.referrer,timeSinceLoad:Math.round(Date.now()-Tb),user:Ud()||void 0},t)}ce(br,"errorContext");function Dd(e){var t;const n=Hd(e),r=(t=e.framesToPop)!=null?t:0;return r===0?n:n.slice(r)}ce(Dd,"stacktrace");function Hd(e){return da(e.stack||"").map(t=>({filename:t.file||"",function:String(t.methodName),lineno:(t.lineNumber||0).toString(),colno:(t.column||0).toString()}))}ce(Hd,"parseStackTrace");const Nd=/(chrome|moz|safari)-extension:\/\//;function Bd(e){return e.some(t=>Nd.test(t.filename)||Nd.test(t.function))}ce(Bd,"isExtensionError");function Ud(){var e,t;const n=(t=(e=document.head)==null?void 0:e.querySelector('meta[name="user-login"]'))==null?void 0:t.content;return n||`anonymous-${Ka()}`}ce(Ud,"pageUser");let ni=!1;window.addEventListener("pageshow",()=>ni=!1),window.addEventListener("pagehide",()=>ni=!0);function Wd(){return!ni&&!Fd&&Rd<10&&Od()&&!lo(document)}ce(Wd,"reportable"),typeof BroadcastChannel=="function"&&new BroadcastChannel("shared-worker-error").addEventListener("message",t=>{ti(t.data.error)});const Ab="$__",zd=document.querySelector("meta[name=js-proxy-site-detection-payload]"),Vd=document.querySelector("meta[name=expected-hostname]");if(zd instanceof HTMLMetaElement&&Vd instanceof HTMLMetaElement&&lo(document)){const e={url:window.location.href,expectedHostname:Vd.content,documentHostname:document.location.hostname,proxyPayload:zd.content},t=new Error,n={};n[`${Ab}`]=btoa(JSON.stringify(e)),ti(t,n)}var Pb=Object.defineProperty,Mb=(e,t)=>Pb(e,"name",{value:t,configurable:!0});z("keydown",".js-quick-submit",function(e){Kd(e)});function Kd(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.key==="Enter"){const n=t.form,r=n.querySelector("input[type=submit], button[type=submit]");if(e.shiftKey){const o=n.querySelector(".js-quick-submit-alternative");(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&!o.disabled&&W(n,o)}else(r instanceof HTMLInputElement||r instanceof HTMLButtonElement)&&r.disabled||W(n);e.preventDefault()}}Mb(Kd,"quickSubmit");var $b=Object.defineProperty,ri=(e,t)=>$b(e,"name",{value:t,configurable:!0});let yr;p(".js-comment-quote-reply",function(e){var t;e.hidden=((t=e.closest(".js-quote-selection-container"))==null?void 0:t.querySelector(".js-inline-comment-form-container, .js-new-comment-form"))==null});function oi(e){return e.nodeName==="DIV"&&e.classList.contains("highlight")}ri(oi,"isHighlightContainer");function Xd(e){return e.nodeName==="IMG"||e.firstChild!=null}ri(Xd,"hasContent");const Gd={PRE(e){const t=e.parentElement;if(t&&oi(t)){const n=t.className.match(/highlight-source-(\S+)/),r=n?n[1]:"",o=(e.textContent||"").replace(/\n+$/,"");e.textContent=`\`\`\`${r} ${o} \`\`\``,e.append(` `)}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]"),r=document.createElement("p");r.textContent=n.href,t.replaceWith(r)}return e}};function Jd(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode(o){return o.nodeName in Gd&&Xd(o)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),n=[];let r=t.nextNode();for(;r;)r instanceof HTMLElement&&n.push(r),r=t.nextNode();n.reverse();for(const o of n)o.replaceWith(Gd[o.nodeName](o))}ri(Jd,"insertMarkdownSyntax"),f("click",".js-comment-quote-reply",function({isTrusted:e,currentTarget:t}){const n=t.closest(".js-comment"),r=n.querySelector(".js-comment-body"),o=n.querySelector(".js-comment-body").cloneNode(!0),s=n.closest(".js-quote-selection-container"),i=r.querySelectorAll("button.js-convert-to-issue-button, span.js-clear");for(const l of i)l.remove();let a=new fa;if(!e&&a.range.collapsed||(s.hasAttribute("data-quote-markdown")&&(a=new ma(s.getAttribute("data-quote-markdown")||"",l=>{const d=a.range.startContainer.parentElement,m=d&&d.closest("pre");if(m instanceof HTMLElement){const h=m.parentElement;if(h&&oi(h)){const g=document.createElement("div");g.className=h.className,g.appendChild(l),l.appendChild(g)}}Jd(l)})),yr&&r.contains(yr.anchorNode)?a.range=yr.range:a.range.collapsed&&a.select(r),a.closest(".js-quote-selection-container")!==s))return;const c=a.range;s.dispatchEvent(new CustomEvent("quote-selection",{bubbles:!0,detail:a})),a.range=c;for(const l of s.querySelectorAll("textarea"))if(Nt(l)){a.insert(l);break}n.querySelector(".js-comment-body").replaceWith(o)});let si;document.addEventListener("selectionchange",ze(function(){const e=window.getSelection();let t;try{t=e.getRangeAt(0)}catch(n){si=null;return}si={anchorNode:e.anchorNode,range:t}},100)),document.addEventListener("toggle",()=>{yr=si},{capture:!0});var qb=Object.defineProperty,Qd=(e,t)=>qb(e,"name",{value:t,configurable:!0});P(".js-pick-reaction",async function(e,t){const n=await t.json(),r=e.closest(".js-comment"),o=r.querySelector(".js-reactions-container"),s=r.querySelector(".js-comment-header-reaction-button"),i=fe(document,n.json.reactions_container.trim()),a=fe(document,n.json.comment_header_reaction_button.trim());o.replaceWith(i),s.replaceWith(a)});function ii(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}Qd(ii,"showReactionContent");function ai(e){const n=e.target.closest(".js-add-reaction-popover").querySelector(".js-reaction-description"),r=n.getAttribute("data-default-text");r&&(n.textContent=r)}Qd(ai,"hideReactionContent"),f("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",ii),n.addEventListener("mouseleave",ai)):(n.removeEventListener("mouseenter",ii),n.removeEventListener("mouseleave",ai))},{capture:!0});var Ib=Object.defineProperty,Ob=(e,t)=>Ib(e,"name",{value:t,configurable:!0});function Yd(e,t,n){e.getAttribute("data-type")==="json"&&n.headers.set("Accept","application/json"),v(e,"deprecatedAjaxSend",{request:n}),t.text().catch(o=>{if(o.response)return o.response;throw o}).then(o=>{o.status<300?v(e,"deprecatedAjaxSuccess"):v(e,"deprecatedAjaxError",{error:o.statusText,status:o.status,text:o.text})},o=>{v(e,"deprecatedAjaxError",{error:o.message,status:0,text:null})}).then(()=>{v(e,"deprecatedAjaxComplete")})}Ob(Yd,"submitWithLegacyEvents"),f("click",["form button:not([type])","form button[type=submit]","form input[type=submit]"].join(", "),function(e){const t=e.currentTarget;t.form&&!e.defaultPrevented&&Xa(t)}),P("form[data-remote]",Yd),f("deprecatedAjaxComplete","form",function({currentTarget:e}){const t=uo(e);t&&t.remove()}),Yr(e=>{const t=uo(e);t&&t.remove()}),pa($n);var Zd=Object.defineProperty,Fb=Object.getOwnPropertyDescriptor,Rb=(e,t)=>Zd(e,"name",{value:t,configurable:!0}),fn=(e,t,n,r)=>{for(var o=r>1?void 0:r?Fb(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Zd(t,n,o),o};let at=class extends HTMLElement{constructor(){super(...arguments);this.loaderWasFocused=!1}connectedCallback(){this.setPaginationUrl(this.list)}get hasNextPage(){return!this.form.hidden}loadNextPage(){!this.hasNextPage||W(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 t;this.setPaginationUrl(this.list),this.loaderWasFocused&&((t=this.focusMarkers.pop())==null||t.focus()),this.loaderWasFocused=!1},{once:!0})}async submit(e){var t;if(e.preventDefault(),this.disabled)return;this.disabled=!0;let n;try{const o=await fetch(this.form.action);if(!o.ok)return;n=await o.text()}catch(o){return}const r=fe(document,n);this.setPaginationUrl(r),this.list.append(r),(t=this.focusMarkers.pop())==null||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}};Rb(at,"RemotePaginationElement"),fn([y],at.prototype,"form",2),fn([y],at.prototype,"list",2),fn([oe],at.prototype,"focusMarkers",2),fn([y],at.prototype,"submitButton",2),at=fn([I],at),p(".has-removed-contents",function(){let e;return{add(t){e=Array.from(t.childNodes);for(const r of e)t.removeChild(r);const n=t.closest("form");n&&v(n,"change")},remove(t){for(const r of e)t.appendChild(r);const n=t.closest("form");n&&v(n,"change")}}});var Db=Object.defineProperty,St=(e,t)=>Db(e,"name",{value:t,configurable:!0});const vr=["is-render-pending","is-render-ready","is-render-loading","is-render-loaded"],Hb=["is-render-ready","is-render-loading","is-render-loaded","is-render-failed","is-render-failed-fatally"],Lt=new WeakMap;function ci(e){const t=Lt.get(e);t!=null&&(t.load=t.hello=null,t.helloTimer&&(clearTimeout(t.helloTimer),t.helloTimer=null),t.loadTimer&&(clearTimeout(t.loadTimer),t.loadTimer=null))}St(ci,"resetTiming");function mn(e){e.classList.remove(...vr),e.classList.add("is-render-failed"),ci(e)}St(mn,"renderFailed");function li(e,t=!1){var n;!Nt(e)||e.classList.contains("is-render-ready")||e.classList.contains("is-render-failed")||e.classList.contains("is-render-failed-fatally")||t&&!((n=Lt.get(e))==null?void 0:n.hello)||mn(e)}St(li,"timeoutWatchdog"),p(".js-render-target",function(e){var t;const n=e;n.classList.remove(...Hb),n.style.height="auto",!((t=Lt.get(e))==null?void 0:t.load)&&(ci(e),!Lt.get(e)&&(Lt.set(e,{load:Date.now(),hello:null,helloTimer:window.setTimeout(li,1e4,e,!0),loadTimer:window.setTimeout(li,45e3,e)}),e.classList.add("is-render-automatic","is-render-requested")))});function pn(e,t){e&&e.postMessage&&e.postMessage(JSON.stringify(t),"*")}St(pn,"postAsJson"),window.addEventListener("message",function(e){let t=e.data;if(!t)return;if(typeof t=="string")try{t=JSON.parse(t)}catch(d){return}if(typeof t.type!="string"&&t.type!=="render")return;const n=t.type;if(typeof t.identity!="string")return;const r=t.identity;if(typeof t.body!="string")return;const o=t.body;let s;for(const d of document.querySelectorAll(".js-render-target"))if(!r||d.getAttribute("data-identity")===r){s=d;break}if(!s||e.origin!==s.getAttribute("data-host"))return;const i=t.payload!=null?t.payload:void 0,a=s.querySelector("iframe"),c=a==null?void 0:a.contentWindow;function l(){const d=a==null?void 0:a.getAttribute("data-content");if(!d)return;const m={type:"render:cmd",body:{cmd:"code_rendering_service:data:ready","code_rendering_service:data:ready":JSON.parse(d)}};pn(c,m)}switch(St(l,"postData"),o){case"hello":{const d=Lt.get(s)||{untimed:!0};d.hello=Date.now();const m={type:"render:cmd",body:{cmd:"ack",ack:!0}},h={type:"render:cmd",body:{cmd:"branding",branding:!1}};if(!c)return;if(pn(c,m),pn(c,h),s.classList.contains("is-local")){const g=s.closest(".js-code-editor"),w=g instanceof HTMLElement?Wt(g):null;if(w){let _=null;const x=St((E,M)=>{if(M&&M.origin==="setValue")return;const A=w.code();A!==_&&(_=A,pn(c,{type:"render:data",body:A}))},"sendEditorData");w.editor.on("change",x),x()}}}break;case"error":mn(s);break;case"error:fatal":mn(s),s.classList.add("is-render-failed-fatal");break;case"error:invalid":mn(s),s.classList.add("is-render-failed-invalid");break;case"loading":s.classList.remove(...vr),s.classList.add("is-render-loading");break;case"loaded":s.classList.remove(...vr),s.classList.add("is-render-loaded");break;case"ready":s.classList.remove(...vr),s.classList.add("is-render-ready"),i&&typeof i.height=="number"&&(s.style.height=`${i.height}px`),v(s,"render:hook:afterready",{container:s,payload:i});break;case"resize":i&&typeof i.height=="number"&&(s.style.height=`${i.height}px`);break;case"data":v(s,"edit:visual",i);break;case"code_rendering_service:markdown:get_data":if(!c)return;l();break;default:v(s,"render:hook:message",{type:n,body:o,payload:i});break}}),P("form[data-replace-remote-form]",async function(e,t){e.classList.remove("is-error"),e.classList.add("is-loading");try{let n=e;const r=await t.html(),o=e.closest("[data-replace-remote-form-target]");if(o){const s=o.getAttribute("data-replace-remote-form-target");n=s?document.getElementById(s):o}n.replaceWith(r.html)}catch(n){e.classList.remove("is-loading"),e.classList.add("is-error")}}),PerformanceObserver&&(PerformanceObserver.supportedEntryTypes||[]).includes("longtask")&&new PerformanceObserver(function(t){const n=t.getEntries().map(({name:r,duration:o})=>({name:r,duration:o,url:window.location.href}));ye({longTasks:n})}).observe({entryTypes:["longtask"]});var Nb=Object.defineProperty,Bb=(e,t)=>Nb(e,"name",{value:t,configurable:!0});const ef=new WeakMap;function tf(e){return e.closest("markdown-toolbar").field}Bb(tf,"getTextarea"),f("click",".js-markdown-link-button",async function({currentTarget:e}){const n=document.querySelector(".js-markdown-link-dialog").content.cloneNode(!0);if(!(n instanceof DocumentFragment))return;const r=await ve({content:n});e instanceof HTMLElement&&ef.set(r,tf(e).selectionEnd)}),f("click",".js-markdown-link-insert",({currentTarget:e})=>{const t=e.closest("details-dialog"),n=document.querySelector(`#${e.getAttribute("data-for-textarea")}`),r=ef.get(t)||0,o=t.querySelector("#js-dialog-link-href").value,i=`[${t.querySelector("#js-dialog-link-text").value}](${o}) `,a=n.value.slice(0,r),c=n.value.slice(r);n.value=a+i+c,n.focus(),n.selectionStart=n.selectionEnd=r+i.length}),f("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");io(o,n),setTimeout(()=>o.focus(),0)},{capture:!0}),z("keydown",".js-saved-reply-shortcut-comment-field",function(e){Tn(e)==="Control+."&&(e.target.closest(".js-previewable-comment-form").querySelector(".js-saved-reply-container").setAttribute("open",""),e.preventDefault())}),z("keydown",".js-saved-reply-filter-input",function(e){if(/^Control\+[1-9]$/.test(Tn(e))){const n=e.target.closest(".js-saved-reply-container").querySelectorAll('[role="menuitem"]'),r=Number(e.key),o=n[r-1];o instanceof HTMLElement&&(o.click(),e.preventDefault())}});var Ub=Object.defineProperty,ui=(e,t)=>Ub(e,"name",{value:t,configurable:!0});function nf(e,t){return e.querySelector(`#LC${t}`)}ui(nf,"queryLineElement");function rf(e,t){const n=ro(e,r=>nf(t,r));if(n){const r=document.createElement("span"),o=["text-bold","hx_keyword-hl","rounded-1","d-inline-block"];r.classList.add(...o),oo(n,r)}}ui(rf,"highlightColumns");function of(e){const t=parseInt(e.getAttribute("data-start-line")),n=parseInt(e.getAttribute("data-end-line")),r=parseInt(e.getAttribute("data-start-column")),o=parseInt(e.getAttribute("data-end-column"));return t!==n||t===n&&r===o?null:{start:{line:t,column:r},end:{line:n,column:o!==0?o:null}}}ui(of,"parseColumnHighlightRange"),p(".js-highlight-code-snippet-columns",function(e){const t=of(e);t!==null&&rf(t,e)}),f("click",".js-segmented-nav-button",function(e){e.preventDefault();const t=e.currentTarget,n=t.getAttribute("data-selected-tab"),r=t.closest(".js-segmented-nav"),o=r.parentElement;for(const s of r.querySelectorAll(".js-segmented-nav-button"))s.classList.remove("selected");t.classList.add("selected");for(const s of o.querySelectorAll(".js-selected-nav-tab"))s.parentElement===o&&s.classList.remove("active");document.querySelector(`.${n}`).classList.add("active")});var Wb=Object.defineProperty,zb=(e,t)=>Wb(e,"name",{value:t,configurable:!0});function ke(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}zb(ke,"getPageID");const Vb=ze(function(){It(ke())},50);window.addEventListener("submit",ha,{capture:!0}),window.addEventListener("pageshow",function(){It(ke())}),window.addEventListener("pjax:end",function(){It(ke())}),p(".js-session-resumable",function(){Vb()}),window.addEventListener("pagehide",function(){Ot(ke(),{selector:".js-session-resumable"})}),window.addEventListener("pjax:beforeReplace",function(e){const t=e.detail.previousState,n=t?t.url:null;if(n)Ot(ke(new URL(n,window.location.origin)),{selector:".js-session-resumable"});else{const r=new Error("pjax:beforeReplace event.detail.previousState.url is undefined");setTimeout(function(){throw r})}}),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 r=(n.getAttribute("data-selected-links")||"").split(" ").indexOf(t)>=0;r?n.setAttribute("aria-current","page"):n.removeAttribute("aria-current"),n.classList.toggle("selected",r)}});var Kb=Object.defineProperty,hn=(e,t)=>Kb(e,"name",{value:t,configurable:!0});const di=["notification_referrer_id","notifications_before","notifications_after","notifications_query"],wr="notification_shelf";function sf(e,t=null){return e.has("notification_referrer_id")?(cf(e,t),lf(e)):null}hn(sf,"storeAndStripShelfParams");function af(e=null){const t=fi(e);if(!t)return fo(wr),null;try{const n=Ga(wr);if(!n)return null;const r=JSON.parse(n);if(!r||!r.pathname)throw new Error("Must have a pathname");if(r.pathname!==t)throw new Error("Stored pathname does not match current pathname.");const o={};for(const s of di)o[s]=r[s];return o}catch(n){return fo(wr),null}}hn(af,"getStoredShelfParamsForCurrentPage");function cf(e,t){const n=fi(t);if(!n)return;const r={pathname:n};for(const o of di){const s=e.get(o);s&&(r[o]=s)}Ja(wr,JSON.stringify(r))}hn(cf,"storeShelfParams");function lf(e){for(const t of di)e.delete(t);return e}hn(lf,"deleteShelfParams");function fi(e){e=e||window.location.pathname;const t=/^(\/[^/]+\/[^/]+\/pull\/[^/]+)/,n=e.match(t);return n?n[0]:null}hn(fi,"getCurrentPullRequestPathname");var Xb=Object.defineProperty,Er=(e,t)=>Xb(e,"name",{value:t,configurable:!0});async function uf(){return P(".js-notification-shelf .js-notification-action form",async function(e,t){if(e.hasAttribute("data-redirect-to-inbox-on-submit")){await mi(t);const r=document.querySelector(".js-notifications-back-to-inbox");r&&r.click();return}Qa(e,e),await mi(t)})}Er(uf,"remoteShelfActionForm");function df(){const e=new URLSearchParams(window.location.search),t=sf(e);if(t){const n=new URL(window.location.href,window.location.origin);return n.search=t.toString(),n.toString()}}Er(df,"urlWithoutNotificationParameters");function ff(e){if(!(e instanceof Gr))return;const t=af();if(!t)return;const n=e.getAttribute("data-base-src");if(!n)return;const r=new URL(n,window.location.origin),o=new URLSearchParams(r.search);for(const[s,i]of Object.entries(t))typeof i=="string"&&o.set(s,i);r.search=o.toString(),e.setAttribute("src",r.toString())}Er(ff,"loadShelfFromStoredParams");async function mi(e){try{await e.text()}catch(t){}}Er(mi,"performRequest");var Gb=Object.defineProperty,mf=(e,t)=>Gb(e,"name",{value:t,configurable:!0});uf();function pf(){const e=df();e&&Xe(null,"",e)}mf(pf,"removeNotificationParams"),pf(),p(".js-notification-shelf-include-fragment",ff),f("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 hf(){await Ut;const e=document.querySelector(".js-mark-notification-form");e instanceof HTMLFormElement&&W(e)}mf(hf,"markNotificationAsRead"),hf();var Jb=Object.defineProperty,pi=(e,t)=>Jb(e,"name",{value:t,configurable:!0});function gf(e){return!!e.closest(".js-jump-to-field")}pi(gf,"isJumpToAvailable");function jr(e,t){if(gf(e))return;const n=document.querySelector(".js-site-search-form");document.querySelector(".js-site-search").classList.toggle("scoped-search",t);let r,o;t?(r=n.getAttribute("data-scoped-search-url"),o=e.getAttribute("data-scoped-placeholder")):(r=n.getAttribute("data-unscoped-search-url"),o=e.getAttribute("data-unscoped-placeholder")),n.setAttribute("action",r),e.setAttribute("placeholder",o)}pi(jr,"toggleSearchScope"),z("keyup",".js-site-search-field",function(e){const t=e.target,n=t.value.length===0;n&&e.key==="Backspace"&&t.classList.contains("is-clearable")&&jr(t,!1),n&&e.key==="Escape"&&jr(t,!0),t.classList.toggle("is-clearable",n)}),Ht(".js-site-search-focus",function(e){const t=e.closest(".js-chromeless-input-container");t.classList.add("focus");function n(){t.classList.remove("focus"),e.value.length===0&&e.classList.contains("js-site-search-field")&&jr(e,!0),e.removeEventListener("blur",n)}pi(n,"blurHandler"),e.addEventListener("blur",n)}),f("submit",".js-site-search-form",function(e){if(!(e.target instanceof Element))return;const t=e.target.querySelector(".js-site-search-type-field");t.value=new URLSearchParams(window.location.search).get("type")||""}),p("textarea.js-size-to-fit",{constructor:HTMLTextAreaElement,subscribe:ga}),f("click",".js-smoothscroll-anchor",function(e){const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))return;const n=Ya(document,t.hash);!n||(n.scrollIntoView({behavior:"smooth"}),e.preventDefault())});var Qb=Object.defineProperty,Yb=(e,t)=>Qb(e,"name",{value:t,configurable:!0});const Zb=1e3,bf=new WeakMap,yf=document.querySelector("#snippet-clipboard-copy-button");async function vf(e,t){const n=e.getAttribute("data-snippet-clipboard-copy-content");if(n===null||(e.removeAttribute("data-snippet-clipboard-copy-content"),!(yf instanceof HTMLTemplateElement)))return;const o=yf.content.cloneNode(!0).children[0];if(!(o instanceof HTMLElement))return;const s=o.children[0];if(!(s instanceof HTMLElement))return;s.setAttribute("value",n),document.addEventListener("selectionchange",()=>{const a=document.getSelection();if(a&&e.contains(a.anchorNode)){const c=a==null?void 0:a.toString();s.style.display=c.trim()===""?"inherit":"none"}},{signal:t});const i=e.querySelector("pre");if(i!==null){let a;i.addEventListener("scroll",()=>{a&&clearTimeout(a),s.style.display="none",a=setTimeout(()=>{s.style.display="inherit"},Zb)},{signal:t})}e.appendChild(o)}Yb(vf,"insertSnippetClipboardCopyButton"),p("[data-snippet-clipboard-copy-content]",{constructor:HTMLElement,add(e){const t=new AbortController;bf.set(e,t),vf(e,t.signal)}}),p(".snippet-clipboard-content clipboard-copy",{constructor:HTMLElement,remove(e){const t=bf.get(e);t&&t.abort()}});var wf=Object.defineProperty,Ef=Object.getOwnPropertySymbols,ey=Object.prototype.hasOwnProperty,ty=Object.prototype.propertyIsEnumerable,jf=(e,t,n)=>t in e?wf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ny=(e,t)=>{for(var n in t||(t={}))ey.call(t,n)&&jf(e,n,t[n]);if(Ef)for(var n of Ef(t))ty.call(t,n)&&jf(e,n,t[n]);return e},Sf=(e,t)=>wf(e,"name",{value:t,configurable:!0});function hi(e,t,n){gi(e,t),n&&e.classList.toggle("on");const r=Array.from(e.querySelectorAll(".js-social-updatable"),In);return Promise.all(r)}Sf(hi,"handleSocialResponse"),P(".js-social-form",async function(e,t){var n,r;let o;const s=e.closest(".js-social-container"),i=e.classList.contains("js-deferred-toggler-target");try{o=await t.json(),s&&await hi(s,o.json.count,i)}catch(a){if(((n=a.response)==null?void 0:n.status)===409&&a.response.json.confirmationDialog){const c=a.response.json.confirmationDialog,l=document.querySelector(c.templateSelector),d=(r=e.querySelector(".js-confirm-csrf-token"))==null?void 0:r.value;if(l instanceof HTMLTemplateElement&&d){const m=new Pe(l,ny({confirmUrl:e.action,confirmCsrfToken:d},c.inputs||{})),h=await ve({content:m});h.addEventListener("social-confirmation-form:success",async g=>{g instanceof CustomEvent&&s&&await hi(s,g.detail.count,i)}),h.addEventListener("social-confirmation-form:error",()=>{Me()})}}else s&&!i&&s.classList.toggle("on"),Me()}}),P(".js-social-confirmation-form",async function(e,t){try{const n=await t.json();v(e,"social-confirmation-form:success",n.json)}catch(n){v(e,"social-confirmation-form:error")}});function gi(e,t){for(const n of e.querySelectorAll(".js-social-count")){n.textContent=t;const r=n.getAttribute("data-singular-suffix"),o=n.getAttribute("data-plural-suffix"),s=t==="1"?r:o;s&&n.setAttribute("aria-label",`${t} ${s}`)}}Sf(gi,"updateSocialCounts");var ry=Object.defineProperty,Sr=(e,t)=>ry(e,"name",{value:t,configurable:!0});class Lf extends ba{constructor(t,n,r,o){super(t,()=>this.getUrlFromRefreshUrl(),r,o);this.refreshUrl=n}getUrlFromRefreshUrl(){return _f(this.refreshUrl)}}Sr(Lf,"AliveSession");async function _f(e){const t=await kf(e);return t&&t.url&&t.token?Tf(t.url,t.token):null}Sr(_f,"fetchRefreshUrl");async function kf(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(t.ok)return t.json();if(t.status===404)return null;throw new Error("fetch error")}Sr(kf,"fetchJSON");async function Tf(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")}Sr(Tf,"post");var oy=Object.defineProperty,sy=(e,t)=>oy(e,"name",{value:t,configurable:!0});const Lr=[],iy=3e4,ay=0;let _r=document.hidden,kr;function Cf(e){return e(_r),Lr.push(e),new Za(()=>{const t=Lr.indexOf(e);t!==-1&&Lr.splice(t,1)})}sy(Cf,"addIdleStateListener"),(()=>{document.addEventListener("visibilitychange",()=>{const e=document.hidden;kr!==void 0&&clearTimeout(kr),kr=setTimeout(()=>{if(e!==_r){_r=e,kr=void 0;for(const n of Lr)n(_r)}},e?iy:ay)})})();var cy=Object.defineProperty,Z=(e,t)=>cy(e,"name",{value:t,configurable:!0});function xf(){return"SharedWorker"in window&&ec("localStorage").getItem("bypassSharedWorker")!=="true"}Z(xf,"isSharedWorkerSupported");function Af(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket-src]"))==null?void 0:e.href)!=null?t:null}Z(Af,"workerSrc");function Pf(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket]"))==null?void 0:e.href)!=null?t:null}Z(Pf,"socketUrl");function Mf(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket]"))==null?void 0:e.getAttribute("data-refresh-url"))!=null?t:null}Z(Mf,"socketRefreshUrl");function $f(){var e,t;return(t=(e=document.head.querySelector("link[rel=shared-web-socket]"))==null?void 0:e.getAttribute("data-session-id"))!=null?t:null}Z($f,"sessionIdentifier");function qf(e){return bi(e).map(t=>({subscriber:e,topic:t}))}Z(qf,"subscriptions");function bi(e){return(e.getAttribute("data-channel")||"").trim().split(/\s+/).map(ya.parse).filter(If)}Z(bi,"channels");function If(e){return e!=null}Z(If,"isPresent");function yi(e,{channel:t,type:n,data:r}){for(const o of e)o.dispatchEvent(new CustomEvent(`socket:${n}`,{bubbles:!1,cancelable:!1,detail:{name:t,data:r}}))}Z(yi,"notify");class Of{constructor(t,n,r,o,s){this.subscriptions=new va,this.presenceMetadata=new wa,this.notifyPresenceDebouncedByChannel=new Map,this.notify=s,this.worker=new SharedWorker(t,`github-socket-worker-v2-${o}`),this.worker.port.onmessage=({data:i})=>this.receive(i),this.worker.port.postMessage({connect:{url:n,refreshUrl:r}})}subscribe(t){const n=this.subscriptions.add(...t);n.length&&this.worker.port.postMessage({subscribe:n});const r=new Set(n.map(s=>s.name)),o=t.reduce((s,i)=>{const a=i.topic.name;return eo(a)&&!r.has(a)&&s.add(a),s},new Set);o.size&&this.worker.port.postMessage({requestPresence:Array.from(o)})}unsubscribeAll(...t){const n=this.subscriptions.drain(...t);n.length&&this.worker.port.postMessage({unsubscribe:n});const r=this.presenceMetadata.removeSubscribers(t);this.sendPresenceMetadataUpdate(r)}updatePresenceMetadata(t){const n=new Set;for(const r of t)this.presenceMetadata.setMetadata(r),n.add(r.channelName);this.sendPresenceMetadataUpdate(n)}sendPresenceMetadataUpdate(t){if(!t.size)return;const n=[];for(const r of t)n.push({channelName:r,metadata:this.presenceMetadata.getChannelMetadata(r)});this.worker.port.postMessage({updatePresenceMetadata:n})}online(){this.worker.port.postMessage({online:!0})}offline(){this.worker.port.postMessage({online:!1})}hangup(){this.worker.port.postMessage({hangup:!0})}receive(t){const{channel:n}=t;if(t.type==="presence"){let r=this.notifyPresenceDebouncedByChannel.get(n);r||(r=ze((o,s)=>{this.notify(o,s),this.notifyPresenceDebouncedByChannel.delete(n)},100),this.notifyPresenceDebouncedByChannel.set(n,r)),r(this.subscriptions.subscribers(n),t);return}this.notify(this.subscriptions.subscribers(n),t)}}Z(Of,"AliveSessionProxy");function Ff(){const e=Af();if(!e)return;const t=Pf();if(!t)return;const n=Mf();if(!n)return;const r=$f();if(!r)return;const s=Z(()=>{if(xf())try{return new Of(e,t,n,r,yi)}catch(l){}return new Lf(t,n,!1,yi)},"createSession")(),i=On(l=>s.subscribe(l.flat())),a=On(l=>s.unsubscribeAll(...l)),c=On(l=>s.updatePresenceMetadata(l));p(".js-socket-channel[data-channel]",{subscribe:l=>{const d=qf(l),m=d.map(g=>g.topic.name).filter(g=>eo(g));let h={unsubscribe(){}};if(m.length){let g,w;const _=Z(()=>{const x=[];g&&x.push(g),w!==void 0&&x.push({[Ea]:w?1:0});for(const E of m)c({subscriber:l,channelName:E,metadata:x})},"queueMetadataOrIdleChange");h=ie(j(l,"socket:set-presence-metadata",x=>{const{detail:E}=x;g=E,_()}),Cf(x=>{!Pn("PRESENCE_IDLE")||(w=x,_())}))}return i(d),h},remove:l=>a(l)}),window.addEventListener("online",()=>s.online()),window.addEventListener("offline",()=>s.offline()),window.addEventListener("unload",()=>{"hangup"in s&&s.hangup()})}Z(Ff,"connect"),(async()=>{await Vt,Ff()})();var Rf=Object.defineProperty,Df=Object.getOwnPropertySymbols,ly=Object.prototype.hasOwnProperty,uy=Object.prototype.propertyIsEnumerable,Hf=(e,t,n)=>t in e?Rf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,dy=(e,t)=>{for(var n in t||(t={}))ly.call(t,n)&&Hf(e,n,t[n]);if(Df)for(var n of Df(t))uy.call(t,n)&&Hf(e,n,t[n]);return e},vi=(e,t)=>Rf(e,"name",{value:t,configurable:!0});const Nf=new Map;function Bf(e,t){const n=[];for(const r of e){const o=Nf.get(r.name);o&&o.arrived>t&&n.push(o)}return n}vi(Bf,"stale");function Uf(e,t){for(const n of e.querySelectorAll(".js-socket-channel[data-channel]"))for(const r of Bf(bi(n),t))n.dispatchEvent(new CustomEvent("socket:message",{bubbles:!1,cancelable:!1,detail:{name:r.name,data:r.data,cached:!0}}))}vi(Uf,"dispatch");function Wf(e){const{name:t,data:n,cached:r}=e.detail;if(r)return;const o={name:t,data:dy({},n),arrived:Date.now()};o.data.wait=0,Nf.set(t,o)}vi(Wf,"store"),document.addEventListener("socket:message",Wf,{capture:!0}),document.addEventListener("pjax:popstate",function(e){const t=e.target,n=e.detail.cachedAt;n&&setTimeout(()=>Uf(t,n))}),p("form.js-auto-replay-enforced-sso-request",{constructor:HTMLFormElement,initialize(e){W(e)}});var fy=Object.defineProperty,my=(e,t)=>fy(e,"name",{value:t,configurable:!0});function wi(e){const t=document.querySelector(".js-stale-session-flash"),n=t.querySelector(".js-stale-session-flash-signed-in"),r=t.querySelector(".js-stale-session-flash-signed-out");t.hidden=!1,n.hidden=e==="false",r.hidden=e==="true",window.addEventListener("popstate",function(o){o.state&&o.state.container!=null&&location.reload()}),document.addEventListener("submit",function(o){o.preventDefault()})}my(wi,"sessionChanged");let gn;if(typeof BroadcastChannel=="function")try{gn=new BroadcastChannel("stale-session"),gn.onmessage=e=>{typeof e.data=="string"&&wi(e.data)}}catch(e){}if(!gn){let e=!1;gn={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&&t.key==="logged-in")try{(t.newValue==="true"||t.newValue==="false")&&wi(t.newValue)}finally{window.localStorage.removeItem(t.key)}})}const zf=document.querySelector(".js-stale-session-flash[data-signedin]");if(zf){const e=zf.getAttribute("data-signedin")||"";gn.postMessage(e)}var py=Object.defineProperty,_t=(e,t)=>py(e,"name",{value:t,configurable:!0});function Ei(e,t,n){const r=e.getBoundingClientRect().height,o=t.getBoundingClientRect(),s=n.getBoundingClientRect();let i=s.top;i+o.height+10>=r&&(i=Math.max(r-o.height-10,0));let a=s.right;n.closest(".js-build-status-to-the-left")!=null&&(a=Math.max(s.left-o.width-10,0)),t.style.top=`${i}px`,t.style.left=`${a}px`,t.style.right="auto"}_t(Ei,"updateStatusPosition"),f("toggle",".js-build-status .js-dropdown-details",function(e){const t=e.currentTarget,n=t.querySelector(".js-status-dropdown-menu");if(!n)return;function r(){t.hasAttribute("open")||s()}_t(r,"closeOnToggle");function o(i){n.contains(i.target)||s()}_t(o,"closeOnScroll");function s(){t.removeAttribute("open"),n.classList.add("d-none"),t.appendChild(n),t.removeEventListener("toggle",r),window.removeEventListener("scroll",o)}_t(s,"closeStatusPopover"),t.addEventListener("toggle",r),n.classList.contains("js-close-menu-on-scroll")&&window.addEventListener("scroll",o,{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),Ei(document.body,n,t))},{capture:!0});async function ji(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 r=n.querySelector(".js-status-loader");if(!r)return;const o=n.querySelector(".js-status-loading"),s=n.querySelector(".js-status-error"),i=r.getAttribute("data-contents-url");o.classList.remove("d-none"),s.classList.add("d-none");let a;try{await $n(),a=await N(document,i)}catch(c){o.classList.add("d-none"),s.classList.remove("d-none")}a&&(r.replaceWith(a),n.querySelector(".js-details-container").classList.add("open"),t&&n.classList.contains("js-append-menu-to-body")&&Ei(document.body,n,t))}_t(ji,"loadStatus"),f("click",".js-status-retry",({currentTarget:e})=>{ji(e)});function Si(e){const t=e.currentTarget;ji(t)}_t(Si,"onMouseEnter"),p(".js-build-status",{add(e){e.addEventListener("mouseenter",Si,{once:!0})},remove(e){e.removeEventListener("mouseenter",Si)}});var hy=Object.defineProperty,gy=(e,t)=>hy(e,"name",{value:t,configurable:!0});f("click","button[data-sudo-required], summary[data-sudo-required]",Li),p("form[data-sudo-required]",{constructor:HTMLFormElement,subscribe:e=>j(e,"submit",Li)});async function Li(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;e.stopPropagation(),e.preventDefault(),await tc()&&(t.removeAttribute("data-sudo-required"),t instanceof HTMLFormElement?W(t):t.click())}gy(Li,"checkSudo");var by=Object.defineProperty,He=(e,t)=>by(e,"name",{value:t,configurable:!0});const Vf={"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"};p("text-expander[data-audit-url]",{subscribe:e=>ie(j(e,"text-expander-change",Xf),j(e,"text-expander-value",Kf))});function Kf(e){const t=e.detail;if(!_i(t.key))return;const n=t.item.getAttribute("data-value");t.value=`${t.key}${n}`}He(Kf,"onvalue");function Xf(e){const{key:t,provide:n,text:r}=e.detail;if(!_i(t))return;const s=e.target.getAttribute("data-audit-url");n(Jf(s,t,r))}He(Xf,"onchange");function Gf(e,t){const n=t.toLowerCase();return n?Je(e,He(o=>{const s=o.textContent.toLowerCase().trim(),i=zt(s,n);return i>0?{score:i,text:s}:null},"key"),Qe):e}He(Gf,"search");const yy=pe(e=>[...e.children],{hash:e=>e.className});async function Jf(e,t,n){const o=(await vy(e)).querySelector(Qf(t));if(!o)return{matched:!1};const s=Gf(yy(o),n).slice(0,5),i=o.cloneNode(!1);i.innerHTML="";for(const a of s)i.append(a);return{fragment:i,matched:s.length>0}}He(Jf,"auditMenu");function _i(e){return Object.getOwnPropertyNames(Vf).includes(e)}He(_i,"isActivationKey");function Qf(e){const t=Vf[e];if(!t)throw new Error(`Unknown audit log expander key: ${e}`);return t}He(Qf,"selector");async function Yf(e){const t=await N(document,e),n=document.createElement("div");return n.append(t),n}He(Yf,"fetchMenu");const vy=pe(Yf);var wy=Object.defineProperty,Te=(e,t)=>wy(e,"name",{value:t,configurable:!0});function Zf(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&t.tagName==="G-EMOJI"&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")}Te(Zf,"getValue");function em(e,t){const n=` ${t.toLowerCase().replace(/_/g," ")}`;return Je(e,Te(o=>{const s=o.getAttribute("data-emoji-name"),i=nm(tm(o),n);return i>0?{score:i,text:s}:null},"key"),Qe)}Te(em,"search");function tm(e){return` ${e.getAttribute("data-text").trim().toLowerCase().replace(/_/g," ")}`}Te(tm,"emojiText");function nm(e,t){const n=e.indexOf(t);return n>-1?1e3-n:0}Te(nm,"emojiScore"),p("text-expander[data-emoji-url]",{subscribe:e=>ie(j(e,"text-expander-change",om),j(e,"text-expander-value",rm))});function rm(e){const t=e.detail;t.key===":"&&(t.value=Zf(t.item))}Te(rm,"onvalue");function om(e){const{key:t,provide:n,text:r}=e.detail;if(t!==":")return;const s=e.target.getAttribute("data-emoji-url");n(sm(s,r))}Te(om,"onchange");async function sm(e,t){const[n,r]=await Ey(e),o=em(r,t).slice(0,5);n.innerHTML="";for(const s of o)n.append(s);return{fragment:n,matched:o.length>0}}Te(sm,"emojiMenu");async function im(e){const n=(await N(document,e)).firstElementChild;return[n,[...n.children]]}Te(im,"fetchEmoji");const Ey=pe(im);var jy=Object.defineProperty,Q=(e,t)=>jy(e,"name",{value:t,configurable:!0});function am(e){return`${e.number} ${e.title.trim().toLowerCase()}`}Q(am,"asText");function cm(e,t){if(!t)return e;const n=new RegExp(`\\b${lm(t)}`),r=/^\d+$/.test(t)?s=>um(s,n):s=>zt(s,t);return Je(e,Q(s=>{const i=am(s),a=r(i);return a>0?{score:a,text:i}:null},"key"),Qe)}Q(cm,"search");function lm(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}Q(lm,"escapeRegExp");function um(e,t){const n=e.search(t);return n>-1?1e3-n:0}Q(um,"issueNumberScore");function dm(e,t,n){const r=Q(s=>Ft`
    ${s.map(o)}
`,"itemsTemplate"),o=Q(s=>{const i=s.type in n?fe(document,n[s.type]):"";return Ft`
  • ${i} #${s.number} ${ja(s.title)}
  • `},"itemTemplate");to(r(e),t)}Q(dm,"renderResults"),p("text-expander[data-issue-url]",{subscribe:e=>{const t=[j(e,"text-expander-change",mm),j(e,"text-expander-value",fm),j(e,"keydown",hm),j(e,"click",pm)];return ie(...t)}});function fm(e){const t=e.detail;if(t.key!=="#")return;const n=t.item.getAttribute("data-value");t.value=`#${n}`}Q(fm,"onvalue");function mm(e){const{key:t,provide:n,text:r}=e.detail;if(t!=="#")return;if(r==="#"){Tr(e.target);return}const s=e.target.getAttribute("data-issue-url");n(gm(s,r))}Q(mm,"onchange");function Tr(e){if(!e)return;const t=e.closest("text-expander");t&&t.dismiss()}Q(Tr,"hideSuggestions");function pm(e){Tr(e.target)}Q(pm,"onclick");function hm(e){const t=["ArrowRight","ArrowLeft"],{key:n}=e;t.indexOf(n)<0||Tr(e.target)}Q(hm,"onkeydown");async function gm(e,t){const n=await Sy(e),r=document.createElement("div"),o=cm(n.suggestions,t).slice(0,5);return dm(o,r,n.icons),{fragment:r.firstElementChild,matched:o.length>0}}Q(gm,"issueMenu");const Sy=pe(async function(e){const t=await self.fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!t.ok){const n=new Error,r=t.statusText?` ${t.statusText}`:"";throw n.message=`HTTP ${t.status}${r}`,n}return t.json()});var Ly=Object.defineProperty,ee=(e,t)=>Ly(e,"name",{value:t,configurable:!0});function bm(e){return e.description?`${e.name} ${e.description}`.trim().toLowerCase():`${e.login} ${e.name}`.trim().toLowerCase()}ee(bm,"asText");function ym(e,t){if(!t)return e;const n=wm(t);return Je(e,ee(o=>{const s=bm(o),i=n(s,o.participant);return i>0?{score:i,text:s}:null},"key"),Qe)}ee(ym,"search");function vm(e,t){const n=ee(o=>Ft`
      ${o.map(r)}
    `,"itemsTemplate"),r=ee(o=>{const s=o.type==="user"?o.login:o.name,i=o.type==="user"?o.name:o.description;return Ft`
  • ${s} ${i}
  • `},"itemTemplate");to(n(e),t)}ee(vm,"renderResults");function wm(e){if(!e)return()=>2;const t=e.toLowerCase().split("");return(n,r)=>{if(!n)return 0;const o=Em(n,t);if(!o)return 0;const i=e.length/o[1]/(o[0]/2+1);return r?i+1:i}}ee(wm,"fuzzyScorer");function Em(e,t){let n,r,o,s;const i=jm(e,t[0]);if(i.length===0)return null;if(t.length===1)return[i[0],1,[]];for(s=null,r=0,o=i.length;r-1;)r.push(n++);return r}ee(jm,"allIndexesOf");function Sm(e,t,n){let r=n;const o=[];for(let s=1;sie(j(e,"text-expander-change",_m),j(e,"text-expander-value",Lm))});function Lm(e){const t=e.detail;if(t.key!=="@")return;const n=t.item.getAttribute("data-value");t.value=`@${n}`}ee(Lm,"onvalue");function _m(e){const{key:t,provide:n,text:r}=e.detail;if(t!=="@"||(r==null?void 0:r.split(" ").length)>1)return;const s=e.target.getAttribute("data-mention-url");n(km(s,r))}ee(_m,"onchange");async function km(e,t){const n=await _y(e),r=document.createElement("div"),o=ym(n,t).slice(0,5);return vm(o,r),{fragment:r.firstElementChild,matched:o.length>0}}ee(km,"mentionMenu");const _y=pe(async function(e){const t=await self.fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!t.ok){const n=new Error,r=t.statusText?` ${t.statusText}`:"";throw n.message=`HTTP ${t.status}${r}`,n}return t.json()});var ky=Object.defineProperty,q=(e,t)=>ky(e,"name",{value:t,configurable:!0});const ki="/";function Tm(e,t){const n=t.toLowerCase().trim(),r=q(o=>{const s=(o.getAttribute("data-text")||"").trim().toLowerCase(),i=zt(s,n);return i>0?{score:i,text:s}:null},"key");return n?Je(e,r,Qe):e}q(Tm,"search"),p("slash-command-expander[data-slash-command-url]",{subscribe:e=>ie(j(e,"text-expander-change",Im),j(e,"text-expander-value",Cm))}),f("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 r=ki,o=n.selectionEnd||0,s=n.value.substring(0,o),i=n.value.substring(o),a=n.value===""||s.match(/\s$/)?"":" ",c=o+r.length+1;n.value=s+a+r+i,n.selectionStart=c,n.selectionEnd=c,n.focus(),v(n,"input")});async function Cm(e){const t=e.detail,{key:n,item:r}=t;if(n!==ki)return;const o=r.getAttribute("data-url");if(!o)return;const s=e.currentTarget,i=r.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);s.isLoading();try{const l=await N(document,o,{method:"PATCH",body:c,headers:{Accept:"text/html","Scoped-CSRF-Token":a.value}});if(!l)return;Ti(s,l)}catch(l){s.showError()}}q(Cm,"onValue");function Ti(e,t){var n;const r=t.firstElementChild;if(!r)return;t.children.length>1&&qm(t.lastElementChild,e),r.hasAttribute("data-reload-suggestions")&&(Fm=pe(xi));const o=r.getAttribute("data-component-type");o==="fill"?/<\/?[a-z][\s\S]*>/i.test(r.innerHTML)?e.setValue(r.innerHTML.trim()):e.setValue(((n=r.textContent)==null?void 0:n.trim())||""):o==="menu"||o==="error"?e.setMenu(r.querySelector(".js-slash-command-menu")):o==="action"?e.closeMenu():o==="embedded_form"?$m(e,r):o==="dialog_form"?Pm(e,r):o==="modal_form"&&Mm(e,r),It(ke())}q(Ti,"handleResponse");function xm(e){if(!(e.metaKey&&e.key==="Enter"))return;e.preventDefault(),e.stopPropagation();const t=e.target,n=t==null?void 0:t.form;if(!!n)if(n.requestSubmit)n.requestSubmit();else{const r=n.querySelector("[type='submit']");r==null||r.click()}}q(xm,"submitOnCommandEnter");function Ci(e){const t=new FormData(e);let n="";for(const r of t)n=n+r[0],n=n+r[1].toString();return n}q(Ci,"getFormContents");function Cr(e){let t=!1;for(const n of e.querySelectorAll("select,input,textarea")){const r=n;r.type!=="hidden"&&(t||(r.focus(),t=!0),r.addEventListener("keydown",xm))}}q(Cr,"focusFirstFormInput");function xr(e,t){const n=e.querySelectorAll("[data-close-dialog]");for(const r of n)r.addEventListener("click",o=>{o.preventDefault(),Ot(ke(),{selector:".js-session-resumable"}),t()})}q(xr,"hookUpCancelActionListeners");function Ar(e,t,n,r){const o=Ci(e);t.addEventListener("keydown",s=>{if(s.key==="Escape"){const i="Are you sure you want to dismiss the form?",a=Ci(e);(o===a||confirm(i))&&(Ot(ke(),{selector:".js-session-resumable"}),r(),n&&n.focus())}})}q(Ar,"addDismissAlertListener");function Pr(e,t,n){e.addEventListener("submit",async r=>{r.preventDefault();const o=r.target,s=o.querySelector(".js-data-url-csrf");if(!s)return;const i=o.getAttribute("action");if(!i)return;Am(t);const a=new FormData(o),c=await N(document,i,{method:"PATCH",body:a,headers:{Accept:"text/html","Scoped-CSRF-Token":s.value}});n(),!!c&&Ti(t,c)})}q(Pr,"addSubmitButtonListener");function Am(e){const t=e.closest(".js-slash-command-surface"),n=e.closest("form"),r=t||n;if(r)for(const o of r.querySelectorAll("[data-disable-with][disabled]"))o.disabled=!1}q(Am,"reenableParentFormButtons");function Pm(e,t){const n=t.querySelector(".js-slash-command-menu");e.setMenu(n,!0);const r=n.querySelector("form"),o=document.activeElement;Cr(r);const s=q(()=>{e.closeMenu()},"closeForm");Ar(r,r,o,s),xr(r,s),Pr(r,e,s)}q(Pm,"handleDialogForm");function Mm(e,t){const n=e.closest("form");if(!n)return;const r=t.querySelector('[data-component="form"]');n.insertAdjacentElement("afterend",r);const o=document.activeElement;Cr(r);const s=q(()=>{n.hidden=!1,r.remove()},"closeForm");xr(r,s);const i=r.getElementsByTagName("form")[0];Ar(i,r,o,s),Pr(r,e,s)}q(Mm,"handleModalForm");function $m(e,t){const n=e.closest(".js-slash-command-surface"),r=e.closest("form"),o=n||r;if(!o)return;o.hidden=!0;const s=t.querySelector('[data-component="form"]');o.insertAdjacentElement("afterend",s);const i=document.activeElement;Cr(s);const a=q(()=>{o.hidden=!1,s.remove()},"closeForm");xr(s,a);const c=s.getElementsByTagName("form")[0];Ar(c,s,i,a),Pr(s,e,a)}q($m,"handleEmbeddedForm");const Ty=5e3;function qm(e,t){var n,r;const o=(n=t.parentElement)==null?void 0:n.parentElement;if(!o)return;const s=o.querySelector(".drag-and-drop .default");let i=!1;s&&(i=s.hidden,s.hidden=!0),(r=s==null?void 0:s.parentElement)==null||r.prepend(e),setTimeout(()=>{s&&(s.hidden=i),e.remove()},Ty)}q(qm,"showFooter");function Im(e){const{key:t,provide:n,text:r}=e.detail;if(t!==ki)return;const o=e.target;o.isLoading();const s=o.getAttribute("data-slash-command-url");n(Om(s,r,o))}q(Im,"onChange");async function Om(e,t,n){try{const[r,o]=await Fm(e),s=r.querySelector(".js-slash-command-menu-items"),i=Tm(o,t);if(s){s.innerHTML="";for(const a of o)if(a.classList.contains("js-group-divider")){const c=a.getAttribute("data-group-id");i.filter(d=>d.getAttribute("data-group-id")===c).length>0&&s.append(a)}else i.includes(a)&&s.append(a)}return{fragment:r,matched:i.length>0}}catch(r){throw n.showError(),new Error(r)}}q(Om,"slashCommandMenu");async function xi(e){const n=(await N(document,e)).firstElementChild,r=n.querySelectorAll(".js-slash-command-menu-items li");return[n,[...r]]}q(xi,"fetchSlashCommands");let Fm=pe(xi);var Cy=Object.defineProperty,xy=(e,t)=>Cy(e,"name",{value:t,configurable:!0});function Rm(e,t){const n=e.closest(".js-survey-question-form"),r=n.querySelector("input.js-survey-other-text"),o=t&&!n.classList.contains("is-other-selected");n.classList.toggle("is-other-selected",o),r.hidden=!t,o?(r.required=!0,r.focus()):r.required=!1,v(r,"change")}xy(Rm,"handleOther"),f("change","input.js-survey-radio",function({currentTarget:e}){Rm(e,e.classList.contains("js-survey-radio-other"))}),f("change","input.js-survey-checkbox-enable-submit",function({currentTarget:e}){var t;const n=e.checked,r=(t=e.closest("form"))==null?void 0:t.querySelector("button[type=submit]");r.disabled=!n}),f("change","input.js-survey-contact-checkbox",function(e){const t=e.currentTarget,r=t.closest(".js-survey-question-form").querySelector(".js-survey-contact-checkbox-hidden");t.checked?r.setAttribute("disabled","true"):r.removeAttribute("disabled")}),f("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}),f("click",'tab-container [role="tab"]',function(e){const{currentTarget:t}=e,r=t.closest("tab-container").querySelector(".js-filterable-field, [data-filter-placeholder-input]");if(r instanceof HTMLInputElement){const o=t.getAttribute("data-filter-placeholder");o&&r.setAttribute("placeholder",o),r.focus()}}),f("tab-container-changed","tab-container",function(e){const t=e.detail.relatedTarget,n=t.getAttribute("data-fragment-url"),r=t.querySelector("include-fragment");n&&r&&!r.hasAttribute("src")&&(r.src=n)}),document.addEventListener("keydown",e=>{if(e.key!=="Escape"||e.target!==document.body)return;const t=document.querySelector(".js-targetable-element:target");!t||mo(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)||mo(t,()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)}))});var Ay=Object.defineProperty,Mr=(e,t)=>Ay(e,"name",{value:t,configurable:!0});async function Dm(e){const t=e.currentTarget;if(Nm(t)){t.classList.remove("tooltipped");return}const n=t.getAttribute("data-url");if(!n)return;const r=await fetch(n,{headers:{Accept:"application/json"}});if(!r.ok)return;const o=await r.json(),s=t.getAttribute("data-id"),i=document.querySelectorAll(`.js-team-mention[data-id='${s}']`);for(const a of i)a.removeAttribute("data-url");try{o.total===0?o.members.push("This team has no members"):o.total>o.members.length&&o.members.push(`${o.total-o.members.length} more`),Ai(i,Hm(o.members))}catch(a){const c=a.response?a.response.status:500,l=t.getAttribute(c===404?"data-permission-text":"data-error-text");Ai(i,l)}}Mr(Dm,"members");function Ai(e,t){for(const n of e)n instanceof HTMLElement&&(n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline"))}Mr(Ai,"tip");function Hm(e){if("ListFormat"in Intl)return new Intl.ListFormat().format(e);if(e.length===0)return"";if(e.length===1)return e[0];if(e.length===2)return e.join(" and ");{const t=e[e.length-1];return e.slice(0,-1).concat(`and ${t}`).join(", ")}}Mr(Hm,"sentence");function Nm(e){return!!e.getAttribute("data-hovercard-url")&&!!e.closest("[data-team-hovercards-enabled]")}Mr(Nm,"teamHovercardEnabled"),p(".js-team-mention",function(e){e.addEventListener("mouseenter",Dm)});var Bm=Object.defineProperty,Py=Object.getOwnPropertyDescriptor,My=(e,t)=>Bm(e,"name",{value:t,configurable:!0}),$r=(e,t,n,r)=>{for(var o=r>1?void 0:r?Py(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Bm(t,n,o),o};let kt=class extends HTMLElement{acceptSuggestion(){var e;((e=this.suggestion)==null?void 0:e.textContent)&&(this.input.value=this.suggestion.textContent,this.input.dispatchEvent(new Event("input")),this.suggestionContainer&&(this.suggestionContainer.hidden=!0),this.input.focus())}};My(kt,"TextSuggesterElement"),$r([y],kt.prototype,"input",2),$r([y],kt.prototype,"suggestionContainer",2),$r([y],kt.prototype,"suggestion",2),kt=$r([I],kt);var $y=Object.defineProperty,qr=(e,t)=>$y(e,"name",{value:t,configurable:!0});function Um(){const e=document.querySelector(".js-timeline-marker");return e!=null?e.getAttribute("data-last-modified"):null}qr(Um,"getTimelineLastModified");function Pi(e){if(zm(e)||Wm(e))return;const t=Um();t&&e.headers.set("X-Timeline-Last-Modified",t)}qr(Pi,"addTimelineLastModifiedHeader");function Wm(e){return e.headers.get("X-PJAX")==="true"}qr(Wm,"isPjax");function zm(e){let t;try{t=new URL(e.url)}catch(n){return!0}return t.host!==window.location.host}qr(zm,"isCrossDomain"),P(".js-needs-timeline-marker-header",function(e,t,n){Pi(n)}),f("deprecatedAjaxSend","[data-remote]",function(e){const{request:t}=e.detail;Pi(t)});var qy=Object.defineProperty,Ce=(e,t)=>qy(e,"name",{value:t,configurable:!0});const Vm=5e3,Iy=".js-comment-body img",Oy=".js-comment-body video";Bt(function({target:e}){const t=Or();if(t&&!e){const n=document.querySelector("#js-timeline-progressive-loader");n&&Mi(t,n)}}),p(".js-timeline-progressive-focus-container",function(e){const t=Or();if(!t)return;const n=document.getElementById(t);n&&e.contains(n)&&Ir(n)}),p("#js-discussions-timeline-anchor-loader",{constructor:HTMLElement,add:e=>{if(document.querySelector("#js-timeline-progressive-loader"))return;const n=Or();if(!n)return;document.getElementById(n)||Mi(n,e)}});async function Km(){const e=document.querySelectorAll(Oy),t=Array.from(e).map(n=>new Promise(r=>{if(n.readyState>=n.HAVE_METADATA)r(n);else{const o=setTimeout(()=>r(n),Vm),s=Ce(()=>{clearTimeout(o),r(n)},"done");n.addEventListener("loadeddata",()=>{n.readyState>=n.HAVE_METADATA&&s()}),n.addEventListener("error",()=>s())}}));return Promise.all(t)}Ce(Km,"videosReady");async function Xm(){const e=document.querySelectorAll(Iy),t=Array.from(e).map(n=>{new Promise(r=>{if(n.complete)r(n);else{const o=setTimeout(()=>r(n),Vm),s=Ce(()=>{clearTimeout(o),r(n)},"done");n.addEventListener("load",()=>s()),n.addEventListener("error",()=>s())}})});return Promise.all(t)}Ce(Xm,"imagesReady");async function Gm(){return Promise.all([Km(),Xm()])}Ce(Gm,"mediaLoaded");async function Ir(e){await Gm(),Jm(e);const t=e.querySelector(`[href='#${e.id}']`);t&&t.click()}Ce(Ir,"focusElement");async function Mi(e,t){if(!t)return;const n=t.getAttribute("data-timeline-item-src");if(!n)return;const r=new URL(n,window.location.origin),o=new URLSearchParams(r.search.slice(1));o.append("anchor",e),r.search=o.toString();let s;try{s=await N(document,r.toString())}catch(l){return}const i=s.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 l=document.getElementById(e);l&&await Ir(l)}else{const l=document.getElementById("js-progressive-timeline-item-container");l&&l.replaceWith(s);const d=document.getElementById(e);d&&await Ir(d)}}Ce(Mi,"loadElement");function Jm(e){const t=e.closest("details, .js-details-container");!t||(t.nodeName==="DETAILS"?t.setAttribute("open","open"):nc(t)||po(t))}Ce(Jm,"expandDetailsIfPresent");function Or(){return window.location.hash.slice(1)}Ce(Or,"urlAnchor");var Fy=Object.defineProperty,Qm=(e,t)=>Fy(e,"name",{value:t,configurable:!0});p(".js-discussion",Ym);function Ym(){let e=new WeakSet;t(),document.addEventListener("pjax:end",t),p(".js-timeline-item",n=>{n instanceof HTMLElement&&(e.has(n)||Ke(n))});function t(){e=new WeakSet(document.querySelectorAll(".js-timeline-item"))}Qm(t,"setExistingTimelineItems")}Qm(Ym,"announceTimelineEvents");var Ry=Object.defineProperty,$i=(e,t)=>Ry(e,"name",{value:t,configurable:!0});function Tt(e){const{name:t,value:n}=e,r={name:window.location.href};switch(t){case"CLS":r.cls=n;break;case"FCP":r.fcp=n;break;case"FID":r.fid=n;break;case"LCP":r.lcp=n;break;case"TTFB":r.ttfb=n;break}ye({webVitalTimings:[r]})}$i(Tt,"sendVitals");function Zm(){return!!(window.performance&&window.performance.timing&&window.performance.getEntriesByType)}$i(Zm,"isTimingSuppported");async function ep(){if(!Zm())return;await Ut,await new Promise(n=>setTimeout(n));const e=window.performance.getEntriesByType("resource");e.length&&ye({resourceTimings:e});const t=window.performance.getEntriesByType("navigation");t.length&&ye({navigationTimings:t})}$i(ep,"sendTimingResults"),ep(),Sa(Tt),La(Tt),_a(Tt),ka(Tt),Ta(Tt),f("click",".js-toggler-container .js-toggler-target",function(e){if(e.button!==0)return;const t=e.currentTarget.closest(".js-toggler-container");t&&t.classList.toggle("on")}),P(".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")}});const Dy={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]};function Hy(e,t,n={}){const r=Ny(e),o=By(r),s=getComputedStyle(r),i=r.getBoundingClientRect(),[a,c]=[s.borderTopWidth,s.borderLeftWidth].map(d=>parseInt(d,10)||0),l={top:i.top+a,left:i.left+c};return Wy(o,l,e.getBoundingClientRect(),t instanceof Element?t.getBoundingClientRect():t,Uy(n))}function Ny(e){let t=e.parentNode;for(;t!==null;){if(t instanceof HTMLElement&&getComputedStyle(t).position!=="static")return t;t=t.parentNode}return document.body}function By(e){let t=e;for(;t!==null&&!(t===document.body||getComputedStyle(t).overflow!=="visible");)t=t.parentNode;const n=t===document.body||!(t instanceof HTMLElement)?document.body:t,r=n.getBoundingClientRect(),o=getComputedStyle(n),[s,i,a,c]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map(l=>parseInt(l,10)||0);return{top:r.top+s,left:r.left+i,width:r.width-a-i,height:Math.max(r.height-s-c,n===document.body?window.innerHeight:-1/0)}}const bn={side:"outside-bottom",align:"start",anchorOffset:4,alignmentOffset:4,allowOutOfBounds:!1};function Uy(e={}){var t,n,r,o,s;const i=(t=e.side)!==null&&t!==void 0?t:bn.side,a=(n=e.align)!==null&&n!==void 0?n:bn.align;return{side:i,align:a,anchorOffset:(r=e.anchorOffset)!==null&&r!==void 0?r:i==="inside-center"?0:bn.anchorOffset,alignmentOffset:(o=e.alignmentOffset)!==null&&o!==void 0?o:a!=="center"&&i.startsWith("inside")?bn.alignmentOffset:0,allowOutOfBounds:(s=e.allowOutOfBounds)!==null&&s!==void 0?s:bn.allowOutOfBounds}}function Wy(e,t,n,r,{side:o,align:s,allowOutOfBounds:i,anchorOffset:a,alignmentOffset:c}){const l={top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height};let d=tp(n,r,o,s,a,c),m=o;if(d.top-=t.top,d.left-=t.left,!i){const h=Dy[o];let g=0;if(h){let w=o;for(;ge.width+l.left&&(d.left=e.width+l.left-n.width),h&&ge.height+l.top&&(d.top=e.height+l.top-n.height)}return Object.assign(Object.assign({},d),{anchorSide:m})}function tp(e,t,n,r,o,s){const i=t.left+t.width,a=t.top+t.height;let c=-1,l=-1;return n==="outside-top"?c=t.top-o-e.height:n==="outside-bottom"?c=a+o:n==="outside-left"?l=t.left-o-e.width:n==="outside-right"&&(l=i+o),(n==="outside-top"||n==="outside-bottom")&&(r==="start"?l=t.left+s:r==="center"?l=t.left-(e.width-t.width)/2+s:l=i-e.width-s),(n==="outside-left"||n==="outside-right")&&(r==="start"?c=t.top+s:r==="center"?c=t.top-(e.height-t.height)/2+s:c=a-e.height-s),n==="inside-top"?c=t.top+o:n==="inside-bottom"?c=a-o-e.height:n==="inside-left"?l=t.left+o:n==="inside-right"?l=i-o-e.width:n==="inside-center"&&(l=(i+t.left)/2-e.width/2+o),n==="inside-top"||n==="inside-bottom"?r==="start"?l=t.left+s:r==="center"?l=t.left-(e.width-t.width)/2+s:l=i-e.width-s:(n==="inside-left"||n==="inside-right"||n==="inside-center")&&(r==="start"?c=t.top+s:r==="center"?c=t.top-(e.height-t.height)/2+s:c=a-e.height-s),{top:c,left:l}}function zy(e,t,n,r){return e==="outside-top"||e==="outside-bottom"?t.topn.height+n.top:t.leftn.width+n.left}var Vy=Object.defineProperty,Ky=(e,t)=>Vy(e,"name",{value:t,configurable:!0}),np=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ct=(e,t,n)=>(np(e,t,"read from private field"),n?n.call(e):t.get(e)),yn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},S=(e,t,n,r)=>(np(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),vn,B,Y,le,Fr;const rp="hx_tooltip-open",op="hx_tooltip",re=6,sp=["hx_tooltip-n","hx_tooltip-s","hx_tooltip-e","hx_tooltip-w","hx_tooltip-ne","hx_tooltip-se","hx_tooltip-nw","hx_tooltip-sw"],Xy={n:"hx_tooltip-n",s:"hx_tooltip-s",e:"hx_tooltip-e",w:"hx_tooltip-w",ne:"hx_tooltip-ne",se:"hx_tooltip-se",nw:"hx_tooltip-nw",sw:"hx_tooltip-sw"};class Rr extends HTMLElement{constructor(){super(...arguments);yn(this,vn,void 0),yn(this,B,"s"),yn(this,Y,"center"),yn(this,le,"outside-bottom"),yn(this,Fr,!1)}get htmlFor(){return this.getAttribute("for")||""}set htmlFor(t){this.setAttribute("for",t)}get control(){return this.ownerDocument.getElementById(this.htmlFor)}get type(){return this.getAttribute("data-type")==="label"?"label":"description"}set type(t){this.setAttribute("data-type",t)}get direction(){return Ct(this,B)}set direction(t){this.setAttribute("data-direction",t)}get align(){return Ct(this,Y)}get side(){return Ct(this,le)}connectedCallback(){this.hidden=!0,S(this,Fr,!0),this.id||(this.id=`tooltip-${Date.now()}-${(Math.random()*1e4).toFixed(0)}`),!!this.control&&(this.classList.add(op),this.setAttribute("role","tooltip"),this.addEvents())}attributeChangedCallback(t,n,r){if(t==="id"||t==="data-type"){if(!this.id||!this.control)return;if(this.type==="label")this.control.setAttribute("aria-labelledby",this.id);else{let o=this.control.getAttribute("aria-describedby");o?o=`${o} ${this.id}`:o=this.id,this.control.setAttribute("aria-describedby",o)}}else if(t==="hidden")if(r==="")this.classList.remove(rp,...sp);else{this.classList.add(rp,op);for(const s of this.ownerDocument.querySelectorAll(this.tagName))s!==this&&(s.hidden=!0);this.updatePosition()}else if(t==="data-direction"){this.classList.remove(...sp);const o=S(this,B,r||"s");o==="n"?(S(this,Y,"center"),S(this,le,"outside-top")):o==="ne"?(S(this,Y,"start"),S(this,le,"outside-top")):o==="e"?(S(this,Y,"center"),S(this,le,"outside-right")):o==="se"?(S(this,Y,"start"),S(this,le,"outside-bottom")):o==="s"?(S(this,Y,"center"),S(this,le,"outside-bottom")):o==="sw"?(S(this,Y,"end"),S(this,le,"outside-bottom")):o==="w"?(S(this,Y,"center"),S(this,le,"outside-left")):o==="nw"&&(S(this,Y,"end"),S(this,le,"outside-top")),this.updatePosition()}}disconnectedCallback(){Ct(this,vn).abort()}addEvents(){if(!this.control)return;S(this,vn,new AbortController);const{signal:t}=Ct(this,vn);this.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("mouseenter",this,{signal:t}),this.control.addEventListener("mouseleave",this,{signal:t}),this.control.addEventListener("focus",this,{signal:t}),this.control.addEventListener("blur",this,{signal:t}),this.ownerDocument.addEventListener("keydown",this,{signal:t})}handleEvent(t){!this.control||((t.type==="mouseenter"||t.type==="focus")&&this.hidden?this.hidden=!1:t.type==="blur"?this.hidden=!0:t.type==="mouseleave"&&t.relatedTarget!==this.control&&t.relatedTarget!==this?this.hidden=!0:t.type==="keydown"&&t.key==="Escape"&&!this.hidden&&(this.hidden=!0))}updatePosition(){if(!this.control||!Ct(this,Fr)||this.hidden)return;const t=Hy(this,this.control,this),{anchorSide:n}=t;let{top:r,left:o}=t;this.style.top=`${r}px`,this.style.left=`${o}px`;const s=this.getBoundingClientRect(),i=this.control.getBoundingClientRect(),a=s.width,c=s.left+a/2,l=i.x+i.width/2,d=Math.abs(c-l),m=Math.abs(s.left-i.x),h=Math.abs(s.left+a-i.right),g=Math.min(d,m,h);g===d?(S(this,Y,"center"),n==="outside-top"?(S(this,B,"n"),r-=re):n==="outside-bottom"?(S(this,B,"s"),r+=re):n==="outside-left"?(S(this,B,"w"),o-=re):(S(this,B,"e"),o+=re)):g===h?(S(this,Y,"end"),n==="outside-top"?(S(this,B,"nw"),r-=re):n==="outside-bottom"?(S(this,B,"sw"),r+=re):n==="outside-left"?(S(this,B,"w"),o-=re):(S(this,B,"e"),o+=re)):(S(this,Y,"start"),n==="outside-top"?(S(this,B,"ne"),r-=re):n==="outside-bottom"?(S(this,B,"se"),r+=re):n==="outside-left"?(S(this,B,"w"),o-=re):(S(this,B,"e"),o+=re)),this.style.top=`${r}px`,this.style.left=`${o}px`,this.classList.add(Xy[this.direction])}}Ky(Rr,"PrimerTooltipElement"),vn=new WeakMap,B=new WeakMap,Y=new WeakMap,le=new WeakMap,Fr=new WeakMap,Rr.observedAttributes=["data-type","data-direction","id","hidden"],window.customElements.get("primer-tooltip")||(window.PrimerTooltipElement=Rr,window.customElements.define("primer-tooltip",Rr)),window.requestIdleCallback(()=>{const e=rc();e&&mc("tz",encodeURIComponent(e))});var ip=Object.defineProperty,Gy=Object.getOwnPropertyDescriptor,qi=(e,t)=>ip(e,"name",{value:t,configurable:!0}),U=(e,t,n,r)=>{for(var o=r>1?void 0:r?Gy(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&ip(t,n,o),o},K;(function(e){e.Initializing="initializing",e.Unsupported="unsupported",e.Ready="ready",e.Waiting="waiting",e.Error="error",e.Submitting="submitting"})(K||(K={}));let be=class extends HTMLElement{constructor(){super(...arguments);this.state=K.Initializing,this.json="",this.autofocusWhenReady=!1,this.hasErrored=!1}connectedCallback(){this.originalButtonText=this.button.textContent,this.setState(oc()?K.Ready:K.Unsupported)}setState(e){this.button.textContent=this.hasErrored?this.button.getAttribute("data-retry-message"):this.originalButtonText,this.button.disabled=!1,this.button.hidden=!1;for(const t of this.messages)t.hidden=!0;switch(e){case K.Initializing:this.button.disabled=!0;break;case K.Unsupported:this.button.disabled=!0,this.unsupportedMessage.hidden=!1;break;case K.Ready:this.autofocusWhenReady&&this.button.focus();break;case K.Waiting:this.waitingMessage.hidden=!1,this.button.hidden=!0;break;case K.Error:this.errorMessage.hidden=!1;break;case K.Submitting:this.button.textContent="Verifying\u2026",this.button.disabled=!0;break;default:throw new Error("invalid state")}this.state=e}async prompt(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("webauthn-get-prompt"));try{this.setState(K.Waiting);const t=JSON.parse(this.json),n=await sc(t);this.setState(K.Submitting);const r=this.closest(".js-webauthn-form"),o=r.querySelector(".js-webauthn-response");o.value=JSON.stringify(n),W(r)}catch(t){throw this.hasErrored=!0,this.setState(K.Error),t}}};qi(be,"WebauthnGetElement"),U([y],be.prototype,"button",2),U([oe],be.prototype,"messages",2),U([y],be.prototype,"unsupportedMessage",2),U([y],be.prototype,"waitingMessage",2),U([y],be.prototype,"errorMessage",2),U([se],be.prototype,"json",2),U([se],be.prototype,"autofocusWhenReady",2),be=U([I],be);var Ne;(function(e){e.Initializing="initializing",e.ShowingForm="showing-form",e.ShowingRevealer="showing-revealer"})(Ne||(Ne={}));let ct=class extends HTMLElement{constructor(){super(...arguments);this.state=Ne.ShowingForm}connectedCallback(){this.setState(this.state)}setState(e){switch(this.revealer.hidden=!0,this.form.hidden=!1,e){case Ne.Initializing:break;case Ne.ShowingForm:this.passwordField.focus(),this.dispatchEvent(new CustomEvent("sudo-password-showing-form"));break;case Ne.ShowingRevealer:this.revealer.hidden=!1,this.form.hidden=!0;break;default:throw new Error("invalid state")}this.state=e}reveal(){this.setState(Ne.ShowingForm)}};qi(ct,"SudoPasswordElement"),U([se],ct.prototype,"state",2),U([y],ct.prototype,"revealer",2),U([y],ct.prototype,"form",2),U([y],ct.prototype,"passwordField",2),ct=U([I],ct);let wn=class extends HTMLElement{connectedCallback(){var e;(e=this.webauthnGet)==null||e.addEventListener("webauthn-get-prompt",()=>{this.sudoPassword.setState(Ne.ShowingRevealer)}),this.sudoPassword.addEventListener("sudo-password-showing-form",()=>{var t;(t=this.webauthnGet)==null||t.setState(K.Ready)})}};qi(wn,"SudoAuthElement"),U([y],wn.prototype,"webauthnGet",2),U([y],wn.prototype,"sudoPassword",2),wn=U([I],wn);var Jy=Object.defineProperty,ap=(e,t)=>Jy(e,"name",{value:t,configurable:!0});let Ii=0;function cp(){if(!document.hasFocus())return;const e=document.querySelector(".js-timeline-marker-form");e&&e instanceof HTMLFormElement&&W(e)}ap(cp,"markThreadAsRead");const Dr="IntersectionObserver"in window?new IntersectionObserver(function(e){for(const t of e)t.isIntersecting&&Oi(t.target)},{root:null,rootMargin:"0px",threshold:1}):null;p(".js-unread-item",{constructor:HTMLElement,add(e){Ii++,Dr&&Dr.observe(e)},remove(e){Ii--,Dr&&Dr.unobserve(e),Ii===0&&cp()}});function Oi(e){e.classList.remove("js-unread-item","unread-item")}ap(Oi,"clearUnread"),p(".js-discussion[data-channel-target]",{subscribe:e=>j(e,"socket:message",function(t){const n=t.target,r=t.detail.data;if(n.getAttribute("data-channel-target")===r.gid)for(const o of document.querySelectorAll(".js-unread-item"))Oi(o)})});var Qy=Object.defineProperty,Yy=(e,t)=>Qy(e,"name",{value:t,configurable:!0});let Hr=0;const lp=/^\(\d+\)\s+/;function Fi(){const e=Hr?`(${Hr}) `:"";document.title.match(lp)?document.title=document.title.replace(lp,e):document.title=`${e}${document.title}`}Yy(Fi,"updateTitle"),p(".js-unread-item",{add(){Hr++,Fi()},remove(){Hr--,Fi()}});var Zy=Object.defineProperty,ev=(e,t)=>Zy(e,"name",{value:t,configurable:!0});p(".js-socket-channel.js-updatable-content",{subscribe:e=>j(e,"socket:message",function(t){const{gid:n,wait:r}=t.detail.data,o=t.target,s=n?up(o,n):o;s&&setTimeout(In,r||0,s)})});function up(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}ev(up,"findByGid");var tv=Object.defineProperty,nv=(e,t)=>tv(e,"name",{value:t,configurable:!0});async function dp(){if(!(!history.state||!history.state.staleRecords)){await Vt;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&&An(t,n,!0)}Xe(null,"",location.href)}}nv(dp,"reapplyPreviouslyUpdatedContent"),window.addEventListener("beforeunload",function(){if(Object.keys(ho).length>0){const e=history.state||{};e.staleRecords=ho,Xe(e,"",location.href)}});try{dp()}catch(e){}f("upload:setup",".js-upload-avatar-image",function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-alambic-organization"),r=e.currentTarget.getAttribute("data-alambic-owner-type"),o=e.currentTarget.getAttribute("data-alambic-owner-id");n&&t.append("organization_id",n),r&&t.append("owner_type",r),o&&t.append("owner_id",o)}),f("upload:complete",".js-upload-avatar-image",function(e){const{attachment:t}=e.detail,n=`/settings/avatars/${t.id}`;ve({content:N(document,n)})});var rv=Object.defineProperty,ov=(e,t)=>rv(e,"name",{value:t,configurable:!0});function En(){if(document.querySelector(":target"))return;const e=ic(location.hash).toLowerCase(),t=ac(document,`user-content-${e}`);t&&cc(t)}ov(En,"hashchange"),window.addEventListener("hashchange",En),document.addEventListener("pjax:success",En),async function(){await Vt,En()}(),f("click","a[href]",function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&t.href===location.href&&location.hash.length>1&&setTimeout(function(){e.defaultPrevented||En()})});var sv=Object.defineProperty,iv=(e,t)=>sv(e,"name",{value:t,configurable:!0});async function fp(e){const t=e.currentTarget,{init:n}=await L.import("./chunk-user-status-submit.js");n(t)}iv(fp,"load"),p(".js-user-status-container",{subscribe:e=>j(e,"click",fp,{once:!0})});var av=Object.defineProperty,xe=(e,t)=>av(e,"name",{value:t,configurable:!0});function mp(e,t){const n=e.querySelector(".js-user-list-base");n&&(n.textContent=t||n.getAttribute("data-generic-message"),n.hidden=!1)}xe(mp,"setFlashError");function Ri(e,t){const r=(t||e).querySelectorAll(".js-user-list-error");for(const i of r)i.hidden=!0;const o=t?[t]:e.querySelectorAll(".errored.js-user-list-input-container");for(const i of o)i.classList.remove("errored");const s=e.querySelector(".js-user-list-base");s&&(s.hidden=!0)}xe(Ri,"resetValidation"),P(".js-user-list-form",async function(e,t){var n;Ri(e);const r=e.querySelector("[data-submitting-message]"),o=r==null?void 0:r.textContent;r&&(r.textContent=r.getAttribute("data-submitting-message"),r.disabled=!0);for(const s of e.querySelectorAll(".js-user-list-input"))s.disabled=!0;try{const s=await t.html();v(e,"user-list-form:success",s.html)}catch(s){if(((n=s.response)==null?void 0:n.status)===422)e.replaceWith(s.response.html);else{mp(e),r&&(o&&(r.textContent=o),r.disabled=!1);for(const i of e.querySelectorAll(".js-user-list-input"))i.disabled=!1}}}),f("user-list-form:success",".js-follow-list",e=>{const t=e.detail,n=t instanceof DocumentFragment?t.querySelector(".js-target-url"):null;(n==null?void 0:n.textContent)?location.href=n.textContent:location.reload()});function Di(e){if(!(e.currentTarget instanceof HTMLElement))return;const t=e.currentTarget.closest(".js-user-list-form"),n=e.currentTarget.closest(".js-user-list-input-container");t&&n&&Ri(t,n)}xe(Di,"clearErrorsFromInput"),me(".js-user-list-form input",Di),me(".js-user-list-form textarea",Di),f("auto-check-error",".js-user-list-form input",function(e){const t=e.currentTarget.closest(".js-user-list-input-container"),n=t==null?void 0:t.querySelector(".js-user-list-error");n&&(n.hidden=!1)});function pp(e){var t;const n=new Map;for(const r of e){const o=(t=r.querySelector(".js-user-lists-create-trigger"))==null?void 0:t.getAttribute("data-repository-id");if(o){const s=n.get(o);s?s.push(r):n.set(o,[r])}}return n}xe(pp,"groupRootsByRepositoryId");async function hp(e,t,n){const r=new FormData;r.set("authenticity_token",t);for(const i of n)r.append("repository_ids[]",i);const o=await fetch(e,{method:"POST",body:r,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}}),s=new Map;if(o.ok){const i=await o.json();for(const a in i)s.set(a,fe(document,i[a]))}return s}xe(hp,"requestMenuBatchRender");function gp(e,t){for(const[n,r]of e.entries()){const o=t.get(n)||[];for(const s of o)s.replaceWith(o.length===1?r:r.cloneNode(!0))}}xe(gp,"replaceUserListMenuRoots");async function Hi(){var e;const t=document.querySelectorAll(".js-user-list-menu-content-root");if(t.length===0)return;const n=t[0].getAttribute("data-batch-update-url");if(!n)return;const r=(e=t[0].querySelector(".js-user-list-batch-update-csrf"))==null?void 0:e.value;if(!r)return;const o=pp(t),s=o.keys(),i=await hp(n,r,s);i.size>0&&gp(i,o)}xe(Hi,"updateAllUserListMenus");function Ni(e){const t=new Promise((n,r)=>{e.addEventListener("user-list-menu-form:success",()=>n()),e.addEventListener("user-list-menu-form:error",o=>r(o))});return W(e),t}xe(Ni,"requestUserListMenuFormSubmit");function bp(e){const t=e.target;if(!(t instanceof HTMLDetailsElement)||t.hasAttribute("open"))return;const n=t.querySelector(".js-user-list-menu-form");n&&Kt(n)&&W(n)}xe(bp,"submitUserListFormOnToggle"),f("toggle",".js-user-list-menu",bp,{capture:!0}),f("click",".js-user-list-menu .js-submit-before-navigate",async e=>{const t=e.target;if(!(t instanceof HTMLElement))return;const n=t.closest(".js-user-list-menu-content-root");if(!n)return;n.removeAttribute("data-update-after-submit");const r=n.querySelector(".js-user-list-menu-form");if(r)try{await Ni(r)}catch(o){Me(),e.preventDefault()}}),P(".js-user-list-menu-form",async function(e,t){let n;try{n=await t.json()}catch(o){Me(),v(e,"user-list-menu-form:error",o);return}if(n.json.didStar){const o=e.closest(".js-toggler-container");o&&o.classList.add("on");const s=n.json.starCount;if(s){const i=e.closest(".js-social-container");i&&gi(i,s)}}const r=e.closest(".js-user-list-menu-content-root[data-update-after-submit]");if(r)for(const o of e.querySelectorAll(".js-user-list-menu-item"))o.checked=o.defaultChecked;n.json.didCreate?await Hi():r&&await In(r),v(e,"user-list-menu-form:success")}),f("click",".js-user-list-delete-confirmation-trigger",e=>{const{currentTarget:t}=e,n=t.getAttribute("data-template-id");if(!n)return;const r=document.getElementById(n);if(!r||!(r instanceof HTMLTemplateElement))return;const o=t.closest(".js-edit-user-list-dialog");o&&(o.open=!1);const s=r.content.cloneNode(!0),i=r.getAttribute("data-labelledby");ve({content:s,labelledBy:i})}),f("click",".js-user-lists-create-trigger",async function(e){const{currentTarget:t}=e,n=document.querySelector(".js-user-list-create-dialog-template"),r=e.currentTarget.getAttribute("data-repository-id"),o=t.closest(".js-user-list-menu-content-root");if(!n||!(n instanceof HTMLTemplateElement)||!r){t instanceof HTMLButtonElement&&(t.disabled=!0);return}const s=n.getAttribute("data-label");if(o&&Kt(o)){const c=o.querySelector(".js-user-list-menu-form");c&&await Ni(c)}const i=new Pe(n,{repositoryId:r}),a=await ve({content:i,label:s});a.addEventListener("user-list-form:success",async()=>{await Hi();const c=a.closest("details");c&&(c.open=!1)})});var yp=Object.defineProperty,cv=Object.getOwnPropertyDescriptor,lv=(e,t)=>yp(e,"name",{value:t,configurable:!0}),Nr=(e,t,n,r)=>{for(var o=r>1?void 0:r?cv(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&yp(t,n,o),o};let xt=class extends HTMLElement{show(){this.input.type="text",this.input.focus(),this.showButton.hidden=!0,this.hideButton.hidden=!1}hide(){this.input.type="password",this.input.focus(),this.hideButton.hidden=!0,this.showButton.hidden=!1}};lv(xt,"VisiblePasswordElement"),Nr([y],xt.prototype,"input",2),Nr([y],xt.prototype,"showButton",2),Nr([y],xt.prototype,"hideButton",2),xt=Nr([I],xt);var uv=Object.defineProperty,jn=(e,t)=>uv(e,"name",{value:t,configurable:!0});p("[data-warn-unsaved-changes]",{add(e){e.addEventListener("input",Sn),e.addEventListener("change",Sn),e.addEventListener("submit",At);const t=e.closest("details-dialog");t&&(t.closest("details").addEventListener("toggle",Bi),t.addEventListener("details-dialog-close",Ui))},remove(e){e.removeEventListener("input",Sn),e.removeEventListener("change",Sn),e.removeEventListener("submit",At);const t=e.closest("details-dialog");t&&(t.closest("details").removeEventListener("toggle",Bi),t.removeEventListener("details-dialog-close",Ui),At())}});function Sn(e){const t=e.currentTarget;Kt(t)?vp(t):At()}jn(Sn,"prepareUnsavedChangesWarning");function vp(e){const t=e.getAttribute("data-warn-unsaved-changes")||"Changes you made may not be saved.";window.onbeforeunload=function(n){return n.returnValue=t,t}}jn(vp,"enableSaveChangesReminder");function At(){window.onbeforeunload=null}jn(At,"disableSaveChangesReminder");function Bi({currentTarget:e}){e.hasAttribute("open")||At()}jn(Bi,"disableSaveChangesReminderOnClosedDialogs");function Ui(e){const t=e.currentTarget;if(!t.closest("details[open]"))return;let r=!0;const o=t.querySelectorAll("form[data-warn-unsaved-changes]");for(const s of o)if(Kt(s)){const i=s.getAttribute("data-warn-unsaved-changes");r=confirm(i);break}r||e.preventDefault()}jn(Ui,"promptOnDialogClosing");var dv=Object.defineProperty,fv=(e,t)=>dv(e,"name",{value:t,configurable:!0});p(".will-transition-once",{constructor:HTMLElement,subscribe:e=>j(e,"transitionend",wp)});function wp(e){e.target.classList.remove("will-transition-once")}fv(wp,"onTransitionEnd");var mv=Object.defineProperty,pv=(e,t)=>mv(e,"name",{value:t,configurable:!0});function Ep(e,t=0){const n=e.getBoundingClientRect(),r=n.top-t,o=n.bottom-window.innerHeight+t;r<0?window.scrollBy(0,r):o>0&&window.scrollBy(0,o)}pv(Ep,"adjustViewport"),f("click",".js-video-play, .js-video-close",function(e){const n=e.currentTarget.closest(".js-video-container"),r=n.querySelector(".js-video-iframe");n.tagName.toLowerCase()==="details"&&n.addEventListener("details-dialog-close",function(){r.removeAttribute("src"),window.setTimeout(function(){n.classList.remove("is-expanded")},10)}),n.classList.contains("is-expanded")?(r.removeAttribute("src"),n.classList.remove("is-expanded")):(r.src=r.getAttribute("data-src")||"",n.classList.add("is-expanded")),Ep(r,20)});var hv=Object.defineProperty,Wi=(e,t)=>hv(e,"name",{value:t,configurable:!0});async function jp(e){const t=e.currentTarget,n=t.getAttribute("data-url");if(!n||Sp(t))return;const r=t.getAttribute("data-id")||"",o=t.textContent,s=document.querySelectorAll(`.js-issue-link[data-id='${r}']`);for(const i of s)i.removeAttribute("data-url");try{const i=await fetch(n,{headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json"}});if(!i.ok){const c=new Error,l=i.statusText?` ${i.statusText}`:"";throw c.message=`HTTP ${i.status}${l}`,c}const a=await i.json();zi(s,`${o}, ${a.title}`)}catch(i){const a=(i.response!=null?i.response.status:void 0)||500,c=(()=>{switch(a){case 404:return t.getAttribute("data-permission-text");default:return t.getAttribute("data-error-text")}})();zi(s,c||"")}}Wi(jp,"issueLabel");function zi(e,t){for(const n of e)n instanceof HTMLElement&&(n.classList.add("tooltipped","tooltipped-ne"),n.setAttribute("aria-label",t))}Wi(zi,"setLabel");function Sp(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}}Wi(Sp,"isHovercardEnabled"),p(".js-issue-link",{subscribe:e=>j(e,"mouseenter",jp)}),L.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 gv=Object.freeze({__proto__:null}),Ln=Ca(gv);const Lp={};for(const e of Object.keys(Ln))Lp[Ln[e]]=e;const b={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 lt=b;for(const e of Object.keys(b)){if(!("channels"in b[e]))throw new Error("missing channels property: "+e);if(!("labels"in b[e]))throw new Error("missing channel labels property: "+e);if(b[e].labels.length!==b[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=b[e];delete b[e].channels,delete b[e].labels,Object.defineProperty(b[e],"channels",{value:t}),Object.defineProperty(b[e],"labels",{value:n})}b.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),s=Math.max(t,n,r),i=s-o;let a,c;s===o?a=0:t===s?a=(n-r)/i:n===s?a=2+(r-t)/i:r===s&&(a=4+(t-n)/i),a=Math.min(a*60,360),a<0&&(a+=360);const l=(o+s)/2;return s===o?c=0:l<=.5?c=i/(s+o):c=i/(2-s-o),[a,c*100,l*100]},b.rgb.hsv=function(e){let t,n,r,o,s;const i=e[0]/255,a=e[1]/255,c=e[2]/255,l=Math.max(i,a,c),d=l-Math.min(i,a,c),m=function(h){return(l-h)/6/d+1/2};return d===0?(o=0,s=0):(s=d/l,t=m(i),n=m(a),r=m(c),i===l?o=r-n:a===l?o=1/3+t-r:c===l&&(o=2/3+n-t),o<0?o+=1:o>1&&(o-=1)),[o*360,s*100,l*100]},b.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=b.rgb.hsl(e)[0],s=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,s*100,r*100]},b.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),s=(1-t-o)/(1-o)||0,i=(1-n-o)/(1-o)||0,a=(1-r-o)/(1-o)||0;return[s*100,i*100,a*100,o*100]};function bv(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}b.rgb.keyword=function(e){const t=Lp[e];if(t)return t;let n=1/0,r;for(const o of Object.keys(Ln)){const s=Ln[o],i=bv(e,s);i.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124+n*.3576+r*.1805,s=t*.2126+n*.7152+r*.0722,i=t*.0193+n*.1192+r*.9505;return[o*100,s*100,i*100]},b.rgb.lab=function(e){const t=b.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,o=o>.008856?o**(1/3):7.787*o+16/116;const s=116*r-16,i=500*(n-r),a=200*(r-o);return[s,i,a]},b.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,s,i;if(n===0)return i=r*255,[i,i,i];r<.5?o=r*(1+n):o=r+n-r*n;const a=2*r-o,c=[0,0,0];for(let l=0;l<3;l++)s=t+1/3*-(l-1),s<0&&s++,s>1&&s--,6*s<1?i=a+(o-a)*6*s:2*s<1?i=o:3*s<2?i=a+(o-a)*(2/3-s)*6:i=a,c[l]=i*255;return c},b.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const s=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=s<=1?s:2-s;const i=(r+n)/2,a=r===0?2*o/(s+o):2*n/(r+n);return[t,a*100,i*100]},b.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,s=t-Math.floor(t),i=255*r*(1-n),a=255*r*(1-n*s),c=255*r*(1-n*(1-s));switch(r*=255,o){case 0:return[r,c,i];case 1:return[a,r,i];case 2:return[i,r,c];case 3:return[i,a,r];case 4:return[c,i,r];case 5:return[r,i,a]}},b.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let s,i;i=(2-n)*r;const a=(2-n)*o;return s=n*o,s/=a<=1?a:2-a,s=s||0,i/=2,[t,s*100,i*100]},b.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let s;o>1&&(n/=o,r/=o);const i=Math.floor(6*t),a=1-r;s=6*t-i,(i&1)!=0&&(s=1-s);const c=n+s*(a-n);let l,d,m;switch(i){default:case 6:case 0:l=a,d=c,m=n;break;case 1:l=c,d=a,m=n;break;case 2:l=n,d=a,m=c;break;case 3:l=n,d=c,m=a;break;case 4:l=c,d=n,m=a;break;case 5:l=a,d=n,m=c;break}return[l*255,d*255,m*255]},b.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,s=1-Math.min(1,t*(1-o)+o),i=1-Math.min(1,n*(1-o)+o),a=1-Math.min(1,r*(1-o)+o);return[s*255,i*255,a*255]},b.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,s,i;return o=t*3.2406+n*-1.5372+r*-.4986,s=t*-.9689+n*1.8758+r*.0415,i=t*.0557+n*-.204+r*1.057,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),i=Math.min(Math.max(0,i),1),[o*255,s*255,i*255]},b.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;const o=116*n-16,s=500*(t-n),i=200*(n-r);return[o,s,i]},b.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,s,i;s=(t+16)/116,o=n/500+s,i=s-r/200;const a=s**3,c=o**3,l=i**3;return s=a>.008856?a:(s-16/116)/7.787,o=c>.008856?c:(o-16/116)/7.787,i=l>.008856?l:(i-16/116)/7.787,o*=95.047,s*=100,i*=108.883,[o,s,i]},b.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const i=Math.sqrt(n*n+r*r);return[t,i,o]},b.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,s=n*Math.cos(o),i=n*Math.sin(o);return[t,s,i]},b.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let s=t===null?b.rgb.hsv(e)[2]:t;if(s=Math.round(s/50),s===0)return 30;let i=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return s===2&&(i+=60),i},b.hsv.ansi16=function(e){return b.rgb.ansi16(b.hsv.rgb(e),e[2])},b.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t===n&&n===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},b.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(~~(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,s=(t>>2&1)*n*255;return[r,o,s]},b.ansi256.rgb=function(e){if(e>=232){const s=(e-232)*10+8;return[s,s,s]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]},b.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(n.length)+n},b.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];t[0].length===3&&(n=n.split("").map(a=>a+a).join(""));const r=parseInt(n,16),o=r>>16&255,s=r>>8&255,i=r&255;return[o,s,i]},b.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),s=Math.min(Math.min(t,n),r),i=o-s;let a,c;return i<1?a=s/(1-i):a=0,i<=0?c=0:o===t?c=(n-r)/i%6:o===n?c=2+(r-t)/i:c=4+(t-n)/i,c/=6,c%=1,[c*360,i*100,a*100]},b.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]},b.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]},b.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],s=t%1*6,i=s%1,a=1-i;let c=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=i,o[2]=0;break;case 1:o[0]=a,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=i;break;case 3:o[0]=0,o[1]=a,o[2]=1;break;case 4:o[0]=i,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=a}return c=(1-n)*r,[(n*o[0]+c)*255,(n*o[1]+c)*255,(n*o[2]+c)*255]},b.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]},b.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]},b.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]},b.hwb.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=1-n,o=r-t;let s=0;return o<1&&(s=(r-o)/(1-o)),[e[0],o*100,s*100]},b.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},b.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},b.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},b.gray.hsl=function(e){return[0,0,e[0]]},b.gray.hsv=b.gray.hsl,b.gray.hwb=function(e){return[0,100,e[0]]},b.gray.cmyk=function(e){return[0,0,0,e[0]]},b.gray.lab=function(e){return[e[0],0,0]},b.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},b.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function yv(){const e={},t=Object.keys(lt);for(let n=t.length,r=0;r1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function _v(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let s=o.length,i=0;i{Pt[e]={},Object.defineProperty(Pt[e],"channels",{value:lt[e].channels}),Object.defineProperty(Pt[e],"labels",{value:lt[e].labels});const t=jv(e);Object.keys(t).forEach(r=>{const o=t[r];Pt[e][r]=_v(o),Pt[e][r].raw=Lv(o)})});var ut=Pt,kv=Object.defineProperty,H=(e,t)=>kv(e,"name",{value:t,configurable:!0});function Br(){return[Math.floor(Math.random()*(255-0)+0),Math.floor(Math.random()*(255-0)+0),Math.floor(Math.random()*(255-0)+0)]}H(Br,"randomRGBColor");function Mt(e,t){const n=ut.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())}H(Mt,"setColorSwatch");function Ur(e,t){e.blur();const n=e.closest("form"),r=n.querySelector(".js-new-label-color-input");$e(r,`#${ut.rgb.hex(t)}`);const o=n.querySelector(".js-new-label-color");Mt(o,t)}H(Ur,"setInputColorFromButton");function _p(e,t){e.closest(".js-label-error-container").classList.add("errored"),e.textContent=t,e.hidden=!1}H(_p,"addErrorToField");function kp(e){e.closest(".js-label-error-container").classList.remove("errored"),e.hidden=!0}H(kp,"removeErrorFromField");function dt(e,t,n){const r=t.querySelector(e);!r||(n?_p(r,n[0]):kp(r))}H(dt,"showOrHideLabelError");function Wr(e,t){dt(".js-label-name-error",e,t.name),dt(".js-label-description-error",e,t.description),dt(".js-label-color-error",e,t.color)}H(Wr,"showLabelErrors");function Be(e){dt(".js-label-name-error",e,null),dt(".js-label-description-error",e,null),dt(".js-label-color-error",e,null)}H(Be,"hideLabelErrors");function Tp(e,t,n,r,o){const s=new URL(`${e}${encodeURIComponent(t)}`,window.location.origin),i=new URLSearchParams(s.search.slice(1));return i.append("color",n),r&&i.append("description",r),o&&i.append("id",o),s.search=i.toString(),s.toString()}H(Tp,"labelPreviewUrl");function Cp(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}H(Cp,"labelDescriptionFrom");function xp(e){const t=e.querySelector(".js-new-label-color-input");return t.checkValidity()?t.value.trim().replace(/^#/,""):"ededed"}H(xp,"labelColorFrom");function Ap(e,t){let r=e.querySelector(".js-new-label-name-input").value.trim();return r.length<1&&(r=t.getAttribute("data-default-name")),r}H(Ap,"labelNameFrom");async function ft(e){const t=e.closest(".js-label-preview-container");if(!t)return;const n=e.closest(".js-label-form"),r=n.querySelector(".js-new-label-error"),o=n.getAttribute("data-label-id"),s=t.querySelector(".js-label-preview"),i=Ap(n,s);if(!n.checkValidity()&&i!=="Label preview")return;const a=xp(n),c=Cp(n),l=s.getAttribute("data-url-template"),d=Tp(l,i,a,c,o);if(t.hasAttribute("data-last-preview-url")){const h=t.getAttribute("data-last-preview-url");if(d===h)return}let m;try{m=await N(document,d)}catch(h){const g=await h.response.json();Wr(n,g),r&&(r.textContent=g.message,r.hidden=!1);return}r&&(r.textContent="",r.hidden=!0),Be(n),s.innerHTML="",s.appendChild(m),t.setAttribute("data-last-preview-url",d)}H(ft,"updateLabelPreview");function Pp(e){ft(e.target)}H(Pp,"onLabelFormInputChange");function Vi(e,t){e.closest(".js-details-container").classList.toggle("is-empty",t)}H(Vi,"toggleBlankSlate");function Ki(e){const t=document.querySelector(".js-labels-count"),r=Number(t.textContent)+e;t.textContent=r.toString();const o=document.querySelector(".js-labels-label");return o.textContent=o.getAttribute(r===1?"data-singular-string":"data-plural-string"),r}H(Ki,"updateCount"),me(".js-label-filter-field",function(e){const t=e.target,r=t.closest("details-menu").querySelector(".js-new-label-name");if(!r)return;const o=t.value.trim();r.textContent=o}),f("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 i of t.querySelectorAll("input[data-label-name]"))if((i.getAttribute("data-label-name")||"").toLowerCase()===o){s=!0;break}n.hidden=o.length===0||s}),Ht(".js-new-label-color-input",function(e){const n=e.closest("form").querySelector(".js-new-label-swatches");n.hidden=!1,e.addEventListener("blur",function(){n.hidden=!0},{once:!0})}),me(".js-new-label-color-input",function(e){const t=e.target;let n=t.value.trim();if(!(n.length<1))if(n.indexOf("#")!==0&&(n=`#${n}`,t.value=n),t.checkValidity()){t.classList.remove("color-fg-danger");const o=t.closest("form").querySelector(".js-new-label-color");Mt(o,ut.hex.rgb(n))}else t.classList.add("color-fg-danger")}),z("keyup",".js-new-label-color-input",function(e){const t=e.target;let n=t.value.trim();if(n.indexOf("#")!==0&&(n=`#${n}`,t.value=n),t.checkValidity()){const s=t.closest("form").querySelector(".js-new-label-color");Mt(s,ut.hex.rgb(n))}v(t,"change",!1);const r=t.closest("form");Be(r)}),z("keyup",".js-new-label-description-input",function(e){const n=e.target.form;Be(n)}),z("keyup",".js-new-label-color-input",function(e){const n=e.target.form;Be(n)}),f("click",".js-new-label-color",async function(e){const t=e.currentTarget,n=Br();Ur(t,n),ft(t)}),f("mousedown",".js-new-label-color-swatch",function(e){const t=e.currentTarget,n=t.getAttribute("data-color");Ur(t,ut.hex.rgb(n)),ft(t);const r=t.closest(".js-new-label-swatches");r.hidden=!0}),f("toggle",".js-new-label-modal",function(e){e.target.hasAttribute("open")&&Xi(e.target)},{capture:!0});async function Xi(e){const t=e.querySelector(".js-new-label-name-input");if(!t)return;const n=e.querySelector(".js-new-label-color-input"),r=Br(),o=`#${ut.rgb.hex(r)}`;n.value=o;const s=e.querySelector(".js-new-label-color");Mt(s,r);const a=document.querySelector(".js-new-label-name").textContent;$e(t,a),lc(t),ft(s)}H(Xi,"initLabelModal"),P(".js-new-label-modal-form",async function(e,t){const n=e.querySelector(".js-new-label-error");let r;try{r=await t.html()}catch(a){const c=a.response.json;n.textContent=c.message,n.hidden=!1}if(!r)return;n.hidden=!0,document.querySelector(".js-new-label-modal").removeAttribute("open");const o=document.querySelector(".js-filterable-issue-labels"),s=r.html.querySelector("input");o.prepend(r.html),s&&s.dispatchEvent(new Event("change",{bubbles:!0}));const i=document.querySelector(".js-label-filter-field");i.value=i.defaultValue,i.focus()}),f("click",".js-edit-label-cancel",function(e){const t=e.target.closest("form");Be(t),t.reset();const n=t.querySelector(".js-new-label-color-input"),r=n.value,o=t.querySelector(".js-new-label-color");Mt(o,ut.hex.rgb(r)),go(t),ft(n);const s=e.currentTarget.closest(".js-labels-list-item");if(s){s.querySelector(".js-update-label").classList.add("d-none");const a=s.querySelector(".js-label-preview");a&&(a.classList.add("d-none"),s.querySelector(".js-label-link").classList.remove("d-none"));const c=s.querySelectorAll(".js-hide-on-label-edit");for(const l of c)l.hidden=!l.hidden}}),P(".js-update-label",async function(e,t){let n;try{n=await t.html()}catch(o){const s=o.response.json;Wr(e,s);return}Be(e),e.closest(".js-labels-list-item").replaceWith(n.html)}),P(".js-create-label",async function(e,t){let n;try{n=await t.html()}catch(i){const a=i.response.json;Wr(e,a);return}e.reset(),Be(e),document.querySelector(".js-label-list").prepend(n.html),Ki(1),Vi(e,!1);const r=e.querySelector(".js-new-label-color"),o=Br();Ur(r,o),ft(e.querySelector(".js-new-label-name-input")),go(e);const s=e.closest(".js-details-container");s instanceof HTMLElement&&po(s)}),f("click",".js-details-target-new-label",function(){document.querySelector(".js-create-label").querySelector(".js-new-label-name-input").focus()}),f("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");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 i of s)i.hidden=!i.hidden}),P(".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();const r=Ki(-1);Vi(e,r===0),n.remove()});const zr=ze(Pp,500);f("suggester:complete",".js-new-label-name-input",zr),me(".js-new-label-name-input",zr),me(".js-new-label-description-input",zr),me(".js-new-label-color-input",zr),z("keypress",".js-new-label-name-input",function(e){const t=e.target,n=parseInt(t.getAttribute("data-maxlength"));uc(t.value)>=n&&e.preventDefault()}),f("click",".js-issues-label-select-menu-item",function(e){!e.altKey&&!e.shiftKey||(e.preventDefault(),e.stopPropagation(),e.altKey&&(window.location.href=e.currentTarget.getAttribute("data-excluded-url")),e.shiftKey&&(window.location.href=e.currentTarget.getAttribute("data-included-url")))}),z("keydown",".js-issues-label-select-menu-item",function(e){if(e.key!=="Enter"||!e.altKey&&!e.shiftKey)return;const t=e.currentTarget;e.preventDefault(),e.stopPropagation(),t instanceof HTMLAnchorElement&&(e.altKey&&(window.location.href=t.getAttribute("data-excluded-url")),e.shiftKey&&(window.location.href=t.getAttribute("data-included-url")))}),f("click",".js-open-label-creation-modal",async function(e){e.stopImmediatePropagation();const t=await ve({content:document.querySelector(".js-label-creation-template").content.cloneNode(!0),detailsClass:"js-new-label-modal"});Xi(t)},{capture:!0});var Tv=Object.defineProperty,Cv=(e,t)=>Tv(e,"name",{value:t,configurable:!0});f("change",".js-thread-notification-setting",Vr),f("change",".js-custom-thread-notification-option",Vr),f("reset",".js-custom-thread-settings-form",Vr);function Vr(){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"),r=document.querySelector("[data-custom-option-required-text]"),o=e&&t?r.getAttribute("data-custom-option-required-text"):"";r.setCustomValidity(o),n.hidden=!e}Cv(Vr,"toggleEventSettings");var Mp=Object.defineProperty,xv=Object.getOwnPropertyDescriptor,Av=(e,t)=>Mp(e,"name",{value:t,configurable:!0}),$p=(e,t,n,r)=>{for(var o=r>1?void 0:r?xv(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&Mp(t,n,o),o};let Kr=class extends HTMLElement{get activeClass(){return this.getAttribute("active-class")||"collapsible-sidebar-widget-active"}get loadingClass(){return this.getAttribute("loading-class")||"collapsible-sidebar-widget-loading"}get url(){return this.getAttribute("url")||""}get isOpen(){return this.hasAttribute("open")}set isOpen(e){e?this.setAttribute("open",""):this.removeAttribute("open")}onKeyDown(e){if(e.code==="Enter"||e.code==="Space")return e.preventDefault(),this.load()}onMouseDown(e){return e.preventDefault(),this.load()}load(){return this.pendingRequest?this.pendingRequest.abort():this.collapsible.hasAttribute("loaded")?this.isOpen?this.setClose():this.setOpen():(this.setLoading(),this.updateCollapsible())}setLoading(){this.classList.add(this.loadingClass),this.classList.remove(this.activeClass)}setOpen(){this.classList.add(this.activeClass),this.classList.remove(this.loadingClass),this.isOpen=!0}setClose(){this.classList.remove(this.activeClass),this.classList.remove(this.loadingClass),this.isOpen=!1}handleAbort(){this.pendingRequest=null,this.setClose()}async updateCollapsible(){var e;try{this.pendingRequest=new AbortController,this.pendingRequest.signal.addEventListener("abort",()=>this.handleAbort());const t=await fetch(this.url,{signal:(e=this.pendingRequest)==null?void 0:e.signal,headers:{Accept:"text/html","X-Requested-With":"XMLHttpRequest"}});if(this.pendingRequest=null,!t.ok)return this.setClose();const n=await t.text();this.collapsible.innerHTML=n,this.collapsible.setAttribute("loaded",""),this.setOpen()}catch(t){return this.pendingRequest=null,this.setClose()}}};Av(Kr,"CollapsibleSidebarWidgetElement"),$p([y],Kr.prototype,"collapsible",2),Kr=$p([I],Kr);var qp=Object.defineProperty,Pv=Object.getOwnPropertyDescriptor,Mv=(e,t)=>qp(e,"name",{value:t,configurable:!0}),Ae=(e,t,n,r)=>{for(var o=r>1?void 0:r?Pv(t,n):t,s=e.length-1,i;s>=0;s--)(i=e[s])&&(o=(r?i(t,n,o):i(o))||o);return r&&o&&qp(t,n,o),o};let ue=class extends HTMLElement{constructor(){super(...arguments);this.url="",this.csrf="",this.instrument="",this.column=1}get isDisabled(){var e;return(e=this.read)==null?void 0:e.hasAttribute("disabled")}set hasErrored(e){e?this.setAttribute("errored",""):this.removeAttribute("errored")}set disabled(e){e?this.setAttribute("disabled",""):this.removeAttribute("disabled")}get hasExpanded(){return this.read.getAttribute("aria-expanded")==="true"}connectedCallback(){var e,t;this.disabled=(t=(e=this.read)==null?void 0:e.disabled)!=null?t:!0,this.querySelector("details")!==null&&this.classList.toggle("no-pointer")}handleDetailsSelect(e){var t;const n=e,r=e.target,o=(t=n.detail)==null?void 0:t.relatedTarget,s=r.closest("details"),i=s==null?void 0:s.querySelector("[data-menu-button]");if(o.getAttribute("aria-checked")==="true"){o.setAttribute("aria-checked","false"),e.preventDefault();for(const a of this.inputs)if(o.contains(a)){this.updateCell(a.name,""),(i==null?void 0:i.innerHTML)&&(i.innerHTML=a.placeholder);break}s==null||s.removeAttribute("open")}}handleDetailsSelected(e){var t;const r=(t=e.detail)==null?void 0:t.relatedTarget;for(const o of this.inputs)if(r.contains(o)){this.updateCell(o.name,o.value);break}}mouseDownFocus(e){!this.isDisabled||this.onFocus(e)}keyDownFocus(e){(e.code==="Enter"||e.code==="Space")&&this.read!==document.activeElement&&this.onFocus(e)}onChange(e){var t,n;e.target.getAttribute("type")!=="date"&&this.updateCell((t=this.read)==null?void 0:t.name,(n=this.read)==null?void 0:n.value)}onFocus(e){e.preventDefault(),this.disabled=!1,this.read.disabled=!1,this.read.focus()}onBlur(e){var t,n;if(this.hasExpanded){e.preventDefault();return}e.target.getAttribute("type")==="date"&&this.updateCell((t=this.read)==null?void 0:t.name,(n=this.read)==null?void 0:n.value),this.read.disabled=!0,this.disabled=!0}onKeyDown(e){if(e.code==="Enter"||e.code==="Tab"){if(e.preventDefault(),e.stopPropagation(),this.hasExpanded)return;this.read.blur()}}async updateCell(e="",t=""){const n=new FormData;n.set(e,t),n.set("ui",this.instrument);for(const o of this.parameters)n.set(o.name,o.value);const r=Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",timeZone:"UTC"});try{if(this.write){const d=this.read.value,m=this.read.type==="date"&&d?r.format(Date.parse(d)):d;this.write.innerHTML=d?m:this.read.placeholder}const o=await fetch(this.url,{method:"PUT",body:n,headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest","Scoped-CSRF-Token":`${this.csrf}`}});if(!o.ok)throw new Error("connection error");if(!this.write)return;const a=(await o.json()).memexProjectItem.memexProjectColumnValues.find(d=>d.memexProjectColumnId===Number(this.column)).value,c=this.read.type==="date"?Date.parse(a.value):a.html,l=this.read.type==="date"&&c?r.format(c):c;this.write.innerHTML=t?l:this.read.placeholder}catch(o){this.hasErrored=!0}}};Mv(ue,"SidebarMemexInputElement"),Ae([se],ue.prototype,"url",2),Ae([se],ue.prototype,"csrf",2),Ae([se],ue.prototype,"instrument",2),Ae([se],ue.prototype,"column",2),Ae([oe],ue.prototype,"inputs",2),Ae([y],ue.prototype,"read",2),Ae([y],ue.prototype,"write",2),Ae([oe],ue.prototype,"parameters",2),ue=Ae([I],ue);var $v=Object.defineProperty,de=(e,t)=>$v(e,"name",{value:t,configurable:!0});function $t(e,t=!1){(t||!Op(e))&&(e instanceof HTMLFormElement?W(e):_n(e))}de($t,"submitForm");function Gi(e){const t=e.currentTarget,n=t.closest(".js-issue-sidebar-form")||t.querySelector(".js-issue-sidebar-form");$t(n)}de(Gi,"submitOnMenuClose"),f("details-menu-selected",".js-discussion-sidebar-menu",function(e){const t=e.detail.relatedTarget,n=e.currentTarget,r=t.closest(".js-issue-sidebar-form"),o=n.hasAttribute("data-multiple");if(t.hasAttribute("data-clear-assignees")){const s=n.querySelectorAll('input[name="issue[user_assignee_ids][]"]:checked');for(const i of s)i.disabled=!1,i.checked=!1;$t(r)}else o?n.closest("details").addEventListener("toggle",Gi,{once:!0}):$t(r)},{capture:!0});function Ip(e,t){e.replaceWith(fe(document,t))}de(Ip,"updateSidebar"),P(".js-issue-sidebar-form",async function(e,t){const n=await t.html();e.closest(".js-discussion-sidebar-item").replaceWith(n.html)}),f("click","div.js-issue-sidebar-form .js-suggested-reviewer",function(e){const t=e.currentTarget,n=t.closest(".js-issue-sidebar-form");_n(n,"post",{name:t.name,value:t.value}),e.preventDefault()}),f("click","div.js-issue-sidebar-form .js-issue-assign-self",function(e){var t;const n=e.currentTarget,r=n.closest(".js-issue-sidebar-form");_n(r,"post",{name:n.name,value:n.value}),n.remove(),(t=document.querySelector("form#new_issue .is-submit-button-value"))==null||t.remove(),e.preventDefault()}),f("click",".js-issue-unassign-self",function(e){const t=e.currentTarget.closest(".js-issue-sidebar-form");_n(t,"delete"),e.preventDefault()}),P(".js-pages-preview-toggle-form",async function(e,t){const n=await t.json();e.querySelector("button.btn").textContent=n.json.new_button_value});async function _n(e,t="post",n){const r=Ji(e);n&&r.append(n.name,n.value);const o=e.getAttribute("data-url");if(!o)return;const s=e.querySelector(".js-data-url-csrf"),i=await fetch(o,{method:t,body:t==="delete"?"":r,mode:"same-origin",headers:{"Scoped-CSRF-Token":s.value,"X-Requested-With":"XMLHttpRequest"}});if(!i.ok)return;const a=await i.text();Ip(e.closest(".js-discussion-sidebar-item"),a)}de(_n,"previewSubmit");function Op(e){const t=e.getAttribute("data-reviewers-team-size-check-url");if(!t)return!1;const n=[...document.querySelectorAll(".js-reviewer-team")].map(a=>a.getAttribute("data-id")),r=e instanceof HTMLFormElement?new FormData(e):Ji(e),s=new URLSearchParams(r).getAll("reviewer_team_ids[]").filter(a=>!n.includes(a));if(s.length===0)return!1;const i=new URLSearchParams(s.map(a=>["reviewer_team_ids[]",a]));return Fp(e,`${t}?${i}`),!0}de(Op,"reviewerTeamsCheckRequired");async function Fp(e,t){const n=await fetch(t);if(!n.ok)return;const r=await n.text();if(r.match(/[^\w-]js-large-team[^\w-]/))Rp(e,r);else{$t(e,!0);return}}de(Fp,"triggerTeamReviewerCheck");function Rp(e,t){const n=e.querySelector(".js-large-teams-check-warning-container");for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(fe(document,t));const r=n.querySelector("details");function o(s){if(s.target instanceof Element){if(r.open=!1,!s.target.classList.contains("js-large-teams-request-button")){const i=e.querySelectorAll("input[name='reviewer_team_ids[]']");for(const a of i)n.querySelector(`.js-large-team[data-id='${a.value}']`)&&(a.checked=!1)}$t(e,!0),s.preventDefault()}}de(o,"dialogAction"),n.querySelector(".js-large-teams-request-button").addEventListener("click",o,{once:!0}),n.querySelector(".js-large-teams-do-not-request-button").addEventListener("click",o,{once:!0}),r.addEventListener("details-dialog-close",o,{once:!0}),r.open=!0}de(Rp,"showTeamReviewerConfirmationDialog"),f("click","div.js-project-column-menu-container .js-project-column-menu-item button",async function(e){const t=e.currentTarget;Dp(t);const n=t.getAttribute("data-url"),r=t.parentElement.querySelector(".js-data-url-csrf"),o=t.getAttribute("data-card-id"),s=new FormData;if(s.append("card_id",o),s.append("use_automation_prioritization","true"),e.preventDefault(),!(await fetch(n,{method:"PUT",mode:"same-origin",body:s,headers:{"Scoped-CSRF-Token":r.value,"X-Requested-With":"XMLHttpRequest"}})).ok)return;const a=document.activeElement,c=t.closest(".js-project-column-menu-dropdown");if(a&&c.contains(a))try{a.blur()}catch(l){}});function Dp(e){const n=e.closest(".js-project-column-menu-dropdown").querySelector(".js-project-column-menu-summary"),r=e.getAttribute("data-column-name");n.textContent=r}de(Dp,"updateProjectColumnMenuSummary"),f("click",".js-prompt-dismiss",function(e){e.currentTarget.closest(".js-prompt").remove()});function Ji(e){const t=e.closest("form"),r=new FormData(t).entries(),o=new FormData;for(const[s,i]of r)t.contains(Hp(t,s,i.toString()))&&o.append(s,i);return o}de(Ji,"scopedFormData");function Hp(e,t,n){for(const r of e.elements)if((r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLButtonElement)&&r.name===t&&r.value===n)return r;return null}de(Hp,"findParam"),f("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"}})}),f("click","div.js-restore-item",async function(e){const t=e.currentTarget.getAttribute("data-url"),n=e.currentTarget.getAttribute("data-column"),r=e.currentTarget.querySelector(".js-data-url-csrf"),o=new FormData;if(o.set("memexProjectItemIds[]",n),!(await fetch(t,{method:"PUT",mode:"same-origin",body:o,headers:{"Scoped-CSRF-Token":r.value,"X-Requested-With":"XMLHttpRequest"}})).ok)throw new Error("connection error");Gi(e)}),C("launch-code",()=>L.import("./chunk-launch-code-element.js")),C("metric-selection",()=>L.import("./chunk-metric-selection-element.js")),C("severity-calculator",()=>L.import("./chunk-severity-calculator-element.js")),C("command-palette-page",()=>L.import("./chunk-command-palette-page-element.js")),C("command-palette-page-stack",()=>L.import("./chunk-command-palette-page-stack-element.js")),C("readme-toc",()=>L.import("./chunk-readme-toc-element.js")),C("delayed-loading",()=>L.import("./chunk-delayed-loading-element.js")),C("feature-callout",()=>L.import("./chunk-feature-callout-element.js")),C("codespaces-policy-form",()=>L.import("./chunk-codespaces-policy-form-element.js")),C("action-list",()=>L.import("./chunk-action-list-element.js")),C("memex-project-picker",()=>L.import("./chunk-memex-project-picker-element.js")),C("project-picker",()=>L.import("./chunk-project-picker-element.js")),C("profile-pins",()=>L.import("./chunk-profile-pins-element.js")),C("emoji-picker",()=>L.import("./chunk-emoji-picker-element.js")),C("edit-hook-secret",()=>L.import("./chunk-edit-hook-secret-element.js")),C("insights-query",()=>L.import("./chunk-insights-query.js")),C("remote-clipboard-copy",()=>L.import("./chunk-remote-clipboard-copy.js")),C("series-table",()=>L.import("./chunk-series-table.js")),C("line-chart",()=>L.import("./chunk-line-chart.js")),C("bar-chart",()=>L.import("./chunk-bar-chart.js")),C("stacked-area-chart",()=>L.import("./chunk-stacked-area-chart.js")),C("presence-avatars",()=>L.import("./chunk-presence-avatars.js")),C("pulse-authors-graph",()=>L.import("./chunk-pulse-authors-graph-element.js")),C("stacks-input-config-view",()=>L.import("./chunk-stacks-input-config-view.js")),C("community-contributions-graph",()=>L.import("./chunk-community-contributions.js")),C("discussion-page-views-graph",()=>L.import("./chunk-discussion-page-views.js")),C("discussions-daily-contributors",()=>L.import("./chunk-discussions-daily-contributors.js")),C("discussions-new-contributors",()=>L.import("./chunk-discussions-new-contributors.js"))}}}); //# sourceMappingURL=behaviors-1a731f8c.js.map