performance.mark("js-parse-end:59153-96c56cfb9888d273.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["59153"],{25445(e,t,r){r.d(t,{Z:()=>o});function o({appendQuery:e,retainScrollPosition:t,returnTarget:r}){window.dispatchEvent(new CustomEvent("blackbird_monolith_append_and_focus_input",{detail:{appendQuery:e,retainScrollPosition:t,returnTarget:r}}))}},18660(e,t,r){r.d(t,{_:()=>n});var o=r(74848),i=r(16522);function n(e){let t,r,n,a=(0,i.c)(12),{buttonFocusId:l,buttonHotkey:s,onButtonClick:c,buttonTestLabel:u,onlyAddHotkeyScopeButton:d}=e,f=u||"";return a[0]!==l||a[1]!==s||a[2]!==c||a[3]!==f?(t=(0,o.jsx)("button",{hidden:!0,"data-testid":f,"data-hotkey":s,onClick:c,"data-hotkey-scope":l}),a[0]=l,a[1]=s,a[2]=c,a[3]=f,a[4]=t):t=a[4],a[5]!==s||a[6]!==c||a[7]!==d?(r=!d&&(0,o.jsx)("button",{hidden:!0,"data-hotkey":s,onClick:c}),a[5]=s,a[6]=c,a[7]=d,a[8]=r):r=a[8],a[9]!==t||a[10]!==r?(n=(0,o.jsxs)(o.Fragment,{children:[t,r]}),a[9]=t,a[10]=r,a[11]=n):n=a[11],n}n.displayName="DuplicateOnKeydownButton"},98779(e,t,r){r.d(t,{R:()=>m});var o=r(74848),i=r(16522),n=r(54242),a=r(23666),l=r(32363),s=r(40914),c=r(27678),u=r(31595),d=r(68541),f=r(7231);function m(e){let t,r,m,h,p=(0,i.c)(24),{size:g,buttonClassName:y,allowResizing:_,idEnding:x}=e,w=(0,n.t)(),v=(0,u.l)(),R=(0,c.y)(),F=(0,d.z)(),b=function(){let e,t=(0,i.c)(2),{addToast:r}=(0,s.Y6)();return t[0]!==r?(e=e=>r({type:"error",message:e}),t[0]=r,t[1]=e):e=t[1],e}(),{sendRepoClickEvent:k}=(0,f.T)();p[0]!==R||p[1]!==v||p[2]!==w?(t=e=>`${(0,a.IO9)({repo:w,commitish:e,action:R,path:v})}${window.location.search}`,p[0]=R,p[1]=v,p[2]=w,p[3]=t):t=p[3],p[4]!==k?(r=e=>k("REF_SELECTOR_MENU.CREATE_BRANCH",{ref_name:e}),p[4]=k,p[5]=r):r=p[5],p[6]!==k?(m=e=>e&&k("REF_SELECTOR_MENU"),p[6]=k,p[7]=m):m=p[7];let S=x||"repos-header-ref-selector";return p[8]!==_||p[9]!==y||p[10]!==b||p[11]!==F.listCacheKey||p[12]!==F.name||p[13]!==F.refType||p[14]!==w.currentUserCanPush||p[15]!==w.defaultBranch||p[16]!==w.name||p[17]!==w.ownerLogin||p[18]!==g||p[19]!==t||p[20]!==r||p[21]!==m||p[22]!==S?(h=(0,o.jsx)(l.PI,{currentCommitish:F.name,defaultBranch:w.defaultBranch,owner:w.ownerLogin,repo:w.name,canCreate:w.currentUserCanPush,cacheKey:F.listCacheKey,selectedRefType:F.refType,getHref:t,uiCommandId:"code-view:open-ref-selector",onBeforeCreate:r,onCreateError:b,onOpenChange:m,size:g,buttonClassName:y,allowResizing:_,idEnding:S,useFocusZone:!0}),p[8]=_,p[9]=y,p[10]=b,p[11]=F.listCacheKey,p[12]=F.name,p[13]=F.refType,p[14]=w.currentUserCanPush,p[15]=w.defaultBranch,p[16]=w.name,p[17]=w.ownerLogin,p[18]=g,p[19]=t,p[20]=r,p[21]=m,p[22]=S,p[23]=h):h=p[23],h}m.displayName="ReposHeaderRefSelector"},82175(e,t,r){r.r(t),r.d(t,{FileResultRow:()=>M,default:()=>E});var o=r(74848),i=r(16522),n=r(48337),a=r(31595),l=r(7231),s=r(12191),c=r(54242),u=r(16197),d=r(23666),f=r(77236),m=r(31854),h=r(79040),p=r(29941),g=r(38621),y=r(45800),_=r(59134),x=r(18990),w=r(56133),v=r(94300),R=r(7478),F=r(10095),b=r(91385),k=r(96540),S=r(6406),C=r(45620),N=r(58164),T=r(92100),j=r(34164);let A={excludeDirectories:!1,excludeSeeAllResults:!1};function E(e){var t;let r,f,g,R,F,b,E,M,P,H,O,W,D,$,q,V,U,G,K,z,Z,J,X,Y,Q,ee=(0,i.c)(102),{actionListClassName:et,additionalResults:er,commitOid:eo,config:ei,findFileWorkerPath:en,getItemUrl:ea,onRenderRow:el,onItemSelected:es,searchBoxRef:ec,className:eu}=e,ed=void 0===ei?A:ei,{excludeDirectories:ef,excludeSeeAllResults:em}=ed,{query:eh,setQuery:ep}=(0,n.JS)(),eg=(0,c.t)(),ey=k.useRef(null),e_=ec??ey,[ex,ew]=k.useState(eh.length>0),[ev,eR]=k.useState(!!eh),{list:eF,directories:eb,loading:ek,error:eS}=(0,T.o)(eo,ex,!!ef);ee[0]!==eb?(f=new Set(eb),ee[0]=eb,ee[1]=f):f=ee[1];let eC=f,eN=(0,a.l)(),{getUrl:eT}=(0,s.Z)();ee[2]!==eh?(g=(r=(t=(t=eh).replaceAll(" ","")).indexOf(":"))>=0?{queryText:t.substring(0,r),queryLine:parseInt(t.substring(r+1),10)}:{queryText:t,queryLine:void 0},ee[2]=eh,ee[3]=g):g=ee[3];let{queryText:ej,queryLine:eA}=g,eE=(0,k.useDeferredValue)(ej);e:{let e;if(ek){R=void 0;break e}ee[4]!==er||ee[5]!==eF?(e=[...eF,...er??[]].sort(),ee[4]=er,ee[5]=eF,ee[6]=e):e=ee[6],R=e}let{matches:eI,clearMatches:eB}=function(e,t,r,o){let n,a,s,c,u,d,f,m,h=(0,i.c)(21),[p,g]=k.useState(),y=k.useRef(""),_=k.useRef(null),{sendStats:x}=(0,l.T)(),w=k.useRef(!1),v=k.useRef("");h[0]!==x||h[1]!==r?(n=()=>{let e=new S.z(r,C.j);e.onmessage=e=>{let{data:t}=e;w.current=!1,(0,k.startTransition)(()=>{g(t.list)}),y.current=t.query,t.startTime&&t.query===v.current&&x("repository.find-file",{"find-file-base-count":t.baseCount,"find-file-results-count":t.list.length,"find-file-duration-ms":performance.now()-t.startTime})},_.current=e},h[0]=x,h[1]=r,h[2]=n):n=h[2];let R=(0,k.useEffectEvent)(n);h[3]!==p?(a=(e,t)=>{let r=y.current&&t.startsWith(y.current);w.current=!0,v.current=t,_.current?.postMessage({baseList:r&&p||e,query:t,startTime:performance.now()})},h[3]=p,h[4]=a):a=h[4];let F=(0,k.useEffectEvent)(a);return h[5]!==R||h[6]!==o?(s=()=>{if(o)return R(),function(){_.current?.terminate()}},h[5]=R,h[6]=o,h[7]=s):s=h[7],h[8]!==o?(c=[o],h[8]=o,h[9]=c):c=h[9],k.useEffect(s,c),h[10]!==R||h[11]!==e||h[12]!==F||h[13]!==t?(u=()=>{void 0===e&&v.current?(w.current=!1,_.current?.terminate(),_.current=null,g(void 0)):e?.length&&t&&((w.current||!_.current)&&(_.current?.terminate(),R()),F(e,t))},h[10]=R,h[11]=e,h[12]=F,h[13]=t,h[14]=u):u=h[14],h[15]!==e||h[16]!==t?(d=[e,t],h[15]=e,h[16]=t,h[17]=d):d=h[17],k.useEffect(u,d),h[18]===Symbol.for("react.memo_cache_sentinel")?(f=()=>g(void 0),h[18]=f):f=h[18],h[19]!==p?(m={matches:p,clearMatches:f},h[19]=p,h[20]=m):m=h[20],m}(R,eE,en,ex),{sendRepoClickEvent:eM}=(0,l.T)(),eP=(0,h.Zp)(),[eH,eL]=k.useState(0),[eO,eW]=k.useState(I),eD=k.useRef(null),e$=k.useRef(null),{sendRepoKeyDownEvent:eq}=(0,l.T)(),{screenSize:eV}=(0,m.lm)(),eU=ed.enableOverlay??eV>=m.Gy.large;ee[7]!==es||ee[8]!==eM?(F=e=>{eM("FILE_TREE.SEARCH_RESULT_CLICK"),es?.(e),eR(!1)},ee[7]=es,ee[8]=eM,ee[9]=F):F=ee[9];let eG=F;ee[10]!==ea||ee[11]!==eT?(b=(e,t,r)=>{let o=t.has(e);return ea?ea(e,o,r):eT({path:e,action:o?"tree":"blob",hash:r})},ee[10]=ea,ee[11]=eT,ee[12]=b):b=ee[12];let eK=b;ee[13]===Symbol.for("react.memo_cache_sentinel")?(E={bindKeys:p.z0.ArrowVertical|p.z0.HomeAndEnd,focusInStrategy:"previous"},ee[13]=E):E=ee[13],ee[14]!==eS||ee[15]!==ek?(M=[ek,eS],ee[14]=eS,ee[15]=ek,ee[16]=M):M=ee[16];let{containerRef:ez}=(0,y.G)(E,M);ee[17]!==eh?(H=()=>{eh||eR(!1)},P=[eh],ee[17]=eh,ee[18]=P,ee[19]=H):(P=ee[18],H=ee[19]),k.useEffect(H,P),ee[20]!==eU||ee[21]!==e_?(O=()=>{document.activeElement!==e_.current&&eU&&eR(!1)},ee[20]=eU,ee[21]=e_,ee[22]=O):O=ee[22],ee[23]!==eU||ee[24]!==e_||ee[25]!==eN?(W=[eN,e_,eU],ee[23]=eU,ee[24]=e_,ee[25]=eN,ee[26]=W):W=ee[26],k.useEffect(O,W),ee[27]!==eI?(D=eI?.slice(0,40)??[],ee[27]=eI,ee[28]=D):D=ee[28];let eZ=D,eJ=eI&&eI.length>eZ.length;ee[29]!==eK||ee[30]!==eB||ee[31]!==eC||ee[32]!==eZ||ee[33]!==em||ee[34]!==eH||ee[35]!==ez||ee[36]!==eJ||ee[37]!==eP||ee[38]!==es||ee[39]!==eh||ee[40]!==eA||ee[41]!==ej||ee[42]!==eg||ee[43]!==eq||ee[44]!==ep?($=e=>{let{key:t,shiftKey:r,metaKey:o,altKey:i,ctrlKey:n}=e;if(!r&&!o&&!i){if("Escape"===t)eh?(eq("FILE_TREE.CANCEL_SEARCH"),ep(""),eB()):document.activeElement&&document.activeElement.blur();else if(!eh)return;else if("Enter"===t){if(!em&&eJ&&eH===eZ.length)eP((0,d.Y8Y)({owner:eg.ownerLogin,repo:eg.name,searchTerm:`path:${ej}`})),es?.();else if(eZ[eH]){let e=eZ[eH];eP(eK(e,eC,eA?`L${eA}`:"")),eR(!1),es?.(e)}}else if("ArrowDown"===t||n&&"n"===t){if(!em&&eJ&&eH>=eZ.length-1){if(eL(eZ.length),eD.current&&ez.current){let e=(0,u.U)(ez.current);(0,p.Rt)(eD.current,e,{behavior:"instant"})}}else eL(Math.min(eH+1,eZ.length-1));e.preventDefault();return}else if("ArrowUp"===t||n&&"p"===t){eL(Math.max(eH-1,0)),e.preventDefault();return}}},ee[29]=eK,ee[30]=eB,ee[31]=eC,ee[32]=eZ,ee[33]=em,ee[34]=eH,ee[35]=ez,ee[36]=eJ,ee[37]=eP,ee[38]=es,ee[39]=eh,ee[40]=eA,ee[41]=ej,ee[42]=eg,ee[43]=eq,ee[44]=ep,ee[45]=$):$=ee[45];let eX=$;ee[46]!==eU?(q=(0,j.$)("FileResultsList-module__Box__vqkwS",{"FileResultsList-module__OverlayEnabled__eP6z3":eU}),ee[46]=eU,ee[47]=q):q=ee[47],ee[48]!==et||ee[49]!==eK||ee[50]!==eE||ee[51]!==eC||ee[52]!==eZ||ee[53]!==eU||ee[54]!==eS||ee[55]!==em||ee[56]!==eH||ee[57]!==eO||ee[58]!==ez||ee[59]!==ek||ee[60]!==eI||ee[61]!==eJ||ee[62]!==el||ee[63]!==eG||ee[64]!==eN||ee[65]!==eA||ee[66]!==ej||ee[67]!==eg?(V=eS?(0,o.jsx)(_.A,{variant:"danger",className:"tmp-m-3",children:"Failed to search"}):(0,o.jsxs)(x.l,{ref:ez,className:(0,j.$)(et,"FileResultsList-module__ActionList__KvCZP",{"FileResultsList-module__ActionList_Overlay__l70lt":eU}),role:"listbox",children:[!ek&&eZ.map((e,t)=>{let r=eC.has(e),i=eK(e,eC,eA?`L${eA}`:"");return(0,o.jsx)(L,{active:e===eN,index:t,focused:eO&&eH===t,match:e,onRender:el,query:eE,onClick:eG,isDirectory:r,to:i,useOverlay:eU,listRef:ez},e)}),(0,o.jsxs)("div",{className:"tmp-m-3 text-center",children:[(0,o.jsx)(B,{loading:ek||!eI,visibleResultCount:eZ.length,truncated:!!eJ}),eJ&&!em&&(0,o.jsxs)(o.Fragment,{children:["\xa0",(0,o.jsx)(w.A,{id:"see-all-results-link",className:(0,j.$)("focus-visible",{"FileResultsList-module__PrimerLink__Mmo7i":eO&&eH===eZ.length}),ref:eD,href:(0,d.Y8Y)({owner:eg.ownerLogin,repo:eg.name,searchTerm:`path:${ej}`}),children:"See all results"})]})]})]}),ee[48]=et,ee[49]=eK,ee[50]=eE,ee[51]=eC,ee[52]=eZ,ee[53]=eU,ee[54]=eS,ee[55]=em,ee[56]=eH,ee[57]=eO,ee[58]=ez,ee[59]=ek,ee[60]=eI,ee[61]=eJ,ee[62]=el,ee[63]=eG,ee[64]=eN,ee[65]=eA,ee[66]=ej,ee[67]=eg,ee[68]=V):V=ee[68],ee[69]!==q||ee[70]!==V?(U=(0,o.jsx)("div",{className:q,children:V}),ee[69]=q,ee[70]=V,ee[71]=U):U=ee[71];let eY=U,eQ=(!eU&&eh||eU&&ev)&&eO&&eH>-1?eJ&&eH===eZ.length?"see-all-results-link":`file-result-${eH}`:void 0,e0=eU?ev:void 0,e1=eU?"file-results-list":void 0;ee[72]===Symbol.for("react.memo_cache_sentinel")?(G=()=>ew(!0),ee[72]=G):G=ee[72],ee[73]!==eB||ee[74]!==ep?(K=e=>{ep(e),e?eR(!0):(eB(),eR(!1)),eL(0)},ee[73]=eB,ee[74]=ep,ee[75]=K):K=ee[75],ee[76]!==ez?(z=e=>{ez.current?.contains(e.relatedTarget)||(eR(!1),eW(!1))},ee[76]=ez,ee[77]=z):z=ee[77],ee[78]!==eh?(Z=()=>{eh&&eR(!0),eW(!0)},ee[78]=eh,ee[79]=Z):Z=ee[79],ee[80]!==eU||ee[81]!==eX||ee[82]!==e_||ee[83]!==eh||ee[84]!==eQ||ee[85]!==e0||ee[86]!==e1||ee[87]!==K||ee[88]!==z||ee[89]!==Z?(J=(0,o.jsx)(N.Z,{ariaActiveDescendant:eQ,ariaExpanded:e0,ariaHasPopup:eU,ariaControls:e1,ref:e_,query:eh,onKeyDown:eX,onPreload:G,onSearch:K,onBlur:z,onFocus:Z,className:"FileResultsList-module__FilesSearchBox__ivVkc"}),ee[80]=eU,ee[81]=eX,ee[82]=e_,ee[83]=eh,ee[84]=eQ,ee[85]=e0,ee[86]=e1,ee[87]=K,ee[88]=z,ee[89]=Z,ee[90]=J):J=ee[90],ee[91]!==eu||ee[92]!==J?(X=(0,o.jsx)("div",{ref:e$,className:eu,children:J}),ee[91]=eu,ee[92]=J,ee[93]=X):X=ee[93],ee[94]!==eU||ee[95]!==eY||ee[96]!==ev?(Y=eU&&(0,o.jsx)(v.T,{anchorRef:e$,open:eU&&ev,renderAnchor:null,onClose:()=>{eR(!1)},focusZoneSettings:{disabled:!0},focusTrapSettings:{disabled:!0},width:"xlarge",align:"end",overlayProps:{id:"file-results-list",role:"dialog"},children:eY}),ee[94]=eU,ee[95]=eY,ee[96]=ev,ee[97]=Y):Y=ee[97];let e2=!eU&&eh&&eY;return ee[98]!==X||ee[99]!==Y||ee[100]!==e2?(Q=(0,o.jsxs)(o.Fragment,{children:[X,Y,e2]}),ee[98]=X,ee[99]=Y,ee[100]=e2,ee[101]=Q):Q=ee[101],Q}function I(){return(0,N.q)()}function B(e){let t,r,n=(0,i.c)(8),{visibleResultCount:a,truncated:l,loading:s}=e,c=s||l||0===a?void 0:"sr-only",u=s?"Loading":void 0;return n[0]!==s||n[1]!==l||n[2]!==a?(t=s?(0,o.jsx)(R.A,{size:"large"}):0===a?"No matches found":l?`First ${a} files shown.`:`Showing ${a} files.`,n[0]=s,n[1]=l,n[2]=a,n[3]=t):t=n[3],n[4]!==c||n[5]!==u||n[6]!==t?(r=(0,o.jsx)("span",{role:"status",className:c,"aria-label":u,children:t},"results-count-status"),n[4]=c,n[5]=u,n[6]=t,n[7]=r):r=n[7],r}E.displayName="FileResultsList",B.displayName="FileResultsStatus";let M=e=>{let t,r,n,a,l,s,c,d,m,h,g=(0,i.c)(33),{active:y,focused:_,index:w,match:v,query:R,to:F,isDirectory:S,onClick:C,onRender:N,useOverlay:T,listRef:A}=e;g[0]!==v||g[1]!==R?(t=(0,b.Xq)(R,v),g[0]=v,g[1]=R,g[2]=t):t=g[2];let E=t;N?.();let I=k.useRef(null),B=S?P:H;g[3]!==_||g[4]!==A?(r=()=>{if(_&&I.current&&A?.current){let e=(0,u.U)(A.current);(0,p.Rt)(I.current,e,{behavior:"instant"})}},n=[_,A],g[3]=_,g[4]=A,g[5]=r,g[6]=n):(r=g[5],n=g[6]),k.useEffect(r,n),g[7]!==v||g[8]!==C?(a=()=>{C?.(v)},g[7]=v,g[8]=C,g[9]=a):a=g[9];let M=a,L=_?"FileResultsList-module__ActionList_ItemFocused__Yu7wK":void 0;g[10]!==L?(l=(0,j.$)(L),g[10]=L,g[11]=l):l=g[11];let W=`file-result-${w}`,D=T?-1:0,$=_||void 0;return g[12]===Symbol.for("react.memo_cache_sentinel")?(s=(0,j.$)("d-flex","FileResultsList-module__ActionList_Item__X18Zr"),g[12]=s):s=g[12],g[13]!==B||g[14]!==v||g[15]!==E?(c=(0,o.jsx)("div",{className:"d-flex flex-1 flex-column overflow-hidden",children:(0,o.jsx)(O,{text:v,positionsList:E,LeadingIcon:B,className:"FileResultsList-module__HighlightMatch__wwEZz"})}),g[13]=B,g[14]=v,g[15]=E,g[16]=c):c=g[16],g[17]!==_||g[18]!==S?(d=_&&(0,o.jsx)("div",{className:"sr-only",children:`Go to ${S?"folder":"file"}`}),g[17]=_,g[18]=S,g[19]=d):d=g[19],g[20]!==M||g[21]!==c||g[22]!==d||g[23]!==W||g[24]!==D||g[25]!==$||g[26]!==F?(m=(0,o.jsxs)(f.N,{to:F,ref:I,role:"option",onClick:M,id:W,tabIndex:D,"data-focus-visible-added":$,className:s,children:[c,d]}),g[20]=M,g[21]=c,g[22]=d,g[23]=W,g[24]=D,g[25]=$,g[26]=F,g[27]=m):m=g[27],g[28]!==y||g[29]!==v||g[30]!==m||g[31]!==l?(h=(0,o.jsx)(x.l.Item,{role:"group",active:y,className:l,children:m},v),g[28]=y,g[29]=v,g[30]=m,g[31]=l,g[32]=h):h=g[32],h};M.displayName="FileResultRow";let P=()=>{let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,o.jsx)(F.A,{"aria-label":"Directory",icon:g.FileDirectoryFillIcon,size:"small",className:"FileResultsList-module__Octicon__T1mIF"}),t[0]=e):e=t[0],e};P.displayName="DirectoryIcon";let H=()=>{let e,t=(0,i.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,o.jsx)(F.A,{"aria-label":"File",icon:g.FileIcon,className:"fgColor-muted mr-2",size:"small"}),t[0]=e):e=t[0],e};H.displayName="FileResultIcon";let L=k.memo(M);function O(e){let t,r,n,a,l=(0,i.c)(14),{text:s,positionsList:c,className:u,LeadingIcon:d}=e;if(l[0]!==c||l[1]!==s){let e;t=[];let r=0;for(let e of c){if(Number(e)!==e||es.length)continue;let i=s.slice(r,e);i&&t.push(W(i)),r=e+1,t.push((0,o.jsx)("mark",{className:"text-bold bgColor-transparent fgColor-default",children:s[e]},e))}l[3]!==r||l[4]!==s?(e=W(s.slice(r)),l[3]=r,l[4]=s,l[5]=e):e=l[5],t.push(e),l[0]=c,l[1]=s,l[2]=t}else t=l[2];return l[6]!==d?(r=d&&(0,o.jsx)(d,{}),l[6]=d,l[7]=r):r=l[7],l[8]!==t||l[9]!==r?(n=(0,o.jsxs)(o.Fragment,{children:[r,t]}),l[8]=t,l[9]=r,l[10]=n):n=l[10],l[11]!==u||l[12]!==n?(a=(0,o.jsx)("div",{className:u,children:n}),l[11]=u,l[12]=n,l[13]=a):a=l[13],a}function W(e){return e.replaceAll("/","/\u200B")}L.displayName="MemoizedFileResultRow",O.displayName="HighlightMatch"},58164(e,t,r){r.d(t,{Z:()=>f,q:()=>m});var o=r(74848),i=r(16522),n=r(69184),a=r(7231),l=r(26316),s=r(38621),c=r(38750),u=r(96540),d=r(34164);let f=e=>{let t,r,n,l,f,p,g,y,_,x=(0,i.c)(34),{ref:w,ariaActiveDescendant:v,ariaControls:R,ariaExpanded:F,ariaHasPopup:b,onBlur:k,onFocus:S,onKeyDown:C,onPreload:N,onSearch:T,query:j,className:A}=e,{sendRepoClickEvent:E}=(0,a.T)(),[I,B]=u.useState(j);x[0]!==j?(t=()=>{B(j)},r=[j],x[0]=j,x[1]=t,x[2]=r):(t=x[1],r=x[2]),u.useEffect(t,r),x[3]!==T||x[4]!==j||x[5]!==E?(n=j?(0,o.jsx)(c.A.Action,{onClick:()=>{E("FILE_TREE.CANCEL_SEARCH"),T("")},icon:s.XCircleFillIcon,"aria-label":"Clear",className:"fgColor-muted"}):void 0,x[3]=T,x[4]=j,x[5]=E,x[6]=n):n=x[6];let M=n;x[7]===Symbol.for("react.memo_cache_sentinel")?(l=m(),x[7]=l):l=x[7],x[8]!==N||x[9]!==T?(f=e=>{B(e.target.value),N(),T(e.target.value)},x[8]=N,x[9]=T,x[10]=f):f=x[10],x[11]!==A?(p=(0,d.$)("d-flex",A),x[11]=A,x[12]=p):p=x[12];let P=b?"combobox":void 0,H=b?"dialog":void 0,L=M?void 0:h;return x[13]!==S||x[14]!==N?(g=e=>{N(),e.target.select(),S?.(e)},x[13]=S,x[14]=N,x[15]=g):g=x[15],x[16]!==E?(y=()=>E("FILE_TREE.SEARCH_BOX"),x[16]=E,x[17]=y):y=x[17],x[18]!==v||x[19]!==R||x[20]!==F||x[21]!==M||x[22]!==k||x[23]!==C||x[24]!==w||x[25]!==g||x[26]!==y||x[27]!==f||x[28]!==p||x[29]!==P||x[30]!==H||x[31]!==L||x[32]!==I?(_=(0,o.jsx)(c.A,{autoFocus:l,ref:w,value:I,onKeyDown:C,onChange:f,className:p,"aria-label":"Go to file","aria-activedescendant":v,role:P,"aria-controls":R,"aria-expanded":F,"aria-haspopup":H,autoCorrect:"off",spellCheck:"false",placeholder:"Go to file",leadingVisual:s.SearchIcon,trailingAction:M,trailingVisual:L,onFocus:g,onBlur:k,onClick:y}),x[18]=v,x[19]=R,x[20]=F,x[21]=M,x[22]=k,x[23]=C,x[24]=w,x[25]=g,x[26]=y,x[27]=f,x[28]=p,x[29]=P,x[30]=H,x[31]=L,x[32]=I,x[33]=_):_=x[33],_};function m(){return"1"===new URLSearchParams(l.fV.search).get("search")}function h(){return(0,o.jsx)(n.E,{children:(0,o.jsx)("kbd",{children:"t"})})}f.displayName="FilesSearchBox",f.displayName="FilesSearchBox"},20790(e,t,r){r.d(t,{Ak:()=>m,RF:()=>h,Wl:()=>d,aT:()=>p,cD:()=>f,fN:()=>u});var o=r(74848),i=r(16522),n=r(36594),a=r(35205),l=r(31854),s=r(96540);let c=(0,a.A)("localStorage"),u=(0,s.createContext)(void 0);u.displayName="OpenPanelStateContext";let d=(0,s.createContext)(()=>void 0);function f(e){let t,r,a,f,m,h,p,g=(0,i.c)(16),{children:y,payload:_,openPanelRef:x,action:w}=e,v="blame"===w,R="tree"===w,F=(0,s.useRef)(v),b=(0,s.useRef)(R);g[0]!==v||g[1]!==R?(t=()=>{F.current=v,b.current=R},g[0]=v,g[1]=R,g[2]=t):t=g[2],(0,s.useLayoutEffect)(t);let k=(0,n.i)(),S=(0,s.useRef)(void 0);g[3]!==k||g[4]!==_?(r=()=>{let e=c.getItem("codeNavOpen");if(!k&&""!==e&&null!==e||k&&_.symbolsExpanded)return"codeNav"},g[3]=k,g[4]=_,g[5]=r):r=g[5];let[C,N]=(0,s.useState)(r),T=(v||R)&&"codeNav"===C?void 0:C;g[6]!==T||g[7]!==x?(a=()=>{x.current=T},f=[T,x],g[6]=T,g[7]=x,g[8]=a,g[9]=f):(a=g[8],f=g[9]),s.useEffect(a,f),g[10]===Symbol.for("react.memo_cache_sentinel")?(m=(e,t)=>{N(r=>(r&&S.current&&S.current.focus(),S.current=t,F.current||b.current&&"codeNav"===e?void 0:e))},g[10]=m):m=g[10];let j=m;return function(e){let t,r,o=(0,i.c)(4),{screenSize:n}=(0,l.lm)(),a=(0,s.useRef)(n);o[0]!==n||o[1]!==e?(t=()=>{let t=a.current>=l.Gy.large,r=a.current===n;nvoid 0}).displayName="OpenPanelContext",f.displayName="OpenPanelProvider"},23082(e,t,r){r.d(t,{V3:()=>u,_y:()=>c,wk:()=>s});var o=r(16522),i=r(19519),n=r(15393);let a={cursorNavigationHopWordLeft:{hotkey:"Alt+ArrowLeft,Ctrl+ArrowLeft",useWhileBlobFocused:!0,noModifierHotkey:["ArrowLeft"],modifierRequired:!0},cursorNavigationHopWordRight:{hotkey:"Alt+ArrowRight,Ctrl+ArrowRight",useWhileBlobFocused:!0,noModifierHotkey:["ArrowRight"],modifierRequired:!0},cursorNavigationTopOfPage:{hotkey:"Meta+ArrowUp",useWhileBlobFocused:!0,noModifierHotkey:["ArrowUp"],modifierRequired:!0},cursorNavigationBottomOfPage:{hotkey:"Meta+ArrowDown",useWhileBlobFocused:!0,noModifierHotkey:["ArrowDown"],modifierRequired:!0},cursorNavigationEnd:{hotkey:"End,Meta+ArrowRight",useWhileBlobFocused:!0,noModifierHotkey:["End"]},cursorNavigationHome:{hotkey:"Home,Meta+ArrowLeft",useWhileBlobFocused:!0,noModifierHotkey:["Home"]},cursorNavigationPageUp:{hotkey:"PageUp",useWhileBlobFocused:!0,noModifierHotkey:["PageUp"]},cursorNavigationPageDown:{hotkey:"PageDown",useWhileBlobFocused:!0,noModifierHotkey:["PageDown"]},cursorNavigationArrowDown:{hotkey:"ArrowDown",useWhileBlobFocused:!0,noModifierHotkey:["ArrowDown"]},cursorNavigationArrowUp:{hotkey:"ArrowUp",useWhileBlobFocused:!0,noModifierHotkey:["ArrowUp"]},cursorNavigationArrowLeft:{hotkey:"ArrowLeft",useWhileBlobFocused:!0,noModifierHotkey:["ArrowLeft"]},cursorNavigationArrowRight:{hotkey:"ArrowRight",useWhileBlobFocused:!0,noModifierHotkey:["ArrowRight"]},cursorNavigationShiftHopWordLeft:{hotkey:"Alt+Shift+ArrowLeft,Ctrl+Shift+ArrowLeft",useWhileBlobFocused:!0,noModifierHotkey:["ArrowLeft"],modifierRequired:!0},cursorNavigationShiftHopWordRight:{hotkey:"Alt+Shift+ArrowRight,Ctrl+Shift+ArrowRight",useWhileBlobFocused:!0,noModifierHotkey:["ArrowRight"],modifierRequired:!0},cursorNavigationShiftTopOfPage:{hotkey:"Meta+Shift+ArrowUp",useWhileBlobFocused:!0,noModifierHotkey:["ArrowUp"],modifierRequired:!0},cursorNavigationShiftBottomOfPage:{hotkey:"Meta+Shift+ArrowDown",useWhileBlobFocused:!0,noModifierHotkey:["ArrowDown"],modifierRequired:!0},cursorNavigationShiftEnd:{hotkey:"Shift+End,Meta+Shift+ArrowRight",useWhileBlobFocused:!0,noModifierHotkey:["End"],modifierRequired:!0},cursorNavigationShiftHome:{hotkey:"Shift+Home,Meta+Shift+ArrowLeft",useWhileBlobFocused:!0,noModifierHotkey:["Home"],modifierRequired:!0},cursorNavigationShiftPageUp:{hotkey:"Shift+PageUp",useWhileBlobFocused:!0,noModifierHotkey:["PageUp"],modifierRequired:!0},cursorNavigationShiftPageDown:{hotkey:"Shift+PageDown",useWhileBlobFocused:!0,noModifierHotkey:["PageDown"],modifierRequired:!0},cursorNavigationShiftArrowDown:{hotkey:"Shift+ArrowDown",useWhileBlobFocused:!0,noModifierHotkey:["ArrowDown"],modifierRequired:!0},cursorNavigationShiftArrowUp:{hotkey:"Shift+ArrowUp",useWhileBlobFocused:!0,noModifierHotkey:["ArrowUp"],modifierRequired:!0},cursorNavigationShiftArrowLeft:{hotkey:"Shift+ArrowLeft",useWhileBlobFocused:!0,noModifierHotkey:["ArrowLeft"],modifierRequired:!0},cursorNavigationShiftArrowRight:{hotkey:"Shift+ArrowRight",useWhileBlobFocused:!0,noModifierHotkey:["ArrowRight"],modifierRequired:!0},cursorNavigationHighlightLine:{text:"J",hotkey:"Shift+J",useWhileBlobFocused:!0,noModifierHotkey:["J"],modifierRequired:!0},cursorNavigationGoLineUp:{hotkey:"Ctrl+p",useWhileBlobFocused:!0,noModifierHotkey:["p"],modifierRequired:!0},cursorNavigationOpenHelpDialog:{hotkey:"Alt+F1,Control+Alt+\u02D9,Control+Alt+h",useWhileBlobFocused:!0,noModifierHotkey:["F1","h","\u02D9"],modifierRequired:!0},cursorNavigationGoLineDown:{hotkey:"Ctrl+n",useWhileBlobFocused:!0,noModifierHotkey:["n"],modifierRequired:!0},cursorNavigationEnter:{text:"\u2318 Enter",hotkey:"Meta+Enter",useWhileBlobFocused:!0,noModifierHotkey:["Enter"],modifierRequired:!0},cursorNavigationSpace:{hotkey:" ",useWhileBlobFocused:!0,noModifierHotkey:[" "],modifierRequired:!1},cursorNavigationShiftSpace:{hotkey:"Shift+ ",useWhileBlobFocused:!0,noModifierHotkey:[" "],modifierRequired:!0},expandAndFocusLineContextMenu:{text:"Shift Alt C",hotkey:"Alt+Shift+C,Alt+Shift+\xc7",useWhileBlobFocused:!0,noModifierHotkey:["C"],modifierRequired:!0},findFilesShortcut:{hotkey:"t,Shift+T",useWhileBlobFocused:!0,noModifierHotkey:["t","T"]},searchShortcut:{hotkey:"/",useWhileBlobFocused:!0,noModifierHotkey:["/"]},selectAllShortcut:{hotkey:"Meta+a",useWhileBlobFocused:!0,noModifierHotkey:["a"],modifierRequired:!0},toggleTreeShortcut:{hotkey:"Meta+b",useWhileBlobFocused:!0,noModifierHotkey:["b"],modifierRequired:!0}},l=new Map;function s(){let e,t,r=(0,o.c)(3);r[0]===Symbol.for("react.memo_cache_sentinel")?(e=["mac"],r[0]=e):e=r[0];let s=(0,n.X)(e),{isServer:c}=(0,i.V)(),u=0;if(s?u=1:c||(u=2),!l.has(u)){var d;let e=a;s||c||(e=Object.keys(a).reduce((e,t)=>{let r=a[t];return e[t]={hotkey:r.hotkey?.replace(/Meta/g,"Control"),text:r.text?.replace(/\u2318/g,"Ctrl").replace(/\u21e7/g,"Shift"),ariaKeyShortcuts:r.ariaKeyShortcuts?.replace(/Meta/g,"Control"),useWhileBlobFocused:r.useWhileBlobFocused,modifierRequired:r.modifierRequired,noModifierHotkey:r.noModifierHotkey},e},{})),c&&(e=Object.keys(d=e).reduce((e,t)=>{let r=d[t];return e[t]={hotkey:void 0,text:r.text?.replace(/\u2318/g,"Ctrl").replace(/\u21e7/g,"Shift"),ariaKeyShortcuts:r.ariaKeyShortcuts?.replace(/Meta/g,"Control"),useWhileBlobFocused:r.useWhileBlobFocused,modifierRequired:r.modifierRequired,noModifierHotkey:r.noModifierHotkey},e},{})),l.set(u,e)}return r[1]!==u?(t=l.get(u),r[1]=u,r[2]=t):t=r[2],t}function c(){let e,t=(0,o.c)(2),r=s();return t[0]!==r?(e=Object.keys(r).reduce((e,t)=>{let o=r[t];if(o.useWhileBlobFocused&&o.noModifierHotkey&&o.modifierRequired)for(let t of o.noModifierHotkey)e.includes(t)||e.push(t);return e},[]),t[0]=r,t[1]=e):e=t[1],e}function u(){let e,t=(0,o.c)(2),r=s();return t[0]!==r?(e=Object.keys(r).reduce((e,t)=>{let o=r[t];if(o.useWhileBlobFocused&&o.noModifierHotkey&&!o.modifierRequired)for(let t of o.noModifierHotkey)e.includes(t)||e.push(t);return e},[]),t[0]=r,t[1]=e):e=t[1],e}},60854(e,t,r){r.d(t,{f:()=>i});var o=r(78597);async function i(e){let t=await (0,o.lS)(`${e}?noancestors=1`);if(!t.ok)throw Error(`Failed to fetch tree data: ${t.status} ${t.statusText}`);let r=await t.json();return"codeViewTreeRoute"in r.payload?{tree:{items:r.payload.codeViewTreeRoute.tree.items,totalCount:r.payload.codeViewTreeRoute.tree.totalCount}}:{tree:{items:r.payload.tree.items,totalCount:r.payload.tree.totalCount}}}},70760(e,t,r){r.d(t,{Uy:()=>z,H:()=>p,qn:()=>ew,c2:()=>ef,Nq:()=>K});var o=r(74848),i=r(16522),n=r(18660),a=r(23082),l=r(26440),s=r(19519),c=r(38621),u=r(21373),d=r(34164),f=r(96540);let m=e=>{let t,r,f,m,h,p,g=(0,i.c)(32),{ref:y,expanded:_,onToggleExpanded:x,className:w,ariaControls:v,textAreaId:R,useFilesButtonBreakpoint:F,variant:b,getTooltipDirection:k}=e,S=void 0===F||F,{toggleTreeShortcut:C}=(0,a.wk)(),{isServer:N}=(0,s.V)();g[0]!==_||g[1]!==k?(t=k?.(_)??"se",g[0]=_,g[1]=k,g[2]=t):t=g[2];let T=t;g[3]!==_||g[4]!==N||g[5]!==x||g[6]!==y||g[7]!==C.hotkey||g[8]!==S||g[9]!==b?(r=S&&(!_||N)&&(0,o.jsx)(u.Q,{"aria-label":"Expand file tree",leadingVisual:c.ArrowLeftIcon,"data-hotkey":C.hotkey,"data-testid":"expand-file-tree-button-mobile",ref:y,onClick:x,variant:b??"invisible",className:"ExpandFileTreeButton-module__Button_1__Svs95",children:"Files"}),g[3]=_,g[4]=N,g[5]=x,g[6]=y,g[7]=C.hotkey,g[8]=S,g[9]=b,g[10]=r):r=g[10];let j=C.hotkey,A=S&&(!_||N);g[11]!==w||g[12]!==A?(f=(0,d.$)(w,"position-relative","ExpandFileTreeButton-module__expandButton__hDOcv",{"ExpandFileTreeButton-module__filesButtonBreakpoint__zEvz3":A}),g[11]=w,g[12]=A,g[13]=f):f=g[13];let E=_?"Collapse file tree":"Expand file tree";return g[14]!==v||g[15]!==_||g[16]!==x||g[17]!==y||g[18]!==f||g[19]!==E||g[20]!==C.hotkey||g[21]!==T||g[22]!==b?(m=(0,o.jsx)(l.L,{dataHotkey:j,className:f,expanded:_,alignment:"left",ariaLabel:E,tooltipDirection:T,testid:"file-tree-button",ariaControls:v,ref:y,variant:b,onToggleExpanded:x}),g[14]=v,g[15]=_,g[16]=x,g[17]=y,g[18]=f,g[19]=E,g[20]=C.hotkey,g[21]=T,g[22]=b,g[23]=m):m=g[23],g[24]!==x||g[25]!==R||g[26]!==C.hotkey?(h=(0,o.jsx)(n._,{buttonFocusId:R,buttonHotkey:C.hotkey,onButtonClick:x,onlyAddHotkeyScopeButton:!0}),g[24]=x,g[25]=R,g[26]=C.hotkey,g[27]=h):h=g[27],g[28]!==r||g[29]!==m||g[30]!==h?(p=(0,o.jsxs)(o.Fragment,{children:[r,m,h]}),g[28]=r,g[29]=m,g[30]=h,g[31]=p):p=g[31],p};m.displayName="ExpandFileTreeButton",m.displayName="ExpandFileTreeButton";var h=r(7231);function p(e){let t,r,l=(0,i.c)(8),{inputRef:s,onFindFilesShortcut:c,textAreaId:u}=e,{sendRepoKeyDownEvent:d}=(0,h.T)(),{findFilesShortcut:f}=(0,a.wk)();return l[0]!==s||l[1]!==c||l[2]!==d?(t=()=>{c?.(),s?.current?.focus(),d("GO_TO_FILE")},l[0]=s,l[1]=c,l[2]=d,l[3]=t):t=l[3],l[4]!==f.hotkey||l[5]!==t||l[6]!==u?(r=(0,o.jsx)(n._,{buttonFocusId:u,buttonHotkey:f.hotkey,onButtonClick:t}),l[4]=f.hotkey,l[5]=t,l[6]=u,l[7]=r):r=l[7],r}p.displayName="FindFilesShortcut";var g=r(82175),y=r(98779),_=r(56792),x=r(48337),w=r(20790),v=r(12191),R=r(54242),F=r(66743),b=r(23666),k=r(77236),S=r(31854),C=r(88134),N=r(29941),T=r(47819),j=r(26108),A=r(87555),E=r(209),I=r(10095),B=r(27104);let M=(0,f.createContext)({knownFolders:new Map,dispatchKnownFolders:()=>{}});M.displayName="FileTreeContext";var P=r(60854);let H="ReposFileTreePane-module__HideTree__AYZnm",L="ReposFileTreePane-module__PaneContentsHiddenOnNarrow__KY_EL";var O=r(31595),W=r(76331),D=r(53035),$=r(60057),q=r(79040),V=r(4625),U=r(7478);let G=(0,f.createContext)({});function K(e){let t,r,n,a,l,s=(0,i.c)(6),{children:c}=e,u=(0,f.useRef)(!1),d=(0,f.useRef)(!1),m=(0,f.useRef)(!0);s[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{u.current=e},s[0]=t):t=s[0];let h=t;s[1]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{d.current=e},s[1]=r):r=s[1];let p=r;s[2]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{m.current=e},s[2]=n):n=s[2];let g=n;s[3]===Symbol.for("react.memo_cache_sentinel")?(a={expandAllFolders:u,refreshTree:d,shouldFetchFolders:m,setExpandAllFolders:h,setRefreshTree:p,setShouldFetchFolders:g},s[3]=a):a=s[3];let y=a;return s[4]!==c?(l=(0,o.jsx)(G,{value:y,children:c}),s[4]=c,s[5]=l):l=s[5],l}function z(){return(0,f.use)(G)}G.displayName="FileTreeControlContext",K.displayName="FileTreeControlProvider";var Z=r(52870);function J(e,t,r){let o=[];for(let i of t)if(i.startsWith(e)){let t=i.slice(e.length+1),n=t.indexOf("/"),a=n>0?t.slice(0,n):t,l=`${e}/${a}`;if(r&&r.some(e=>e.path===l))continue;let s={items:[],data:{contentType:l===i?"file":"directory",name:a,path:l,isClientOnly:!0}};o.push(s)}return o}function X(e,t,r){e.data.name=e.data.name.slice(e.data.name.lastIndexOf("/")+1,e.data.name.length);let o=t.name.slice(0,t.name.lastIndexOf("/")),i=o.indexOf("/")>-1,n={path:t.path.slice(0,t.path.lastIndexOf("/")),contentType:t.contentType,name:o,hasSimplifiedPath:i},a={items:[e],data:n};return(r.set(n.path,a),i)?X(a,{...n},r):a}function Y(e,t,r,o,i=!1){if(!e)return{newRootItems:r,rootItemsUpdated:!1,itemsAdded:!1};let n=!!e[""]&&Q("",t,r,e[""].items);o?.(r);let a=n;for(let n of Object.keys(e).sort())if(n){let l=t.get(n);if(l){let s=l.items.length;if(Q(n,t,l.items,e[n].items,o),l.data.totalCount=e[n].totalCount,l.items.length>s&&(a=!0),i&&l.items.length>s){let e={...l,items:[...l.items]};t.set(n,e),function(e,t,r,o){let i=r.lastIndexOf("/");if(-1===i){let e=t.findIndex(e=>e.data.path===r);-1!==e&&(t[e]=o)}else{let t=r.substring(0,i),n=e.get(t);if(n){let e=n.items.findIndex(e=>e.data.path===r);-1!==e&&(n.items[e]=o)}}}(t,r,n,e)}}}return{newRootItems:r,rootItemsUpdated:n,itemsAdded:a}}function Q(e,t,r,o,i){let n=!1;for(let a of o){let o=e?`${e}/${a.name}`:a.name;if(!t.get(o)){let e={items:[],data:{...a}};if(t.set(o,e),a.hasSimplifiedPath){let o=X(e,a,t),l=r.findIndex(e=>e.data.path===o.data.path);-1!==l?o.items.length>r[l].items.length&&(r[l]=o,n=!0):(r.push(o),i?.(r))}else r.push(e),i?.(r)}}return n}function ee(e){let t,r,n,a,l,s,u,d,m,p,g,y,_=(0,i.c)(43),{isActive:x,file:w,onItemSelected:v,getItemUrl:R,selectedItemRef:F,navigate:b,onRenderRow:k,getFileTrailingVisual:S,getFileIcon:C}=e,{sendRepoClickEvent:N}=(0,h.T)(),T=f.useRef(null);_[0]===Symbol.for("react.memo_cache_sentinel")?(t={focusRowRef:T,mouseRowRef:T},_[0]=t):t=_[0];let j=(0,$.Z)(t),A="submodule"===w.data.contentType;_[1]!==w.data||_[2]!==S?(r=S?.(w.data),_[1]=w.data,_[2]=S,_[3]=r):r=_[3];let E=r;_[4]!==w.data||_[5]!==R||_[6]!==x||_[7]!==A||_[8]!==b||_[9]!==v||_[10]!==N?(n=e=>{A?(e.preventDefault(),w.data.submoduleUrl&&(window.location.href=w.data.submoduleUrl)):e.metaKey||e.ctrlKey||1===e.button?(window.open(R(w.data),"_blank"),e.preventDefault()):x?e.preventDefault():(v?.(),N("FILES_TREE.ITEM",{item_path:w.data.path}),b(R(w.data)),e.stopPropagation())},_[4]=w.data,_[5]=R,_[6]=x,_[7]=A,_[8]=b,_[9]=v,_[10]=N,_[11]=n):n=_[11];let I=n;k?.();let B=`${w.data.path}-item`,M=x?void 0:"auto 2rem";_[12]!==w.data||_[13]!==C||_[14]!==A?(a=C?C(w.data):A?(0,o.jsx)(c.FileSubmoduleIcon,{}):(0,o.jsx)(c.FileIcon,{}),_[12]=w.data,_[13]=C,_[14]=A,_[15]=a):a=_[15],_[16]!==a?(l=(0,o.jsx)(V.G.LeadingVisual,{children:a}),_[16]=a,_[17]=l):l=_[17];let P=A?"var(--fgColor-accent, var(--color-accent-fg))":void 0;return _[18]!==P?(s={color:P},_[18]=P,_[19]=s):s=_[19],_[20]!==w.data.name||_[21]!==F||_[22]!==s?(u=(0,o.jsx)("span",{ref:F,style:s,children:w.data.name}),_[20]=w.data.name,_[21]=F,_[22]=s,_[23]=u):u=_[23],_[24]!==w.data.name||_[25]!==j?(d=j&&(0,o.jsx)(W.m,{"data-testid":`${w.data.name}-item-tooltip`,id:`${w.data.name}-item-tooltip`,contentRef:T,"aria-label":w.data.name,open:!0,direction:"ne"}),_[24]=w.data.name,_[25]=j,_[26]=d):d=_[26],_[27]!==u||_[28]!==d?(m=(0,o.jsxs)(o.Fragment,{children:[u,d]}),_[27]=u,_[28]=d,_[29]=m):m=_[29],_[30]!==E?(p=!!E?.screenReaderText&&(0,o.jsx)("span",{className:"sr-only",children:E.screenReaderText}),_[30]=E,_[31]=p):p=_[31],_[32]!==E?(g=!!E?.trailingVisual&&(0,o.jsx)(V.G.TrailingVisual,{children:E.trailingVisual}),_[32]=E,_[33]=g):g=_[33],_[34]!==x||_[35]!==I||_[36]!==m||_[37]!==p||_[38]!==g||_[39]!==B||_[40]!==M||_[41]!==l?(y=(0,o.jsxs)(V.G.Item,{ref:T,onSelect:I,current:x,id:B,containIntrinsicSize:M,children:[l,m,p,g]}),_[34]=x,_[35]=I,_[36]=m,_[37]=p,_[38]=g,_[39]=B,_[40]=M,_[41]=l,_[42]=y):y=_[42],y}ee.displayName="WrappedFileTreeRow";let et=f.memo(ee);function er({clientOnlyFilePaths:e,directory:t,isActive:r,isAncestorOfActive:i,leadingPath:n="",onItemSelected:a,dispatchKnownFolders:l,getItemUrl:s,getFetchUrl:c,selectedItemRef:u,navigate:d,onRenderRow:m,getFileTrailingVisual:p,getFileIcon:g,navigateOnClick:y=!0,treeName:_}){let{expandAllFolders:x,shouldFetchFolders:w}=z(),[v,R]=(0,f.useState)(x?.current||i),{sendRepoClickEvent:F}=(0,h.T)(),b=f.useRef(null),k=f.useRef(null),S=(0,$.Z)({focusRowRef:k,mouseRowRef:b}),[C,N,T,j,A,E,I]=function(e,t,r){let[o,i]=f.useState(e.items),[n,a]=f.useState(e.data.totalCount||0),[l,s]=f.useState(!1),[c,u]=f.useState(!1),{safeSetTimeout:d}=(0,Z.A)();f.useEffect(()=>{i(e.items)},[e.items]),f.useEffect(()=>{void 0!==e.data.totalCount&&a(e.data.totalCount)},[e.data.totalCount]);let m=f.useCallback(()=>{u(!1)},[]),h=f.useCallback((e,t)=>{let r=e||[...o];i(r.slice(0,100)),d(()=>{i(r),void 0!==t&&a(t)},1)},[o,d]);return[f.useCallback(async o=>{let n=new Map;if(e.data.isClientOnly){if(o){let r=J(e.data.path,o);for(let e of r)n.set(e.data.path,e);t({type:"add",folders:n,processingTime:0}),r.length>100?h(r,r.length):(i(r),a(r.length))}}else{let l=r(e.data);u(!1),s(!0);let c=Date.now();try{let r=await (0,P.f)(l),s=r.tree.items.map(e=>{let t={items:[],data:{...e},autoExpand:"directory"===e.contentType&&1===r.tree.items.length};return(n.set(e.path,t),e.hasSimplifiedPath)?X(t,e,n):t});if(o){let t=e.data.path,i=J(t,o,r.tree.items);for(let e of(s.push(...i),i))n.set(e.data.path,e)}t({type:"add",folders:n,processingTime:Date.now()-c}),e.items=s,e.data.totalCount=r.tree.totalCount,s.length>100?h(s,r.tree.totalCount):(i(s),a(r.tree.totalCount))}catch{u(!0)}}s(!1)},[r,e,t,h]),h,o,l,c,m,n]}(t,l,c),B=I-T.length,M=n?`${n}/`:"";(0,f.useEffect)(()=>{x?.current&&!v&&R(!0)},[t,x,v]);let H=f.useCallback(o=>{x?.current&&(x.current=!1),o&&!v&&!j&&!A&&(t.items.length>100?N():0!==t.items.length||r||i||w?.current===!1||C(e)),o!==v&&R(o)},[x,v,j,A,t.items.length,r,i,w,N,C,e]),L=f.useCallback(e=>{e.metaKey||e.ctrlKey||1===e.button&&y?(window.open(s(t.data),"_blank"),e.preventDefault()):r?e.preventDefault():(a?.(),F("FILES_TREE.ITEM",{item_path:t.data.path}),y?d(s(t.data)):H?.(!v),e.stopPropagation())},[t.data,s,r,v,d,y,a,H,F]);f.useEffect(()=>{i&&!v&&H?.(!0)},[i]),f.useEffect(()=>{0===t.items.length&&v?H?.(!1):!v&&t.autoExpand&&H?.(!0)},[t.items.length]);let O=f.useCallback(e=>{u&&r&&u(e),b.current=e},[u,r]);return 1===t.items.length&&"directory"===t.items[0].data.contentType?(0,o.jsx)(en,{clientOnlyFilePaths:e,directoryItems:t.items,leadingPath:M+t.data.name,inheritsActive:r,dispatchKnownFolders:l,onItemSelected:a,selectedItemRef:u,getItemUrl:s,directoryNavigateOnClick:y,getFileTrailingVisual:p,getFileIcon:g,treeName:_}):(m?.(),(0,o.jsxs)(V.G.Item,{ref:k,expanded:v,onExpandedChange:H,current:r,onSelect:L,id:`${t.data.path}-item`,containIntrinsicSize:r?void 0:"auto 2rem",children:[(0,o.jsx)(V.G.LeadingVisual,{children:(0,o.jsx)(V.G.DirectoryIcon,{})}),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("span",{ref:O,children:[M,t.data.name]}),S&&(0,o.jsx)(W.m,{"data-testid":`${t.data.name}-directory-item-tooltip`,id:`${t.data.name}-directory-item-tooltip`,contentRef:k,"aria-label":`${M}${t.data.name}`,open:!0,direction:"ne"})]}),(0,o.jsx)(V.G.SubTree,{state:j?"loading":A?"error":"done",children:A?(0,o.jsx)(V.G.ErrorDialog,{onRetry:C,onDismiss:E,children:"There was an error loading the folder contents."}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(en,{clientOnlyFilePaths:e,directoryItems:T,dispatchKnownFolders:l,onItemSelected:a,selectedItemRef:u,getItemUrl:s,directoryNavigateOnClick:y,getFileTrailingVisual:p,getFileIcon:g,treeName:_}),B>0&&(0,o.jsx)(el,{message:`${B} entries not shown`})]})})]}))}et.displayName="FileTreeRow",er.displayName="WrappedDirectoryTreeRow";let eo=f.memo(er);function ei({clientOnlyFilePaths:e,directoryItems:t,leadingPath:r,inheritsActive:i,onItemSelected:n,dispatchKnownFolders:a,selectedItemRef:l,onRenderRow:s,getItemUrl:c,getFileTrailingVisual:u,getFileIcon:d,directoryNavigateOnClick:m=!0,treeName:h}){let p=(0,O.l)(),g=(0,v.Z)(),y=(0,q.Zp)(),_=f.useRef(y);return(0,o.jsx)(o.Fragment,{children:t.map(t=>{let f=p===t.data.path,y=f||p.startsWith(`${t.data.path}/`);return"directory"===t.data.contentType?(0,o.jsx)(eo,{clientOnlyFilePaths:e,isActive:i||f,isAncestorOfActive:y,onItemSelected:n,leadingPath:r,directory:t,dispatchKnownFolders:a,getItemUrl:c,getFetchUrl:g.getItemUrl,selectedItemRef:y?l:void 0,navigate:_.current,onRenderRow:s,navigateOnClick:m,getFileTrailingVisual:u,getFileIcon:d,itemCount:t.items.length,treeName:h},t.data.name):(0,o.jsx)(et,{onItemSelected:n,file:t,isActive:f,getItemUrl:c,selectedItemRef:f?l:void 0,navigate:_.current,onRenderRow:s,getFileTrailingVisual:u,getFileIcon:d,treeName:h},t.data.name)})})}eo.displayName="DirectoryTreeRow",ei.displayName="WrappedDirectoryContents";let en=f.memo(ei);function ea(e){let{clientOnlyFilePaths:t,data:r,rootItems:i,setRootItems:n,fetchError:a,incompleteFileTree:l,processingTime:s,loading:c,onRenderRow:u,getItemUrl:m,getFileTrailingVisual:h,getFileIcon:p,sortDirectoryItems:g,treeName:y}=e,{knownFolders:_,dispatchKnownFolders:x}=(0,f.use)(M),{refreshTree:w}=z(),v=(0,D.E)();f.useEffect(()=>{if(c)return;let e=new Map,t=[];w?.current||(e=new Map(_),t=i.slice());let{newRootItems:o,rootItemsUpdated:a,itemsAdded:l}=Y(r,e,t,g,v),u=v&&l;(o.length>i.length||a||u||w?.current)&&n(o),(e.size>_.size||u||w?.current)&&x({type:"set",folders:e,processingTime:s}),w?.current&&(w.current=!1)},[r,c]);let R=f.useCallback(e=>{1===e.button&&e.preventDefault()},[]);return(0,o.jsx)(o.Fragment,{children:(0,o.jsx)("div",{onMouseDown:R,className:(0,d.$)(e.className,"ReposFileTreeView-module__Box__vkb5W"),"data-testid":"repos-file-tree-container",children:c?(0,o.jsx)("div",{className:"ReposFileTreeView-module__Box_1__97JKJ",children:(0,o.jsx)(U.A,{"aria-label":"Loading file tree"})}):(0,o.jsx)("nav",{"aria-label":"File Tree Navigation",children:(0,o.jsxs)(V.G,{"aria-label":"Files",children:[a&&(0,o.jsx)(el,{message:"Some files could not be loaded."}),l&&(0,o.jsx)(el,{message:"Sign in to see the full file tree."}),(0,o.jsx)(en,{clientOnlyFilePaths:t,directoryItems:i,onItemSelected:e.onItemSelected,dispatchKnownFolders:x,selectedItemRef:e.selectedItemRef,onRenderRow:u,directoryNavigateOnClick:e.directoryNavigateOnClick,getItemUrl:m,getFileTrailingVisual:h,getFileIcon:p,treeName:y})]})})})})}function el(e){let t,r,n=(0,i.c)(3),{message:a}=e,l=a||"Couldn't load.";return n[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,o.jsx)(V.G.LeadingVisual,{children:(0,o.jsx)(I.A,{icon:c.AlertFillIcon,className:"ReposFileTreeView-module__Octicon__GMgHV"})}),n[0]=t):t=n[0],n[1]!==l?(r=(0,o.jsxs)(V.G.Item,{id:"error-tree-row",children:[t,(0,o.jsx)("div",{className:"ReposFileTreeView-module__Box_2__y5uWW",children:l})]}),n[1]=l,n[2]=r):r=n[2],r}en.displayName="DirectoryContents",ea.displayName="ReposFileTreeView",el.displayName="ErrorTreeRow";var es=r(25445),ec=r(86733);function eu(e){let t,r,l,s,u,f=(0,i.c)(15),{className:m,onClick:h,textAreaId:p}=e,{searchShortcut:g}=(0,a.wk)();return f[0]!==m?(t=(0,d.$)("SearchButton-module__IconButton__SBlqu",m),f[0]=m,f[1]=t):t=f[1],f[2]!==h||f[3]!==t?(r=(0,o.jsx)(ec.N,{"aria-label":"Search this repository",tooltipDirection:"nw",icon:c.SearchIcon,commandId:"global-navigation:search",size:"medium",className:t,onClick:h}),f[2]=h,f[3]=t,f[4]=r):r=f[4],f[5]!==h||f[6]!==p?(l=()=>{let e=document.getElementById(p);h?.(),(0,es.Z)({retainScrollPosition:!0,returnTarget:e??void 0})},f[5]=h,f[6]=p,f[7]=l):l=f[7],f[8]!==g.hotkey||f[9]!==l||f[10]!==p?(s=(0,o.jsx)(n._,{buttonFocusId:p,buttonHotkey:g.hotkey,onButtonClick:l,onlyAddHotkeyScopeButton:!0}),f[8]=g.hotkey,f[9]=l,f[10]=p,f[11]=s):s=f[11],f[12]!==r||f[13]!==s?(u=(0,o.jsxs)(o.Fragment,{children:[r,s]}),f[12]=r,f[13]=s,f[14]=u):u=f[14],u}eu.displayName="SearchButton";let ed=S.Gy.xxxlarge;function ef({clientOnlyFilePaths:e,collapseTree:t,showTree:r,fileTree:i,treeToggleElement:n,treeToggleRef:a,onItemSelected:l,processingTime:u,searchBoxRef:m,repo:h,path:F,refInfo:O,isFilePath:W,foldersToFetch:D,incompleteFileTree:$,id:q,onFindFilesShortcut:V,textAreaId:U,getItemUrlOverride:G,headerClassName:K,paneClassName:z,paneContentsClassName:Z,treeContainerClassName:J,findFileWorkerPath:X,headerContent:Q,getFileTrailingVisual:ee,getFileIcon:et,sortDirectoryItems:er,showFindFile:eo=!0,directoryNavigateOnClick:ei=!0,showRefSelectorRow:en=!0,paneResizable:el=!0}){if(eo&&void 0===X)throw Error("findFileWorkerPath must be provided when showFindFile is true");let es=(0,w.RF)(),{canEdit:ec,fileExistsOnDefault:ep}=(0,_.M)(),[eg,ey]=f.useState(D.length>0),[e_,ex]=f.useState(!1),ew=f.useRef([]),ev=f.useRef(0),eR=f.useRef(null),eF=f.useRef(null),eb=f.useRef(!1),ek=f.useRef(null),{query:eS}=(0,x.JS)(),eC=f.useRef(eS);eC.current=eS;let{codeCenterOption:eN}=(0,C.ud)(),eT=f.useRef(es),{isServer:ej}=(0,s.V)(),{defaultBranch:eA}=(0,R.t)(),{getItemUrl:eE}=(0,v.Z)(),eI=G||eE,eB=[],eM=new Map,eP=f.useRef(eg);!eP.current&&i&&(eB=Y(i,eM,[],er).newRootItems),eP.current=!0;let[eH,eL]=f.useReducer(em,eM),[eO,eW]=f.useState(eB);f.useEffect(()=>{r&&(!eS||window.matchMedia(`(min-width: ${S.Gy.large}px)`).matches)||(ek.current=null)},[r,eS]),f.useEffect(()=>{es&&eT.current!==es&&window.matchMedia(`(max-width: ${ed-1}px)`).matches&&t({setPreference:!1}),eT.current=es},[t,es]);let eD=f.useCallback(async e=>{let t=eE({contentType:"directory",path:e,name:e});try{let r=await (0,P.f)(t),o={items:r.tree.items,totalCount:r.tree.totalCount};i[e]=o}catch{ex(!0)}ew.current.push(e),ev.current-=1,0===ev.current&&ey(!1)},[i,eE]);f.useEffect(()=>{if($)return void ey(!1);if(!D||0===D.length)return;let e=D.filter(e=>!ew.current.includes(e));if(e.length>0)for(let t of(ev.current+=e.length,ey(!0),e))eD(t)},[eD,D,$]);let e$=f.useCallback(e=>{if(r&&(!eC.current||window.matchMedia(`(min-width: ${S.Gy.large}px)`).matches)&&eR.current&&e){let t=eR.current.clientHeight;(0,N.Rt)(e,eR.current,{endMargin:t/2,startMargin:t/2,behavior:"auto"})}},[r]),eq=f.useCallback(e=>{e&&eb.current?eb.current=!1:ek.current!==e&&e$(e),ek.current=e},[e$]),eV=f.useCallback(e=>{eR.current=e,window.matchMedia(`(min-width: ${ed}px)`).matches&&e$(ek.current)},[e$]),eU=f.useCallback(e=>{e&&e$(ek.current)},[e$]),{screenSize:eG}=(0,S.lm)(),eK=!ej&&(es&&eG=S.Gy.large,ez=f.useCallback(()=>{eK||l(),eb.current=!0},[l,eK]),eZ=W?F.substring(0,F.lastIndexOf("/")):F,eJ=(0,f.useMemo)(()=>({knownFolders:eH,dispatchKnownFolders:eL}),[eH]),eX=f.useMemo(()=>ej?null:(0,B.KF)(),[ej]),eY=f.useCallback(()=>{window.matchMedia(`(min-width: ${S.Gy.large+1}px) and (max-width: ${S.Gy.xxxxlarge-1}px)`).matches&&t({setPreference:!1})},[t]),eQ=O.name===eA,e0=(0,o.jsxs)("div",{id:q,className:(0,d.$)("ReposFileTreePane-module__PaneContents__SJjfF",ej&&L,Z),children:[(0,o.jsxs)("div",{className:(0,d.$)(K,"ReposFileTreePane-module__Box_1__PpIop"),children:[Q,en&&(0,o.jsxs)("div",{className:"ReposFileTreePane-module__Box_2__g74WI",children:[(0,o.jsx)("div",{className:"ReposFileTreePane-module__Box_3__D6cTp",children:eQ||void 0===ep?(0,o.jsx)(y.R,{buttonClassName:"react-repos-tree-pane-ref-selector width-full ref-selector-class",allowResizing:!0}):(0,o.jsxs)(T.A,{className:"ReposFileTreePane-module__FullWidthButtonGroup__tyEfq",children:[ep?(0,o.jsx)(j.K,{icon:c.ChevronLeftIcon,"aria-label":"View file on default branch",as:k.N,to:(0,b.IO9)({repo:h,commitish:eA,action:"blob",path:F})}):(0,o.jsx)(j.K,{icon:c.ChevronLeftIcon,"aria-label":"View file on default branch",description:"File does not exist on default branch","aria-disabled":!0,inactive:!0}),(0,o.jsx)(y.R,{buttonClassName:"react-repos-tree-pane-ref-selector width-full ref-selector-class",allowResizing:!0})]})}),(0,o.jsxs)("div",{className:"ReposFileTreePane-module__Box_4__DG4pa",children:[ec&&(0,o.jsx)(j.K,{"aria-label":"Add file",tooltipDirection:"n",as:k.N,icon:c.PlusIcon,to:(0,b.IO9)({repo:h,path:eZ,commitish:O.name,action:"new"}),onClick:ez,className:"ReposFileTreePane-module__IconButton__rGggU"}),(0,o.jsx)(eu,{className:ec?"ReposFileTreePane-module__SearchButtonWithLeftBorder__TBrDc":void 0,onClick:eY,textAreaId:U})]})]})]}),O.currentOid&&eo&&X&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.default,{commitOid:O.currentOid,findFileWorkerPath:X,onItemSelected:l,searchBoxRef:m,className:(0,d.$)("ReposFileTreePane-module__FileResultsList__zmSnM",ej&&L)}),(0,o.jsx)(p,{inputRef:m,onFindFilesShortcut:V,textAreaId:U})]}),(0,o.jsx)(eh,{scrollingRef:eR,sentinelRef:eF}),(0,o.jsxs)("div",{ref:eV,className:(0,d.$)("ReposFileTreePane-module__Box_5__Zy_o6",ej&&L),children:[(0,o.jsx)("div",{ref:eF,style:{height:1,marginTop:-1,width:"100%",flexShrink:0}}),ej?O.currentOid&&(0,o.jsx)("div",{className:eS?"react-tree-show-tree-items-on-large-screen":"react-tree-show-tree-items",children:(0,o.jsx)(ea,{clientOnlyFilePaths:e,data:i,rootItems:eO,selectedItemRef:eq,setRootItems:eW,onItemSelected:ez,processingTime:u,loading:eg,fetchError:e_,incompleteFileTree:$,directoryNavigateOnClick:ei,getItemUrl:eI,className:J,getFileTrailingVisual:ee,getFileIcon:et,sortDirectoryItems:er,treeName:O.name})}):eX&&(0,o.jsx)(B.bL,{node:eX}),!O.currentOid&&!h.isEmpty&&(0,o.jsxs)("div",{className:"ReposFileTreePane-module__Box_6__KnilA",children:[(0,o.jsx)(I.A,{icon:c.AlertFillIcon}),"\xa0Ref is invalid"]})]})]});return(0,o.jsxs)(M,{value:eJ,children:[eX&&(0,o.jsx)(B.oj,{node:eX,children:O.currentOid&&(0,o.jsx)("div",{className:eS?"react-tree-show-tree-items-on-large-screen":"react-tree-show-tree-items",children:(0,o.jsx)(ea,{clientOnlyFilePaths:e,data:i,directoryNavigateOnClick:ei,rootItems:eO,selectedItemRef:eq,setRootItems:eW,onItemSelected:ez,processingTime:u,loading:eg,fetchError:e_,incompleteFileTree:$,getItemUrl:eI,className:J,getFileTrailingVisual:ee,getFileIcon:et,sortDirectoryItems:er,treeName:O.name})})}),!r&&eN.enabled&&n&&(0,o.jsx)("div",{className:"ReposFileTreePane-module__Box_7__T2yBS",children:n}),(0,o.jsx)(A.O7.Pane,{position:"start",sticky:!0,padding:"none",width:"large",resizable:!!el,widthStorageKey:"codeView.tree-pane-width",divider:{regular:"none",narrow:"none"},className:(0,d.$)("ReposFileTreePane-module__Pane__rBZpI",!r&&H,eK||es?"ReposFileTreePane-module__HidePaneWithTreeOverlay__mFFGX":"ReposFileTreePane-module__HidePane__VHAVt",z),children:r&&!eK&&(0,o.jsx)("div",{className:ej?es?"react-tree-pane-contents-3-panel":"react-tree-pane-contents":void 0,children:e0})}),r&&eK&&eT.current===es&&(0,o.jsx)(E.Ay,{className:(0,d.$)(ej?es?"react-tree-pane-overlay-3-panel":"react-tree-pane-overlay":void 0,"ReposFileTreePane-module__Overlay__Lgnte",!r&&H),ref:eU,returnFocusRef:a,onClickOutside:eY,onEscape:eY,top:0,position:"fixed",children:(0,o.jsx)(o.Fragment,{children:e0})})]})}function em(e,t){switch(t.type){case"set":{let r=e?.size>0;return(0,F.BI)("file-tree",{"fetch-count":r?t.folders.size-e.size:t.folders.size,"file-count":t.folders.size,"nav-type":r?"soft":"hard","processing-time":t.processingTime}),t.folders}case"add":{let r=new Map([...e,...t.folders]);return(0,F.BI)("file-tree",{"fetch-count":t.folders.size,"file-count":r.size,"nav-type":"fetch","processing-time":t.processingTime}),r}default:throw Error(`Unknown action type: ${t.type}`)}}function eh(e){let t,r,n,a=(0,i.c)(6),{scrollingRef:l,sentinelRef:s}=e,[c,u]=f.useState(!1);return a[0]!==l||a[1]!==s?(t=()=>{let e=s.current;if(!e||!l.current)return;let t=new IntersectionObserver(e=>{let[t]=e;u(!t.isIntersecting)},{root:l.current,threshold:0});return t.observe(e),()=>t.disconnect()},r=[l,s],a[0]=l,a[1]=s,a[2]=t,a[3]=r):(t=a[2],r=a[3]),f.useEffect(t,r),a[4]!==c?(n=c?(0,o.jsx)("div",{className:"ReposFileTreePane-module__Box_8__TLAjy"}):null,a[4]=c,a[5]=n):n=a[5],n}ef.displayName="ReposFileTreePane",eh.displayName="TreeBorder";var ep=r(58164),eg=r(17005),ey=r(36594),e_=r(26316),ex=r(46249);function ew(e,t,r,i,n,a="fileTreeExpanded",l){let{sendRepoClickEvent:s}=(0,h.T)(),c=(0,ey.i)(),u=a?(0,eg.Ri)(a):void 0,d=void 0===e_.XC,p=!c&&u&&"false"!==u.value||c&&r;void 0===p&&(p=!1);let g=(0,f.useRef)(null),y=(0,f.useRef)(null),{screenSize:_}=(0,S.lm)(),[x,w]=(0,f.useState)(p),v=(0,f.useRef)(p),R=(0,f.useRef)(!1),F=(0,f.useRef)(!1),b=(0,f.useCallback)(()=>!(t.current&&window.matchMedia(`(min-width: ${ed}px)`).matches||!t.current&&window.matchMedia(`(min-width: ${S.Gy.xlarge}px)`).matches),[t]);(0,f.useLayoutEffect)(()=>{let e=b();e||(R.current=!1),w((0,ep.q)()&&_{k.current=x}),(0,f.useLayoutEffect)(()=>{let e=t.current?ed:S.Gy.xlarge,r=_=e;r&&v.current&&!(0,ep.q)()&&k.current&&w(!1),o&&v.current&&!k.current&&w(!0)},[t,_]);let C=(0,f.useCallback)(e=>{if(w(!0),b()&&(R.current=!0),e?.setPreference&&(n?.(!0),v.current=!0,a)){let e=new Date(Date.now()+2592e6).toUTCString();(0,eg.TV)(a,"true",e)}e?.focus==="toggleButton"?requestAnimationFrame(()=>g.current?.focus()):e?.focus==="search"&&requestAnimationFrame(()=>y.current?.focus())},[a,2592e6,b,n]),N=(0,f.useCallback)(e=>{if(w(!1),R.current=!1,F.current=!0,e?.setPreference&&(n?.(!1),v.current=!1,a)){let e=new Date(Date.now()+2592e6).toUTCString();(0,eg.TV)(a,"false",e)}e?.focus==="toggleButton"&&requestAnimationFrame(()=>g.current?.focus())},[a,2592e6,n]),T=(0,f.useCallback)(e=>e&&window.matchMedia(`(min-width: ${ed}px)`).matches||!t.current&&window.matchMedia(`(min-width: ${S.Gy.xlarge}px)`).matches,[t]),j=(0,f.useCallback)(()=>{s(k.current?"FILES_TREE.HIDE":"FILES_TREE.SHOW"),k.current?N({focus:"toggleButton",setPreference:T(t.current)}):C({focus:"toggleButton",setPreference:T(t.current)})},[s,N,T,t,C]),A=void 0!==u||x||d?void 0:"react-tree-toggle-button-with-indicator",E=(0,f.useMemo)(()=>(0,o.jsx)(ex.A,{as:"h2",className:"use-tree-pane-module__Heading__s4QbZ",children:(0,o.jsx)(m,{expanded:x,ariaControls:e,onToggleExpanded:j,className:A,ref:g,textAreaId:i,...l})}),[x,e,j,A,i,l]);return{isTreeExpanded:x,expandTree:C,collapseTree:N,treeToggleElement:E,treeToggleRef:g,searchBoxRef:y}}},88134(e,t,r){r.d(t,{T2:()=>c,cp:()=>h,ud:()=>g});var o=r(74848),i=r(16522),n=r(35205),a=r(96540);let l=(0,n.A)("localStorage"),s="codeView.codeFolding",c="codeView.codeWrapping",u="codeView.centerView",d="codeView.openSymbolsOnClick",f=new Map([[s,"Show code folding buttons"],[c,"Wrap lines"],[u,"Center content"],[d,"Open symbols on click"]]),m=(0,a.createContext)({codeFoldingOption:{},codeWrappingOption:{},codeCenterOption:{},openSymbolsOption:{}});m.displayName="CodeViewOptionsContext";let h=e=>{let t,r,n=(0,i.c)(8),{children:a}=e,l=p(s,!0),f=p(c,!1),h=p(u,!1),g=p(d,!0);n[0]!==h||n[1]!==l||n[2]!==f||n[3]!==g?(t={codeFoldingOption:l,codeWrappingOption:f,codeCenterOption:h,openSymbolsOption:g},n[0]=h,n[1]=l,n[2]=f,n[3]=g,n[4]=t):t=n[4];let y=t;return n[5]!==a||n[6]!==y?(r=(0,o.jsx)(m,{value:y,children:a}),n[5]=a,n[6]=y,n[7]=r):r=n[7],r};function p(e,t){let r,o,n,s,c=(0,i.c)(11);c[0]!==e?(r=l.getItem(e),c[0]=e,c[1]=r):r=c[1];let u=r;c[2]!==t||c[3]!==u?(o=()=>u?"true"===u:t,c[2]=t,c[3]=u,c[4]=o):o=c[4];let[d,m]=(0,a.useState)(o);c[5]!==e?(n=f.get(e)||"",c[5]=e,c[6]=n):n=c[6];let h=n;return c[7]!==d||c[8]!==h||c[9]!==e?(s={name:e,enabled:d,setEnabled:m,label:h},c[7]=d,c[8]=h,c[9]=e,c[10]=s):s=c[10],s}function g(){return(0,a.use)(m)}h.displayName="CodeViewOptionsProvider"},15393(e,t,r){r.d(t,{X:()=>l});var o=r(16522),i=r(96540);function n(){return()=>{}}function a(){return!1}function l(e){let t,r=(0,o.c)(2);return r[0]!==e?(t=()=>{let t=function(){if("u"