forked from APACGAMONDE/APACGAMONDE-Bank-ShareHoldings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub-bootstrap-2ad6112d.js.download
34 lines (32 loc) · 433 KB
/
github-bootstrap-2ad6112d.js.download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
System.register(["./frameworks.js","./vendor.js"],(function(){"use strict";var e,t,n,s,o,r,i,a,c,l,u,d,m,f,p,g,h,v,b,j,w,L,y,E,T,k,M,S,H,x,A,q,C,I,_,$,N,D,P,R,F,B,O,U,z,W,V,J,K,G,X,Y,Q,Z,ee,te,ne,se,oe,re,ie,ae,ce,le,ue,de,me,fe,pe,ge,he,ve,be,je,we,Le,ye,Ee,Te,ke,Me,Se,He,xe,Ae,qe,Ce,Ie,_e,$e,Ne,De,Pe,Re,Fe,Be,Oe,Ue,ze,We,Ve,Je,Ke,Ge,Xe,Ye,Qe,Ze,et,tt,nt,st,ot,rt,it,at,ct,lt,ut,dt,mt,ft,pt,gt,ht,vt,bt,jt;return{setters:[function(Qe){e=Qe.T,t=Qe.U,n=Qe.x,s=Qe.w,o=Qe.h,r=Qe.V,i=Qe.g,a=Qe.D,c=Qe.o,l=Qe.a,u=Qe.q,d=Qe.l,m=Qe.A,f=Qe.W,p=Qe.r,g=Qe.O,h=Qe.E,v=Qe.X,b=Qe.S,j=Qe.Y,w=Qe.z,L=Qe.y,y=Qe.M,E=Qe.Z,T=Qe._,k=Qe.b,M=Qe.$,S=Qe.m,H=Qe.i,x=Qe.a0,A=Qe.f,q=Qe.P,C=Qe.k,I=Qe.a1,_=Qe.a2,$=Qe.a3,N=Qe.a4,D=Qe.p,P=Qe.a5,R=Qe.a6,F=Qe.a7,B=Qe.K,O=Qe.a8,U=Qe.a9,z=Qe.Q,W=Qe.aa,V=Qe.ab,J=Qe.ac,K=Qe.H,G=Qe.L,X=Qe.ad,Y=Qe.ae,Q=Qe.af,Z=Qe.ag,ee=Qe.ah,te=Qe.ai,ne=Qe.aj,se=Qe.ak,oe=Qe.al,re=Qe.am,ie=Qe.an,ae=Qe.G,ce=Qe.t,le=Qe.c,Qe.d,ue=Qe.ao,de=Qe.ap,me=Qe.aq,fe=Qe.J,pe=Qe.ar,ge=Qe.I,he=Qe.as,ve=Qe.n,be=Qe.s,je=Qe.at,we=Qe.au,Le=Qe.av,ye=Qe.aw,Ee=Qe.ax,Te=Qe.ay,ke=Qe.az,Me=Qe.aA,Se=Qe.aB,He=Qe.aC,xe=Qe.aD,Ae=Qe.aE,qe=Qe.aF,Ce=Qe.aG,Ie=Qe.aH,_e=Qe.aI,$e=Qe.aJ,Ne=Qe.aK,De=Qe.aL,Pe=Qe.F,Re=Qe.aM,Fe=Qe.aN,Be=Qe.aO,Oe=Qe.aP,Ue=Qe.aQ,ze=Qe.aR,We=Qe.aS,Ve=Qe.aT,Je=Qe.aU,Ke=Qe.aV,Ge=Qe.aW,Xe=Qe.aX,Ye=Qe.aY},function(e){Qe=e.a,Ze=e.I,et=e.o,tt=e.d,nt=e.f,st=e.A,ot=e.c,rt=e.R,it=e.F,at=e.i,ct=e.u,lt=e.C,ut=e.e,dt=e.t,mt=e.g,ft=e.j,pt=e.n,gt=e.r,ht=e.h,vt=e.k,bt=e.l,jt=e.M}],execute:function(){document.addEventListener("click",(function(e){if(!(e.target instanceof Element))return;const t=e.target.closest("a[data-confirm], input[type=submit][data-confirm], input[type=checkbox][data-confirm], button[data-confirm]");if(!t)return;const n=t.getAttribute("data-confirm");n&&(t instanceof HTMLInputElement&&t.hasAttribute("data-confirm-checked")&&!t.checked||confirm(n)||(e.stopImmediatePropagation(),e.preventDefault()))}),!0),Qe("[data-hotkey]",{add(t){e(t)},remove(e){t(e)}}),window.IncludeFragmentElement.prototype.fetch=n;class PollIncludeFragmentElement extends Ze{async fetch(e,t=1e3){const n=await super.fetch(e);return 202===n.status?(await new Promise(e=>setTimeout(e,t)),this.fetch(e,1.5*t)):n}}function wt(e){return"ArrowDown"===e.key||"ArrowUp"===e.key}function Lt(e){const t=o(e,"label");t.hasAttribute("data-role")||t.setAttribute("data-role",i(t,"role")),t.setAttribute("role",i(t,"data-role")),e.removeAttribute("role")}window.customElements.get("poll-include-fragment")||(window.PollIncludeFragmentElement=PollIncludeFragmentElement,window.customElements.define("poll-include-fragment",PollIncludeFragmentElement)),navigator.userAgent.match(/Firefox/)&&(Qe('details-menu label[tabindex][role^="menuitem"]',e=>{const t=e.querySelector("input");if(!t)return;const n=e.classList.contains("select-menu-item"),s=t.classList.contains("d-none"),o=n||s||t.hidden;n&&t.classList.add("d-block"),s&&t.classList.remove("d-none"),o&&(t.classList.add("sr-only"),t.hidden=!1),e.removeAttribute("tabindex")}),et("focus",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{const t=o(e.currentTarget,"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}),s("keydown",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',(async function(e){if(wt(e))e.currentTarget instanceof Element&&function(e){const t=o(e,"label");t.hasAttribute("data-role")||t.setAttribute("data-role",i(t,"role"));e.setAttribute("role",i(t,"data-role")),t.removeAttribute("role")}(e.currentTarget);else if("Enter"===e.key){const t=e.currentTarget;e.preventDefault(),await r(),t instanceof HTMLInputElement&&t.click()}})),et("blur",'details-menu label input[role="menuitemradio"], details-menu label input[role="menuitemcheckbox"]',e=>{Lt(e.currentTarget)},{capture:!0}),s("keyup",'details-menu label[role="menuitemradio"] input, details-menu label[role="menuitemcheckbox"] input',e=>{wt(e)&&e.currentTarget instanceof Element&&Lt(e.currentTarget)}));function yt(e){return e.toUpperCase()===e}function Et(e,t,n,s){for(var o=e.length,r=t.length,i=e.toLowerCase(),a=t.toLowerCase(),c=function(e){for(var t,n=e.length,s=new Array(n),o="/",r=0;r<n;r++){var i=e[r];"/"===o?s[r]=.9:"-"===o||"_"===o||" "===o?s[r]=.8:"."===o?s[r]=.6:(t=o).toLowerCase()===t&&yt(i)?s[r]=.7:s[r]=0,o=i}return s}(t),l=0;l<o;l++){n[l]=new Array(r),s[l]=new Array(r);for(var u=-1/0,d=l===o-1?-.005:-.01,m=0;m<r;m++)if(i[l]===a[m]){var f=-1/0;l?m&&(f=Math.max(s[l-1][m-1]+c[m],n[l-1][m-1]+1)):f=-.005*m+c[m],n[l][m]=f,s[l][m]=u=Math.max(f,u+d)}else n[l][m]=-1/0,s[l][m]=u+=d}}function Tt(e,t){e=e.toLowerCase(),t=t.toLowerCase();for(var n=e.length,s=0,o=0;s<n;s+=1)if(0===(o=t.indexOf(e[s],o)+1))return!1;return!0}const kt=(e,t,n)=>{if(!Tt(e,t))return-1/0;const s=function(e,t){var n=e.length,s=t.length;if(!n||!s)return-1/0;if(n===s)return 1/0;if(s>1024)return-1/0;var o=new Array(n),r=new Array(n);return Et(e,t,o,r),r[n-1][s-1]}(e,t);return s<n?-1/0:s},Mt=(e,t,n)=>{e.innerHTML="";let s=0;for(const o of function(e,t){var n=e.length,s=t.length,o=new Array(n);if(!n||!s)return o;if(n===s){for(var r=0;r<n;r++)o[r]=r;return o}if(s>1024)return o;var i=new Array(n),a=new Array(n);Et(e,t,i,a);for(var c=!1,l=(r=n-1,s-1);r>=0;r--)for(;l>=0;l--)if(i[r][l]!==-1/0&&(c||i[r][l]===a[r][l])){c=r&&l&&a[r][l]===i[r-1][l-1]+1,o[r]=l--;break}return o}(t,n)){""!==n.slice(s,o)&&e.appendChild(document.createTextNode(n.slice(s,o))),s=o+1;const t=document.createElement("mark");t.textContent=n[o],e.appendChild(t)}e.appendChild(document.createTextNode(n.slice(s)))},St=new WeakMap,Ht=new WeakMap,xt=new WeakMap,At=e=>{if(!xt.has(e)&&e instanceof HTMLElement){const t=(e.getAttribute("data-value")||e.textContent||"").trim();return xt.set(e,t),t}return xt.get(e)||""};class FuzzyListElement extends HTMLElement{connectedCallback(){const e=this.querySelector("ul");if(!e)return;const t=new Set(e.querySelectorAll("li")),n=this.querySelector("input");n instanceof HTMLInputElement&&n.addEventListener("input",()=>{this.value=n.value});const s=new MutationObserver(e=>{let n=!1;for(const s of e)if("childList"===s.type&&s.addedNodes.length)for(const e of s.addedNodes)if(e instanceof HTMLLIElement&&!t.has(e)){const s=At(e);n=n||Tt(this.value,s),t.add(e)}n&&this.sort()});s.observe(e,{childList:!0});const o={handler:s,items:t,lazyItems:new Map,timer:null};Ht.set(this,o)}disconnectedCallback(){const e=Ht.get(this);e&&(e.handler.disconnect(),Ht.delete(this))}addLazyItems(e,t){const n=Ht.get(this);if(!n)return;const{lazyItems:s}=n,{value:o}=this;let r=!1;for(const i of e)s.set(i,t),r=r||o&&Tt(o,i);r&&this.sort()}sort(){const e=St.get(this);e&&(e.aborted=!0);const t={aborted:!1};St.set(this,t);const{minScore:n,markSelector:s,maxMatches:o,value:r}=this,i=Ht.get(this);if(!i)return;if(!this.dispatchEvent(new CustomEvent("fuzzy-list-will-sort",{cancelable:!0,detail:r})))return;const{items:a,lazyItems:c}=i,l=this.hasAttribute("mark-selector"),u=this.querySelector("ul");if(!u)return;const d=[];if(r){for(const e of a){const t=At(e),s=kt(r,t,n);s!==-1/0&&d.push({item:e,score:s})}for(const[e,t]of c){const s=kt(r,e,n);s!==-1/0&&d.push({text:e,render:t,score:s})}d.sort((e,t)=>t.score-e.score).splice(o)}else{let e=d.length;for(const t of a){if(e>=o)break;d.push({item:t,score:1}),e+=1}for(const[t,n]of c){if(e>=o)break;d.push({text:t,render:n,score:1}),e+=1}}requestAnimationFrame(()=>{if(t.aborted)return;const e=u.querySelector('input[type="radio"]:checked');u.innerHTML="";let n=0;const o=()=>{if(t.aborted)return;const i=Math.min(d.length,n+100),m=document.createDocumentFragment();for(let e=n;e<i;e+=1){const t=d[e];let n=null;if(t.render&&t.text){const{render:e,text:s}=t;n=e(s),a.add(n),xt.set(n,s),c.delete(s)}else t.item&&(n=t.item);n instanceof HTMLElement&&(l&&Mt(s&&n.querySelector(s)||n,l?r:"",At(n)),m.appendChild(n))}n=i;let f=!1;if(e instanceof HTMLInputElement)for(const t of m.querySelectorAll('input[type="radio"]:checked'))t instanceof HTMLInputElement&&t.value!==e.value&&(t.checked=!1,f=!0);if(u.appendChild(m),e&&f&&e.dispatchEvent(new Event("change",{bubbles:!0})),i<d.length)requestAnimationFrame(o);else{u.hidden=0===d.length;const e=this.querySelector("[data-fuzzy-list-show-on-empty]");e&&(e.hidden=d.length>0),this.dispatchEvent(new CustomEvent("fuzzy-list-sorted",{detail:d.length}))}};o()})}get value(){return this.getAttribute("value")||""}set value(e){this.setAttribute("value",e)}get markSelector(){return this.getAttribute("mark-selector")||""}set markSelector(e){e?this.setAttribute("mark-selector",!0===e?"":e):this.removeAttribute("mark-selector")}get minScore(){return Number(this.getAttribute("min-score")||0)}set minScore(e){Number.isNaN(e)||this.setAttribute("min-score",String(e))}get maxMatches(){return Number(this.getAttribute("max-matches")||1/0)}set maxMatches(e){Number.isNaN(e)||this.setAttribute("max-matches",String(e))}static get observedAttributes(){return["value","mark-selector","min-score","max-matches"]}attributeChangedCallback(e,t,n){if(t===n)return;const s=Ht.get(this);s&&(s.timer&&window.clearTimeout(s.timer),s.timer=window.setTimeout(()=>this.sort(),100))}}function qt(){const e=l(document,"input[type=text].js-advanced-search-prefix",HTMLInputElement),t=l(document,"select.js-advanced-search-prefix",HTMLSelectElement),n=l(document,".js-advanced-search-prefix:checked",HTMLInputElement),s=[...It(e),...It(t),...It(n)],o=s.reduce((e,t)=>(t.value&&t.type&&e[t.type]++,e),{Repositories:0,Users:0,Code:0,Issues:0}),r=s.reduce((e,t)=>`${e} ${function({prefix:e,value:t}){return""===e?"":t?`${e}${t}`:""}(t)}`.trim(),""),i=u(document,".js-advanced-search-input",HTMLInputElement).value;u(document,".js-type-value",HTMLInputElement).value=function(e){let t=new URLSearchParams(window.location.search).get("type")||"Repositories",n=0;for(const s in e)e[s]>n&&(n=e[s],t=s);return t}(o),u(document,".js-search-query",HTMLInputElement).value=`${i} ${r}`.trim();const a=u(document,".js-advanced-query");a.innerHTML="",a.textContent=r;const c=document.createElement("span");c.textContent=i.trim(),a.prepend(c," ")}function Ct(e){return-1!==e.search(/\s/g)?`"${e}"`:e}function It(e){return e.map(e=>{const t=e.value.trim(),n=i(e,"data-search-prefix"),s=e.getAttribute("data-search-type");return""===n?{prefix:n,value:t,type:s}:-1!==t.search(/,/g)&&"location"!==n?t.split(/,/).map(e=>({prefix:n,value:Ct(e.trim()),type:s})):{prefix:n,value:Ct(t),type:s}}).flatMap(e=>e)}function _t(e,t){const n=e.querySelector(".js-app-logo-with-bgcolor");n instanceof HTMLElement&&(n.style.backgroundColor=`#${t}`)}function $t(){return l(document,".js-selected-repository-field",HTMLInputElement)}function Nt(){const e=u(document,"#repository-menu-list"),t=Array.from($t()).map(e=>e.value);let n=!1;for(const o of l(e,"[role=menuitem]",HTMLButtonElement)){const e=t.includes(o.value);n||e||(n=!0),o.hidden=e}const s=e.querySelector(".js-no-repository-found");s instanceof HTMLElement&&(s.hidden=n)}function Dt(){const e=!u(document,".js-select-repositories-radio",HTMLInputElement).checked||$t().length>0,t=document.querySelector(".js-integrations-install-form-submit");t&&t instanceof HTMLButtonElement&&(t.disabled=!e)}function Pt(){const e=$t().length,t=u(document,".js-integration-total-repos");t.hidden=0===e,t.textContent=`Selected ${e} ${1===e?"repository":"repositories"}.`}function Rt(e,t){e.style.visibility=t?"hidden":"";const n=i(e,"data-tab-item");u(document,`[data-menu-item=${n}]`).hidden=!t}function Ft(e,t){let n=!1;const s=u(e,".js-responsive-underlinenav-overflow");for(const o of t){const t=f(o,e);t&&(n=e.offsetWidth-(t.left+o.offsetWidth)<=s.offsetWidth,Rt(o,n))}s.style.visibility=n?"":"hidden"}window.customElements.get("fuzzy-list")||(window.FuzzyListElement=FuzzyListElement,window.customElements.define("fuzzy-list",FuzzyListElement)),a(".js-advanced-search-prefix",(function(){qt()})),et("change",".js-advanced-search-prefix",qt),c(".js-advanced-search-input",(function(e){const t=o(e,".js-advanced-search-label");t.classList.add("focus"),e.addEventListener("blur",()=>t.classList.remove("focus"),{once:!0})})),Qe(".js-advanced-search-input",(function(){qt()})),d(".js-app-bgcolor-form",(async function(e,t){const n=e.querySelector(".js-app-bgcolor-save-notice");if(!n)return;let s;try{s=await t.html()}catch(o){n.classList.remove("visible")}s&&(n.classList.add("visible"),setTimeout(()=>n.classList.remove("visible"),1500))})),a(".js-app-bgcolor-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))return;const n=o(t,"form",HTMLFormElement),s=t.value.replace(/^#/,"");if(s.length<1)return t.classList.remove("text-red"),void _t(n,t.defaultValue);t.checkValidity()?(t.classList.remove("text-red"),_t(n,s),n.classList.contains("js-app-bgcolor-form")&&tt(()=>function(e,t){t.checkValidity()&&m(e)}(n,t),400)()):(t.classList.add("text-red"),_t(n,t.defaultValue))})),Qe(".js-apps-install-select-repositories-container remote-input",e=>{e.addEventListener("remote-input-success",Nt),e.addEventListener("remote-input-error",Nt)}),et("details-menu-selected",".js-apps-install-select-repositories-menu",(function(e){const t=e.detail.relatedTarget,n=u(document,".js-integrations-install-repo-picked"),s=u(t,"template",HTMLTemplateElement).content.cloneNode(!0);n.prepend(s),u(document,".js-min-repository-error").hidden=!0,u(document,".js-max-repository-warning").hidden=!function(){const e=document.querySelector(".js-integrations-install-form");if(e instanceof HTMLFormElement){const t=+(e.getAttribute("data-max-repos")||0);return t>0&&$t().length>=t}}(),Pt(),Dt(),Nt()}),{capture:!0}),et("change",".js-integrations-install-form",Dt),et("click",".js-repository-picker-remove",(function(e){o(e.currentTarget,".js-repository-picker-result").remove(),u(document,".js-min-repository-error").hidden=$t().length>0,Pt(),Dt(),Nt()})),et("change",".js-installation-repositories-radio",(function(){const e=u(document,".js-select-repositories-radio",HTMLInputElement);u(document,".js-integrations-install-repo-selection").classList.toggle("has-removed-contents",!e.checked)})),Qe(".js-responsive-underlinenav",{constructor:HTMLElement,initialize(e){const t=l(e,".js-responsive-underlinenav-item");Ft(e,t),window.addEventListener("resize",(function(){Ft(e,t)}),{passive:!0})}}),et("deprecatedAjaxSend","[data-remote]",(function(e){e.currentTarget===e.target&&(e.defaultPrevented||e.currentTarget.classList.add("loading"))})),et("deprecatedAjaxComplete","[data-remote]",(function(e){e.currentTarget===e.target&&e.currentTarget.classList.remove("loading")})),d("form.js-ajax-pagination, .js-ajax-pagination form",(async function(e,t){const n=o(e,".js-ajax-pagination");let s;try{s=await t.html()}catch(r){if(r.response&&404===r.response.status)return void n.remove();throw r}n.replaceWith(s.html),nt(e,"page:loaded")}));let Bt=null;function Ot(e){Ut(function(e){return(e.getAttribute("aria-label")||e.innerText||"").trim()}(e))}function Ut(e){Bt&&(Bt.textContent="",Bt.textContent=e)}!async function(){await p,Bt=document.createElement("div"),Bt.setAttribute("aria-live","polite"),Bt.classList.add("sr-only"),document.body.append(Bt)}();const zt=["input[pattern]","input[required]","textarea[required]","input[data-required-change]","textarea[data-required-change]"].join(",");c(zt,e=>{let t=e.checkValidity();function n(){const n=e.checkValidity();n!==t&&e.form&&Vt(e.form),t=n}e.addEventListener("input",n),e.addEventListener("blur",(function t(){e.removeEventListener("input",n),e.removeEventListener("blur",t)}))});const Wt=new WeakMap;function Vt(e){const t=e.checkValidity();for(const n of l(e,"button[data-disable-invalid]",HTMLButtonElement))n.disabled=!t}Qe("button[data-disable-invalid]",{constructor:HTMLButtonElement,initialize(e){const t=e.form;t&&(!function(e){Wt.get(e)||(e.addEventListener("change",()=>Vt(e)),Wt.set(e,!0))}(t),e.disabled=!t.checkValidity())}}),Qe("input[data-required-change], textarea[data-required-change]",(function(e){const t="radio"===e.type&&e.form?g(e.form,e.name,RadioNodeList).value:null;function n(n){const s=e.form;if(n&&"radio"===e.type&&s&&t)for(const o of g(s,e.name,RadioNodeList))o instanceof HTMLInputElement&&o.setCustomValidity(e.value===t?"unchanged":"");else e.setCustomValidity(e.value===(t||e.defaultValue)?"unchanged":"")}e.addEventListener("input",n),e.addEventListener("change",n),n(),e.form&&Vt(e.form)})),document.addEventListener("reset",(function(e){if(e.target instanceof HTMLFormElement){const t=e.target;setTimeout(()=>Vt(t))}}));const Jt=new WeakMap;function Kt(e,t){var n,s,o;t.classList.remove("is-loading","successed","errored","warn"),e.classList.remove("is-autocheck-loading","is-autocheck-successful","is-autocheck-errored");const r=t.querySelector("p.note");if(r){const e=Jt.get(r);e&&(r.innerHTML=e)}null===(n=t.querySelector("dd.error"))||void 0===n||n.remove(),null===(s=t.querySelector("dd.warning"))||void 0===s||s.remove(),null===(o=t.querySelector("dd.success"))||void 0===o||o.remove()}function Gt(e){const t=e.closest("form");if(!t)return;const n=t.querySelector(".js-auto-complete-button");n instanceof HTMLButtonElement&&(n.disabled=!e.value)}Qe("auto-check",(function(e){const t=u(e,"input",HTMLInputElement),n=t.closest("dl.form-group")||e,s=t.form;let o;function r(){return o||(o=`input-check-${(1e4*Math.random()).toFixed(0)}`),o}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=r()),Jt.set(a,a.innerHTML)),e.addEventListener("loadstart",()=>{Kt(t,n),n.classList.add("is-loading"),t.classList.add("is-autocheck-loading"),Vt(s)}),e.addEventListener("loadend",()=>{n.classList.remove("is-loading"),t.classList.remove("is-autocheck-loading")}),t.addEventListener("auto-check-success",async e=>{t.classList.add("is-autocheck-successful"),n.classList.add("successed"),Vt(s);const{response:o}=e.detail;if(!o)return;const i=await o.text();if(i)if(a instanceof HTMLElement)a.innerHTML=i,Ot(a);else{const e=200===o.status,s=document.createElement("dd");s.id=r(),s.classList.add(e?"success":"warning"),s.innerHTML=i,n.append(s),n.classList.add(e?"successed":"warn"),Ot(s),e&&(s.hidden=document.activeElement!==t)}}),t.addEventListener("auto-check-error",async e=>{t.classList.add("is-autocheck-errored"),n.classList.add("errored"),Vt(s);const{response:o}=e.detail;if(!o)return;const i=await o.text();if(a instanceof HTMLElement)a.innerHTML=i||"Something went wrong",Ot(a);else{const e=document.createElement("dd");e.id=r(),e.classList.add("error"),e.innerHTML=i||"Something went wrong",n.append(e),Ot(e)}}),t.addEventListener("input",()=>{t.removeAttribute("aria-describedby"),t.value||Kt(t,n)}),t.addEventListener("blur",()=>{const e=n.querySelector("dd.success");e&&(e.hidden=!0)}),t.addEventListener("focus",()=>{const e=n.querySelector("dd.success");e&&(e.hidden=!1)}),s.addEventListener("reset",()=>{Kt(t,n)})})),Qe("auto-complete",(function(e){e.addEventListener("loadstart",()=>e.classList.add("is-auto-complete-loading")),e.addEventListener("loadend",()=>e.classList.remove("is-auto-complete-loading"))})),Qe("auto-complete",{constructor:st,initialize:Gt}),et("auto-complete-change","auto-complete",(function(e){Gt(e.currentTarget)}));const Xt=new b;function Yt(e){const t=e.target;if(!(t instanceof HTMLInputElement||t instanceof HTMLSelectElement))return;const n=t.form;m(n)}d("[data-autosearch-results-container]",(async function(e,t){e.classList.add("is-sending");try{const n=await Xt.push(t.html()),s=e.getAttribute("data-autosearch-results-container"),o=s?document.getElementById(s):null;o&&(o.innerHTML="",o.appendChild(n.html)),h(null,"",`?${v(e)}`)}finally{e.classList.remove("is-sending")}})),c("input[data-autoselect], textarea[data-autoselect]",(async function(e){await r(),e.select()})),et("change","form[data-autosubmit]",(function(e){const t=e.currentTarget;m(t)})),et("change","input[data-autosubmit], select[data-autosubmit]",Yt);const Qt=tt(Yt,300);function Zt(e){e.preventDefault(),e.stopPropagation()}Qe("input[data-throttled-autosubmit]",{subscribe:e=>j(e,"input",Qt)}),Qe("a.btn.disabled",{subscribe:e=>j(e,"click",Zt)}),(async()=>{await w;const e=function(e){try{return JSON.parse(window.localStorage.getItem(e)||"{}")}catch(t){return{}}}("bundle-urls")||{},t=function(){const e={};for(const t of document.getElementsByTagName("script")){const n=t.src.match(/\/([\w-]+)-[0-9a-f]{32,}\.js$/);n&&(e[`${n[1]}.js`]=t.src)}for(const t of document.getElementsByTagName("link")){const n=t.href.match(/\/([\w-]+)-[0-9a-f]{32,}\.css$/);n&&(e[`${n[1]}.css`]=t.href)}return e}();!function(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch(n){}}("bundle-urls",t);const n=Object.keys(t).filter(n=>{const s=t[n];return e[n]!==s});n.length&&L({downloadedBundles:n})})(),Qe(".js-check-all-container",{subscribe:function(e){let t=!1,n=null;function s(e,t,n,s=!1){t instanceof HTMLInputElement&&(t.indeterminate=s,t.checked!==n&&(t.checked=n,setTimeout(()=>{const n=new CustomEvent("change",{bubbles:!0,cancelable:!1,detail:{relatedTarget:e}});t.dispatchEvent(n)})))}function o(o){const r=o.target;r instanceof Element&&(r.hasAttribute("data-check-all")?function(t){if(t instanceof CustomEvent&&t.detail){const{relatedTarget:e}=t.detail;if(e&&e.hasAttribute("data-check-all-item"))return}const o=t.target;if(!(o instanceof HTMLInputElement))return;n=null;for(const n of e.querySelectorAll("[data-check-all-item]"))s(o,n,o.checked);o.indeterminate=!1,i()}(o):r.hasAttribute("data-check-all-item")&&function(o){if(o instanceof CustomEvent&&o.detail){const{relatedTarget:e}=o.detail;if(e&&(e.hasAttribute("data-check-all")||e.hasAttribute("data-check-all-item")))return}const r=o.target;if(!(r instanceof HTMLInputElement))return;const a=Array.from(e.querySelectorAll("[data-check-all-item]"));if(t&&n){const[e,t]=[a.indexOf(n),a.indexOf(r)].sort();for(const n of a.slice(e,+t+1||9e9))s(r,n,r.checked)}t=!1,n=r;const c=e.querySelector("[data-check-all]");if(c){const e=a.length,t=a.filter(e=>e instanceof HTMLInputElement&&e.checked).length;s(r,c,t===e,e>t&&t>0)}i()}(o))}function r(e){e.target instanceof Element&&e.target.hasAttribute("data-check-all-item")&&(t=e.shiftKey)}function i(){const t=e.querySelector("[data-check-all-count]");if(t){const n=e.querySelectorAll("[data-check-all-item]:checked").length;t.textContent=n.toString()}}return e.addEventListener("mousedown",r),e.addEventListener("change",o),{unsubscribe:()=>{e.removeEventListener("mousedown",r),e.removeEventListener("change",o)}}}});function en(e){const t=e.querySelector(".js-clipboard-clippy-icon"),n=e.querySelector(".js-clipboard-check-icon");e.classList.toggle("ClipboardButton--success"),t&&t.classList.toggle("d-none"),n&&n.classList.toggle("d-none")}function tn(e,t){const n=e.closest(".js-write-bucket");n&&n.classList.toggle("focused",t)}function nn(e){const t=e.currentTarget;t instanceof Element&&tn(t,!1)}function sn(e){const t=o(e,".js-previewable-comment-form"),n=e.classList.contains("js-preview-tab");if(n){const e=u(t,".js-write-bucket");u(t,".js-preview-body").style.minHeight=`${e.clientHeight}px`}t.classList.toggle("preview-selected",n),t.classList.toggle("write-selected",!n);const s=u(t,'.tabnav-tab.selected, .tabnav-tab[aria-selected="true"]');s.setAttribute("aria-selected","false"),s.classList.remove("selected"),e.classList.add("selected"),e.setAttribute("aria-selected","true");const r=u(t,".js-write-tab");return n?r.setAttribute("data-hotkey","Control+P,Meta+Shift+p"):r.removeAttribute("data-hotkey"),t}et("clipboard-copy","[data-copy-feedback]",e=>{const t=e.currentTarget,n=i(t,"data-copy-feedback"),s=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&&(Ot(t),setTimeout(()=>{s?t.setAttribute("aria-label",s):t.removeAttribute("aria-label"),t.classList.remove("tooltipped",`tooltipped-${o}`)},2e3))}),et("clipboard-copy",".js-clipboard-copy",(function({currentTarget:e}){e instanceof HTMLElement&&(en(e),setTimeout(en,2e3,e))})),d(".js-new-comment-form",(async function(e,t){let n;!function(e){const t=e.querySelector(".js-comment-form-error");t instanceof HTMLElement&&(t.hidden=!0)}(e);try{n=await t.json()}catch(r){!function(e,t){let n="You can't comment at this time";if(t.response&&422===t.response.status){const e=t.response.json;e.errors&&(n+=` — your comment ${e.errors.join(", ")}`)}n+=". ";const s=e.querySelector(".js-comment-form-error");s instanceof HTMLElement&&(s.textContent=n,s.hidden=!1)}(e,r)}if(!n)return;e.reset();for(const i of l(e,".js-resettable-field",HTMLInputElement))y(i,i.getAttribute("data-reset-value")||"");const s=e.querySelector(".js-write-tab");s instanceof HTMLElement&&s.click();const o=n.json.updateContent;for(const i in o){const e=o[i],t=document.querySelector(i);t instanceof HTMLElement?E(t,e):console.warn(`couldn't find ${i} for immediate update`)}})),Qe(".js-comment-and-button",{constructor:HTMLButtonElement,initialize(e){const t=u(e.form,".js-comment-field"),n=e.querySelector(".js-form-action-text"),s=n||e,o=s.textContent;let r=!1;function a(t){const n=t.currentTarget.value.trim();n!==r&&(r=n,s.textContent=n?i(e,"data-comment-text"):o)}return{add(){t.addEventListener("input",a),t.addEventListener("change",a)},remove(){t.removeEventListener("input",a),t.removeEventListener("change",a)}}}}),et("click",".js-comment-edit-button",(function(e){const t=o(e.currentTarget,".js-comment");t.classList.add("is-comment-editing"),u(t,".js-write-tab").click();const n=u(t,".js-comment-field");n.focus(),nt(n,"change");const s=e.currentTarget.closest(".js-dropdown-details");s&&s.removeAttribute("open")})),et("click",".js-comment-hide-button",(function(e){const t=o(e.currentTarget,".js-comment").querySelector(".js-minimize-comment");t&&t.classList.remove("d-none");const n=e.currentTarget.closest(".js-dropdown-details");n&&n.removeAttribute("open")})),et("click",".js-comment-hide-minimize-form",(function(e){o(e.currentTarget,".js-minimize-comment").classList.add("d-none")})),et("click",".js-comment-cancel-button",(function(e){const t=o(e.currentTarget,"form",HTMLFormElement),n=i(e.currentTarget,"data-confirm-text");if(T(t)&&!confirm(n))return!1;for(const o of t.querySelectorAll("input, textarea")){const e=o;e.value=e.defaultValue}const s=e.currentTarget.closest(".js-comment");s&&s.classList.remove("is-comment-editing")})),d(".js-comment-delete, .js-comment .js-comment-update, .js-issue-update, .js-comment-minimize, .js-comment-unminimize",(function(e,t,n){const s=o(e,".js-comment");s.classList.add("is-comment-loading");const r=s.getAttribute("data-body-version");r&&n.headers.set("X-Body-Version",r)})),d(".js-comment .js-comment-update",(async function(e,t){let n;const s=o(e,".js-comment"),r=s.querySelector(".js-comment-update-error");r instanceof HTMLElement&&(r.hidden=!0);try{n=await t.json()}catch(u){if(422!==u.response.status)throw u;{const e=JSON.parse(u.response.text);if(e.errors)return void(r instanceof HTMLElement&&(r.textContent=`There was an error posting your comment: ${e.errors.join(", ")}`,r.hidden=!1))}}if(!n)return;const i=n.json,a=s.querySelector(".js-comment-body");a&&i.body&&(a.innerHTML=i.body),s.setAttribute("data-body-version",i.newBodyVersion);const c=s.querySelector(".js-body-version");c instanceof HTMLInputElement&&(c.value=i.newBodyVersion);for(const o of s.querySelectorAll("input, textarea")){const e=o;e.defaultValue=e.value}s.classList.remove("is-comment-stale","is-comment-editing");const l=s.querySelector(".js-comment-edit-history");if(l){const e=await k(document,i.editUrl);l.innerHTML="",l.append(e)}})),d(".js-comment .js-comment-delete, .js-comment .js-comment-update, .js-comment-minimize, .js-comment-unminimize",(async function(e,t){const n=o(e,".js-comment");try{await t.text()}catch(s){if(422!==s.response.status)throw s;{let e;try{e=JSON.parse(s.response.text)}catch(r){}e&&e.stale&&n.classList.add("is-comment-stale")}}n.classList.remove("is-comment-loading")})),d(".js-discussion-comment-unminimize, .js-discussion-comment-minimize",(async function(e,t){const n=o(e,".js-discussion-comment"),s=n.querySelector(".js-discussion-comment-error");s&&(s.hidden=!0);try{const e=await t.html();n.replaceWith(e.html)}catch(r){if(!(r.response.status>=400&&r.response.status<500))throw r;if(r.response.html){const e=i(u(r.response.html,".js-discussion-comment"),"data-error");s instanceof HTMLElement&&(s.textContent=e,s.hidden=!1)}}})),d(".js-comment-delete",(async function(e,t){await t.json();let n=e.closest(".js-comment-delete-container");n||(n=e.closest(".js-comment-container")||e.closest(".js-line-comments"),n&&1!==n.querySelectorAll(".js-comment").length&&(n=o(e,".js-comment"))),n.remove()})),d(".js-issue-update",(async function(e,t){const n=o(e,".js-details-container");n.classList.remove("open");const s=(await t.json()).json;if(null!=s.issue_title){u(n,".js-issue-title").textContent=s.issue_title;const e=n.closest(".js-issues-results");if(e){if(e.querySelector(".js-merge-pr.is-merging")){const t=e.querySelector(".js-merge-pull-request textarea");t instanceof HTMLTextAreaElement&&t.value===t.defaultValue&&(t.value=t.defaultValue=s.issue_title)}else if(e.querySelector(".js-merge-pr.is-squashing")){const t=e.querySelector(".js-merge-pull-request .js-merge-title");t instanceof HTMLInputElement&&t.value===t.defaultValue&&(t.value=t.defaultValue=s.default_squash_commit_title)}const t=e.querySelector("button[value=merge]");t&&t.setAttribute("data-input-message-value",s.issue_title);const n=e.querySelector("button[value=squash]");n&&n.setAttribute("data-input-title-value",s.default_squash_commit_title)}}document.title=s.page_title;for(const o of e.elements)(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement)&&(o.defaultValue=o.value)})),d(".js-comment-minimize",(async function(e,t){await t.json();const n=o(e,".js-comment").querySelector(".js-minimize-comment");n&&n.classList.add("d-none");const s=o(e,".unminimized-comment");s.classList.add("d-none"),s.classList.remove("js-comment");const r=o(e,".js-minimizable-comment-group").querySelector(".minimized-comment");r&&r.classList.remove("d-none"),r&&r.classList.add("js-comment")})),d(".js-comment-unminimize",(async function(e,t){await t.json();const n=o(e,".js-minimizable-comment-group"),s=n.querySelector(".unminimized-comment");s&&s.classList.remove("d-none"),s&&s.classList.add("js-comment");const r=n.querySelector(".minimized-comment");r&&r.classList.add("d-none"),r&&r.classList.remove("js-comment")})),et("details-menu-select",".js-comment-edit-history-menu",e=>{const t=e.detail.relatedTarget.getAttribute("data-edit-history-url");if(!t)return;e.preventDefault();const n=k(document,t);M({content:n,dialogClass:"Box-overlay--wide"})},{capture:!0}),c(".js-comment-field",(function(e){tn(e,!0),e.addEventListener("blur",nn,{once:!0})})),et("click",".js-write-tab",(function(e){const t=e.currentTarget,n=o(t,".js-previewable-comment-form");if(n instanceof ot)return void setTimeout(()=>{u(n,".js-comment-field").focus()});const s=sn(t);setTimeout(()=>{u(s,".js-comment-field").focus()});const r=n.querySelector("markdown-toolbar");r instanceof HTMLElement&&(r.hidden=!1)})),et("click",".js-preview-tab",(function(e){const t=e.currentTarget,n=o(t,".js-previewable-comment-form");if(n instanceof ot)return;const s=sn(t);setTimeout(()=>{ln(s)});const r=n.querySelector("markdown-toolbar");r instanceof HTMLElement&&(r.hidden=!0),e.stopPropagation(),e.preventDefault()})),et("tab-container-change",".js-previewable-comment-form",(function(e){const t=e.detail.relatedTarget.classList.contains("js-preview-panel"),n=e.currentTarget,s=u(n,".js-write-tab");if(t){const e=u(n,".js-write-bucket");u(n,".js-preview-body").style.minHeight=`${e.clientHeight}px`,s.setAttribute("data-hotkey","Control+P,Meta+Shift+p"),ln(n);const t=n.querySelector("markdown-toolbar");t instanceof HTMLElement&&(t.hidden=!0)}else{s.removeAttribute("data-hotkey");const e=n.querySelector("markdown-toolbar");e instanceof HTMLElement&&(e.hidden=!1)}n.classList.toggle("preview-selected",t),n.classList.toggle("write-selected",!t)})),et("preview:render",".js-previewable-comment-form",(function(e){const t=sn(u(e.target,".js-preview-tab"));setTimeout(()=>{ln(t);const e=t.querySelector("markdown-toolbar");e instanceof HTMLElement&&(e.hidden=!0)})}));const on=new b;function rn(e){var t,n,s,r,i,a,c,l,d;const m=u(e,".js-comment-field",HTMLTextAreaElement).value,f=null===(t=e.querySelector(".js-path"))||void 0===t?void 0:t.value,p=null===(n=e.querySelector(".js-line-number"))||void 0===n?void 0:n.value,g=null===(s=e.querySelector(".js-start-line-number"))||void 0===s?void 0:s.value,h=null===(r=e.querySelector(".js-side"))||void 0===r?void 0:r.value,v=null===(i=e.querySelector(".js-start-side"))||void 0===i?void 0:i.value,b=null===(a=e.querySelector(".js-start-commit-oid"))||void 0===a?void 0:a.value,j=null===(c=e.querySelector(".js-end-commit-oid"))||void 0===c?void 0:c.value,w=null===(l=e.querySelector(".js-base-commit-oid"))||void 0===l?void 0:l.value,L=null===(d=e.querySelector(".js-comment-id"))||void 0===d?void 0:d.value,y=new FormData;return y.append("text",m),y.append("authenticity_token",function(e){const t=e.querySelector(".js-data-preview-url-csrf"),n=o(e,"form",HTMLFormElement).elements.namedItem("authenticity_token");if(t instanceof HTMLInputElement)return t.value;if(n instanceof HTMLInputElement)return n.value;throw new Error("Comment preview authenticity token not found")}(e)),f&&y.append("path",f),p&&y.append("line_number",p),g&&y.append("start_line_number",g),h&&y.append("side",h),v&&y.append("start_side",v),b&&y.append("start_commit_oid",b),j&&y.append("end_commit_oid",j),w&&y.append("base_commit_oid",w),L&&y.append("comment_id",L),y}async function an(e){const t=i(e,"data-preview-url"),n=rn(e);return nt(e,"preview:setup",{data:n}),on.push(cn(t,n))}const cn=S((function(e,t){return H(e,{method:"post",body:t})}),(function(e,t){const n="entries"in t?[...t.entries()].toString():Math.random().toString();return`${e}:${n}`}));async function ln(e){const t=u(e,".comment-body");t.innerHTML="<p>Loading preview…</p>";try{const n=await an(e);t.innerHTML=n||"<p>Nothing to preview</p>"}catch(n){t.innerHTML="<p>Error rendering preview</p>"}}Qe(".js-preview-tab",(function(e){e.addEventListener("mouseenter",async()=>{const t=o(e,".js-previewable-comment-form");try{await an(t)}catch(n){}})})),s("keydown",".js-comment-field",(function(e){const t=e.target;if((e.ctrlKey||e.metaKey)&&e.shiftKey&&"P"===e.key.toUpperCase()){const n=o(t,".js-previewable-comment-form");n.classList.contains("write-selected")&&(n instanceof ot?u(n,".js-preview-tab").click():(t.blur(),n.dispatchEvent(new CustomEvent("preview:render",{bubbles:!0,cancelable:!1}))),e.preventDefault(),e.stopImmediatePropagation())}}));const un=/^(\+1|-1|:\+1?|:-1?)$/;function dn(e){const t=e.target,n=t.value,s=o(t,".js-reaction-suggestion");if(s)if((e=>{let t=!1;for(const n of e.split("\n")){const e=n.trim();if(e&&!e.startsWith(">")){if(t&&!1===un.test(e))return!1;!t&&un.test(e)&&(t=!0)}}return t})(n)){s.classList.remove("hide-reaction-suggestion"),s.classList.add("reaction-suggestion");const e=i(s,"data-reaction-markup");s.setAttribute("data-reaction-suggestion-message",e)}else mn(s)}function mn(e){e.classList.remove("reaction-suggestion"),e.classList.add("hide-reaction-suggestion"),e.removeAttribute("data-reaction-suggestion-message")}async function fn({currentTarget:e}){const t=e,n=t.hasAttribute("open");nt(t,n?"menu:activate":"menu:deactivate"),await r(),nt(t,n?"menu:activated":"menu:deactivated")}et("focusout","#new_comment_field",(function(e){const t=e.currentTarget;mn(o(t,".js-reaction-suggestion"))})),et("focusin","#new_comment_field",(function(e){dn(e)})),s("keyup","#new_comment_field",(function(e){dn(e)})),Qe("details.select-menu details-menu include-fragment",(function(e){const t=e.closest("details");t&&(e.addEventListener("loadstart",(function(){t.classList.add("is-loading"),t.classList.remove("has-error")})),e.addEventListener("error",(function(){t.classList.add("has-error")})),e.addEventListener("loadend",(function(){t.classList.remove("is-loading");const e=t.querySelector(".js-filterable-field");e&&nt(e,"filterable:change")})))})),Qe("details details-menu .js-filterable-field",{constructor:HTMLInputElement,add(e){const t=o(e,"details");t.addEventListener("toggle",(function(){t.hasAttribute("open")||(e.value="",nt(e,"filterable:change"))}))}}),Qe("details-menu[role=menu] [role=menu]",e=>{const t=e.closest("details-menu[role]");t&&t!==e&&t.removeAttribute("role")}),Qe("details details-menu remote-input input",{constructor:HTMLInputElement,add(e){const t=o(e,"details");t.addEventListener("toggle",(function(){t.hasAttribute("open")||(e.value="")}))}}),Qe("form details-menu",e=>{const t=o(e,"form");t.addEventListener("reset",()=>{setTimeout(()=>function(e){const t=e.querySelectorAll("details-menu [role=menuitemradio] input[type=radio]:checked");for(const n of t)nt(n,"change")}(t),0)})}),s("keypress","details-menu .js-filterable-field, details-menu filter-input input",e=>{if("Enter"===e.key){const t=e.currentTarget,n=o(t,"details-menu").querySelector('[role^="menuitem"]:not([hidden])');n instanceof HTMLElement&&n.click(),e.preventDefault()}}),et("details-menu-selected","details-menu",e=>{const t=e.currentTarget.querySelector(".js-filterable-field");t instanceof HTMLInputElement&&t.value&&t.focus()},{capture:!0}),et("details-menu-selected","[data-menu-input]",e=>{if(!(e.target instanceof Element))return;const t=i(e.target,"data-menu-input"),n=document.getElementById(t);(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)&&(n.value=e.detail.relatedTarget.value)},{capture:!0}),Qe("details-menu remote-input",{constructor:rt,initialize(e){const t=document.getElementById(e.getAttribute("aria-owns")||"");if(!t)return;let n=null;e.addEventListener("load",()=>{n=document.activeElement&&t.contains(document.activeElement)&&document.activeElement.id?document.activeElement.id:null}),e.addEventListener("loadend",()=>{if(n){const s=t.querySelector(`#${n}`)||t.querySelector('[role^="menu"]');s instanceof HTMLElement?s.focus():e.input&&e.input.focus()}})}}),et("details-menu-selected","details-menu[data-menu-max-options]",e=>{const t=+i(e.currentTarget,"data-menu-max-options")===e.currentTarget.querySelectorAll('[role="menuitemcheckbox"][aria-checked="true"]').length;u(e.currentTarget,"[data-menu-max-options-warning]").hidden=!t;for(const n of l(e.currentTarget,'[role="menuitemcheckbox"] input',HTMLInputElement))n.disabled=t&&!n.checked},{capture:!0}),Qe("details > details-menu",{subscribe(e){const t=o(e,"details");return j(t,"toggle",fn)}});const pn=new WeakMap,gn=["input[type=submit][data-disable-with]","button[data-disable-with]"].join(", ");function hn(e,t){e instanceof HTMLInputElement?e.value=t:e.innerHTML=t}function vn(e){for(const t of e.querySelectorAll(gn)){const n=pn.get(t);null!=n&&(hn(t,n),t.hasAttribute("data-disable-invalid")&&!e.checkValidity()||(t.disabled=!1),pn.delete(t))}}et("submit","form",(function(e){for(const n of e.currentTarget.querySelectorAll(gn)){pn.set(n,(t=n)instanceof HTMLInputElement?t.value||"Submit":t.innerHTML||"");const e=n.getAttribute("data-disable-with");e&&hn(n,e),n.disabled=!0}var t}),{capture:!0}),et("deprecatedAjaxComplete","form",(function({currentTarget:e,target:t}){e===t&&vn(e)})),x(vn),Qe(".js-feature-preview-indicator-container",e=>{!async function(e){const t=i(e,"data-feature-preview-indicator-src"),n=await async function(e){try{return(await A(e)).show_indicator}catch(t){return!1}}(t),s=e.querySelectorAll(".js-feature-preview-indicator");for(const o of s)o.hidden=!n}(e)}),et("click","[data-feature-preview-trigger-url]",async e=>{const t=e.currentTarget,n=i(t,"data-feature-preview-trigger-url"),s=await M({content:k(document,n),dialogClass:"feature-preview-dialog"}),o=i(t,"data-feature-preview-close-details"),r=i(t,"data-feature-preview-close-hmac");s.addEventListener("dialog:remove",()=>{L({hydroEventPayload:o,hydroEventHmac:r},!0)});const a=l(document,".js-feature-preview-indicator");for(const i of a)i.hidden=!0}),d(".js-feature-preview-unenroll",async(e,t)=>{await t.text();const n=u(e,".js-feature-preview-slug",HTMLInputElement).value;nt(e,`feature-preview-unenroll:${n}`)}),d(".js-feature-preview-enroll",async(e,t)=>{await t.text();const n=u(e,".js-feature-preview-slug",HTMLInputElement).value;nt(e,`feature-preview-enroll:${n}`)});class bn{constructor(e,t){this.attachment=e,this.policy=t}async process(e){const t=new Headers(this.policy.header||{}),n=new XMLHttpRequest;n.open("POST",this.policy.upload_url,!0);for(const[s,o]of t)n.setRequestHeader(s,o);n.onloadstart=()=>{e.attachmentUploadDidStart(this.attachment,this.policy)},n.upload.onprogress=t=>{if(t.lengthComputable){const n=Math.round(t.loaded/t.total*100);e.attachmentUploadDidProgress(this.attachment,n)}},await function(e,t){return new Promise((n,s)=>{e.onload=()=>n(e),e.onerror=s,e.send(t)})}(n,function(e,t){const n=new FormData;t.same_origin&&n.append("authenticity_token",t.upload_authenticity_token);for(const s in t.form)n.append(s,t.form[s]);return n.append("file",e.file),n}(this.attachment,this.policy)),204===n.status?(jn(this.policy),e.attachmentUploadDidComplete(this.attachment,this.policy,{})):201===n.status?(jn(this.policy),e.attachmentUploadDidComplete(this.attachment,this.policy,JSON.parse(n.responseText))):e.attachmentUploadDidError(this.attachment,{status:n.status,body:n.responseText})}}function jn(e){const t="string"==typeof e.asset_upload_url?e.asset_upload_url:null,n="string"==typeof e.asset_upload_authenticity_token?e.asset_upload_authenticity_token:null;if(!t||!n)return;const s=new FormData;s.append("authenticity_token",n),fetch(t,{method:"PUT",body:s,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}async function wn(e,t){const n=function(e,t){return{attachmentUploadDidStart(n,s){n.saving(0),Tn(t,"is-uploading"),nt(t,"upload:start",{batch:e,attachment:n,policy:s})},attachmentUploadDidProgress(n,s){n.saving(s),nt(t,"upload:progress",{batch:e,attachment:n})},attachmentUploadDidComplete(n,s,o){n.saved(function(e,t){const n=(null==e.id?null:String(e.id))||(null==t.asset.id?null:String(t.asset.id)),s=("string"==typeof e.href?e.href:null)||("string"==typeof t.asset.href?t.asset.href:null);return{id:n,href:s,name:t.asset.name}}(o,s)),nt(t,"upload:complete",{batch:e,attachment:n}),Tn(t,"is-default")},attachmentUploadDidError(n,s){nt(t,"upload:error",{batch:e,attachment:n});const o=yn(s);Tn(t,o)}}}(e,t);for(const o of e.attachments){const r=await Ln(e,o,t);if(!r)return;try{const e=new bn(o,r);await e.process(n)}catch(s){return nt(t,"upload:error",{batch:e,attachment:o}),void Tn(t,"is-failed")}}}async function Ln(e,t,n){const s=function(e,t){const n=u(t,".js-data-upload-policy-url-csrf",HTMLInputElement).value,s=t.getAttribute("data-upload-repository-id"),o=e.file,r=new FormData;r.append("name",o.name),r.append("size",String(o.size)),r.append("content_type",o.type),r.append("authenticity_token",n),s&&r.append("repository_id",s);e.directory&&r.append("directory",e.directory);return r}(t,n),o=[];nt(n,"upload:setup",{batch:e,attachment:t,form:s,preprocess:o});try{await Promise.all(o);const r=await fetch(function(e,t){return new Request(i(t,"data-upload-policy-url"),{method:"POST",body:e,credentials:"same-origin",headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}})}(s,n));if(r.ok)return await r.json();nt(n,"upload:invalid",{batch:e,attachment:t});const a=await r.text();Tn(n,yn({status:r.status,body:a},t.file))}catch(r){nt(n,"upload:invalid",{batch:e,attachment:t}),Tn(n,"is-failed")}return null}function yn(e,t){if(400===e.status)return"is-bad-file";if(422!==e.status)return"is-failed";const n=JSON.parse(e.body);if(!n||!n.errors)return"is-failed";for(const s of n.errors)switch(s.field){case"size":{const e=t?t.size:null;return null!=e&&0===e?"is-empty":"is-too-big"}case"file_count":return"is-too-many";case"width":case"height":return"is-bad-dimensions";case"name":return"already_exists"===s.code?"is-duplicate-filename":"is-bad-file";case"content_type":return"is-bad-file";case"uploader_id":return"is-bad-permissions";case"repository_id":return"is-repository-required";case"format":return"is-bad-format"}return"is-failed"}const En=["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 Tn(e,t){e.classList.remove(...En),e.classList.add(t)}class kn{constructor(e){this.attachments=e,this.size=this.attachments.length,this.total=Mn(this.attachments,e=>e.file.size)}percent(){const e=Mn(this.attachments,e=>e.file.size*e.percent/100);return Math.round(e/this.total*100)}uploaded(){return Mn(this.attachments,e=>e.isSaved()?1:0)}isFinished(){return this.attachments.every(e=>e.isSaved())}}function Mn(e,t){return e.reduce((e,n)=>e+t(n),0)}Qe("file-attachment[hover]",{add(e){e.classList.add("dragover")},remove(e){e.classList.remove("dragover")}}),et("file-attachment-accept","file-attachment",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/behaviors/file-attachment.ts:18");const{attachments:t}=e.detail;0===t.length&&(Tn(e.currentTarget,"is-hidden-file"),e.preventDefault())})),et("file-attachment-accepted","file-attachment",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/behaviors/file-attachment.ts:27");const{attachments:t}=e.detail;wn(new kn(t),e.currentTarget)}));let Sn=0;function Hn(e){return Array.from(e.types).indexOf("Files")>=0}function xn(e){const t=e.dataTransfer;t&&Hn(t)&&e.preventDefault()}function An(e){const t=e.dataTransfer;t&&Hn(t)&&e.preventDefault()}function qn({currentTarget:e}){if(!(e instanceof Element))throw new Error("invariant: app/assets/modules/github/behaviors/file-attachment.ts:73");Tn(u(e,"file-attachment"),"is-default")}function Cn(e,t){let n=$n(e,t);if(n&&-1===t.indexOf("/")){n+=$n(e.substring(e.lastIndexOf("/")+1),t)}return n}function In(e){const t=e.toLowerCase().split("");let n="";for(let s=0;s<t.length;s++){const e=t[s].replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");n+=0===s?`(.*)(${e})`:`([^${e}]*?)(${e})`}return new RegExp(`${n}(.*?)$`,"i")}function _n(e,t,n){if(t){const s=e.innerHTML.trim().match(n||In(t));if(!s)return;let o=!1;const r=[];for(let e=1;e<s.length;++e){const t=s[e];t&&(e%2==0?o||(r.push("<mark>"),o=!0):o&&(r.push("</mark>"),o=!1),r.push(t))}e.innerHTML=r.join("")}else{const t=e.innerHTML.trim(),n=t.replace(/<\/?mark>/g,"");t!==n&&(e.innerHTML=n)}}function $n(e,t){let n=e;if(n===t)return 1;const s=n.length;let o=0,r=0;for(let l=0;l<t.length;l++){const e=t[l],i=n.indexOf(e.toLowerCase()),a=n.indexOf(e.toUpperCase()),c=Math.min(i,a),u=c>-1?c:Math.max(i,a);if(-1===u)return 0;o+=.1,n[u]===e&&(o+=.1),0===u&&(o+=.8,0===l&&(r=1))," "===n.charAt(u-1)&&(o+=.8),n=n.substring(u+1,s)}const i=t.length,a=o/i;let c=(a*(i/s)+a)/2;return r&&c+.1<1&&(c+=.1),c}Qe("file-attachment",{add(e){0==Sn++&&(document.addEventListener("drop",xn),document.addEventListener("dragover",An));const t=e.closest("form");t&&t.addEventListener("reset",qn)},remove(e){0==--Sn&&(document.removeEventListener("drop",xn),document.removeEventListener("dragover",An));const t=e.closest("form");t&&t.removeEventListener("reset",qn)}});const Nn=new WeakMap,Dn=new WeakMap,Pn=new WeakMap;function Rn(e,t,n={}){if(!e)return 0;const s=t.toLowerCase(),o=null!=n.text?n.text:Bn,r=n.limit,i=n.score;let a=Nn.get(e);const c=e.querySelector('input[type="radio"]:checked'),l=Array.from(e.children);a||(a=Array.from(e.children),Nn.set(e,a));for(const g of l)e.removeChild(g),g instanceof HTMLElement&&(g.style.display="");const u=document.createDocumentFragment();let d=0,m=0;if(s){const e=Array.from(a);for(const n of e){null==Dn.get(n)&&Dn.set(n,o(n));const e=i?i(Dn.get(n)||"",s,n):Cn(Dn.get(n)||"",s);Pn.set(n,String(e))}e.sort(Fn);const t=In(s);for(const o of e)(null==r||d<r)&&parseFloat(Pn.get(o))>0&&(m++,!0===n.mark&&(_n(o),_n(o,s,t)),u.appendChild(o)),d++}else for(const g of a)(null==r||d<r)&&(m++,!0===n.mark&&_n(g),u.appendChild(g)),d++;let f=!1;if(c instanceof HTMLInputElement)for(const g of u.querySelectorAll('input[type="radio"]:checked'))g instanceof HTMLInputElement&&g.value!==c.value&&(g.checked=!1,f=!0);e.appendChild(u),c&&f&&c.dispatchEvent(new Event("change",{bubbles:!0}));const p=e.querySelectorAll(".js-divider");for(const g of p)g.classList.toggle("d-none",Boolean(s&&s.trim().length>0));return m}function Fn(e,t){const n=parseFloat(Pn.get(e)),s=parseFloat(Pn.get(t)),o=Dn.get(e)||"",r=Dn.get(t)||"";return n>s?-1:n<s?1:o<r?-1:o>r?1:0}function Bn(e){if(e.hasAttribute("data-filter-value")){return(e.getAttribute("data-filter-value")||"").toLowerCase().trim()}return e.textContent.toLowerCase().trim()}function On(e){return(e.textContent||"").toLowerCase().trim()}function Un(e,t){const n=e.innerHTML;if(t){const s=new RegExp(t,"i");e.innerHTML=n.replace(s,"<mark>$&</mark>")}else{const t=n.replace(/<\/?mark>/g,"");n!==t&&(e.innerHTML=t)}}function zn(e){return(e.querySelector("[data-filterable-item-text]")||e).textContent.toLowerCase().trim()}function Wn(e,t){const n=e.innerHTML;if(t){const s=new RegExp(t,"i");e.innerHTML=n.replace(s,"<mark>$&</mark>")}else{const t=n.replace(/<\/?mark>/g,"");n!==t&&(e.innerHTML=t)}}const Vn=new WeakMap;async function Jn(e,t,n){const s=Vn.get(e)||await async function(e){await q();const t=await A(i(e,"data-filterable-src"));return Vn.set(e,t),t}(e);if(null==s)throw new Error("invariant: app/assets/modules/github/substring-memory-filter-list.ts:22");const o=n.limit,r=u(e,"template",HTMLTemplateElement),a={};for(const i of l(e,"input[type=hidden]",HTMLInputElement))a[`${i.name}${i.value}`]=i;let c=r.nextElementSibling;for(;c;){const e=c;c=e.nextElementSibling,e instanceof HTMLElement&&("true"===e.getAttribute("aria-checked")||e.classList.contains("select-menu-divider"))?e.hidden=!0:e.remove()}let d=0,m=document.createDocumentFragment();const f=e.querySelector(".js-divider-suggestions"),p=e.querySelector(".js-divider-rest");function g(e){const n=!(null!=o&&d>=o)&&function(e){return`${e.login} ${e.name}`.toLowerCase().trim()}(e).indexOf(t)>=0;if(n||e.selected){const t=function(e,t,n){if(null!=e.element)return e.element;const s=t.content.cloneNode(!0),o=u(s,"input[type=checkbox], input[type=radio]",HTMLInputElement);e.type&&(o.name=`reviewer_${e.type}_ids[]`);o.value=e.id;const r=`${o.name}${e.id}`;let i=e.selected;n[r]&&(i=!0,n[r].remove(),delete n[r]);const a=u(s,"[role^=menuitem]");i&&(a.setAttribute("aria-checked","true"),o.checked=!0);e.disabled&&a.setAttribute("aria-disabled","true");const c=s.querySelector(".js-username");c&&(c.textContent=e.login);const l=s.querySelector(".js-description");l&&(l.textContent=e.name);const d=s.querySelector(".js-extended-description");d&&(e.description?d.textContent=e.description:d.remove());return u(s,".js-avatar",HTMLImageElement).src=e.avatar,e.element=a,e.element}(e,r,a);t.hidden=!n,n&&d++,m.appendChild(t)}}if(f&&s.suggestions){for(const e of s.suggestions)g(e);m.childNodes.length&&(f.after(m),f.hidden=0===d,m=document.createDocumentFragment())}const h=d;for(const i of s.users)g(i);return e.append(m),p&&(p.hidden=d===h||0===h),d}async function Kn(e,t){const n=e.hasAttribute("data-filterable-highlight"),s=parseInt(e.getAttribute("data-filterable-limit"),10)||null;let o=0;switch(e.getAttribute("data-filterable-type")){case"fuzzy":o=Rn(e,t,{mark:n,limit:s});break;case"substring":o=function(e,t,n={}){let s;if(!e)return;const o=t.toLowerCase(),r=null!=n.text?n.text:zn,i=n.limit,a=Array.from(e.children).filter(e=>!e.classList.contains("select-menu-no-results"));!0===n.mark?s=Wn:"function"==typeof n.mark&&(s=n.mark);let c=0;for(const l of a)-1!==r(l).indexOf(o)?null!=i&&c>=i?(l.style.display="none",l.hidden=!0):(c++,l.style.display="",l.hidden=!1,s&&(s(l),s(l,o))):(l.style.display="none",l.hidden=!0);return c}(e,t,{mark:n,limit:s})||0;break;case"substring-memory":o=await Jn(e,t,{limit:s});break;default:o=function(e,t,n={}){let s;if(!e)return;const o=t.toLowerCase(),r=null!=n.text?n.text:On,i=n.limit;!0===n.mark?s=Un:"function"==typeof n.mark&&(s=n.mark);let a=0;for(const c of e.children)c instanceof HTMLElement&&(0===r(c).indexOf(o)?null!=i&&a>=i?(c.style.display="none",c.hidden=!0):(a++,c.style.display="",c.hidden=!1,s&&(s(c),s(c,o))):(c.style.display="none",c.hidden=!0));return a}(e,t,{mark:n,limit:s})||0}return e.classList.toggle("filterable-active",t.length>0),e.classList.toggle("filterable-empty",0===o),o}Qe(".js-filterable-field",{constructor:HTMLInputElement,initialize(e){e.autocomplete||(e.autocomplete="off");let t=e.value;async function n(e){t!==e.value&&(t=e.value,await r(),nt(e,"filterable:change"))}async function s(){t=e.value,await r(),nt(e,"filterable:change")}return{add(e){e.addEventListener("focus",s),C(e,n),document.activeElement===e&&s()},remove(e){e.removeEventListener("focus",s),I(e,n)}}}}),et("filterable:change",".js-filterable-field",(async function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/behaviors/filterable.ts:83");const n=t.value.trim().toLowerCase(),s=document.querySelectorAll(`[data-filterable-for="${t.id}"]`);for(const o of s){const e=await Kn(o,n);document.activeElement&&t===document.activeElement&&Ut(`${e} results found.`);const s=new CustomEvent("filterable:change",{bubbles:!0,cancelable:!1,detail:{inputField:t}});o.dispatchEvent(s)}})),et("filterable:change","details-menu .select-menu-list",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/behaviors/filterable.ts:125");const t=e.currentTarget,n=t.querySelector(".js-new-item-form");n&&function(e,t,n){const s=n.length>0&&!function(e,t){for(const n of e.querySelectorAll("[data-menu-button-text]")){if(n.textContent.toLowerCase().trim()===t.toLowerCase())return!0}return!1}(e,n);if(e.classList.toggle("is-showing-new-item-form",s),!s)return;u(t,".js-new-item-name").textContent=n;const o=t.querySelector(".js-new-item-value");(o instanceof HTMLInputElement||o instanceof HTMLButtonElement)&&(o.value=n)}(t,n,e.detail.inputField.value)})),Qe("tab-container .select-menu-list .filterable-empty, details-menu .select-menu-list .filterable-empty",{add(e){o(e,".select-menu-list").classList.add("filterable-empty")},remove(e){o(e,".select-menu-list").classList.remove("filterable-empty")}}),et("click",".js-flash-close",(function(e){const t=e.currentTarget.closest(".flash-messages");e.currentTarget.closest(".flash").remove(),t&&!t.querySelector(".flash")&&t.remove()}));const Gn=new WeakMap;function Xn(e){e instanceof CustomEvent&&Ut(`${e.detail} results found.`)}function Yn(e,t){const n=e.currentTarget;if(n instanceof Element){for(const e of n.querySelectorAll("[data-show-on-error]"))e instanceof HTMLElement&&(e.hidden=!t);for(const e of n.querySelectorAll("[data-hide-on-error]"))e instanceof HTMLElement&&(e.hidden=t)}}function Qn(e){Yn(e,!1)}function Zn(e){Yn(e,!0)}document.addEventListener("focus",(function(e){const t=e.target;t instanceof Element&&!Gn.get(t)&&(nt(t,"focusin:delay"),Gn.set(t,!0))}),{capture:!0}),document.addEventListener("blur",(function(e){setTimeout((function(){const t=e.target;t instanceof Element&&t!==document.activeElement&&(nt(t,"focusout:delay"),Gn.delete(t))}),200)}),{capture:!0}),Qe("fuzzy-list",{constructor:FuzzyListElement,subscribe:e=>j(e,"fuzzy-list-sorted",Xn)}),et("filter-input-updated","filter-input",e=>{if(!(e instanceof CustomEvent))return;const t=e.currentTarget.input;if(!document.activeElement||document.activeElement!==t)return;const{count:n,total:s}=e.detail;Ut(`Found ${n} out of ${s} ${1===s?"item":"items"}`)}),et("toggle","details",e=>{setTimeout(()=>function(e){const t=e.querySelector("filter-input");t&&!e.hasAttribute("open")&&t.reset()}(e.target),0)},{capture:!0}),et("tab-container-changed","tab-container",e=>{if(!(e instanceof CustomEvent))return;if(!(e.target instanceof HTMLElement))return;const{relatedTarget:t}=e.detail,n=e.target.querySelector("filter-input");n instanceof it&&n.setAttribute("aria-owns",t.id)},{capture:!0}),d(".js-immediate-updates",(async function(e,t){let n;try{n=(await t.json()).json.updateContent}catch(s){s.response.json&&(n=s.response.json.updateContent)}if(n)for(const o in n){const e=n[o],t=document.querySelector(o);t instanceof HTMLElement&&E(t,e)}})),Qe("include-fragment, poll-include-fragment",{subscribe:e=>_(j(e,"error",Zn),j(e,"loadstart",Qn))}),et("click","include-fragment button[data-retry-button]",({currentTarget:e})=>{const t=o(e,"include-fragment",window.IncludeFragmentElement),n=t.src;t.src="",t.src=n}),Qe("[data-indeterminate]",{constructor:HTMLInputElement,initialize(e){e.indeterminate=!0}}),d(".js-notice-dismiss",(async function(e,t){await t.text(),o(e,".js-notice").remove()}));class PasswordStrengthElement extends HTMLElement{connectedCallback(){this.addEventListener("input",es)}disconnectedCallback(){this.removeEventListener("input",es)}}function es(e){const t=e.currentTarget;if(!(t instanceof PasswordStrengthElement))return;const n=e.target;if(!(n instanceof HTMLInputElement))return;const s=function(e,t){const n={valid:!1,hasMinimumCharacterCount:e.length>=t.minimumCharacterCount,hasMinimumPassphraseLength:0!==t.passphraseLength&&e.length>=t.passphraseLength,hasLowerCase:/[a-z]/.test(e),hasNumber:/\d/.test(e)};return n.valid=n.hasMinimumPassphraseLength||n.hasMinimumCharacterCount&&n.hasLowerCase&&n.hasNumber,n}(n.value,{minimumCharacterCount:Number(i(t,"minimum-character-count")),passphraseLength:Number(t.getAttribute("passphrase-length"))});if(s.valid){n.setCustomValidity("");const e=t.querySelector("dl.form-group");e&&(e.classList.remove("errored"),e.classList.add("successed"))}else n.setCustomValidity(i(t,"invalid-message"));!function(e,t){const n=e.querySelector("[data-more-than-n-chars]"),s=u(e,"[data-min-chars]"),o=u(e,"[data-number-requirement]"),r=u(e,"[data-letter-requirement]"),a=i(e,"error-class").split(" ").filter(e=>e.length>0),c=i(e,"pass-class").split(" ").filter(e=>e.length>0);for(const i of[n,s,o,r])null==i||i.classList.remove(...a,...c);if(t.hasMinimumPassphraseLength&&n)n.classList.add(...c);else if(t.valid)s.classList.add(...c),o.classList.add(...c),r.classList.add(...c);else{const e=t.hasMinimumCharacterCount?c:a,i=t.hasNumber?c:a,l=t.hasLowerCase?c:a;null==n||n.classList.add(...a),s.classList.add(...e),o.classList.add(...i),r.classList.add(...l)}}(t,s)}function ts(e){return null==e.getAttribute("data-pjax-preserve-scroll")&&0}function ns(e){let t=e;for(;t;){const e=t.getAttribute("data-pjax");if(e&&"true"!==e)return document.querySelector(e);t=t.parentElement&&t.parentElement.closest("[data-pjax]")}return e.closest("[data-pjax-container]")}window.customElements.get("password-strength")||(window.PasswordStrengthElement=PasswordStrengthElement,window.customElements.define("password-strength",PasswordStrengthElement)),et("click",".js-permalink-shortcut",(function(e){const t=e.currentTarget;try{h(null,"",t.href+window.location.hash)}catch(n){window.location.href=t.href+window.location.hash}e.preventDefault()})),et("click","[data-pjax] a, a[data-pjax]",(function(e){if(!(e instanceof MouseEvent))throw new Error("invariant: app/assets/modules/github/behaviors/pjax.ts:48");const t=e.currentTarget;if(t instanceof HTMLAnchorElement){if(null!=t.getAttribute("data-skip-pjax"))return;if(null!=t.getAttribute("data-remote"))return;const n=ns(t);n&&$(e,{container:n,scrollTo:ts(t)})}})),et("submit","form[data-pjax]",(function(e){if(!(e instanceof Event))throw new Error("invariant: app/assets/modules/github/behaviors/pjax.ts:67");const t=e.target,n=ns(t);n&&N(e,{container:n,scrollTo:ts(t)})})),et("change","select[data-pjax]",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLSelectElement))throw new Error("invariant: app/assets/modules/github/behaviors/pjax.ts:79");const n=ns(t);n&&D({url:t.value,container:n})})),async function(){await p;const e=document.querySelector(".js-pjax-loader-bar");if(!e)return;const t=e.firstElementChild;if(!(t instanceof HTMLElement))return;let n=0,s=null,o=null;function r(e){t instanceof HTMLElement&&(0===e&&(null==o&&(o=getComputedStyle(t).transition),t.style.transition="none"),n=e,t.style.width=`${n}%`,0===e&&(t.clientWidth,t.style.transition=o||""))}function i(){0===n&&(n=12),r(Math.min(n+3,95)),s=window.setTimeout(i,500)}document.addEventListener("pjax:start",(function(){r(0),e&&e.classList.add("is-loading"),s=window.setTimeout(i,0)})),document.addEventListener("pjax:end",(function(){s&&clearTimeout(s),r(100),e&&e.classList.remove("is-loading")}))}();let ss=null;function os(e,t){return e.split("/",3).join("/")===t.split("/",3).join("/")}"getEntriesByName"in window.performance&&(document.addEventListener("pjax:start",(function(e){e instanceof CustomEvent&&e.detail&&e.detail.url&&(window.performance.mark("pjax_start"),ss=e.detail.url)})),document.addEventListener("pjax:end",(async function(){if(await r(),!window.performance.getEntriesByName("pjax_start").length)return;window.performance.mark("pjax_end"),window.performance.measure("last_pjax_request","pjax_start","pjax_end");const e=window.performance.getEntriesByName("last_pjax_request").pop(),t=e?e.duration:null;t&&(ss&&L({requestUrl:ss,pjaxDuration:Math.round(t)}),window.performance.clearMarks("pjax_start"),window.performance.clearMarks("pjax_end"),window.performance.clearMeasures("last_pjax_request"))}))),document.addEventListener("pjax:click",(function(e){if(window.onbeforeunload)return e.preventDefault()})),et("pjax:click","#js-repo-pjax-container a[href]",(function(e){const t=e.currentTarget.pathname;os(t,location.pathname)?function(e){const t=e.split("/")[3];return["commit","commits","community","issues","packages","projects","releases","security","tags","wiki"].includes(t)&&os(e,location.pathname)}(t)&&e.preventDefault():e.preventDefault()})),et("pjax:click",".js-comment-body",(function(e){const t=e.target;t instanceof HTMLAnchorElement&&"files"===t.pathname.split("/")[3]&&e.preventDefault()}));const rs={};function is(e){if(null===e.parentNode||!(e.parentNode instanceof HTMLElement))throw new Error;const t=e.parentNode.children;for(let n=0;n<t.length;++n)if(t[n]===e)return n;return 0}(async()=>{await p,rs[document.location.pathname]=Array.from(document.querySelectorAll("head [data-pjax-transient]"))})(),document.addEventListener("pjax:beforeReplace",(function(e){const t=e.detail.contents||[];for(let n=0;n<t.length;n++){const e=t[n];if(e instanceof Element)if("pjax-head"===e.id)rs[document.location.pathname]=Array.from(e.children),t[n]=null;else if("js-flash-container"===e.id){const s=document.querySelector("#js-flash-container");s&&s.replaceWith(e),t[n]=null}}})),document.addEventListener("pjax:end",(function(){const e=rs[document.location.pathname];if(!e)return;const t=document.head;for(const n of document.querySelectorAll("head [data-pjax-transient]"))n.remove();for(const n of e)n.matches("title, script, link[rel=stylesheet]")?n.matches("link[rel=stylesheet]")&&t.append(n):(n.setAttribute("data-pjax-transient",""),t.append(n))})),s("keydown",".js-quick-submit",(function(e){!function(e){const t=e.target;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))throw new Error("invariant: app/assets/modules/github/behaviors/quick-submit.ts:13");if((e.ctrlKey||e.metaKey)&&"Enter"===e.key){const n=t.form;if(!(n instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/behaviors/quick-submit.ts:16");const s=n.querySelector("input[type=submit], button[type=submit]");if(e.shiftKey){const e=n.querySelector(".js-quick-submit-alternative");(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&!e.disabled&&m(n,e)}else(s instanceof HTMLInputElement||s instanceof HTMLButtonElement)&&s.disabled||m(n);e.preventDefault()}}(e)}));let as=0;function cs(e){return e.replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}const ls={INPUT:e=>e instanceof HTMLInputElement&&e.checked?"[x] ":"[ ] ",CODE(e){const t=e.textContent||"";return e.parentNode&&"PRE"===e.parentNode.nodeName?(e.textContent=`\`\`\`\n${t.replace(/\n+$/,"")}\n\`\`\`\n\n`,e):t.indexOf("`")>=0?`\`\` ${t} \`\``:`\`${t}\``},STRONG:e=>`**${e.textContent||""}**`,EM:e=>`_${e.textContent||""}_`,DEL:e=>`~${e.textContent||""}~`,BLOCKQUOTE(e){const t=(e.textContent||"").trim().replace(/^/gm,"> "),n=document.createElement("pre");return n.textContent=`${t}\n\n`,n},A(e){const t=e.textContent||"",n=e.getAttribute("href");return/^https?:/.test(t)&&t===n?t:n?`[${t}](${n})`:t},IMG(e){const t=e.getAttribute("alt")||"",n=e.getAttribute("src");if(!n)throw new Error;const s=e.hasAttribute("width")?` width="${cs(e.getAttribute("width")||"")}"`:"",o=e.hasAttribute("height")?` height="${cs(e.getAttribute("height")||"")}"`:"";return s||o?`<img alt="${cs(t)}"${s}${o} src="${cs(n)}">`:`![${t}](${n})`},LI(e){const t=e.parentNode;if(!t)throw new Error;let n="";if(!function(e){const t=e.childNodes[0],n=e.childNodes[1];return!!(t&&e.childNodes.length<3)&&!("OL"!==t.nodeName&&"UL"!==t.nodeName||n&&(n.nodeType!==Node.TEXT_NODE||(n.textContent||"").trim()))}(e))if("OL"===t.nodeName)if(as>0&&!t.previousSibling){n=`${is(e)+as+1}\\. `}else n=`${is(e)+1}. `;else n="* ";const s=n.replace(/\S/g," "),o=(e.textContent||"").trim().replace(/^/gm,s),r=document.createElement("pre");return r.textContent=o.replace(s,n),r},OL(e){const t=document.createElement("li");return t.appendChild(document.createElement("br")),e.append(t),e},H1(e){const t=parseInt(e.nodeName.slice(1));return e.prepend(`${Array(t+1).join("#")} `),e},UL:e=>e};ls.UL=ls.OL;for(let e=2;e<=6;++e)ls[`H${e}`]=ls.H1;function us(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,(function(e){return e.nodeName in ls&&!function(e){if(e instanceof HTMLAnchorElement&&1===e.childNodes.length){const t=e.childNodes[0];if(t instanceof HTMLImageElement)return t.src===e.href}return!1}(e)&&(function(e){return"IMG"===e.nodeName||null!=e.firstChild}(e)||function(e){return"INPUT"===e.nodeName&&e instanceof HTMLInputElement&&"checkbox"===e.type}(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP})),n=[];let s=t.nextNode();for(;s;)s instanceof HTMLElement&&n.push(s),s=t.nextNode();n.reverse();for(const o of n)o.replaceWith(ls[o.nodeName](o))}const ds=new WeakMap;let ms=0;const fs=/\bEdge\//.test(navigator.userAgent);function ps(e,t){return function(e,t){const n=0===ms;ms+=ds.has(e)?0:1;const s=Object.assign({quoteMarkdown:!1,copyMarkdown:!1,scopeSelector:""},t);ds.set(e,s),n&&document.addEventListener("keydown",bs);s.copyMarkdown&&e.addEventListener("copy",gs)}(e,t),{unsubscribe:()=>{!function(e){const t=ds.get(e);if(null==t)return;ds.delete(e),ms-=1,0===ms&&document.removeEventListener("keydown",bs);t.copyMarkdown&&e.removeEventListener("copy",gs)}(e)}}}function gs(e){const t=e.target;if(!(t instanceof HTMLElement))return;if(Ls(t))return;const n=e.clipboardData;if(!n)return;const s=window.getSelection();if(!s)return;let o;try{o=s.getRangeAt(0)}catch(a){return}const r=s.toString(),i=ws(r,o,!0);i&&(n.setData("text/plain",r),n.setData("text/x-gfm",i.selectionText),e.preventDefault(),s.removeAllRanges(),s.addRange(o))}function hs(e){let t=e;for(;t=t.parentElement;)if(ds.has(t))return t}function vs(e){for(const n of e.querySelectorAll("textarea"))if(n instanceof HTMLTextAreaElement&&!((t=n).offsetWidth<=0&&t.offsetHeight<=0))return n;var t}function bs(e){if(function(e){return e.defaultPrevented||"r"!==e.key||e.metaKey||e.altKey||e.shiftKey||e.ctrlKey||e.target instanceof HTMLElement&&Ls(e.target)}(e))return;const t=window.getSelection();if(!t)return;let n;try{n=t.getRangeAt(0)}catch(s){return}js(t.toString(),n)&&e.preventDefault()}function js(e,t){const n=ws(e,t,!1);if(!n)return!1;const{container:s,selectionText:o}=n;if(!s.dispatchEvent(new CustomEvent("quote-selection",{bubbles:!0,cancelable:!0,detail:{range:t,selectionText:o}})))return!0;const r=vs(s);return!!r&&(function(e,t){let n=`> ${e.replace(/\n/g,"\n> ")}\n\n`;t.value&&(n=`${t.value}\n\n${n}`);t.value=n,t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})),t.focus(),t.selectionStart=t.value.length,t.scrollTop=t.scrollHeight}(o,r),!0)}function ws(e,t,n){let s=e.trim();if(!s)return;let o=t.startContainer;if(!o)return;if(o.nodeType!==Node.ELEMENT_NODE&&(o=o.parentNode),!(o instanceof Element))return;const r=hs(o);if(!r)return;const i=ds.get(r);if(i){if(i.quoteMarkdown&&!fs)try{const e=function(e,t){const n=e.startContainer;if(!(n&&n.parentNode&&n.parentNode instanceof HTMLElement))throw new Error("the range must start within an HTMLElement");const s=n.parentNode;let o=e.cloneContents();if(t){const e=o.querySelector(t);e&&(o=document.createDocumentFragment(),o.appendChild(e))}as=0;const r=s.closest("li");if(s.closest("pre")){const e=document.createElement("pre");e.appendChild(o),o=document.createDocumentFragment(),o.appendChild(e)}else if(r&&r.parentNode&&("OL"===r.parentNode.nodeName&&(as=is(r)),!o.querySelector("li"))){const e=document.createElement("li");if(!r.parentNode)throw new Error;const t=document.createElement(r.parentNode.nodeName);e.appendChild(o),t.appendChild(e),o=document.createDocumentFragment(),o.appendChild(t)}return o}(t,i.scopeSelector);r.dispatchEvent(new CustomEvent("quote-selection-markdown",{bubbles:!0,cancelable:!1,detail:{fragment:e,range:t,unwrap:n}})),us(e),s=function(e){const t=document.body;if(!t)return"";const n=document.createElement("div");n.appendChild(e),n.style.cssText="position:absolute;left:-9999px;",t.appendChild(n);let s="";try{const e=window.getSelection();if(e){const t=document.createRange();t.selectNodeContents(n),e.removeAllRanges(),e.addRange(t),s=e.toString(),e.removeAllRanges(),t.detach()}}finally{t.removeChild(n)}return s}(e).replace(/^\n+/,"").replace(/\s+$/,"")}catch(a){setTimeout(()=>{throw a})}return{selectionText:s,container:r}}}function Ls(e){const t=e.nodeName.toLowerCase(),n=(e.getAttribute("type")||"").toLowerCase();return"select"===t||"textarea"===t||"input"===t&&"submit"!==n&&"reset"!==n||e.isContentEditable}function ys(e){return"DIV"===e.nodeName&&e.classList.contains("highlight")}Qe(".js-quote-selection-container",{subscribe:e=>ps(e,{quoteMarkdown:e.hasAttribute("data-quote-markdown"),scopeSelector:e.getAttribute("data-quote-markdown")||"",copyMarkdown:!1})}),document.addEventListener("quote-selection-markdown",(function(e){const t=e.detail,{fragment:n,range:s,unwrap:o}=t,r=s.startContainer.parentElement,i=r&&r.closest("pre");if(i instanceof HTMLElement&&!o){const e=i.parentElement;if(e&&ys(e)){const t=document.createElement("div");t.className=e.className,t.appendChild(n),n.appendChild(t)}}!function(e){const t=document.createNodeIterator(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.nodeName in Es&&function(e){return"IMG"===e.nodeName||null!=e.firstChild}(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}),n=[];let s=t.nextNode();for(;s;)s instanceof HTMLElement&&n.push(s),s=t.nextNode();n.reverse();for(const o of n)o.replaceWith(Es[o.nodeName](o))}(n)}));const Es={PRE(e){const t=e.parentElement;if(t&&ys(t)){const n=t.className.match(/highlight-source-(\S+)/),s=n?n[1]:"",o=(e.textContent||"").replace(/\n+$/,"");e.textContent=`\`\`\`${s}\n${o}\n\`\`\``,e.append("\n\n")}return e},A(e){const t=e.textContent||"";return e.classList.contains("user-mention")||e.classList.contains("team-mention")?t: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;if(!t)throw new Error("invariant: app/assets/modules/github/behaviors/quote-selection.ts:77");const n=u(t,"a[href]",HTMLAnchorElement),s=document.createElement("p");s.textContent=n.href,t.replaceWith(s)}return e}};let Ts,ks;et("click",".js-comment-quote-reply",(function({currentTarget:e}){const t=o(e,".js-comment"),n=u(t,".js-comment-body");if(t.classList.contains("js-nested-discussion-comment")){const e=o(t,".js-timeline-comment");u(e,".js-toggle-inline-comment-form").click()}if(ks&&"Range"===ks.type&&n.contains(ks.anchorNode))js(ks.text,ks.range);else{const e=window.getSelection();e.removeAllRanges(),e.selectAllChildren(n),js(e.toString(),e.getRangeAt(0))}})),document.addEventListener("selectionchange",tt((function(){const e=window.getSelection();let t;try{t=e.getRangeAt(0)}catch(n){return void(Ts=null)}Ts={type:e.type,anchorNode:e.anchorNode,text:e.toString(),range:t}}),100)),document.addEventListener("toggle",(function(e){const t=e.target;if(!(t instanceof Element&&t.hasAttribute("open")))return;ks=Ts;const n=t.querySelector(".js-comment-quote-reply.d-none");if(!n)return;const s=hs(t);s&&(s.querySelector(".js-inline-comment-form-container")||vs(s))&&n.classList.remove("d-none")}),{capture:!0}),Qe(".has-removed-contents",(function(){let e;return{add(t){e=Array.from(t.childNodes);for(const s of e)t.removeChild(s);const n=t.closest("form");n&&nt(n,"change")},remove(t){for(const s of e)t.appendChild(s);const n=t.closest("form");n&&nt(n,"change")}}})),d("form[data-replace-remote-form]",(async function(e,t){e.classList.remove("is-error"),e.classList.add("is-loading");try{let n=e;const s=await t.html(),o=e.closest("[data-replace-remote-form-target]");if(o){const e=o.getAttribute("data-replace-remote-form-target");n=e?document.getElementById(e):o}n.replaceWith(s.html)}catch(n){e.classList.remove("is-loading"),e.classList.add("is-error")}}));let Ms=null;function Ss(e,t){var n,s;const o=null!==(n=null==t?void 0:t.selector)&&void 0!==n?n:".js-session-resumable",r=`${null!==(s=null==t?void 0:t.keyPrefix)&&void 0!==s?s:"session-resume:"}${e}`,i=[];for(const l of document.querySelectorAll(o))(l instanceof HTMLInputElement||l instanceof HTMLTextAreaElement)&&i.push(l);const a=i.filter(e=>function(e){return e.id&&e.value!==e.defaultValue&&e.form!==Ms}(e)).map(e=>[e.id,e.value]);if(a.length)try{sessionStorage.setItem(r,JSON.stringify(a))}catch(c){}}function Hs(e,t){var n;const s=`${null!==(n=null==t?void 0:t.keyPrefix)&&void 0!==n?n:"session-resume:"}${e}`;let o;try{o=sessionStorage.getItem(s)}catch(i){}if(!o)return;try{sessionStorage.removeItem(s)}catch(a){}const r=[];for(const[c,l]of JSON.parse(o)){const e=new CustomEvent("session:resume",{bubbles:!0,cancelable:!0,detail:{targetId:c,targetValue:l}});if(document.dispatchEvent(e)){const e=document.getElementById(c);e&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.value===e.defaultValue&&(e.value=l,r.push(e))}}setTimeout((function(){for(const e of r)e.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))}),0)}function xs(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}window.addEventListener("submit",(function(e){Ms=e.target,setTimeout((function(){e.defaultPrevented&&(Ms=null)}),0)}),{capture:!0}),window.addEventListener("pageshow",(function(){Hs(xs())})),window.addEventListener("pjax:end",(function(){Hs(xs())})),window.addEventListener("pagehide",(function(){Ss(xs(),{selector:".js-session-resumable"})})),window.addEventListener("pjax:beforeReplace",(function(e){const t=e.detail.previousState,n=t?t.url:null;if(n)Ss(xs(new URL(n,window.location.origin)),{selector:".js-session-resumable"});else{const e=new Error("pjax:beforeReplace event.detail.previousState.url is undefined");setTimeout((function(){throw e}))}})),Qe("textarea.js-size-to-fit",{constructor:HTMLTextAreaElement,subscribe:function(e){var t=null,n=!1,s=void 0,o=void 0,r=void 0;function i(t){if(s!==t.clientX||o!==t.clientY){var a=e.style.height;r&&r!==a&&(n=!0,e.style.maxHeight="",e.removeEventListener("mousemove",i)),r=a}s=t.clientX,o=t.clientY}var a=e.ownerDocument,c=a.documentElement;function l(){if(!(n||e.value===t||e.offsetWidth<=0&&e.offsetHeight<=0)){var s=function(){for(var t=0,n=e;n!==a.body&&null!==n;)t+=n.offsetTop||0,n=n.offsetParent;var s=t-a.defaultView.pageYOffset;return{top:s,bottom:c.clientHeight-(s+e.offsetHeight)}}(),o=s.top,i=s.bottom;if(!(o<0||i<0)){var l=Number(getComputedStyle(e).height.replace(/px/,""))+i;e.style.maxHeight=l-100+"px";var u=e.parentElement;if(u instanceof HTMLElement){var d=u.style.height;u.style.height=getComputedStyle(u).height,e.style.height="auto",e.style.height=e.scrollHeight+"px",u.style.height=d,r=e.style.height}t=e.value}}}function u(){n=!1,e.style.height="",e.style.maxHeight=""}e.addEventListener("mousemove",i),e.addEventListener("input",l),e.addEventListener("change",l);var d=e.form;return d&&d.addEventListener("reset",u),e.value&&l(),{unsubscribe:function(){e.removeEventListener("mousemove",i),e.removeEventListener("input",l),e.removeEventListener("change",l),d&&d.removeEventListener("reset",u)}}}}),d(".js-social-form",(async function(e,t){const n=await t.json(),s=o(e,".js-social-container");for(const o of s.querySelectorAll(".js-social-count"))o.textContent=n.json.count})),et("click",'tab-container [role="tab"]',(function(e){const{currentTarget:t}=e,n=o(t,"tab-container").querySelector(".js-filterable-field, [data-filter-placeholder-input]");if(n instanceof HTMLInputElement){const e=t.getAttribute("data-filter-placeholder");e&&n.setAttribute("placeholder",e),n.focus()}}));class As{constructor(e){if(this.container=e.container,this.selections=e.selections,this.inputWrap=e.inputWrap,this.input=e.input,this.tagTemplate=e.tagTemplate,!this.input.form)throw new Error("invariant: app/assets/modules/github/behaviors/tag-input.ts:51");this.form=this.input.form,this.autoComplete=e.autoComplete}setup(){this.container.addEventListener("click",e=>{const t=e.target;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/behaviors/tag-input.ts:59");t.matches(".js-remove")?this.removeTag(e):this.onFocus()}),this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.addEventListener("blur",this.onBlur.bind(this)),this.input.addEventListener("keydown",this.onKeyDown.bind(this)),this.form.addEventListener("submit",this.onSubmit.bind(this)),this.autoComplete.addEventListener("auto-complete-change",()=>{this.selectTag(this.autoComplete.value)})}onFocus(){this.inputWrap.classList.add("focus"),this.input!==document.activeElement&&this.input.focus()}onBlur(){this.inputWrap.classList.remove("focus"),this.autoComplete.open||this.onSubmit()}onSubmit(){this.input.value&&(this.selectTag(this.input.value),this.autoComplete.open=!1)}onKeyDown(e){switch(P(e)){case"Backspace":this.onBackspace();break;case"Enter":case"Tab":this.taggifyValueWhenSuggesterHidden(e);break;case",":case" ":this.taggifyValue(e)}}taggifyValueWhenSuggesterHidden(e){!this.autoComplete.open&&this.input.value&&(e.preventDefault(),this.selectTag(this.input.value))}taggifyValue(e){this.input.value&&(e.preventDefault(),this.selectTag(this.input.value),this.autoComplete.open=!1)}selectTag(e){const t=this.normalizeTag(e),n=this.selectedTags();t&&n.indexOf(t)<0&&(this.selections.appendChild(this.templateTag(t)),this.input.value="",nt(this.form,"tags:changed"))}removeTag(e){const t=e.target;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/behaviors/tag-input.ts:141");e.preventDefault(),o(t,".js-tag-input-tag").remove(),nt(this.form,"tags:changed")}templateTag(e){const t=this.tagTemplate.cloneNode(!0);return u(t,"input",HTMLInputElement).value=e,u(t,".js-placeholder-tag-name").replaceWith(e),t.classList.remove("d-none","js-template"),t}normalizeTag(e){return e.toLowerCase().trim().replace(/[\s,']+/g,"-")}onBackspace(){if(!this.input.value){const e=this.selections.querySelector("li:last-child .js-remove");e instanceof HTMLElement&&e.click()}}selectedTags(){const e=l(this.selections,"input",HTMLInputElement);return Array.from(e).map(e=>e.value).filter(e=>e.length>0)}}async function qs(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/behaviors/team-members.ts:8");if(function(e){return!!e.getAttribute("data-hovercard-url")&&!!e.closest("[data-team-hovercards-enabled]")}(t))return void t.classList.remove("tooltipped");const n=t.getAttribute("data-url");if(!n)return;const s=A(n),o=i(t,"data-id"),r=document.querySelectorAll(`.js-team-mention[data-id='${o}']`);for(const i of r)i.removeAttribute("data-url");try{const e=await s;0===e.total?e.members.push("This team has no members"):e.total>e.members.length&&e.members.push(`${e.total-e.members.length} more`),Cs(r,function(e){if("ListFormat"in Intl){return(new Intl.ListFormat).format(e)}if(0===e.length)return"";if(1===e.length)return e[0];if(2===e.length)return e.join(" and ");{const t=e[e.length-1];return e.slice(0,-1).concat(`and ${t}`).join(", ")}}(e.members))}catch(a){const e=a.response?a.response.status:500;Cs(r,i(t,404===e?"data-permission-text":"data-error-text"))}}function Cs(e,t){for(const n of e)n instanceof HTMLElement&&(n.setAttribute("aria-label",t),n.classList.add("tooltipped","tooltipped-s","tooltipped-multiline"))}Qe(".js-tag-input-container",{constructor:HTMLElement,initialize(e){new As({container:e,inputWrap:u(e,".js-tag-input-wrapper"),input:u(e,'input[type="text"], input:not([type])',HTMLInputElement),selections:u(e,".js-tag-input-selected-tags"),tagTemplate:u(e,".js-template"),autoComplete:u(e,"auto-complete",st)}).setup()}}),Qe(".js-team-mention",(function(e){e.addEventListener("mouseenter",qs)}));let Is=0;const _s="IntersectionObserver"in window?new IntersectionObserver((function(e){for(const t of e)t.isIntersecting&&$s(t.target)}),{root:null,rootMargin:"0px",threshold:1}):null;function $s(e){e.classList.remove("js-unread-item","unread-item")}Qe(".js-unread-item",{constructor:HTMLElement,add(e){Is++,_s&&_s.observe(e)},remove(e){Is--,_s&&_s.unobserve(e),0===Is&&function(){if(!document.hasFocus())return;const e=document.querySelector(".js-timeline-marker-form");e&&e instanceof HTMLFormElement&&m(e)}()}}),et("socket:message",".js-discussion",(function(e){if(e.currentTarget===e.target)for(const t of document.querySelectorAll(".js-unread-item"))$s(t)}));let Ns=0;const Ds=/^\(\d+\)\s+/;function Ps(){const e=Ns?`(${Ns}) `:"";document.title.match(Ds)?document.title=document.title.replace(Ds,e):document.title=`${e}${document.title}`}function Rs(){if(document.querySelector(":target"))return;const e=R(location.hash).toLowerCase(),t=F(document,`user-content-${e}`);t&&t.scrollIntoView()}function Fs(e){if(!(e.target instanceof Element))throw new Error("invariant: app/assets/modules/github/behaviors/will-transition-once.ts:21");e.target.classList.remove("will-transition-once")}Qe(".js-unread-item",{add(){Ns++,Ps()},remove(){Ns--,Ps()}}),window.addEventListener("hashchange",Rs),document.addEventListener("pjax:success",Rs),async function(){await p,Rs()}(),et("click","a[href]",(function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&t.href===location.href&&location.hash.length>1&&setTimeout((function(){e.defaultPrevented||Rs()}))})),Qe(".will-transition-once",{constructor:HTMLElement,subscribe:e=>j(e,"transitionend",Fs)});const Bs=new b;async function Os(e){const t=e.getAttribute("data-item-name")||"items",n=e.value,s=parseInt(e.getAttribute("data-item-minimum"))||0,o=parseInt(e.getAttribute("data-item-maximum"))||300,r=parseInt(e.getAttribute("data-item-count"))||0,a=Math.max(s,parseInt(n)||0),c=a>o,u=document.querySelector(".js-downgrade-button");u instanceof HTMLButtonElement&&(u.disabled=a===r);const d=new URL(i(e,"data-url"),window.location.origin),m=new URLSearchParams(d.search.slice(1));m.append(t,a.toString()),document.querySelector(".js-transform-user")&&m.append("transform_user","1"),d.search=m.toString();const f=await Bs.push(A(d.toString())),p=document.querySelector(".js-contact-us");p&&p.classList.toggle("d-none",!c);const g=document.querySelector(".js-payment-summary");g&&g.classList.toggle("d-none",c);const v=document.querySelector(".js-submit-billing");v instanceof HTMLElement&&(v.hidden=c);const b=document.querySelector(".js-billing-section");b&&b.classList.toggle("has-removed-contents",f.free||f.is_enterprise_cloud_trial);const j=document.querySelector(".js-upgrade-info");j&&j.classList.toggle("d-none",a<=0);const w=document.querySelector(".js-downgrade-info");w&&w.classList.toggle("d-none",a>=0);const L=document.querySelector(".js-extra-seats-line-item");L&&L.classList.toggle("d-none",f.no_additional_seats),document.querySelector(".js-seat-field")&&function(e){for(const t of l(document,".js-seat-field",HTMLInputElement))t.value=e}(n);const y=document.querySelector(".js-minimum-seats-disclaimer");y&&(y.classList.toggle("tooltipped",5===f.seats),y.classList.toggle("tooltipped-nw",5===f.seats));const E=f.selectors;for(const i in E)for(const e of document.querySelectorAll(i))e.innerHTML=E[i];h(O(),"",f.url)}function Us(e,t){t&&"0"!==t?e.textContent=`(using ${t})`:e.remove()}et("click",".js-org-signup-duration-change",e=>{if(e.preventDefault(),!(e instanceof MouseEvent))throw new Error("invariant: app/assets/modules/github/billing/addons.ts:14");const t=e.currentTarget,n=i(t,"data-plan-duration");!function(e){const t="year"===e?"month":"year";for(const n of l(document,".js-plan-duration-text"))n.innerHTML=e;for(const n of l(document,".unstyled-available-plan-duration-adjective"))n.innerHTML=`${e}ly`;for(const n of l(document,".js-org-signup-duration-change"))n.setAttribute("data-plan-duration",t)}(n),function(e){for(const t of l(document,".js-seat-field",HTMLInputElement)){const n=new URL(i(t,"data-url"),window.location.origin),s=new URLSearchParams(n.search.slice(1));s.delete("plan_duration"),s.append("plan_duration",e),n.search=s.toString(),t.setAttribute("data-url",n.toString())}}(n);for(const s of l(document,".js-seat-field",HTMLInputElement))Os(s);!function(){for(const e of l(document,".js-unit-price"))e.hidden=!e.hidden}()}),Qe(".js-addon-purchase-field",{constructor:HTMLInputElement,add(e){B(e)&&Os(e),C(e,(function(){Os(e)}))}}),Qe(".js-addon-downgrade-field",{constructor:HTMLSelectElement,add(e){B(e)&&Os(e),e.addEventListener("change",(function(){Os(e)}))}}),et("details-menu-selected",".js-organization-container",(function(e){const t=document.querySelector(".js-addon-purchase-field"),n=e.target.querySelector("input:checked");if(t instanceof HTMLInputElement&&n instanceof HTMLInputElement){const e=n.getAttribute("data-upgrade-url");e&&(t.setAttribute("data-url",e),t.value="0",Os(t))}}),{capture:!0}),d(".js-fetch-downgrade-features-count",(async function(e,t){const n=(await t.json()).json;for(const s in n.counts){const t=u(e,`.js-downgrade-count[data-${s}-count]`);t&&Us(t,n.counts[s])}})),Qe(".js-fetch-downgrade-features-count",{constructor:HTMLFormElement,add:m}),Qe(".js-repo-health",(function(e){const t=o(e,"form",HTMLFormElement),n=u(t,".js-comment-field",HTMLTextAreaElement),s=u(t,".js-repo-name",HTMLInputElement);function r(){!async function(e,t,n){const s=u(document,".js-repo-health-check",HTMLFormElement);u(s,".js-repo-health-name",HTMLInputElement).value=n,e.classList.remove("d-none"),e.classList.add("is-loading"),t.setCustomValidity("checking"),nt(t,"change");const o=await k(document,s.action,{method:"POST",body:new FormData(s)}),r=u(e,".js-repo-health-results");r.innerHTML="",r.appendChild(o),e.classList.remove("is-loading"),t.setCustomValidity(""),nt(t,"change")}(e,n,s.value)}"hidden"===s.type?n.addEventListener("focus",r):s.addEventListener("change",r)})),d(".js-audit-log-export-form",(async function(e,t){const n=u(document,".js-audit-log-exporting"),s=u(document,".js-audit-log-export-menu");function o(e){s.hidden=e,n.hidden=!e}let r;o(!0);try{r=await t.json()}catch(a){return o(!1),void U()}const i=r.json;try{await z(i.job_url)}catch(a){return o(!1),void U()}o(!1),window.location=i.export_url}));const zs=new b;function Ws(e){const t=document.querySelector(".js-membership-tabs");if(t){const n=e.querySelectorAll(".js-bulk-actions-toggle:checked");t.classList.toggle("d-none",n.length>0)}}function Vs(){return u(document,".js-business-saml-provider-settings-form",HTMLFormElement)}function Js(){return Vs().querySelector(".js-business-saml-form-inputs")}function Ks(e){e&&e.classList.remove("d-none")}function Gs(){return"1"===u(document,".js-business-saml-currently-enabled",HTMLInputElement).value&&!u(document,".js-business-enable-saml",HTMLInputElement).checked}function Xs(){return u(document,".is-submit-button-value",HTMLInputElement)}function Ys(){Vs().submit()}function Qs(){const e=document.querySelector(".js-business-enable-saml");e&&e instanceof HTMLInputElement&&(e.checked=!0,Ks(Js()))}function Zs(){u(document,"#business_saml_provider_saml_deprovisioning_enabled",HTMLInputElement).checked=!1}function eo(){const e="0"===u(document,".js-business-two-factor-currently-enabled",HTMLInputElement).value;return u(document,".js-business-enable-two-factor",HTMLInputElement).checked&&e}let to;et("change",".js-bulk-actions-toggle",(function(e){const t=e.currentTarget,n=o(t,".js-bulk-actions-container");nt(n,"bulk-actions:update")})),et("bulk-actions:update",".js-bulk-actions-container",tt((async function(e){const t=e.target;if(!(t instanceof HTMLElement))return;const n=u(t,".js-bulk-actions"),s=!!t.querySelector(".js-bulk-actions-toggle:checked"),r=await zs.push(H(function(e){const t=new URL(i(e,"data-bulk-actions-url"),window.location.origin),n=new URLSearchParams(t.search.slice(1)),s=e.getAttribute("data-bulk-actions-parameter"),r=l(e,".js-bulk-actions-toggle:checked",HTMLInputElement);if(s){const e=r.map(e=>i(o(e,".js-bulk-actions-item"),"data-bulk-actions-id")).sort();for(const t of e)n.append(`${s}[]`,t)}else for(const o of r.sort((e,t)=>e.value>t.value?1:-1))n.append(o.name,o.value);return t.search=n.toString(),t.toString()}(t)));s?(Ws(t),n.innerHTML=r):(n.innerHTML=r,Ws(t)),nt(t,"bulk-actions:updated")}),100)),et("click",".js-preview-sign-in-message",(function(e){const t=u(document,"#custom_messages_sign_in_message",HTMLTextAreaElement).value;u(document,"#sign_in_message",HTMLInputElement).value=t;const n=e.currentTarget;if(!(n instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:11");if(!n.form)throw new Error("invariant: app/assets/modules/github/businesses.ts:12");n.form.submit()})),et("click",".js-preview-sign-out-message",(function(e){const t=u(document,"#custom_messages_sign_out_message",HTMLTextAreaElement).value;u(document,"#sign_out_message",HTMLInputElement).value=t;const n=e.currentTarget;if(!(n instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:19");if(!n.form)throw new Error("invariant: app/assets/modules/github/businesses.ts:20");n.form.submit()})),et("click",".js-preview-auth-provider-name",(function(e){const t=u(document,"#custom_messages_auth_provider_name",HTMLInputElement).value;u(document,"#auth_provider_name",HTMLInputElement).value=t;const n=e.currentTarget;if(!(n instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:27");if(!n.form)throw new Error("invariant: app/assets/modules/github/businesses.ts:28");m(n.form)})),et("click",".js-preview-suspended-message",(function(e){const t=u(document,"#custom_messages_suspended_message",HTMLTextAreaElement).value;u(document,"#suspended_message",HTMLInputElement).value=t;const n=e.currentTarget;if(!(n instanceof HTMLButtonElement&&n.form))throw new Error("invariant: app/assets/modules/github/businesses.ts:35");n.form.submit()})),et("click",".js-admin-settings-policy-input",(function({currentTarget:e}){if(!(e instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:39");const t=e.form;if(!(t instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:41");const n=u(t,'[aria-checked="true"]',HTMLButtonElement);m(t,n)})),et("click",".js-business-enable-saml",(function(e){if(!(e.currentTarget instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:108");e.currentTarget.checked?Ks(Js()):function(e){e&&e.classList.add("d-none")}(Js())})),et("click",".js-business-saml-submit",(function(e){e.preventDefault();const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:126");m(Vs(),t)})),et("submit",".js-business-saml-provider-settings-form",(function(e){e.preventDefault(),"test_settings"===Xs().name?Ys():"save_settings"===Xs().name&&(Gs()?async function(){(await M({content:u(document,"#disable-saml-confirmation",HTMLTemplateElement).content.cloneNode(!0)})).addEventListener("dialog:remove",Qs)}():Ys())})),et("submit",".js-enterprise-user-provisioning-form",(function(e){const t=u(e.currentTarget,'[name="business_saml_provider_saml_deprovisioning_enabled_previously"]',HTMLInputElement),n=u(e.currentTarget,"#business_saml_provider_saml_deprovisioning_enabled",HTMLInputElement);"0"===t.value&&n.checked&&(e.preventDefault(),async function(){(await M({content:u(document,"#enable-saml-deprovisioning-confirmation",HTMLTemplateElement).content.cloneNode(!0)})).addEventListener("dialog:remove",Zs)}())})),et("click",".js-enable-enable-saml-provider-button",(function(){const e=u(document,".js-enable-saml-provider-button",HTMLButtonElement),t=u(document,".js-enable-saml-provider-instruction",HTMLElement);e.disabled=!1,t.hidden=!0})),et("click",".js-suggested-org",(function(e){if(!(e.currentTarget instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/businesses.ts:183");if("true"===e.currentTarget.getAttribute("aria-disabled"))return;const t=o(e.currentTarget,"form"),n=u(e.currentTarget,".js-suggested-org-details-source");u(t,".js-suggested-org-details-target").innerHTML=n.innerHTML})),et("change",".js-invite-business-org-auto-complete",(function(e){const t=e.currentTarget;if(!(t instanceof st))throw new Error("invariant: app/assets/modules/github/businesses.ts:195");const n=o(t,"form"),s=u(n,".js-suggested-org-details-target");t.value||(s.innerHTML="")})),et("click",".js-business-two-factor-submit-button",(function(e){eo()||e.preventDefault()})),et("change",".js-repo-types-allowed-radio",()=>{const e=l(document,".js-repo-type-creation-checkbox",HTMLInputElement),t=l(document,".js-repo-type-creation-label",HTMLElement);for(const n of e)n.disabled=!1;for(const n of t)n.classList.remove("text-gray-light")}),et("change",".js-repo-types-disallowed-radio",()=>{const e=l(document,".js-repo-type-creation-checkbox",HTMLInputElement),t=l(document,".js-repo-type-creation-label",HTMLElement);for(const n of e)n.disabled=!0,n.checked=!1;for(const n of t)n.classList.add("text-gray-light")}),et("change",".js-provisioning-enabled-checkbox",()=>{if("0"===u(document,'[name="business_saml_provider_provisioning_enabled_previously"]',HTMLInputElement).value)return;const e=u(document,".js-provisioning-enabled-checkbox",HTMLInputElement),t=l(document,".js-disable-when-user-provisioning-disabled-checkbox",HTMLInputElement);if(e.checked)for(const n of t){const e=u(document,`[name='${n.id}_previously']`,HTMLInputElement);o(n,".js-deprovisioning-checkbox",HTMLElement).classList.remove("checkbox-disabled"),n.removeAttribute("disabled"),"1"===e.value?n.checked=!0:n.removeAttribute("checked")}else for(const n of t)n.setAttribute("disabled","disabled"),n.checked=!1,o(n,".js-deprovisioning-checkbox",HTMLElement).classList.add("checkbox-disabled")});let no=!1;function so(){to=document.activeElement,document.body&&document.body.classList.toggle("intent-mouse",no)}function oo(e){return e.hasAttribute("data-maxlength")?parseInt(e.getAttribute("data-maxlength")||""):e.maxLength}function ro(e){const t=oo(e);!function(e,t,n){const s=n.closest(".js-characters-remaining-container");if(!s)return;const o=u(s,".js-characters-remaining"),r=String(o.getAttribute("data-suffix")),i=t-W(e);i<=20?(o.textContent=`${i} ${r}`,o.classList.toggle("text-red",i<=5),o.hidden=!1):o.hidden=!0}(e.value,t,e)}function io(e){const t=e.querySelectorAll(".js-characters-remaining-container");for(const n of t){ro(u(n,".js-characters-remaining-field",HTMLInputElement))}}function ao(e){const t=[];for(const n of function(){try{return document.cookie.split(";")}catch(e){return[]}}()){const[s,o]=n.trim().split("=");e===s&&void 0!==o&&t.push({key:s,value:o})}return t}function co(e,t,n=null,s=!1){let o=document.domain;if(null==o)throw new Error("Unable to get document domain");o.endsWith(".github.com")&&(o="github.com");const r="https:"===location.protocol?"; secure":"",i=n?`; expires=${n}`:"";!1===s&&(o=`.${o}`);try{document.cookie=`${e}=${t}; path=/; domain=${o}${i}${r}`}catch(a){}}function lo(e,t=!1){let n=document.domain;if(null==n)throw new Error("Unable to get document domain");n.endsWith(".github.com")&&(n="github.com");const s=(new Date).getTime(),o=new Date(s-1).toUTCString(),r="https:"===location.protocol?"; secure":"",i=`; expires=${o}`;!1===t&&(n=`.${n}`);try{document.cookie=`${e}=''; path=/; domain=${n}${i}${r}`}catch(a){}}function uo(e){if(!window._octo)return;const t=Math.floor((new Date).getTime()/1e3);e.timestamp=t;if(document.head&&document.head.querySelector('meta[name="octolytics-event-url"]')){const t=u(document.head,'meta[name="octolytics-event-url"]',HTMLMetaElement).content,n=JSON.stringify(e);navigator.sendBeacon&&navigator.sendBeacon(t,n)}}function mo(){let e="";const t=ao("_octo"),n=[];for(const s of t){const t=s.value.split(".");if("GH1"===t.shift()&&t.length>1){const s=(t.shift()||"").split("-");1===s.length&&(s[1]="1");const o=[Number(s[0]),Number(s[1])];e=t.join("."),n.push([o,e])}}return e="",n.length>0&&(e=String(n.sort().reverse()[0][1])),e}document.addEventListener("mousedown",(function(){no=!0,to===document.activeElement&&so()}),{capture:!0}),document.addEventListener("keydown",(function(){no=!1}),{capture:!0}),document.addEventListener("focusin",so,{capture:!0}),c(".js-characters-remaining-field",(function(e){function t(){(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&ro(e)}t(),e.addEventListener("input",t),e.addEventListener("blur",()=>{e.removeEventListener("input",t)},{once:!0})})),et("click","[data-octo-click]",(function(e){if(!window._octo)return;const t=e.currentTarget,n=t instanceof HTMLElement&&t.getAttribute("data-octo-click")||"",s={};s.event_type=n;const o={},r={},i={};let a=[];t instanceof HTMLElement&&t.hasAttribute("data-octo-dimensions")&&(a=(t.getAttribute("data-octo-dimensions")||"").split(","));const c=document.head?document.head.querySelectorAll('meta[name^="octolytics-"]'):[];for(const u of c)if(u instanceof HTMLMetaElement)if(u.name.startsWith("octolytics-dimension-")){o[u.name.replace(/^octolytics-dimension-/,"")]=u.content}else if(u.name.startsWith("octolytics-measure-")){r[u.name.replace(/^octolytics-measure-/,"")]=u.content}else if(u.name.startsWith("octolytics-context-")){i[u.name.replace(/^octolytics-context-/,"")]=u.content}else if(u.name.startsWith("octolytics-actor-")){o[u.name.replace(/^octolytics-/,"").replace(/-/g,"_")]=u.content}else if(u.name.startsWith("octolytics-")){s[u.name.replace(/^octolytics-/,"").replace(/-/g,"_")]=u.content}const l=document.querySelector("meta[name=visitor-payload]");if(l instanceof HTMLMetaElement){const e=JSON.parse(atob(l.content));Object.assign(o,e)}if(t instanceof HTMLElement&&t.hasAttribute("data-ga-click")){const e=(t.getAttribute("data-ga-click")||"").split(",").map(e=>e.trim());o.category=e[0],o.action=e[1]}for(const u of a){const e=u.split(":"),t=e.shift();t&&(o[t]=e.join(":"))}s.dimensions=o,s.measures=r,s.context=i,uo(s)}));const fo={}.hasOwnProperty,po={host:"collector.githubapp.com",type:"page_view",dimensions:{},measures:{},context:{},actor:{},image:new Image,performance:{},expectedPerformanceTimingKeys:["connectEnd","connectStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domainLookupEnd","domainLookupStart","fetchStart","loadEventEnd","loadEventStart","navigationStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","secureConnectionStart","unloadEventEnd","unloadEventStart"],recordPageView(){return this.applyMetaTags(),null!=this.app&&(null==this.host?(console&&console.warn&&console.warn("Host not set, you are doing something wrong"),!1):(this.image.src=this._src(),this._clearPerformance(),!0))},setHost(e){this.host=e},setApp(e){this.app=e},setDimensions(e){this.dimensions=e},addDimensions(e){let t;null==this.dimensions&&(this.dimensions={});const n=[];for(t in e){if(!fo.call(e,t))continue;const s=e[t];n.push(this.dimensions[t]=s)}return n},setMeasures(e){this.measures=e},addMeasures(e){let t;null==this.measures&&(this.measures={});const n=[];for(t in e){if(!fo.call(e,t))continue;const s=e[t];n.push(this.measures[t]=s)}return n},setContext(e){this.context=e},addContext(e){let t;null==this.context&&(this.context={});const n=[];for(t in e){if(!fo.call(e,t))continue;const s=e[t];n.push(this.context[t]=s)}return n},setActor(e){this.actor=e},push(e){return this.applyCall(e)},enablePerformance(){this.performance=this._performanceTiming()},_recordSrc(e,t,n,s){return`//${this.host}/${this.app}/${e}?${this._queryString(t,n,s)}`},_src(){return`//${this.host}/${this.app}/${this.type}?${this._queryString()}`},_queryString(e,t,n){let s,o;const r=this._params(),i=[];for(s in r)o=r[s],i.push(`dimensions[${s}]=${o}`);return i.push(this._encodeObject("dimensions",Object.assign({},this.dimensions,e))),i.push(this._encodeObject("measures",Object.assign({},this.measures,t))),null!=this.performance&&i.push(this._encodeObject("measures",{performance_timing:String(this.performance)})),i.push(this._encodeObject("context",Object.assign({},this.context,n))),i.push(this._actor()),i.push(this._encodeObject("dimensions",{cid:this._clientId()})),i.join("&")},_clearPerformance(){this.performance=null},_performanceTiming(){if(null==window.performance||null==window.performance.timing||null==window.performance.timing.navigationStart)return null;const e=this.expectedPerformanceTimingKeys.reduce((e,t)=>{const n=window.performance.timing[t];return e[t]="number"==typeof n?n:0,e},{}),t=[],n=e.navigationStart;for(const s in e){const o=e[s],r=0===o?null:o-n;t.push(r)}return`1-${t.join("-")}`},_params(){return{page:this._encode(this._page()),title:this._encode(this._title()),referrer:this._encode(this._referrer()),user_agent:this._encode(this._agent()),screen_resolution:this._encode(this._screenResolution()),pixel_ratio:this._encode(this._pixelRatio()),browser_resolution:this._encode(this._browserResolution()),tz_seconds:this._encode(this._tzSeconds()),timestamp:(new Date).getTime()}},_page(){try{const e=document.querySelector("meta[name=octolytics-location]");return e instanceof HTMLMetaElement?document.location.origin+e.content:document.location.href}catch(e){}},_title(){try{return document.title}catch(e){}},_referrer(){let e="";try{e=window.top.document.referrer}catch(t){if(window.parent)try{e=window.parent.document.referrer}catch(t){}}return""===e&&(e=document.referrer),e},_agent(){try{return navigator.userAgent}catch(e){}},_screenResolution(){try{return`${screen.width}x${screen.height}`}catch(e){return"unknown"}},_pixelRatio:()=>window.devicePixelRatio,_browserResolution(){let e=0,t=0;try{return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):null!=document.documentElement&&null!=document.documentElement.clientWidth?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):null!=document.body&&null!=document.body.clientWidth&&(t=document.body.clientWidth,e=document.body.clientHeight),`${t}x${e}`}catch(n){return"unknown"}},_tzSeconds(){try{return-60*(new Date).getTimezoneOffset()}catch(e){return""}},_encodeObject(e,t){const n=[];if(Array.isArray(t))for(const s of t)n.push(this._encodeObject(`${e}[]`,s));else if("object"==typeof t)for(const s in t)n.push(this._encodeObject(`${e}[${s}]`,t[s]));else n.push(`${e}=${this._encode(t)}`);return n.join("&")},_actor(){let e,t,n;const s=[],o=this.actor;for(t in o){const r=o[t],i=`dimensions[actor_${t}]`;if(Array.isArray(r))for(e=0,n=r.length;e<n;e++){const t=r[e];s.push(`${i}[]=${this._encode(t)}`)}else s.push(`${i}=${this._encode(r)}`)}return s.join("&")},_clientId(){let e=mo();return""===e&&(e=function(){const e=(new Date).getTime(),t=`${Math.round(Math.random()*(Math.pow(2,31)-1))}.${Math.round(e/1e3)}`;return co("_octo",`GH1.1.${t}`,new Date(e+31536e6).toUTCString()),t}()),e},_encode:e=>null!=e?window.encodeURIComponent(e):"",applyQueuedCalls(e){const t=[];for(const n of e)t.push(this.applyCall(n));return t},applyCall(e){const t=e[0],n=e.slice(1);return"function"==typeof this[t]?this[t](...n):console&&console.warn&&console.warn(`${t} is not a valid method`)},applyMetaTags(){const e=this.loadMetaTags();return e.host&&this.setHost(e.host),e.app&&this.setApp(e.app),this._objectIsEmpty(e.actor)||this.setActor(e.actor),this.addDimensions(e.dimensions),this.addMeasures(e.measures),this.addContext(e.context)},loadMetaTags(){let e,t;const n={dimensions:{},measures:{},context:{},actor:{}},s=document.getElementsByTagName("meta");for(e=0,t=s.length;e<t;e++){const t=s[e];if(t.name&&t.content){const e=t.name.match(this.octolyticsMetaTagName);if(e)switch(e[1]){case"host":n.host=t.content;break;case"app-id":case"app":n.app=t.content;break;case"dimension":this._addField(n.dimensions,e[2],t);break;case"measure":this._addField(n.measures,e[2],t);break;case"context":this._addField(n.context,e[2],t);break;case"actor":this._addField(n.actor,e[2],t)}}}const o=document.querySelector("meta[name=visitor-payload]");if(o instanceof HTMLMetaElement){const e=JSON.parse(atob(o.content));this.addDimensions(e)}return n},_addField(e,t,n){e[t]=n.content},_objectIsEmpty(e){let t;for(t in e)if(fo.call(e,t))return!1;return!0},octolyticsMetaTagName:/^octolytics-(host|app-id|app|dimension|measure|context|actor)-?(.*)/};if(window._octo){if(window._octo.slice){const e=window._octo.slice(0);window._octo=po,window._octo.applyQueuedCalls(e)}}else window._octo=po;function go(e){const t=i(e,"data-fieldname");return document.querySelectorAll(`span[data-fieldname="${t}"]`)}function ho(e,t){if(e.value)for(const n of t)n.textContent=e.value}document.addEventListener("keydown",e=>{if("Escape"!==e.key)return;if(e.target!==document.body)return;const t=document.querySelector(".js-targetable-element:target");t&&V(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)||V(t,()=>{window.location.hash="",window.history.replaceState(null,"",window.location.pathname+window.location.search)})))}),c(".js-template-form-input",(function(e){if(!(e instanceof HTMLInputElement))return;const t=go(e);function n(){e instanceof HTMLInputElement&&ho(e,t)}function s(e){for(const n of t)n.classList.toggle("CommunityTemplate-highlight--focus",e)}s(!0),e.addEventListener("input",n),e.addEventListener("blur",(function t(){s(!1),e.removeEventListener("input",n),e.removeEventListener("blur",t)}))})),et("click",".js-template-highlight",(function(e){(function(e){const t=i(e,"data-fieldname");return u(document,`input[data-fieldname="${t}"]`,HTMLInputElement)})(e.currentTarget).focus()})),Qe(".js-templates",(function(){for(const e of l(document,".js-template-form-input",HTMLInputElement)){ho(e,go(e))}})),et("submit","form.js-post-recovery-token",(function(e){const t=e.currentTarget;t instanceof HTMLFormElement&&(e.preventDefault(),async function(e){const t=u(document,".js-delegated-account-recovery-submit",HTMLButtonElement),n=u(document,".js-create-recovery-token-form",HTMLFormElement);e.classList.remove("failed"),e.classList.add("loading"),t.disabled=!0;try{const t=await J(n),s=await t.json();K(e,{token:s.token,state:s.state_url}),e.submit()}catch(s){e.classList.remove("loading"),e.classList.add("failed"),t.disabled=!1}}(t))})),Qe("form.js-recovery-provider-auto-redirect",{constructor:HTMLFormElement,initialize:function(e){e.submit()}}),et("click",".js-sub-dependencies",(async function({currentTarget:e}){const t=e,n=t.getAttribute("data-loaded"),s=t.querySelector(".js-expanded"),o=t.querySelector(".js-collapsed"),r=t.closest(".js-details-container");if(s&&s.classList.toggle("d-none"),o&&o.classList.toggle("d-none"),r&&r.classList.toggle("bg-gray-light"),!n){t.setAttribute("data-loaded","true");const e=i(t,"data-sub-dependency-url"),n=t.closest(".js-dependency"),s=await k(document,e);n&&n.after(s)}}));let vo=null;function bo({currentTarget:e}){const t=e;if(t.hasAttribute("open")){const e=t.querySelector("[autofocus]");e&&e.focus()}else{const e=t.querySelector("summary");e&&e.focus()}}function jo({currentTarget:e}){const t=e;t.hasAttribute("open")?(vo&&vo!==t&&vo.removeAttribute("open"),vo=t):t===vo&&(vo=null)}function wo({currentTarget:e}){if(!(e instanceof Element))return;const t=o(e,"details"),n=i(t,"data-deferred-details-content-url");t.removeAttribute("data-deferred-details-content-url"),u(t,"include-fragment, poll-include-fragment",Ze).src=n}function Lo(e){return Array.from(e.types).indexOf("Files")>=0}document.addEventListener("keydown",(function(e){!e.defaultPrevented&&"Escape"===e.key&&vo&&vo.removeAttribute("open")})),Qe(".js-dropdown-details",{subscribe:e=>_(j(e,"toggle",jo),j(e,"toggle",bo))}),Qe("[data-deferred-details-content-url]:not([data-details-no-preload-on-hover])",{subscribe:e=>{const t=u(e,"summary");return j(t,"mouseenter",wo)}}),Qe("[data-deferred-details-content-url]",{subscribe:e=>j(e,"toggle",wo)}),et("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"))})),G((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)})),Qe(".js-document-dropzone",{constructor:HTMLElement,add(e){const t=document.body;if(!t)throw new Error("invariant: app/assets/modules/github/document-dropzone.ts:9");t.addEventListener("dragstart",Ho),t.addEventListener("dragend",xo),t.addEventListener("dragenter",Eo),t.addEventListener("dragover",Eo),t.addEventListener("dragleave",To),e.addEventListener("drop",ko)},remove(e){const t=document.body;if(!t)throw new Error("invariant: app/assets/modules/github/document-dropzone.ts:19");t.removeEventListener("dragstart",Ho),t.removeEventListener("dragend",xo),t.removeEventListener("dragenter",Eo),t.removeEventListener("dragover",Eo),t.removeEventListener("dragleave",To),e.removeEventListener("drop",ko)}});let yo=null;function Eo(e){if(So)return;const t=e.currentTarget;if(!(t instanceof Element))throw new Error("invariant: app/assets/modules/github/document-dropzone.ts:38");yo&&window.clearTimeout(yo),yo=window.setTimeout(()=>t.classList.remove("dragover"),200);const n=e.dataTransfer;n&&Lo(n)&&(n.dropEffect="copy",t.classList.add("dragover"),e.stopPropagation(),e.preventDefault())}function To(e){if(e.target instanceof Element&&e.target.classList.contains("js-document-dropzone")){if(!(e.currentTarget instanceof Element))throw new Error("invariant: app/assets/modules/github/document-dropzone.ts:56");e.currentTarget.classList.remove("dragover")}}function ko(e){const t=document.body;if(!t)throw new Error("invariant: app/assets/modules/github/document-dropzone.ts:62");const n=e.currentTarget;if(!(n instanceof Element))throw new Error("invariant: app/assets/modules/github/document-dropzone.ts:64");n.classList.remove("dragover"),t.classList.remove("dragover");const s=e.dataTransfer;s&&Lo(s)&&(nt(n,"document:drop",{transfer:s}),e.stopPropagation(),e.preventDefault())}let Mo,So=!1;function Ho(){So=!0}function xo(){So=!1}async function Ao(e){const t=e.getAttribute("data-url")||"";if(await async function(e){const t=e;if(!t)return!1;try{return(await A(t)).has_gravatar}catch(n){return!1}}(t)){const t=e.getAttribute("data-gravatar-text");null!=t&&(e.textContent=t)}}function qo(e){const t=Co();if(!t)return;Io(e,t);const n=function(e,t){const n=function(e,t){const n=/^(diff-[0-9a-f]{32})(?:[L|R]\d+)?$/.exec(t);if(!n)return;const s=n[1],o=e.querySelector(`a[name='${s}']`);if(!o)return;const r=o.nextElementSibling;if(r&&!r.querySelector(".js-diff-load-container"))return;return r}(e,t);if(n)return n;return function(e,t){const n=/^(?:r|commitcomment-)(\d+)$/.exec(t);if(!n)return;const s=n[1],o=e.querySelector(`#diff-with-comment-${s}`);if(!o)return;return o.closest(".js-file")}(e,t)}(e,t);n&&(X(n),_o(n))}function Co(){return window.location.hash.slice(1)}function Io(e,t){const n=F(e.ownerDocument,t);n&&e.contains(n)&&X(n)}function _o(e){const t=u(e,".js-diff-entry-loader",Ze),n=u(e,".js-diff-placeholder",Element),s=u(e,"button.js-diff-load",HTMLButtonElement),o=u(e,".js-button-text");n.setAttribute("fill","url('#animated-diff-gradient')"),o.textContent=s.getAttribute("data-disable-with")||"",s.disabled=!0;const r=new URL(t.getAttribute("data-fragment-url")||"",window.location.origin);return t.src=r.toString(),t.data}function $o(e,t){return l(document,".js-details-container.open.Details--on").filter(n=>n.getAttribute(e)===t)}function No(e,t,n,s,o){const r=u(document,".js-file-filter"),i=new URL(window.location.href,window.location.origin);if(!e&&!s){if(t)return;return i.search="",h(Y(),"",i.toString())}const a=u(r,".js-file-filter-form",HTMLFormElement),c=new FormData(a),l=n.filter(e=>!c.getAll("file-filters[]").includes(e)),d=o.filter(e=>!c.getAll("owned-by[]").includes(e));for(const u of l)c.append("file-filters[]",u);for(const u of d)c.append("owned-by[]",u);const m=new URLSearchParams(c);m.has("file-filters[]")&&""!==m.toString()||m.set("file-filters[]",""),t&&m.set("w","1"),i.search=m.toString(),h(Y(),"",i.toString())}function Do(e){var t;t=e,u(document,".js-file-filter-text",HTMLElement).classList.toggle("text-blue",t),function(e){const t=document.querySelector(".js-reset-filters"),n=document.querySelector(".js-commits-filtered");null==t||n||(t.hidden=!e)}(e),function(){const e=Fo(),t=Ko();for(const o of e)if(t){const e="0"===i(o,"data-non-deleted-files-count");o.disabled=e}else o.disabled=!1;const n=document.querySelector(".js-deleted-files-container"),s=Bo();if(s&&n){const t=function(e){const t=e.find(e=>e.checked&&"0"!==i(e,"data-deleted-files-count"));return Boolean(t)}(e);n.classList.toggle("text-gray",!t),s.disabled=!t}}(),function(){const e=Vo(),t=u(document,".js-file-filter-select-all-container",HTMLElement),n=i(t,e?"data-select-all-markup":"data-all-selected-markup");t.textContent=n,t.classList.toggle("text-gray",!e),t.classList.toggle("text-blue",e)}(),function(){const e=document.querySelector(".js-deleted-files-container");if(e){const t=Ko()?"data-show-deleted-markup":"data-hide-deleted-markup",n=i(e,t);e.textContent=n}}(),function(){const e=l(document,".js-file-type-count");for(const t of e){const e=Ko()?"data-non-deleted-file-count-markup":"data-all-file-count-markup",n=t.getAttribute(e);n&&(t.textContent=n)}}(),No(e,Jo(),Ro(),zo(),Wo())}function Po(e){!function(){const e=Bo(),t=Ro(),n=l(document,".js-file"),s=Wo(),o=Oo();for(const r of n){let n=!0;const i=r.getAttribute("data-file-type");if(i&&(n=t.includes(i)),o&&n){r.hasAttribute("data-file-user-viewed")&&(n=!o.checked)}if(s.length>0&&n){const e=(r.getAttribute("data-codeowners")||"").split(",");n=e.filter(e=>s.includes(e)).length>0}if(e&&e.checked&&n){"true"===r.getAttribute("data-file-deleted")&&(n=!1)}Go(r,n)}}(),Do(e)}function Ro(){return Fo().filter(e=>e.checked).map(e=>e.value)}function Fo(){return l(document,".js-diff-file-type-option",HTMLInputElement)}function Bo(){const e=document.querySelector(".js-deleted-files-toggle");if(e instanceof HTMLInputElement)return e}function Oo(){const e=document.querySelector(".js-viewed-files-toggle");if(e instanceof HTMLInputElement)return e}function Uo(){return Vo()||Ko()||zo()}function zo(){return Wo().length>0}function Wo(){return l(document,".js-diff-owner-option",HTMLInputElement).filter(e=>e.checked).map(e=>e.value)}function Vo(){return Ro().length!==Fo().length}function Jo(){return new URLSearchParams(window.location.search).has("w")}function Ko(){const e=Bo();return!!e&&e.checked}function Go(e,t){const n=o(e,".js-file.js-details-container");n.classList.toggle("open",t),n.classList.toggle("Details--on",t)}function Xo(e){const t=Fo();for(const n of t)n.checked=e}function Yo(e,t){const n=document.querySelector('.js-site-favicon[type="image/svg+xml"]'),s=document.querySelector('.js-site-favicon[type="image/png"]');t||(t="light");const o="light"===t?"":"-dark";if(n&&s)if(null==Mo&&(Mo=n.href),e){e=`${e=e.substr(0,e.lastIndexOf("."))}${o}.svg`,n.href=e;const t=n.href.substr(0,n.href.lastIndexOf("."));s.href=`${t}.png`}else{const e=n.href.indexOf("-dark.svg"),t=n.href.substr(0,-1!==e?e:n.href.lastIndexOf("."));n.href=`${t}${o}.svg`,s.href=`${t}${o}.png`}}function Qo(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}function Zo(){Q(document)&&Z(document)}Qe(".js-detect-gravatar",(function(e){Ao(e)})),Qe(".js-diff-progressive-container",(function(e){qo(e);const t=e.querySelector(".js-diff-progressive-loader");t&&t.addEventListener("load",(function(){qo(e)}))})),Qe(".js-diff-load-container",(function(e){const t=e.querySelector(".js-diff-entry-loader");t&&t.addEventListener("load",(function(){o(e,".js-file").classList.remove("hide-file-notes-toggle");const t=Co();t&&Io(e,t)}))})),et("click",".js-diff-load",(function(e){if(e.target.classList.contains("js-ignore-this"))return;_o(o(e.currentTarget,".js-diff-load-container"))})),et("click",".js-rendered, .js-source",(function(e){const t=e.currentTarget;t.classList.contains("selected")?e.preventDefault():(function(e){const t=o(e,".js-file-header"),n=e.classList.contains("js-rendered"),s=e.classList.contains("js-source"),r=i(t,"data-short-path"),a=i(t,"data-anchor"),c=new URL(window.location.href,window.location.origin),l=new URLSearchParams(c.search.slice(1));c.hash=a,n?l.set("short_path",r):s&&l.delete("short_path");c.search=l.toString(),h(null,"",c.toString())}(t),function(e){for(const t of document.querySelectorAll(".js-rendered, .js-source"))t.classList.remove("selected"),t.removeAttribute("aria-current");e.classList.add("selected"),e.setAttribute("aria-current","true")}(t))})),d(".js-prose-diff-toggle-form",(async function(e,t){const n=o(e,".js-details-container"),s=u(n,".js-file-content"),r=await t.html();for(;s.lastChild;)s.removeChild(s.lastChild);s.append(r.html),n.classList.toggle("display-rich-diff"),n.classList.toggle("show-inline-notes")})),et("change",".js-diff-style-toggle input",(function(e){if(!(e.target instanceof Element))return;const t=o(e.target,".js-diff-settings");for(const n of l(t,".js-diff-style-toggle label"))n.classList.toggle("selected")})),et("click",".js-toc-retry",(function(e){if(!(e.target instanceof Element))return;const t=o(e.target,".select-menu"),n=u(t,"include-fragment"),s=i(n,"src");n.setAttribute("src",""),n.setAttribute("src",s)})),et("change",".js-diff-file-type-option",(function(){Po(Uo())})),et("change",".js-diff-owner-option",(function(){Po(zo())})),et("click",".js-file-filter-select-all",(function(){Vo()&&(Xo(!0),Po(Uo()))})),et("change",".js-deleted-files-toggle",(function(){Po(Uo())})),et("change",".js-viewed-files-toggle",(function(){Po(Uo())})),Qe(".js-file-filter",(function(){Uo()?Do(!0):No(!1,Jo(),Ro(),zo(),Wo())})),et("click",".js-file-header .js-details-target",(function({currentTarget:e}){if(!document.querySelector(".js-file-filter"))return;const t=o(e,".js-details-container"),n=function(e){const t=i(e,"data-file-type"),n=$o("data-file-type",t),s=l(document,".js-diff-file-type-option",HTMLInputElement).find(e=>e.value===t);if(!s)return!1;const o=s.checked!==n.length>0;return o&&(s.checked=n.length>0),o}(t),s=Bo();let r=!1;s&&(r=function(e,t){let n=!1;if("true"===i(e,"data-file-deleted")){const e=$o("data-file-deleted","true");n=t.checked!==(0===e.length),n&&(t.checked=0===e.length)}return n}(t,s));const a=Oo();let c=!1;a&&(c=function(e,t){let n=!1;if("true"===e.getAttribute("data-file-user-viewed")){const e=$o("data-file-user-viewed","true");n=t.checked!==(0===e.length),n&&(t.checked=0===e.length)}return n}(t,a)),(n||r||c)&&Do(Uo())})),Qe("[data-favicon-override]",{add(e){const t=i(e,"data-favicon-override");setTimeout(()=>Yo(t,Qo()?"dark":"light"))},remove(){null!=Mo&&Yo(Mo,Qo()?"dark":"light")}}),Qo()&&Yo(void 0,"dark"),window.matchMedia("(prefers-color-scheme: dark)").addListener(()=>{Yo(void 0,Qo()?"dark":"light")}),G(Zo),et("click",'a[href^="#"]',(function(e){const{currentTarget:t}=e;t instanceof HTMLAnchorElement&&setTimeout(Zo,0)}));const er=["flash-notice","flash-error","flash-message","flash-warn"];function tr(e,t,n){let s;try{s=atob(decodeURIComponent(n))}catch(i){return}const o=e.content.cloneNode(!0),r=o.querySelector(".js-flash-template-container");r.classList.add(t),r.querySelector(".js-flash-template-message").textContent=s,e.after(o)}Qe("template.js-flash-template",{constructor:HTMLTemplateElement,add(e){!function(e){for(const{key:t,value:n}of er.flatMap(ao))lo(t),tr(e,t,n)}(e)}}),d(".js-form-toggle-target",(async function(e,t){await t.text();const n=o(e,".js-form-toggle-container");u(n,".js-form-toggle-target[hidden]").hidden=!1,e.hidden=!0}));class nr{constructor(e){this.name=e.getAttribute("data-theme-name")||"",this.slug=e.getAttribute("data-theme-slug")||"",this.gem=e.getAttribute("data-theme-gem")||"",this.selected=e.classList.contains("selected"),this.baseHref=e.getAttribute("href")||""}}class sr{constructor(){this.pagePreview=u(document,"#page-preview"),this.contextLoader=u(document,".theme-picker-spinner"),this.fullPicker=u(document,".theme-picker-thumbs"),this.miniPicker=u(document,".theme-picker-controls"),this.scrollBackwardsLink=u(document,".theme-toggle-full-left",HTMLButtonElement),this.scrollForwardsLink=u(document,".theme-toggle-full-right",HTMLButtonElement),this.themeLinksContainer=u(this.fullPicker,".js-theme-selector"),this.themeLinks=l(this.themeLinksContainer,".theme-selector-thumbnail"),this.themes=this.themeLinks.map(e=>{const t=new nr(e);return t.selected&&(this.selectedTheme=t),t}),this.scrolledPage=0,this.selectedTheme=this.selectedTheme||this.themes[0],this.pagePreview.addEventListener("load",()=>this.onPagePreviewLoad()),this.scrollBackwardsLink.addEventListener("click",()=>this.scrollThemeLinksContainer(-1)),this.scrollForwardsLink.addEventListener("click",()=>this.scrollThemeLinksContainer(1)),u(document,".theme-picker-prev").addEventListener("click",e=>this.onThemeNavPrevClick(e)),u(document,".theme-picker-next").addEventListener("click",e=>this.onThemeNavNextClick(e));for(const t of this.themeLinks)t.addEventListener("click",e=>this.onThemeLinkClick(e));u(document,".theme-picker-view-toggle").addEventListener("click",e=>this.onHideClick(e));const e=document.querySelector("#page-edit");e&&e.addEventListener("click",e=>this.onEditClick(e)),u(document,"#page-publish").addEventListener("click",e=>this.onPublishClick(e)),this.theme(this.selectedTheme),this.updateScrollLinks()}onPagePreviewLoad(){this.contextLoader.classList.remove("visible")}onThemeNavPrevClick(e){this.theme(this.prevTheme()),e.preventDefault()}onThemeNavNextClick(e){this.theme(this.nextTheme()),e.preventDefault()}onThemeLinkClick(e){this.theme(this.themeForLink(e.currentTarget)),e.preventDefault()}onHideClick({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/generated-pages-theme-picker.ts:68");this.fullPicker.classList.toggle("d-none"),this.miniPicker.classList.toggle("d-none"),this.scrollToTheme(this.theme(),!1),e.classList.toggle("open")}onEditClick(e){m(u(document,"#page-edit-form",HTMLFormElement)),e.preventDefault()}onPublishClick(e){const t=u(document,"#page-publish-form",HTMLFormElement),n=this.theme();n&&(u(document,'input[name="page[theme_slug]"]',HTMLInputElement).value=n.slug),m(t),e.preventDefault()}scrollThemeLinksContainer(e){this.scrollToTheme(this.themes[e<0?0:6]),this.updateScrollLinks()}updateScrollLinks(){const e=0===this.scrolledPage;this.scrollBackwardsLink.disabled=e,this.scrollBackwardsLink.classList.toggle("disabled",e),this.scrollForwardsLink.disabled=!e,this.scrollForwardsLink.classList.toggle("disabled",!e)}selectedThemeIndex(){return this.themes.indexOf(this.selectedTheme)}prevTheme(){let e=(this.selectedThemeIndex()-1)%this.themes.length;return e<0&&(e+=this.themes.length),this.themes[e]}nextTheme(){return this.themes[(this.selectedThemeIndex()+1)%this.themes.length]}themeForLink(e){return this.themes[this.themeLinks.indexOf(e)]}linkForTheme(e){return this.themeLinks[this.themes.indexOf(e)]}scrollToTheme(e,t=!0){this.scrolledPage=Math.floor(this.themes.indexOf(e)/6);let n=0;if(this.scrolledPage>0){const e=this.linkForTheme(this.themes[6*this.scrolledPage]);n=e.offsetLeft}const s=this.themeLinksContainer,o=n-s.scrollLeft;if(t&&0!==o){const e=150;!function(e){new Promise(t=>{let n=performance.now();!function s(){window.requestAnimationFrame(o=>{!1!==e(o-n)?(n=o,s()):t()})}()})}(t=>{if(t<0)return;const r=s.scrollLeft;return s.scrollLeft=Math[n-r>0?"min":"max"](r+o*(t/e),n),r!==s.scrollLeft&&void 0})}else s.scrollLeft=n}theme(e){if(!e)return this.selectedTheme;this.selectedTheme=e,this.showPreviewFor(e);for(const t of this.themeLinks)t.classList.remove("selected");this.linkForTheme(e).classList.add("selected"),this.scrollToTheme(e),u(this.miniPicker,".js-theme-name").textContent=e.name}showPreviewFor(e){if(this.contextLoader.classList.add("visible"),e.gem)this.pagePreview.setAttribute("src",e.baseHref);else{const t=u(this.fullPicker,"form",HTMLFormElement);u(document,'input[name="theme_slug"]',HTMLInputElement).value=e.slug,m(t)}}}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function or(e,t,n,s){var o,r=arguments.length,i=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i}function rr(e,t){Object.defineProperty(e,t,{configurable:!0,get:function(){return function(e,t){const n=e.tagName.toLowerCase();for(const s of e.querySelectorAll(`[data-target*="${n}.${t}"]`))if(s.closest(n)===e)return s}(this,t)}})}function ir(e,t){Object.defineProperty(e,t,{configurable:!0,get:function(){return function(e,t){const n=e.tagName.toLowerCase(),s=[];for(const o of e.querySelectorAll(`[data-target*="${n}.${t}"]`))o.closest(n)===e&&s.push(o);return s}(this,t)}})}function ar(e){!function(e,t,n){if(e[t]){const s=e[t];e[t]=function(...e){n.apply(this,e),s.apply(this,e)}}else e[t]=n}(e.prototype,"connectedCallback",(function(){!function(e){const t=e.tagName.toLowerCase();for(const n of e.querySelectorAll(`[data-action*=":${t}#"]`))if(n.closest(t)===e)for(const s of(n.getAttribute("data-action")||"").split(" ")){const[o,r]=s.split("#"),[i,a]=o.split(":");if(a!==t)continue;const c=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e),r);c&&"function"==typeof c.value&&n.addEventListener(i,t=>{e[r](t)})}}(this)})),function(e){const t=e.name.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase();window.customElements.get(t)||(window[e.name]=e,window.customElements.define(t,e))}(e)}function cr(){return/Windows/.test(navigator.userAgent)?"windows":/Macintosh/.test(navigator.userAgent)?"mac":null}function lr(e){const t=i(e,"data-platforms").split(","),n=cr();return Boolean(n&&t.includes(n))}Qe("#theme-picker-wrap",(function(){new sr})),Qe(".js-remove-unless-platform",(function(e){lr(e)||e.remove()})),Qe(".js-show-for-platform",{constructor:HTMLElement,add(e){lr(e)&&(e.hidden=!1)}}),Qe(".js-hide-for-platform",{constructor:HTMLElement,add(e){lr(e)&&(e.hidden=!0)}});let ur=class GetRepoController extends HTMLElement{showDownloadMessage(e){const t=e.currentTarget.getAttribute("data-open-app")||cr();if(t){this.modal.classList.add("is-downloading");for(const e of this.platforms)e.getAttribute("data-platform")===t&&(e.hidden=!1)}}onDetailsToggle(){this.modal.classList.remove("is-downloading");for(const e of this.platforms)e.hidden=!0}};or([rr],ur.prototype,"modal",void 0),or([ir],ur.prototype,"platforms",void 0),ur=or([ar],ur),et("click",".email-hidden-toggle",(function(e){const t=e.currentTarget.nextElementSibling;t instanceof HTMLElement&&(t.style.display="",t.classList.toggle("expanded"),e.preventDefault())}));let dr=class GitCloneHelpController 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 s of this.helpTexts)s.textContent=n;for(const s of this.cloneURLButtons)s.classList.remove("selected");t.classList.add("selected")}};function mr(e){try{return sessionStorage.getItem(e)}catch(t){return null}}function fr(e,t){try{sessionStorage.setItem(e,t)}catch(n){}}function pr(e){try{sessionStorage.removeItem(e)}catch(t){}}function gr(e){const t=document.querySelectorAll(e);if(t.length>0)return t[t.length-1]}function hr(){return`${window.location.protocol}//${window.location.host}${function(){const e=gr("meta[name=analytics-location]");return e?e.content:window.location.pathname}()+function(){let e="";gr("meta[name=analytics-location-query-strip]")||(e=window.location.search);const t=gr("meta[name=analytics-location-params]");t&&(e+=(e?"&":"?")+t.content);for(const n of document.querySelectorAll("meta[name=analytics-param-rename]")){const t=n.content.split(":",2);e=e.replace(new RegExp(`(^|[?&])${t[0]}($|=)`,"g"),`$1${t[1]}$2`)}return e}()}`}function vr(){te(hr()),ne(gr("meta[name=analytics-location]")?"(masked)":document.title);const e=document.querySelector("meta[name=analytics-ec-payload]");e instanceof HTMLMetaElement&&br(e.content);const t=mr("ga-deferred");t&&(br(t),pr("ga-deferred"));for(const n of l(document,"meta.js-ga-set",HTMLMetaElement))se(n.name,n.content)}function br(e){if(e)for(const t of JSON.parse(e))window.ga.apply(null,t)}function jr(){for(const e of document.querySelectorAll("meta[name=analytics-virtual-pageview]"))e instanceof HTMLMetaElement&&oe(e.content,{title:""});oe()}function wr(e){const[t,n,s,o]=e.trim().split(/\s*,\s*/);return o?{category:t,action:n,label:s,value:Number(o)}:{category:t,action:n,label:s}}or([rr],dr.prototype,"helpField",void 0),or([ir],dr.prototype,"helpTexts",void 0),or([ir],dr.prototype,"cloneURLButtons",void 0),dr=or([ar],dr),ee("octolyticsPlugin",(function(e){const t=e.get("sendHitTask");e.set("sendHitTask",(function(e){if(t(e),"event"===e.get("hitType")&&window._octo){const t=`//${window._octo.host}/collect`,n=new Blob([e.get("hitPayload")],{type:"application/x-www-form-urlencoded"});navigator.sendBeacon&&navigator.sendBeacon(t,n)}}))}));const Lr=document.querySelector("meta[name=google-analytics]");Lr instanceof HTMLMetaElement&&(re(Lr.content,"auto"),ie("octolyticsPlugin"),ie("ec"),vr()),async function(){await p,jr()}(),document.addEventListener("pjax:complete",()=>{setTimeout(()=>{vr(),jr()},20)},!1),Qe("[data-ga-load]",(function(e){const t=wr(e.getAttribute("data-ga-load")||"");t.interactive=!1,ae(t)})),Qe("meta[name=analytics-event]",{constructor:HTMLMetaElement,initialize(e){const t=wr(e.content);t.interactive=!1,ae(t)}}),et("click","[data-ga-click]",(function(e){br(e.currentTarget.getAttribute("data-ga-ec")||"");const t=wr(e.currentTarget.getAttribute("data-ga-click")||"");ae(t)}),{capture:!0}),et("click","[data-ga-deferred]",(function(e){fr("ga-deferred",e.currentTarget.getAttribute("data-ga-deferred")||"")}),{capture:!0}),et("change","[data-ga-change]",(function(e){br(e.currentTarget.getAttribute("data-ga-ec")||"");const t=wr(e.currentTarget.getAttribute("data-ga-change")||"");ae(t)}),{capture:!0}),et("click",".js-skip-to-content",(function(e){const t=document.getElementById("start-of-content");if(t){const e=t.nextElementSibling;e instanceof HTMLElement&&(e.setAttribute("tabindex","-1"),e.focus())}e.preventDefault()}));const yr="ontouchstart"in document;for(const e of document.querySelectorAll(".HeaderMenu-details"))e.addEventListener("toggle",Tr),yr||(e.addEventListener("mouseover",kr),e.addEventListener("mouseleave",kr));let Er=!1;function Tr(e){if(!Er){Er=!0;for(const t of document.querySelectorAll(".HeaderMenu-details"))t!==e.currentTarget&&t.removeAttribute("open");setTimeout(()=>Er=!1)}}function kr(e){const{currentTarget:t}=e;t instanceof HTMLElement&&window.innerWidth>1012&&("mouseover"===e.type&&e instanceof MouseEvent?e.target instanceof Node&&e.relatedTarget instanceof Node&&t.contains(e.target)&&!t.contains(e.relatedTarget)&&t.setAttribute("open",""):t.removeAttribute("open"))}et("click",".js-video-play, .js-video-close",(function(e){e.preventDefault();const t=e.currentTarget,n=t.classList.contains("js-video-play"),s=o(t,".js-video-container"),r=u(s,".js-video-iframe",HTMLIFrameElement),i=document.querySelector(".js-video-bg");n?r.src=r.getAttribute("data-src")||"":r.removeAttribute("src"),s.classList.toggle("is-expanded",n),null!=i&&i.classList.toggle("is-expanded",n),function(e,t=0){const n=e.getBoundingClientRect(),s=n.top-t,o=n.bottom-window.innerHeight+t;s<0?window.scrollBy(0,s):o>0&&window.scrollBy(0,o)}(r,20)}));const Mr=document.querySelector(".js-hovercard-content"),Sr=S(k);let Hr,xr,Ar=null,qr=0;function Cr(e){return"Popover-message--"+e}function Ir(){Mr instanceof HTMLElement&&(Mr.style.display="none",Mr.children[0].innerHTML="",Ar=null,Hr=null)}function _r(e){if(!(Mr instanceof HTMLElement))throw new Error("invariant violation, cardContentContainer is not HTMLElement");const{width:t,height:n}=Mr.getBoundingClientRect(),{left:s,top:o,height:r,width:i}=function(e){const t=e.getClientRects();let n=t[0]||{top:0,left:0,height:0,width:0};for(const s of t)if(s.left<qr&&s.right>qr){n=s;break}return n}(e),a=o>n;if(e.classList.contains("js-hovercard-left")){const e=o+r/2;return{containerTop:a?e-n+17+8:e-17-8,containerLeft:s-t-12,contentClassSuffix:a?"right-bottom":"right-top"}}{const e=window.innerWidth-s>t,c=s+i/2;return{containerTop:a?o-n-12:o+r+12,containerLeft:e?c-24:c-t+24,contentClassSuffix:a?e?"bottom-left":"bottom-right":e?"top-left":"top-right"}}}function $r(e,t){if(!(Mr instanceof HTMLElement))return;const n=Mr.children[0];n.innerHTML="";const s=document.createElement("div");for(const o of e.children)s.appendChild(o.cloneNode(!0));n.appendChild(s),function(e,t){if(!(Mr instanceof HTMLElement))return;Mr.style.visibility="hidden",Mr.style.display="block",t.classList.remove(Cr("bottom-left"),Cr("bottom-right"),Cr("right-top"),Cr("right-bottom"),Cr("top-left"),Cr("top-right"));const{containerTop:n,containerLeft:s,contentClassSuffix:o}=_r(e);t.classList.add(Cr(o)),Mr.style.top=`${n+window.pageYOffset}px`,Mr.style.left=`${s+window.pageXOffset}px`,function(e,t){const n=e.getAttribute("data-hovercard-z-index-override");t.style.zIndex=n||"100"}(e,Mr),Mr.style.visibility=""}(t,n),function(e){setTimeout(()=>{if(document.body&&document.body.contains(e)){const t=e.querySelector("[data-hovercard-tracking]");if(t){const e=t.getAttribute("data-hovercard-tracking");if(e){const t={event_type:"user-hovercard-load"};t.dimensions=JSON.parse(e),uo(t)}}const n=e.querySelector("[data-hydro-view]");n instanceof HTMLElement&&ce(n)}},500)}(s),Mr.style.display="block"}function Nr(e){const t=e.getAttribute("data-hovercard-url");if(t){const n=function(e){const t=e.closest("[data-hovercard-subject-tag]");if(t)return t.getAttribute("data-hovercard-subject-tag");const n=document.head&&document.head.querySelector('meta[name="hovercard-subject-tag"]');return n?n.getAttribute("content"):null}(e);if(n){const e=new URL(t,window.location.origin),s=new URLSearchParams(e.search.slice(1));return s.append("subject",n),s.append("current_path",window.location.pathname+window.location.search),e.search=s.toString(),e.toString()}return t}return""}function Dr(e){!async function(e,t){const n=e.currentTarget;if(e instanceof MouseEvent&&(qr=e.clientX),!(n instanceof Element))return;if(Hr===n)return;if(n.closest(".js-hovercard-content"))return;if(!function(e){const t=e.getAttribute("data-hovercard-type");return"pull_request"===t||"issue"===t?!!e.closest("[data-issue-and-pr-hovercards-enabled]"):"team"===t?!!e.closest("[data-team-hovercards-enabled]"):"repository"===t?!!e.closest("[data-repository-hovercards-enabled]"):"commit"===t?!!e.closest("[data-commit-hovercards-enabled]"):"project"===t?!!e.closest("[data-project-hovercards-enabled]"):"contributors"===t?!!e.closest("[data-contributors-hovercards-enabled]"):"discussion"===t?!!e.closest("[data-discussion-hovercards-enabled]"):"acv_badge"!==t||!!e.closest("[data-acv-badge-hovercards-enabled]")}(n))return;Ir(),Hr=n,Ar=document.activeElement;const s=Nr(n);let o;try{const e=new Promise(e=>window.setTimeout(e,t,0));o=await Sr(document,s),await e}catch(r){const e=r.response;if(e&&404===e.status){const e="Hovercard is unavailable";n.setAttribute("aria-label",e),n.classList.add("tooltipped","tooltipped-ne")}else if(e&&410===e.status){const t=await e.clone().json();n.setAttribute("aria-label",t.message),n.classList.add("tooltipped","tooltipped-ne")}return}n===Hr&&($r(o,n),e instanceof KeyboardEvent&&Mr instanceof HTMLElement&&Mr.focus())}(e,250)}function Pr(e){if(Hr){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&&Ar instanceof HTMLElement&&Ar.focus();Ir()}}function Rr(e){const t=Hr;xr=window.setTimeout(()=>{Hr===t&&Pr(e)},100)}function Fr(e){if(e instanceof KeyboardEvent)switch(e.key){case"Escape":Pr(e)}}function Br(){xr&&clearTimeout(xr)}function Or(){return u(document,"input.js-edit-integration-setup-url",HTMLInputElement)}function Ur(){return u(document,".js-help-text-for-redirect-on-update")}function zr(e){e&&((function(){const e=o(Or(),".form-group");return u(e,".js-setup-url-hint")}()).textContent=e)}function Wr(){const e=document.getElementById("js-update-integration-permissions");e&&e.removeAttribute("disabled")}function Vr(){return function(){const e=l(document,'[id^=integration_permission_]:checked:not([data-permission="none"])',HTMLInputElement);return Array.from(e,e=>e.getAttribute("data-resource"))}().map(e=>function(e){if(e)return l(document,`.js-integration-hook-event[data-resource~="${e}"]:checked`,HTMLInputElement)}(e)).reduce((e,t)=>e.concat(t,[]),[])}function Jr(e=!1){const t=u(document,".js-integration-permissions-selector [id=integration_permission_metadata_read]",HTMLInputElement),n=o(t,".js-list-group-item");e&&y(t,!0),u(n,".js-mandatory-label").hidden=!e;for(const s of l(n,"input",HTMLInputElement))s!==t&&(s.disabled=e)}function Kr(){const e=u(document,".js-content-references input",HTMLInputElement),t=u(document,".js-content-references template",HTMLTemplateElement),n=u(document,".js-content-references-domain-list"),s=e.value;if(!s)return;const r=t.content.cloneNode(!0);r instanceof DocumentFragment&&(u(r,"input",HTMLInputElement).value=s,u(r,".js-content-references-domain-url").textContent=s,e.value="",n.appendChild(r),o(n,".Box").hidden=!1,Wr())}async function Gr({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/issue-link.ts:7");const t=e.getAttribute("data-url");if(!t)return;const n=e.getAttribute("data-id")||"",s=e.textContent,o=document.querySelectorAll(`.js-issue-link[data-id='${n}']`);for(const i of o)i.removeAttribute("data-url");try{Xr(o,`${s}, ${(await A(t)).title}`)}catch(r){const t=(null!=r.response?r.response.status:void 0)||500;Xr(o,(()=>{switch(t){case 404:return e.getAttribute("data-permission-text");default:return e.getAttribute("data-error-text")}})()||"")}}function Xr(e,t){for(const n of e)n instanceof HTMLElement&&(Yr(n)||n.classList.add("tooltipped","tooltipped-ne"),n.setAttribute("aria-label",t))}function Yr(e){return!!e.getAttribute("data-hovercard-url")&&!!e.closest("[data-issue-and-pr-hovercards-enabled]")}Mr&&(Qe("[data-hovercard-url]",{subscribe:e=>_(j(e,"mouseover",Dr),j(e,"mouseleave",Rr),j(e,"keyup",Fr))}),Qe("[data-hovercard-url]",{remove(e){Hr===e&&Ir()}}),Qe(".js-hovercard-content",{subscribe:e=>_(j(e,"mouseover",Br),j(e,"mouseleave",Pr),j(e,"keyup",Fr))}),Qe(".js-hovercard-include-fragment",{constructor:HTMLTemplateElement,add(e){Hr&&$r(e.content,Hr)}}),et("menu:activated","details",Ir),window.addEventListener("statechange",Ir)),Qe(".js-scrollnav-listener",(function(e){window.addEventListener("scroll",(function(){!function(e){const t=u(e,".js-scrollnav").getBoundingClientRect().height;for(const n of e.querySelectorAll(".js-section")){const s=n.getBoundingClientRect(),o=t>=s.top,r=t<=s.top+s.height;if(o&&r){const t=e.querySelector(`.js-scrollnav-item[href="#${n.id}"]`);if(t&&!t.classList.contains("selected")){for(const t of e.querySelectorAll(".js-scrollnav-item"))t.classList.remove("selected");t.classList.add("selected")}}}}(e)}),{passive:!0})})),et("change",".js-edit-integration-request-oauth-on-install",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/integrations/edit.ts:22");const n=Or();if(t.checked){n.disabled=!0,n.placeholder=n.getAttribute("data-hint-unavailable-when-install")||"",zr(n.getAttribute("data-hint-same-as-callback-url")||"");const e=Ur();e.textContent=e.getAttribute("data-hint-redirect-on-update-callback-url")||""}else{n.disabled=!1,n.placeholder="",n.value=n.getAttribute("data-setup-url")||"",zr(n.getAttribute("data-hint-setup-url")||"");const e=Ur();e.textContent=e.getAttribute("data-hint-redirect-on-update-setup-url")||""}})),et("change",".js-integration-permissions-selector [id^=integration_permission_]",(function({currentTarget:e}){const t=e.getAttribute("data-permission"),n=e.getAttribute("data-resource")||"",s=l(document,`.js-integration-hook-event[data-resource~="${n}"]`,HTMLInputElement),r=l(document,".js-integration-single-file-resource",HTMLInputElement),i=l(document,`.js-dropdown-container[data-resource~="${n}"]`);if(Wr(),"none"!==t){const t=l(document,`.js-integration-hook-event-permission-error[data-resource~='${n}']`);for(const e of t)e.classList.add("d-none");const a=l(document,".js-integration-single-file-permission-error");for(const e of a)e.classList.add("d-none");for(const e of s)e.readOnly=!1;for(const e of r)e.readOnly=!1;o(e,".js-list-group-item").classList.remove("disabled");for(const e of i)e.classList.remove("d-none")}else{for(const e of s)a=e,Vr().includes(a)||(e.readOnly=!0,e.checked=!1,o(e,".js-dropdown-container").classList.add("anim-fade-in","d-none"));if(o(e,".js-list-group-item").classList.add("disabled"),"single_file"===n)for(const e of r)e.readOnly=!0,e.value="";else"content_references"===n&&(u(document,`.js-dropdown-container[data-resource~='${n}']`).classList.add("anim-fade-in","d-none"),"none"===t&&(u(document,".js-content-references-domain-list").innerHTML=""))}var a})),et("change",".js-hook-active-checkbox",(function({currentTarget:e}){if(!(e instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/integrations.ts:116");for(const t of document.querySelectorAll(".js-integration-hook-enabled")){if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/integrations.ts:118");t.hidden=!e.checked}})),et("change",".js-integration-permissions-selector [id^=integration_permission_][data-resource-parent^=repository]",(function({currentTarget:e}){const t=e.getAttribute("data-permission");"metadata"!==(e.getAttribute("data-resource")||"")&&("none"!==t?Jr(!0):function(){let e=!0;const t=document.querySelectorAll(".js-integration-permissions-selector [id^=integration_permission_][data-resource-parent=repository]:checked");for(const n of t){const t=n.getAttribute("data-permission")||"none";if("metadata"!==(n.getAttribute("data-resource")||"")&&"none"!==t){e=!1;break}}return e}()&&Jr())})),et("change",".js-integration-permissions-selector [name^=integration]",Wr),et("click",".js-integration-permissions-selector .js-integration-hook-event",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/integrations.ts:176");if(t.readOnly){const n=o(t,".js-send-events");u(n,".js-integration-hook-event-permission-error").classList.remove("d-none"),e.preventDefault()}})),et("click",".js-integration-permissions-selector .js-integration-single-file-resource",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/integrations.ts:187");if(t.readOnly){const n=o(t,".js-single-file");u(n,".js-integration-single-file-permission-error").classList.remove("d-none"),e.preventDefault()}})),s("keydown",".js-content-references input",(function(e){"Enter"===e.key&&(e.preventDefault(),Kr())})),et("click",".js-content-references .js-domain-add",Kr),et("click",".js-content-references .js-close",(function(e){if(!(e.target instanceof Element))return;const t=o(e.target,"li"),n=t.parentElement;n&&(n.removeChild(t),0===l(n,"li").length&&(o(n,".Box").hidden=!0),Wr())})),Qe(".js-issue-link",{subscribe:e=>j(e,"mouseenter",Gr)});var Qr=le((function(e,t){!function(n,s){var o=function(){var e=null,t={};r("monochrome",null,[[0,0],[100,0]]),r("red",[-26,18],[[20,100],[30,92],[40,89],[50,85],[60,78],[70,70],[80,60],[90,55],[100,50]]),r("orange",[19,46],[[20,100],[30,93],[40,88],[50,86],[60,85],[70,70],[100,70]]),r("yellow",[47,62],[[25,100],[40,94],[50,89],[60,86],[70,84],[80,82],[90,80],[100,75]]),r("green",[63,178],[[30,100],[40,90],[50,85],[60,81],[70,74],[80,64],[90,50],[100,40]]),r("blue",[179,257],[[20,100],[30,86],[40,80],[50,74],[60,60],[70,52],[80,44],[90,39],[100,35]]),r("purple",[258,282],[[20,100],[30,87],[40,79],[50,70],[60,65],[70,59],[80,52],[90,45],[100,42]]),r("pink",[283,334],[[20,100],[30,90],[40,86],[60,84],[80,80],[90,75],[100,73]]);var n=function(r){if(void 0!==(r=r||{}).seed&&null!==r.seed&&r.seed===parseInt(r.seed,10))e=r.seed;else if("string"==typeof r.seed)e=function(e){for(var t=0,n=0;n!==e.length&&!(t>=Number.MAX_SAFE_INTEGER);n++)t+=e.charCodeAt(n);return t}(r.seed);else{if(void 0!==r.seed&&null!==r.seed)throw new TypeError("The seed value must be an integer or string");e=null}var c,l;if(null!==r.count&&void 0!==r.count){var u=r.count,d=[];for(r.count=null;u>d.length;)e&&r.seed&&(r.seed+=1),d.push(n(r));return r.count=u,d}return function(e,t){switch(t.format){case"hsvArray":return e;case"hslArray":return a(e);case"hsl":var n=a(e);return"hsl("+n[0]+", "+n[1]+"%, "+n[2]+"%)";case"hsla":var s=a(e),o=t.alpha||Math.random();return"hsla("+s[0]+", "+s[1]+"%, "+s[2]+"%, "+o+")";case"rgbArray":return i(e);case"rgb":return"rgb("+i(e).join(", ")+")";case"rgba":var r=i(e);o=t.alpha||Math.random();return"rgba("+r.join(", ")+", "+o+")";default:return function(e){var t=i(e);function n(e){var t=e.toString(16);return 1==t.length?"0"+t:t}return"#"+n(t[0])+n(t[1])+n(t[2])}(e)}}([c=function(e){var n=o(function(e){if("number"==typeof parseInt(e)){var n=parseInt(e);if(n<360&&n>0)return[n,n]}if("string"==typeof e)if(t[e]){var s=t[e];if(s.hueRange)return s.hueRange}else if(e.match(/^#?([0-9A-F]{3}|[0-9A-F]{6})$/i)){var o=function(e){e=3===(e=e.replace(/^#/,"")).length?e.replace(/(.)/g,"$1$1"):e;var t=parseInt(e.substr(0,2),16)/255,n=parseInt(e.substr(2,2),16)/255,s=parseInt(e.substr(4,2),16)/255,o=Math.max(t,n,s),r=o-Math.min(t,n,s),i=o?r/o:0;switch(o){case t:return[(n-s)/r%6*60||0,i,o];case n:return[60*((s-t)/r+2)||0,i,o];case s:return[60*((t-n)/r+4)||0,i,o]}}(e)[0];return[o,o]}return[0,360]}(e.hue));n<0&&(n=360+n);return n}(r),l=function(e,t){if("monochrome"===t.hue)return 0;if("random"===t.luminosity)return o([0,100]);var n=function(e){return s(e).saturationRange}(e),r=n[0],i=n[1];switch(t.luminosity){case"bright":r=55;break;case"dark":r=i-10;break;case"light":i=55}return o([r,i])}(c,r),function(e,t,n){var r=function(e,t){for(var n=s(e).lowerBounds,o=0;o<n.length-1;o++){var r=n[o][0],i=n[o][1],a=n[o+1][0],c=n[o+1][1];if(t>=r&&t<=a){var l=(c-i)/(a-r);return l*t+(i-l*r)}}return 0}(e,t),i=100;switch(n.luminosity){case"dark":i=r+20;break;case"light":r=(i+r)/2;break;case"random":r=0,i=100}return o([r,i])}(c,l,r)],r)};function s(e){for(var n in e>=334&&e<=360&&(e-=360),t){var s=t[n];if(s.hueRange&&e>=s.hueRange[0]&&e<=s.hueRange[1])return t[n]}return"Color not found"}function o(t){if(null===e)return Math.floor(t[0]+Math.random()*(t[1]+1-t[0]));var n=t[1]||1,s=t[0]||0,o=(e=(9301*e+49297)%233280)/233280;return Math.floor(s+o*(n-s))}function r(e,n,s){var o=s[0][0],r=s[s.length-1][0],i=s[s.length-1][1],a=s[0][1];t[e]={hueRange:n,lowerBounds:s,saturationRange:[o,r],brightnessRange:[i,a]}}function i(e){var t=e[0];0===t&&(t=1),360===t&&(t=359),t/=360;var n=e[1]/100,s=e[2]/100,o=Math.floor(6*t),r=6*t-o,i=s*(1-n),a=s*(1-r*n),c=s*(1-(1-r)*n),l=256,u=256,d=256;switch(o){case 0:l=s,u=c,d=i;break;case 1:l=a,u=s,d=i;break;case 2:l=i,u=s,d=c;break;case 3:l=i,u=a,d=s;break;case 4:l=c,u=i,d=s;break;case 5:l=s,u=i,d=a}return[Math.floor(255*l),Math.floor(255*u),Math.floor(255*d)]}function a(e){var t=e[0],n=e[1]/100,s=e[2]/100,o=(2-n)*s;return[t,Math.round(n*s/(o<1?o:2-o)*1e4)/100,o/2*100]}return n}();e&&e.exports&&(t=e.exports=o),t.randomColor=o}()}));Qr.randomColor;function Zr(e,t){const n=function(e){const t="string"==typeof e?parseInt(e.replace("#",""),16):e;return+((299*(t>>16&255)+587*(t>>8&255)+114*(255&t))/1e3/255).toFixed(2)}(t);null!=n&&(n<.6?(e.classList.remove("text-gray-dark"),e.classList.add("text-white")):(e.classList.remove("text-white"),e.classList.add("text-gray-dark")))}function ei(e,t){let n=t;"#"!==n.charAt(0)&&(n=`#${n}`),e.style.backgroundColor=n;const s=e.querySelector(".js-new-label-color-icon");s&&Zr(s,t)}function ti(e,t){e.blur();const n=o(e,"form"),s=u(n,".js-new-label-color-input",HTMLInputElement);y(s,t),ei(u(n,".js-new-label-color",HTMLButtonElement),t)}function ni(e,t,n){const s=t.querySelector(e);s&&(n?function(e,t){o(e,".js-label-error-container").classList.add("errored"),e.textContent=t,e.hidden=!1}(s,n[0]):function(e){o(e,".js-label-error-container").classList.remove("errored"),e.hidden=!0}(s))}function si(e,t){ni(".js-label-name-error",e,t.name),ni(".js-label-description-error",e,t.description),ni(".js-label-color-error",e,t.color)}function oi(e){ni(".js-label-name-error",e,null),ni(".js-label-description-error",e,null),ni(".js-label-color-error",e,null)}async function ri(e){const t=e.closest(".js-label-preview-container");if(!t)return;const n=o(e,".js-label-form",HTMLFormElement),s=n.querySelector(".js-new-label-error"),r=n.getAttribute("data-label-id"),a=u(t,".js-label-preview",HTMLElement),c=function(e,t){let n=u(e,".js-new-label-name-input",HTMLInputElement).value.trim();return n.length<1&&(n=i(t,"data-default-name")),n}(n,a),l=function(e){const t=u(e,".js-new-label-color-input",HTMLInputElement);return t.checkValidity()?t.value.trim().replace(/^#/,""):"ededed"}(n),d=function(e){let t=null;const n=e.querySelector(".js-new-label-description-input");return n instanceof HTMLInputElement&&n.value.trim().length>0&&(t=n.value.trim()),t}(n),m=function(e,t,n,s,o){const r=new URL(`${e}${encodeURIComponent(t)}`,window.location.origin),i=new URLSearchParams(r.search.slice(1));return i.append("color",n),s&&i.append("description",s),o&&i.append("id",o),r.search=i.toString(),r.toString()}(i(a,"data-url-template"),c,l,d,r);if(t.hasAttribute("data-last-preview-url")){if(m===i(t,"data-last-preview-url"))return}let f;try{f=await k(document,m)}catch(p){const e=await p.response.json();return si(n,e),void(s&&(s.textContent=e.message,s.hidden=!1))}s&&(s.textContent="",s.hidden=!0),oi(n),a.innerHTML="",a.appendChild(f),t.setAttribute("data-last-preview-url",m)}function ii(e,t){o(e,".js-details-container").classList.toggle("is-empty",t)}function ai(e){const t=u(document,".js-labels-count"),n=Number(t.textContent)+e;t.textContent=n.toString();const s=u(document,".js-labels-label");return s.textContent=s.getAttribute(1===n?"data-singular-string":"data-plural-string"),n}function ci(e){const t=e.querySelector(".js-new-label-name-input");if(!t)return;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:309");const n=u(e,".js-new-label-color-input",HTMLInputElement);let s=Qr();if(n.value.length>0)for(;n.value===s;)s=Qr();n.value=s;const o=u(e,".js-new-label-color",HTMLButtonElement);ei(o,s);const r=u(document,".js-new-label-name").textContent;y(t,r),ro(t),ri(o)}a(".js-label-filter-field",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:189");const n=o(t,"details-menu").querySelector(".js-new-label-name");if(!n)return;const s=t.value.trim();n.textContent=s})),et("filterable:change",".js-filterable-issue-labels",(function(e){const t=o(e.currentTarget,"details-menu"),n=t.querySelector(".js-add-label-button");if(!n)return;if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:205");const s=e.detail.inputField.value.trim().toLowerCase(),r=l(t,'input[name="issue[labels][]"]').some(e=>(e.getAttribute("data-label-name")||"").toLowerCase()===s);n.hidden=0===s.length||r})),c(".js-new-label-color-input",(function(e){const t=o(e,"form"),n=u(t,".js-new-label-swatches");n.hidden=!1,e.addEventListener("blur",(function(){n.hidden=!0}),{once:!0})})),a(".js-new-label-color-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:228");let n=t.value.trim();if(!(n.length<1))if(0!==n.indexOf("#")&&(n=`#${n}`,t.value=n),t.checkValidity()){t.classList.remove("text-red");const e=o(t,"form");ei(u(e,".js-new-label-color",HTMLButtonElement),n)}else t.classList.add("text-red")})),s("keyup",".js-new-label-color-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:250");let n=t.value.trim();if(0!==n.indexOf("#")&&(n=`#${n}`,t.value=n),t.checkValidity()){const e=o(t,"form");ei(u(e,".js-new-label-color",HTMLButtonElement),n)}nt(t,"change",!1),oi(o(t,"form",HTMLFormElement))})),s("keyup",".js-new-label-description-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:267");const n=t.form;if(!n)throw new Error("invariant: app/assets/modules/github/issues/labels.ts:269");oi(n)})),s("keyup",".js-new-label-color-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:274");const n=t.form;if(!n)throw new Error("invariant: app/assets/modules/github/issues/labels.ts:276");oi(n)})),et("click",".js-new-label-color",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:283");ti(t,Qr()),ri(t)})),et("mousedown",".js-new-label-color-swatch",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:290");ti(t,i(t,"data-color")),ri(t),o(t,".js-new-label-swatches").hidden=!0})),et("toggle",".js-new-label-modal",(function(e){e.target.hasAttribute("open")&&ci(e.target)}),{capture:!0}),d(".js-new-label-modal-form",(async function(e,t){const n=u(e,".js-new-label-error");let s;try{s=await t.html()}catch(a){const e=a.response.json;n.textContent=e.message,n.hidden=!1}if(!s)return;n.hidden=!0,u(document,".js-new-label-modal").removeAttribute("open");const o=u(document,".js-filterable-issue-labels"),r=s.html.querySelector("input");o.prepend(s.html),r&&r.dispatchEvent(new Event("change",{bubbles:!0}));const i=u(document,".js-label-filter-field",HTMLInputElement);i.value=i.defaultValue,i.focus()})),et("click",".js-edit-label-cancel",(function(e){const t=o(e.target,"form",HTMLFormElement);oi(t),t.reset();const n=u(t,".js-new-label-color-input",HTMLInputElement),s=n.value;u(t,".js-new-label-color",HTMLButtonElement).style.backgroundColor=s,io(t),ri(n);const r=e.currentTarget.closest(".js-labels-list-item");if(r){u(r,".js-update-label",HTMLElement).classList.add("d-none");const e=r.querySelector(".js-label-preview");if(e){e.classList.add("d-none"),u(r,".js-label-link",HTMLElement).classList.remove("d-none")}const t=r.querySelectorAll(".js-hide-on-label-edit.d-none");for(const n of t)n.classList.remove("d-none")}})),d(".js-update-label",(async function(e,t){let n;try{n=await t.html()}catch(s){return void si(e,s.response.json)}oi(e),o(e,".js-labels-list-item").replaceWith(n.html)})),d(".js-create-label",(async function(e,t){let n;try{n=await t.html()}catch(o){return void si(e,o.response.json)}e.reset(),oi(e),u(document,".js-label-list").prepend(n.html),ai(1),ii(e,!1),ti(u(e,".js-new-label-color",HTMLButtonElement),Qr()),ri(u(e,".js-new-label-name-input",HTMLInputElement)),io(e);const s=e.closest(".js-details-container");s instanceof HTMLElement&&ue(s)})),et("click",".js-details-target-new-label",(function(){const e=u(document,".js-create-label");u(e,".js-new-label-name-input",HTMLInputElement).focus()})),et("click",".js-edit-label",(function(e){const t=o(e.currentTarget,".js-labels-list-item"),n=u(t,".js-update-label",HTMLElement);n.classList.remove("d-none"),u(n,".js-new-label-name-input",HTMLInputElement).focus();const s=t.querySelector(".js-label-preview");if(s){s.classList.remove("d-none"),u(t,".js-label-link",HTMLElement).classList.add("d-none")}const r=l(t,".js-hide-on-label-edit",HTMLElement);for(const o of r)o.classList.add("d-none")})),d(".js-delete-label",(async function(e,t){const n=o(e,".js-labels-list-item");u(n,".js-label-delete-spinner").hidden=!1,await t.text(),ii(e,0===ai(-1)),n.remove()}));const li=tt((function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:169");ri(t)}),500);function ui(e,t,n){const s=e.getAttribute("data-direction"),o=di(t).indexOf(t);"up"===s&&t.previousElementSibling?t.previousElementSibling.insertAdjacentElement("beforebegin",t):"down"===s&&t.nextElementSibling&&t.nextElementSibling.insertAdjacentElement("afterend",t);const r=di(t).indexOf(t);e.focus(),n({oldIndex:o,newIndex:r,item:t})}function di(e){const t=e.parentElement;return Array.from(t.children)}let mi;et("suggester:complete",".js-new-label-name-input",li),a(".js-new-label-name-input",li),a(".js-new-label-description-input",li),a(".js-new-label-color-input",li),s("keypress",".js-new-label-name-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:478");const n=parseInt(t.getAttribute("data-maxlength"));W(t.value)>=n&&e.preventDefault()})),et("click",".js-issues-label-select-menu-item",(function(e){if(!(e instanceof MouseEvent))throw new Error("invariant: app/assets/modules/github/issues/labels.ts:486");e.altKey&&(e.preventDefault(),e.stopPropagation(),window.location.href=i(e.currentTarget,"data-excluded-url"))})),s("keydown",".js-issues-label-select-menu-item",(function(e){if("Enter"!==e.key)return;if(!e.altKey)return;const t=e.currentTarget;e.preventDefault(),e.stopPropagation(),t instanceof HTMLAnchorElement&&(window.location.href=i(t,"data-excluded-url"))})),et("click",".js-open-label-creation-modal",(async function(e){e.stopImmediatePropagation(),ci(await M({content:u(document,".js-label-creation-template",HTMLTemplateElement).content.cloneNode(!0),detailsClass:"js-new-label-modal"}))}),{capture:!0}),G((function({newURL:e}){const t=e.match(/\/issues#issue\/(\d+)$/);if(t){const n=t[1];window.location.href=e.replace(/\/?#issue\/.+/,`/${n}`)}})),G((function({newURL:e}){const t=e.match(/\/issues#issue\/(\d+)\/comment\/(\d+)$/);if(t){const n=t[1],s=t[2];window.location.href=e.replace(/\/?#issue\/.+/,`/${n}#issuecomment-${s}`)}})),Qe(".js-issue-row .js-issues-list-check:checked",{add(e){o(e,".js-issue-row").classList.add("selected")},remove(e){o(e,".js-issue-row").classList.remove("selected")}}),et("navigation:keydown",".js-issue-row",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/issues/list.ts:23");"x"===e.detail.hotkey&&(!function(e){const t=e.querySelector(".js-issues-list-check");t instanceof HTMLInputElement&&y(t,!t.checked)}(e.currentTarget),e.preventDefault(),e.stopPropagation())})),c("#js-issues-search",(function(e){if(!(e instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/list.ts:34");e.value=e.value}));let fi=null;function pi(e){const{item:t,oldIndex:n}=e,{parentNode:s}=t;if(!(s instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/pinned-issue-reordering.ts:13");fi=s.children[n+1]}async function gi(e){const{oldIndex:t,newIndex:n,item:s}=e;if(t===n)return;const r=o(s,".js-pinned-issues-reorder-form",HTMLFormElement),i=o(r,".js-pinned-issues-reorder-container"),a=u(i,".js-pinned-issues-spinner");a.style.display="inline-block",mi.option("disabled",!0);try{await H(r.action,{method:r.method,body:new FormData(r)}),a.style.display="none",mi.option("disabled",!1)}catch(c){const e=s.parentNode;if(!e)throw new Error("invariant: app/assets/modules/github/issues/pinned-issue-reordering.ts:36");fi?e.insertBefore(s,fi):e.appendChild(s)}}function hi(){const e=u(document,".js-reveal-custom-thread-settings",HTMLInputElement).checked,t=!document.querySelector(".js-custom-thread-notification-option:checked"),n=u(document,".js-custom-thread-settings"),s=u(document,"[data-custom-option-required-text]",HTMLInputElement),o=e&&t?i(s,"data-custom-option-required-text"):"";s.setCustomValidity(o),n.hidden=!e}function vi(e){e instanceof HTMLFormElement?m(e):ji(e)}function bi({currentTarget:e}){if(!(e instanceof Element))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:19");const t=e.closest(".js-issue-sidebar-form")||e.querySelector(".js-issue-sidebar-form");if(!t)throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:21");vi(t)}async function ji(e,t="post",n){const s=function(e){const t=o(e,"form",HTMLFormElement),n=pe(t),s=new FormData;for(const[o,r]of n)e.contains(wi(t,o,r))&&s.append(o,r);return s}(e);n&&s.append(n.name,n.value);const r=i(e,"data-url");if(!r)return;const a=u(e,".js-data-url-csrf",HTMLInputElement),c=await H(fe(r,a.value,{method:t,body:s}));!function(e,t){e.replaceWith(ge(document,t))}(o(e,".js-discussion-sidebar-item"),c)}function wi(e,t,n){for(const s of e.elements)if((s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLButtonElement)&&s.name===t&&s.value===n)return s;return null}Qe(".js-pinned-issues-reorder-list",(function(e){mi=de.create(e,{animation:150,item:".js-pinned-issue-list-item",handle:".js-pinned-issue-reorder",onUpdate:gi,onStart:pi,chosenClass:"is-dragging"})})),et("submit",".js-pinned-issues-reorder-form",(function(e){e.preventDefault()})),et("click",".js-pinned-issue-list-item .js-sortable-button",(function({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/pinned-issue-reordering.ts:59");ui(e,o(e,".js-pinned-issue-list-item"),gi)})),et("details-menu-select",".js-saved-reply-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/issues/replies.ts:9");if(!(e.target instanceof Element))return;const t=(u(e.detail.relatedTarget,".js-saved-reply-body").textContent||"").trim(),n=o(e.target,".js-previewable-comment-form"),s=u(n,"textarea.js-comment-field",HTMLTextAreaElement);me(s,t),setTimeout(()=>s.focus(),0)}),{capture:!0}),s("keydown",".js-saved-reply-shortcut-comment-field",(function(e){if("Control+."===P(e)){if(!(e.target instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/replies.ts:21");const t=o(e.target,".js-previewable-comment-form");u(t,".js-saved-reply-container").setAttribute("open",""),e.preventDefault(),ae({category:"Markdown Toolbar",action:"shortcut",label:"saved reply"})}})),s("keydown",".js-saved-reply-filter-input",(function(e){if(/^Control\+[1-9]$/.test(P(e))){if(!(e.target instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/replies.ts:35");const t=o(e.target,".js-saved-reply-container").querySelectorAll('[role="menuitem"]'),n=Number(e.key),s=t[n-1];s instanceof HTMLElement&&(s.click(),e.preventDefault(),ae({category:"Saved Replies",action:"shortcut",label:`saved reply number ${n}`}))}})),et("change",".js-thread-notification-setting",hi),et("change",".js-custom-thread-notification-option",hi),et("reset",".js-custom-thread-settings-form",hi),et("details-menu-selected",".js-discussion-sidebar-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:26");const t=e.detail.relatedTarget,n=e.currentTarget,s=o(t,".js-issue-sidebar-form"),r=n.hasAttribute("data-multiple");if(t.hasAttribute("data-clear-assignees")){const e=l(n,'input[name="issue[user_assignee_ids][]"]:checked',HTMLInputElement);for(const t of e)t.disabled=!1,t.checked=!1;vi(s)}else r?o(n,"details").addEventListener("toggle",bi,{once:!0}):vi(s)}),{capture:!0}),d(".js-issue-sidebar-form",(async function(e,t){const n=await t.html();if(!(e.parentNode instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:52");o(e,".js-discussion-sidebar-item").replaceWith(n.html)})),et("click","div.js-issue-sidebar-form .js-suggested-reviewer",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:58");ji(o(t,".js-issue-sidebar-form"),"post",{name:t.name,value:t.value}),e.preventDefault()})),et("click","div.js-issue-sidebar-form .js-issue-assign-self",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:66");ji(o(t,".js-issue-sidebar-form"),"post",{name:t.name,value:t.value}),e.preventDefault()})),et("click",".js-issue-unassign-self",(function(e){ji(o(e.currentTarget,".js-issue-sidebar-form"),"delete"),e.preventDefault()})),d(".js-pages-preview-toggle-form",(async function(e,t){const n=await t.json();u(e,"button.btn").textContent=n.json.new_button_value})),et("change",".js-project-menu-checkbox",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:104");const n=o(t,".js-project-menu-container");for(const s of l(n,".js-project-menu-checkbox",HTMLInputElement))if(s!==t&&s.name===t.name){s.checked=t.checked;const e=s.closest(".js-navigation-item");e&&e.classList.toggle("selected",t.checked);const n=s.closest("label[aria-checked]");n&&n.setAttribute("aria-checked",t.checked.toString())}})),et("click","div.js-project-column-menu-container .js-project-column-menu-item button",(async function(e){const t=e.currentTarget;!function(e){const t=o(e,".js-project-column-menu-dropdown"),n=u(t,".js-project-column-menu-summary"),s=i(e,"data-column-name");n.textContent=s}(t);const s=i(t,"data-url");if(!(t.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:127");const r=u(t.parentElement,".js-data-url-csrf",HTMLInputElement),a=i(t,"data-card-id"),c=new FormData;c.append("card_id",a),c.append("use_automation_prioritization","true"),e.preventDefault(),await n(fe(s,r.value,{method:"put",body:c}));const l=document.activeElement,d=o(t,".js-project-column-menu-dropdown");if(l&&d.contains(l))try{l.blur()}catch(m){}})),et("click",".js-prompt-dismiss",(function(e){o(e.currentTarget,".js-prompt").remove()})),et("click",".js-convert-to-draft",(function(e){const t=i(e.currentTarget,"data-url");if(!(e.currentTarget.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/issues/sidebar.ts:187");const n=u(e.currentTarget.parentElement,".js-data-url-csrf",HTMLInputElement);H(fe(t,n.value,{method:"post"}))}));const Li=new WeakMap,yi=new WeakMap;et("change",".js-issues-list-check",(function(){const e=!!document.querySelector(".js-issues-list-check:checked");u(document,"#js-issues-toolbar").classList.toggle("triage-mode",e);for(const t of document.querySelectorAll(".js-issue-triage-menu"))Li.set(t,!0)})),et("toggle",".js-issue-triage-menu",(function(e){const t=e.currentTarget;if(!(t instanceof Element))throw new Error("invariant: app/assets/modules/github/issues/triage.ts:26");t.hasAttribute("open")?function(e){if(!Li.has(e))return;const t=u(document,".js-triage-loader-template",HTMLTemplateElement),n=u(e,".js-triage-deferred-content");n.innerHTML="",n.append(t.content.cloneNode(!0));const s=function(e,t){const n=new URL(e,window.location.origin),s=new URLSearchParams(n.search);for(const[o,r]of t)s.append(o,r);return n.search=s.toString(),n.toString()}(i(e,"data-url"),l(document,".js-issues-list-check:checked",HTMLInputElement).map(e=>[e.name,e.value]));u(n,"include-fragment").setAttribute("src",s),Li.delete(e)}(t):async function(e){const t=u(e,"form",HTMLFormElement);if(!yi.has(t))return;!function(e,t){const n=o(e,".js-issues-toolbar-triage");u(n,".js-issue-triage-spinner").hidden=!t,u(n,".js-issue-triage-error").hidden=!0}(e,!0);try{const e=await A(t.action,{method:t.method,body:new FormData(t)});yi.delete(t),await z(e.job.url,{headers:{accept:"application/json"}}),D({url:window.location.href,container:u(document,"#js-repo-pjax-container"),replace:!0})}catch(n){!function(e,t){const n=o(e,".js-issues-toolbar-triage");u(n,".js-issue-triage-spinner").hidden=!0,u(n,".js-issue-triage-error").hidden=!t}(e,!0)}}(t)}),{capture:!0}),et("details-menu-selected",".js-issue-triage-menu details-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/issues/triage.ts:78");const t=e.detail.relatedTarget,n=o(t,"form",HTMLFormElement),s=function(e){const t="true"===e.getAttribute("aria-checked"),n=e.getAttribute("name")||e.getAttribute("data-name"),s=e.getAttribute("value")||e.getAttribute("data-value");if(!n||!s)throw new Error("invariant: app/assets/modules/github/issues/triage.ts:97");const o=document.createElement("input");switch(o.type="hidden",o.name=n,e.getAttribute("role")){case"menuitem":case"menuitemradio":o.value=s;break;case"menuitemcheckbox":o.value=t?s:"0"}return o}(t),r=u(n,".js-issues-triage-fields"),i=r.querySelector(`[name='${s.name}']`);i?i.replaceWith(s):r.append(s);yi.set(n,!0)}),{capture:!0}),d(".js-undo-issue-event-form",async(e,t)=>{await t.text();const n=i(e,"action");e.remove();const s=document.querySelectorAll(`.js-undo-issue-event-form[action="${n}"]`);for(let o=0;o<s.length;o++)s[o].remove()});const Ei=/^(team|repository|project):[^/]+\/[^/]+(\/([^/]+))?$/;function Ti(e,t){t.setItem("jump_to:page_views",JSON.stringify(e))}function ki(e){if(!e)return{};const t=e.getItem("jump_to:page_views");if(!t)return{};let n;try{n=JSON.parse(t)}catch(o){return Ti({},e),{}}const s={};for(const r in n)r.match(Ei)&&(s[r]=n[r]);return s}function Mi(e){let t;const[n,s]=e.name.split("/")||[];switch(e.type){case"Project":if(!e.owner)throw new Error("invariant: suggestion.owner");if(null===e.number||void 0===e.number)throw new Error("invariant: suggestion.number");t=xi(e.owner.name,`${e.number}`);break;case"Repository":t=Hi(n,s);break;case"Team":t=Si(n,s);break;default:throw new Error(`Invalid Suggestion type: ${e.type}`)}return t}function Si(e,t){return`team:${e}/${t}`}function Hi(e,t){return`repository:${e}/${t}`}function xi(e,t){return`project:${e}/${t}`}function Ai(e,t,n){const s=new URL(e,window.location.origin),o=new URLSearchParams(s.search.slice(1));o.set("q",t),n&&o.set("unscoped_q",t);const r=new URLSearchParams(window.location.search).get("type");return r&&o.set("type",r),s.search=o.toString(),s.toString()}let qi={};function Ci(e){const t=i(e,"data-target-type");if("Search"===t){const e=u(document,".js-site-search-form",HTMLFormElement),t=e.getAttribute("data-scope-type");t&&_i({dimensions:{scope_id:parseInt(e.getAttribute("data-scope-id")||""),scope_type:t}}),Ii("search")}else _i({dimensions:{target_id:parseInt(e.getAttribute("data-target-id")||""),target_type:t},measures:{client_rank:parseInt(e.getAttribute("data-client-rank")||""),server_rank:parseInt(e.getAttribute("data-server-rank")||"")}}),Ii("click")}function Ii(e){var t,n;const s=parseInt((null===(n=null===(t=document.head)||void 0===t?void 0:t.querySelector('meta[name="octolytics-actor-id"]'))||void 0===n?void 0:n.content)||"");if(!s)return!1;qi.dimensions=qi.dimensions||{},qi.dimensions.actor_id=s;let o=qi.dimensions&&qi.dimensions.session_id;return("menu-activation"!==e||!o)&&(!("menu-activation"!==e&&!o)&&("menu-activation"===e&&(o="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),_i({dimensions:{session_id:o}})),qi.event_type=`jump-to-${e}`,!!o&&(function(e){he("JUMP_TO_LOGGING")&&console.log(JSON.stringify(e));uo(e)}(qi),"menu-deactivation"!==e&&"click"!==e&&"search"!==e||(qi={}),!0)))}function _i(e){e.context&&(qi.context=Object.assign(qi.context||{},e.context),qi.dimensions=Object.assign(qi.dimensions||{},e.context)),e.dimensions&&(qi.dimensions=Object.assign(qi.dimensions||{},e.dimensions)),e.measures&&(qi.measures=Object.assign(qi.measures||{},e.measures))}function $i(e){u(document,".js-jump-to-suggestions-container").classList.remove("d-none"),e.classList.add("jump-to-dropdown-visible"),u(document,".js-jump-to").setAttribute("aria-expanded","true")}function Ni(){u(document,".js-jump-to-suggestions-container").classList.add("d-none"),u(document,".js-jump-to-field").classList.remove("jump-to-dropdown-visible"),u(document,".js-jump-to").setAttribute("aria-expanded","false"),Ii("menu-deactivation")}function Di(e){const t=e.form;if(!t)throw new Error("invariant: form");const n=u(document,".js-jump-to-suggestions-results-container"),s=e.value.trim(),o=!(!e.form||!e.form.getAttribute("data-scope-type")),r=u(n,".js-jump-to-scoped-search"),a=u(n,".js-jump-to-global-search");if(r.classList.toggle("d-none",!s||!o),a.classList.toggle("d-none",!s),s&&o){const e=Bi(r,s,Ai(i(t,"action"),s,o),!0);n.replaceChild(e,r)}if(s){const e=Bi(a,s,Ai(i(t,"data-unscoped-search-url"),s,!1),!1);n.replaceChild(e,a)}}function Pi(e,t,n){if(!e.form)return;const s=Oi(".js-jump-to-suggestions-template-container"),o=document.createDocumentFragment();n.length<1&&!t?function(){if(!Boolean(null===(t=null===(e=document.head)||void 0===e?void 0:e.querySelector('meta[name="user-login"]'))||void 0===t?void 0:t.content))return;var e,t;const n=Oi(".js-jump-to-no-results-template-container").cloneNode(!0);n instanceof HTMLElement&&n.classList.remove("d-none");Ri(n)}():(n.forEach((e,n)=>{o.appendChild(function(e,t,n,s){const o=e.cloneNode(!0);if(!(o instanceof HTMLElement))throw new Error("invariant: el instanceof HTMLElement");o.id=`jump-to-suggestion-${t.type.toLowerCase()}-${t.databaseId}`;const r=u(o,".js-jump-to-suggestion-path",HTMLAnchorElement);r.href=t.path,r.setAttribute("data-target-type",t.type),r.setAttribute("data-target-id",`${t.databaseId}`),r.setAttribute("data-client-rank",`${s}`),r.setAttribute("data-server-rank",`${t.rank}`);const i=u(o,".js-jump-to-suggestion-name");switch(i.textContent=t.name,i.setAttribute("aria-label",t.name),_n(i,n.replace(/\s/g,"")),t.type){case"Team":{const e=u(o,".js-jump-to-suggestion-avatar",HTMLImageElement);e.alt=t.name,e.src=t.avatarUrl?t.avatarUrl:"",e.classList.remove("d-none");break}case"Project":Fi(o,".js-jump-to-octicon-project");break;case"Repository":Fi(o,".js-jump-to-octicon-repo")}return u(o,".js-jump-to-badge-jump").classList.remove("d-none"),o}(s,e,t,n))}),Ri(o))}function Ri(e){const t=u(document,".js-jump-to-suggestions-results-container");for(const n of l(t,".js-jump-to-suggestion")){if(!n.parentNode)throw new Error("invariant: oldResult.parentNode");n.parentNode.removeChild(n)}t.appendChild(e)}function Fi(e,t){const n=u(e,".js-jump-to-octicon"),s=u(n,t,SVGElement);n.classList.remove("d-none"),s.classList.remove("d-none")}function Bi(e,t,n,s){const o=e.cloneNode(!0);if(!(o instanceof HTMLElement))throw new Error("invariant: el instanceof HTMLElement");o.id=`jump-to-suggestion-search-${s?"scoped":"global"}`;const r=u(o,".js-jump-to-suggestion-path",HTMLAnchorElement);r.href=n,r.setAttribute("data-target-type","Search");const i=u(o,".js-jump-to-suggestion-name");i.textContent=t,i.setAttribute("aria-label",t),Fi(o,".js-jump-to-octicon-search");const a=u(o,".js-jump-to-badge-search");return a.classList.remove("d-none"),s?u(a,".js-jump-to-badge-search-text-default").classList.remove("d-none"):u(a,".js-jump-to-badge-search-text-global").classList.remove("d-none"),o}function Oi(e){const t=u(document,".js-jump-to-suggestions-container"),n=u(t,e).firstElementChild;if(!(n instanceof HTMLElement))throw new Error("invariant: template");return n}const Ui=new WeakMap,zi=new WeakMap;function Wi(e,t,n){const s=t.toLowerCase(),o=n.text,r=n.score;let i=e;if(s){i=[];for(const t of e){null==Ui.get(t)&&Ui.set(t,o(t));const e=r?r(Ui.get(t)||"",s,t):Cn(Ui.get(t)||"",s);zi.set(t,e),e>0&&i.push(t)}i.sort(Vi)}return null!=n.limit?i.slice(0,n.limit):i}function Vi(e,t){const n=parseFloat(zi.get(e)),s=parseFloat(zi.get(t)),o=Ui.get(e)||"",r=Ui.get(t)||"";return n>s?-1:n<s?1:o<r?-1:o>r?1:0}const Ji=.6,Ki=.4;function Gi(e,t,n){const s=t.get(e)||0,o=n.get(e)||0;return s*Ji+o*Ki}function Xi(e){const t=[...Object.keys(e)].reduce((t,n)=>t+e[n].visitCount,0);return new Map(Object.keys(e).map(n=>[n,e[n].visitCount/t]))}function Yi(e){const t=[...Object.keys(e)].sort((t,n)=>e[t].lastVisitedAt-e[n].lastVisitedAt),n=t.length;return new Map(t.map((e,t)=>[e,(t+1)/n]))}function Qi(e){return!!(e?e.closest(".js-jump-to-field"):document.querySelector(".js-jump-to-field"))}function Zi(e,t){const n=e.value.trim(),s=function(e,t=null){const n=t||ki(),s=Xi(n),o=Yi(n);return e.map(e=>({suggestion:e,score:Gi(e.pageKey,s,o)})).sort((e,t)=>t.score-e.score).map(e=>e.suggestion)}(function(e,t,n){const s=e.replace(/\s/g,""),o=t.filter(e=>e.path!==n);return s?Wi(o,s,{text:e=>e.name}):o}(n,t,window.location.pathname)),o=s.slice(0,7);_i({measures:{result_count:s.length,display_count:o.length,filter_count:t.length-s.length},context:{query:n,display_set:o.map(e=>[e.type,e.databaseId])}}),Pi(e,n,o),Ii("menu-activation")||Ii("query")}function ea(e,t){const n=e.nextElementSibling;return n instanceof HTMLElement?n.classList.contains(t)?n:ea(n,t):null}const ta=/^\/orgs\/([a-z0-9-]+)\/teams\/([\w-]+)/,na=[/^\/([^/]+)\/([^/]+)\/?$/,/^\/([^/]+)\/([^/]+)\/blob/,/^\/([^/]+)\/([^/]+)\/tree/,/^\/([^/]+)\/([^/]+)\/issues/,/^\/([^/]+)\/([^/]+)\/pulls?/,/^\/([^/]+)\/([^/]+)\/pulse/],sa=[["organization",/^\/orgs\/([a-z0-9-]+)\/projects\/([0-9-]+)/],["repository",/^\/([^/]+)\/([^/]+)\/projects\/([0-9-]+)/]];function oa(e){return Object.keys(e).length<=100?e:function(e){const t=Xi(e),n=Yi(e);return Object.keys(e).map(e=>({pageKey:e,score:Gi(e,t,n)})).sort((e,t)=>t.score-e.score).map(e=>e.pageKey)}(e).slice(0,50).reduce((t,n)=>(t[n]=e[n],t),{})}function ra(e,t){const n=ki(t),s=Math.floor(Date.now()/1e3),o=n[e]||{lastVisitedAt:s,visitCount:0};o.visitCount+=1,o.lastVisitedAt=s,n[e]=o;try{Ti(oa(n),t)}catch(r){}}const ia=()=>{const e="test-storage-availability";try{return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),window.localStorage}catch(t){return null}};let aa;async function ca(e){const t=i(e,"data-jump-to-suggestions-path"),n=function(){const e=new FormData;for(const t of Object.keys(ki()))e.append("variables[pageViews][]",t);return e}(),s=ea(e,"js-data-jump-to-suggestions-path-csrf");if(!s)return[];try{return function(e){if("errors"in e.data)return[];let t=1;const n=[];for(const s of e.data.suggestions.nodes)null!=s&&(s.rank=t++,s.pageKey=Mi(s),"Team"===s.type&&(s.name=`@${s.name}`),n.push(s));return n}(await A(fe(t,s.value,{method:"POST",body:n})))}catch(o){return[]}}async function la(e){const t=e;!function(e){e.classList.add("js-navigation-enable"),e.classList.add("jump-to-field-active")}(t),$i(t),aa||(aa=ca(t)),Di(t),da(t),Zi(t,await aa)}Qe(".js-jump-to-field",{constructor:HTMLInputElement,add(e){!function(e,t=ia()){if(!t)return;const n=e.match(ta);if(n)return void ra(Si(n[1],n[2]),t);let s,o;for(let r=0,i=sa.length;r<i;r++){const[n,o]=sa[r];if(s=e.match(o),s){let e=null,o=null;switch(n){case"organization":e=s[1],o=s[2];break;case"repository":e=`${s[1]}/${s[2]}`,o=s[3]}return void(e&&o&&ra(xi(e,o),t))}}for(let r=0,i=na.length;r<i;r++)if(o=e.match(na[r]),o)return void ra(Hi(o[1],o[2]),t)}(window.location.pathname),e.addEventListener("input",tt((async function(){Di(e),da(e),Zi(e,await aa)}),100)),document.activeElement&&document.activeElement===e&&la(e)}}),c(".js-jump-to-field",la),et("navigation:keydown",".js-site-search-form",(function(e){const t=e.currentTarget.querySelector(".js-navigation-item.navigation-focus");switch(e.detail.hotkey){case"Enter":if(t)Ci(u(t,".js-jump-to-suggestion-path",HTMLElement));else{const t=e.currentTarget;m(t)}break;case"Escape":u(e.currentTarget,".js-jump-to-field",HTMLInputElement).blur(),Ni()}})),et("navigation:focus",".js-site-search-form",(function(e){const t=u(document,".js-jump-to-field",HTMLInputElement),n=e.target.id,s=o(e.target,".js-jump-to-suggestions-results-container");for(const o of s.querySelectorAll(".js-navigation-item"))o.setAttribute("aria-selected",(e.target===o).toString());t.setAttribute("aria-activedescendant",n)}));let ua=null;function da(e){const t=e.value.trim(),n=u(document,".js-jump-to-suggestions-results-container");t?ve(n):be(n)}et("focusout",".js-jump-to",(function(){const e=u(document,".js-jump-to-field",HTMLInputElement);ua=window.setTimeout(()=>{!function(e){e.classList.remove("js-navigation-enable"),e.classList.remove("jump-to-field-active")}(e),Ni()},200)})),et("focusin",".js-jump-to",(function(){ua&&window.clearTimeout(ua),$i(u(document,".js-jump-to-field",HTMLInputElement))})),et("click",".js-jump-to-suggestion-path",(function(e){const t=e.currentTarget;if("Search"===t.getAttribute("data-target-type")){const e=u(document,".js-jump-to-field",HTMLInputElement);t.href=function(e,t){const n=new URL(t,window.location.origin),s=new URLSearchParams(n.search.slice(1));return s.get("q")&&s.set("q",e),s.get("unscoped_q")&&s.set("unscoped_q",e),n.search=s.toString(),n.toString()}(e.value.trim(),t.href)}Ci(t)})),et("submit",".js-site-search-form",(function(e){if(!Qi())return;e.target.getAttribute("data-scoped-search-url")&&_i({}),Ii("search")}));let ma=0,fa=null;const pa=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a","Enter"];function ga(e){ma=e,function(e){let t=document.getElementById("konami-overlay");t||(t=document.createElement("div"),t.id="konami-overlay",t.classList.add("konami-overlay"),document&&document.body&&document.body.appendChild(t));if(!t)return;t.style.background=`rgba(0,0,0,${e+.24})`;const n=50*(1+e),s=(e,t)=>e+Math.round(Math.random()*(t-e));for(let o=0;o<n;o++){const e=s(0,window.innerHeight),n=s(0,window.innerWidth),o=document.createElement("div");o.classList.add("dot"),o.textContent=`${s(0,1)}`,o.style.fontSize=`${s(1,8)}px`,o.style.color=`rgba(255,255,255,${Math.random()})`,o.style.top=`${e}px`,o.style.left=`${n}px`;const r=s(0,300);setTimeout(()=>t&&t.prepend(o),r),setTimeout(()=>o.parentNode&&o.parentNode.removeChild(o),r+s(100,500))}}(ma/pa.length);const t=l(document,".js-konami-key");for(const r of t)r.classList.remove("active"),r.classList.remove("inactive"),r.classList.remove("complete"),r.classList.remove("down");const n=t.slice(0,ma),s=t.slice(ma,ma+1),o=t.slice(ma+2);for(const r of n)r.classList.add("complete");for(const r of s)r.classList.add("active");for(const r of o)r.classList.add("inactive")}function ha(e){if(!(e.target instanceof Node&&je(e.target)||ma>=pa.length||(pa.includes(P(e))&&(e.preventDefault(),e.stopPropagation()),P(e)!==pa[ma]))){const e=document.querySelectorAll(".js-konami-key")[ma];e&&e.classList.add("down")}}function va(e){if(!(e.target instanceof Node&&je(e.target)||ma>=pa.length)){if(P(e)===pa[ma])ga(ma+1),ma===pa.length-1&&function(){const e=document.querySelector(".js-konami-success");e&&e.removeAttribute("hidden")}(),ma===pa.length&&function(){const e=document.querySelector(".js-konami-form");if(!(e instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/konami/konami.ts:128");m(e)}();else{if(!pa.includes(P(e)))return;ga(0)}e.preventDefault(),e.stopPropagation()}}function ba(){fa=null,document.removeEventListener("keydown",ha),document.removeEventListener("keyup",va);const e=document.getElementById("konami-overlay");e&&e.parentNode&&e.parentNode.removeChild(e)}function ja(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;const n=parseInt(t.getAttribute("data-input-max-length")||"",10),s=parseInt(t.getAttribute("data-warning-length")||"",10)||5,r=t.value.replace(/(\r\n|\n|\r)/g,"\r\n");let a=n-r.length;if(a<=0){let e=r.substr(0,n);e.endsWith("\r")?(e=e.substr(0,n-1),a=1):a=0,t.value=e}const c=i(t,"data-warning-text"),l=o(t,".js-length-limited-input-container"),d=u(l,".js-length-limited-input-warning");a<=s?(d.textContent=c.replace(new RegExp("{{remaining}}","g"),`${a}`),d.classList.remove("d-none")):(d.textContent="",d.classList.add("d-none"))}function wa(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=u(t,".js-milestone-edit-cancel"),s=n.getAttribute("data-confirm-changes");s&&(T(t)?n.setAttribute("data-confirm",s):n.removeAttribute("data-confirm"))}et("click",".js-konami",(async function(e){if(e.preventDefault(),fa)return;if(ga(5),document.addEventListener("keydown",ha),document.addEventListener("keyup",va),!(e.target instanceof HTMLElement))return;const t=`/site/konami?return_to=${e.target.getAttribute("data-return-to")||""}`;fa=await M({content:k(document,t),dialogClass:"kb-konami-dialog container-xl"}),ga(ma),fa.addEventListener("dialog:remove",ba,{once:!0})})),et("click",".js-details-target-new-label",(function({target:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/labels/maintainer-label-prompt.ts:7");const t=ea(e,"Popover");if(t){const e=u(t,"form",HTMLFormElement);m(e)}})),Qe(".js-length-limited-input",{add(e){e.addEventListener("input",ja),e.addEventListener("change",ja)},remove(e){e.removeEventListener("input",ja),e.removeEventListener("change",ja)}}),Qe("link[rel=prefetch-viewed]",{initialize(){window.requestIdleCallback(()=>{fetch(location.href,{method:"HEAD",credentials:"same-origin",headers:{Purpose:"prefetch-viewed"}})})}}),et("click",".js-manage-requests-tabs-item",(function({currentTarget:e}){const t=o(e,".js-manage-memberships-container");u(t,".js-manage-invitations-tabs-item").classList.remove("selected"),e.classList.add("selected");const n=u(t,".js-manage-invitations-list"),s=u(t,".js-manage-requests-list");n.classList.add("d-none"),s.classList.remove("d-none")})),et("click",".js-manage-invitations-tabs-item",(function({currentTarget:e}){const t=o(e,".js-manage-memberships-container");u(t,".js-manage-requests-tabs-item").classList.remove("selected"),e.classList.add("selected");const n=u(t,".js-manage-requests-list"),s=u(t,".js-manage-invitations-list");n.classList.add("d-none"),s.classList.remove("d-none")})),et("change",".js-milestone-edit-form",wa),et("click",".js-milestone-edit-form",wa);const La=new WeakMap,ya=new WeakMap;et("socket:message",".js-milestone-issues",(async function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/milestone-dragging.ts:29");const t=e.currentTarget,n=e.detail.data,s=u(t,".js-milestone-issues-container");if(ya.has(s))return void ya.delete(s);await q();const o=document.querySelector(".js-client-uid");o instanceof HTMLInputElement&&o.value===n.client_uid||async function(e){if(we(e))return;const t=i(e,"data-url"),n=await k(document,t);Le(document,()=>{e.replaceWith(n)})}(t)})),d(".js-milestone-sort-form",(async function(e,t){const n=(await t.json()).json,s=u(e,".js-milestone-reorder-feedback");s.textContent="",n.error?u(e,".js-milestone-changed").classList.remove("d-none"):(u(e,".js-timestamp",HTMLInputElement).value=n.updated_at,s.textContent=s.getAttribute("data-success-text")||"")}));const Ea=tt((function(e){const{newIndex:t,item:n}=e,s=o(n,".js-milestone-issues-container"),r=n.getAttribute("data-id")||"",i=function(e,t){return e.querySelectorAll(".js-draggable-issue")[t]}(s,t-1),a=i&&i.getAttribute("data-id"),c=o(s,".js-milestone-sort-form",HTMLFormElement);u(c,".js-item-id",HTMLInputElement).value=r,u(c,".js-prev-id",HTMLInputElement).value=a||"",ae({category:"Milestone",action:"reorder",label:"string"==typeof e.trackingLabel?e.trackingLabel:"drag-and-drop"}),ya.set(s,!0),m(c)}),200);function Ta(e,t){Ea({item:t,newIndex:Array.from(e.querySelectorAll(".js-draggable-issue")).indexOf(t),trackingLabel:"keyboard-shortcut"}),ye(o(t,".js-navigation-container"),t)}async function ka(e){if(await function(e){return new Promise((function(t){function n(){e.hasFocus()&&(t(),e.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n),window.removeEventListener("blur",n))}e.addEventListener("visibilitychange",n),window.addEventListener("focus",n),window.addEventListener("blur",n),n()}))}(document),await new Promise(e=>setTimeout(e,1e3)),!(e instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/oauth.ts:9");e instanceof HTMLButtonElement&&(e.disabled=!1)}function Ma(e){const t=o(e,".js-org-insights-hero-container");for(const n of l(t,"[role=tab]"))n.setAttribute("aria-selected",(n===e).toString());for(const n of l(t,"[role=tabpanel]"))n.hidden=e.id!==n.getAttribute("aria-labelledby");for(const n of l(document,".js-org-insights-period-selector-link",HTMLAnchorElement))n.hash=e.hash}et("click",".js-draggable-issue .js-sortable-button",(function({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/milestone-dragging.ts:92");ui(e,o(e,".js-draggable-issue"),Ea)})),et("navigation:keydown",".js-draggable-issues-container .js-draggable-issue",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/milestone-dragging.ts:97");const t=e.currentTarget,n=o(t,".js-draggable-issues-container");if("J"===e.detail.hotkey){const s=t.nextElementSibling;s&&(s.after(t),Ta(n,t),e.preventDefault(),e.stopPropagation())}else if("K"===e.detail.hotkey){const s=t.previousElementSibling;s&&(s.before(t),Ta(n,t),e.preventDefault(),e.stopPropagation())}})),Qe(".js-draggable-issues-container",{add:function(e){if(La.has(e))return;const t=de.create(e,{animation:150,item:".js-draggable-issue",handle:".js-drag-handle",onUpdate:Ea,chosenClass:"is-dragging"});La.set(e,t)},remove:function(e){const t=La.get(e);t&&t.destroy()}}),et("submit",".js-mobile-preference-form",({currentTarget:e})=>{u(e,".js-mobile-preference-anchor-field",HTMLInputElement).value=window.location.hash.substr(1)}),Qe("#js-oauth-authorize-btn",e=>{ka(e)}),async function(){await w,window._octo&&(window._octo.push(["enablePerformance"]),window._octo.push(["recordPageView"]))}(),Qe(".js-octo-ga-id",e=>{window.ga(t=>{t&&e.setAttribute("content",t.get("clientId"))})}),Qe(".js-octo-ga-id-input",e=>{window.ga(t=>{t&&e.setAttribute("value",t.get("clientId"))})}),document.addEventListener("pjax:complete",(function(){window._octo&&window._octo.push(["recordPageView"])})),et("change",".js-two-factor-needs-enforced",(function({currentTarget:e}){if(!(e instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/2fa.ts:33");u(document,".js-confirm-2fa-modal").classList.toggle("d-none",!e.checked),u(document,".js-2fa-save-button").classList.toggle("d-none",e.checked)})),Qe(".js-two-factor-enforcement-poller",(function(e){e.addEventListener("load",(function(){window.location.reload()}))})),et("click",".js-org-insights-hero-container [role=tab]",({currentTarget:e})=>{e instanceof HTMLAnchorElement&&Ma(e)}),G(()=>{const e=document.querySelector(".js-org-insights-hero-container");if(!e)return;const t=e.querySelector(`[href='${document.location.hash||"#insights-prs"}']`);t instanceof HTMLAnchorElement&&Ma(t)});const Sa=new b,Ha=()=>l(document,".js-invitations-team-suggestions-pagination > a",HTMLAnchorElement);function xa(){const e=document.querySelector(".js-org-reinstate-forms"),t=document.querySelectorAll(".js-org-reinstate-option:checked");if(!e||1!==t.length)return;const n=i(t[0],"data-form"),s=e.getElementsByClassName("js-togglable-form");for(const r of s)r.classList.add("d-none");const o=document.getElementById(n);if(!o)throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:88");o.classList.remove("d-none")}function Aa(){const e=document.querySelector(".js-seats");if(!e)return Ia();const t=i(e,"data-filled-seats");return parseInt(t)+Ia()}function qa(){(function(){if(Ia()<=0)return Ca(".js-plan-no-change",!0),Ca(".js-plan-changes",!0),!0;return!1})()||(function(){const e=document.querySelector(".js-filled-seats"),t=Aa();e&&null!==t&&(e.textContent=t.toString())}(),function(){const e=document.querySelector(".js-seats-remaining");if(e instanceof HTMLElement){e.hidden=!0;const t=_a()-Aa(),n=u(document,".js-seats-remaining-zero"),s=u(document,".js-seats-remaining-singular"),o=u(document,".js-seats-remaining-plural");if(n.hidden=0!==t,s.hidden=1!==t,t>1){u(document,".js-seats-remaining-update-target").textContent=String(t)}o.hidden=t<=1}}(),function(){const e=document.querySelector(".js-max-seats-warning");e instanceof HTMLElement&&(e.hidden=!$a())}(),function(){const e=Aa();return _a()<e}()?async function(){const e=document.querySelector(".js-seats");if(!e)return;const t=new URL(i(e,"data-url"),window.location.origin),n=new URLSearchParams(t.search.slice(1));n.append("seats",Aa().toString()),t.search=n.toString();const s=await Sa.push(A(t.toString())),o=s.new_price,r=e.getAttribute("data-original-price");if(r&&o===r)return void Ca(".js-plan-no-change",!0);!function(){const e=u(document,".js-new-seats"),t=u(document,".js-new-users-singular"),n=u(document,".js-new-users-plural"),s=Ia();t.hidden=1!==s,n.hidden=1===s,e.textContent=String(s)}();const a=s.selectors;for(const i in a)for(const e of document.querySelectorAll(i))e.innerHTML=a[i];Ca(".js-plan-no-change",!0),Ca(".js-plan-changes",!1),Ca(".js-complete-button",!0),Ca(".js-invite-button",!1)}():(Ca(".js-plan-no-change",!1),Ca(".js-plan-changes",!0),Ca(".js-complete-button",!1),Ca(".js-invite-button",!0)))}function Ca(e,t){const n=document.querySelector(e);n instanceof HTMLElement&&(n.hidden=t)}function Ia(){return l(document,".js-badge").length||0}function _a(){const e=document.querySelector(".js-seats");if(!e)return 0;const t=i(e,"data-total-seats");return parseInt(t)}function $a(){return _a()===Aa()}function Na(e){Ee(e)}async function Da(e,t,n,s){const o=i(e,"data-url"),r=new URL(o,window.location.origin),a=new URLSearchParams(r.search.slice(1));a.append("member",t),a.append("action_type",n),s&&a.append("return_to",s),r.search=a.toString(),Pa(!0),u(document,".js-add-team-member-form").hidden=!0;const c=await k(document,r.toString());Pa(!1),e.innerHTML="",e.appendChild(c)}function Pa(e){u(document,".js-add-members-loading-state").hidden=!e,u(document,".js-add-members-modal-content").hidden=e}function Ra(e,t){const n=new URL(e.href,window.location.origin),s=new URLSearchParams(n.search);s.delete("organization_name"),s.delete("login"),s.append("organization_name",t),s.append("login",u(document,"#organization_login",HTMLInputElement).value);const o=new URL(e.href,window.location.origin);o.search=s.toString(),e.href=o.toString()}function Fa(e){for(const t of l(document,".js-plan-info")){const n=Ba(e);if("string"!=typeof n)throw new Error("invariant: app/assets/modules/github/orgs/new.ts:196");t.classList.contains(n)?(t.classList.remove("has-removed-contents"),t.hidden=!1):(t.classList.add("has-removed-contents"),t.hidden=!0)}}function Ba(e){return"business_plus"===e?function(){const e=u(document,".js-enterprise-choice:checked",HTMLInputElement);return"server"===e.value?"js-enterprise-server-plan-info":"cloud-trial"===e.value?"js-enterprise-cloud-trial-plan-info":"js-enterprise-cloud-plan-info"}():"free"===e?"js-free-plan-info":"business"===e?"js-business-plan-info":null}et("click",".js-invitation-toggle-team",(async function(){const e=(e=>{const t=new URLSearchParams(window.location.search),n=new Set(t.getAll("team_ids[]")),s=l(document,e,HTMLInputElement);for(const o of s)o.checked?n.add(o.value):n.delete(o.value);return[...n]})(".js-invitation-toggle-team");for(const t of Ha()){const n=t.getAttribute("href");if(n){const s=new URL(n,window.location.origin),o=new URLSearchParams(s.search.slice(1));o.delete("team_ids[]");for(const t of e)o.append("team_ids[]",t);s.search=o.toString(),t.setAttribute("href",s.toString())}}u(document,'[name="team_ids"]',HTMLInputElement).value=e.join(",")})),et("click",".js-invitation-radio-role",(async function(){const e=(()=>{let e="";const t=l(document,".js-invitation-radio-role",HTMLInputElement);for(const n of t)n.checked&&(e=n.value);return e})();for(const t of Ha()){const n=t.getAttribute("href");if(n){const s=new URL(n,window.location.origin),o=new URLSearchParams(s.search.slice(1));o.set("role",e),s.search=o.toString(),t.setAttribute("href",s.toString())}}})),et("change",".js-org-reinstate-option",xa),Qe(".js-org-reinstate-forms",xa),Qe(".js-member-suggestion",(function(){const e=l(document,".js-badge").map(e=>u(e,"input",HTMLInputElement).value);if(0!==e.length)for(const t of l(document,".js-member-suggestion",HTMLLIElement)){const n=i(t,"data-autocomplete-value");if(e.includes(n)){t.classList.add("disabled"),t.setAttribute("aria-disabled","true");const e=t.querySelector(".js-non-member-warning-reason"),n=t.querySelector(".js-non-member-warning-action");if(e&&n)for(const t of[e,n])t.textContent=i(t,"data-markup"),t instanceof HTMLElement&&(t.hidden=!1)}}})),et("combobox-commit",".js-badge-container .js-new-org-members-complete-results",e=>{const t=u(document,".js-badge-input",HTMLInputElement),n=u(document,".js-badges"),s=e.target;if(!(s instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:121");const o=l(s,".js-badge-template",HTMLTemplateElement),r=l(document,".js-badge").map(e=>u(e,"input",HTMLInputElement).value);for(const i of o){const e=i.cloneNode(!0);if(!(e instanceof HTMLTemplateElement))throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:128");const t=e.content,s=u(t,"input",HTMLInputElement).value;r.includes(s)||n.append(t)}qa(),function(e){const t=e.currentTarget;if(t instanceof Element&&t.hasAttribute("data-ga-event")){const e=t.getAttribute("data-ga-event-category"),n=t.getAttribute("data-ga-event-action"),s=t.getAttribute("data-ga-event-label");window.ga("send","event",e,n,s)}const n=e.target;if(!(n instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:338");Ee(n)}(e),t.value="",t.setAttribute("placeholder","")}),et("click",".js-badge-search-container .js-badge",e=>{const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:145");"true"===i(t,"aria-pressed")?t.setAttribute("aria-pressed","false"):t.setAttribute("aria-pressed","true")}),et("click",".js-badge-search-container",e=>{const t=e.currentTarget;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:158");u(t,"input",HTMLInputElement).focus()}),et("click",".js-badge-container .js-member-suggestion",()=>{u(document,".js-badge-input",HTMLInputElement).focus()}),s("keydown",".js-badge-search-container .js-badge-input",e=>{const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/invitations.ts:168");const n=o(t,".js-badge-search-container"),s=l(n,'.js-badges .js-badge[aria-pressed="true"]'),r=n.getAttribute("data-allow-plan-increase"),i="Backspace"!==e.key||""!==t.value;if(!r&&$a()&&i)e.preventDefault();else if(!i){if(0!==s.length)for(const e of s)e.remove(),Na(e);else{const e=l(n,".js-badges .js-badge");if(0===e.length)return;const t=e[e.length-1];t.remove(),Na(t)}qa()}}),et("click",".js-private-repo-creation-allowed",(function(e){const t=e.currentTarget;if(t instanceof HTMLInputElement){const e="true"===t.getAttribute("data-private-only-policy-allowed"),n=u(document,".js-public-repo-creation-allowed",HTMLInputElement),s=u(document,".js-public-disabled-doc-link");e||(t.checked?(n.disabled=!0,n.checked=!0,s.hidden=!1):(n.disabled=!1,s.hidden=!0))}})),et("click",".js-membership-tab",(function(e){const t=i(e.currentTarget,"data-membership"),n=u(document,".js-member-filter-field",HTMLInputElement),s=n.value,o=new RegExp("membership:[a-z-]+"),r=s.toString().trim().replace(o,"");n.value=`${r} ${t}`.replace(/\s\s/," ").trim(),n.focus(),nt(n,"input"),u(document,".js-membership-tabs").classList.remove("selected"),e.currentTarget.classList.add("selected")})),et("click",".js-member-search-filter",(function(e){e.preventDefault();const t=i(e.currentTarget,"data-filter"),n=o(e.currentTarget,"[data-filter-on]"),s=i(n,"data-filter-on"),r=u(document,".js-member-filter-field",HTMLInputElement),a=r.value,c=new RegExp(`${s}:(?:[a-z]|_)+`),l=a.toString().trim().replace(c,"");r.value=`${l} ${t}`.replace(/\s\s/," ").trim(),r.focus(),nt(r,"input")})),et("submit",".js-needs-interstitial .js-approve-membership-request",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/orgs/members.ts:40");const n=i(u(t,"[data-member-name]"),"data-member-name"),s=i(t,"data-action-type"),r=o(t,".js-add-members-container");e.preventDefault(),Da(r,n,s,null)})),et("submit",".js-needs-interstitial.js-add-team-member-form",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/orgs/members.ts:49");const n=g(t,"member");if(!n.value)return;const s=i(t,"data-action-type"),o=u(document,".js-add-members-container");e.preventDefault();const r=t.getAttribute("data-return-to");Da(o,n.value,s,r)})),Qe("#add-team-member",(function(e){const t=u(e,"details-dialog"),n=t.innerHTML;e.addEventListener("toggle",(function({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/orgs/members.ts:85");e.hasAttribute("open")||(t.innerHTML=n)}))})),d(".js-add-org-member-form",(async function(e,t){const n=u(document,".js-member-list");e.classList.add("is-sending");const s=document.querySelector(".flash-messages");let o;s&&s.remove();try{o=await t.json()}catch(a){if(!a.response&&!a.response.json)return;return void n.insertAdjacentHTML("beforebegin",a.response.json.message_html||"")}e.classList.remove("is-sending"),u(e,"auto-complete",st).value="";const r=u(ge(document,o.json.list_item_html),"*"),i=r.getAttribute("data-login");if(i)for(const c of n.children)if(c.getAttribute("data-login")===i){c.remove();break}n.prepend(r)})),et("auto-check-success",".js-new-organization-name",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/new.ts:10");for(const s of l(document,".js-enterprise-trial-link",HTMLAnchorElement))Ra(s,t.value);const n=o(t,"dd").querySelector(".js-field-hint-name");n&&(n.textContent=t.value)})),Qe(".js-hide-org-name-hint",(function(e){if(!(e instanceof HTMLSpanElement))throw new Error("invariant: app/assets/modules/github/orgs/new.ts:22");const t=e.parentElement;t&&(t.hidden=!0)})),a(".js-company-name-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/new.ts:45");const n=t.form;if(!n)throw new Error("invariant: app/assets/modules/github/orgs/new.ts:47");const s=n.querySelectorAll(".js-company-name-text");if(0===s.length)return;const o=n.querySelector(".js-corp-tos-link"),r=n.querySelector(".js-tos-link");r&&(r.classList.add("d-none"),r.setAttribute("aria-hidden","true"),o&&(o.classList.remove("d-none"),o.setAttribute("aria-hidden","false")));for(const a of s)if(t.value){if(a.hasAttribute("data-wording")){const e=i(a,"data-wording");a.textContent=` ${e} ${t.value}`}else a.textContent=t.value}else a.textContent=""})),Qe(".js-company-owned:not(:checked)",{constructor:HTMLInputElement,add(e){const t=e.form;if(!t)throw new Error("invariant: app/assets/modules/github/orgs/new.ts:88");const n=u(t,".js-company-name-input",HTMLInputElement),s=u(document,".js-company-name-text"),o=u(document,".js-corp-tos-link"),r=u(document,".js-tos-link");e.getAttribute("data-optional")&&n.removeAttribute("required"),y(n,""),r.classList.remove("d-none"),r.setAttribute("aria-hidden","false"),o.classList.add("d-none"),o.setAttribute("aria-hidden","true"),s.textContent=""}}),Qe(".js-company-owned:checked",{constructor:HTMLInputElement,add(e){const t=e.form;if(!t)throw new Error("invariant: app/assets/modules/github/orgs/new.ts:111");const n=t.querySelector(".js-company-name-input");n&&(n.setAttribute("required",""),nt(n,"focus"),nt(n,"input"))}}),Qe(".js-company-owned-autoselect",{constructor:HTMLInputElement,add(e){const t=e;function n(){if(t.checked&&t.form){const e=u(t.form,".js-company-owned",HTMLInputElement);y(e,!0)}}t.addEventListener("change",n),n()}}),d(".js-org-list-item .js-org-remove-item",(async function(e,t){o(e,".js-org-list-item").classList.add("d-none");try{await t.text()}catch(n){o(e,".js-org-list-item").classList.remove("d-none");const t=e.getAttribute("data-error-message");if(t)return void alert(t)}o(e,".js-org-list-item").remove()})),et("click",".js-plan-choice",e=>{const t=document.querySelector(".SignUpContinueActions"),n=e.target.value;Fa(n),null!=t&&t.classList.remove("has-removed-contents");const s=!(n&&"business_plus"===n);for(const o of l(document,".js-enterprise-choice",HTMLInputElement))o.disabled=s}),et("click",".js-enterprise-choice",e=>{const t=document.querySelector(".js-billing-section"),n=document.querySelector(".SignUpContinueActions"),s=document.querySelector(".js-enterprise-contact"),o=document.querySelector(".js-enterprise-trial-link"),r=e.target.value,i=[t,n];if(s&&s.classList.toggle("has-removed-contents","server"!==r),o&&o.classList.toggle("has-removed-contents","server"===r),"cloud-trial"===r)t&&t.classList.add("has-removed-contents");else for(const a of i)null!=a&&a.classList.toggle("has-removed-contents","cloud"!==r);Fa("business_plus")}),et("change",".js-enterprise-trial-industry",(function(e){if(!(e instanceof Event))throw new Error("invariant: app/assets/modules/github/orgs/new.ts:234");const t=e.target;if(!(t instanceof HTMLSelectElement))throw new Error("invariant: app/assets/modules/github/orgs/new.ts:236");const n=t.value,s=document.querySelector(".js-enterprise-trial-other-industry-field");s&&(s.hidden=n!==i(s,"data-trigger-option-value"))})),Qe(".js-enterprise-trial-ga-id",{constructor:HTMLInputElement,initialize(e){const t=i(e,"data-field");window.ga((function(n){n&&y(e,n.get(t))}))}}),d(".js-select-repo-permission",(async function(e,t){const n=u(e,".js-permission-success"),s=u(e,".js-permission-error");let o;n.hidden=!0,s.hidden=!0,e.classList.add("is-loading");try{o=await t.json()}catch(i){return e.classList.remove("is-loading"),void(s.hidden=!1)}e.classList.remove("is-loading"),n.hidden=!1;const r=e.closest(".js-org-repo");if(r){const e=o.json;r.classList.toggle("with-higher-access",e.members_with_higher_access)}})),Qe(".js-role-fgp-input",{constructor:HTMLInputElement,add(e){e.addEventListener("focus",Qa),e.addEventListener("blur",ec),ac()},remove(e){e.removeEventListener("focus",Qa),e.removeEventListener("blur",ec)}}),Qe("#js-fgp-list-items",{constructor:HTMLElement,add(e){e.addEventListener("mousedown",tc)},remove(e){e.removeEventListener("mousedown",tc)}}),et("change",".js-fgp-list-item-checkbox",e=>{const t=e.target;if(!(t instanceof HTMLInputElement))return;const n=t.value||"";t.checked?Oa(n):Ua(n),Wa().focus()}),et("focusin",".js-role-fgp-filter-input",()=>at(Wa(),Va())),et("focusout:delay",".js-role-fgp-filter-input",()=>ct(Wa(),Va()));const Oa=e=>{const t=rc(e),n=za(t),s=t.category,o=Xa(s);o.appendChild(n),Ja().hidden=!1,Ga(s).hidden=!1,o.hidden=!1},Ua=e=>{const t=rc(e),n=document.querySelector(`#fgp-item-${e}`),s=t.category,o=Xa(s);n.remove(),sc(o)&&(o.hidden=!0,Ga(s).hidden=!0);const r=Ja();nc(r)&&(r.hidden=!0)};et("click",".js-added-fgp-btn",e=>{const t=e.target;if(!(t instanceof Element))return;const n=t.closest(".js-added-fgp-item").getAttribute("data-fgp");Ua(n),(e=>{Ya(e).checked=!1})(n)});const za=e=>{const t=Ka().content.cloneNode(!0),n=t.querySelector(".js-added-fgp-item");return n.querySelector(".js-added-fgp-description").textContent=e.description,n.setAttribute("id",`fgp-item-${e.label}`),n.setAttribute("data-fgp",e.label),t},Wa=()=>document.querySelector(".js-role-fgp-input"),Va=()=>document.querySelector("#js-fgp-list-items"),Ja=()=>document.querySelector("#js-fgp-summary"),Ka=()=>Ja().querySelector("#js-fgp-list-item-template"),Ga=e=>document.querySelector(`.js-fgp-category-title[data-fgp-category="${e}"]`),Xa=e=>document.querySelector(`.js-fgp-category-list[data-fgp-category="${e}"]`),Ya=e=>Va().querySelector(`.js-fgp-list-item-checkbox[value="${e}"]`),Qa=()=>{Va().hidden=!1,Wa().setAttribute("aria-expanded","true")};let Za=!1;const ec=()=>{Za?Za=!1:(Va().hidden=!0,Wa().setAttribute("aria-expanded","false"))},tc=()=>Za=!0,nc=e=>!e.querySelector(".js-fgp-category-box").querySelector(".js-fgp-category-element:not([hidden])"),sc=e=>0===e.childElementCount;let oc={};const rc=e=>oc[e],ic=()=>Wa().getAttribute("data-fgp-metadata-url"),ac=S(async()=>{oc=await A(ic())});function cc(){return u(document,".js-saml-provider-settings-form",HTMLFormElement)}function lc(){return cc().querySelector(".js-saml-form-inputs")}function uc(){return u(document,".js-org-saml-confirm-enforcement-hidden",HTMLInputElement)}function dc(e){e&&e.classList.remove("d-none")}function mc(){return"1"===u(document,".js-org-saml-currently-enabled",HTMLInputElement).value&&!u(document,".js-org-enable-saml",HTMLInputElement).checked}function fc(){return u(document,".is-submit-button-value",HTMLInputElement)}function pc(){return u(document,".js-org-saml-enforce",HTMLInputElement).checked&&"0"===uc().value&&!("1"===u(document,".js-org-saml-previously-enforced",HTMLInputElement).value)&&"1"===u(document,".js-org-has-unlinked-saml-members",HTMLInputElement).value}function gc(){cc().submit()}function hc(){const e=document.querySelector(".js-org-enable-saml");e&&e instanceof HTMLInputElement&&(e.checked=!0,dc(lc()))}function vc(e,t){t>0?e.textContent=function(e){return e>999?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}(t):e.remove()}function bc(e,t){u(e,".js-add-child-team-loading-state").hidden=!t,u(e,".js-add-child-team-modal-content").hidden=t}d(".js-per-seat-invite-field, .js-per-seat-invite .js-org-remove-item",(async function(e,t){!function(e){for(const n in e.selectors){const t=e.selectors[n],s=document.querySelector(n);t&&s&&(s.textContent=t)}const t=100===e.filled_seats_percent;u(document,".js-need-more-seats").classList.toggle("d-none",!t),u(document,".js-add-org-member-form").classList.toggle("d-none",t)}((await t.json()).json)})),et("click",".js-org-enable-saml",(function(e){if(!(e.currentTarget instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/security.ts:91");e.currentTarget.checked?dc(lc()):function(e){e&&e.classList.add("d-none")}(lc())})),et("click",".js-saml-submit",(function(e){e.preventDefault();const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/orgs/security.ts:109");m(cc(),t)})),et("click",".js-org-saml-confirm-enforce-button",(function(){uc().value="true",m(cc())})),et("submit",".js-saml-provider-settings-form",(function(e){e.preventDefault(),"test_settings"===fc().name?gc():"save_settings"===fc().name&&(mc()?async function(){(await M({content:u(document,"#disable-saml-confirmation",HTMLTemplateElement).content.cloneNode(!0)})).addEventListener("dialog:remove",hc)}():pc()?M({content:u(document,"#enforce-saml-confirmation",HTMLTemplateElement).content.cloneNode(!0)}):gc())})),d(".js-fetch-tab-count",(async function(e,t){const n=(await t.json()).json;for(const s in n.selectors){vc(u(e,s),n.selectors[s])}})),Qe(".js-fetch-tab-count",{constructor:HTMLFormElement,add:m}),et("click",".js-team-remove-user",(function(e){e.preventDefault();for(const t of document.querySelectorAll(".js-team-add-user-form"))t.classList.remove("d-none");u(document,".js-team-add-user-name").focus(),o(e.currentTarget,"li").remove()})),et("click",".js-team-add-user-button",(function(e){e.preventDefault(),async function(e){const t=o(e,".js-team-add-user-form"),n=u(t,".js-team-add-user-name",HTMLInputElement),s=n.value;n.value="";const r=u(document,".js-team-user-logins");for(const o of r.querySelectorAll("li"))if(o.getAttribute("data-login")===s)return;if(!(await Te("low")))return;const i=new URL(t.getAttribute("data-template-url")||"",window.location.origin),a=new URLSearchParams(i.search.slice(1));a.append("member",s),i.search=a.toString(),n.focus();const c=await k(document,i.toString());r.appendChild(c);for(const o of l(document,".js-login-field",HTMLInputElement))o.disabled=!1;t.classList.add("d-none")}(e.currentTarget)})),et("click",".js-rename-owners-team-next-btn",(function(){const e=u(document,".js-rename-owners-team-about-content");e.hidden=!e.hidden;const t=u(document,".js-rename-owners-team-rename-form");t.hidden=!t.hidden})),et("auto-complete-change",".js-add-child-team-completer",(async function({target:e}){if(!(e instanceof st))throw new Error("invariant: app/assets/modules/github/orgs/team-add-child.ts:11");if(!(e instanceof st))return;if(!e.value)return;const t=o(e,".js-add-team-container");bc(t,!0);const n=o(e,".js-add-child-team-form"),s=i(n,"data-change-parent-summary-path"),r=await k(document,s);u(n,".js-add-team-search").hidden=!0,u(n,".js-add-team-warning").append(r),bc(t,!1)})),et("submit",".js-add-child-team-form",(function(e){const t=e.currentTarget,{value:n}=u(t,".js-add-child-team-completer",st);n||e.preventDefault()})),et("details-dialog-close",".js-add-team-dialog",(function(e){const t=e.currentTarget,n=u(t,".js-add-team-container");u(t,".js-add-team-search").hidden=!1,u(t,".js-add-team-warning").innerHTML="",bc(n,!1)})),et("click",".js-expandable-team-breadcrumbs .js-team-breadcrumb-trigger",(async function(e){const t=e.target;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/orgs/team-breadcrumbs.ts:7");const n=o(t,".js-expandable-team-breadcrumbs");n.classList.add("is-loading");try{await ke(n)}catch(s){}n.classList.remove("is-loading")}));class jc{constructor(e,t,n){this.diffId=e,this.side=t,this.lineNumber=n,this.element=F(document,this.anchor())}sideForCommenting(){return this.element&&this.element.classList.contains("blob-num-context")?"right":{R:"right",L:"left"}[this.side]}isContext(){return!!this.element&&this.element.classList.contains("blob-num-context")}anchor(){return`${this.diffId}${this.anchorSuffix()}`}anchorSuffix(){return`${this.side}${this.lineNumber}`}is(e){return this.diffId===e.diffId&&this.side===e.side&&this.lineNumber===e.lineNumber}}class wc{constructor(e,t,n,s,o){this.elements=new Set,this.isParsed=!1,this.isSplit=!1,this._rows=new Set,this._isAcrossHunks=!1,this._isContextOnly=!0,this._includesExpandedLine=!1,this.diffId=e,this.diffTable=document.querySelector(`.js-diff-table[data-diff-anchor="${e}"]`),this.diffTable&&(this.isSplit=this.diffTable.classList.contains("js-file-diff-split")),this.start=new jc(e,t,n),this.end=new jc(e,s,o),this.lineCount=0,this.parse()}anchor(){const e=[];return e.push(this.start.anchor()),this.start.is(this.end)||e.push(this.end.anchorSuffix()),e.join("-")}parse(){if(!this.diffTable)return;let e=this.unify(this.diffTable.querySelectorAll(".js-linkable-line-number"));e=this.filterInRange(e),this.lineCount=e.length,this.elements=this.expandRelatedElements(e),this.isParsed=!0}unify(e){if(!this.isSplit)return Array.from(e);const t=[];let n=[],s=[];for(const o of e)o.classList.contains("blob-num-addition")?n.push(o):o.classList.contains("blob-num-deletion")?s.push(o):(t.push(...s,...n,o),n=[],s=[]);return t.push(...s,...n),t}filterInRange(e){if(!this.start.element||!this.end.element)return[];let t=e.indexOf(this.start.element),n=e.indexOf(this.end.element);if(t>n){[t,n]=[n,t];const[e,s]=[this.end,this.start];this.start=e,this.end=s}return e.slice(t,n+1)}isContextOnly(){return this.isParsed||this.parse(),this._isContextOnly}isAcrossHunks(){return this.isParsed||this.parse(),this._isAcrossHunks}includesExpandedLine(){return this.isParsed||this.parse(),this._includesExpandedLine}rows(){return this.isParsed||this.parse(),this._rows}expandRelatedElements(e){const t=this.isSplit,n=e[0],s=e[e.length-1];if(n&&s){const e=n.closest("[data-hunk]"),t=s.closest("[data-hunk]");if(e&&t){e.getAttribute("data-hunk")!==t.getAttribute("data-hunk")&&(this._isAcrossHunks=!0)}}return e.reduce((e,n)=>{!this._includesExpandedLine&&n.closest(".blob-expanded")&&(this._includesExpandedLine=!0);const s=n.parentElement;s instanceof HTMLElement&&this._rows.add(s);const o=n.classList.contains("blob-num-deletion")||n.classList.contains("blob-num-addition");if(o&&(this._isContextOnly=!1),!s)return e;if(t&&o){return Array.from(s.children).indexOf(n)<2?e.add(s.children[0]).add(s.children[1]):e.add(s.children[2]).add(s.children[3])}for(const t of Array.from(s.children))e.add(t);return e},new Set)}}function Lc(e){const t=e.match(/^#?(diff-[a-f0-9]+)(L|R)(\d+)(?:-(L|R)(\d+))?$/i);if(null!=t&&6===t.length)return t;const n=e.match(/^#?(discussion-diff-[0-9]+)(L|R)(\d+)(?:-(L|R)(\d+))?$/i);return null!=n&&6===n.length?n:null}let yc=null,Ec=null,Tc=!1,kc=null;function Mc(){return yc}function Sc(e){return!!e.closest(".js-multi-line-comments-enabled")}function Hc(e,t){if(!Sc(e))return!1;const{start:{lineNumber:n},end:{lineNumber:s}}=t;return(n!==s||!t.isContextOnly())&&(!t.isAcrossHunks()&&!t.includesExpandedLine())}function xc(e){return o(e,".js-diff-table").classList.contains("is-selecting")}function Ac(){Dc(),window.history.replaceState(null,"","#"),Pc()}function qc(e,t){Dc();let n=e.id;if(t){const t=Lc(n);if(!t)return;const s=t[1],r=t[2],i=t[3];if(yc&&yc.diffId===s){if(r===yc.start.side&&i<yc.start.lineNumber)return;const t=new wc(s,yc.start.side,yc.start.lineNumber,r,+i);n=t.anchor();const a=e.closest(".js-file-content[data-hydro-view]");if(a instanceof HTMLElement&&function(e,t){const n={starting_diff_position:t.start.side+t.start.lineNumber,ending_diff_position:t.end.side+t.end.lineNumber,line_count:t.lineCount};e.setAttribute("data-hydro-client-context",JSON.stringify(n)),ce(e)}(a,t),Tc&&xc(e)){o(e,".js-diff-table").classList.toggle("is-commenting",Hc(e,t))}Ec=function(){if(Hc(e,t)){const n=`.js-add-line-comment[data-side="${t.end.sideForCommenting()}"]`,s=o(e,"tr").querySelector(n);s&&t&&s.click()}}}}window.history.replaceState(null,null,`#${n}`),Pc()}function Cc(e){if(!(e instanceof HTMLElement))return null;if(e.classList.contains("js-linkable-line-number"))return e;const t=e.previousElementSibling;return t?Cc(t):null}function Ic(e){if(yc){if(!(e.target instanceof Element))throw new Error("invariant: app/assets/modules/github/pages/diffs/linkable-line-number.ts:113");e.target.closest(".js-diff-table")||(window.history.replaceState(null,null,"#"),Pc())}}function _c(e){const t=e.target;if(!(t instanceof Element))return;kc&&function(){if(!kc)return;qc(kc,!1);const e=o(kc,".js-diff-table");kc=null,e.classList.add("is-selecting"),e.classList.add("is-commenting"),document.addEventListener("mouseup",(function(t){e.classList.remove("is-selecting"),e.classList.remove("is-selecting","is-commenting"),Ec&&Ec(),Ec=null,Nc(e),t.preventDefault()}),{once:!0})}();const n=t.closest(".blob-code, .js-linkable-line-number");var s;return n?n.classList.contains("blob-code")?function(e){const t=Cc(e);t&&xc(t)&&qc(t,!0)}(n):void(n.classList.contains("js-linkable-line-number")&&xc(s=n)&&qc(s,!0)):void 0}function $c(e){e.addEventListener("mouseenter",_c,{capture:!0})}function Nc(e){Tc=!1,e.removeEventListener("mouseenter",_c,{capture:!0}),setTimeout(()=>{document.addEventListener("click",Ic,{once:!0})},0)}function Dc(e){const t=e||document.querySelector(".js-add-line-comment[data-start_side]");t&&(t.removeAttribute("data-start_side"),t.removeAttribute("data-start_position"),t.removeAttribute("data-start_line"),t.removeAttribute("data-startiscontext"),t.removeAttribute("data-endiscontext"))}function Pc(){if(yc){for(const e of yc.elements)e.classList.remove("selected-line","selected-line-top","selected-line-bottom","selected-line-left","selected-line-right");yc=null}const e=Lc(window.location.hash);if(!e)return;const t=e[1],n=e[2],s=e[3],r=e[4]||n,i=e[5]||s;yc=new wc(t,n,+s,r,+i);const a=Array.from(yc.elements)[0];a&&(o(a,".js-diff-table").classList.contains("file-diff-split")?function(){if(!yc)return;for(const r of yc.elements)r.classList.add("selected-line");const e=[],t=[],n=[],s=[];for(const r of yc.rows()){const[o,i,a,c]=r.children;e.push(o),t.push(i),n.push(a),s.push(c)}function o(e){for(const[t,n]of e.entries()){if(n.classList.contains("empty-cell"))continue;const s=e[t-1];s&&s.classList.contains("selected-line")||n.classList.add("selected-line-top");const o=e[t+1];o&&o.classList.contains("selected-line")||n.classList.add("selected-line-bottom")}}o(e),o(t),o(n),o(s);for(const[r,i]of t.entries())s[r].classList.contains("selected-line")||i.classList.add("selected-line-right");for(const[r,i]of n.entries())t[r].classList.contains("selected-line")||i.classList.add("selected-line-left")}():function(){if(!yc)return;for(const s of yc.elements)s.classList.add("selected-line");const e=Array.from(yc.rows()),t=e[0];for(const s of t.children)s.classList.add("selected-line-top");const n=e[e.length-1];for(const s of n.children)s.classList.add("selected-line-bottom")}())}function Rc(e){const t=u(e,".js-inline-comment-form-container");t.classList.add("open"),u(t,".js-write-tab").click(),u(t,".js-comment-field").focus(),nt(t,"inlinecomment:focus")}function Fc(e){e.reset(),Dc();const t=o(e,".js-inline-comment-form-container");t.classList.remove("open"),nt(t,"inlinecomment:collapse")}function Bc(e){const t=e.closest(".js-teams-write-a-post");return t?function(e){const t=u(e,".js-team-discussions-post-compose");t.classList.contains("d-none")||(t.classList.add("d-none"),u(e,".js-post-placeholder").classList.remove("d-none"),e.classList.remove("active")),u(e,".js-comment-form-error").classList.add("d-none")}(t):e.closest(".js-teams-reply-to-post")?function(e){if(!(e instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/orgs/team-discussions.ts:29");Fc(e)}(e):void 0}function Oc(e){const t=e.closest(".js-teams-reply-to-post"),n=t&&t.querySelector(".js-comment-form-error");n&&n.classList.add("d-none")}function Uc(e,t){e.textContent=(parseInt(e.textContent)+t).toString()}function zc(e,t){if(e.classList.add("d-none"),!e.parentElement)throw new Error("invariant: app/assets/modules/github/orgs/team-discussions.ts:179");u(e.parentElement,t).classList.remove("d-none")}et("mousedown",".js-add-line-comment",(function(e){const t=e.target.parentElement;if(!t)return;if(!Sc(e.target))return;const n=Cc(t);if(!n)return;const s=o(e.target,".js-diff-table");$c(s),kc=n,Tc=!0,e.target.addEventListener("mouseup",(function(){Nc(s),kc=null,Tc=!1}),{once:!0}),yc&&yc.lineCount>1&&e.preventDefault()})),et("mousedown",".js-linkable-line-number",(function(e){if(!(e instanceof MouseEvent))return;if(0!==e.button)return;const t=e.target;if(!(t instanceof Element))return;const n=o(t,".js-diff-table");n.classList.add("is-selecting"),$c(n),document.addEventListener("mouseup",(function(){o(t,".js-diff-table").classList.remove("is-selecting"),Nc(n)}),{once:!0}),qc(t,e instanceof MouseEvent&&e.shiftKey),e.preventDefault()})),G(Pc),Qe(".blob-expanded",Pc),Qe(".js-diff-progressive-loader",(function(e){e.addEventListener("load",Pc)})),Qe(".js-diff-entry-loader",(function(e){e.addEventListener("load",Pc)})),et("click",".js-toggle-inline-comment-form",(function(e){Rc(o(e.currentTarget,".js-line-comments"))})),et("quote-selection",".js-line-comments",(function(e){Rc(e.currentTarget)})),s("keydown",".js-inline-comment-form-container form .js-comment-field",(function(e){const t=e.target;if(!(t instanceof HTMLTextAreaElement))throw new Error("invariant: app/assets/modules/github/behaviors/inline-comment.ts:33");if(!t.classList.contains("js-navigation-enable")&&"Escape"===e.key&&0===t.value.length){Fc(o(t,"form",HTMLFormElement)),e.preventDefault()}})),et("click",".js-hide-inline-comment-form",(function(e){const t=o(e.currentTarget,"form",HTMLFormElement),n=o(e.currentTarget,".js-inline-comment-form-container").querySelector(".js-multi-line-preview");n&&(n.hidden=!0),!T(t)||confirm(i(e.target,"data-confirm-cancel-text"))?Fc(t):e.preventDefault()})),et("click",".js-team-discussions-team-description-toggle",(function(){u(document,".js-team-discussions-team-description").classList.toggle("d-none"),u(document,".js-team-discussions-team-description-form").classList.toggle("d-none")})),et("click",".js-team-discussions-post-toggle",(function(e){const t=o(e.target,".js-teams-write-a-post");t.classList.contains("active")||(t.classList.add("active"),u(t,".js-team-discussions-post-compose").classList.remove("d-none"),u(t,".js-post-placeholder").classList.add("d-none"),u(t,".js-title-field").focus())})),et("click",".js-hide-post-form",(function(e){const t=o(e.target,".js-new-comment-form",HTMLFormElement);!T(t)||confirm(i(e.target,"data-confirm-cancel-text"))?Bc(e.target):e.preventDefault()})),et("click",".js-hide-inline-comment-form",(function(e){Oc(e.target)})),d(".js-new-comment-form",(async function(e,t){await t.text(),Bc(e),Oc(e)})),d(".js-team-discussions-team-description-form",(async function(e,t){try{await t.text()}catch(r){}const n=u(document,".js-team-discussions-team-description"),s=u(n,".description"),o=u(document,".js-team-discussions-team-description-field",HTMLTextAreaElement);n.classList.toggle("d-none"),e.classList.toggle("d-none"),o.value.trim()?(s.textContent=o.value,o.defaultValue=o.value):(s.textContent="This team has no description",o.defaultValue="")})),d(".js-comment-pin",(async function(e,t){const n=u(e,"button[type=submit]");n.blur(),await t.text();const s=u(e,".js-pinned-discussion-input",HTMLInputElement),r=document.querySelector("#pinned_posts_counter"),a=i(n,"aria-label"),c=i(n,"data-alternate-aria-label");n.setAttribute("data-alternate-aria-label",a),n.setAttribute("aria-label",c),n.classList.toggle("pinned");const l=n.classList.contains("pinned");if(r){Uc(r,l?1:-1);const t=o(r,".js-pinned-post-tab");if(!l&&t.classList.contains("selected")){!function(e){e.addEventListener("transitionend",(function(t){"opacity"===t.propertyName&&e.remove()}),{once:!0}),e.classList.add("fade-out")}(o(e,".js-comment-delete-container"))}}s.value=l?"0":"1"})),d(".js-comment-delete",(async function(e,t){await t.text();const n=e.closest(".discussion-post"),s=n&&n.querySelector(".js-comment-pin button[type=submit]");if(s&&s.classList.contains("pinned")){const e=document.querySelector("#pinned_posts_counter");e&&Uc(e,-1)}})),et("quote-selection",".js-discussion-post",(function(e){const t=u(e.target,".js-inline-comment-form-container");t.classList.add("open"),u(t,".js-write-tab").click(),u(t,".js-comment-field").focus()})),d(".js-comment-subscribe",(async function(e,t){await t.text(),zc(e,".js-comment-unsubscribe")})),d(".js-comment-unsubscribe",(async function(e,t){await t.text(),zc(e,".js-comment-subscribe")})),d(".js-discussion-post-update",(async function(e,t){const n=e.closest(".js-comment");if(!n)return;const s=n.querySelector(".js-comment-title");if(!s)return;const o=await t.json();s.textContent=o.json.title})),async function(){await w;const e=document.querySelector(".js-show-discussion .js-mark-notification-form");e instanceof HTMLFormElement&&m(e)}();let Wc=!1;function Vc(e){u(document,".js-selected-group-mappings-container").hidden=e}function Jc(e){const t=o(e,"form",HTMLFormElement),n=t.querySelector(".js-selected-team-id"),s=n instanceof HTMLInputElement&&n.value,r=u(t,".js-team-privacy-closed"),i=u(t,".js-team-privacy-secret"),a=u(r,"input",HTMLInputElement),c=u(i,"input",HTMLInputElement);i.classList.toggle("text-gray",!!s),c.disabled=!!s,s&&(a.checked=!0)}function Kc(e){const t=u(e,".js-team-member-summary");u(t,".js-team-member-summary-text").textContent=function(e){const t=l(e,"input.js-team-member:checked",HTMLInputElement);return 0===t.length?null:t.length<=3?t.map(e=>i(e,"data-team-member-text")).join(", "):`${t.length} members selected`}(e)||i(t,"data-default-label")}et("click",".js-open-child-team",(function(e){if(Wc)return;Wc=!0;const t=e.currentTarget.getAttribute("data-parent-team-slug");if(!t)return;const n=document.querySelectorAll(`.js-child-team[data-parent-team-slug="${t}"]`),s=o(e.currentTarget,".js-team-row");if(s.classList.contains("is-open"))e.currentTarget.setAttribute("aria-expanded","false"),function(e,t){(function e(t){for(const n of t){const t=i(n,"data-team-slug"),s=document.querySelectorAll(`.js-child-team[data-parent-team-slug="${t}"]`);e(s),n.classList.remove("is-open"),n.classList.add("d-none")}})(t),e.classList.remove("is-open"),Wc=!1}(s,n);else{e.currentTarget.setAttribute("aria-expanded","true"),async function(e,t,n){if(t.length){for(const e of t)e.classList.remove("d-none");e.classList.add("is-open"),Wc=!1}else{const t=await k(document,n);e.after(t),e.classList.add("is-open"),Wc=!1}}(s,n,i(e.currentTarget,"data-child-team-url"))}})),et("click",".js-show-more-child-teams",(async function(e){if(Wc)return;Wc=!0;const t=e.currentTarget,n=o(t,".js-team-row"),s=i(t,"data-child-team-url"),r=n.parentNode,a=await k(document,s);n.before(a),r&&r.removeChild(n),Wc=!1})),a(".js-team-ldap-group-field",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/team-import.ts:9");o(t,".form-group").classList.remove("errored")})),et("auto-complete-change",".js-import-ldap-group-completer",(function({target:e}){if(!(e instanceof st))throw new Error("invariant: app/assets/modules/github/orgs/team-import.ts:13");const t=o(e,".js-ldap-group-adder"),n=u(e,".js-team-ldap-group-field",HTMLInputElement),s=u(t,".js-team-ldap-dn-field",HTMLInputElement);if(s.value="",e.value){const{dn:t,cn:o}=JSON.parse(e.value);n.value=o,s.value=t}})),d(".js-ldap-group-adder",(async function(e,t,n){n.headers.set("X-Context","import");const s=o(e,".js-ldap-import-groups-container");let r;try{r=await t.html()}catch(a){return void(a.response&&u(e,".form-group").classList.add("errored"))}const i=document.querySelector(".js-import-form-actions");s.classList.remove("is-empty"),u(s,".js-ldap-imported-groups").prepend(r.html),e.reset(),u(e,".js-team-ldap-group-field").focus(),i&&i.classList.remove("d-none")})),et("submit",".js-team-remove-group",(function(e){o(e.currentTarget,".js-team").classList.add("is-removing"),u(document,".js-team-ldap-group-field").focus()})),d(".js-team-remove-group",(async function(e,t){try{await t.text()}catch(n){return void o(e,".js-team").classList.remove("is-removing")}o(e,".js-team").remove(),document.querySelector(".js-team:not(.is-removing)")||(u(document,".js-ldap-import-groups-container").classList.add("is-empty"),u(document,".js-import-form-actions").classList.add("d-none"))})),et("click",".js-edit-team",(function(e){const t=o(e.currentTarget,".js-team");t.classList.contains("is-removing")||(t.classList.add("is-editing"),u(t,".js-team-name-field").focus())})),et("click",".js-cancel-team-edit",(function(e){const t=o(e.currentTarget,".js-team"),n=u(t,".js-team-form",HTMLFormElement);t.classList.remove("is-editing"),n.reset()})),d(".js-team-form",(async function(e,t,n){n.headers.set("X-Context","import");const s=await t.html();o(e,".js-team").replaceWith(s.html)})),et("details-menu-selected",".js-team-group-mapping-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/orgs/team-external.ts:13");const t=e.detail.relatedTarget,n=i(t,"data-id"),s=i(t,"data-name"),o=i(t,"data-description"),r=u(document,".js-team-group-mapping-template",HTMLTemplateElement),a=document.importNode(r.content,!0),c=u(a,".js-group-mapping-hidden-name",HTMLInputElement),l=u(a,".js-group-mapping-hidden-description",HTMLInputElement);c.name=c.name.replace("{GROUP_ID}",n),l.name=l.name.replace("{GROUP_ID}",n),c.value=s,l.value=o,u(a,".js-group-mapping-name").textContent=s,u(a,".js-group-mapping-desc").textContent=o;const d=u(document,".js-selected-group-mappings");(function(e,t){return null!=t.querySelector(`input[name="team[group_mappings][${e}][name]"]`)})(n,d)||(d.append(a),Vc(!1))}),{capture:!0}),et("click",".js-remove-group-mapping",(function(e){o(e.currentTarget,".js-group-mapping-container").remove(),!!document.querySelector(".js-selected-group-mappings .js-group-mapping-container")||Vc(!0)})),Qe(".js-team-group-mapping-menu",(function(e){const t=u(e,"remote-input"),n=document.getElementById(i(t,"aria-owns"));n&&t.addEventListener("error",(function(){n.classList.add("is-error")}))})),et("click",".js-team-search-filter",(function(e){e.preventDefault();const t=i(e.currentTarget,"data-filter"),n=o(e.currentTarget,"[data-filter-on]"),s=i(n,"data-filter-on"),r=u(document,".js-team-search-field",HTMLInputElement),a=new RegExp(`${s}:[a-z]+`),c=r.value.trim().replace(a,"");r.value=`${c} ${t}`.replace(/\s\s/," "),r.focus(),nt(r,"input")})),Qe(".js-select-team-menu",(function(e){Jc(e)})),et("details-menu-selected",".js-select-team-menu",(function(e){const t=e.target;if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/orgs/team-new.ts:35");const n=e.detail.relatedTarget;if(!(n instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/orgs/team-new.ts:37");u(t,".js-selected-team-id",HTMLInputElement).value=n.value,u(t,".js-already-selected-team-name",HTMLInputElement).value=i(n,"data-team-name"),Jc(t)}),{capture:!0}),et("click",".js-create-team-button",(function(e){const t=o(e.currentTarget,"form"),n=t.querySelector(".js-already-selected-team-name");if(!(n instanceof HTMLInputElement))return;const s=t.querySelector(".js-original-team-visibility"),r=t.querySelector(".js-team-privacy-secret");if(!r)return;const a=u(r,"input",HTMLInputElement),c=function(e){return e.value!==e.getAttribute("data-original-team-name")}(n),l=function(e,t){return null!=e&&t.checked&&!["","SECRET"].includes(e.getAttribute("data-original-team-visibility"))}(s,a);if(c||l){e.preventDefault();const s=i(t,"data-important-changes-summary-url"),o=new URL(s,window.location.origin),r=new URLSearchParams(o.search.slice(1));r.append("parent_team",n.value),l&&r.append("visibility_changed",l.toString()),c&&r.append("parent_changed",c.toString()),o.search=r.toString(),M({content:k(document,o.toString()),dialogClass:"p-3"})}})),et("click",".js-confirm-edit-team",(function(){u(document,".js-org-team-form",HTMLFormElement).submit()})),et("auto-complete-change",".js-team-project-completer",(function({target:e}){if(!(e instanceof st))throw new Error("invariant: app/assets/modules/github/orgs/team-projects.ts:6");const t=o(e,"form",HTMLFormElement),n=g(t,"project_id"),s=u(t,".js-team-project-complete-field",HTMLInputElement);if(e.value){const{name:t,id:o}=JSON.parse(e.value);n.value=o,s.value=t}else n.value=""})),et("details-menu-selected",".js-team-member-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/orgs/team-review-request-delegation-exclusion.ts:23");Kc(o(e.currentTarget,".js-team-member-picker"))}),{capture:!0}),Qe(".js-team-member-summary",(function(e){Kc(o(e,".js-team-member-picker"))})),Qe(".js-org-transform-poller",(function(e){const t=e.getAttribute("data-redirect-url")||"";e.addEventListener("load",(function(){window.location.href=t}))})),Qe(".js-transform-notice",{constructor:HTMLElement,add(e){const t=ao("org_transform_notice");for(const s of t){const t=document.createElement("span");try{t.textContent=atob(decodeURIComponent(s.value)),lo(s.key),e.appendChild(t),e.hidden=!1}catch(n){}return}}}),et("change",".js-notification-restrictions-confirmation-needed",(function({currentTarget:e}){if(!(e instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/orgs/verified-domains.ts:8");const t=u(document,".js-notification-restrictions-confirm-modal",HTMLElement),n=u(document,".js-notification-restrictions-save",HTMLButtonElement);t.hidden=!e.checked,n.hidden=e.checked}));let Gc=class PagerController extends HTMLElement{constructor(){super(...arguments),this.currentPage=0}connectedCallback(){this.toggleTargets()}toggleTargets(){const e=this.currentPage+1>=this.page.length;for(const t of this.hideOnLastPage)t.hidden=e;for(const t of this.showOnLastPage)t.hidden=!e}next(){this.page[this.currentPage].hidden=!0,this.currentPage+=1,this.page[this.currentPage].hidden=!1,this.toggleTargets()}};function Xc(e,t){const n=e.value;e.value=t.textContent||"",t.textContent=n}or([ir],Gc.prototype,"hideOnLastPage",void 0),or([ir],Gc.prototype,"showOnLastPage",void 0),or([ir],Gc.prototype,"page",void 0),Gc=or([ar],Gc),et("click","#load-readme",(function(e){const t=u(document,"#gollum-editor-body",HTMLTextAreaElement),n=u(document,"#editor-body-buffer"),s=u(document,"#undo-load-readme"),o=n.textContent,r=i(e.currentTarget,"data-readme-name");if(Xc(t,n),!(e.currentTarget instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/pages-composer.ts:11");e.currentTarget instanceof HTMLButtonElement&&(e.currentTarget.disabled=!0,e.currentTarget.textContent=`${r} loaded`,s.classList.remove("d-none"),t.addEventListener("input",(function e(){t.value!==o&&(s.classList.add("d-none"),t.removeEventListener("input",e))})))})),et("click","#undo-load-readme",(function(e){Xc(u(document,"#gollum-editor-body",HTMLTextAreaElement),u(document,"#editor-body-buffer"));const t=u(document,"#load-readme",HTMLButtonElement),n=i(t,"data-readme-name");t.disabled=!1,t.textContent=`Load ${n}`,e.currentTarget.classList.add("d-none")}));let Yc=!1;function Qc(e,t){return document.querySelector(`#${e}LC${t}`)}function Zc({blobRange:e,anchorPrefix:t}){if(0!==document.querySelectorAll(".js-file-line").length&&(function(){for(const e of document.querySelectorAll(".js-file-line.highlighted"))e.classList.remove("highlighted");for(const e of document.querySelectorAll(".js-file-line .highlighted")){const t=o(e,".js-file-line");e.replaceWith(...e.childNodes),t.normalize()}}(),e))if(null===e.start.column||null===e.end.column)for(let n=e.start.line;n<=e.end.line;n+=1){const e=Qc(t,n);e&&e.classList.add("highlighted")}else if(e.start.line===e.end.line&&null!=e.start.column&&null!=e.end.column){const n=xe(e,e=>Qc(t,e));if(n){const e=document.createElement("span");e.classList.add("highlighted"),Ae(n,e)}}}function el(){const e=Me(window.location.hash);Zc(e),function(){const e=document.querySelector(".js-file-line-actions");if(!e)return;const t=document.querySelectorAll(".js-file-line.highlighted"),n=t[0];if(n){!function(e){const t=[];for(const s of e)t.push(s.textContent);const n=document.getElementById("js-copy-lines");if(n instanceof lt){n.textContent=`Copy ${1===e.length?"line":"lines"}`,n.value=t.join("\n");const s=`Blob, copyLines, numLines:${e.length.toString()}`;n.setAttribute("data-ga-click",s)}}(t),function(e){const t=document.getElementById("js-view-git-blame");if(!t)return;t.setAttribute("data-ga-click",`Blob, viewGitBlame, numLines:${e.toString()}`)}(t.length);const s=function(e){const t=document.querySelector(".js-permalink-shortcut");if(t instanceof HTMLAnchorElement){const n=`${t.href}${window.location.hash}`,s=document.getElementById("js-copy-permalink");if(s instanceof lt){s.value=n;const t=`Blob, copyPermalink, numLines:${e.toString()}`;s.setAttribute("data-ga-click",t)}return n}}(t.length);s&&function(e,t){const n=document.getElementById("js-new-issue");if(n instanceof HTMLAnchorElement){if(!n.href)return;const s=new URL(n.href,window.location.origin),o=new URLSearchParams(s.search.slice(1));o.set("permalink",e),s.search=o.toString(),n.href=s.toString(),n.setAttribute("data-ga-click",`Blob, newIssue, numLines:${t.toString()}`)}}(s,t.length),e.style.top=`${n.offsetTop-2}px`,e.classList.remove("d-none")}else e.classList.add("d-none")}();const{blobRange:t,anchorPrefix:n}=e,s=t&&Qc(n,t.start.line);if(!Yc&&s){s.scrollIntoView(),o(s,".blob-wrapper, .js-blob-wrapper").scrollLeft=0}Yc=!1}function tl(e){qe(e),X(e)}async function nl(e,t){let n;if(t){const s="R"===t.slice(-1)?"data-right-range":"data-left-range",o=e.getAttribute(s)||"";n=t+parseInt(o.split("-")[0],10)}else n=e.hash.slice(1);const s=i(e,"data-url"),r=new URL(s,window.location.origin),a=new URLSearchParams(r.search.slice(1));a.append("anchor",n),r.search=a.toString();const c=await k(document,r.toString()),l=o(e,".js-expandable-line"),u=function(e,t){const n=e.nextElementSibling;return n instanceof HTMLElement&&n.matches(t)?n:null}(l,".file-diff-line");u?V(u,()=>{l.replaceWith(c)}):l.replaceWith(c)}function sl(e,t,n,s){const o=parseInt(n,10),r=parseInt(s||"",10);return l(e,".js-expand",HTMLAnchorElement).filter(e=>{const n="R"===t?"data-right-range":"data-left-range",s=(e.getAttribute(n)||"").split("-"),i=parseInt(s[0],10),a=parseInt(s[1],10);return i<=o&&o<=a||(o<=i&&a<=r||i<=r&&r<=a)})}G((function(){if(document.querySelector(".js-file-line-container")){setTimeout(el,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()}}})),et("click",".js-line-number",(function(e){if(!(e instanceof MouseEvent))throw new Error("invariant: expected click event to be MouseEvent -- app/assets/modules/github/pages/blob/lines.ts:162");const t=Me(e.currentTarget.id),{blobRange:n}=t;if(!n)throw new Error("invariant: expected line number clicks to match range -- app/assets/modules/github/pages/blob/lines.ts:165");const s=Se(window.location.hash);s&&e.shiftKey&&(t.blobRange={start:s.start,end:n.end}),function(e){const t=window.scrollY;Yc=!0,e(),window.scrollTo(0,t)}(()=>{window.location.hash=He(t)})})),et("submit",".js-jump-to-line-form",(function(e){const t=u(e.currentTarget,".js-jump-to-line-field",HTMLInputElement).value.replace(/[^\d-]/g,"").split("-").map(e=>parseInt(e,10)).filter(e=>e>0).sort((e,t)=>e-t);t.length&&(window.location.hash=`L${t.join("-L")}`),e.preventDefault()})),a(".js-csv-filter-field",(function(e){if(!(e.target instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/pages/blob/csv.ts:4");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))})),et("navigation:keydown",".js-commits-list-item",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/pages/commits.ts:6");e.target instanceof Element&&"c"===e.detail.hotkey&&u(e.target,".js-navigation-open").click()})),G((function(){const e=function(e){if(!e)return;const t=Lc(e);if(!t)return;const n=t[1],s=t[2],o=t[3],r=t[5];return{anchor:n,side:s,line:o,lastLine:r,hashFragment:n+s+o,partialHashFragment:n+s}}(window.location.hash);e&&(F(document,e.hashFragment)&&!e.lastLine||async function e(t,n){const{anchor:s,side:o,line:r,lastLine:i,hashFragment:a,partialHashFragment:c}=t,l=F(document,s);if(!l)return;const u=l.nextElementSibling;if(!u)return;const d=sl(u,o,r,i);if(!d.length){const e=F(document,a);if(e)return void tl(e);const t=u.querySelector(".js-diff-load-container");if(!t)return;try{await _o(t);const e=F(document,a);e instanceof HTMLElement&&tl(e)}catch(f){tl(u)}return}await function(e,t){return Promise.all(e.map(e=>nl(e,t)))}(d,c);const m=F(document,a);sl(u,o,r,i).length?e(t,n):m?tl(m):n<1&&e(t,n+1)}(e,0))})),et("click",".js-expand",(function(e){if(e.preventDefault(),!(e.currentTarget instanceof HTMLAnchorElement))throw new Error("invariant: app/assets/modules/github/pages/diffs/expander.ts:104");nl(e.currentTarget)}));const ol=new RegExp("```suggestion(?:.*)\n","i"),rl=new RegExp("```(\n|$)");function il(e,t){const n=e.slice(0,t).split("\n");return e.split("\n")[n.length-1]}function al(e){const t=/^(\s+)/.exec(e);return t&&t[0]||""}function cl(e,t,n=0){const s=t.substring(n,t.length),o=e.exec(s);return o?o.index+n:-1}function ll(e,t){const n=[];let s=0,o=-1;for(;(o=cl(ol,e,s))>-1;){s=o+"```suggestion".length;const t=cl(rl,e,s);if(-1===t)return!1;s=t+"```".length,n.push([o,t])}return n.some(e=>t>e[0]&&t<e[1])}const ul=".js-add-to-batch-enabled",dl=".js-unchanged-suggestion",ml=".js-closed-pull",fl=".js-viewing-subset-changes",pl=".js-validation-on-left-blob",gl=".js-validation-on-right-blob",hl=".js-outdated-comment",vl=".js-resolved-thread",bl=".js-pending-review";function jl(e){const t=e.getAttribute("data-lines");if(null!=t){const n=o(e,".js-suggested-changes-container");!function(e,t){const n=function(e){let t="```suggestion\n";return t+=`${e}\n`,t+="```",t}(e),s=t.selectionStart,o=t.value,r=cl(/\n/,o,s),i=""===o.trim(),a=il(o,s),c=""===a.trim(),l="\n```".length;let u=o,d=0;if(i)u=n,d=u.length-l;else if(-1===r)c?(u=o+n,d=u.length-l):(u=[o,n].join("\n"),d=u.length-l);else if(c){const e=s-al(a).length,t=o.substring(0,e),i=o.substring(r,o.length);u=[t,n,i].join(""),d=u.length-i.length-l}else if(ll(o,s)){const e=cl(/```/,o,s)+3,t=o.substring(0,e),r=o.substring(e,o.length);u=[t,"\n",n,r].join(""),d=u.length-r.length-l}else{const e=o.substring(0,r),t=o.substring(r,o.length);u=[e,"\n",n,t].join(""),d=u.length-t.length-l}y(t,u),t.focus(),t.setSelectionRange(d,d)}(t,u(n,".js-comment-field",HTMLTextAreaElement))}}function wl(e,t){const n=document.querySelectorAll(".js-apply-suggestion-button"),s=u(e,".js-disabled-apply-suggestion-button");for(const r of n){const e=s.cloneNode(!0);yl(e,t),o(r,"details").replaceWith(e)}}function Ll(e){const t=document.querySelector(".js-batched-suggested-changes-container");t&&t.classList.add("d-none");for(const n of l(document,".js-apply-single-suggestion",HTMLInputElement))n.classList.remove("d-none"),n.disabled=!0,n.setAttribute("aria-label",e);for(const n of l(document,".js-batched-suggested-changes-add",HTMLInputElement))n.classList.remove("d-none"),n.disabled=!0,n.setAttribute("aria-label",e);for(const n of document.querySelectorAll(".js-batched-suggested-changes-remove"))n.classList.add("d-none");for(const n of document.querySelectorAll(".js-focus-commit-suggestions-form-button"))n.classList.add("d-none");for(const n of document.querySelectorAll(".pending-batched-suggestion-label"))n.classList.add("d-none")}function yl(e,t){e.setAttribute("aria-label",t),e.classList.remove("d-none")}function El(e,t){const n=u(document,".js-suggested-changes-inline-validation-template").cloneNode(!0);n.classList.remove("js-suggested-changes-inline-validation-template"),u(n,".js-suggested-changes-inline-error-message").textContent=e.trim();const s=t.parentNode;if(!s)throw new Error("invariant: app/assets/modules/github/pulls/suggested-changes.ts:83");s.insertBefore(n,t.nextSibling)}function Tl(e){if(!document.querySelector(".js-suggested-changes-subset-files"))return;const t=l(e,".js-suggested-change-toolbar-item",HTMLButtonElement),n=u(document,fl).textContent.trim();for(const s of t)s.disabled=!0,s.setAttribute("aria-label",n)}function kl(){const e=document.querySelector(".js-batched-suggested-changes-container");e&&setTimeout(()=>function(e){const t=o(e,".js-review-state-classes").querySelectorAll("[data-pending-batched-suggestion]").length;for(const s of document.querySelectorAll(".js-pending-batched-suggested-changes-count"))s.textContent=String(t);const n=u(document,".js-reenable-add-to-batch").textContent;for(const s of document.querySelectorAll("[data-batched-suggestion-reenable-sibling]"))s.removeAttribute("data-batched-suggestion-reenable-sibling"),s.removeAttribute("disabled"),s.setAttribute("aria-label",n);if(t>0){e.hidden=!1;const t=u(e,".js-batched-suggested-changes-toggle");t.classList.add("anim-pulse-in"),t.addEventListener("animationend",()=>t.classList.remove("anim-pulse-in"),{once:!0});for(const e of document.querySelectorAll(".js-apply-single-suggestion"))e.classList.add("d-none");for(const e of document.querySelectorAll(".js-batched-suggested-changes-add")){const t=o(e,".js-suggested-change-form-container");if("true"===t.getAttribute("data-pending-batched-suggestion")||"true"===t.getAttribute("data-comment-pending")||"true"===t.getAttribute("data-outdated-comment")?e.classList.add("d-none"):e.classList.remove("d-none"),"true"===e.getAttribute("data-batched-suggestion-disabled-by-sibling")){e.removeAttribute("data-batched-suggestion-disabled-by-sibling"),e.setAttribute("disabled","disabled");const t=u(document,".js-one-suggestion-per-line").textContent;e.setAttribute("aria-label",t)}}for(const e of document.querySelectorAll(".js-batched-suggested-changes-remove")){"true"===o(e,".js-suggested-change-form-container").getAttribute("data-pending-batched-suggestion")?e.classList.remove("d-none"):e.classList.add("d-none")}for(const e of document.querySelectorAll(".js-focus-commit-suggestions-form-button")){const t=o(e,".js-suggested-change-form-container"),n="true"===t.getAttribute("data-comment-pending"),s="true"===t.getAttribute("data-outdated-comment"),r="true"===t.getAttribute("data-resolved-comment"),i=o(e,".js-inline-comments-container"),a="left"===u(i,'input[name="side"]',HTMLInputElement).value;n||s||r||a?e.classList.add("d-none"):e.classList.remove("d-none")}for(const e of document.querySelectorAll(".pending-batched-suggestion-label")){"true"===o(e,".js-suggested-change-form-container").getAttribute("data-pending-batched-suggestion")?e.classList.remove("d-none"):e.classList.add("d-none")}}else{e.hidden=!0;for(const e of document.querySelectorAll(".js-apply-single-suggestion"))e.classList.remove("d-none");for(const e of document.querySelectorAll(".js-batched-suggested-changes-add"))e.classList.remove("d-none");for(const e of document.querySelectorAll(".js-batched-suggested-changes-remove"))e.classList.add("d-none");for(const e of document.querySelectorAll(".js-focus-commit-suggestions-form-button"))e.classList.add("d-none");for(const e of document.querySelectorAll(".pending-batched-suggestion-label"))e.classList.add("d-none")}}(e))}function Ml(e,t){const n=u(e,"input[name=commit_title]",HTMLInputElement),s=u(e,"textarea[name=commit_message]",HTMLTextAreaElement);let o=n.value.trim();""===o&&(o=n.defaultValue);const r=s.value.trim();""!==r&&(o=`${o}\n\n${r}\n`),n.disabled=!0,s.disabled=!0;const i=document.createElement("input");i.setAttribute("type","hidden"),i.setAttribute("name","message"),i.value=o,e.appendChild(i);const a=document.createElement("input");a.setAttribute("type","hidden"),a.setAttribute("name","changes"),a.value=JSON.stringify(t),e.appendChild(a)}function Sl(e,t){const n=e.nextElementSibling;return n&&n.matches(t)?n:null}function Hl(e){const t=e.querySelector(".js-toggle-file-notes");t instanceof HTMLInputElement&&y(t,!0)}function xl(){for(const e of document.querySelectorAll(".file .js-inline-comments-container")){const t=e.querySelectorAll(".js-comments-holder > *").length>0,n=e.querySelector(".js-inline-comment-form-container"),s=!!n&&n.classList.contains("open");t||s||e.remove()}}function Al(e){const t=u(document,e).firstElementChild;if(!t)throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:189");const n=t.cloneNode(!0),s=n.querySelector("textarea");return s instanceof HTMLTextAreaElement&&(s.value=""),n}async function ql(e){const t=e.querySelector(".js-suggestion-button-placeholder");if(!t)return;const n=t.getAttribute("data-src-base");if(!n)return;const s=new URL(n,window.location.origin),o=t.closest(".js-inline-comment-form")||t.closest(".js-comment-update");if(!(o instanceof HTMLFormElement))return;const r=function(e,t){const n=new URLSearchParams(e.search.slice(1)),s=t.elements.namedItem("in_reply_to")||t.elements.namedItem("comment_id");if(s instanceof HTMLInputElement&&s.value)return n.append("comment_id",s.value),n;const o=t.elements.namedItem("path"),r=t.elements.namedItem("start_side"),i=t.elements.namedItem("start_line"),a=t.elements.namedItem("side"),c=t.elements.namedItem("line"),l=t.elements.namedItem("start_commit_oid"),u=t.elements.namedItem("end_commit_oid"),d=t.elements.namedItem("base_commit_oid");return o instanceof HTMLInputElement&&r instanceof HTMLInputElement&&i instanceof HTMLInputElement&&a instanceof HTMLInputElement&&c instanceof HTMLInputElement&&l instanceof HTMLInputElement&&u instanceof HTMLInputElement&&d instanceof HTMLInputElement?(n.append("path",o.value),n.append("start_side",r.value),n.append("start_line",i.value),n.append("end_side",a.value),n.append("end_line",c.value),n.append("start_commit_oid",l.value),n.append("end_commit_oid",u.value),n.append("base_commit_oid",d.value),n):null}(s,o);if(!r)return;s.search=r.toString();const i=await k(document,s.toString());t.innerHTML="",t.appendChild(i)}function Cl(e,t,n,s){if(e.classList.remove("bg-green-light","bg-red-light"),!s)return"right"===n?(e.classList.add("color-green-6"),void(e.textContent=`+${t}`)):"left"===n?(e.classList.add("text-red"),void(e.textContent=`-${t}`)):void(e.textContent=String(t));e.textContent=t}et("click",".js-suggested-change-toolbar-item",(function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&!t.disabled&&jl(t)})),et("click",".js-refresh-after-suggestion",(function(){window.location.reload()})),Qe(".js-inline-comments-container",{add(e){Tl(e)}}),Qe(".js-preview-body .js-apply-changes",{add(e){const t=e.closest(".js-suggested-changes-container");if(!t)return e.remove();const n=u(document,gl).textContent,s=u(document,pl).textContent,r=o(e,".js-suggested-changes-blob");if(""!==t.getAttribute("data-thread-side")){if("left"===t.getAttribute("data-thread-side"))return El(s,r),e.remove()}else{const t=o(e,".js-inline-comment-form"),n=u(t,'input[name="side"]',HTMLInputElement);if(!t||!n)return e.remove();if(t&&"left"===n.value)return El(s,r),e.remove()}const i=e.previousElementSibling;if(!i)throw new Error("invariant: app/assets/modules/github/pulls/suggested-changes.ts:144");const a=i.querySelector(".js-blob-code-deletion"),c=i.querySelectorAll(".js-blob-code-addition");return a&&0!==c.length?a.textContent===Array.from(c).map(e=>e.textContent).join("\n")?(El(n,r),e.remove()):void e.remove():void 0}}),Qe(".js-comment-body .js-apply-changes",{add(e){const t=e.closest(".js-suggested-changes-container");if(!t)return e.remove();const n=t.querySelector(".js-suggested-changes-template");if(!(n instanceof HTMLTemplateElement))return e.remove();const s=n.content.cloneNode(!0),o=u(s,".js-disabled-apply-suggestion-button");let r;try{r=u(s,".js-batched-suggested-changes-add")}catch(v){if("QueryError"!==v.name)throw v}if(l(document,".js-suggested-changes-files-tab").length){const e=u(document,ul).textContent;r&&(r.removeAttribute("disabled"),r.setAttribute("aria-label",e))}const i=u(document,".js-pull-header-details"),a=i&&"true"===i.getAttribute("data-pull-is-open"),c=e.closest(".js-resolvable-timeline-thread-container"),d="true"===n.getAttribute("data-comment-pending"),m=t.classList.contains("js-selection-contains-deletions");if(c&&"true"===c.getAttribute("data-resolved")){const t=u(document,vl).textContent,n=s.querySelector("details");return n&&n.remove(),yl(o,t),r&&(r.setAttribute("disabled","disabled"),r.setAttribute("aria-label",t)),e.replaceWith(s)}if(!a){const t=u(document,ml).textContent;return yl(o,t),r&&(r.setAttribute("disabled","disabled"),r.setAttribute("aria-label",t)),e.replaceWith(s)}if(d){const t=u(document,bl).textContent;return u(s,"details").remove(),yl(o,t),r&&(r.setAttribute("disabled","disabled"),r.setAttribute("aria-label",t)),e.replaceWith(s)}if(m){const t=u(document,pl).textContent;return u(s,"details").remove(),yl(o,t),r&&(r.setAttribute("disabled","disabled"),r.setAttribute("aria-label",t)),e.replaceWith(s)}const f=document.querySelector(".js-suggested-changes-subset-files"),p="true"===n.getAttribute("data-outdated-comment");if(f||p){let t;return f?t=u(document,fl).textContent:p&&(t=u(document,hl).textContent),u(s,"details").remove(),yl(o,t),r&&(r.setAttribute("disabled","disabled"),r.setAttribute("aria-label",t)),e.replaceWith(s)}const g=u(s,".js-single-suggested-change-form"),h=e.closest(".js-suggested-changes-blob");if(h){const e=h.querySelector(".js-blob-code-deletion"),t=h.querySelectorAll(".js-blob-code-addition");if(!e)return;const n=e.textContent,i=Array.from(t).map(e=>e.textContent);if(i.length>0&&n===i.join("\n")){const e=u(document,dl).textContent;u(s,"details").remove(),yl(o,e),r&&(r.setAttribute("disabled","disabled"),r.setAttribute("aria-label",e))}else for(const s of i){const e=document.createElement("input");e.setAttribute("type","hidden"),e.setAttribute("name","value[]"),e.value=s,g.appendChild(e)}}e.replaceWith(s)}}),Qe(".js-pull-header-details",{add(e){const t="true"===e.getAttribute("data-pull-is-open"),n=document.querySelector(".js-suggested-changes-template");if(t||!(n instanceof HTMLTemplateElement))return;const s=n.content,o=u(document,ml).textContent;wl(s,o),Ll(o)}}),Qe(".js-suggested-changes-subset-files",{add(){const e=document.querySelector(".js-suggested-changes-template");if(!(e instanceof HTMLTemplateElement))return;const t=e.content,n=u(document,fl).textContent;wl(t,n),Ll(n)}}),et("click",".js-apply-suggestion-button",(async function(e){const t=e.currentTarget.parentElement;if(t){const e=u(t,".js-suggestion-commit-title");setTimeout(()=>e.focus(),1)}})),et("click",".js-dismiss-suggested-change-onboarding-notice",(async function(e){const t=i(e.currentTarget,"data-url");if(!(e.currentTarget.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/pulls/suggested-changes.ts:327");const n=u(e.currentTarget.parentElement,".js-data-url-csrf",HTMLInputElement),s=new FormData;s.append("notice","suggested_changes_onboarding_prompt"),await H(fe(t,n.value,{method:"post",body:s}));const o=document.querySelectorAll(".js-suggested-change-onboarding-notice");for(const r of o)r.remove()})),s("keypress",".js-comment-field",(function(e){if("Enter"===e.key){const t=e.target;if(!(t instanceof HTMLTextAreaElement))throw new Error("invariant: app/assets/modules/github/pulls/suggested-changes.ts:343");(function(e){const t=e.selectionStart;if(!ll(e.value,t))return!1;const n=e.value,s=il(n,t);if(null===s)return!1;const o=`\n${al(s)}`,r=n.substr(0,t)+o+n.substr(t);y(e,r);const i=t+o.length;return e.setSelectionRange(i,i),!0})(t)&&e.preventDefault()}})),s("keypress",".js-suggestion-commit-message",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLTextAreaElement))throw new Error("invariant: app/assets/modules/github/pulls/suggested-changes.ts:351");"Enter"===e.key&&t.setAttribute("rows","3")})),et("click",".js-batched-suggested-changes-add",(function(e){const t=e.target,n=o(t,".js-suggested-change-form-container");if("true"===n.getAttribute("data-comment-pending")||"true"===n.getAttribute("data-outdated-comment")||"true"===t.getAttribute("data-batched-suggestion-disabled-by-sibling"))return;n.setAttribute("data-pending-batched-suggestion","true");const s=o(t,".js-inline-comments-container");for(const o of s.querySelectorAll(".js-batched-suggested-changes-add"))o.setAttribute("data-batched-suggestion-disabled-by-sibling","true");t.removeAttribute("data-batched-suggestion-disabled-by-sibling"),kl()})),et("click",".js-batched-suggested-changes-remove",(function(e){o(e.currentTarget,".js-suggested-change-form-container").removeAttribute("data-pending-batched-suggestion");const t=o(e.currentTarget,".js-inline-comments-container");for(const n of t.querySelectorAll(".js-batched-suggested-changes-add"))n.setAttribute("data-batched-suggestion-reenable-sibling","true");kl()})),et("click",".js-focus-commit-suggestions-form-button",(function(e){e.preventDefault(),window.location.href="#clear-commit-suggestions",window.location.href="#commit-suggestions"})),et("click",".js-dismiss-batched-suggested-changes-onboarding-notice",(async function(e){const t=i(e.currentTarget,"data-url");if(!(e.currentTarget.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/pulls/suggested-changes.ts:497");const n=u(e.currentTarget.parentElement,".js-data-url-csrf",HTMLInputElement),s=new FormData;s.append("notice","batched_suggested_changes_onboarding_prompt"),await H(fe(t,n.value,{method:"post",body:s}));for(const o of document.querySelectorAll(".js-batched-suggested-change-onboarding-notice"))o.remove()})),et("click",".js-single-suggested-change-form .js-suggested-changes-submit",(function(e){const t=e.currentTarget,n=o(t,".js-single-suggested-change-form",HTMLFormElement),s=l(n,'input[name="value[]"]',HTMLInputElement).map(e=>e.value);Ml(n,[{commentId:u(n,"input[name=comment_id]",HTMLInputElement).value,path:u(n,"input[name=path]",HTMLInputElement).value,suggestion:s}])})),d(".js-single-suggested-change-form",(async function(e,t){const n=o(e,".js-suggested-change-form-container"),s=o(e,"details"),r=u(n,".js-suggestion-applied"),i=o(e,".js-suggested-changes-contents"),a=u(i,".js-error-message-placeholder");try{await t.json(),r.classList.remove("d-none"),u(n,".js-batched-suggested-changes-add").classList.add("d-none"),s.remove(),window.location.reload()}catch(c){if("QueryError"!==c.name){const t=c.response.json&&c.response.json.error,r=u(a,".js-error-message");a.hidden=!1,r.textContent=t,n.prepend(a);const i=o(e,".js-suggested-change-form-container");u(i,".js-batched-suggested-changes-add").classList.add("d-none"),s.remove()}}})),et("click",".js-suggestion-batch-submit",(function(e){const t=o(e.currentTarget,".js-batched-suggested-changes-form",HTMLFormElement),n=[];for(const s of document.querySelectorAll("[data-pending-batched-suggestion]")){const e=u(s,".js-single-suggested-change-form",HTMLFormElement),t=l(e,'input[name="value[]"]',HTMLInputElement).map(e=>e.value);n.push({commentId:u(e,"input[name=comment_id]",HTMLInputElement).value,path:u(e,"input[name=path]",HTMLInputElement).value,suggestion:t})}Ml(t,n)})),d(".js-batched-suggested-changes-form",(async function(e,t){try{await t.json(),o(e,".js-batched-suggested-changes-container",HTMLElement).hidden=!0,window.location.reload()}catch(n){const t=n.response.json&&n.response.json.error,s=o(e,".js-batched-suggested-changes-container"),r=u(s,".js-error-message-container");u(r,".js-error-message").textContent=t,r.hidden=!1}})),Qe(".js-files-tab-stale",{add(){const e=document.querySelector(".js-batched-suggested-changes-container");e&&setTimeout(()=>{e.hidden=!0})}}),et("click",".js-add-single-line-comment",(function(e){const t=e.currentTarget;if(!(t instanceof Element))throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:18");Hl(o(t,".file"));const n=function(e){const t=o(e,"tr"),n=Sl(t,".js-inline-comments-container");if(n instanceof Element){const e=u(t,"button.js-add-line-comment"),s=Array.from(n.querySelectorAll(".js-inline-comment-form")).pop();return s instanceof HTMLFormElement&&_l(s,e),n}}(t)||function(e){const t=o(e,"tr"),n=Al("#js-inline-comments-single-container-template"),s=n.querySelector(".js-inline-comment-form");s instanceof HTMLFormElement&&_l(s,e);return t.after(n),n}(t);Rc(Array.from(n.querySelectorAll(".js-line-comments")).pop())})),et("click",".js-add-split-line-comment",(function(e){const t=e.currentTarget;Hl(o(t,".file"));const n=o(t,"tr"),s="addition"===t.getAttribute("data-type")?"js-addition":"js-deletion",r=function(e,t,n){const s=e.querySelector(`.js-line-comments.${t}`);if(s){const e=Array.from(s.querySelectorAll(".js-inline-comment-form")).pop();if(!(e instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:280");return _l(e,n),s}const o=Al("#js-inline-comments-split-form-container-template");o.classList.add(t);const r=o.querySelector(".js-inline-comment-form");r instanceof HTMLFormElement&&_l(r,n);const i=e.querySelectorAll(`.${t}`);i[i.length-1].after(o);for(const a of i)a.remove();return o}(function(e){let t=Sl(e,".js-inline-comments-container");return t||(t=Al("#js-inline-comments-split-container-template"),e.after(t),t)}(n),s,t);Rc(Array.from(r.querySelectorAll(".js-line-comments")).pop())})),d(".js-inline-comment-form",(async function(e,t){let n;!function(e){const t=e.querySelector(".js-comment-form-error");t&&(t.hidden=!0,t.textContent=null)}(e);try{n=await t.json()}catch(a){if(a.response){let t;try{t=a.response.json}catch(c){}if(t)return void function(e,t){const n=u(e,".js-comment-form-error");let s;s=t.errors?Array.isArray(t.errors)?t.errors.join(", "):t.errors:"There was an error posting your comment.";n.textContent=s,n.style.display="block",n.hidden=!1,n.classList.remove("d-none")}(e,t)}throw a}const s=n.json,o=s.inline_comment,r=e.closest(".js-line-comments");if(o){if(!r)throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:93");u(r,".js-comments-holder").append(ge(document,o))}const i=s.inline_comment_thread;if(i){if(!r)throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:99");r.replaceWith(ge(document,i))}Fc(e)})),document.addEventListener("session:resume",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:160");!function(e){const[t,n]=e.match(/^new_inline_comment_(?:discussion|diff)_(?:[\w-]+)_(\d+)_(\d+)$/)||[];if(!t)return;const s=document.querySelector(`.js-inline-comment-form input[name='in_reply_to'][value='${n}']`);if(!s)return;const o=s.closest(".js-line-comments");o&&Rc(o)}(e.detail.targetId),function(e){const[t,n]=e.match(/^new_inline_comment_diff_(?:[\w-]+)_(\d+)$/)||[];if(!t)return;const s=document.querySelector(`.js-add-line-comment[data-anchor='${t}'][data-position='${n}']`);s&&s.click()}(e.detail.targetId)})),Qe(".js-comment",{remove:xl}),et("inlinecomment:focus",".js-inline-comment-form-container",(function(e){if(!(e.target instanceof Element))throw new Error("invariant: app/assets/modules/github/pages/diffs/line-comments.ts:200");const t=e.target.querySelector(".js-suggested-changes-container");t&&ql(t)})),Qe(".js-suggested-changes-container.is-comment-editing",e=>{ql(e)}),document.addEventListener("inlinecomment:collapse",()=>{xl()});const Il={R:"right",L:"left"};function _l(e,t){const n=["type","path","position","line","side","original-line"];for(const o of n){const n=e.elements.namedItem(o);if(n instanceof HTMLInputElement){const e=t.getAttribute(`data-${o}`)||"";n.value=e}}!function(e,t){const n=Mc();if(!n)return;if(n.end.is(n.start))return;if(!Hc(t,n))return void Ac();const{start:{side:s,lineNumber:r},end:{side:i,lineNumber:a}}=n,c=Number(t.getAttribute("data-line")),l=t.getAttribute("data-side");if(c!==a||!n.end.isContext()&&l!==Il[i])return void Ac();const d=Il[s],m=e.elements.namedItem("start_line"),f=e.elements.namedItem("start_side"),p=e.elements.namedItem("line"),g=e.elements.namedItem("side"),h=e.elements.namedItem("preview_start_side"),v=e.elements.namedItem("preview_side");if(m instanceof HTMLInputElement&&f instanceof HTMLInputElement&&p instanceof HTMLInputElement&&g instanceof HTMLInputElement&&h instanceof HTMLInputElement&&v instanceof HTMLInputElement){m.value=String(r),f.value=d,f.value=h.value=f.value,v.value=g.value;const t=m.value,s=f.value,i=p.value,a=g.value,c=o(e,".js-inline-comment-form-container");if(t&&i){const e=u(c,".js-multi-line-preview"),o=u(e,".js-multi-line-preview-start"),r=u(e,".js-multi-line-preview-end"),l=n.start.isContext(),d=n.end.isContext();Cl(o,t,s,l),Cl(r,i,a,d),e.hidden=!1,c.classList.add("is-multiline")}else u(c,".js-multi-line-preview").hidden=!0,c.classList.remove("is-multiline");Tl(c)}}(e,t);const s=t.getAttribute("data-position")||"",r=t.getAttribute("data-anchor")||"",i=u(e,".js-comment-field"),a=i.id.replace(/^r\d+ /,"").replace("${anchor}",r).replace("${position}",s);for(const o of e.querySelectorAll(`[for="${i.id}"]`))o.setAttribute("for",a);i.id=a}function $l(e){return Math.floor(e/2)}function Nl(e,t){const n=e.parentElement;if(!n)return;const s=n.children;let o;if(4===s.length)for(let r=0,i=s.length;r<i;r++){s[r]===e&&(o=$l(r))}for(let r=0,i=s.length;r<i;r++){const e=s[r];null!=o&&$l(r)!==o||e.classList.toggle("is-hovered",t)}}function Dl(){const e=document.body;if(!e)throw new Error("invariant: app/assets/modules/github/pages/diffs/split.ts:6");const t=document.querySelector("meta[name=diff-view]"),n=t&&t instanceof HTMLMetaElement?t.content:"",s=document.querySelector(".js-file-diff-split"),o=!!("split"===n&&s||document.querySelector(".wants-full-width-container"));e.classList.toggle("full-width",o)}function Pl(e){const t=e.parentElement;if(!t)throw new Error("invariant: app/assets/modules/github/pages/diffs/tr-collapsing.ts:11");const n=t.querySelectorAll("td.js-line-comments").length,s=t.querySelectorAll("td.js-line-comments.is-collapsed").length;t.classList.toggle("is-collapsed",s>0&&n===s)}function Rl(e){const t=l(document,".js-hook-event-checkbox",HTMLInputElement);for(const n of t)n.checked=n.matches(e)}Qe(".diff-table",(function(e){let t=null;function n(e){if(!(e instanceof MouseEvent))throw new Error("invariant: app/assets/modules/github/pages/diffs/line-highlight.ts:35");t&&Nl(t,!1),t=null}function s(e){if(!(e instanceof MouseEvent))throw new Error("invariant: app/assets/modules/github/pages/diffs/line-highlight.ts:42");t&&Nl(t,!1),e.target instanceof HTMLElement&&(t=e.target.closest("td.blob-code"),t&&Nl(t,!0))}return{add:function(){e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",n),e.addEventListener("mouseover",s)},remove:function(){e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",n),e.removeEventListener("mouseover",s)}}})),et("click",".js-rich-diff.collapsed .js-expandable",(function(e){if(!(e.target instanceof Element))return;e.preventDefault();const t=e.target.closest(".js-rich-diff");if(!t)throw new Error("invariant: app/assets/modules/github/pages/diffs/prose-diff.ts:8");t.classList.remove("collapsed")})),et("click",".js-show-rich-diff",(function(e){const t=e.currentTarget.closest(".js-warn-no-visible-changes");if(!t)return;t.classList.add("d-none");const n=t.parentElement;if(!n)throw new Error("invariant: app/assets/modules/github/pages/diffs/prose-diff.ts:18");const s=n.querySelector(".js-no-rich-changes");s&&s.classList.remove("d-none")})),Qe("meta[name=diff-view]",{add:Dl,remove:Dl}),Qe(".js-file-diff-split",{add:Dl,remove:Dl}),Qe(".js-compare-tab.selected",{add:Dl,remove:Dl}),Qe(".wants-full-width-container",{add:Dl,remove:Dl}),et("change",".js-toggle-file-notes",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/pages/diffs/toggle-file-notes.ts:11");o(t,".file").classList.toggle("show-inline-notes",t.checked)})),et("click",".js-toggle-all-file-notes",(function(e){const t=l(document,".js-toggle-file-notes",HTMLInputElement),n=t.some(e=>e.checked);for(const s of t)y(s,!n);e.preventDefault()})),Qe(".js-inline-comments-container",(function(e){let t;const n=e.closest(".file");if(n){return{add:t=function(){const e=null!=n.querySelector(".js-inline-comments-container");n.classList.toggle("has-inline-notes",e)},remove:t}}})),et("change",".js-toggle-file-check-annotations",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/pages/diffs/toggle-check-annotations.ts:9");const n=o(t,".file").querySelectorAll(".js-inline-annotations");for(const s of n)s instanceof HTMLElement&&(s.hidden=!t.checked)})),Qe("td.js-line-comments.is-collapsed",{add:Pl,remove:Pl}),Qe(".js-hook-url-field",{constructor:HTMLInputElement,add(e){function t(){const t=e.form;if(!t)throw new Error("invariant: app/assets/modules/github/pages/hooks.ts:14");if(!t)return;let n;try{n=new URL(e.value)}catch(i){}const s=t.querySelector(".js-invalid-url-notice");s instanceof HTMLElement&&(s.hidden=!!(""===e.value||n&&/^https?:/.test(n.protocol)));const o=t.querySelector(".js-insecure-url-notice");o instanceof HTMLElement&&n&&e.value&&(o.hidden=/^https:$/.test(n.protocol));const r=t.querySelector(".js-ssl-hook-fields");r instanceof HTMLElement&&(r.hidden=!(n&&"https:"===n.protocol))}C(e,t),t()}}),et("change",".js-hook-event-choice",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/pages/hooks.ts:50");const n=t.checked&&"custom"===t.value,s=t.closest(".js-hook-events-field");if(s&&s.classList.toggle("is-custom",n),t.checked)if(n){u(document,".js-hook-wildcard-event",HTMLInputElement).checked=!1}else"push"===t.value?Rl('[value="push"]'):"all"===t.value&&Rl(".js-hook-wildcard-event")})),et("details:toggled",".js-hook-secret",(function(e){const t=e.currentTarget,n=u(t,"input[type=password]",HTMLInputElement);t.classList.contains("open")&&n.focus()})),et("click",".js-hook-deliveries-pagination-button",(async function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/pages/hooks.ts:79");t.disabled=!0;const n=t.parentElement;if(!n)throw new Error("invariant: app/assets/modules/github/pages/hooks.ts:82");const s=i(t,"data-url");n.before(await k(document,s)),n.remove()})),d(".js-redeliver-hook-form",(async function(e,t){let n;try{n=await t.html()}catch(i){if(!e.parentElement)throw new Error("invariant: app/assets/modules/github/pages/hooks.ts:94");return void e.classList.add("failed")}const s=e.getAttribute("data-delivery-guid")||"",o=u(document,`.js-hook-delivery-container[data-delivery-guid="${s}"]`),r=o.parentElement;if(!r)throw new Error("invariant: app/assets/modules/github/pages/hooks.ts:101");o.replaceWith(n.html),u(r,"poll-include-fragment").addEventListener("load",(function(){const e=u(r,".js-hook-delivery-container"),t=u(r,".js-item-status"),n=e.getAttribute("data-status-class");t.classList.remove("success","pending","failure"),n&&t.classList.add(n);const s=r.querySelector(".js-item-status-tooltip"),o=e.getAttribute("data-status-message");s&&o&&s.setAttribute("aria-label",o)}))})),d(".js-test-hook-form",(async function(e,t){const n=u(document,".js-test-hook-message");n.classList.remove("error","success");try{await t.text()}catch(s){n.classList.add("error");const e=u(n,".js-test-hook-message-errors");if(null!=s.response){const t=await s.response.json();e.textContent=t.errors}else e.textContent=e.getAttribute("data-network-error-message")||"";return}n.classList.add("success")})),d(".js-toggler-container .js-set-approval-state",(async function(e,t){const n=o(e,".js-toggler-container");n.classList.add("loading");const s=await t.json();"approved"===s.json.approval_state?n.classList.add("on"):"denied"===s.json.approval_state&&(n.classList.add("revoked"),n.classList.remove("on")),n.classList.remove("loading")})),d(".js-request-access-approval-form",(async function(e,t){await t.text();const n=i(e,"data-container-id");u(document,`#${n}`).classList.add("on")})),et("details-menu-selected",".js-select-plan-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/pages/plan.ts:4");const t=e.detail.relatedTarget,n=document.querySelectorAll(".js-plan-card-section");for(const i of n)i instanceof HTMLElement&&(i.hidden=!0);const s=e.currentTarget.querySelectorAll("[role^=menuitem]"),o=Array.from(s).indexOf(t),r=Array.from(n)[o];r instanceof HTMLElement&&(r.hidden=!1)}),{capture:!0});const Fl=function(){const e=new Uint32Array(256);for(let t=256;t--;){let n=t;for(let e=8;e--;)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return function(t){let n=-1;for(let s=0;s<t.length;s++)n=n>>>8^e[255&n^t.charCodeAt(s)];return(-1^n)>>>0}}();function Bl(e){const t=o(e,".js-experiment-variant"),n=i(t,"data-experiment");if(Wl(n)){const s=i(t,"data-experiment-group"),o=i(e,"data-ga-click");o&&e.setAttribute("data-ga-click",function(e,t,n){const s=Ol(e,t,n);return[s.category,s.action,s.label,s.value].join(", ")}(o,n,s))}}function Ol(e,t,n){const s=wr(e),o=Ul(t,n);return s.label?s.label+=`;${o}`:s.label=o,s}function Ul(e,t){return`experimentv2:${e};group:${t}`}const zl={};function Wl(e){if(zl[e])return zl[e].variant;try{const t=function(e){const t=document.querySelector(`meta[name=experiment-${e}]`);if(!(t instanceof HTMLMetaElement))return null;const n=new URLSearchParams(window.location.search).get("experiment_group");if(""===n){return JSON.parse(atob(t.content)).default}if(n)return n;const s=(new Date).toISOString();let o=function(e){const t=ao(`experiment:${e}`);for(const s of t)try{return JSON.parse(atob(s.value))}catch(n){}return null}(e);const r=mo();if(!o||!o.rollOutPlacement){const t=Fl(`${r}-${e}-experiment-enrollment`);o={version:"1",rollOutPlacement:t/4294967295*100,subgroup:null,createdAt:s,updatedAt:s}}let i=o.subgroup;if(!i){o.updatedAt=s;const n=JSON.parse(atob(t.content));if(i=n.default,o.rollOutPlacement<=n.roll_out_percent){const t=Fl(`${r}-${e}-experiment-participant`)/4294967295*100;for(const e of n.groups)t>=e.min&&t<e.max&&(i=o.subgroup=e.handle)}!function(e,t){const n=btoa(JSON.stringify(t)),s=(new Date).getTime(),o=new Date(s+31536e6).toUTCString();co(`experiment:${e}`,n,o)}(e,o)}return i}(e);return zl[e]={variant:t},t}catch(t){return zl[e]={variant:null},null}}Qe(".js-experiment-homepage-signup-container-xl",(function(e){"audience"===Wl("homepage_signup_flow")&&(e.classList.remove("container-lg"),e.classList.add("container-xl"))})),Qe(".js-suggested-usernames-container",(function(e){const t=l(e,".js-suggested-username",HTMLInputElement),n=document.querySelector(".js-signup-form");if(n&&0!==t.length)for(const s of t)n.appendChild(s)})),c(".js-email-notice-trigger",(function(e){const t=l(document,".js-email-notice");for(const n of t)n.classList.add("notice-highlight");e.addEventListener("blur",(function(){for(const e of t)e.classList.remove("notice-highlight")}))})),Qe(".js-plan-choice:checked",{add(e){const t=e.closest(".plan-row");t&&t.classList.add("selected")},remove(e){const t=e.closest(".plan-row");t&&t.classList.remove("selected")}});const Vl=new WeakMap;function Jl(e){const t=e.target;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/pages/signup.ts:63");const n=o(t,"form");if(t.closest("input[type=text]")&&!Vl.get(n)){const e=u(n,".js-signup-source",HTMLInputElement);ae({category:"Signup",action:"Attempt",label:e.value}),Vl.set(n,!0)}}function Kl(){const e=u(document,".js-password-with-confirmation",HTMLInputElement),t=u(document,".js-password-confirm",HTMLInputElement);t.value!==e.value?function(e){const t=o(e,".js-form-group");t.classList.add("errored");const n=e.getAttribute("data-validity-message");if(n){e.setCustomValidity(n),Vt(o(e,"form",HTMLFormElement))}const s=t.querySelector(".error"),r=e.getAttribute("data-error-message");if(!s&&r){const e=document.createElement("dd");e.classList.add("error"),e.innerHTML=r,t.appendChild(e)}}(t):function(e){const t=o(e,".js-form-group");e.setCustomValidity(""),t.classList.remove("errored"),Vt(o(e,"form",HTMLFormElement));const n=t.querySelector(".error");n&&t.removeChild(n)}(t)}Qe(".js-signup-form",{subscribe:e=>j(e,"input",Jl)}),et("submit",".js-signup-form-submit",(function(e){const t=e.currentTarget,n=u(t,".js-signup-source",HTMLInputElement),s=Wl("homepage_signup_flow");(!s&&!n.value.includes(";experiment")||s&&n.value.includes(s))&&ae({category:"Signup",action:"Submit",label:n.value})})),Qe(".js-octocaptcha-parent",(function(e){if(!(e instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/pages/signup.ts:80");const t=u(e,".js-octocaptcha-spinner"),n=u(e,".js-octocaptcha-success"),s=u(e,".js-octocaptcha-token",HTMLInputElement),o=u(e,".js-octocaptcha-form-submit",HTMLButtonElement),r=u(e,".js-octocaptcha-frame-container"),i=u(e,".js-octocaptcha-frame"),a=s.getAttribute("data-octocaptcha-url");let c=!1;const l=()=>{c||(c=!0,t.classList.add("d-none"),n.classList.remove("d-none"),m())},d=()=>{if(c)return;const t=document.createElement("input");t.type="hidden",t.id="error_loading_captcha",t.name="error_loading_captcha",t.value="1",e.appendChild(t),l()},m=()=>{if(!(e instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/pages/signup.ts:119");e.checkValidity()&&(o.disabled=!1)};setTimeout(d,2e4),i.addEventListener("error",d),window.addEventListener("message",e=>{if(e.origin!==a)return;const n=e.data&&e.data.event;"captcha-loaded"===n?c||(c=!0,t.classList.add("d-none"),r.classList.remove("v-hidden","zero-height")):"captcha-complete"===n?(s.value=e.data.sessionToken,(()=>{const e=r.getAttribute("data-ga-event-category");e&&ae({category:e,action:"success",label:"captcha verified"})})(),m()):"captcha-suppressed"===n&&l()})})),Qe(".js-survey-answer-choice:checked",{add(e){const t=o(e,".js-answer"),n=u(t,".js-answer-choice"),s=u(document,".js-role-input-box");n&&(n.classList.remove("border-black-fade","bg-gray-light"),n.classList.add("border-blue","bg-white")),e.classList.contains("js-user-role-other-choice")&&(s.hidden=!1)},remove(e){const t=o(e,".js-answer"),n=u(t,".js-answer-choice"),s=u(document,".js-role-input-box");n&&(n.classList.remove("border-blue","bg-white"),n.classList.add("border-black-fade","bg-gray-light")),e.classList.contains("js-user-role-other-choice")&&(s.hidden=!0)}}),Qe(".js-allow-multiple:checked",{constructor:HTMLInputElement,add(e){const t=parseInt(e.getAttribute("data-max-choices")||""),n=o(e,".js-question"),s=l(n,".js-allow-multiple",HTMLInputElement);if(s.filter(e=>!0===e.checked).length>=t)for(const o of s)!1===o.checked&&(o.disabled=!0)},remove(e){const t=o(e,".js-question");for(const n of l(t,".js-allow-multiple",HTMLInputElement))n.disabled=!1}}),s("keyup",".js-password-with-confirmation",()=>{""!==u(document,".js-password-confirm",HTMLInputElement).value&&Kl()}),s("keyup",".js-password-confirm",Kl);let Gl=null;et("pjax:click",".js-pjax-capture-input",(function(){Gl=function(e){const t=e.createElement("textarea");return t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",e.body.appendChild(t),t.focus(),()=>(t.blur(),t.remove(),t.value)}(document)})),et("pjax:end","#js-repo-pjax-container",(function(){if(Gl){const e=Gl(),t=document.querySelector(".js-pjax-restore-captured-input");t instanceof HTMLInputElement&&e&&y(t,e),Gl=null}})),et("pjax:click",".js-pjax-history-navigate",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/pjax/history-navigate.ts:11");e.currentTarget instanceof HTMLAnchorElement&&(e.currentTarget.href===Ce()?(history.back(),e.detail.relatedEvent.preventDefault(),e.preventDefault()):e.currentTarget.href===Ie()&&(history.forward(),e.detail.relatedEvent.preventDefault(),e.preventDefault()))})),Qe("[data-pjax-container] link[rel=pjax-prefetch]",{constructor:HTMLLinkElement,initialize(e){const t=_e(e,{headers:{Purpose:"prefetch"}});$e(e,t)}});class PreciseTimeAgoElement extends ut{connectedCallback(){Xl.push(this),Yl||(Ql(),Yl=window.setInterval(Ql,1e3))}disconnectedCallback(){const e=Xl.indexOf(this);-1!==e&&Xl.splice(e,1),Xl.length||(window.clearInterval(Yl),Yl=void 0)}getFormattedDate(){const e=this.date;if(!e)return;if(!(e instanceof Date))throw new Error("invariant: app/assets/modules/github/precise-time-ago-element.ts:38");const t=(new Date).getTime()-e.getTime(),n=Math.floor(t/1e3),s=Math.floor(n/60),o=Math.floor(s/60),r=Math.floor(o/24),i=n-60*s,a=s-60*o;return s<1?`${n}s`:o<1?`${s}m ${i}s`:r<1?`${o}h ${a}m ${i}s`:`${r}d ${o-24*r}h ${a}m ${i}s`}}const Xl=[];let Yl;function Ql(){for(const e of Xl)e.textContent=e.getFormattedDate()||""}window.customElements.get("precise-time-ago")||(window.PreciseTimeAgoElement=PreciseTimeAgoElement,window.customElements.define("precise-time-ago",PreciseTimeAgoElement)),Qe("body.js-print-popup",()=>{window.print(),setTimeout(window.close,1e3)}),et("click",".js-new-user-contrib-example",(async function(e){const t=u(document,".js-calendar-graph");if(t.classList.contains("sample-graph"))return;t.classList.add("sample-graph");const n=i(e.currentTarget,"data-url");let s;try{s=await H(n)}catch(a){return void t.classList.remove("sample-graph")}const o=document.createElement("div");o.innerHTML=s;const r=t.querySelector(".js-calendar-graph-svg");if(!r)throw new Error("invariant: app/assets/modules/github/profile/calendar-sample.ts:23");r.replaceWith(o.children[0])}));let Zl=null;function eu(){const e=u(document,".js-calendar-graph"),t=i(e,"data-url");return new URL(t,window.location.origin)}function tu(e){const t=e.target;t.matches("rect.day")&&(nu(),function(e){const t=document.body;if(!t)throw new Error("invariant: app/assets/modules/github/profile/contributions.ts:65");const n=i(e,"data-date"),s=function(e,t){const n=`${su[t.getUTCMonth()].slice(0,3)} ${t.getUTCDate()}, ${t.getUTCFullYear()}`,s=0===e?"No":new Intl.NumberFormat("en-US").format(e),o=document.createElement("div");o.classList.add("svg-tip","svg-tip-one-line"),o.style.pointerEvents="none";const r=document.createElement("strong");return r.textContent=`${s} ${1===e?"contribution":"contributions"}`,o.append(r,` on ${n}`),o}(parseInt(e.getAttribute("data-count")||""),mu(n));t.appendChild(s);const o=e.getBoundingClientRect(),r=o.left+window.pageXOffset-s.offsetWidth/2+o.width/2,a=o.bottom+window.pageYOffset-s.offsetHeight-2*o.height;s.style.top=`${a}px`,s.style.left=`${r}px`}(t))}function nu(){const e=document.querySelector(".svg-tip");e&&e.remove()}Qe(".js-calendar-graph-svg",(function(e){const t=o(e,".js-calendar-graph");t.addEventListener("mouseover",tu),t.addEventListener("mouseout",nu);const n=t.getAttribute("data-from");n&&(Zl=mu(n))})),et("click",".js-calendar-graph rect.day",(function(e){const t=e.currentTarget,n=o(t,".js-calendar-graph"),s=i(n,"data-org"),r=i(t,"data-date");t.classList.contains("active")?gu(pu()):function(e,t,n){let s,o;if(Zl&&t){const t=Zl.getTime(),n=26784e5,r=t-n,i=t+n;[s,o]=e>Zl?[Zl,e]:[e,Zl],s=new Date(Math.max(s.getTime(),r)),o=new Date(Math.min(o.getTime(),i)),Zl=null}else Zl=o=s=e;au(s,o);const r=eu(),i=ru(r.search.slice(1),{from:s,to:o,org:n});i.append("tab","overview"),r.search=i.toString(),ou(r.toString())}(mu(r),e.shiftKey,s)}));const su=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];async function ou(e){const t=document.getElementById("js-contribution-activity");if(!t)return;t.classList.add("loading");const n=await k(document,e);t.classList.remove("loading"),t.innerHTML="",t.append(n)}function ru(e,t){const n=new URLSearchParams(e);n.delete("from"),n.delete("to"),n.delete("org");let s=t.fromStr;t.from&&(s=du(t.from)),s&&n.append("from",s);let o=t.toStr;t.to&&(o=du(t.to)),o&&n.append("to",o);const r=t.org;return r&&n.append("org",r),n}async function iu(e,t,n){const s=u(document,".js-calendar-graph"),o=i(s,"data-graph-url"),r=new URL(o,window.location.origin),a=ru(r.search.slice(1),{from:e,to:t,org:n});r.search=a.toString();const c=await k(document,r.toString());u(document,".js-yearly-contributions").replaceWith(c)}function au(e,t){const n=u(document,".js-calendar-graph"),s=n.querySelectorAll("rect.day");for(const r of s)r.classList.remove("active");if(n.classList.remove("days-selected"),e||t){n.classList.add("days-selected");for(const e of s)o(e)&&e.classList.add("active")}function o(n){const s=mu(n.getAttribute("data-date")||"").getTime();return e&&t?e.getTime()<=s&&s<=t.getTime():e?s===e.getTime():void 0}}function cu(){const e=u(document,".js-calendar-graph").querySelectorAll("rect.active"),t=e[0],n=e[e.length-1],s=t&&i(t,"data-date"),o=n&&i(n,"data-date");return s&&o?{first:s,last:o}:null}function lu(){const e=cu()||function(){const e=new URLSearchParams(window.location.search.slice(1)),t=e.get("from"),n=e.get("to");return t&&n?{first:t,last:n}:null}()||function(){const e=new URL(pu(),window.location.origin),t=new URLSearchParams(e.search.slice(1)),n=t.get("from"),s=t.get("to");return n&&s?{first:n,last:s}:null}();if(!e)throw new Error("invariant: app/assets/modules/github/profile/contributions.ts:187");return e}function uu(e){return`0${e}`.slice(-2)}function du(e){return`${e.getUTCFullYear()}-${uu(e.getUTCMonth()+1)}-${uu(e.getUTCDate())}`}function mu(e){const[t,n,s]=e.split("-").map(e=>parseInt(e,10));return new Date(Date.UTC(t,n-1,s))}async function fu(e){const t=cu(),n=function(){const e=u(document,".js-calendar-graph");return{first:i(e,"data-from"),last:i(e,"data-to")}}(),s=new Date(n.first),o=new Date(n.last);if(await iu(s,o,e),t){au(new Date(t.first),new Date(t.last))}}function pu(){return u(document,".js-profile-timeline-year-list .js-year-link.selected",HTMLAnchorElement).href||""}function gu(e){const t=new URL(e,window.location.origin).search,n=new URLSearchParams(t.slice(1)),s=n.get("org"),o=n.get("from"),r=n.get("to");if(!o||!r)throw new Error("invariant: app/assets/modules/github/profile/contributions.ts:309");const i=new Date(o),a=new Date(r);iu(i,a,s);const c=eu(),l=ru(c.search.slice(1),{from:i,to:a,org:s});l.append("tab","overview"),c.search=l.toString(),ou(c.toString())}function hu(e){const t=e.closest(".js-details-container");t&&t.classList.add("open");const n=e.getBoundingClientRect(),s=window.scrollY+n.top-62-10;window.scrollTo(0,s)}function vu(e,t){return e.length<t.length?-1:e.length>t.length?1:e.localeCompare(t)}function bu(e,t){const n=e.getBoundingClientRect();return(t.getBoundingClientRect().width-n.width)/2}function ju(e,t){const n=e.querySelector("svg");if(!n)return;const s=n.querySelector(".js-highlight-blob"),o=Math.floor(e.clientWidth),r=Math.max(o,250),i=r,a=n.querySelector(".js-highlight-label-top"),c=n.querySelector(".js-highlight-label-bottom"),l=n.querySelector(".js-highlight-label-right"),u=n.querySelector(".js-highlight-label-left"),d=n.querySelector(".js-highlight-percent-top"),m=n.querySelector(".js-highlight-percent-bottom"),f=n.querySelector(".js-highlight-percent-right"),p=n.querySelector(".js-highlight-percent-left"),g=n.querySelector(".js-highlight-x-axis"),h=n.querySelector(".js-highlight-y-axis"),v=n.querySelector(".js-highlight-top-ellipse"),b=n.querySelector(".js-highlight-right-ellipse"),j=n.querySelector(".js-highlight-bottom-ellipse"),w=n.querySelector(".js-highlight-left-ellipse"),L=e.querySelector(".js-activity-overview-graph-spinner"),y=n.querySelector("g");if(!y)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:59");if(!s)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:60");if(!a)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:61");if(!c)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:62");if(!l)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:63");if(!u)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:64");if(!d)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:65");if(!m)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:66");if(!f)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:67");if(!p)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:68");if(!g)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:69");if(!h)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:70");if(!v)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:71");if(!b)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:72");if(!j)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:73");if(!w)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:74");if(!L)throw new Error("invariant: app/assets/modules/github/profile/contributions-spider-graph.ts:75");y.removeAttribute("transform"),n.classList.remove("d-none"),n.classList.add("d-block"),L.classList.remove("d-block"),L.classList.add("d-none"),a.innerHTML="",l.innerHTML="",c.innerHTML="",u.innerHTML="",d.innerHTML=" ",f.innerHTML=" ",m.innerHTML=" ",p.innerHTML=" ";const E=Object.keys(t.percentages).sort(vu),[T,k]=E.slice(0,2).sort(),[M,S]=E.slice(2,4).sort(),H=t.percentages[M],x=t.percentages[k],A=t.percentages[S],q=t.percentages[T];let C=null;const I=(e,n)=>{const s=t.percentages[e];if(s>0)return C=n,`${s}%`},_=I(M,d);_&&(d.textContent=_);const $=I(k,f);$&&(f.textContent=$);const N=I(S,m);N&&(m.textContent=N);const D=I(T,p);D&&(p.textContent=D);const P=r/2,R=r/2;a.appendChild(document.createTextNode(M)),a.setAttribute("dx",P.toString()),c.appendChild(document.createTextNode(S)),c.setAttribute("dx",R.toString()),d.setAttribute("dx",P.toString()),m.setAttribute("dx",R.toString());const F=a.getBoundingClientRect().height;let B=0;C&&(B=C.getBoundingClientRect().height);let O=i/2+F/4,U=i/2+F/4;q>0&&(O=O+B/2+2.5),x>0&&(U=U+B/2+2.5),u.appendChild(document.createTextNode(T)),u.setAttribute("dy",O.toString()),l.appendChild(document.createTextNode(k)),l.setAttribute("dy",U.toString());const z=O-F,W=U-F;p.setAttribute("dy",z.toString()),f.setAttribute("dy",W.toString());let V=H/100,J=A/100,K=q/100,G=x/100;const X=Math.max(V,J,K,G),Y=e=>1*e/X+0;V=Y(V),J=Y(J),K=Y(K),G=Y(G);const Q=function(e){let t=0;for(const n of e){const e=n.getBoundingClientRect();e.width>t&&(t=e.width)}return t}([u,l,a,c])+10,Z=Math.max(Q,F),ee=r/2,te=i/2,ne=ee,se=Z,oe=ee,re=i-Z,ie=Z,ae=te,ce=r-Z,le=te,ue=ee-ie,de=te-se;let me=se+(1-V)*de,fe=Math.max(re-(1-J)*de,te),pe=ie+(1-K)*ue,ge=ce-(1-G)*ue;g.setAttribute("x1",ie.toString()),g.setAttribute("y1",te.toString()),g.setAttribute("x2",ce.toString()),g.setAttribute("y2",te.toString()),h.setAttribute("x1",ee.toString()),h.setAttribute("y1",se.toString()),h.setAttribute("x2",ee.toString()),h.setAttribute("y2",re.toString()),me+4<te&&(me+=4),fe-4>te&&(fe-=4),pe+4<ee&&(pe+=4),ge-4>ee&&(ge-=4);const he=se-10,ve=ce+10;let be=re+10+8;A>0&&(be+=B);const je=ie-12;a.setAttribute("dy",he.toString()),l.setAttribute("dx",ve.toString()),c.setAttribute("dy",be.toString()),u.setAttribute("dx",je.toString());const we=je-bu(p,u),Le=ve+bu(f,l);p.setAttribute("dx",we.toString()),f.setAttribute("dx",Le.toString());const ye=he-F,Ee=be-F;d.setAttribute("dy",ye.toString()),m.setAttribute("dy",Ee.toString());0===H?v.classList.add("d-none"):(v.setAttribute("cx",ne.toString()),v.setAttribute("cy",(me-2).toString())),0===x?b.classList.add("d-none"):(b.setAttribute("cx",(ge+2).toString()),b.setAttribute("cy",le.toString())),0===A?j.classList.add("d-none"):(j.setAttribute("cx",oe.toString()),j.setAttribute("cy",(fe+2).toString())),0===q?w.classList.add("d-none"):(w.setAttribute("cx",(pe-2).toString()),w.setAttribute("cy",ae.toString()));const Te=y.getBoundingClientRect(),ke=n.getBoundingClientRect(),Me=0-(Te.top-ke.top),Se=0-(Te.left-ke.left);y.setAttribute("transform",`translate(${Se}, ${Me})`);const He=Math.ceil(Te.width),xe=Math.ceil(Te.height);n.setAttribute("width",He.toString()),n.setAttribute("height",xe.toString());const Ae=`M${ne},${me} ${[[ge,le],[oe,fe],[pe,ae]].map(e=>`L${e[0]},${e[1]}`).join(" ")} z`;H+x+A+q!==0&&s.setAttribute("d",Ae)}function wu(e){u(document,".js-profile-editable-area").hidden=e,u(document,".js-profile-editable-form").hidden=!e,u(document,".js-profile-editable-error").textContent=""}et("click",".js-org-filter-link",(function(e){e.stopPropagation(),e.preventDefault();const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))throw new Error("invariant: app/assets/modules/github/profile/contributions.ts:254");const n=o(t,".js-org-filter-links-container").querySelector(".js-org-filter-link.selected"),s=new URL(t.href,window.location.origin),r=new URLSearchParams(s.search.slice(1)),i=r.get("org"),a=lu(),c=new Date(a.first),l=new Date(a.last);n&&n.classList.remove("selected"),t!==n&&t.classList.add("selected"),fu(i);const u=eu(),d={org:i,from:null,to:null};r.has("from")&&(d.from=c),r.has("to")&&(d.to=l);const m=ru(u.search.slice(1),d);u.search=m.toString(),ou(u.toString()),async function(e,t){const n=document.getElementById("year-list-container");if(!n)return;t.append("year_list","1"),e.search=t.toString();const s=await k(document,e.toString());n.innerHTML="",n.append(s)}(u,m),Ne(null,"",u.toString())})),et("click",".js-year-link",(function(e){e.stopPropagation(),e.preventDefault();const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))throw new Error("invariant: app/assets/modules/github/profile/contributions.ts:290");const n=o(t,"ul");u(n,".js-year-link.selected").classList.remove("selected"),t.classList.add("selected"),gu(t.href),Ne(null,"",t.href)})),function(){const e=window.location.hash;if(!e||e.indexOf("#event-")<0)return;const t=e.slice(1,e.length),n=document.getElementById(t);n&&hu(n)}(),window.addEventListener("hashchange",(function(e){const t=e.newURL||window.location.href,n=t.slice(t.indexOf("#")+1,t.length),s=document.getElementById(n);s&&(e.stopPropagation(),hu(s))})),d(".js-show-more-timeline-form",(async function(e,t){await t.text();const n=document.querySelector(".js-show-more-timeline-form");if(n){const t=i(n,"data-year"),s=u(document,".js-year-link.selected"),o=u(document,`#year-link-${t}`);if(s.classList.remove("selected"),o.classList.add("selected"),t!==e.getAttribute("data-year")){const e=i(n,"data-from"),t=new Date(e),s=i(n,"data-to");iu(t,new Date(s),n.getAttribute("data-org"))}}document.title=e.getAttribute("data-title")||"",Ne(null,"",e.getAttribute("data-url")||"")})),Qe(".js-activity-overview-graph-container",e=>{!async function(e){await w;const t=i(e,"data-percentages"),n={percentages:JSON.parse(t)};if(ju(e,n),"true"===e.getAttribute("data-responsive-graph")){const t=dt(ju.bind(null,e,n),100)}}(e)});let Lu=null;et("click",".js-profile-editable-edit-button",(function(){!function(){const e=u(document,".js-user-profile-bio").textContent;"string"==typeof e&&(u(document,".js-user-profile-bio-edit",HTMLTextAreaElement).value=e)}(),wu(!0)})),et("click",".js-profile-editable-cancel",(function(){wu(!1)})),et("change",".js-profile-editable-pro-badge",(function(e){if(!(e.target instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/profile/inline-editable-profile.ts:30");Lu={preference:e.target.checked}})),d(".js-profile-editable-form",async(e,t)=>{let n;try{n=await t.html()}catch(s){if(422===s.response.status){u(document,".js-profile-editable-error").textContent=s.response.json.message}return}if(function(e){u(document,".js-profile-editable-area").replaceWith(e)}(n.html),wu(!1),Lu){u(document,".js-pro-badge").classList.toggle("d-none",!Lu.preference)}});const yu=new WeakMap;async function Eu(e){const t=u(document,".js-pinned-items-selection-form");if(e){if((yu.get(t)||0)>100)return}const n=t.querySelector(".js-more-pinnable-items-button");if(!(n instanceof HTMLButtonElement))return;if(n.textContent=i(n,"data-disable-with"),n.disabled=!0,e){const e=yu.get(t)||0;yu.set(t,e+1)}const s=i(n,"data-url"),o=await k(document,s);u(t,".js-more-pinnable-items-replace-target").replaceWith(o),Tu(),ku()}function Tu(){nt(u(document,".js-pinned-items-filter-input"),"change")}async function ku(){const e=u(document,".js-pinned-items-selection-form");await r();const t=l(e,".js-pinnable-checkbox",HTMLInputElement),n=t.filter(e=>e.checked).length,s=parseInt(e.getAttribute("data-max-repo-count")||"",10);for(const o of t)o.disabled=n===s&&!o.checked;!function(e,t){const n=u(document,".js-remaining-pinned-items-count"),s=i(n,"data-remaining-label"),o=t-e;n.textContent=`${o} ${s}`,n.classList.toggle("text-red",o<1)}(n,s)}Qe(".js-more-pinnable-items-button",(function(){(function(){const e=document.querySelector(".js-pinned-items-filter-input");return e instanceof HTMLInputElement&&(document.activeElement===e||e.defaultValue.trim().length>0)})()&&Eu(!0)})),et("click",".js-more-pinnable-items-button",(function(){Eu(!1)})),et("filter-input-start",".js-pinned-items-filter",e=>{const t=e.currentTarget;if(!(t instanceof it))throw new Error("invariant: app/assets/modules/github/profile/pinned-items.ts:96");t.filter=function(){const e=l(document,".js-pinned-items-type-filter:checked",HTMLInputElement).map(e=>e.value);return(t,n,s)=>{const o=s.toLowerCase().trim();if(t.querySelector("input:checked"))return{match:!0};const r=!o||n.toLowerCase().indexOf(o.toLowerCase())>-1,i=t.getAttribute("data-pinnable-type"),a=!(e.length>0&&i)||e.includes(i);return{match:r&&a}}}()}),c(".js-pinned-items-filter-input",(function(){Eu(!0)})),et("change",".js-pinned-items-type-filter",Tu),et("change",".js-pinned-items-type-filter",(function(){const e=l(document,".js-pinned-items-type-filter:checked",HTMLInputElement);for(const t of e)t.disabled=1===e.length})),et("change",".js-pinned-items-selection-form",ku),et("reset",".js-pinned-items-selection-form",ku),Qe(".js-pinned-items-selection-form",Tu);let Mu=null,Su=null;function Hu(e){const{item:t,oldIndex:n}=e,{parentNode:s}=t;if(!(s instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/profile/pinned-item-reordering.ts:13");Su=s.children[n+1]}async function xu(e){const{oldIndex:t,newIndex:n,item:s}=e;if(t===n)return;const r=o(s,".js-pinned-items-reorder-form",HTMLFormElement),i=o(r,".js-pinned-items-reorder-container"),a=u(i,".js-pinned-items-spinner"),c=u(i,".js-pinned-items-reorder-message");c.textContent="",a.style.display="inline-block",Mu.option("disabled",!0);try{await H(r.action,{method:r.method,body:new FormData(r)}),c.textContent=c.getAttribute("data-success-text")||"",a.style.display="none",Mu.option("disabled",!1)}catch(l){c.textContent=c.getAttribute("data-error-text")||"",a.style.display="none";const e=s.parentNode;if(!e)throw new Error("invariant: app/assets/modules/github/profile/pinned-item-reordering.ts:41");Su?e.insertBefore(s,Su):e.appendChild(s)}}function Au(e,t){t>0?e.textContent=function(e){return e>999?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}(t):e.remove()}Qe(".js-pinned-items-reorder-list",(function(e){Mu=de.create(e,{animation:150,item:".js-pinned-item-list-item",handle:".js-pinned-item-reorder",onUpdate:xu,onStart:Hu,chosenClass:"is-dragging"})})),et("submit",".js-pinned-items-reorder-form",(function(e){e.preventDefault()})),et("click",".js-pinned-item-list-item .js-sortable-button",(function({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/profile/pinned-item-reordering.ts:64");ui(e,o(e,".js-pinned-item-list-item"),xu)})),Qe(".js-user-profile-sticky-fields.is-stuck",(function(){const e=u(document,".js-user-profile-sticky-bar");return{add(){e.classList.add("is-stuck")},remove(){e.classList.remove("is-stuck")}}})),Qe(".js-user-profile-follow-button.is-stuck",(function(){const e=u(document,".js-user-profile-sticky-bar");return{add(){e.classList.add("is-follow-stuck")},remove(){e.classList.remove("is-follow-stuck")}}})),Qe(".js-user-profile-following-toggle .js-toggler-container.on",(function(){return{add(){const e=document.querySelector(".js-user-profile-following-mini-toggle .js-toggler-container");e&&e.classList.add("on")},remove(){const e=document.querySelector(".js-user-profile-following-mini-toggle .js-toggler-container");e&&e.classList.remove("on")}}})),Qe(".js-user-profile-following-mini-toggle .js-toggler-container.on",(function(){const e=u(document,".js-user-profile-following-toggle .js-toggler-container");return{add(){e.classList.add("on")},remove(){e.classList.remove("on")}}})),Qe(".js-profile-tab-count-container",(function(e){!async function(e){const t=new URL(i(e,"data-url"),window.location.origin),s=new URLSearchParams(t.search.slice(1)),o=e.querySelector(".js-profile-repository-count"),r=e.querySelector(".js-profile-project-count"),a=e.querySelector(".js-profile-package-count"),c=e.querySelector(".js-profile-team-count"),l=e.querySelector(".js-profile-member-count");o&&s.append("repo","1"),r&&s.append("project","1"),a&&s.append("package","1"),c&&s.append("team","1"),l&&s.append("member","1"),t.search=s.toString();const u=await n(t.toString()),d=(await u.json()).data;o&&d.repositories&&Au(o,d.repositories.totalCount),r&&d.projects&&Au(r,d.projects.totalCount),a&&d.registryPackages&&Au(a,d.registryPackages.totalCount),c&&d.teams&&Au(c,d.teams.totalCount),l&&d.members&&Au(l,d.members.totalCount)}(e)}));function qu(e){return e.split("\n").reduce((function(e,t){var n=function(e){var t=Cu.exec(e);if(!t)return null;var n=t[2]&&0===t[2].indexOf("native"),s=t[2]&&0===t[2].indexOf("eval"),o=Iu.exec(t[2]);s&&null!=o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{file:n?null:t[2],methodName:t[1]||"<unknown>",arguments:n?[t[2]]:[],lineNumber:t[3]?+t[3]:null,column:t[4]?+t[4]:null}}(t)||function(e){var t=_u.exec(e);if(!t)return null;return{file:t[2],methodName:t[1]||"<unknown>",arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}}(t)||function(e){var t=$u.exec(e);if(!t)return null;var n=t[3]&&t[3].indexOf(" > eval")>-1,s=Nu.exec(t[3]);n&&null!=s&&(t[3]=s[1],t[4]=s[2],t[5]=null);return{file:t[3],methodName:t[1]||"<unknown>",arguments:t[2]?t[2].split(","):[],lineNumber:t[4]?+t[4]:null,column:t[5]?+t[5]:null}}(t)||function(e){var t=Pu.exec(e);if(!t)return null;return{file:t[2],methodName:t[1]||"<unknown>",arguments:[],lineNumber:+t[3],column:t[4]?+t[4]:null}}(t)||function(e){var t=Du.exec(e);if(!t)return null;return{file:t[3],methodName:t[1]||"<unknown>",arguments:[],lineNumber:+t[4],column:t[5]?+t[5]:null}}(t);return n&&e.push(n),e}),[])}var Cu=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Iu=/\((\S*)(?::(\d+))(?::(\d+))\)/;var _u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var $u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Nu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;var Du=/^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i;var Pu=/^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i;let Ru=!1,Fu=0;const Bu=(new Date).getTime();function Ou(e){var t;const n=function(e){return qu(e.stack||"").map(e=>({filename:e.file||"",function:String(e.methodName),lineno:(e.lineNumber||0).toString(),colno:(e.column||0).toString()}))}(e),s=null!==(t=e.framesToPop)&&void 0!==t?t:0;return 0===s?n:n.slice(s)}const Uu=/(chrome|moz|safari)-extension:\/\//;const zu=/^\S/,Wu=/^\s+at /;function Vu(){var e,t;const n=null===(t=null===(e=document.head)||void 0===e?void 0:e.querySelector('meta[name="user-login"]'))||void 0===t?void 0:t.content;if(n)return n;const s=mo();return s?`anonymous-${s}`:null}let Ju=!1;window.addEventListener("pageshow",()=>{Ju=!1}),window.addEventListener("pagehide",()=>{Ju=!0});const Ku=document.querySelector("meta[name=js-proxy-site-detection-payload]"),Gu=document.querySelector("meta[name=expected-hostname]");if(Ku instanceof HTMLMetaElement&&Gu instanceof HTMLMetaElement&&De(document)){const e={url:window.location.href,expectedHostname:Gu.content,documentHostname:document.location.hostname,proxyPayload:Ku.content},t=new Error,n={};n.$__=btoa(JSON.stringify(e)),function(e,t={}){!function(e){var t,n;if(!(!Ju&&!Ru&&Fu<10&&"function"==typeof Blob&&"undefined"!=typeof Intl&&"undefined"!=typeof MutationObserver&&"undefined"!=typeof URLSearchParams&&"undefined"!=typeof IntersectionObserver&&"entries"in FormData.prototype)||De(document))return;const s=null===(n=null===(t=document.head)||void 0===t?void 0:t.querySelector('meta[name="browser-errors-url"]'))||void 0===n?void 0:n.content;if(!s)return;if(e.error&&e.error.stack&&(o=e.error.stack,Uu.test(o)))return void(Ru=!0);var o;Fu++,window.fetch(s,{method:"post",body:JSON.stringify(e)}).catch((function(){}))}(function(e,t={}){let n;if(e){let s="";const o=e;if(e.stack){const{framesToPop:t}=o;s=function(e,t=0){if(0===t)return e;let n=e.split("\n");null!=t&&(n=n.slice(t));return n.join("\n")}(function(e){const t=e.split("\n");return function(e){return e.length>=2&&zu.test(e[0])&&Wu.test(e[1])}(t)?(t.shift(),t.join("\n")):e}(e.stack),t)}else{let{fileName:e,lineNumber:n,columnNumber:r}=o;null==e&&(e=String(t.filename)),null==n&&(n=t.lineno||0),null==r&&(r=t.colno||0),s=`${e}:${n}:${r}`}n={type:e.name,value:e.message,stacktrace:Ou(e),name:e.name,message:e.message,stack:s}}return Object.assign({error:n,filename:"",lineno:0,colno:0,sanitizedUrl:hr()||window.location.href,readyState:document.readyState,referrer:document.referrer,timeSinceLoad:Math.round((new Date).getTime()-Bu),user:Vu()||void 0},t)}(e,t))}(t,n)}function Xu(e,t,n){const s=Array.from(e.querySelectorAll('[role="menuitem"]'));let o=s.indexOf(t),r=s.indexOf(n);if(-1===o)throw new Error("Couldn't find startIndex in container");if(-1===r)throw new Error("Couldn't find endItem in container");Yu(e),s[r].classList.add("is-last-in-range"),o>r&&([o,r]=[r,o]);for(const i of s.slice(o,r+1))i.classList.add("is-range-selected")}function Yu(e){for(const t of e.querySelectorAll('[role="menuitem"]'))t.classList.remove("is-range-selected","is-last-in-range")}et("details-menu-select",".js-pull-base-branch-menu",(function(){const e=u(document,".js-change-base-template",HTMLTemplateElement).content.cloneNode(!0);e instanceof DocumentFragment&&M({content:e})}),{capture:!0}),Qe(".js-diffbar-commits-menu .js-diffbar-commits-list",{subscribe:function(e){const t=o(e,"details-menu");let n=!1;function s(e){n=e.shiftKey,n&&e.preventDefault()}function r(t){if(!n)return;if(t.preventDefault(),!(t instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/pulls/commits-range-selection.ts:68");const s=t.detail.relatedTarget;if(!(s instanceof Element))throw new Error("invariant: app/assets/modules/github/pulls/commits-range-selection.ts:70");if(s.classList.contains("is-range-selected")){t.stopPropagation();const n=e.querySelectorAll(".is-range-selected"),s=n[0],o=n[n.length-1],r=i(e,"data-range-url"),a=s.getAttribute("data-parent-commit"),c=i(o,"data-commit"),l=a&&c?`${a}..${c}`:c,d=r.replace("$range",l);D({url:d,container:u(document,"#js-repo-pjax-container")})}else t.stopImmediatePropagation(),async function(e,t){function n(n){if(!(n.target instanceof Element))throw new Error("invariant: app/assets/modules/github/pulls/commits-range-selection.ts:35");Xu(e,t,o(n.target,'[role="menuitem"]'))}Xu(e,t,t),e.addEventListener("mouseover",n),await new Promise(e=>window.addEventListener("keyup",e,{once:!0})),e.removeEventListener("mouseover",n),Yu(e)}(e,s)}return e.addEventListener("click",s,{capture:!0}),t.addEventListener("details-menu-select",r),{unsubscribe:()=>{e.removeEventListener("click",s,{capture:!0}),t.removeEventListener("details-menu-select",r)}}}}),et("toggle",".js-diffbar-commits-menu",(function(e){const t=e.currentTarget;if(!t.hasAttribute("open"))return;const n=t.querySelector(".in-range");n&&n.focus()}),{capture:!0}),et("click",".js-compare-tab",(function(e){for(const n of document.querySelectorAll(".js-compare-tab.selected"))n.classList.remove("selected");e.currentTarget.classList.add("selected");for(const n of document.querySelectorAll("#commits_bucket, #files_bucket, #commit_comments_bucket"))n.classList.add("d-none");const t=e.currentTarget.hash;u(document,t).classList.remove("d-none"),e.preventDefault()})),G((function({target:e}){if(!(e instanceof HTMLElement))return;const t=e.closest("#commits_bucket, #files_bucket, #commit_comments_bucket");t&&t instanceof HTMLElement&&!B(t)&&u(document,`.js-compare-tab[href="#${t.id}"]`).click()})),et("click",".js-toggle-range-editor-cross-repo",(function(){u(document,".js-range-editor").classList.toggle("is-cross-repo")})),et("pjax:click",".js-range-editor",(function(e){const t=document.querySelector(".js-compare-pr");if(t&&t.classList.contains("open")){const t=e.detail.options,n=new URL(t.url,window.location.origin);n.search.match(/expand=1/)||(n.search+=`${n.search?"&":""}expand=1`,t.url=n.toString())}})),Qe(".js-compare-pr.open",{add(){document.body.classList.add("is-pr-composer-expanded")},remove(){document.body.classList.remove("is-pr-composer-expanded")}}),et("change",".js-collab-checkbox",(function({currentTarget:e}){const t=e.form;for(const o of t.querySelectorAll(".errored"))o.classList.remove("errored");const n=o(e,".js-collab-option"),s=u(n,".js-status-indicator");s.classList.remove("status-indicator-success","status-indicator-failed"),s.classList.add("status-indicator-loading")})),d(".js-collab-form",(async function(e,t){try{await t.text()}catch(n){for(const t of e.querySelectorAll(".status-indicator-loading")){t.classList.remove("status-indicator-loading"),t.classList.add("status-indicator-failed");const e=o(t,".js-collab-option");e.classList.add("errored");const n=u(e,".js-collab-checkbox",HTMLInputElement);n.checked=!n.checked}for(const t of e.querySelectorAll(".status-indicator-success"))t.classList.remove("status-indicator-success");return}for(const s of e.querySelectorAll(".errored"))s.classList.remove("errored");for(const s of e.querySelectorAll(".status-indicator-loading"))s.classList.remove("status-indicator-loading"),s.classList.add("status-indicator-success")})),et("details-menu-selected",".js-pull-request-menu",(function(e){const t=u(document,".js-pull-request-button"),n=u(e.detail.relatedTarget,"span[data-menu-button-text]").textContent;t.textContent=n,t.focus()}),{capture:!0}),Qe(".js-timeline-item > .js-commit-group",{constructor:HTMLElement,add(e){if(e.querySelector(".js-commit-group-header"))return;const t=e.closest(".js-timeline-item");if(!(t instanceof HTMLElement))return;let n=t.previousElementSibling;n instanceof HTMLElement&&(n.classList.contains("js-timeline-item")||(n=n.previousElementSibling,n instanceof HTMLElement))&&n.querySelector(".js-commit-group")&&function(e,t){const n=u(e,".js-commit-group-commits"),s=t.querySelectorAll(".js-commit-group-commits > .js-commit");for(const r of s)r.classList.toggle("py-3"),n.appendChild(r);const o=e.querySelector(".js-commit-group-count");o instanceof HTMLElement&&(o.textContent=`${n.querySelectorAll(".js-commit").length}`),t.remove()}(n,t)}}),et("click",".js-file-header .js-details-target",(function(e){if(!(e instanceof MouseEvent&&e.altKey&&e.currentTarget instanceof HTMLElement)){const t=o(e.currentTarget,".js-file");return void(t.getBoundingClientRect().top<0&&X(t))}const{currentTarget:t}=e,n=o(t,".js-details-container");n.addEventListener("details:toggled",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/pulls/file-collapsing.ts:23");const{open:t}=e.detail;V(n,()=>{for(const e of document.querySelectorAll(".js-file.js-details-container"))e!==n&&(e.classList.toggle("open",t),e.classList.toggle("Details--on",t))}),function(e){if(!document.querySelector(".js-file-filter"))return;Xo(e);const t=Bo();t&&(t.checked=!e),Do(Uo())}(t)}),{once:!0})})),G(()=>{const e=window.location.hash.slice(1);if(!e)return;const t=document.getElementsByName(e)[0];if(!t)return;const n=t.nextElementSibling;n&&n.matches(".js-file.js-details-container")&&(n.classList.add("open"),n.classList.add("Details--on"))}),Qe(".js-file-header-dropdown",{subscribe:e=>j(e,"toggle",(function({currentTarget:e}){if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/pulls/file-collapsing.ts:56");const t=e,n=t.hasAttribute("open"),s=o(t,".js-file-header");if(!(s instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/pulls/file-collapsing.ts:60");s.classList.toggle("has-open-dropdown",n)}))}),et("click",".js-fork-cleanup-select-item",(function({currentTarget:e}){const t=o(e,".js-fork-cleanup-select-menu");for(const o of l(t,".js-fork-cleanup-select-item"))o.classList.remove("selected");e.classList.add("selected");const n=o(t,".js-fork-cleanup-button-group"),s=e.getAttribute("data-toggles-button");"branch"===s?(u(n,".js-fork-cleanup-branch-button").classList.remove("d-none"),u(n,".js-fork-cleanup-fork-button").classList.add("d-none")):"fork"===s&&(u(n,".js-fork-cleanup-branch-button").classList.add("d-none"),u(n,".js-fork-cleanup-fork-button").classList.remove("d-none"))})),et("details:toggled",".js-pull-merging",(function({currentTarget:e}){const t=l(e,".js-merge-pull-request"),n=t.some(B);for(const s of t)s.classList.toggle("is-dirty",n)})),et("click",".js-merge-box-try-again",(async function({currentTarget:e}){const t=u(o(e,".js-pull-merging"),".js-tryable-again",HTMLFormElement);nt(t,"submit")})),document.addEventListener("session:resume",(function(e){const t=document.getElementById(e.detail.targetId);if(t){const e=t.closest(".js-merge-pull-request");if(e){const t=e.closest(".js-details-container");t&&t.classList.add("open")}}})),et("change",".js-merge-button-toggle",(function({currentTarget:e}){const t=o(e,".js-merge-pr"),n=!e.checked;for(const s of l(t,".js-merge-commit-button",HTMLButtonElement))s.disabled=n})),et("details-menu-selected",".js-merge-method-menu",(function(e){const t=e.detail.relatedTarget,n=o(t,".js-merge-pr"),s=u(n,".js-merge-pull-request",HTMLFormElement),r=u(n,".js-merge-method-menu-button"),a=r.getAttribute("data-merge-button-class");r.classList.toggle("btn-danger",t.hasAttribute("data-merge-commit-warning")),a&&r.classList.toggle(a,!t.hasAttribute("data-unsafe-rebase"));const c=u(n,".js-merge-title",HTMLInputElement),d=u(n,".js-merge-message",HTMLTextAreaElement);c.defaultValue===c.value&&(c.defaultValue=c.value=i(t,"data-input-title-value"));d.defaultValue===d.value&&(d.defaultValue=d.value=i(t,"data-input-message-value"));n.classList.toggle("is-merging","merge"===t.value),n.classList.toggle("is-squashing","squash"===t.value),n.classList.toggle("is-rebasing","rebase"===t.value);const m=s.classList.contains("js-admin-override-merge")&&"merge"===t.value||s.classList.contains("js-admin-override-squash")&&"squash"===t.value||s.classList.contains("js-admin-override-rebase")&&"rebase"===t.value,f=l(n,".js-admin-override");for(const o of f)o.hidden=!m;const p=m&&!u(n,".js-merge-button-toggle",HTMLInputElement).checked,g=l(n,".js-merge-pull-request .js-merge-commit-button",HTMLButtonElement);for(const o of g)o.type=t.value===o.value?"submit":"button",o.disabled=p;s.classList.toggle("text-red",m);const h=o(n,".js-pull-merging"),v=new URL(i(h,"data-url"),window.location.origin),b=new URLSearchParams(v.search);b.set("merge_type",t.value),v.search=b.toString(),h.setAttribute("data-url",v.toString())}),{capture:!0}),et("details:toggled",".js-merge-pr",(function(e){const t=e.currentTarget.querySelector(".js-merge-message");t&&nt(t,"change")})),Qe(".branch-action-item.js-details-container.open",{add(e){for(const t of e.querySelectorAll(".js-merge-review-section"))t.setAttribute("open","")},remove(e){for(const t of e.querySelectorAll(".js-merge-review-section"))t.removeAttribute("open")}}),et("toggle",".js-details-container .js-merge-review-section",(function({currentTarget:e}){const t=o(e,".js-details-container"),n=t.querySelectorAll(".js-merge-review-section").length,s=t.querySelectorAll(".js-merge-review-section[open]").length,r=s===n;0===s?ue(t,!1):r&&ue(t,!0)}),{capture:!0}),Qe("poll-include-fragment[data-to-be-polled]",{constructor:Ze,add(e){function t(){e.src=i(e,"data-to-be-polled"),e.removeAttribute("data-to-be-polled")}document.hidden?document.addEventListener("visibilitychange",t,{once:!0}):t()}});let Qu=!1;function Zu(){const e=document.querySelectorAll(".pull-request-ref-restore");for(let t=0;t<e.length;t++)e[t].classList.toggle("last",t===e.length-1)}function ed(){const e=null!=document.querySelector("#js-pull-restorable"),t=document.querySelector(".js-pull-discussion-timeline");t&&t.classList.toggle("is-pull-restorable",e)}function td(){const e=document.querySelector(".js-reviews-container");e&&setTimeout(()=>function(e){const t=o(e,".js-review-state-classes"),n=t.querySelectorAll(".js-pending-review-comment").length,s=u(document,".js-review-changes");t.classList.toggle("is-review-pending",n>0);for(const o of document.querySelectorAll(".js-pending-review-comment-count"))o.textContent=String(n);for(const o of document.querySelectorAll(".js-pending-comment-count-type"))o instanceof HTMLElement&&(o.textContent=o.getAttribute(1===n?"data-singular-string":"data-plural-string"));if(n>0){s.textContent=s.getAttribute("data-pending-message")||"";const t=u(e,".js-reviews-toggle");t.classList.add("anim-pulse-in"),t.addEventListener("animationend",()=>t.classList.remove("anim-pulse-in"),{once:!0})}else s.textContent=s.getAttribute("data-message")||""}(e))}function nd(e){return e.getAttribute("ratio").split("/")}function sd(e){if(e){const[t,n]=nd(e),s=parseInt(t)/parseInt(n),o=e.querySelector(".js-review-progress"),r=e.querySelector(".js-review-count");o instanceof HTMLElement&&r&&(o.style.width=`${100*s}%`,r.textContent=`${t} / ${n}`)}}document.addEventListener("keydown",(function(e){"Alt"===e.key&&(Qu=!0)})),document.addEventListener("keyup",(function(e){"Alt"===e.key&&(Qu=!1)})),et("click",".js-toggle-outdated-comments",(function(e){if(!((e instanceof MouseEvent&&e.altKey||Qu)&&e.currentTarget instanceof HTMLElement))return;const t=e.currentTarget,n=o(t,"details");function s(){const e=n.hasAttribute("open");for(const n of document.querySelectorAll(".js-toggle-outdated-comments"))if(n!==t){o(n,"details").toggleAttribute("open",e)}}setTimeout(()=>{V(t,s)})})),Qe(".pull-request-ref-restore",{add:Zu,remove:Zu}),Qe("#js-pull-restorable",{add:ed,remove:ed}),d(".js-inline-comment-form",(async function(e,t){await t.text(),td()})),d(".js-pending-review-comment .js-comment-delete",(async function(e,t){await t.text(),td()})),d(".js-resolvable-timeline-thread-form",(async function(e,t){try{const n=await t.html();o(e,".js-resolvable-timeline-thread-container").replaceWith(n.html)}catch(n){U()}})),et("click",".js-resolvable-thread-toggler",(function(e){if(!(e.target instanceof HTMLElement))return;const t=o(e.target,".js-resolvable-timeline-thread-container");o(e.target,".js-resolvable-thread-toggler-container").classList.toggle("border-bottom"),u(t,".js-resolvable-thread-contents").classList.toggle("d-none");for(const n of t.querySelectorAll(".js-resolvable-thread-toggler"))n.classList.toggle("d-none")})),d(".js-toggle-user-reviewed-file-form",(async function(e,t){const n=o(e,".js-details-container"),s=!!n.querySelector(".js-reviewed-file"),r=n.classList.contains("open"),i=n.querySelector(".js-file-header"),a=!!i&&60===i.getBoundingClientRect().top;(!s&&r||s&&!r)&&(ue(n),a&&X(n));const c=u(e,".js-reviewed-toggle");s?(c.classList.remove("bg-blue-2","border-blue-light"),c.classList.add("text-gray","border-gray-dark")):(c.classList.remove("text-gray","border-gray-dark"),c.classList.add("bg-blue-2","border-blue-light")),u(c,".js-reviewed-checkbox",HTMLInputElement).disabled=!0;const l=document.querySelector("progress-bar");l instanceof ProgressBarElement&&(s?l.decrement():l.increment());const d=await t.html(),m=e.closest(".js-replace-file-header-review");m&&(m.replaceWith(d.html),n.hasAttribute("data-file-user-viewed")?n.removeAttribute("data-file-user-viewed"):n.setAttribute("data-file-user-viewed","true"))}));class ProgressBarElement extends HTMLElement{static get observedAttributes(){return["ratio"]}attributeChangedCallback(e){"ratio"===e&&sd(this)}connectedCallback(){sd(this)}increment(){const[e,t]=nd(this),n=Math.min(parseInt(e)+1,parseInt(t));this.setAttribute("ratio",`${n}/${t}`)}decrement(){const[e,t]=nd(this),n=Math.min(parseInt(e)-1,parseInt(t));this.setAttribute("ratio",`${n}/${t}`)}}function od(e){const t=e.target,n=i(t,"data-reaction-label"),s=o(t,".js-add-reaction-popover"),r=u(s,".js-reaction-description");r.hasAttribute("data-default-text")||r.setAttribute("data-default-text",r.textContent||""),r.textContent=n}function rd(e){const t=o(e.target,".js-add-reaction-popover"),n=u(t,".js-reaction-description"),s=n.getAttribute("data-default-text");s&&(n.textContent=s)}function id(e,t){e&&e.postMessage&&e.postMessage(JSON.stringify(t),"*")}window.customElements.get("progress-bar")||(window.ProgressBarElement=ProgressBarElement,window.customElements.define("progress-bar",ProgressBarElement)),document.addEventListener("pjax:end",(function(){for(const e of document.querySelectorAll(".js-pull-refresh-on-pjax"))nt(e,"socket:message",{})})),Qe(".js-multi-line-callout",(function(e){const t=document.querySelector(".js-linkable-line-number");if(!t)return;if(o(t,".js-diff-table").offsetHeight<343)return;const n=t.closest("tr");if(!n)return;const s=n.lastElementChild;s&&(e.remove(),s.prepend(e),e.removeAttribute("hidden"))})),et("submit",".js-multi-line-callout",(function(e){if(!(e.target instanceof Element))return;o(e.target,".js-multi-line-callout").hidden=!0})),et("click",".js-dismiss-multi-line-suggestion-onboarding-notice",(async function(e){const t=i(e.currentTarget,"data-url"),n=u(e.currentTarget.parentElement,".js-data-url-csrf",HTMLInputElement),s=new FormData;s.append("notice","multi_line_suggestions"),await H(fe(t,n.value,{method:"post",body:s}));const o=document.querySelectorAll(".js-multi-line-suggestion-onboarding-notice");for(const r of o)r.remove()})),Qe(".js-updating-pull-request-commits-count",{add(e){const t=e.textContent,n=l(document,".js-updateable-pull-request-commits-count");for(const s of n)s.textContent=t}}),(async()=>{if(await p,window.performance&&window.performance.navigation&&window.performance.navigation.type===window.performance.navigation.TYPE_RELOAD){const e=document.getElementById("js-report-pull-request-refresh");e&&ce(e)}})(),d(".js-pick-reaction",(async function(e,t){const n=await t.json(),s=o(e,".js-comment"),r=u(s,".js-reactions-container"),i=u(s,".js-comment-header-reaction-button"),a=ge(document,n.json.reactions_container.trim()),c=ge(document,n.json.comment_header_reaction_button.trim());r.replaceWith(a),i.replaceWith(c),s.classList.remove("is-reacting")})),et("toggle",".js-reaction-popover-container",(function(e){const t=e.currentTarget.hasAttribute("open");for(const n of l(e.target,".js-reaction-option-item"))t?(n.addEventListener("mouseenter",od),n.addEventListener("mouseleave",rd)):(n.removeEventListener("mouseenter",od),n.removeEventListener("mouseleave",rd));o(e.target,".js-comment").classList.toggle("is-reacting",t)}),{capture:!0});const ad="render:hook:message",cd="render:hook:afterready",ld=["is-render-pending","is-render-ready","is-render-loading","is-render-loaded"],ud=new WeakMap;function dd(e){if(null==e)return;const t=ud.get(e);null!=t&&(t.load=t.hello=null,t.helloTimer&&(clearTimeout(t.helloTimer),t.helloTimer=null),t.loadTimer&&(clearTimeout(t.loadTimer),t.loadTimer=null))}function md(e){if(null!=e)return e.classList.remove(...ld),e.classList.add("is-render-failed"),dd(e)}function fd(){return!0}function pd(e,t=fd){return function(){if(B(e)&&!e.classList.contains("is-render-ready")&&!e.classList.contains("is-render-failed")&&!e.classList.contains("is-render-failed-fatally")&&(!t||t()))return md(e)}}Qe(".js-render-target",{constructor:HTMLElement,initialize:function(e){const t=ud.get(e);null!=t&&t.load||(dd(e),function(e){if(ud.get(e))return;const t={load:null,hello:null,helloTimer:null,loadTimer:null};t.load=Date.now(),t.helloTimer=window.setTimeout(pd(e,(function(){return!t.hello})),1e4),t.loadTimer=window.setTimeout(pd(e),45e3),ud.set(e,t)}(e),e.classList.add("is-render-automatic"),e.classList.add("is-render-requested"))}}),window.addEventListener("message",(function(e){const t=e.data;if(!t)return;const n=function(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return}}(t)||t;if("string"!=typeof n.type&&"render"!==n.type)return;const s=n.type;if("string"!=typeof n.identity)return;const o=n.identity;if("string"!=typeof n.body)return;const r=n.body,i=function(e){return Array.from(document.querySelectorAll(".js-render-target")).filter(t=>!e||t.getAttribute("data-identity")===e)[0]}(o);i&&e.origin===i.getAttribute("data-host")&&function(e,t,n,s,o){switch(s){case"hello":{(ud.get(e)||{untimed:!0}).hello=Date.now();const t={type:"render:cmd",body:{cmd:"ack",ack:!0}},n={type:"render:cmd",body:{cmd:"branding",branding:!1}},s=function(e){const t=e.querySelector("iframe");return t instanceof HTMLIFrameElement?t.contentWindow:null}(e);if(id(s,t),id(s,n),e.classList.contains("is-local")&&s&&"function"==typeof s.postMessage){const t=s,n=e.closest(".js-code-editor"),o=n instanceof HTMLElement?Pe(n):null;if(o){let e=null;const n=(n,s)=>{if(function(e){return e&&"setValue"===e.origin}(s))return;const r=o.code();r!==e&&(e=r,id(t,{type:"render:data",body:r}))};o.editor.on("change",n),n()}}}break;case"error":return md(e);case"error:fatal":return md(e),e.classList.add("is-render-failed-fatal");case"error:invalid":return md(e),e.classList.add("is-render-failed-invalid");case"loading":return e.classList.remove(...ld),e.classList.add("is-render-loading");case"loaded":return e.classList.remove(...ld),e.classList.add("is-render-loaded");case"ready":e.classList.remove(...ld),e.classList.add("is-render-ready"),o&&"number"==typeof o.height&&(e.style.height=`${o.height}px`),nt(e,cd,{container:e,payload:o});break;case"resize":o&&"number"==typeof o.height&&(e.style.height=`${o.height}px`);break;case"data":nt(e,"edit:visual",o);break;default:nt(e,ad,{type:t,body:s,payload:o})}}(i,s,0,r,null!=n.payload?n.payload:void 0)}));let gd=class BranchFilterController extends HTMLElement{constructor(){super(...arguments),this.requests=new b,this.originalSelectedItem=null}submit(e){e.preventDefault()}resetField(e){if("Escape"!==P(e))return;const t=this.field.value.trim();this.field.value="",t&&this.search()}reset(){this.field.focus(),this.field.value="",nt(this.field,"input")}get activeFilter(){var e;return null!==(e=this.filters.find(e=>e.classList.contains("selected")))&&void 0!==e?e:null}async search(){this.originalSelectedItem||(this.originalSelectedItem=this.activeFilter);const e=this.field.value.trim().length>0,t=function(e){const t=e.form;if(e.value.trim()){const n=new URL(t.action,window.location.origin),s=new URLSearchParams(n.search.slice(1)),o=t.elements.namedItem("utf8");return o instanceof HTMLInputElement&&s.append("utf8",o.value),s.append("query",e.value),n.search=s.toString(),n.toString()}return i(t,"data-reset-url")}(this.field);this.classList.toggle("is-search-mode",e),this.classList.add("is-loading");for(const s of this.filters)s.classList.remove("selected");e?this.allFilter.classList.add("selected"):this.originalSelectedItem&&(this.originalSelectedItem.classList.add("selected"),this.originalSelectedItem=null);try{const e=await this.requests.push(k(document,t));h(null,"",t),this.results.innerHTML="",this.results.appendChild(e)}catch(n){}finally{this.classList.remove("is-loading")}}};or([rr],gd.prototype,"field",void 0),or([rr],gd.prototype,"results",void 0),or([rr],gd.prototype,"allFilter",void 0),or([ir],gd.prototype,"filters",void 0),or([mt(100)],gd.prototype,"search",null),gd=or([ar],gd);let hd=class BranchFilterItemController extends HTMLElement{get branch(){return this.getAttribute("branch")}get branches(){const e=this.closest("branch-filter-controller").querySelectorAll("branch-filter-item-controller");return Array.from(e).filter(e=>e.branch===this.branch)}loading(e){for(const t of this.branches)t.spinner.hidden=!e,t.destroyButton&&(t.destroyButton.hidden=e)}set mode(e){for(const t of this.branches)t.classList.toggle("Details--on","restore"===e)}async restore(e){e.preventDefault(),this.loading(!0);try{await J(e.target)}catch(t){location.reload()}finally{this.loading(!1)}this.mode="destroy"}async destroy(e){e.preventDefault(),this.loading(!0);try{await J(e.target)}catch(t){location.reload()}finally{this.loading(!1)}this.mode="restore"}};or([rr],hd.prototype,"destroyButton",void 0),or([rr],hd.prototype,"spinner",void 0),hd=or([ar],hd),et("socket:message",".repository-import",(function(e){const t=e.detail.data;t.redirect_to&&(document.location.href=t.redirect_to,e.stopImmediatePropagation())})),et("change","input.js-repository-import-lfs-opt",(function({currentTarget:e}){const t=parseInt(e.getAttribute("data-percent-used")||""),n=o(e,".js-repository-import-lfs-container"),s=e.getAttribute("data-used")||"";u(n,".js-repository-import-lfs-warn").classList.toggle("d-none",!(t>100)),u(n,".js-usage-bar").classList.toggle("exceeded",t>=100),u(n,".js-usage-bar").setAttribute("aria-label",`${t}%`),u(n,".js-repository-import-lfs-progress").style.width=`${t}%`,u(n,"span.js-usage-text").textContent=s})),d(".js-repository-import-author-form",(async function(e,t){const n=await t.html();o(e,".js-repository-import-author").replaceWith(n.html)})),et("click",".js-repository-import-projects-cancel-button",(function(){const e=u(document,".js-repository-import-projects-cancel-form",HTMLFormElement);m(e)}));let vd=!1;function bd(){const e=u(document,".js-repo-name");nt(e,"input");const t=u(document,'.js-owner-container [aria-checked="true"]'),n="false"!==t.getAttribute("data-org-allow-public-repos"),s=u(document,".js-privacy-toggle[value=public]",HTMLInputElement);jd(n,s,document.querySelector(".js-privacy-toggle-label-public"),document.querySelector(".js-public-description"),document.querySelector(".js-public-restricted-by-policy-description"));const o=function(e,t){let n=!1;const s=document.querySelectorAll(".js-new-repo-internal-visibility");for(const o of s){o.hidden=!0;const e=o.querySelector(".js-privacy-toggle[value=internal]");e instanceof HTMLInputElement&&e.checked&&(n=!0)}if(e){const s=document.querySelector(`#new-repo-internal-visibility-${e}`);if(s){s.hidden=!1;const e=s.querySelector(".js-privacy-toggle-label-internal"),o=s.querySelector(".js-internal-description"),r=s.querySelector(".js-internal-restricted-by-policy-description"),i=s.querySelector(".js-privacy-toggle[value=internal]");if(i instanceof HTMLInputElement)return"false"===t.getAttribute("data-org-allow-internal-repos")?(i.disabled=!0,e&&e.classList.add("text-gray-light"),o&&(o.hidden=!0),r&&(r.hidden=!1)):(n&&(i.checked=!0,nt(i,"change")),i.disabled=!1,e&&e.classList.remove("text-gray-light"),o&&(o.hidden=!1),r&&(r.hidden=!0)),i}}return null}(t.getAttribute("data-business-id"),t),r="false"!==t.getAttribute("data-org-allow-private-repos"),i=u(document,".js-privacy-toggle[value=private]",HTMLInputElement),a=document.querySelector(".js-privacy-toggle-label-private"),c=document.querySelector(".js-private-description"),l=document.querySelector(".js-private-restricted-by-policy-description");jd(r,i,a,c,l),function(){const e=document.querySelectorAll('.js-org-upgrade-link:not([hidden=""]');for(const t of e)t.hidden=!0}();const d="false"!==t.getAttribute("data-org-private-restricted-by-plan"),m=document.querySelector(".js-upgrade-private-description"),f="false"!==t.getAttribute("data-org-show-upgrade"),p=t.getAttribute("data-org-name"),g=p?document.querySelector(`a[data-upgrade-link="${p}"]`):null,h=document.querySelector(".js-ask-owner-message");r||!d?(m&&(m.hidden=!0),g&&(g.hidden=!0),h&&(h.hidden=!0)):(l&&(l.hidden=d),m&&(m.hidden=!1),g&&(g.hidden=!f),h&&(h.hidden=f));const v="true"===t.getAttribute("data-org-show-trade-controls"),b="true"===t.getAttribute("data-viewer-is-org-admin"),j="true"===t.getAttribute("data-user-show-trade-controls"),w=v&&!r,L=document.querySelector(".js-trade-controls-description"),y=document.querySelector(".js-individual-trade-controls-description");if(j||w){const e=!j&&!b&&w;l&&(l.hidden=!e),i.disabled=!0,c&&(c.hidden=!0),m&&(m.hidden=!0),g&&(g.hidden=!0),h&&(h.hidden=!0)}else L&&(L.hidden=!0),y&&(y.hidden=!0);j?(L&&(L.hidden=!0),y&&(y.hidden=!1)):w&&L&&(L.hidden=!b),function(e,t,n,s){let o=null;"private"!==e.getAttribute("data-default")||s.disabled?"internal"===e.getAttribute("data-default")&&n&&!n.disabled?o=n:t.disabled?n&&!n.disabled&&(o=n):o=t:o=s;if(!o)return;const r=t.disabled&&t.checked||s.disabled&&s.checked||n&&n.disabled&&n.checked,i=!(t.checked||n&&n.checked||s.checked);!1!==vd&&!0!==r&&!0!==i||(o.checked=!0,nt(o,"change"))}(t,s,o,i),function(e){for(const s of document.querySelectorAll(".js-with-permission-fields"))s.hidden=!e;for(const s of document.querySelectorAll(".js-without-permission-fields"))s.hidden=e;const t=document.querySelector(".errored"),n=document.querySelector("dl.warn");t&&(t.hidden=!e);n&&(n.hidden=!e)}("yes"===t.getAttribute("data-permission")),function(){const e=document.querySelector("#js-upgrade-container");if(!e)return;const t=u(document,"#js-payment-methods-form");e.firstElementChild&&t.appendChild(e.firstElementChild);const n=u(document,"input[name=owner]:checked",HTMLInputElement).value,s=t.querySelector(`.js-upgrade[data-login="${n}"]`);s&&e.appendChild(s)}(),wd();const E=document.querySelector(".js-quick-install-container");if(E){const e=u(E,".js-quick-install-divider");e.hidden=!0;const t=u(document,"input[name=owner]:checked",HTMLInputElement).parentElement;if(t){const n=t.querySelector(".js-quick-install-list-template");if(n instanceof HTMLTemplateElement){const t=u(E,".js-account-apps");t.innerHTML="",t.append(n.content.cloneNode(!0)),n.children.length>0&&(e.hidden=!1)}}}}function jd(e,t,n,s,o){e?(t.disabled=!1,n&&n.classList.remove("text-gray-light"),s&&(s.hidden=!1),o&&(o.hidden=!0)):(t.disabled=!0,n&&n.classList.add("text-gray-light"),s&&(s.hidden=!0),o&&(o.hidden=!1))}function wd(e){const t=document.querySelector("#js-upgrade-container");if(!t)return;const n=t.querySelector(".js-billing-section"),s=t.querySelector(".js-confirm-upgrade-checkbox");let o=e?e.target:null;if(o||(o=document.querySelector(".js-privacy-toggle:checked")),!(o instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/repositories/new.ts:263");if("false"===o.value){if(t.hidden=!1,n&&n.classList.remove("has-removed-contents"),s){if(!(s instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/repositories/new.ts:269");s.checked=!0}}else if(t.hidden=!0,n&&n.classList.add("has-removed-contents"),s){if(!(s instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/repositories/new.ts:278");s.checked=!1}Ld()}function Ld(){const e=u(document,".js-repo-form"),t=e.querySelector(".js-repo-name"),n=e.querySelector(".js-repo-url");let s=!n||!n.classList.contains("is-autocheck-errored");s&&t&&(s=t.classList.contains("is-autocheck-successful"),"private"===u(document,".js-privacy-toggle:checked",HTMLInputElement).value&&(s=s&&function(){const e=document.querySelector("#js-upgrade-container");if(!e)return!0;if(e.querySelector(".js-ofac-sanction-notice"))return!1;const t=e.querySelector(".js-confirm-upgrade-checkbox");if(t instanceof HTMLInputElement&&!t.checked)return!1;const n=e.querySelector(".js-zuora-billing-info");if(n&&n.classList.contains("d-none"))return!1;return!0}())),u(e,"button[type=submit]",HTMLButtonElement).disabled=!s}async function yd(e){const t=e.form;u(t,"#release_draft",HTMLInputElement).value="1",Td(e,"saving");try{const n=await A(t.action,{method:t.method,body:new FormData(t)});return Td(e,"saved"),setTimeout(Td,5e3,e,"default"),nt(t,"release:saved",{release:n}),n}catch(n){throw Td(e,"failed"),n}}function Ed(e){const t=o(e,".js-releases-marketplace-publish-container"),n=u(t,".js-releases-marketplace-publish-preview");e.checked?n.classList.remove("d-none"):n.classList.add("d-none")}function Td(e,t){for(const n of e.querySelectorAll(".js-save-draft-button-state"))n.hidden=n.getAttribute("data-state")!==t;e.disabled="saving"===t}function kd(e){const t=document.querySelector(".js-release-target-wrapper");if(null!=t){switch(e){case"valid":t.classList.add("d-none");break;case"loading":break;default:t.classList.remove("d-none")}for(const t of document.querySelectorAll(".js-tag-status-message"))t.hidden=t.getAttribute("data-state")!==e}}Qe("#js-upgrade-container .js-zuora-billing-info:not(.d-none)",Ld),Qe(".page-new-repo",(function(){const e=document.querySelector("#js-upgrade-container");e&&(e.hidden=!0),bd();const t=document.querySelector(".js-owner-select");t&&t.focus()})),et("click",".js-reponame-suggestion",(function(e){const t=u(document,".js-repo-name",HTMLInputElement);t.value=e.currentTarget.textContent,nt(t,"input",!1)})),et("click",".js-privacy-toggle",(function(){vd=!0})),et("change",".js-privacy-toggle",wd),et("details-menu-selected",".js-owner-container",bd,{capture:!0}),et("change","#js-upgrade-container input",Ld),a("#js-upgrade-container input",Ld),et("auto-check-send",".js-repo-name-auto-check",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/repositories/new.ts:359");const t=e.currentTarget.form;if(!t)throw new Error("invariant: app/assets/modules/github/repositories/new.ts:362");const n=u(t,"input[name=owner]:checked",HTMLInputElement).value;e.detail.body.append("owner",n)})),et("auto-check-complete","#repository_name",(function(){Ld()})),a(".js-repo-url",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))return;const n=t.closest(".form-group");if(!(n instanceof HTMLDListElement))return;const s=u(document,".js-insecure-url-warning"),o=u(document,".js-svn-url-error"),r=u(document,".js-git-url-error"),i=t.value.toLowerCase();s.hidden=!i.startsWith("http://"),o.hidden=!i.startsWith("svn://"),r.hidden=!i.startsWith("git://"),i.startsWith("svn://")||i.startsWith("git://")?(t.classList.add("is-autocheck-errored"),n.classList.add("errored")):(t.classList.remove("is-autocheck-errored"),n.classList.remove("errored")),Ld()})),et("click",".js-packages-learn-more-dismiss",(function(){const e=u(document,".js-packages-popover-form",HTMLFormElement);m(e)})),et("tab-container-changed",".js-branches-tags-tabs",(async function(e){if(!(e instanceof CustomEvent))return;const t=e.detail.relatedTarget,n=e.currentTarget;if(!n)return;let s,o;for(const a of n.querySelectorAll("[data-controls-ref-menu-id]")){if(!(a instanceof it||a instanceof rt))return;const e=i(a,"data-controls-ref-menu-id"),n=t.id===e;a.hidden=!n,n?o=a:s||(s=a.input?a.input.value:"")}const r=o&&o.input;r&&(o&&void 0!==s&&(r.value=s),r.focus())})),Qe(".js-pulse-contribution-data",e=>{!async function(e){const t=e.getAttribute("data-pulse-diffstat-summary-url");let n;try{t&&(n=await async function(e){return k(document,e)}(t),function(e,t){t.innerHTML="",t.appendChild(e)}(n,e))}catch(s){const t=u(e,".js-blankslate-loading"),n=u(e,".js-blankslate-error");t.classList.add("d-none"),n.classList.remove("d-none")}}(e)}),et("change",".js-releases-marketplace-publish-field",(function(e){Ed(e.currentTarget)})),Qe(".js-releases-marketplace-publish-field",(function(e){Ed(e)})),et("click",".js-save-draft",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/repositories/releases.ts:49");yd(t),e.preventDefault()})),et("click",".js-timeline-tags-expander",(function(e){const t=e.currentTarget;o(t,".js-timeline-tags").classList.remove("is-collapsed")})),et("release:saved",".js-release-form",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/repositories/releases.ts:67");const t=e.detail.release,n=e.currentTarget,s=n.getAttribute("data-repo-url"),o=t.update_url||Hd("tag",s,t.tag_name);if(n.setAttribute("action",o),t.update_authenticity_token){n.querySelector("input[name=authenticity_token]").value=t.update_authenticity_token}const r=t.edit_url||Hd("edit",s,t.tag_name);h(O(),document.title,r);const i=document.querySelector("#delete_release_confirm form");if(i){const e=t.delete_url||Hd("tag",s,t.tag_name);if(i.setAttribute("action",e),t.delete_authenticity_token){u(i,"input[name=authenticity_token]",HTMLInputElement).value=t.delete_authenticity_token}}const a=n.querySelector("#release_id");if(!a.value){a.value=t.id;const e=document.createElement("input");e.type="hidden",e.name="_method",e.value="put",n.appendChild(e)}})),et("click",".js-publish-release",(function(){u(document,"#release_draft",HTMLInputElement).value="0"}));const Md=new WeakMap;async function Sd(e){if(!e.value)return;if(e.value===Md.get(e))return;kd("loading"),Md.set(e,e.value);const t=i(e,"data-url"),n=new URL(t,window.location.origin),s=new URLSearchParams(n.search.slice(1));s.append("tag_name",e.value),n.search=s.toString();try{const t=await A(n.toString());"duplicate"===t.status&&parseInt(e.getAttribute("data-existing-id"))===parseInt(t.release_id)?kd("valid"):(u(document,".js-release-tag .js-edit-release-link").setAttribute("href",t.url),kd(t.status))}catch(o){kd("invalid")}}function Hd(e,t,n){return`${t}/releases/${e}/${n}`}function xd(e){const t=o(e,"form",HTMLFormElement).querySelector(".js-previewable-comment-form");if(!t)return;let n=t.getAttribute("data-base-preview-url");n||(n=String(t.getAttribute("data-preview-url")),t.setAttribute("data-base-preview-url",n));const s=l(e,'input[name="release[tag_name]"], input[name="release[target_commitish]"]:checked',HTMLInputElement),r=new URL(n,window.location.origin),i=new URLSearchParams(r.search.slice(1));for(const o of s)o.value&&i.append(o.name,o.value);r.search=i.toString(),t.setAttribute("data-preview-url",r.toString())}function Ad(e){return!!e.value&&e.value!==e.defaultValue}async function qd(e){u(document,".js-cooper-enter-prompt").hidden=!e}Qe("input.js-release-tag-field",{constructor:HTMLInputElement,initialize(e){Sd(e),e.addEventListener("blur",(function(){Sd(e)}))}}),et("change",".js-release-tag",(function(e){xd(e.currentTarget)})),Qe(".js-release-form .js-previewable-comment-form",(function(e){xd(u(o(e,"form"),".js-release-tag"))})),Qe(".js-cooper-query",{constructor:HTMLInputElement,add(e){e.selectionStart=e.selectionEnd=e.value.length,qd(Ad(e)),e.addEventListener("focus",e=>{const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/repositories/code-search.ts:16");qd(Ad(t))}),e.addEventListener("blur",()=>{qd(!1)})}}),et("submit",".js-cooper-form",()=>{const e=u(document,".js-cooper-query",HTMLInputElement),t=u(document,".js-cooper-results"),n=u(document,".js-cooper-shimmer-cards"),s=u(n,".js-cooper-label-placeholder"),o=u(s,"span",HTMLSpanElement),r=u(s,"h3",HTMLHeadingElement),i=u(r,"span",HTMLSpanElement);t.hidden=!0,n.hidden=!1,o.hidden=!0,r.hidden=!1,i.textContent=e.value}),s("keyup",".js-cooper-query",e=>{const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/repositories/code-search.ts:44");if("Escape"===e.key){const n=t.form;if(!(n instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/repositories/code-search.ts:47");const s=n.getAttribute("data-esc-to");s&&D({url:s,container:u(document,"#js-repo-pjax-container")}),e.preventDefault()}else qd(Ad(t))}),Qe(".js-security-tab-count",(function(e){e instanceof HTMLElement&&async function(e){const t=i(e,"data-url");let n;try{n=(await A(t)).count}catch(s){return}e.textContent=n,e.hidden=!1;for(const o of l(document,".js-security-deferred-tab-count"))o.textContent=n,o.hidden=!1}(e)})),s("keydown",".js-tree-finder-field",e=>{"Escape"===e.key&&(e.preventDefault(),history.back())});Qe(".js-tree-finder",e=>{const t=u(e,".js-tree-finder-field",HTMLInputElement),n=u(e,".js-tree-browser-results");n.childElementCount>0||((async e=>{if(!(e instanceof FuzzyListElement))return;const t=i(e,"data-url"),n=u(e,".js-tree-browser-result-template",HTMLTemplateElement),{paths:s}=await A(t);e.addLazyItems(s,e=>{const t=n.content.cloneNode(!0).firstElementChild;if(!t)throw new Error("invariant: app/assets/modules/github/repositories/tree-finder.ts:23");const s=u(t,".js-tree-browser-result-anchor",HTMLAnchorElement),o=u(s,".js-tree-browser-result-path"),r=new URL(s.href,window.location.origin);return r.pathname=`${r.pathname}/${encodeURI(e)}`,s.href=String(r),o.textContent=e,t}),e.sort()})(e),at(t,n),e.addEventListener("fuzzy-list-will-sort",()=>{ft(t,n)}),e.addEventListener("fuzzy-list-sorted",()=>{pt(t,n)}))});let Cd=null;function Id(e){const t=document.createElement("input");return t.setAttribute("type","hidden"),t.setAttribute("name",e.name),t.setAttribute("value",e.value),t}function _d(e,t){if(Qi(e))return;const n=u(document,".js-site-search-form",HTMLFormElement);let s,o;u(document,".js-site-search").classList.toggle("scoped-search",t),t?(s=i(n,"data-scoped-search-url"),o=i(e,"data-scoped-placeholder")):(s=i(n,"data-unscoped-search-url"),o=i(e,"data-unscoped-placeholder")),n.setAttribute("action",s),e.setAttribute("placeholder",o)}Qe(".js-pjax-files",e=>{if(!Cd)return void(Cd=window.location.pathname);const t=e.querySelector(`a[href='${Cd}']`);t&&setTimeout((function(){document.activeElement&&document.activeElement!==document.body||t.focus()}),200),Cd=window.location.pathname}),Qe(".js-highlight-code-snippet-columns",(function(e){const t=function(e){const t=parseInt(i(e,"data-start-line")),n=parseInt(i(e,"data-end-line")),s=parseInt(i(e,"data-start-column")),o=parseInt(i(e,"data-end-column"));return t!==n?null:t===n&&s===o?null:{start:{line:t,column:s},end:{line:n,column:0!==o?o:null}}}(e);null!==t&&function(e,t){const n=xe(e,e=>function(e,t){return e.querySelector(`#LC${t}`)}(t,e));if(n){const e=document.createElement("span");e.classList.add("bg-yellow-3"),Ae(n,e)}}(t,e)})),et("change",".js-scanning-alert-check",(function({currentTarget:e}){const t=o(e,".js-scanning-alert-list"),n=null!=t.querySelector(".js-scanning-alert-check:checked");u(t,".js-scanning-alert-bulk-actions").hidden=!n,u(t,".js-scanning-alert-links").hidden=n,function(e){for(const t of l(e,".js-scanning-bulk-action-items",HTMLElement)){t.innerHTML="";const n=l(e,".js-scanning-alert-list [data-check-all-item]:checked",HTMLInputElement);for(const e of n)t.appendChild(Id(e))}}(t)})),et("details-menu-selected",".js-scanning-code-path-menu",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/scanning.ts:73");const t=i(e.detail.relatedTarget,"data-target-code-path");for(const n of document.querySelectorAll(".js-scanning-code-path"))n.hidden=t!==i(n,"data-code-path")}),{capture:!0}),Qe(".js-codesearch-nav",(function(e){const t=e.querySelector(".selected");if(!(t instanceof HTMLElement))return;const n=t.offsetLeft,s=t.offsetWidth,o=n+s,r=window.innerWidth;(o-e.scrollLeft>r||o<e.scrollLeft)&&(e.scrollLeft=n-r/2+s/2)})),Qe(".js-codesearch-count",(function(e){const t=e.getAttribute("data-search-type");for(const n of document.querySelectorAll(".js-codesearch-deferred-count"))if(t&&n.getAttribute("data-search-type")===t){const t=e.cloneNode(!0);if(!(t instanceof Element))return;t.classList.remove("js-codesearch-count"),n.replaceWith(t)}})),s("keyup",".js-site-search-field",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/search/site.ts:28");const n=0===t.value.length;n&&"Backspace"===e.key&&t.classList.contains("is-clearable")&&_d(t,!1),n&&"Escape"===e.key&&_d(t,!0),t.classList.toggle("is-clearable",n)})),c(".js-site-search-focus",(function(e){const t=o(e,".js-chromeless-input-container");t.classList.add("focus"),e.addEventListener("blur",(function n(){if(t.classList.remove("focus"),!(e instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/search/site.ts:44");0===e.value.length&&e.classList.contains("js-site-search-field")&&_d(e,!0),e.removeEventListener("blur",n)}))})),et("submit",".js-site-search-form",(function(e){if(!(e.target instanceof Element))return;u(e.target,".js-site-search-type-field",HTMLInputElement).value=new URLSearchParams(window.location.search).get("type")||""}));function $d(){const e=document.body;if(!e)throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:10");e.classList.add("is-sending"),e.classList.remove("is-sent","is-not-sent")}function Nd(){const e=document.body;if(!e)throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:16");e.classList.add("is-sent"),e.classList.remove("is-sending")}function Dd(e){const t=document.body;if(!t)throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:27");e&&(u(document,".js-sms-error").textContent=e),t.classList.add("is-not-sent"),t.classList.remove("is-sending")}function Pd(e){const t=u(document,".js-stale-session-flash"),n=u(t,".js-stale-session-flash-signed-in"),s=u(t,".js-stale-session-flash-signed-out");t.hidden=!1,n.hidden="false"===e,s.hidden="true"===e,window.addEventListener("popstate",(function(e){e.state&&null!=e.state.container&&location.reload()})),document.addEventListener("submit",(function(e){e.preventDefault()}))}let Rd;if(d(".js-ems-beta-tag-toggle",(async function(e,t){let n;Re();try{n=await t.json()}catch(o){return void U()}var s;n&&(s=n.json.enrolled,u(document,".js-ems-beta-tag-enrolled").hidden=!s,u(document,".js-ems-beta-tag-unenrolled").hidden=s,window.location.reload())})),et("click",".js-segmented-nav-button",(function(e){e.preventDefault();const t=e.currentTarget,n=i(t,"data-selected-tab"),s=o(t,".js-segmented-nav"),r=s.parentElement;if(!r)throw new Error("invariant: app/assets/modules/github/segmented-nav.ts:10");for(const o of l(s,".js-segmented-nav-button"))o.classList.remove("selected");t.classList.add("selected");for(const o of l(r,".js-selected-nav-tab"))o.parentElement===r&&o.classList.remove("active");u(document,`.${n}`).classList.add("active")})),d(".js-send-auth-code",async(e,t)=>{let n;$d();try{n=await t.text()}catch(s){Dd(s.response.text)}n&&Nd()}),et("click",".js-send-two-factor-code",(async function(e){const t=e.currentTarget;if(!(t instanceof HTMLButtonElement))throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:52");const s=t.form;if(!s)throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:54");const o=`${u(s,".js-country-code-select",HTMLSelectElement).value} ${u(s,".js-sms-number",HTMLInputElement).value}`;if($d(),!(t.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:59");const r=u(t.parentElement,".js-data-url-csrf",HTMLInputElement),a=new FormData;a.append("number",o);try{const e=i(t,"data-url");await n(fe(e,r.value,{method:"post",body:a})),Nd();for(const t of s.querySelectorAll(".js-2fa-enable"))(t instanceof HTMLInputElement||t instanceof HTMLButtonElement)&&(t.disabled=!1);u(s,".js-2fa-otp").focus()}catch(c){if(c.response){Dd(await c.response.text())}for(const e of s.querySelectorAll(".js-2fa-enable"))(e instanceof HTMLInputElement||e instanceof HTMLButtonElement)&&(e.disabled=!0)}})),et("click",".js-enable-enable-two-factor-auth-button",(function(){const e=u(document,".js-enable-two-factor-auth-button",HTMLButtonElement);e.disabled=!1,e.removeAttribute("aria-label"),e.classList.remove("tooltipped")})),Qe(".js-two-factor-sms-fallback-button",(function(e){e.addEventListener("toggle",(function(e){const t=e.currentTarget;if(!(t instanceof Element))throw new Error("invariant: app/assets/modules/github/sessions/two-factor.ts:99");for(const n of t.querySelectorAll(".flash"))n instanceof HTMLElement&&(n.hidden=!0);u(t,".js-configure-sms-fallback").hidden=!1,u(t,".js-verify-sms-fallback").hidden=!0}))})),d(".js-two-factor-set-sms-fallback",async(e,t)=>{let n;try{n=await t.text()}catch(s){const t=u(e,".js-configure-sms-fallback"),n=u(e,".js-verify-sms-fallback"),o=t.hidden?n:t,r=u(o,".flash");switch(s.response.status){case 422:case 429:r.textContent=s.response.text,r.hidden=!1}}if(n)switch(n.status){case 200:case 201:window.location.reload();break;case 202:u(e,".js-configure-sms-fallback").hidden=!0,u(e,".js-verify-sms-fallback").hidden=!1,u(e,".js-fallback-otp").focus()}}),"function"==typeof BroadcastChannel)try{Rd=new BroadcastChannel("stale-session"),Rd.onmessage=e=>{"string"==typeof e.data&&Pd(e.data)}}catch(mp){}if(!Rd){let e=!1;Rd={postMessage(t){e=!0;try{window.localStorage.setItem("logged-in",t)}finally{e=!1}}},window.addEventListener("storage",(function(t){if(!e&&t.storageArea===window.localStorage&&"logged-in"===t.key)try{"true"!==t.newValue&&"false"!==t.newValue||Pd(t.newValue)}finally{window.localStorage.removeItem(t.key)}}))}const Fd=document.querySelector(".js-stale-session-flash[data-signedin]");if(Fd){const e=Fd.getAttribute("data-signedin")||"";Rd.postMessage(e)}function Bd(e){if(!(e instanceof HTMLInputElement))return;const t=e.closest(".checkable-input-container");if(!t)return;const n=t.querySelector(".js-checkable-input-target");n&&(t.classList.toggle("checked",e.checked),n instanceof HTMLElement&&(n.hidden=!e.checked))}document.addEventListener("pjax:end",(function(){const e=document.querySelector('meta[name="selected-link"]'),t=e&&e.getAttribute("value");if(t)for(const n of document.querySelectorAll(".js-sidenav-container-pjax .js-selected-navigation-item")){const e=(n.getAttribute("data-selected-links")||"").split(" ").indexOf(t)>=0;n.classList.toggle("selected",e)}})),Qe(".js-contact-javascript-flag",{constructor:HTMLInputElement,add(e){e.value="true"}}),et("click",".js-launch-sales-chat",(function(e){const t=window.screenX,n=window.screenY,s=440,o=500,r=[`width=${s}`,`height=${o}`,"location=no","resizable=yes","scrollbars=yes",`left=${window.innerWidth+t-(s+16)}`,`top=${window.innerHeight+n-(o-64)}`],i=window.location.pathname.split("/").filter((function(e){return""!==e})).slice(-1)[0];window.open(`https://sales-chat.github.com/${i}`,"Sales_Chat",r.join(",")),e.preventDefault()})),Qe(".js-checkable-input-trigger",Bd),et("change",".js-checkable-input-trigger",e=>Bd(e.target));const Od=["notification_referrer_id","notifications_before","notifications_after","notifications_query"];function Ud(e,t=null){return e.has("notification_referrer_id")?(function(e,t){const n=zd(t);if(!n)return;const s={pathname:n};for(const o of Od){const t=e.get(o);t&&(s[o]=t)}fr("notification_shelf",JSON.stringify(s))}(e,t),function(e){for(const t of Od)e.delete(t);return e}(e)):null}function zd(e){const t=(e=e||window.location.pathname).match(/^(\/[^/]+\/[^/]+\/pull\/[^/]+)/);return t?t[0]:null}async function Wd(e){try{await e.text()}catch(t){}}et("socket:message",".js-notification-indicator",(function(e){const t=e.currentTarget,n=e.detail.data;t.setAttribute("aria-label",n.aria_label),t.setAttribute("data-ga-click",n.ga_click),(t.querySelector(".js-indicator-modifier")||u(t,"span")).setAttribute("class",n.span_class)})),async function(){d(".js-notification-shelf .js-notification-action form",(async function(e,t){if(e.hasAttribute("data-redirect-to-inbox-on-submit")){await Wd(t);const e=u(document,".js-notifications-back-to-inbox",HTMLAnchorElement);e&&e.click()}else Fe(e,e),await Wd(t)}))}(),function(){const e=function(){const e=Ud(new URLSearchParams(window.location.search));if(e){const t=new URL(window.location.href,window.location.origin);return t.search=e.toString(),t.toString()}}();e&&h(null,"",e)}(),Qe(".js-notification-shelf-include-fragment",(function(e){if(!(e instanceof Ze))return;const t=function(e=null){const t=zd(e);if(!t)return pr("notification_shelf"),null;try{const e=mr("notification_shelf");if(!e)return null;const n=JSON.parse(e);if(!n||!n.pathname)throw new Error("Must have a pathname");if(n.pathname!==t)throw new Error("Stored pathname does not match current pathname.");const s={};for(const t of Od)s[t]=n[t];return s}catch(n){return pr("notification_shelf"),null}}();if(!t)return;const n=e.getAttribute("data-base-src");if(!n)return;const s=new URL(n,window.location.origin),o=new URLSearchParams(s.search);for(const[r,i]of Object.entries(t))"string"==typeof i&&o.set(r,i);s.search=o.toString(),e.setAttribute("src",s.toString())}));let Vd=!1;async function Jd(){if(Vd)return;Vd=!0;const e={contexts:u(document,"meta[name=github-keyboard-shortcuts]",HTMLMetaElement).content},t=`/site/keyboard_shortcuts?${new URLSearchParams(e).toString()}`;(await M({content:k(document,t),dialogClass:"hx_Box--overlay--wide container-xl"})).addEventListener("dialog:remove",(function(){Vd=!1}),{once:!0})}et("click",".js-keyboard-shortcuts",Jd),document.addEventListener("keydown",e=>{e.target instanceof Node&&je(e.target)||"?"===P(e)&&Jd()}),Qe(".js-modifier-key",{constructor:HTMLElement,add(e){if(/Macintosh/.test(navigator.userAgent)){let t=e.textContent;t&&(t=t.replace(/ctrl/,"⌘"),t=t.replace(/alt/,"⌥"),e.textContent=t)}}}),Qe(".js-modifier-label-key",{add(e){if(/Macintosh/.test(navigator.userAgent)){let t=i(e,"aria-label");t=t.replace(/ctrl\+/,"cmd-"),t=t.replace(/alt\+/,"option-"),e.setAttribute("aria-label",t)}}}),Qe(".js-site-status-container",{initialize(e){!async function(e){var t,n;const s=(null===(n=null===(t=document.head)||void 0===t?void 0:t.querySelector('meta[name="site-status-api-url"]'))||void 0===n?void 0:n.content)||"",o=await window.fetch(s),r=await o.json(),i=r.status.indicator;if("none"!==i&&e instanceof HTMLElement){u(e,".js-site-status-message").textContent=r.status.description,u(e,".js-site-status-time").setAttribute("datetime",r.page.updated_at);const t="minor"===i?"flash-warn":"flash-error";u(e,".flash").classList.add(t),e.hidden=!1}}(e)}});const Kd=[{sectionName:"actions-events",percent:95},{sectionName:"actions-workflow",percent:100},{sectionName:"actions-workflow-logs",percent:100},{sectionName:"actions-templates",percent:100},{sectionName:"security-vulnerability",percent:60},{sectionName:"security-workspace",percent:70},{sectionName:"security-alerts-graph",percent:60},{sectionName:"security-alerts",percent:60},{sectionName:"security-dependabot",percent:50},{sectionName:"security-patches-graph",percent:70},{sectionName:"security-token-scanning",percent:70},{sectionName:"security-lgtm",percent:60},{sectionName:"mobile-notification",percent:90},{sectionName:"mobile",percent:50},{sectionName:"hide-notification",percent:50},{sectionName:"mobile-triage",percent:50},{sectionName:"mobile-work",percent:50},{sectionName:"mobile-contribute",percent:50},{sectionName:"mobile-nightmode",percent:70},{sectionName:"mobile-beta",percent:50},{sectionName:"enterprise-nav",percent:0},{sectionName:"insights-dashboard",percent:70},{sectionName:"team-hero",percent:50},{sectionName:"team-testimonial",percent:60},{sectionName:"team-collaboration",percent:70},{sectionName:"team-automation",percent:30},{sectionName:"team-security",percent:30},{sectionName:"team-rocket",percent:50},{sectionName:"team-developers",percent:40}];function Gd(e){e.map(({sectionName:e,percent:t})=>{!function(e,t,n,s){const o=window.innerHeight||document.documentElement&&document.documentElement.clientHeight;e.map(e=>{const r=l(document,`.${t}`),i=e.getBoundingClientRect().top,a=e.getBoundingClientRect().bottom,c=Math.round(i/o*100),u=Math.round(a/o*100);c<=s?e.classList.contains(t)?e.classList.add(n):r.map(e=>e.classList.add(n)):(e.classList.remove(n),e.classList.contains(t)||r.map(e=>e.classList.remove(n))),a<=u&&(e.classList.remove(n),e.classList.contains(t)||r.map(e=>e.classList.remove(n)))})}(l(document,`.section-${e}`),`target-${e}`,`animate-${e}`,t)})}function Xd(e){const t=function(e){return l(document,".js-pricing-plan-card").indexOf(e)}(e);return Array.from(l(document,".js-pricing-plan-tab"))[t]}let Yd;function Qd(){const e=window.innerWidth/2;let t=u(document,".js-pricing-plan-card"),n=window.innerWidth;for(const s of Yd){const o=s.getBoundingClientRect().left+s.getBoundingClientRect().width/2,r=Math.abs(e-o);o>0&&o<window.innerWidth&&r<n&&(t=s,n=r)}u(document,".pricing-plan-tab-active").classList.remove("pricing-plan-tab-active"),Xd(t).classList.add("pricing-plan-tab-active")}function Zd(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;if(t.classList.contains("pricing-testimonial-logo-active"))return;const n=function(e){const t=em(e);return Array.from(l(document,".js-pricing-testimonial-quote"))[t]}(t),s=function(e){const t=em(e);return Array.from(l(document,".js-pricing-testimonial-img"))[t]}(t);u(document,".pricing-testimonial-logo-active").classList.remove("pricing-testimonial-logo-active"),t.classList.add("pricing-testimonial-logo-active");for(const o of l(document,".pricing-testimonial-content-active"))o.classList.remove("pricing-testimonial-content-active");n.classList.add("pricing-testimonial-content-active"),s.classList.add("pricing-testimonial-content-active")}function em(e){return l(document,".js-pricing-testimonial-logo").indexOf(e)}window.addEventListener("scroll",()=>Gd(Kd),!1),window.addEventListener("resize",()=>Gd(Kd),!1),window.addEventListener("load",()=>Gd(Kd),!1),et("click",".js-pricing-plan-tab",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;u(document,".pricing-plan-tab-active").classList.remove("pricing-plan-tab-active"),t.classList.add("pricing-plan-tab-active");const n=function(e){const t=function(e){return l(document,".js-pricing-plan-tab").indexOf(e)}(e);return Array.from(l(document,".js-pricing-plan-card"))[t]}(t),s=n.offsetLeft-(window.innerWidth-n.clientWidth)/2;u(document,".js-pricing-plans-container").scrollTo({top:0,left:s,behavior:"smooth"})})),Qe(".js-pricing-plans-container",()=>{u(document,".js-pricing-plans-container").addEventListener("wheel",Qd,{capture:!1,passive:!0}),"ontouchstart"in window&&u(document,".js-pricing-plans-container").addEventListener("scroll",Qd,{capture:!1,passive:!0})}),Qe(".js-pricing-plans-container .js-pricing-plan-card",()=>{Yd=l(document,".js-pricing-plans-container .js-pricing-plan-card")}),et("click",".js-pricing-learn-more-gh1",(function(){for(const e of l(document,".js-pricing-github-one-container"))e.classList.remove("pricing-github-one-container-hidden");for(const e of l(document,".js-pricing-learn-more-container"))e.classList.add("pricing-learn-more-container-collapsed");for(const e of l(document,".js-pricing-github-one-details"))e.classList.remove("pricing-github-one-details-collapsed")})),Qe(".js-pricing-testimonial-logo",()=>{for(const e of l(document,".js-pricing-testimonial-logo"))e.addEventListener("mouseenter",Zd)}),et("click",".js-pricing-testimonial-logo",e=>{Zd(e)}),et("click",".js-toggle-pricing-details",e=>{e.stopPropagation();const t=o(e.currentTarget,".js-pricing-matrix-row");u(t,".js-pricing-matrix-details").classList.toggle("pricing-matrix-details-visible"),u(t,".js-pricing-expand-arrow").classList.toggle("pricing-expand-arrow-open")});const tm=new WeakMap;Qe(".js-insights-hero-block",{add(e){tm.set(e,setTimeout((function t(){const n=l(document,".js-insights-hero-chart"),s=u(document,".js-insights-hero-chart.js-show"),o=n.indexOf(s)+1,r=n[o===n.length?0:o];for(const e of n)e.classList.toggle("js-show",r===e);tm.set(e,setTimeout(t,4e3))}),4e3))},remove(e){const t=tm.get(e);clearTimeout(t)}}),c(".js-skip-password-autofill",e=>{e instanceof HTMLInputElement&&(e.type="password")}),et("click",".js-smoothscroll-anchor",(function(e){const t=e.currentTarget;if(!(t instanceof HTMLAnchorElement))return;const n=Be(document,t.hash);n&&(n.scrollIntoView({behavior:"smooth"}),e.preventDefault())}));const nm={},sm={},om={};let rm=null,im=0,am=null;const cm=[];function lm(e){const t=Date.now();let n=nm[e]||0;const s=om[e];s&&(n=Math.max(n,s[1])),n>0&&t-n<36e5||(cm.push(e),nm[e]=t)}function um(e){for(const t of cm)e.send(`subscribe:${t}`);cm.length=0}function dm(){try{return rm=function(){const e=document.head&&document.head.querySelector("link[rel=web-socket]");if(!(e instanceof HTMLLinkElement))return null;let t;try{t=new WebSocket(e.href)}catch(o){if(o.name&&"SecurityError"!==o.name)throw new Error(`error opening WebSocket: ${o.message} (${o.name})`);return null}function n(){clearTimeout(s),im=0,um(t)}t.addEventListener("open",n);const s=setTimeout((function(){t.removeEventListener("open",n),t.close(),t===rm&&(rm=null)}),4e3);return t.addEventListener("close",mm),t.addEventListener("message",(function(e){const[t,n]=JSON.parse(String(e.data));if(!t||!n)return;const s=sm[t]||[];for(const o of s)nt(o,"socket:message",{data:n,name:t});om[t]=[n,Date.now()]})),t}(),rm}catch(e){throw rm=null,e}}function mm(e){if(!1===navigator.onLine||null==document.querySelector(".js-socket-channel"))return;let t=rm,n=1e3;if(e instanceof CloseEvent&&(n=e.code),e.target instanceof WebSocket&&(t=e.target),im>=5||1008===n||1011===n)return window.removeEventListener("online",mm),void(t&&(t.removeEventListener("close",mm),t.close(1e3,"give-up-reconnects"),t===rm&&(rm=null)));let s=0;1012===n||1013===n?s=100:im>0&&(s=1e3*Math.pow(2,im)),im+=1,am&&clearTimeout(am),am=window.setTimeout(dm,s)}function fm(e){const t=e.getAttribute("data-channel");return t?t.split(/\s+/):[]}function pm(e,t){let{wait:n}=e;return null!=n&&(n-=t,n<=0&&(n=null)),n===e.wait?e:Object.assign({},e,{wait:n})}function gm(e,t,n){const s=e.getBoundingClientRect().height,o=t.getBoundingClientRect(),r=n.getBoundingClientRect();let i=r.top;i+o.height+10>=s&&(i=Math.max(s-o.height-10,0));let a=r.right;null!=n.closest(".js-build-status-to-the-left")&&(a=Math.max(r.left-o.width-10,0)),t.style.top=`${i}px`,t.style.left=`${a}px`,t.style.right="auto"}async function hm(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 s=u(n,".js-status-loader"),o=u(n,".js-status-loading"),r=u(n,".js-status-error"),a=i(s,"data-contents-url");let c;o.classList.remove("d-none"),r.classList.add("d-none");try{await q(),c=await k(document,a)}catch(l){o.classList.add("d-none"),r.classList.remove("d-none")}if(c){s.replaceWith(c),u(n,".js-details-container").classList.add("open");const e=document.body;e&&t&&n.classList.contains("js-append-menu-to-body")&&gm(e,n,t)}}function vm({currentTarget:e}){if(!(e instanceof Element))throw new Error("invariant: app/assets/modules/github/statuses.ts:100");hm(e)}async function bm(e){const t=e.currentTarget;if(!(t instanceof HTMLElement))return;const n=t.getAttribute("data-sudo-required");n&&(e.stopPropagation(),e.preventDefault(),await Te(n)&&(t.removeAttribute("data-sudo-required"),t instanceof HTMLFormElement?m(t):t.click()))}window.WebSocket&&(Qe(".js-socket-channel[data-channel]",{add:function(e){const t=rm||dm();if(t){for(const t of fm(e))lm(t),null==sm[t]&&(sm[t]=[]),sm[t].push(e);t.readyState===WebSocket.OPEN&&um(t)}},remove:function(e){for(const t of fm(e)){const n=sm[t];if(n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}}}),window.addEventListener("online",mm),window.addEventListener("offline",(function(){rm&&rm.close(1e3,"navigator-offline")}))),document.addEventListener("pjax:popstate",(function(e){if(!(e instanceof CustomEvent))return;const t=e.target;if(!(t instanceof Element))return;const n=e.detail.cachedAt;n&&setTimeout(()=>{const e=Date.now();for(const s of t.querySelectorAll(".js-socket-channel[data-channel]"))for(const t of fm(s)){if(!(t in om))continue;const[o,r]=om[t];r<n||nt(s,"socket:message",{data:pm(o,e-r),name:t})}})})),window.addEventListener("visibilitychange",(function(){if(document.hasFocus()){for(const e of document.querySelectorAll(".js-socket-channel[data-channel]"))for(const t of fm(e))lm(t);rm&&rm.readyState===WebSocket.OPEN&&um(rm)}})),Qe("form.js-auto-replay-enforced-sso-request",{constructor:HTMLFormElement,initialize(e){m(e)}}),et("toggle",".js-build-status .js-dropdown-details",(function(e){const t=e.currentTarget,n=t.querySelector(".js-status-dropdown-menu");if(!n)return;function s(){t.hasAttribute("open")||r()}function o(e){n.contains(e.target)||r()}function r(){t.removeAttribute("open"),n.classList.add("d-none"),t.appendChild(n),t.removeEventListener("toggle",s),window.removeEventListener("scroll",o)}t.addEventListener("toggle",s),n.classList.contains("js-close-menu-on-scroll")&&window.addEventListener("scroll",o,{capture:!0,passive:!0}),n.classList.remove("d-none"),u(n,".js-details-container").classList.add("open");const i=document.body;i&&n.classList.contains("js-append-menu-to-body")&&(i.appendChild(n),gm(i,n,t))}),{capture:!0}),et("click",".js-status-retry",({currentTarget:e})=>{hm(e)}),Qe(".js-build-status",{add(e){e.addEventListener("mouseenter",vm,{once:!0})},remove(e){e.removeEventListener("mouseenter",vm)}}),et("click","button[data-sudo-required], summary[data-sudo-required]",bm),Qe("form[data-sudo-required]",{constructor:HTMLFormElement,subscribe:e=>j(e,"submit",bm)});const jm={"actor:":"ul.js-user-suggestions","user:":"ul.js-user-suggestions","operation:":"ul.js-operation-suggestions","org:":"ul.js-org-suggestions","action:":"ul.js-action-suggestions","repo:":"ul.js-repo-suggestions","country:":"ul.js-country-suggestions"};function wm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/audit-log-suggester.ts:21");const{key:t,item:n}=e.detail;if(!ym(t))return;const s=i(n,"data-value");e.detail.value=`${t}${s}`}function Lm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/audit-log-suggester.ts:29");const{key:t,provide:n}=e.detail;if(!ym(t))return;const s=e.target;if(!(s instanceof Element))throw new Error("invariant: app/assets/modules/github/suggesters/audit-log-suggester.ts:34");n(async function(e,t,n){const s=(await Em(e)).querySelector(function(e){const t=jm[e];if(!t)throw new Error(`Unknown audit log expander key: ${e}`);return t}(t));if(!(s instanceof HTMLElement))return{matched:!1};const o=Rn(s,n,{limit:5});return{fragment:s.cloneNode(!0),matched:o>0}}(i(s,"data-audit-url"),t,e.detail.text))}function ym(e){return Object.getOwnPropertyNames(jm).includes(e)}Qe("text-expander[data-audit-url]",{subscribe:e=>_(j(e,"text-expander-change",Lm),j(e,"text-expander-value",wm))});const Em=S((async function(e){const t=await k(document,e),n=document.createElement("div");return n.append(t),n}));const Tm={};function km(e){const t=e.getAttribute("data-emoji-name")||"";return Tm[t]=` ${function(e){return(e.getAttribute("data-text")||"").trim().toLowerCase()}(e).replace(/_/g," ")}`,t}function Mm(e,t){const n=Tm[e].indexOf(t);return n>-1?1e3-n:0}function Sm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/emoji-suggester.ts:53");":"===e.detail.key&&(e.detail.value=function(e){if(e.hasAttribute("data-use-colon-emoji"))return e.getAttribute("data-value");const t=e.firstElementChild;return t&&"G-EMOJI"===t.tagName&&!t.firstElementChild?t.textContent:e.getAttribute("data-value")}(e.detail.item))}function Hm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/emoji-suggester.ts:59");const{key:t,provide:n}=e.detail;if(":"!==t)return;const s=e.target;if(!(s instanceof Element))throw new Error("invariant: app/assets/modules/github/suggesters/emoji-suggester.ts:64");n(async function(e,t){const n=await xm(e),s=function(e,t){return Rn(t,` ${e.toLowerCase().replace(/_/g," ")}`,{limit:5,text:km,score:Mm})}(t,n);return{fragment:n,matched:s>0}}(i(s,"data-emoji-url"),e.detail.text))}Qe("text-expander[data-emoji-url]",{subscribe:e=>_(j(e,"text-expander-change",Hm),j(e,"text-expander-value",Sm))});const xm=S((async function(e){const t=(await k(document,e)).firstElementChild;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/suggesters/emoji-suggester.ts:76");return t}));function Am(e,t,n){const s=new RegExp(`\\b${o=e,o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`);var o;const r=/^\d+$/.test(e)?e=>function(e,t){const n=e.search(t);return n>-1?1e3-n:0}(e,s):t=>Cn(t,e),i=Wi(n.suggestions,e,{limit:5,text:e=>`${e.number} ${e.title.trim().toLowerCase()}`,score:r});return function(e,t,n){const s=e=>{const t=e.type in n?ge(document,n[e.type]):"";return ht`
<li role="option" id="suggester-issue-${e.id}" data-value="${e.number}">
<span class="d-inline-block mr-1">${t}</span> <small>#${e.number}</small> ${e.title}
</li>
`};gt((o=e,ht`
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
${o.map(s)}
</ul>
`),t);var o}(i,t,n.icons),i.length}function qm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/issue-suggester.ts:58");if("#"!==e.detail.key)return;const t=i(e.detail.item,"data-value");e.detail.value=`#${t}`}function Cm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/issue-suggester.ts:65");const{key:t,provide:n}=e.detail;if("#"!==t)return;const s=e.target;if(!(s instanceof Element))throw new Error("invariant: app/assets/modules/github/suggesters/issue-suggester.ts:70");n(async function(e,t){const n=await Im(e),s=document.createElement("div"),o=Am(t,s,n),r=s.firstElementChild;if(!(r instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/suggesters/issue-suggester.ts:79");return{fragment:r,matched:o>0}}(i(s,"data-issue-url"),e.detail.text))}Qe("text-expander[data-issue-url]",{subscribe:e=>_(j(e,"text-expander-change",Cm),j(e,"text-expander-value",qm))});const Im=S(A);function _m(e,t,n){const s=Wi(n,e,{limit:5,score:$m(e).score,text:e=>e.description?`${e.name} ${e.description}`.trim().toLowerCase():`${e.login} ${e.name}`.trim().toLowerCase()});return function(e,t){const n=e=>{const t="user"===e.type?e.login:e.name,n="user"===e.type?e.name:e.description;return ht`
<li role="option" id="suggester-${e.id}-${e.type}-${t}" data-value="${t}">
<span>${t}</span>
<small>${n}</small>
</li>
`};gt((s=e,ht`
<ul role="listbox" class="suggester-container suggester suggestions list-style-none position-absolute">
${s.map(n)}
</ul>
`),t);var s}(s,t),s.length}function $m(e){let t;if(e){const n=e.toLowerCase().split("");t=function(t){if(!t)return 0;const s=function(e,t){let n,s,o,r;const i=function(e,t){let n=0;const s=[];for(;(n=e.indexOf(t,n))>-1;)s.push(n++);return s}(e,t[0]);if(0===i.length)return null;if(1===t.length)return[i[0],1,[]];for(r=null,s=0,o=i.length;s<o;s++){const o=i[s];if(!(n=Nm(e,t,o+1)))continue;const a=n[n.length-1]-o;(!r||a<r[1])&&(r=[o,a,n])}return r}(t,n);if(!s)return 0;let o=e.length/s[1];return o/=s[0]/2+1,o}}else t=()=>2;return{score:t}}function Nm(e,t,n){let s=n;const o=[];for(let r=1;r<t.length;r+=1){if(s=e.indexOf(t[r],s),-1===s)return;o.push(s++)}return o}function Dm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/mention-suggester.ts:124");if("@"!==e.detail.key)return;const t=i(e.detail.item,"data-value");e.detail.value=`@${t}`}function Pm(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/suggesters/mention-suggester.ts:131");const{key:t,provide:n}=e.detail;if("@"!==t)return;const s=e.target;if(!(s instanceof Element))throw new Error("invariant: app/assets/modules/github/suggesters/mention-suggester.ts:136");n(async function(e,t){const n=await Rm(e),s=document.createElement("div"),o=_m(t,s,n),r=s.firstElementChild;if(!(r instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/suggesters/mention-suggester.ts:145");return{fragment:r,matched:o>0}}(i(s,"data-mention-url"),e.detail.text))}Qe("text-expander[data-mention-url]",{subscribe:e=>_(j(e,"text-expander-change",Pm),j(e,"text-expander-value",Dm))});const Rm=S(A);function Fm(e,t){const n=o(e,".js-survey-question-form"),s=u(n,"input.js-survey-other-text",HTMLInputElement);n.classList.toggle("is-other-selected",t),s.hidden=!t,t?(s.required=!0,s.focus()):s.required=!1,nt(s,"change")}function Bm(e,t=e.length){let n=0,s=0;for(let o=0;o<t;o++){const t=e.charCodeAt(o);Um(t)?Om(s)?n+=1:n+=3:t<=127?n+=1:t>=128&&t<=2047?n+=2:t>=2048&&t<=65535&&(n+=3),s=t}return n}function Om(e){return e>=55296&&e<=56319}function Um(e){return e>=56320&&e<=57343}et("change","select.js-survey-select",(function(e){const t=e.currentTarget;Fm(t,t.options[t.selectedIndex].classList.contains("js-survey-option-other"))})),et("change","input.js-survey-radio",(function({currentTarget:e}){Fm(e,e.classList.contains("js-survey-radio-other"))})),et("change","input.js-survey-contact-checkbox",(function(e){const t=e.currentTarget,n=o(t,".js-survey-question-form"),s=u(n,".js-survey-contact-checkbox-hidden");t.checked?s.setAttribute("disabled","true"):s.removeAttribute("disabled")})),et("click",".js-tagsearch-nav-item",e=>{o(e.currentTarget,".js-tagsearch-popover-content").scrollTop=0}),Qe(".js-file-line-container, .js-code-block-container",{constructor:HTMLElement,subscribe(e){const t=document.querySelector(".js-tagsearch-popover");if(!(t instanceof HTMLElement))return{unsubscribe(){}};const n=u(t,".js-tagsearch-popover-content"),s=new WeakMap,o=new WeakMap;let r;async function a(n){const r=function(e,t,n){let s,o;if(document.caretPositionFromPoint){const e=document.caretPositionFromPoint(t,n);e&&(s=e.offsetNode,o=e.offset)}else if(document.caretRangeFromPoint){const e=document.caretRangeFromPoint(t,n);e&&(s=e.startContainer,o=e.startOffset)}if(!s||"number"!=typeof o||s.nodeType!==Node.TEXT_NODE)return;const r=s.textContent;if(!r)return null;const i=function(e,t,n){let s;for(;s=t.exec(e);){const e=s.index+s[0].length;if(s.index<n&&n<e)return[s[0],s.index,e]}return null}(r,e,o);if(!i)return null;const a=document.createRange();return a.setStart(s,i[1]),a.setEnd(s,i[2]),a}(/\w+[!?]?/g,n.clientX,n.clientY);if(!r)return;const a=r.commonAncestorContainer.parentElement;if(!a)throw new Error("invariant: app/assets/modules/github/tagsearch.ts:24");for(const e of a.classList)if(["pl-token","pl-c","pl-s","pl-k"].includes(e))return;const c=r.toString();if(!c||c.match(/\n|\s|[();&.=",]/))return;let u=o.get(a);if(u||(u=new Set,o.set(a,u)),u.has(c))return;u.add(c);let d=i(t,"data-tagsearch-lang");if("HTML+ERB"===d){if(!a.closest(".pl-sre"))return;d="Ruby"}if(e.classList.contains("js-code-block-container")&&(d=function(e){const t=e.closest(".highlight");if(t)for(const n of t.classList)switch(n){case"highlight-source-go":return"Go";case"highlight-source-js":return"JavaScript";case"highlight-source-python":return"Python";case"highlight-source-ruby":return"Ruby";case"highlight-source-ts":return"TypeScript"}return null}(a),!d))return;const m=function(e){let t=e.startContainer,n=1+Bm(t.textContent||"",e.startOffset);for(;;){let e=t.previousSibling;for(;e;)n+=Bm(e.textContent||""),e=e.previousSibling;const s=t.parentElement;if(!s)return[1,1];if(s.classList.contains("js-file-line")){const e=s.previousElementSibling;if(!e)throw new Error("invariant: app/assets/modules/github/tagsearch.ts:290");if(!e.classList.contains("js-line-number"))throw new Error("invariant: app/assets/modules/github/tagsearch.ts:291");return[parseInt(e.getAttribute("data-line-number")||"1",10),n]}t=s}}(r),f=await async function(e,t,n,s){const o=i(e,"data-tagsearch-url"),r=i(e,"data-tagsearch-path"),a=i(e,"data-tagsearch-ref"),c=new URL(o,window.location.origin),l=new URLSearchParams;l.set("q",t),l.set("context",r),l.set("ref",a),l.set("lang",n),l.set("row",s[0].toString()),l.set("col",s[1].toString()),c.search=l.toString();const u=await H(c.toString());return/js-tagsearch-no-definitions/.test(u)?"":u}(t,c,d,m);if(!f)return;const p=document.createElement("span");p.classList.add("pl-token"),p.addEventListener("click",l),p.setAttribute("data-hydro-click",i(t,"data-hydro-click")),p.setAttribute("data-hydro-click-hmac",i(t,"data-hydro-click-hmac")),s.set(p,f),r.surroundContents(p)}function c(){n.scrollTop=0}function l(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;const o=e.currentTarget;if(!(o instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/tagsearch.ts:78");o===r?m():(function(e){r&&r.classList.remove("active");r=e,r.classList.add("active"),n.innerHTML=s.get(e)||"",d(e);const t=e.closest(".js-file-line");t&&function(e){const t=e.id.replace(/^LC/,""),s=n.querySelector(".js-tagsearch-looking-at-def"),o=n.querySelector(".js-tagsearch-defined-on");if(!t||!s||!o)return;i(s,"data-row")===t&&(s.hidden=!1,o.hidden=!0)}(t)}(o),function(){if(!t.hidden)return void c();t.hidden=!1,c(),document.addEventListener("click",p),document.addEventListener("keyup",g),window.addEventListener("resize",f,{passive:!0})}()),e.preventDefault()}function d(e){const n=e.getClientRects()[0]||{bottom:0,left:0};t.style.position="absolute",t.style.top=`${window.scrollY+n.bottom+7}px`,t.style.left=`${window.scrollX+n.left}px`}function m(){t.hidden||(t.hidden=!0,r&&r.classList.remove("active"),r=void 0,document.removeEventListener("click",p),document.removeEventListener("keyup",g),window.removeEventListener("resize",f))}function f(){r instanceof HTMLElement&&d(r)}function p(e){const{target:n}=e;if(n instanceof Node){if(!r)throw new Error("invariant: app/assets/modules/github/tagsearch.ts:151");t.contains(n)||r.contains(n)||m()}}function g(e){switch(e.key){case"Escape":m()}}return e.addEventListener("mousemove",a),{unsubscribe(){e.removeEventListener("mousemove",a)}}}});const zm=new b;const Wm=tt((async function(){const e=u(document,".js-quick-pull-new-branch-name",HTMLInputElement),t=e.value,n=e.getAttribute("data-generated-branch");if(!n)throw new Error("invariant: app/assets/modules/github/template-editor.ts:19");const s=u(document,".js-quick-pull-normalization-info"),o=new FormData;o.append("ref",t);const r=i(e,"data-check-url");if(!(e.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:46");const a=u(e.parentElement,".js-data-check-url-csrf",HTMLInputElement),c=A(fe(r,a.value,{method:"POST",body:o})),l=await zm.push(c);try{!function(o){if(t!==e.value)return;const r=o.normalized_ref;if(s.innerHTML=null==o.message_html?"":o.message_html,!r){u(s,"code").textContent=n}}(l)}catch(d){e.value}}),200);function Vm(){return document.querySelectorAll(".js-template-editor").length>0}function Jm(){return document.querySelectorAll(".js-template-form.is-loading").length>0?"loading":document.querySelectorAll(".js-template-form.is-errored").length>0?"error":"ok"}function Km(){const e=u(document,".js-commit-templates-form",HTMLFormElement),t=u(e,".js-blob-submit",HTMLButtonElement),n=u(document,".js-template-commit-form-error-message"),s=u(document,".js-template-commit-form-loading-message");switch(Jm()){case"loading":n.classList.add("d-none"),s.classList.remove("d-none"),e.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled");break;case"error":n.classList.remove("d-none"),s.classList.add("d-none"),e.setAttribute("disabled","disabled"),t.setAttribute("disabled","disabled");break;default:n.classList.add("d-none"),s.classList.add("d-none"),e.removeAttribute("disabled"),t.removeAttribute("disabled")}}async function Gm(e){e.classList.add("is-loading"),Km();const t=u(e,'[name="filename"]',HTMLInputElement).value,n={};for(const o of l(document,".js-template-form",HTMLFormElement)){const e=u(o,'[name="filename"]',HTMLInputElement).value;n[e]={};for(const[t,s]of pe(o))n[e][t]=s}const s=new FormData(e);s.append("current",t),s.append("templates",JSON.stringify(n));const r=await A(e.action,{method:"POST",body:s}),i=ge(document,r.html);o(e,".js-template-preview").replaceWith(i);const a=u(document,".js-hidden-template-fields"),c=a.querySelector(`[data-filename="${r.filename}"]`);if(c instanceof HTMLInputElement)c.value=r.markdown;else{const e=document.createElement("input");e.type="hidden",e.name=`templates[][${r.filename}]`,e.setAttribute("data-filename",r.filename),e.value=r.markdown,a.append(e)}e.classList.remove("is-loading"),Km()}function Xm(){for(const e of l(document,".js-template-form",HTMLFormElement))Gm(e)}function Ym(e){if(function(e){let t;try{t=new URL(e.url)}catch(n){return!0}return t.host!==window.location.host}(e)||function(e){return/[?&]_pjax=/.test(e.url)}(e))return;const t=function(){const e=document.querySelector(".js-timeline-marker");return null!=e?e.getAttribute("data-last-modified"):null}();t&&e.headers.set("X-Timeline-Last-Modified",t)}function Qm(e){!function(e){const t=e.closest("details, .js-details-container");if(!t)return;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/timeline/progressive.ts:71");"DETAILS"===t.nodeName?t.setAttribute("open","open"):Oe(t)||ue(t)}(e);const t=e.querySelector(`[href='#${e.id}']`);t&&t.click()}function Zm(){return window.location.hash.slice(1)}Qe(".js-template-form .js-issue-labels",{add(e){const t=e.closest(".js-issue-template-labels-container");if(!t)return;const n=u(t,".js-issue-template-labels",HTMLInputElement);n.value="";for(const s of e.children){const e=s.getAttribute("data-name");e&&!n.value.includes(e)&&(""===n.value?n.value=e:n.value=`${n.value}, ${e}`)}}}),Qe(".js-template-form .js-issue-assignees",{add(e){const t=e.closest(".js-issue-template-assignees-container");if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:85");const n=u(t,".js-issue-template-assignees",HTMLInputElement);n.value="";for(const s of e.children){const e=s.querySelector("span");if(e){const t=e.getAttribute("data-assignee-name");t&&!n.value.includes(t)&&(""===n.value?n.value=t:n.value=`${n.value}, ${t}`)}}}}),et("change",".js-quick-pull-choice-option",(function(e){if(!Vm())return;const t=e.currentTarget;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:109");u(document,".js-quick-pull-new-branch-name").toggleAttribute("required","quick-pull"===t.value)})),a(".js-quick-pull-new-branch-name",(function(e){if(!Vm())return;const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:118");const n=t.value;u(document,".js-quick-pull-target-branch",HTMLInputElement).value=n,n.length&&Wm()})),a(".js-synced-template-input",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:128");const n=t.getAttribute("data-sync");if(!n)return;const s=o(t,".js-sync-container"),r=l(s,`[data-sync-with="${n}"]`),i=t.value;if(""!==i.trim()){for(const e of r)e.textContent=t.value;if("name"===n){u(s,".js-sync-filename",HTMLInputElement).value=`${i.replace(/[^\w]/g,"-")}.md`.toLowerCase()}}else for(const o of r){const e=o.getAttribute("data-sync-blank");e&&(o.innerHTML=`<span class="text-gray">${e}</span>`)}})),et("submit",".js-template-form",(function(e){e.preventDefault();const t=e.currentTarget;if(!(t instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:250");Gm(t)})),et("click",".js-toggle-template-commit",(function(){const e=u(document,".js-template-commit-pane");e.classList.toggle("d-none"),e.classList.contains("d-none")||Xm()})),et("submit",".js-commit-templates-form",(function(e){"ok"!==Jm()&&e.preventDefault(),Km()})),et("click",".js-refresh-template-content",(async function(e){const t=e.currentTarget,n=o(t,".js-template-form"),s=u(n,".js-template-content-preview");s.innerHTML='<span class="text-gray">Loading preview...</span>';const r=u(n,".js-template-content-textarea",HTMLTextAreaElement).value,i=t.getAttribute("data-markdown-preview-url");if(!i)return;if(!(t.parentElement instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/template-editor.ts:278");const a=u(t.parentElement,".js-data-markdown-preview-url-csrf",HTMLInputElement),c=new FormData;c.append("markdown",r);const l=await H(fe(i,a.value,{method:"POST",body:c}));s.innerHTML=l})),et("click",".js-custom-template-toggle",e=>{const t=e.target,n=o(t,".js-template-preview"),s=!n.classList.contains("expand-preview");if(function(){const e=document.querySelectorAll(".js-template-preview");for(const t of e)t.classList.remove("expand-preview")}(),s)n.classList.add("expand-preview"),n.scrollIntoView({behavior:"smooth",block:"start"});else{Gm(u(n,".js-template-form",HTMLFormElement))}}),et("click",".js-remove-template-button",(function(e){const t=o(e.target,".js-template-preview"),n=i(t,"data-filename"),s=u(document,".js-hidden-template-fields"),r=u(document,".js-toggle-template-commit",HTMLButtonElement),a=s.querySelector(`[data-filename="${n}"]`);a&&a.remove(),r.disabled=!1,t.remove(),Xm()})),et("click",".js-edit-custom-field-header",(function(e){o(e.target,".js-custom-field-header").classList.toggle("section-focus"),u(document,".js-toggle-template-commit",HTMLButtonElement).disabled=!1})),et("details-menu-selected",".js-add-template",(function(e){const t=u(document,".js-templates-container"),n=u(document,".js-toggle-template-commit",HTMLButtonElement);if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/template-editor.ts:326");const s=e.detail.relatedTarget.getAttribute("data-source");if(!s)return;n.disabled=!1;const o=u(document,`#${s}`);t.insertAdjacentHTML("beforeend",o.innerHTML)}),{capture:!0}),et("change",".js-template-repository-choice",(function(e){const t=e.target,n=t.checked&&""!==t.value,s=t.form;u(s,".js-repository-auto-init-options").classList.toggle("has-removed-contents",n);const r=l(s,".js-template-repository-setting"),a=l(s,".js-template-repository-name-display");if(n){const e=o(t,".js-template-repository-choice-container"),n=u(e,".js-template-repository-name"),r=i(t,"data-owner"),c=s.querySelector(`.js-repository-owner-choice[value="${r}"]`);if(c instanceof HTMLInputElement)c.checked=!0,nt(c,"change");else{const e=u(s,".js-repository-owner-choice.js-repository-owner-is-viewer",HTMLInputElement);e.checked=!0,nt(e,"change")}for(const t of a)t.textContent=n.textContent}else for(const o of a)o.textContent="";for(const o of r)o.hidden=!n})),et("details-menu-selected",".js-timeline-scoping-menu",(async function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/timeline/content-toggle.ts:6");const t=e.detail.relatedTarget;if(!(t instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/timeline/content-toggle.ts:8");const n=i(t,"data-url");let s;!function(e){const t=document.querySelector(".js-new-comment-form");if(!(t instanceof HTMLFormElement))return;const n=t.querySelector("input.js-scope-issue-timeline-input");if(!(n instanceof HTMLInputElement))return;n.value=e?"0":"1"}(t.hasAttribute("data-full-timeline"));try{s=await k(document,n)}catch(o){return}u(document,".js-issue-timeline-container").replaceWith(s)}),{capture:!0}),d(".js-needs-timeline-marker-header",(function(e,t,n){Ym(n)})),et("deprecatedAjaxSend","[data-remote]",(function(e){const{request:t}=e.detail;Ym(t)})),G((function({target:e}){const t=Zm();t&&!e&&async function(e){const t=document.getElementById("js-timeline-progressive-loader");if(!t)return;const n=t.getAttribute("data-timeline-item-src");if(!n)return;const s=new URL(n,window.location.origin),o=new URLSearchParams(s.search.slice(1));let r;o.append("anchor",e),s.search=o.toString();try{r=await k(document,s.toString())}catch(l){return}const i=r.querySelector(".js-timeline-item");if(!i)return;const a=i.getAttribute("data-gid");if(!a)return;const c=document.querySelector(`.js-timeline-item[data-gid='${a}']`);if(c){c.replaceWith(i);const t=document.getElementById(e);t&&Qm(t)}else{const t=document.getElementById("js-progressive-timeline-item-container");t&&t.replaceWith(r);const n=document.getElementById(e);n&&Qm(n)}}(t)})),Qe(".js-timeline-progressive-focus-container",(function(e){const t=Zm();if(!t)return;const n=document.getElementById(t);n&&e.contains(n)&&Qm(n)})),Qe(".js-discussion",(function(){let e=new WeakSet;function t(){e=new WeakSet(document.querySelectorAll(".js-timeline-item"))}t(),document.addEventListener("pjax:end",t),Qe(".js-timeline-item",t=>{t instanceof HTMLElement&&(e.has(t)||Ot(t))})}));function ef(){const e={};e.crossBrowserLoadEvent=Date.now();const t=window.performance&&window.performance.timing;if(t)e.connectEnd=t.connectEnd,e.connectStart=t.connectStart,e.domComplete=t.domComplete,e.domContentLoadedEventEnd=t.domContentLoadedEventEnd,e.domContentLoadedEventStart=t.domContentLoadedEventStart,e.domInteractive=t.domInteractive,e.domLoading=t.domLoading,e.domainLookupEnd=t.domainLookupEnd,e.domainLookupStart=t.domainLookupStart,e.fetchStart=t.fetchStart,e.loadEventEnd=t.loadEventEnd,e.loadEventStart=t.loadEventStart,e.navigationStart=t.navigationStart,e.redirectEnd=t.redirectEnd,e.redirectStart=t.redirectStart,e.requestStart=t.requestStart,e.responseEnd=t.responseEnd,e.responseStart=t.responseStart,e.secureConnectionStart=t.secureConnectionStart,e.unloadEventEnd=t.unloadEventEnd,e.unloadEventStart=t.unloadEventStart;else{const t=function(){const e=mr("navigationStart");if(e)return parseInt(e,10)}();null!=t&&(e.simulatedNavigationStart=t)}const n=function(){if(window.performance&&"timeOrigin"in window.performance&&window.performance.getEntriesByType){const e=window.performance.getEntriesByType("paint");if(e.length){const t=e.find(e=>"first-paint"===e.name);if(t)return Math.round((performance.timeOrigin+t.startTime)/1e6)}}}();return null!=n&&(e.chromeFirstPaintTime=n),e}function tf(e){const t=o(e,".js-topic-save-notice-container"),n=u(t,".js-repo-topics-save-notice");n.classList.remove("d-none"),n.classList.add("d-inline-block","anim-fade-in"),setTimeout(()=>{n.classList.remove("d-inline-block"),n.classList.add("d-none")},1900)}function nf(e){const t=u(e,".js-topic-suggestions-box");t.querySelector(".js-topic-suggestion")||t.remove()}async function sf(e){const t=e.querySelector(".js-topic-suggestions-container");if(!t)return;const n=i(t,"data-url"),s=await k(document,n);t.innerHTML="",t.appendChild(s)}function of(){return u(document,".js-use-security-key",HTMLButtonElement)}function rf(e,t){for(const n of document.querySelectorAll(".js-u2f-message"))n instanceof HTMLElement&&(n.hidden=!0);if(u(document,e).hidden=!1,t){const e=of();e.textContent=i(e,"data-retry-message")}}function af(){return u(document,".js-u2f-auth-form",HTMLFormElement)}async function cf(){try{rf(".js-webauthn-auth-waiting",!1);const e=JSON.parse(i(af(),"data-webauthn-sign-request")),t=await Ve(e);rf(".js-webauthn-auth-success",!1),of().disabled=!0,function(e){const t=af();u(t,".js-u2f-auth-response",HTMLInputElement).value=JSON.stringify(e),m(t)}(t)}catch(e){throw rf(".js-webauthn-auth-error",!0),e}}window.performance&&window.performance.timing||window.addEventListener("pagehide",(function(){fr("navigationStart",Date.now().toString())})),async function(){await w,await new Promise(e=>setTimeout(e));const e=function(){const e=[],t=window.performance;if(t&&t.getEntriesByType)for(const n of t.getEntriesByType("resource")){const t={};e.push(t),"string"==typeof n.name&&(t.name=n.name),"string"==typeof n.entryType&&(t.entryType=n.entryType),"number"==typeof n.startTime&&(t.startTime=n.startTime),"number"==typeof n.duration&&(t.duration=n.duration)}return e}();e.length&&L({resourceTimings:e});const t=function(){const e=[],t=window.performance;if(t&&t.getEntriesByType)for(const s of t.getEntriesByType("navigation")){const t={};e.push(t),"string"==typeof s.entryType&&(t.entryType=s.entryType),"number"==typeof s.startTime&&(t.startTime=s.startTime),"number"==typeof s.duration&&(t.duration=s.duration)}const n=ef();return n&&0===e.length&&e.push({name:location.href,entryType:"navigation",startTime:0,duration:n.loadEventEnd-n.navigationStart,initiatorType:"navigation",nextHopProtocol:"http/1.1",type:"navigate",redirectStart:n.redirectStart,redirectEnd:n.redirectEnd,fetchStart:n.fetchStart,domainLookupStart:n.domainLookupStart,domainLookupEnd:n.domainLookupEnd,connectStart:n.connectStart,connectEnd:n.connectEnd,secureConnectionStart:n.secureConnectionStart,requestStart:n.requestStart,responseStart:n.responseStart,responseEnd:n.responseEnd,unloadEventStart:n.unloadEventStart,unloadEventEnd:n.unloadEventEnd,domInteractive:n.domInteractive,domContentLoadedEventStart:n.domContentLoadedEventStart,domContentLoadedEventEnd:n.domContentLoadedEventEnd,domComplete:n.domComplete,loadEventStart:n.loadEventStart,loadEventEnd:n.loadEventEnd}),e}();t.length&&L({navigationTimings:t})}(),et("click",".js-toggler-container .js-toggler-target",(function(e){if(0!==e.button)return;const t=e.currentTarget.closest(".js-toggler-container");t&&t.classList.toggle("on")})),d(".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")}}),d(".js-accept-topic-form",(async function(e,t){await t.html();const n=o(e,".js-topic-form-area"),s=o(e,".js-topic-suggestion"),r=u(n,".js-template"),i=u(n,".js-tag-input-selected-tags"),a=r.cloneNode(!0),c=u(s,'input[name="input[name]"]',HTMLInputElement).value;u(a,"input",HTMLInputElement).value=c,u(a,".js-placeholder-tag-name").replaceWith(c),a.classList.remove("d-none","js-template"),i.appendChild(a),s.remove(),sf(n),nf(n),tf(e)})),et("click",".js-repo-topics-form-done",(function(){!async function(){const e=u(document,".js-topics-list-container"),t=i(e,"data-url"),n=await k(document,t);e.innerHTML="",e.appendChild(n)}()})),d(".js-decline-topic-form",(async function(e,t){await t.html(),tf(e);const n=o(e,".js-topic-form-area");o(e,".js-topic-suggestion").remove(),sf(n),nf(n)})),d(".js-repo-topics-edit-form",(async function(e,t){const n=o(e,".js-topic-form-area");n.classList.remove("errored"),u(n,".js-topic-error").textContent="";for(const o of n.querySelectorAll(".js-tag-input-tag.invalid-topic"))o.classList.remove("invalid-topic");try{await t.json(),tf(e),sf(n)}catch(s){const t=s.response.json;if(t.message&&(n.classList.add("errored"),u(n,".js-topic-error").textContent=t.message),t.invalidTopics){const n=l(e,".js-topic-input",HTMLInputElement);for(const e of t.invalidTopics)for(const t of n)if(t.value===e){o(t,".js-tag-input-tag").classList.add("invalid-topic")}}}})),et("tags:changed",".js-repo-topics-edit-form",(function(e){const t=e.target;m(t)})),et("click",".js-reveal-hidden-topics",(function(e){const t=e.target,n=o(t,".js-hidden-topics-container").querySelector(".js-hidden-topics");n&&(n.classList.remove("d-none"),t.remove())})),et("click",".js-hide-content-attachment",(function(e){e.preventDefault(),function(e){const t=o(e,".js-content-attachment"),n=o(e,"[data-unfurl-hide-url]"),s=i(n,"data-unfurl-hide-url"),r=u(n,".js-data-unfurl-hide-url-csrf",HTMLInputElement),a=i(e,"data-id"),c=new XMLHttpRequest;c.onload=function(){c.status>=200&&c.status<300&&t.remove()},c.open("POST",s);const l=new FormData;l.append("id",a),l.append("authenticity_token",r.value),c.send(l)}(e.currentTarget)})),Qe(".js-content-attachment .max--md",(function(e){const t=u(e,".markdown-body");var n;(t.clientHeight<188||""===((n=t).textContent||"").trim()&&1===(n.querySelectorAll("img")||[]).length)&&(e.classList.remove("max--md"),u(e,".Details-content--closed").hidden=!0,u(e,".Details-content--open").hidden=!0)})),window.requestIdleCallback(()=>{const e=function(){if("Intl"in window)try{return(new window.Intl.DateTimeFormat).resolvedOptions().timeZone}catch(mp){}}();e&&co("tz",encodeURIComponent(e))}),Qe(".js-webauthn-support",{constructor:HTMLInputElement,add:function(e){y(e,Ue())}}),Qe(".js-webauthn-iuvpaa-support",{constructor:HTMLInputElement,add:function(e){!async function(){y(e,await ze())}()}}),Qe(".js-u2f-auth-form-body",(function(e){if(!e)return;const t=We();if(e.classList.toggle("unavailable",!t),t){const e=of();e.hidden=!1,e.classList.contains("js-webauthn-autofocus")&&e.focus()}})),et("click",".js-use-security-key",(function(e){!function(e){e&&e.preventDefault(),We()&&cf()}(e)}));function lf(){let e=[];try{e=(window.localStorage.getItem("dismissed_prompts")||"").split(",")}catch(mp){}return e}let uf=class SignupPromptController extends HTMLElement{get promptType(){return this.getAttribute("data-prompt")||""}connectedCallback(){this.hidden=lf().includes(this.promptType)}dismiss(){try{const e=lf().concat(this.promptType||[]);window.localStorage.setItem("dismissed_prompts",e.join(","))}catch(mp){}finally{this.hidden=!0}}};if(uf=or([ar],uf),he("PAGE_STALE_CHECK")){window.addEventListener("beforeunload",(function(){if(Object.keys(Je).length>0){const e=history.state||{};e.staleRecords=Je,h(e,"",location.href)}}));try{!async function(){if(history.state&&history.state.staleRecords){await p;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&&E(t,n,!0)}h(null,"",location.href)}}()}catch(mp){}}et("socket:message",".js-updatable-content",(function(e){const{gid:t,wait:n}=e.detail.data||{},s=e.target;let o;if(t&&s.getAttribute("data-gid")===t?o=e.target:t?o=s.querySelector(`[data-url][data-gid="${t}"]`):e.currentTarget===s&&(o=s),!(o instanceof HTMLElement))return;const r=ke.bind(null,o);null==n?r("live-update"):setTimeout(r,n,"delayed-live-update")})),et("upload:setup",".js-upload-avatar-image",(function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-alambic-organization"),s=e.currentTarget.getAttribute("data-alambic-owner-type"),o=e.currentTarget.getAttribute("data-alambic-owner-id");n&&t.append("organization_id",n),s&&t.append("owner_type",s),o&&t.append("owner_id",o)})),et("upload:complete",".js-upload-avatar-image",(function(e){const{attachment:t}=e.detail,n=`/settings/avatars/${t.id}`;M({content:k(document,n)})}));class df{constructor(e){this.dataview=new DataView(e),this.pos=0}static fromFile(e){return new Promise((function(t,n){const s=new FileReader;s.onload=function(){if(!(s.result instanceof ArrayBuffer))throw new Error("invariant: app/assets/modules/github/png-scanner.ts:35");t(new df(s.result))},s.onerror=function(){n(s.error)},s.readAsArrayBuffer(e)}))}advance(e){this.pos+=e}readInt(e){const t=this,n=function(){switch(e){case 1:return t.dataview.getUint8(t.pos);case 2:return t.dataview.getUint16(t.pos);case 4:return t.dataview.getUint32(t.pos);default:throw new Error("bytes parameter must be 1, 2 or 4")}}();return this.advance(e),n}readChar(){return this.readInt(1)}readShort(){return this.readInt(2)}readLong(){return this.readInt(4)}readString(e){const t=[];for(let n=0;n<e;n++)t.push(String.fromCharCode(this.readChar()));return t.join("")}scan(e){if(2303741511!==this.readLong())throw new Error("invalid PNG");for(this.advance(4);;){const t=this.readLong(),n=this.readString(4),s=this.pos+t+4;if(!1===e.call(this,n,t)||"IEND"===n)break;this.pos=s}}}function mf(e,t){const n=e.value.substring(0,e.selectionStart||0),s=e.value.substring(e.selectionEnd||0),o=0===n.length||n.match(/\n$/)?"":"\n",r=n+o+t;e.value=r+s,e.selectionStart=r.length,e.selectionEnd=e.selectionStart,e.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})),e.focus()}function ff(e){const t=e.dataTransfer;if(!t)return;if(function(e){return Array.from(e.types).indexOf("Files")>=0}(t))return;if(!vf(t))return;const n=bf(t);if(!n.some(wf))return;e.stopPropagation(),e.preventDefault();const s=e.currentTarget;s instanceof HTMLTextAreaElement&&mf(s,n.map(hf).join(""))}function pf(e){const t=e.dataTransfer;t&&(t.dropEffect="link")}function gf(e){const t=e.clipboardData;if(!t||!vf(t))return;const n=bf(t);if(!n.some(wf))return;e.stopPropagation(),e.preventDefault();const s=e.currentTarget;s instanceof HTMLTextAreaElement&&mf(s,n.map(hf).join(""))}function hf(e){return wf(e)?`\n![](${e})\n`:e}function vf(e){return Array.from(e.types).indexOf("text/uri-list")>=0}function bf(e){return(e.getData("text/uri-list")||"").split("\r\n")}const jf=/\.(gif|png|jpe?g)$/i;function wf(e){return jf.test(e)}function Lf(e){const t=e.dataTransfer;if(!t)return;if(function(e){return Array.from(e.types).indexOf("Files")>=0}(t))return;const n=Mf(t);if(!n)return;e.stopPropagation(),e.preventDefault();const s=e.currentTarget;s instanceof HTMLTextAreaElement&&mf(s,kf(n))}function yf(e){const t=e.dataTransfer;t&&(t.dropEffect="copy")}function Ef(e){if(!e.clipboardData)return;const t=Mf(e.clipboardData);if(!t)return;e.stopPropagation(),e.preventDefault();const n=e.currentTarget;n instanceof HTMLTextAreaElement&&mf(n,kf(t))}function Tf(e){return(e.textContent||"").trim().replace(/\|/g,"\\|").replace(/\n/g," ")||" "}function kf(e){const t=Array.from(e.querySelectorAll("tr")),n=t.shift();if(!n)return"";const s=(o=n,Array.from(o.querySelectorAll("td, th")).map(Tf));var o;const r=s.map(()=>"--");return`\n${`${s.join(" | ")}\n${r.join(" | ")}\n`}${t.map(e=>Array.from(e.querySelectorAll("td")).map(Tf).join(" | ")).join("\n")}\n\n`}function Mf(e){if(-1===Array.from(e.types).indexOf("text/html"))return null;const t=e.getData("text/html");if(!/<table/i.test(t))return null;const n=function(e){const t=document.createElement("div");return t.innerHTML=e,t.querySelector("table")}(t);return!n||n.closest("[data-paste-markdown-skip]")?null:n}function Sf(e){const t=e.clipboardData;if(!t||!function(e){return Array.from(e.types).indexOf("text/x-gfm")>=0}(t))return;const n=e.currentTarget;if(!(n instanceof HTMLTextAreaElement))return;const s=t.getData("text/x-gfm");s&&(e.stopPropagation(),e.preventDefault(),mf(n,s))}function Hf(e){return`${e.isImage()?"!":""}[Uploading ${e.file.name}…]()`}Qe(".js-paste-markdown",{constructor:HTMLElement,subscribe:function(e){return function(e){e.addEventListener("dragover",yf),e.addEventListener("drop",Lf),e.addEventListener("paste",Ef)}(e),function(e){e.addEventListener("dragover",pf),e.addEventListener("drop",ff),e.addEventListener("paste",gf)}(e),function(e){e.addEventListener("paste",Sf)}(e),{unsubscribe:()=>{!function(e){e.removeEventListener("dragover",yf),e.removeEventListener("drop",Lf),e.removeEventListener("paste",Ef)}(e),function(e){e.removeEventListener("dragover",pf),e.removeEventListener("drop",ff),e.removeEventListener("paste",gf)}(e),function(e){e.removeEventListener("paste",Sf)}(e)}}}});function xf(e){const t=o(e,"form",HTMLFormElement);return u(t,"#release_id",HTMLInputElement).value}et("upload:setup",".js-upload-markdown-image",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/markdown.ts:34");const t=u(e.currentTarget,".js-comment-field",HTMLTextAreaElement);t.setCustomValidity("uploading"),me(t,`${Hf(e.detail.attachment)}\n`)})),et("upload:complete",".js-upload-markdown-image",(async function(e){const{attachment:t}=e.detail,n=u(e.currentTarget,".js-comment-field",HTMLTextAreaElement),s=t.isImage()?await async function(e){const t=await async function(e){var t;const n={width:0,height:0,ppi:0};try{return null!==(t=await async function(e){if("image/png"!==e.type)return null;const t=e.slice(0,10240,e.type),n=await df.fromFile(t),s={width:0,height:0,ppi:1};return n.scan((function(e){switch(e){case"IHDR":return s.width=this.readLong(),s.height=this.readLong(),!0;case"pHYs":{const e=this.readLong(),t=this.readLong();let n;return 1===this.readChar()&&(n=.0254),n&&(s.ppi=Math.round((e+t)/2*n)),!1}case"IDAT":return!1}return!0})),s}(e))&&void 0!==t?t:n}catch(s){return n}}(e.file),n=(o=e.file.name,function(e){return e.replace(/[[\]\\"<>&]/g,".").replace(/\.{2,}/g,".").replace(/^\.|\.$/gi,"")}(o).replace(/\.[^.]+$/,"").replace(/\./g," ")),s=e.href;var o;if(144===t.ppi){return`<img width="${Math.round(t.width/2)}" alt="${n}" src="${s}">`}return`![${n}](${s})`}(t):function(e){return`[${e.file.name}](${e.href})`}(t);n.setCustomValidity(""),Ke(n,Hf(t),s)})),et("upload:error",".js-upload-markdown-image",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/markdown.ts:71");const t=u(e.currentTarget,".js-comment-field",HTMLTextAreaElement),n=Hf(e.detail.attachment);t.setCustomValidity(""),Ke(t,n,"")})),et("upload:invalid",".js-upload-markdown-image",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/markdown.ts:78");const t=u(e.currentTarget,".js-comment-field",HTMLTextAreaElement),n=Hf(e.detail.attachment);t.setCustomValidity(""),Ke(t,n,"")})),et("upload:setup",".js-upload-marketplace-listing-screenshot",(function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-marketplace-listing-id");n&&t.append("marketplace_listing_id",n)})),et("upload:complete",".js-upload-marketplace-listing-screenshot",(async function(e){const t=i(e.currentTarget,"data-screenshots-url"),n=u(document,".js-marketplace-listing-screenshots-container"),s=await k(document,t);n.innerHTML="",n.appendChild(s)})),et("upload:setup",".js-upload-marketplace-listing-hero-card-background",(function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-marketplace-listing-id");n&&t.append("marketplace_listing_id",n)})),et("upload:complete",".js-upload-marketplace-listing-hero-card-background",(function(e){const{attachment:t}=e.detail;u(document,".js-marketplace-listing-hero-card-background-id",HTMLInputElement).value=t.id,u(document,".js-hero-listing-container").style.backgroundImage=`url(${t.href})`})),et("click",".js-release-remove-file",(function(e){const t=o(e.currentTarget,".js-release-file");t.classList.add("delete"),u(t,"input.destroy",HTMLInputElement).value="true"})),et("click",".js-release-undo-remove-file",(function(e){const t=o(e.currentTarget,".js-release-file");t.classList.remove("delete"),u(t,"input.destroy",HTMLInputElement).value=""}));let Af=null;function qf(e,t){t.append("release_id",xf(e));const n=l(document,".js-releases-field .js-release-file.delete .id",HTMLInputElement);if(n.length){const e=n.map(e=>e.value);t.append("deletion_candidates",e.join(","))}}et("release:saved",".js-release-form",(function(e){const t=e.currentTarget;Af=null;let n=!1;for(const o of t.querySelectorAll(".js-releases-field .js-release-file"))o.classList.contains("delete")?o.remove():o.classList.contains("js-template")||(n=!0);const s=u(t,".js-releases-field");s.classList.toggle("not-populated",!n),s.classList.toggle("is-populated",n)})),et("upload:setup",".js-upload-release-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/release-file.ts:47");const{form:t,preprocess:n}=e.detail,s=e.currentTarget;if(xf(s))return void qf(s,t);if(!Af){const e=u(document,".js-save-draft",HTMLButtonElement);Af=yd(e)}const o=qf.bind(null,s,t);n.push(Af.then(o))})),et("upload:start",".js-upload-release-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/release-file.ts:65");const t=e.detail.policy;u(e.currentTarget,".js-upload-meter").classList.remove("d-none");const n=t.asset.replaced_asset;if(n)for(const s of l(document,".js-releases-field .js-release-file .id",HTMLInputElement))Number(s.value)===n&&o(s,".js-release-file").remove()})),et("upload:complete",".js-upload-release-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/release-file.ts:80");const{attachment:t}=e.detail,n=u(document,".js-releases-field"),s=u(n,".js-template").cloneNode(!0);s.classList.remove("d-none","js-template"),u(s,"input.id",HTMLInputElement).value=t.id;const o=t.name||t.href.split("/").pop();for(const i of s.querySelectorAll(".js-release-asset-filename"))i instanceof HTMLInputElement?i.value=o:i.textContent=o;const r=`(${(t.file.size/1048576).toFixed(2)} MB)`;u(s,".js-release-asset-filesize").textContent=r,n.appendChild(s),n.classList.remove("not-populated"),n.classList.add("is-populated"),u(e.currentTarget,".js-upload-meter").classList.add("d-none")})),et("upload:progress",".js-upload-release-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/release-file.ts:106");const{attachment:t}=e.detail;u(e.currentTarget,".js-upload-meter").style.width=`${t.percent}%`})),et("upload:setup",".js-upload-repository-image",(function(){u(document,".js-remove-repository-image-button").hidden=!0})),et("upload:complete",".js-upload-repository-image",(function(e){const{attachment:t}=e.detail;u(document,".js-repository-image-id",HTMLInputElement).value=t.id,u(document,".js-remove-repository-image-button").hidden=!1,u(document,".js-repository-image-container").style.backgroundImage=`url(${t.href})`}));let Cf=null;const If=new WeakMap;function _f(e){e.classList.remove("is-progress-bar");const t=o(e,".js-upload-manifest-file-container");u(t,".js-upload-progress").classList.remove("active"),u(t,".js-upload-meter-text .js-upload-meter-filename").textContent=""}function $f(e){_f(e.currentTarget)}function Nf(e){return u(e,'[role="tablist"] [role="tab"][aria-selected="true"]')}function Df(e){const t=l(e,'[role="tablist"] [role="tab"]'),n=Nf(e);return l(e,'[role="tabpanel"]',HTMLElement)[Array.from(t).indexOf(n)]}function Pf(e){const t=e.querySelector(".js-emoji-picker-filter"),n=u(e,".js-emoji-picker-filter-tab-button"),s=u(e,".js-emoji-picker-all-emoji");t instanceof HTMLInputElement&&(t.value=""),s.setAttribute("value",""),n.hidden=!0}function Rf(e){e.classList.add("selected-emoji")}function Ff(e){if(!(e.target instanceof HTMLElement))return;const t=e.target.closest(".js-emoji-picker");if(t&&t instanceof HTMLElement&&!t.hidden)switch(e.key){case"ArrowRight":case"ArrowLeft":case"ArrowUp":case"ArrowDown":e.preventDefault(),function(e,t){const n=Df(e),s=Array.from(n.querySelectorAll(".js-emoji-button")),o=n.querySelector(".selected-emoji.js-emoji-button"),r=function(e){let t,n=0;const s=e[0].getBoundingClientRect().top;for(const o of e){if(t=o.getBoundingClientRect(),s<t.top)break;n+=1}return n}(s),i=function(e,t){const n=[[]];let s=0;for(let o=0;o<e.length;o++){const r=e[o];o>0&&o%t==0&&(s+=1,n.push([])),n[s].push(r)}return n}(s,r);let a=0,c=0;if(o){const e=function(e,t){let n=0,s=0,o=[],r=-1;for(let i=0;i<e.length;i++){if(o=e[i],r=o.indexOf(t),r>-1){s=r;break}n+=1}return{row:n,col:s}}(i,o);switch(a=e.row,c=e.col,o.classList.remove("selected-emoji"),t){case"ArrowRight":c+=1;break;case"ArrowDown":a+=1;break;case"ArrowLeft":c-=1;break;case"ArrowUp":a-=1}}const l=i.length-1,u=c>i[l].length-1,d=a===l;a<0?(a=l,u&&(a-=1)):(a>l||d&&u&&"ArrowDown"===t)&&(a=0);const m=i[a].length-1;c<0?c=m:c>m&&(c=0);const f=i[a][c];Rf(f),f.focus()}(t,e.key)}}function Bf(e){e.hidden=!0,document.removeEventListener("keydown",Ff)}function Of(e){document.addEventListener("click",t=>{if(t.target instanceof HTMLElement){t.target.closest(".js-emoji-picker")!==e&&Bf(e)}});const t=u(e,".js-emoji-picker-all-emoji"),n=u(e,".js-emoji-picker-no-results"),s=u(e,".js-emoji-picker-results-header");t.addEventListener("fuzzy-list-sorted",e=>{const o=Number(e.detail)>0;n.hidden=o,t.hidden=!o,s.hidden=!o});const r=e.querySelector(".js-emoji-picker-filter");r instanceof HTMLInputElement&&r.addEventListener("input",()=>function(e){const t=o(e,".js-emoji-picker"),n=Nf(t),s=u(t,".js-emoji-picker-filter-tab-button",HTMLButtonElement);if(u(t,".js-emoji-picker-all-emoji").setAttribute("value",e.value),n.classList.contains("js-emoji-picker-filter-tab-button")||n.classList.add("emoji-picker-prior-selected-tab-button"),e.value){s.hidden=!1,"true"===s.getAttribute("aria-selected")||(s.click(),e.focus())}else{s.hidden=!0;const e=t.querySelector(".emoji-picker-prior-selected-tab-button");e instanceof HTMLButtonElement&&e.click()}}(r))}function Uf(e){return u(e,".js-user-status-details").hasAttribute("open")}function zf(e){const t=e.querySelector(".js-emoji-picker");t instanceof HTMLElement&&(!function(e){const t=u(e,".js-original-emoji-category"),n=u(e,".js-original-emoji-category-tab",HTMLElement),s=Nf(e),o=Df(e),r=e.querySelector(".js-originally-selected-emoji");if(r){const t=e.querySelector(".selected-emoji");t&&t.classList.remove("selected-emoji"),r.classList.add("selected-emoji")}s.removeAttribute("aria-selected"),t.setAttribute("aria-selected","true"),o.hidden=!0,n.hidden=!1}(t),Pf(t),Bf(t))}function Wf(e){const t=u(e,".js-user-status-original-emoji"),n=u(e,".js-user-status-custom-emoji"),s=u(e,".js-user-status-no-emoji-icon");n.innerHTML=t.innerHTML,s.hidden=n.hasChildNodes()}function Vf(e,t){Wf(e),function(e,t){const n=e.querySelector(".js-user-status-emoji-picker");if(!(n instanceof window.IncludeFragmentElement))return;const s=i(n,"data-url");if(t){const e=new URL(s,window.location.origin),t=new URLSearchParams(e.search.slice(1));t.append("show_picker","1"),e.search=t.toString()}n.setAttribute("src",s.toString())}(e,t),function(e){const t=e.querySelector(".js-user-status-org-picker");if(!(t instanceof window.IncludeFragmentElement))return;const n=i(t,"data-url");t.src=n.toString()}(e)}function Jf(e){const t=u(e,".js-user-status-suggestions"),n=u(e,".js-user-status-message-field",HTMLInputElement).value.trim().length>0;t.classList.toggle("collapsed",n),t.setAttribute("aria-expanded",n.toString())}function Kf(e,t){Uf(e)?function(e){const t=u(e,".js-user-status-message-field",HTMLInputElement);Wf(e),zf(e),t.value=t.defaultValue,io(e)}(e):Vf(e,t),Qf(e)}function Gf(e,t){u(e,".js-user-status-custom-emoji").innerHTML=t.innerHTML,u(e,".js-user-status-no-emoji-icon").hidden=!0}function Xf(e,t){u(e,".js-user-status-emoji-field",HTMLInputElement).value=t.value}function Yf(e,t){if("Escape"===P(t)){const t=e.closest(".js-user-status-container");if(!(t instanceof HTMLElement))return;e.value=e.defaultValue,Kf(t,!1)}}function Qf(e){const t=u(e,".js-user-status-submit",HTMLButtonElement),n=u(e,".js-clear-user-status-button",HTMLButtonElement),s=u(e,".js-user-status-message-field",HTMLInputElement),o=u(e,".js-user-status-emoji-field",HTMLInputElement),r=s.value.trim(),i=o.value.trim();let a=!1,c=!1;var l;oo(l=s)-W(l.value)<0&&(a=!0),r.length<1&&i.length<1&&(a=!0,n.classList.contains("js-user-status-exists")||(c=!0)),t.disabled=a,n.disabled=c}function Zf(e){return o(e,".js-user-status-container")}function ep(e,t){if(Uf(e))return;const n=e.querySelectorAll(".js-toggle-user-status-edit.Details-content--closed");for(const s of n)s.classList.toggle("text-blue",t),s.classList.toggle("link-gray-dark",!t)}function tp(e){if(!(e.target instanceof Element))return;ep(o(e.target,".js-user-status-container"),!0)}function np(e){if(!(e.target instanceof Element))return;ep(o(e.target,".js-user-status-container"),!1)}function sp(e){const t=e.currentTarget;T(t)?function(e){const t=e.getAttribute("data-warn-unsaved-changes")||"Changes you made may not be saved.";window.onbeforeunload=function(e){return e.returnValue=t,t}}(t):op()}function op(){window.onbeforeunload=null}function rp({currentTarget:e}){e.hasAttribute("open")||op()}function ip(e){const t=e.currentTarget;if(!t.closest("details[open]"))return;let n=!0;const s=l(t,"form[data-warn-unsaved-changes]",HTMLFormElement);for(const o of s)if(T(o)){const e=i(o,"data-warn-unsaved-changes");n=confirm(e);break}n||e.preventDefault()}et("file-attachment-accept",".js-upload-manifest-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:34");const{attachments:t}=e.detail,n=parseInt(e.currentTarget.getAttribute("data-directory-upload-max-files")||"",10);t.length>n&&(e.preventDefault(),e.currentTarget.classList.add("is-too-many"))})),et("document:drop",".js-upload-manifest-tree-view",(async function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:43");const{transfer:t}=e.detail,n=e.currentTarget,s=await vt.traverse(t,!0),o=u(document,"#js-repo-pjax-container");o.addEventListener("pjax:success",()=>{u(o,".js-upload-manifest-file",bt).attach(s)},{once:!0});const r=i(n,"data-drop-url");D({url:r,container:o})})),et("upload:setup",".js-upload-manifest-file",(async function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:56");const{batch:t,form:n,preprocess:s}=e.detail,r=e.currentTarget;function i(){n.append("upload_manifest_id",If.get(r))}if(function(e,t){const n=o(e,".js-upload-manifest-file-container"),s=u(n,".js-upload-progress");s.classList.add("active"),e.classList.add("is-progress-bar");const r=u(s,".js-upload-meter-text");u(r,".js-upload-meter-range-start").textContent=String(t.uploaded()+1),u(r,".js-upload-meter-range-end").textContent=String(t.size)}(r,t),If.get(r))return void i();if(Cf)return void s.push(Cf.then(i));const a=o(r,".js-upload-manifest-file-container").querySelector(".js-upload-manifest-form");Cf=A(a.action,{method:a.method,body:new FormData(a)});const[c,l]=function(){let e;return[new Promise(t=>{e=t}),e]}();s.push(c.then(i));const d=await Cf,m=u(document,".js-manifest-commit-form",HTMLFormElement).elements.namedItem("manifest_id");if(!(m instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:88");m.value=d.upload_manifest.id,If.set(r,d.upload_manifest.id),Cf=null,l()})),et("upload:start",".js-upload-manifest-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:103");const{attachment:t,batch:n}=e.detail,s=o(e.currentTarget,".js-upload-manifest-file-container"),r=u(s,".js-upload-progress"),i=u(r,".js-upload-meter-text");u(i,".js-upload-meter-range-start").textContent=n.uploaded()+1,u(i,".js-upload-meter-filename").textContent=t.fullPath})),et("upload:complete",".js-upload-manifest-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:114");const{attachment:t,batch:n}=e.detail,s=u(document,".js-manifest-commit-file-template",HTMLTableElement).rows[0].cloneNode(!0);u(s,".name").textContent=t.fullPath;const o=t.id,r=u(s,".js-remove-manifest-file-form",HTMLFormElement).elements.namedItem("file_id");if(!(r instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:124");r.value=o;const i=u(document,".js-manifest-file-list");i.classList.remove("d-none"),e.currentTarget.classList.add("is-file-list"),u(document,".js-upload-progress").classList.add("is-file-list"),u(i,".js-manifest-file-list-root").appendChild(s),n.isFinished()&&_f(e.currentTarget)})),et("upload:progress",".js-upload-manifest-file",(function(e){if(!(e instanceof CustomEvent))throw new Error("invariant: app/assets/modules/github/upload/upload-manifest-file.ts:139");const{batch:t}=e.detail,n=o(e.currentTarget,".js-upload-manifest-file-container");u(n,".js-upload-meter").style.width=`${t.percent()}%`})),et("upload:error",".js-upload-manifest-file",$f),et("upload:invalid",".js-upload-manifest-file",$f),d(".js-remove-manifest-file-form",(async function(e,t){await t.html();const n=o(e,".js-manifest-file-list-root");if(o(e,".js-manifest-file-entry").remove(),!n.hasChildNodes()){o(n,".js-manifest-file-list").classList.add("d-none"),u(document,".js-upload-manifest-file").classList.remove("is-file-list"),u(document,".js-upload-progress").classList.remove("is-file-list")}})),Qe(".js-manifest-ready-check",{initialize(e){!async function(e){const t=i(e,"data-redirect-url");try{await z(i(e,"data-poll-url")),window.location.href=t}catch(n){u(document,".js-manifest-ready-check").classList.add("d-none"),u(document,".js-manifest-ready-check-failed").classList.remove("d-none")}}(e)}}),et("upload:setup",".js-upload-enterprise-installation-user-accounts-upload",(function(e){const{form:t}=e.detail,n=e.currentTarget.getAttribute("data-business-id");n&&t.append("business_id",n);const s=e.currentTarget.getAttribute("data-enterprise-installation-id");s&&t.append("enterprise_installation_id",s)})),et("upload:complete",".js-upload-enterprise-installation-user-accounts-upload",(function(e){const{attachment:t}=e.detail,n=u(e.currentTarget,".js-enterprise-installation-user-accounts-upload-id",HTMLInputElement);n.value=t.id;const s=u(e.currentTarget,".js-enterprise-installation-id",HTMLInputElement),o=e.currentTarget.getAttribute("data-enterprise-installation-id");o&&(s.value=o);const r=n.form;r&&r.submit()})),et("click",".js-user-status-expire-button",(function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&function(e,t){const n=u(e,".js-user-status-expiration-interval-selected"),s=u(e,".js-user-status-expire-drop-down"),o=u(e,".js-user-status-expiration-date-input",HTMLInputElement);n.textContent=t.title,o.value=t.value,s.removeAttribute("open")}(Zf(t),t)})),et("click",".js-toggle-user-status-edit",(function(e){if(!(e.currentTarget instanceof HTMLElement))return;const t=Zf(e.currentTarget);e.target instanceof HTMLElement&&Kf(t,!!e.target.closest(".js-toggle-user-status-emoji-picker"))})),et("click",".js-toggle-user-status-emoji-picker",(function(e){if(!(e.currentTarget instanceof HTMLElement))return;const t=Zf(e.currentTarget).querySelector(".js-emoji-picker");t instanceof HTMLElement&&t.hidden&&setTimeout(()=>function(e){const t=e.querySelector(".js-emoji-picker-filter"),n=!e.hidden;e.hidden=n,n?(t instanceof HTMLInputElement&&(t.value=""),document.removeEventListener("keydown",Ff)):(t instanceof HTMLInputElement&&t.focus(),document.addEventListener("keydown",Ff))}(t),50)})),et("click",".js-emoji-button",(function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&function(e){const t=o(e,".js-user-status-container"),n=u(t,".js-emoji-picker");Xf(t,e),function(e){const t=e.querySelector(".selected-emoji");t&&t.classList.remove("selected-emoji")}(t),Rf(e),Gf(t,e),Qf(t),Bf(n)}(t)})),et("click",".js-user-status-emoji-tab",(function(e){const t=e.currentTarget;t instanceof HTMLElement&&function(e){const t=o(e,".js-emoji-picker"),n=t.querySelector(".js-emoji-picker-filter");Pf(t),!t.hidden&&n instanceof HTMLInputElement&&n.focus()}(t)})),c(".js-user-status-message-field",(function(e){Jf(Zf(e))})),s("keyup",".js-user-status-message-field",e=>{const t=e.target;t instanceof HTMLInputElement&&Yf(t,e)}),s("keyup",".js-emoji-picker-filter",e=>{const t=e.target;t instanceof HTMLInputElement&&Yf(t,e)}),et("click",".js-clear-user-status-button",(function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&function(e){e.hidden=!0,u(e,".js-user-status-emoji-field",HTMLInputElement).value="",u(e,".js-user-status-no-emoji-icon").hidden=!1,u(e,".js-user-status-custom-emoji").innerHTML="";const t=u(e,".js-user-status-message-field",HTMLInputElement);t.value="",t.classList.contains("js-characters-remaining-field")&&ro(t);const n=e.querySelector(".selected-emoji.js-emoji-button");n&&n.classList.remove("selected-emoji"),u(e,".js-user-status-limited-availability-checkbox",HTMLInputElement).checked=!1;const s=e.querySelector(".js-user-status-expiration-date-input");s&&s instanceof HTMLInputElement&&(s.value=""),Qf(e),Jf(e);const o=u(e,".js-user-status-form",HTMLFormElement);m(o)}(o(t,".js-user-status-container"))})),et("click",".js-predefined-user-status",(function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&function(e){const t=o(e,".js-user-status-container"),n=u(e,".js-predefined-user-status-emoji"),s=u(e,".js-predefined-user-status-message"),r=u(t,".js-user-status-message-field",HTMLInputElement);r.value=(s.textContent||"").trim(),Gf(t,n),Xf(t,e),Qf(t),Jf(t),r.classList.contains("js-characters-remaining-field")&&ro(r)}(t)})),a(".js-user-status-message-field",(function(e){const t=e.target;if(!(t instanceof HTMLElement))return;const n=o(t,".js-user-status-form");Qf(n),Jf(n)})),et("click",".js-user-status-org-button",(function(e){const t=e.currentTarget;t instanceof HTMLButtonElement&&function(e){const t=o(e,".js-user-status-container"),n=u(t,".js-user-status-org-id-field",HTMLInputElement),s=u(t,".js-user-status-org-details"),r=u(t,".js-user-status-selected-org"),a=u(e,".js-user-status-org-display"),c=u(t,".js-user-status-org-message"),l=e.value,d=""!==l,m=u(t,".js-user-status-message-field",HTMLInputElement),f=t.querySelector(".js-user-status-org-button.selected");let p="";f&&f.classList.remove("selected"),e.classList.add("selected"),n.value=l,r.innerHTML="";const g=a.cloneNode(!0);if(g instanceof HTMLElement&&(g.hidden=!1),r.appendChild(g),s.removeAttribute("open"),d){const t=i(c,"data-prefix"),n=i(c,"data-suffix"),s=i(e,"data-org");c.textContent=`${t}${s}${n}`,c.hidden=!1;const o=new URL(i(m,"data-org-url"),window.location.origin),r=new URLSearchParams(o.search.slice(1));r.append("global_id",l),o.search=r.toString(),p=o.toString()}else c.textContent=i(c,"data-none"),c.hidden=!0,p=i(m,"data-no-org-url");o(m,"text-expander").setAttribute("data-mention-url",p)}(t)})),et("change",".js-user-status-limited-availability-checkbox",(function(e){const t=e.target;if(!(t instanceof HTMLInputElement))return;const n=o(t,".js-user-status-form"),s=t.checked,r=i(t,"data-default-message"),a=u(n,".js-user-status-message-field",HTMLInputElement);s&&a.value.length<1?a.value=r:s||a.value!==r||(a.value=""),Qf(n),Jf(n)})),d(".js-user-status-form",(async function(e,t){const n=u(e,".js-user-status-form-group");let s;n.classList.remove("errored");try{s=await t.html()}catch(l){return void n.classList.add("errored")}const r=o(e,".js-user-status-container"),a=s.html.querySelector(".js-user-status-container");r.replaceWith(s.html);const c=document.querySelectorAll(".js-user-status-container");for(const o of c)if(a!==o){const e=o.closest(".js-user-status-context");if(e){const t=i(e,"data-url"),n=await k(document,t);o.replaceWith(n)}}})),Qe(".js-toggle-user-status-edit",(function(e){e.addEventListener("mouseenter",tp),e.addEventListener("mouseleave",np)})),Qe(".js-emoji-picker",e=>{if(!(e instanceof HTMLElement))throw new Error("invariant: app/assets/modules/github/user-status-submit.ts:62");Of(e)}),Qe("[data-warn-unsaved-changes]",{add(e){e.addEventListener("input",sp),e.addEventListener("change",sp),e.addEventListener("submit",op);const t=e.closest("details-dialog");t&&(o(t,"details").addEventListener("toggle",rp),t.addEventListener("details-dialog-close",ip))},remove(e){e.removeEventListener("input",sp),e.removeEventListener("change",sp),e.removeEventListener("submit",op);const t=e.closest("details-dialog");t&&(o(t,"details").removeEventListener("toggle",rp),t.removeEventListener("details-dialog-close",ip),op())}}),et("submit",".js-prefetch-workspace-location",(async function(e){const t=e.currentTarget;if(!(t instanceof HTMLFormElement))throw new Error("invariant: app/assets/modules/github/workspaces/prefetch-location.ts:11");const n=t.querySelector('[name="workspace[location]"]');if(!(n instanceof HTMLInputElement))throw new Error("invariant: app/assets/modules/github/workspaces/prefetch-location.ts:13");if(""!==n.value)return;e.preventDefault();const s=t.querySelector("button[type=submit]");s instanceof HTMLInputElement&&(s.disabled=!0);const o=t.getAttribute("data-workspace-locations-url");if(!o)return;const r=await async function(e){const t=await A(e);if(t)return t.current}(o);r&&(n.value=r),t.submit()}));const ap=new WeakMap;function cp(e){const t=o(e,".js-repository-advisory-form-container"),n=u(t,".js-advisory-credits-blankslate"),s=l(e,".js-advisory-credit-row").every(e=>e.hidden);e.hidden=s,n.hidden=!s}et("click",".js-markdown-link-button",(async function({currentTarget:e}){const t=u(document,".js-markdown-link-dialog",HTMLTemplateElement).content.cloneNode(!0);if(!(t instanceof DocumentFragment))return;const n=await M({content:t});e instanceof HTMLElement&&ap.set(n,function(e){const t=o(e,"markdown-toolbar",jt).field;if(!t)throw new Error("invariant: textarea");return t}(e).selectionEnd)})),et("click",".js-markdown-link-insert",({currentTarget:e})=>{const t=o(e,"details-dialog"),n=u(document,`#${i(e,"data-for-textarea")}`,HTMLTextAreaElement),s=ap.get(t)||0,r=u(t,"#js-dialog-link-href",HTMLInputElement).value,a=`[${u(t,"#js-dialog-link-text",HTMLInputElement).value}](${r}) `,c=n.value.slice(0,s),l=n.value.slice(s);n.value=c+a+l,n.focus(),n.selectionStart=n.selectionEnd=s+a.length}),d(".js-repository-advisory-title-update",(async function(e,t){o(e,".js-details-container").classList.remove("open");const n=(await t.json()).json;document.title=n.page_title;for(const s of e.elements)(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement)&&(s.defaultValue=s.value)})),d(".js-add-repository-advisory-collaborator",(async function(e,t){t.html(),e.reset()})),et("details-menu-selected",".js-advisory-menu",(function(e){const t=e.detail.relatedTarget,n=i(t,"data-advisory-info-show"),s=l(document,".js-show-if-publishing, .js-show-if-requesting-cve");for(const o of s)o.hidden=!o.classList.contains(n)}),{capture:!0}),d(".js-repository-advisory-add-credit-form",(async function(e,t){const n=o(e,".js-repository-advisory-form-container");u(n,".js-add-credit-button",HTMLButtonElement).disabled=!0,e.reset();const s=await t.html();s&&function(e,t){const n=u(t.html,".js-advisory-credit-row"),s=n.getAttribute("data-user-id"),o=u(e,".js-advisory-credits-list"),r=o.querySelector(`.js-advisory-credit-row[data-user-id='${s}']`);if(r){const e=u(r,".js-advisory-credit-destroy-field",HTMLInputElement);r.hidden||r.classList.add("user-already-added"),e.value="false",r.hidden=!1}else{const t=u(e,".js-next-credit-index-field",HTMLInputElement);o.append(n),t.value=String(Number(t.value)+1)}cp(o)}(n,s)})),et("click",".js-advisory-credit-remove-button",(function(e){!function(e){const t=u(e,".js-advisory-credit-destroy-field",HTMLInputElement),n=o(e,".js-advisory-credits-list");t.value="true",e.hidden=!0,e.classList.remove("user-already-added"),cp(n)}(o(e.currentTarget,".js-advisory-credit-row"))}));let lp=!1;function up(e){const t=document.importNode(e.content,!0),n=u(document,"#js-flash-container");for(const s of n.children)n.removeChild(s);n.appendChild(t)}function dp(){for(const e of document.querySelectorAll(".js-selected-check-run"))e.remove();u(document,".js-zen-blankslate").hidden=!1,lp=!0}d(".js-check-suite-rerequest-form",(async function(e,t){o(e,"details").removeAttribute("open");const n=document.querySelector("#js-selected-check-run");if(null!==n){const t="true"===u(e,"input[name=only_failed_check_runs]",HTMLInputElement).value,s="true"===i(n,"data-failed");t&&!s||dp()}try{await t.text(),up(u(document,"#js-check-suite-rerequest-form-success",HTMLTemplateElement))}catch(s){throw up(u(document,"#js-check-suite-rerequest-form-error",HTMLTemplateElement)),s}})),d(".js-check-run-rerequest-form",(async function(e,t){lp=!0,u(document,"#js-selected-check-run").contains(e)&&dp();try{await t.text(),up(u(e,".js-check-run-rerequest-form-success",HTMLTemplateElement))}catch(n){throw up(u(e,".js-check-run-rerequest-form-error",HTMLTemplateElement)),n}})),Qe(".js-latest-run-link",{constructor:HTMLElement,add(e){lp&&e.click()}}),et("click",".js-timeout-flash-close",(function(e){e.target instanceof HTMLElement&&(o(e.target,".js-interactive-component-timeout").hidden=!0)})),et("click",".js-interactive-component-button",(function(e){const t=e.target;if(t instanceof HTMLButtonElement){const e=t.querySelector(".js-loading-spinner");e instanceof HTMLElement&&(e.hidden=!1)}})),d(".js-interactive-component-form",(async function(e,t){const n=u(e,".js-interactive-component-timeout"),s=o(e,".js-component-container");if(n){n.hidden=!0;const t=l(s,".js-interactive-component-button",HTMLButtonElement);for(const e of t)e.disabled=!0;const o=parseInt(i(e,"data-timeout"));setTimeout(()=>{if(n){n.hidden=!1;const e=l(s,".js-interactive-component-button[disabled]",HTMLButtonElement);for(const t of e){t.disabled=!1;const e=t.querySelector(".loading-spinner");e instanceof HTMLElement&&(e.hidden=!0)}}},o)}await t.text()})),Qe(".js-experiment-variant",{constructor:HTMLElement,add(e){!function(e){const t=i(e,"data-experiment"),n=i(e,"data-experiment-group"),s=Wl(t);if(s&&s===n){for(const n of l(e,"[data-if-experiment-enabled-ga-load]")){const e=Ol(i(n,"data-if-experiment-enabled-ga-load"),t,s);e.interactive=!1,ae(e)}e.hidden=!1}else if(!s&&e.getAttribute("data-experiment-default")){for(const t of l(e,"[data-if-experiment-enabled-ga-load]")){const e=wr(i(t,"data-if-experiment-enabled-ga-load"));e.interactive=!1,ae(e)}e.hidden=!1}else e.remove()}(e)}}),Qe(".js-add-experiment-labels-to-ga-click",(function(e){Bl(e)})),Qe(".js-add-experiment-labels-to-value",{constructor:HTMLInputElement,add(e){!function(e){const t=o(e,".js-experiment-variant"),n=i(t,"data-experiment");if(Wl(n)){const s=i(t,"data-experiment-group");e.value+=Ul(n,s)}}(e)}}),et("click",["form button:not([type])","form button[type=submit]","form input[type=submit]"].join(", "),(function(e){const t=e.currentTarget;t.form&&!e.defaultPrevented&&Ge(t)})),d("form[data-remote]",(function(e,t,n){"json"===e.getAttribute("data-type")&&n.headers.set("Accept","application/json"),nt(e,"deprecatedAjaxSend",{request:n}),t.text().catch(e=>{if(e.response)return e.response;throw e}).then(t=>{t.status<300?nt(e,"deprecatedAjaxSuccess"):nt(e,"deprecatedAjaxError",{error:t.statusText,status:t.status,text:t.text})},t=>{nt(e,"deprecatedAjaxError",{error:t.message,status:0,text:null})}).then(()=>{nt(e,"deprecatedAjaxComplete")})})),et("deprecatedAjaxComplete","form",(function({currentTarget:e}){const t=Xe(e);t&&t.remove()})),x(e=>{const t=Xe(e);t&&t.remove()}),Ye(q)}}}));
//# sourceMappingURL=github-bootstrap-99eae789.js.map