티스토리 수익 글 보기
“use strict”;(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([[3951],{13523:(e,t,n)=>{n.d(t,{$r:()=>a,M1:()=>o,li:()=>i,pS:()=>c,wE:()=>l});var r=n(71315);let i=”X-Fetch-Nonce”,s=new Set;function a(e){s.add(e)}function o(){return s.values().next().value||””}function l(e){let t={};return void 0!==e&&(t[“X-Fetch-Nonce-To-Validate”]=e),void 0===e?t[i]=o():s.has(e)?t[i]=e:t[i]=Array.from(s).join(“,”),t}function c(){let e=r.XC?.head?.querySelector(‘meta[name=”fetch-nonce”]’)?.content||””;e&&a(e)}},24117:(e,t,n)=>{var r=n(7123),i=n(74848),s=n(96540),a=n(94236),o=n(29e3),l=n(15220),c=n(38621),u=n(96379);let d=async e=>{try{let t=await (0,u.DI)(“/notifications/subscribe”,{method:”POST”,body:e});if(t.ok)return{ok:!0,errorMsg:””};{let e=await t.json(),n=e.error?e.error:”Failed to update”;return{ok:!1,errorMsg:n}}}catch(e){return{ok:!1,errorMsg:e instanceof Error?e.message:”Failed to update”}}};var h=n(5524);let p=”none”,m=”watching”,f=”ignoring”,b=”custom”,y={[p]:”Participating and @mentions”,[m]:”All Activity”,[f]:”Ignore”,[b]:”Custom”},g={…y,[p]:”Participating”},w={[p]:”Watch”,[m]:”Unwatch”,[f]:”Stop ignoring”,[b]:”Unwatch”},x=[{name:y[p],description:”Only receive notifications from this repository when participating or @mentioned.”,subscriptionType:p},{name:y[m],description:”Notified of all notifications on this repository.”,subscriptionType:m},{name:y[f],description:”Never be notified.”,subscriptionType:f},{name:y[b],description:”Select events you want to be notified of in addition to participating and @mentions.”,trailingIcon:(0,s.createElement)(c.ArrowRightIcon),subscriptionType:b}],j=e=>e in w?w[e]:””;function v(e){return(0,i.jsx)(h.l,{selectionVariant:”single”,children:x.map((t,n)=>(0,i.jsxs)(s.Fragment,{children:[(0,i.jsxs)(h.l.Item,{selected:t.subscriptionType===e.selected,onSelect:()=>e.onSelect(t.subscriptionType),children:[(0,i.jsx)(“span”,{className:”SubscriptionList-module__subscriptionTypeName–feJ4k”,children:t.name}),(0,i.jsx)(h.l.Description,{variant:”block”,children:t.description}),t.trailingIcon?(0,i.jsx)(h.l.TrailingVisual,{children:t.trailingIcon}):null]}),n!==x.length-1?(0,i.jsx)(h.l.Divider,{}):””]},n))})}try{v.displayName||(v.displayName=”SubscriptionList”)}catch{}var S=n(86877),_=n(46720),C=n(5839),T=n(21373);function N(e){let[t,n]=(0,s.useState)(!1),[r,a]=(0,s.useState)(“”),o=e.items.filter(e=>e?.text?.toLowerCase().startsWith(r.toLowerCase()));return(0,i.jsx)(C.X,{title:”Select labels”,renderAnchor:({children:t,…n})=>0===e.items.length?(0,i.jsx)(T.Q,{…n,trailingAction:c.TriangleDownIcon,”aria-haspopup”:”dialog”,children:”No labels available”}):(0,i.jsxs)(T.Q,{…n,trailingAction:c.TriangleDownIcon,”aria-haspopup”:”dialog”,children:[(0,i.jsx)(“span”,{className:”color-fg-muted”,children:”Labels: “}),(0,i.jsx)(“span”,{id:”select-labels”,children:e.labelsText})]}),placeholder:”Filter labels”,open:t,onCancel:e.resetLabels,onOpenChange:(t,r)=>{n(t),”click-outside”===r&&e.applyLabels()},items:o,selected:e.selectedLabels,onSelectedChange:e.onChangeLabels,onFilterChange:a,showItemDividers:!0,overlayProps:{width:”small”,height:”medium”,maxHeight:”medium”}})}try{N.displayName||(N.displayName=”FilterLabels”)}catch{}var L=n(69726);function k(e){let[t,n]=(0,s.useState)(!1),r=(0,s.useCallback)(()=>(e.nextFocusRef?.current?.focus(),!0),[e.nextFocusRef]),a=(0,s.useCallback)(()=>{n(!0)},[]),o=(0,s.useCallback)(()=>{e.onApply(),setTimeout(()=>{e?.checkStatus&&e.checkStatus(a)},600)},[e,a]);return(0,i.jsxs)(“div”,{className:”FooterActions-module__footerContainer–sNVyn”,children:[e.showError?(0,i.jsx)(“span”,{className:”FooterActions-module__errorMessageText–LtM5d”,children:”Error. Please try again.”}):null,(0,i.jsxs)(“div”,{className:”FooterActions-module__buttonsContainer–XOX1_”,style:e.overrideButtonStyles??{padding:”var(–base-size-16)”},children:[!e.showError&&t?(0,i.jsx)(L.A,{size:”small”,className:”FooterActions-module__FooterActionsSpinner–WjF07″}):null,(0,i.jsx)(T.Q,{size:”small”,onClick:()=>e.onCancel(),onBlur:t=>{e.disabled&&r(t)},children:”Cancel”}),(0,i.jsx)(T.Q,{disabled:e.disabled,variant:”primary”,size:”small”,onClick:()=>o(),onBlur:r,className:”FooterActions-module__applyButton–Q5SC4″,children:”Apply”})]})]})}try{k.displayName||(k.displayName=”FooterActions”)}catch{}let I=e=>{let t=O(e,2);if(e.length>=2){if(2===e.length)return A(e);let n=O(e,3);if(n.length>30)return`${t.slice(0,30)}… +${e.length-2} more`;{let t=e.length>3?` +${e.length-3} more`:””;return`${n}${t}`}}if(1!==e.length)return”All”;{let t=e[0]?.text||””;return t.length>30?`${t.slice(0,30)}…`:t}},A=e=>{let t=e[0]?.text||””,n=O(e,2);return n.length>30?t.length>25?`${t.slice(0,25)}… +1 more`:`${n.slice(0,30)}…`:n},O=(e,t)=>e.slice(0,t).map(e=>e.text).join(“, “),P=e=>{switch(e){case”PullRequest”:return”Pull requests”;case”SecurityAlert”:return”Security alerts”;default:return`${e}s`}};function E(e){let[t,n]=(0,s.useState)(e.appliedThreads),[r,a]=(0,s.useState)(e.appliedLabels),[o,l]=(0,s.useState)(e.appliedLabels),[c,u]=(0,s.useState)(()=>I(e.appliedLabels));(0,s.useEffect)(()=>{e.appliedLabels.length>0&&!t.includes(“Issue”)&&n([…t,”Issue”])},[]);let d=(0,s.useCallback)(e=>{t&&t.includes(e)?n(t.filter(t=>t!==e)):n([…t,e])},[t]),h=(0,s.useCallback)(e=>{l(e),u(I(e))},[]),p=(0,s.useCallback)(()=>{a(o)},[o]),m=(0,s.useCallback)(()=>{l(r),u(I(r))},[r]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(“div”,{className:”ThreadList-module__threadContent–x7fVL”,children:e.subscribableThreadTypes.map((n,r)=>(0,i.jsxs)(“div”,{className:”ThreadList-module__threadRow–LKENb”,style:r===e.subscribableThreadTypes.length-1?{}:{borderBottom:”1px solid var(–borderColor-default, var(–color-border-default))”},children:[(0,i.jsxs)(S.A,{children:[(0,i.jsx)(_.A,{checked:t.includes(n.name),onChange:()=>d(n.name)}),(0,i.jsx)(S.A.Label,{children:P(n.name)})]}),n.enabled?null:(0,i.jsxs)(“p”,{className:”ThreadList-module__threadDisabledMessage–kfUK2″,children:[P(n.name),” are not enabled for this repository”]}),(0,i.jsx)(“div”,{“aria-live”:”polite”,children:”Issue”===n.name&&e.showLabelSubscriptions&&t.includes(“Issue”)?(0,i.jsx)(“div”,{className:”ThreadList-module__filterContainer–R6lFt”,children:(0,i.jsx)(N,{items:e.repoLabels,labelsText:c,onChangeLabels:h,selectedLabels:o,applyLabels:p,resetLabels:m})}):null})]},r))}),(0,i.jsx)(k,{onCancel:e.cancelMenuCallback,onApply:()=>e.saveThreads(t,o),showError:e.showError,disabled:0===t.length||e.isSavingThreads})]})}try{E.displayName||(E.displayName=”ThreadList”)}catch{}function F({repositoryId:e,repositoryName:t,watchersCount:n,subscriptionType:r,subscribableThreadTypes:u,repositoryLabels:h,showLabelSubscriptions:y}){let w=(0,s.useMemo)(()=>h.map(e=>({id:e.id,text:e.name,selected:e.subscribed})),[h]),x=w.filter(e=>e.selected),S=(0,s.useMemo)(()=>u.map(e=>e.subscribed||”Issue”===e.name&&y&&x.length>0?e.name:null).filter(e=>null!==e),[u,y,x]),[_,C]=(0,s.useState)(!1),[T,N]=(0,s.useState)(!1),[L,k]=(0,s.useState)(!1),I=(0,s.useCallback)(()=>k(!1),[]),[A,O]=(0,s.useState)(S.length>0?b:r),[P,F]=(0,s.useState)(A),[R,M]=(0,s.useState)(S),[$,D]=(0,s.useState)(x),[X,B]=(0,s.useState)(!1),U=(0,s.useRef)(null),W=(0,s.useCallback)(()=>{N(!1),O(P)},[P]),H=(0,s.useCallback)(async(t,n)=>{B(!0),M(t),D(n),F(b);let r=new FormData;r.set(“do”,”custom”),r.set(“repository_id”,e),t.map(e=>{r.append(“thread_types[]”,e)}),n.map(e=>{e.id&&r.append(“labels[]”,e.id.toString())}),(await d(r)).ok?(N(!1),B(!1)):C(!0)},[e]),V=(0,s.useCallback)(async t=>{let n=new FormData;return t===f?n.set(“do”,”ignore”):t===m?n.set(“do”,”subscribed”):(t===p||t===b&&0===R.length)&&n.set(“do”,”included”),n.append(“thread_types[]”,””),n.set(“repository_id”,e),await d(n)},[e,R]),G=(0,s.useCallback)(async e=>{if(e===b)N(!0),O(b);else{let t=await V(e);t.ok?(O(e),F(e),M([])):”limit_exceeded”===t.errorMsg&&k(!0)}},[O]),Q=(0,s.useCallback)(e=>{M(e)},[M]),q=(0,s.useMemo)(()=>{let e,n;return e=j(A),n=g[A],A===f?`${e} in ${t}`:`${e}: ${n} in ${t}`},[A,t]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(“div”,{className:”d-md-none”,children:(0,i.jsxs)(a.W,{children:[(0,i.jsx)(a.W.Button,{“data-testid”:”notifications-subscriptions-menu-button-desktop”,leadingVisual:A===f?c.BellSlashIcon:c.EyeIcon,trailingAction:null,className:”NotificationsSubscriptionsMenu-module__watchButton–ccU5u”,”aria-label”:q,children:(0,i.jsx)(i.Fragment,{})}),(0,i.jsx)(a.W.Overlay,{width:”medium”,children:(0,i.jsx)(v,{selected:A,onSelect:G})})]})}),(0,i.jsx)(“div”,{className:”d-none d-md-block”,children:(0,i.jsxs)(a.W,{children:[(0,i.jsxs)(a.W.Button,{“data-testid”:”notifications-subscriptions-menu-button-mobile”,size:”small”,leadingVisual:A===f?c.BellSlashIcon:c.EyeIcon,className:”NotificationsSubscriptionsMenu-module__ActionMenuButton–UgYy6″,”aria-label”:q,children:[j(A),(0,i.jsx)(“span”,{className:”ml-2 Counter rounded-3 NotificationsSubscriptionsMenu-module__watchCounter–vgIup”,children:n})]}),(0,i.jsx)(a.W.Overlay,{width:”medium”,children:(0,i.jsx)(v,{selected:A,onSelect:G})})]})}),(0,i.jsx)(o.A,{className:”NotificationsSubscriptionsMenu-module__subscriptionDialog–H1n3k”,returnFocusRef:U,isOpen:T,onDismiss:()=>W(),”aria-labelledby”:”header”,children:(0,i.jsxs)(“div”,{“data-testid”:”inner”,children:[(0,i.jsxs)(o.A.Header,{id:”header”,children:[“Subscribe to events for “,t]}),(0,i.jsx)(E,{subscribableThreadTypes:u,showLabelSubscriptions:y,cancelMenuCallback:W,appliedThreads:R,repoLabels:w,subscribedThreads:S,applyThreads:Q,appliedLabels:$,saveThreads:H,showError:_,isSavingThreads:X})]})}),L&&(0,i.jsx)(l.l,{title:”Cannot watch this repository”,onClose:I,children:(0,i.jsxs)(l.l.Body,{children:[“You have reached the limit of 10,000 watched repositories. Update your”,” “,(0,i.jsx)(“a”,{href:”/watching”,children:”watch settings”}),” to continue.”]})})]})}try{F.displayName||(F.displayName=”NotificationsSubscriptionsMenu”)}catch{}(0,r.k)(“notifications-subscriptions-menu”,{Component:F})},28600:(e,t,n)=>{n.d(t,{A:()=>o});let{getItem:r,setItem:i,removeItem:s}=(0,n(82075).A)(“localStorage”),a=”REACT_PROFILING_ENABLED”,o={enable:()=>i(a,”true”),disable:()=>s(a),isEnabled:()=>!!r(a)}},31635:(e,t,n)=>{n.d(t,{AQ:()=>a,Cg:()=>i,Me:()=>o,N3:()=>s,Tt:()=>r,xN:()=>l});function r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&”function”==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);it.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function i(e,t,n,r){var i,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o–)(i=e[o])&&(a=(s<3?i(a):s>3?i(t,n,a):i(t,n))||a);return s>3&&a&&Object.defineProperty(t,n,a),a}function s(e){return this instanceof s?(this.v=e,this):new s(e)}function a(e,t,n){if(!Symbol.asyncIterator)throw TypeError(“Symbol.asyncIterator is not defined.”);var r,i=n.apply(e,t||[]),a=[];return r=Object.create((“function”==typeof AsyncIterator?AsyncIterator:Object).prototype),o(“next”),o(“throw”),o(“return”,function(e){return function(t){return Promise.resolve(t).then(e,u)}}),r[Symbol.asyncIterator]=function(){return this},r;function o(e,t){i[e]&&(r[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||l(e,t)})},t&&(r[e]=t(r[e])))}function l(e,t){try{var n;(n=i[e](t)).value instanceof s?Promise.resolve(n.value.v).then(c,u):d(a[0][2],n)}catch(e){d(a[0][3],e)}}function c(e){l(“next”,e)}function u(e){l(“throw”,e)}function d(e,t){e(t),a.shift(),a.length&&l(a[0][0],a[0][1])}}function o(e){var t,n;return t={},r(“next”),r(“throw”,function(e){throw e}),r(“return”),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:s(e[r](t)),done:!1}:i?i(t):t}:i}}function l(e){if(!Symbol.asyncIterator)throw TypeError(“Symbol.asyncIterator is not defined.”);var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=function(e){var t=”function”==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&”number”==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?”Object is not iterable.”:”Symbol.iterator is not defined.”)}(e),t={},r(“next”),r(“throw”),r(“return”),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){var s,a,o;s=r,a=i,o=(t=e[n](t)).done,Promise.resolve(t.value).then(function(e){s({value:e,done:o})},a)})}}}”function”==typeof SuppressedError&&SuppressedError},37285:(e,t,n)=>{n.d(t,{Av:()=>o,BM:()=>r,HX:()=>d,M_:()=>h,RD:()=>u,rb:()=>i});let r=”GraphQLTraces”,i=”GraphQLTracingRefresh”,s=a()?decodeURIComponent(new URLSearchParams(window.location.search).get(“disable_clusters”)||””).split(“,”).filter(e=>””!==e):[];function a(){return”undefined”!=typeof window}function o(e){if(!a()||!l()||!e)return;let t=window;t&&!t[r]&&(t[r]=[]),t&&e.__trace&&(t[r].push(e.__trace),”function”==typeof t[i]&&t[i]())}function l(){if(!a())return!1;let e=window;return”true”===new URLSearchParams(window.location.search).get(“_tracing”)||e&&void 0!==e[r]}function c(){return s.length>0}function u(e){if(!a()||!l()&&!c())return e;let t=new URL(e,window.location.origin);return l()&&t.searchParams.set(“_tracing”,”true”),c()&&t.searchParams.set(“disable_clusters”,s.join(“,”)),t.pathname+t.search}function d(e){return s.indexOf(e)>-1}function h(e){if(!a())return;let t=s.indexOf(e);t>-1?s.splice(t,1):s.push(e);let n=new URLSearchParams(window.location.search);n.set(“disable_clusters”,s.join(“,”)),window.location.search=n.toString()}},40064:(e,t,n)=>{n.d(t,{V:()=>h});var r=n(74848),i=n(96540),s=n(43258),a=n(38621),o=n(52870),l=n(56149);let c={info:””,success:”Toast–success”,error:”Toast–error”},u={info:(0,r.jsx)(a.InfoIcon,{}),success:(0,r.jsx)(a.CheckIcon,{}),error:(0,r.jsx)(a.StopIcon,{})},d=({message:e,timeToLive:t,icon:n,type:s=”info”,role:a=”log”})=>{let[d,h]=i.useState(!0),{safeSetTimeout:p}=(0,o.A)();return(0,i.useEffect)(()=>{t&&p(()=>h(!1),t-300)},[p,t]),(0,r.jsx)(l.ZL,{children:(0,r.jsx)(“div”,{className:”p-1 position-fixed bottom-0 left-0 mb-3 ml-3″,children:(0,r.jsxs)(“div”,{className:`Toast ${c[s]} ${d?”Toast–animateIn”:”Toast–animateOut”}`,id:”ui-app-toast”,”data-testid”:`ui-app-toast-${s}`,role:a,children:[(0,r.jsx)(“span”,{className:”Toast-icon”,children:n||u[s]}),(0,r.jsx)(“span”,{className:”Toast-content”,children:e})]})})})};try{d.displayName||(d.displayName=”Toast”)}catch{}function h(){let{toasts:e,persistedToast:t}=(0,i.useContext)(s.T8);return(0,r.jsxs)(r.Fragment,{children:[e.map((e,t)=>(0,r.jsx)(d,{message:e.message,icon:e.icon,timeToLive:s.Qn,type:e.type,role:e.role},t)),t&&(0,r.jsx)(d,{message:t.message,icon:t.icon,type:t.type,role:t.role})]})}try{h.displayName||(h.displayName=”Toasts”)}catch{}},50467:(e,t,n)=>{n.d(t,{_:()=>r});function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},51407:(e,t,n)=>{n.d(t,{Y:()=>r});function r(){let e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}},51987:(e,t,n)=>{n.d(t,{jC:()=>o,kt:()=>s,tV:()=>a});var r=n(87057),i=n(13523);function s(e){let t={“X-Requested-With”:”XMLHttpRequest”,…(0,i.wE)(e)};return{…t,[r.S]:(0,r.O)()}}function a(e,t){for(let[n,r]of Object.entries(s(t)))e.set(n,r)}function o(e){return{“X-GitHub-App-Type”:e}}},76143:(e,t,n)=>{n.d(t,{D:()=>s,Y:()=>a});var r=n(4559),i=n(71315);function s(e){if(!i.XC)return;let t=i.XC.querySelector(“title”),n=i.XC.createElement(“title”);n.textContent=e,t?t.textContent!==e&&(t.replaceWith(n),(0,r.i)(e)):(i.XC.head.appendChild(n),(0,r.i)(e))}function a(e){return document.body.classList.contains(“logged-out”)?`${e} \xb7 GitHub`:e}},87057:(e,t,n)=>{n.d(t,{O:()=>a,S:()=>s});var r=n(71315);let i=r.cg?.document?.head?.querySelector(‘meta[name=”release”]’)?.content||””,s=”X-GitHub-Client-Version”;function a(){return i}},96379:(e,t,n)=>{n.d(t,{DI:()=>a,QJ:()=>l,Sr:()=>c,lS:()=>o});var r=n(51987),i=n(88057),s=n(37285);async function a(e,t={}){let n,o,l,c;var u,d=e;if(new URL(d,window.location.origin).origin!==window.location.origin)throw Error(“Can not make cross-origin requests from verifiedFetch”);let{tracingEnabled:h,fetchPath:p}=(n=new URL(u=e,window.location.href),(l=(o=new URL(window.location.href,window.location.origin)).searchParams.get(“_features”))&&!n.searchParams.has(“_features”)&&n.searchParams.set(“_features”,l),(c=o.searchParams.get(“_tracing”))&&!n.searchParams.has(“_tracing”)&&n.searchParams.set(“_tracing”,c),{tracingEnabled:!!c,fetchPath:u.startsWith(window.location.origin)?n.href:`${n.pathname}${n.search}`}),m={…t.headers,”GitHub-Verified-Fetch”:”true”,…(0,r.kt)()},f=await fetch(p,{…t,headers:m}),b=f?.headers?.get(“X-Github-Request-Id”);if(b&&(0,i.Ex)(b),h&&f){let e=f.clone();try{let t=await e.text(),n=t&&JSON.parse(t);(0,s.Av)(n)}catch{}}return f}function o(e,t){let n={…t?.headers??{},Accept:”application/json”,”Content-Type”:”application/json”},r=t?.body?JSON.stringify(t.body):void 0;return a(e,{…t,body:r,headers:n})}function l(e,t={}){let n={…t.headers,”GitHub-Is-React”:”true”};return a(e,{…t,headers:n})}function c(e,t){let n={…t?.headers??{},”GitHub-Is-React”:”true”};return o(e,{…t,headers:n})}}}]);
//# sourceMappingURL=3951-49d9dea0a271.js.map