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

1 line
40 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(self.webpackChunk=self.webpackChunk||[]).push([[98688],{74516:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var o=n(1565),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M862 465.3h-81c-4.6 0-9 2-12.1 5.5L550 723.1V160c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v563.1L255.1 470.8c-3-3.5-7.4-5.5-12.1-5.5h-81c-6.8 0-10.5 8.1-6 13.2L487.9 861a31.96 31.96 0 0048.3 0L868 478.5c4.5-5.2.8-13.2-6-13.2z"}}]},name:"arrow-down",theme:"outlined"},i=n(68475),c=function(e,t){return r.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(c)},75742:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var o=n(1565),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"}}]},name:"check",theme:"outlined"},i=n(68475),c=function(e,t){return r.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(c)},26063:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var o=n(1565),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 444H820V330.4c0-17.7-14.3-32-32-32H473L355.7 186.2a8.15 8.15 0 00-5.5-2.2H96c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h698c13 0 24.8-7.9 29.7-20l134-332c1.5-3.8 2.3-7.9 2.3-12 0-17.7-14.3-32-32-32zM136 256h188.5l119.6 114.4H748V444H238c-13 0-24.8 7.9-29.7 20L136 643.2V256zm635.3 512H159l103.3-256h612.4L771.3 768z"}}]},name:"folder-open",theme:"outlined"},i=n(68475),c=function(e,t){return r.createElement(i.Z,(0,o.Z)({},e,{ref:t,icon:a}))};var l=r.forwardRef(c)},58271:function(e,t,n){"use strict";n.d(t,{t:function(){return p}});var o=n(82242),r=n.n(o),a=(n(59301),n(3113)),i="buttonFixed___vyq30",c="button___hxmYv",l="buttonWrap___uK8dl",s=n(92310),u=n.n(s),d=n(37712),p=function(e){var t=e.cancelText,n=void 0===t?"取消":t,o=e.okText,s=void 0===o?"确定":o,p=e.loading,f=void 0!==p&&p,h=e.hasOkBtn,m=void 0===h||h,v=e.hasCancelBtn,x=void 0===v||v,g=e.okButtonProps,y=void 0===g?{}:g,b=e.onCancel,j=void 0===b?function(){}:b,_=e.onOk,w=void 0===_?function(){}:_,C=e.className,k=void 0===C?"":C;return(0,d.jsx)("div",{className:u()(i,k),children:(0,d.jsxs)("div",{className:l,children:[x&&(0,d.jsx)(a.ZP,{size:"middle",className:"".concat(c," mr20"),onClick:j,children:n}),m&&(0,d.jsx)(a.ZP,r()(r()({size:"middle",type:"primary",className:"".concat(c," mr20"),loading:f,onClick:w},y),{},{children:s}))]})})}},7406:function(e,t,n){"use strict";var o=n(82242),r=n.n(o),a=(n(59301),n(93314)),i=n(3113),c=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,o=void 0===n?{}:n,l=e.styles,s=void 0===l?{}:l,u=e.customText,d=e.ButtonText,p=e.ButtonClick,f=e.Buttonclass,h=e.ButtonTwo,m=e.imgStyles,v=e.loading,x=void 0!==v&&v;return(0,c.jsxs)("section",{className:"tc animated fadeIn",style:r()(r()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),s),children:[(0,c.jsx)("img",{src:t||a,style:r()(r()({},m),{},{pointerEvents:"none",userSelect:"none"})}),(0,c.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,c.jsx)(i.ZP,r()(r()({className:f,onClick:p},o),{},{children:d})),h&&h]})}},84143:function(e,t,n){"use strict";n.d(t,{Z:function(){return w}});var o=n(82242),r=n.n(o),a=n(7557),i=n.n(a),c=n(41498),l=n.n(c),s=n(79800),u=n.n(s),d=n(59301),p={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},f=n(3113),h=n(74516),m=n(94049),v=n(6848),x=n(6457),g=n(83),y=n(7406),b=n(27065),j=n(6288),_=n(37712),w=function(e){var t,n,o,a,c,s,w=e.editOffice,C=void 0===w?"view":w,k=e.data,O=(e.theme,e.type),S=e.filename,E=e.monacoEditor,N=e.className,P=e.style,Z=e.close,D=e.onClose,I=e.hasMask,R=e.disabledDownload,T=e.onImgDimensions,$=e.showNodata,B=e.recordInfo,z=(0,d.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),L=u()(z,2),K=(L[0],L[1],(0,d.useState)("")),W=u()(K,2),F=(W[0],W[1]),M=(0,d.useState)(),V=u()(M,2),A=V[0],H=V[1],U="build"===window.ENV?"/react/build":"",G=location.host.startsWith("localhost")?b.Z.PROXY_SERVER:b.Z.API_SERVER,J=(0,d.useRef)();null!==(t=k)&&void 0!==t&&t.startsWith("/api")&&"txt"!==O&&(k=b.Z.API_SERVER+k);S&&(E.filename=S),(0,d.useEffect)((function(){var e,t=null===(e=document.cookie)||void 0===e||null===(e=e.replace(/\s/g,""))||void 0===e?void 0:e.split(";");null==t||t.map((function(e){var t=e.split("=");"_educoder_session"===t[0]&&F(t[1])}))}),[]),(0,d.useEffect)((function(){var e;"office"===O&&(k.indexOf("bigfilescdn.")>-1||k.indexOf("bigfiles1")>-1?H({url:k,fileType:(e=k,e.substring(e.lastIndexOf("/")+1).split(".").pop()),model:k.indexOf("model=edit")?"edit":"view"}):Y())}),[O,k]);var Y=function(){var e=l()(i()().mark((function e(){var t,n,o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("data:",k),t=k,k.startsWith("http")||(t=location.origin+t),n=new URL(t).pathname.split("/").pop(),e.next=6,(0,g.gJ)({attachment_id:n});case 6:(o=e.sent).url=G+o.url,H(o);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){k.startsWith("http")||k.startsWith("blob:")?q():(0,x.Sv)(S||"educoder",k,S)},q=function(){B&&(0,j.fc)({id:null==B?void 0:B.id,watch_type:1,course_id:null==B?void 0:B.course_id}),(0,x.Nd)(S||"educoder",decodeURIComponent(k))};return(0,_.jsxs)("div",{style:r()({},P||{}),className:"".concat(I&&p.bgBlack," ").concat(O?p.wrp:"hide"),children:[Z&&(0,_.jsxs)("div",{className:p.close,ref:J,children:[!!T&&(0,_.jsx)(v.Z,{title:"点击对图片进行批注",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:function(){D(),T()},children:(0,_.jsx)("i",{className:"icon-yulanpizhu"})})}),!R&&(0,_.jsx)(v.Z,{title:"点击下载此文件",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{onClick:q,children:(0,_.jsx)("i",{className:"icon-quxiaozhiding"})})}),(0,_.jsx)(v.Z,{title:"关闭",getPopupContainer:function(){return J.current},children:(0,_.jsx)("span",{className:"",onClick:D,children:(0,_.jsx)("i",{className:"icon-guanbi1"})})})]}),(0,_.jsx)("div",{className:"".concat(p[N]," ").concat(N," ").concat(p.monaco," ").concat("txt"===O?"show":"hide"),children:"txt"===O&&(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(m.ZP,r()({},E))})}),"audio"===O&&(0,_.jsx)("audio",{src:"".concat((null===(n=k)||void 0===n?void 0:n.indexOf("http://"))>-1||(null===(o=k)||void 0===o?void 0:o.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(k),autoPlay:!0}),"video"===O&&(0,_.jsx)(_.Fragment,{children:(null===(a=k)||void 0===a?void 0:a.indexOf("http"))>-1?(0,_.jsx)("video",{controls:!0,src:"".concat(k),autoPlay:!0}):(0,_.jsx)("video",{controls:!0,src:"data:video/mp4;base64,".concat(k),autoPlay:!0})}),"office"===O&&A&&(0,_.jsx)("iframe",{src:"".concat(U,"/office.html?key=").concat(A.key,"&url=").concat(btoa(A.url),"&callbackUrl=").concat(G+A.callbackUrl,"&fileType=").concat(A.fileType,"&title=").concat(A.title,"&model=").concat(C,"&officeServer=").concat(b.Z.ONLYOFFICE,"&disabledDownload=").concat(!!R)}),"html"===O&&(0,_.jsx)("iframe",{src:k+"&disposition=inline"}),"pdf"===O&&(0,_.jsx)("iframe",{src:"".concat(U,"/js/pdfview/index.html?url=").concat(k,"&disabledDownload=").concat(!!R)}),"image"===O&&(0,_.jsx)("img",{src:"".concat((null===(c=k)||void 0===c?void 0:c.indexOf("http://"))>-1||(null===(s=k)||void 0===s?void 0:s.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(k)}),("other"===O||"download"===O)&&(0,_.jsx)(_.Fragment,{children:$?(0,_.jsx)(y.Z,{customText:"当前文件不支持预览,可点击下载查看",ButtonTwo:(0,_.jsx)(f.ZP,{icon:(0,_.jsx)("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:X,children:"下载"})}):(0,_.jsxs)(f.ZP,{type:"primary",size:"middle",onClick:X,children:[(0,_.jsx)(h.Z,{}),"点击下载"]})})]})}},77135:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var o=n(82242),r=n.n(o),a=n(7557),i=n.n(a),c=n(41498),l=n.n(c),s=n(79800),u=n.n(s),d=n(59301),p=n(7880),f=n(78241),h=n(8591),m=n(43418),v=n(98135),x="wrap___TwY3U",g="content___Ks95W",y="mainPathWrap___CrMaa",b="colorBlue___dvWbP",j=n(37712),_=(0,p.connect)((function(e){var t=e.shixunsDetail,n=e.loading;return{shixunsDetail:t,globalSetting:e.globalSetting,loading:n.models.index}}))((function(e){var t=e.shixunsDetail,n=(e.globalSetting,e.loading,e.dispatch),o=e.title,a=e.pathList,c=void 0===a?[]:a,s=e.showInputPath,_=void 0!==s&&s,w=e.isMergeSelectFile,C=void 0!==w&&w,k=e.onFinish,O=void 0===k?function(){}:k,S=f.Z.useForm(),E=u()(S,1)[0],N=(0,p.useParams)(),P=(0,p.useLocation)(),Z=(0,d.useRef)(),D=(0,d.useState)(""),I=u()(D,2),R=I[0],T=I[1],$=(0,d.useState)(""),B=u()($,2),z=B[0],L=B[1],K=(0,d.useState)([]),W=u()(K,2),F=W[0],M=W[1],V=(0,d.useState)([]),A=u()(V,2),H=A[0],U=A[1];(0,d.useEffect)((function(){var e;Z.current="repository"===(null===(e=P.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[3])}),[]),(0,d.useEffect)((function(){if("Repository-SelectFilePath"===t.actionTabs.key){var e=c.join("/"),n=[];c.map((function(t,o){0===o?n.push({val:"根目录",path:""},{val:"/".concat(t),path:e}):n.push({val:"/".concat(t),path:e})})),M(n),T(e),L(e),G(e)}}),[t.actionTabs.key]);var G=function(){var e=l()(i()().mark((function e(t){var o;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n({type:Z.current?"shixunsDetail/getRepository":"shixunsDetail/getSecretRepository",payload:{id:N.id,path:t}});case 2:(o=e.sent)&&U(o.trees||[]);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=l()(i()().mark((function e(){var t,o,a;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=null==E?void 0:E.getFieldsValue(),o=R?"".concat(R).concat(null!=t&&t.name?"/".concat(null==t?void 0:t.name):""):null==t?void 0:t.name,!C){e.next=6;break}return O(o),Y(),e.abrupt("return");case 6:if(!_){e.next=16;break}return e.next=9,E.validateFields();case 9:return e.next=11,n({type:"shixunsDetail/uploadGitFolder",payload:r()(r()({},{id:N.id,path:o}),Z.current?{}:{secret_repository:!0})});case 11:a=e.sent,O(z),0===a.status&&h.ZP.info("新建成功"),e.next=18;break;case 16:O(o),h.ZP.success("选择文件目录成功");case 18:Y();case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){n({type:"shixunsDetail/setActionTabs",payload:{}}),E.resetFields()};return(0,j.jsx)(m.Z,{centered:!0,title:o||"新建文件夹",closable:!1,keyboard:!1,open:"Repository-SelectFilePath"===t.actionTabs.key,onOk:J,onCancel:Y,children:(0,j.jsxs)("div",{className:x,children:[(0,j.jsxs)("div",{className:g,children:[(0,j.jsx)("div",{className:y,children:!(null==F||!F.length)&&F.map((function(e,t){return(0,j.jsx)("a",{onClick:function(){return function(e,t){var n=F.filter((function(e,n){return n<=t}));M(n);var o=n.filter((function(e,t){return 0!==t})).map((function(e){return e.val})).join("").substr(1);T(o),G(o)}(0,t)},children:e.val},t)}))}),!(null==H||!H.length)&&H.map((function(e,t){return"tree"===e.type&&(0,j.jsxs)("a",{onClick:function(){return function(e){var t=R;"tree"===e.type&&(F.length?F.push({val:"/".concat(e.name),path:e.name}):F.push({val:"根目录",path:""},{val:"/".concat(e.name),path:e.name}),M(F),t=R?"".concat(R,"/").concat(e.name):e.name,T(t)),G(t)}(e)},children:[(0,j.jsx)("i",{className:"iconfont icon-wenjianjia ".concat(b)}),e.name]},t)}))]}),(0,j.jsx)("label",{className:"mt5",children:"选中的新建文件夹目录:"}),(0,j.jsx)("div",{className:"mt5 mb5",children:R}),_&&(0,j.jsx)(f.Z,{form:E,scrollToFirstError:!0,className:"mt20",children:(0,j.jsx)(f.Z.Item,{name:"name",rules:[{required:!0,message:"请输入名称"},{whitespace:!0,message:"请勿输入空格"}],children:(0,j.jsx)(v.Z,{placeholder:"请输入新文件夹名/子文件夹名。src/step1"})})})]})})}))},52094:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return T}});var o=n(37205),r=n.n(o),a=n(7557),i=n.n(a),c=n(41498),l=n.n(c),s=n(79800),u=n.n(s),d=n(39647),p=n.n(d),f=n(59301),h=n(7880),m=n(8591),v=(n(43418),n(6848)),x=n(60324),g=(n(3113),n(48209)),y=n(56102),b=n(58271),j=n(84143),_="bg___ihsIB",w="wrap___H02Km",C="pathWrap___EC4ja",k="pathContent___o2I24",O=n(37712),S=(0,h.connect)((function(e){var t=e.shixunsDetail,n=e.loading;return{shixunsDetail:t,globalSetting:e.globalSetting,user:e.user,loading:n.models.index}}))((function(e){var t,n=e.shixunsDetail,o=(e.globalSetting,e.loading,e.user),r=e.dispatch,a=e.content,c=e.fixedButtonVisible,s=void 0===c||c,d=e.pathList,p=void 0===d?[]:d,v=e.onSetShowContent,x=void 0===v?function(){}:v,g=e.onClickRootPath,y=void 0===g?function(){}:g,S=e.onClickOhterPath,E=void 0===S?function(){}:S,N=(0,h.useParams)(),P=(0,h.useLocation)(),Z=(0,f.useRef)(),D=(0,f.useState)(),I=u()(D,2),R=I[0],T=I[1],$=null===(t=o.userInfo)||void 0===t||null===(t=t.shixun)||void 0===t?void 0:t.editable;(0,f.useEffect)((function(){return r({type:"globalSetting/footerToggle",payload:!1}),function(){r({type:"globalSetting/footerToggle",payload:!0})}}),[]),(0,f.useEffect)((function(){var e;Z.current="repository"===(null===(e=P.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[3])}),[P.pathname]),(0,f.useEffect)((function(){try{var e,t,o,r,a;if(null!=n&&null!==(e=n.fileContent)&&void 0!==e&&null!==(e=e.content)&&void 0!==e&&null!==(e=e.content)&&void 0!==e&&e.length||""==(null==n||null===(t=n.fileContent)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.content))if("txt"===(null==n||null===(o=n.fileContent)||void 0===o?void 0:o.file_type))T(window.decodeURIComponent(escape(window.atob(null==n||null===(r=n.fileContent)||void 0===r||null===(r=r.content)||void 0===r?void 0:r.content))));else T(null==n||null===(a=n.fileContent)||void 0===a||null===(a=a.content)||void 0===a?void 0:a.content)}catch(e){var i;T(window.atob(null==n||null===(i=n.fileContent)||void 0===i||null===(i=i.content)||void 0===i?void 0:i.content))}}),[a]);var B=function(){var e=l()(i()().mark((function e(){var t;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r({type:"shixunsDetail/updateRepositoryFile",payload:{id:N.id,path:null!=p&&p.length?p.join("/"):"",content:R,secret_repository:!Z.current||null}});case 2:e.sent&&(m.ZP.info("保存成功"),(t=p.length>1?p[p.length-2]:"")?E(t,p.length-2):y());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,O.jsxs)("section",{className:_,children:[(0,O.jsxs)("div",{className:w,children:[!(null==p||!p.length)&&(0,O.jsx)("div",{className:C,children:(0,O.jsxs)("div",{className:k,children:[(0,O.jsx)("a",{onClick:y,children:N.id}),p.map((function(e,t){return t===p.length-1?(0,O.jsxs)("span",{children:[" / ",e]},t):(0,O.jsxs)("a",{onClick:function(){return E(e,t)},children:[" / ",e]})}))]})}),(0,O.jsx)("div",{className:"mt20",style:{position:"relative",minHeight:500},children:a&&(0,O.jsx)(j.Z,{filename:a.filename,type:"office"===a.file_type?"download":a.file_type,data:R,style:{position:"absolute",zIndex:1},monacoEditor:{value:R,language:null==a?void 0:a.language,theme:"vs",options:{readOnly:!0}}})})]}),s&&(0,O.jsx)(b.t,{okText:"保存",hasOkBtn:$,onCancel:function(){return x(!0)},onOk:B})]})})),E={bg:"bg___D4cwy",contentbg:"contentbg___Id0pg",wrap:"wrap___MSDnd",modal:"modal___wkS0s",head:"head___e9UA3",headLeft:"headLeft____KVI7",headInputWrap:"headInputWrap___KpP4V",popover:"popover___TGO24",info:"info___f5jtZ",infoUser:"infoUser___syQV8",infoSubmitText:"infoSubmitText___wLlcr",deleteWrap:"deleteWrap___C2Nvj",content:"content___jG0lY",pl23:"pl23___DFTpV",colorBlue:"colorBlue___RBryy",pathContent:"pathContent___vCyoJ",nodata:"nodata___piT_j",nodataText:"nodataText___EquBb"},N=n(27065),P=n(91477),Z=n(77135),D=n(85062),I=["shixunsDetail","globalSetting","loading","user","dispatch"],R=function(){return(0,O.jsxs)("div",{className:"tc mt20 pb50 ".concat(E.nodata),children:[(0,O.jsx)("img",{src:"".concat(N.Z.IMG_SERVER,"/images/educoder/RepositoryNoneData.png")}),(0,O.jsx)("div",{className:E.nodataText,children:"此处存放本实训所需的所有代码等相关文件,你可以通过以下两种方式来使用:"}),(0,O.jsxs)("div",{className:E.nodataText,children:["1、",(0,O.jsx)("span",{children:(0,O.jsx)("a",{href:"/forums/2784",target:"_blank",children:"Git客户端"})}),"上传已有文件来开始使用。"]}),(0,O.jsx)("div",{className:"".concat(E.nodataText),children:"2、直接在平台上创建文件目录以及相关代码文件。"})]})},T=(0,h.connect)((function(e){var t=e.shixunsDetail,n=e.loading;return{shixunsDetail:t,globalSetting:e.globalSetting,user:e.user,loading:n.models.index}}))((function(e){e.shixunsDetail,e.globalSetting,e.loading,e.user;var t,n,o,a,c=e.dispatch,s=(p()(e,I),(0,h.useParams)()),d=(0,h.useLocation)(),b=(0,f.useRef)(),j=(0,f.useState)(!0),_=u()(j,2),w=_[0],C=_[1],k=(0,f.useState)([]),T=u()(k,2),$=T[0],B=T[1],z=(0,f.useState)(),L=u()(z,2),K=L[0],W=L[1],F=(0,f.useState)(),M=u()(F,2),V=M[0],A=M[1],H=(0,f.useState)(),U=u()(H,2),G=(U[0],U[1]),J=(0,f.useState)([]),Y=u()(J,2),X=Y[0],q=Y[1],Q=(0,f.useState)(),ee=u()(Q,2),te=ee[0],ne=ee[1],oe=(0,f.useState)(),re=u()(oe,2),ae=(re[0],re[1]),ie=(0,f.useState)(!1),ce=u()(ie,2),le=ce[0],se=ce[1],ue=(0,f.useState)(),de=u()(ue,2),pe=(de[0],de[1]),fe=!1;(0,f.useEffect)((function(){var e,t="repository"===(null===(e=d.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[3]);if(d.pathname.includes("/master/shixun_show")){b.current=t;var n=d.pathname.split("/");if(n.length>5){var o=n.splice(6,n.length);q(o);var r=null!=o&&o.length?o.join("/"):"";he(r)}}else b.current!==t&&(b.current=t,C(!0),he(),q([]))}),[d.pathname]),(0,f.useEffect)((function(){}),[d.pathname]);var he=function(){var e=l()(i()().mark((function e(){var t,n,o,r=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"",e.next=3,c({type:b.current?"shixunsDetail/getRepository":"shixunsDetail/getSecretRepository",payload:{id:s.id,path:t}});case 3:(n=e.sent)&&(B(n.trees||[]),ae((null==n?void 0:n.secret_dir_path)||""),W(n.git_url||""),A((null===(o=n.commits)||void 0===o?void 0:o[0])||{}));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),me=function(){var e=l()(i()().mark((function e(){var t,n=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:"",e.next=3,(0,D.Zt)({id:s.id,secret_dir_path:t});case 3:e.sent&&pe(t);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ve=function(){var e=l()(i()().mark((function e(){var t,n,o=arguments;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=o.length>0&&void 0!==o[0]?o[0]:"",e.next=3,c({type:"shixunsDetail/getFileContent",payload:{id:s.id,path:t,secret_repository:!b.current||null}});case 3:if(-2!==(null==(n=e.sent)?void 0:n.status)){e.next=6;break}return e.abrupt("return",n);case 6:if(-1!==(null==n?void 0:n.status)){e.next=8;break}return e.abrupt("return",n);case 8:return n&&(C(!1),ne(n)),e.abrupt("return",n);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=l()(i()().mark((function e(t){var n,o,a,c,l;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null==t?void 0:t[0],o=$.find((function(e){return e.name===n}))){e.next=4;break}return e.abrupt("return");case 4:if(a=[].concat(r()(X),[n]),c=null!=a&&a.length?a.join("/"):"","blob"!==o.type){e.next=12;break}return e.next=9,ve(c);case 9:return-1!==(null==(l=e.sent)?void 0:l.status)&&-2!==(null==l?void 0:l.status)&&q(a),e.abrupt("return");case 12:q(a),he(c);case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ge=function(){C(!0),q([]),he()},ye=function(e,t){C(!0);var n=X.filter((function(e,n){return n<=t}));q(n);var o=null!=n&&n.length?n.join("/"):"";he(o)},be=null==$?void 0:$.map((function(e,t){return{title:(0,O.jsxs)("span",{className:"font14 pt5 pb5",children:["tree"===e.type?(0,O.jsx)("i",{className:"iconfont icon-xingzhuangjiehebeifen font12 ".concat(E.colorBlue," mr5")}):(0,O.jsx)("i",{className:"iconfont icon-xingzhuangjiehe font12 ".concat(E.colorBlue," mr5")}),e.name]}),key:e.name}}));return(0,O.jsxs)("section",{className:E.bg,children:[w?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("div",{className:E.contentbg,children:(0,O.jsxs)("div",{className:E.wrap,children:[(0,O.jsxs)("div",{className:E.head,children:[(0,O.jsxs)("div",{className:E.headLeft,children:[(0,O.jsx)("span",{children:"网址克隆:"}),(0,O.jsxs)("div",{className:"".concat(E.headInputWrap," mr5"),children:[(0,O.jsx)("input",{defaultValue:K}),(0,O.jsx)(y.CopyToClipboard,{text:K,onCopy:function(){return m.ZP.success("复制成功")},children:(0,O.jsx)(v.Z,{placement:"topLeft",title:"点击复制版本库",children:(0,O.jsx)("i",{className:"iconfont icon-fuzhi2 current ml5"})})})]}),(0,O.jsx)(x.Z,{overlayClassName:E.popover,placement:"bottomRight",content:(0,O.jsxs)("p",{className:"font12",children:["请上传当前实训中各个关卡涉及的所有文件",(0,O.jsx)("br",{}),"包括任务文件、执行文件,以及其他的必须文件",(0,O.jsx)("br",{}),(0,O.jsx)("br",{}),"提交代码的方法:",(0,O.jsx)("br",{}),"1、在电脑上安装Git tortoise客户端",(0,O.jsx)("br",{}),"或者其它熟悉的Git客户端,在Git客户端上向左侧的地址提交代码",(0,O.jsx)("br",{}),"2.直接在平台上新建文件/文件夹,或者拖拽上传相关代码文件",(0,O.jsx)("br",{}),(0,O.jsx)("br",{}),"注意:",(0,O.jsx)("br",{}),"请在Git客户端要求填写时按照如下说明填写",(0,O.jsx)("br",{}),"* 用户名:使用您在本平台绑定的邮箱",(0,O.jsx)("br",{}),"* 口令:使用您在本平台的登录口令"]}),trigger:"click",children:(0,O.jsx)("i",{className:"iconfont icon-tishi2"})})]}),fe]}),!b.current&&(0,O.jsx)(O.Fragment,{children:(0,O.jsxs)("div",{className:"pt40 pl20 pr20 font14 c-orange",children:[(0,O.jsx)("div",{children:"私密版本库的文件对学员始终隐藏,无法访问查看。 "}),(0,O.jsx)("div",{children:"若评测学员任务需要使用私密版本库的文件,请指定将私密版本库合并到常规版本库的目标路径,以确保评测时能访问私密版本库的文件。"})]})}),be.length?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("div",{className:E.info,children:[(0,O.jsxs)("div",{className:E.infoUser,children:[(null==V?void 0:V.author)&&(0,O.jsx)("img",{width:"35",height:"35",alt:null==V||null===(t=V.author)||void 0===t?void 0:t.name,src:"".concat(N.Z.IMG_SERVER,"/").concat(null==V||null===(n=V.author)||void 0===n?void 0:n.image_url)}),(0,O.jsx)("a",{href:null==V||null===(o=V.author)||void 0===o?void 0:o.user_url,target:"_blank",className:"mr5",children:null==V||null===(a=V.author)||void 0===a?void 0:a.name}),(0,O.jsxs)("span",{children:["提交于",(0,O.jsx)("span",{children:null==V?void 0:V.time})," ",null==V?void 0:V.title]})]}),(0,O.jsxs)("div",{onClick:function(){return h.history.push("/shixuns/".concat(s.id,"/").concat(b.current?"repository":"secret_repository","/").concat(s.id,"/commits"))},children:[(0,O.jsx)("i",{className:"iconfont icon-tijiaojilu font18 mr5"}),(0,O.jsx)("span",{className:"".concat(E.infoSubmitText," current"),children:"提交记录"})]})]}),!(null==X||!X.length)&&(0,O.jsx)("div",{className:E.pathWrap,children:(0,O.jsxs)("div",{className:E.pathContent,children:[(0,O.jsx)("a",{onClick:ge,children:s.id}),X.map((function(e,t){return t===X.length-1?(0,O.jsxs)("span",{children:[" / ",e]}):(0,O.jsxs)("a",{onClick:function(){return ye(0,t)},children:[" / ",e]})}))]})}),fe,(0,O.jsx)("div",{className:E.content,children:(0,O.jsx)(g.Z,{checkable:fe,treeData:be,onSelect:xe,onCheck:function(e){G(null==e?void 0:e[0])}})})]}):(0,O.jsx)(R,{})]})}),(0,O.jsx)(P.Z,{})]}):(0,O.jsx)(S,{content:te,pathList:X,fixedButtonVisible:!1,onSetShowContent:function(e){var t=null!=X&&X.length?null==X?void 0:X.filter((function(e,t){return t!==X.length-1})):[];q(t),C(e)},onClickRootPath:ge,onClickOhterPath:ye}),(0,O.jsx)(Z.Z,{pathList:X,showInputPath:!0,isMergeSelectFile:le,onFinish:function(e){le?me(e):he(e),se(!1)}})]})}))},77578:function(e,t,n){"use strict";n.d(t,{Z:function(){return o}});const o=e=>e?"function"==typeof e?e():e:null},39722:function(e,t,n){"use strict";n.d(t,{t5:function(){return d}});var o=n(92310),r=n.n(o),a=n(55477),i=n(59301),c=n(36355),l=n(77578),s=n(17356),u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const d=e=>{const{hashId:t,prefixCls:n,className:o,style:c,placement:s="top",title:u,content:d,children:p}=e;return i.createElement("div",{className:r()(t,n,`${n}-pure`,`${n}-placement-${s}`,o),style:c},i.createElement("div",{className:`${n}-arrow`}),i.createElement(a.G,Object.assign({},e,{className:t,prefixCls:n}),p||((e,t,n)=>{if(t||n)return i.createElement(i.Fragment,null,t&&i.createElement("div",{className:`${e}-title`},(0,l.Z)(t)),i.createElement("div",{className:`${e}-inner-content`},(0,l.Z)(n)))})(n,u,d)))};t.ZP=e=>{const{prefixCls:t}=e,n=u(e,["prefixCls"]),{getPrefixCls:o}=i.useContext(c.E_),r=o("popover",t),[a,l]=(0,s.Z)(r);return a(i.createElement(d,Object.assign({},n,{prefixCls:r,hashId:l})))}},60324:function(e,t,n){"use strict";var o=n(92310),r=n.n(o),a=n(59301),i=n(77578),c=n(62892),l=n(36355),s=n(6848),u=n(39722),d=n(17356),p=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};const f=e=>{let{title:t,content:n,prefixCls:o}=e;return a.createElement(a.Fragment,null,t&&a.createElement("div",{className:`${o}-title`},(0,i.Z)(t)),a.createElement("div",{className:`${o}-inner-content`},(0,i.Z)(n)))},h=a.forwardRef(((e,t)=>{const{prefixCls:n,title:o,content:i,overlayClassName:u,placement:h="top",trigger:m="hover",mouseEnterDelay:v=.1,mouseLeaveDelay:x=.1,overlayStyle:g={}}=e,y=p(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:b}=a.useContext(l.E_),j=b("popover",n),[_,w]=(0,d.Z)(j),C=b(),k=r()(u,w);return _(a.createElement(s.Z,Object.assign({placement:h,trigger:m,mouseEnterDelay:v,mouseLeaveDelay:x,overlayStyle:g},y,{prefixCls:j,overlayClassName:k,ref:t,overlay:o||i?a.createElement(f,{prefixCls:j,title:o,content:i}):null,transitionName:(0,c.m)(C,"zoom-big",y.transitionName),"data-popover-inject":!0})))}));h._InternalPanelDoNotUseOrYouWillBeFired=u.ZP,t.Z=h},17356:function(e,t,n){"use strict";var o=n(17313),r=n(29878),a=n(19447),i=n(33166),c=n(83116),l=n(37613);const s=e=>{const{componentCls:t,popoverColor:n,minWidth:r,fontWeightStrong:i,popoverPadding:c,boxShadowSecondary:l,colorTextHeading:s,borderRadiusLG:u,zIndexPopup:d,marginXS:p,colorBgElevated:f,popoverBg:h}=e;return[{[t]:Object.assign(Object.assign({},(0,o.Wf)(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:d,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:h,backgroundClip:"padding-box",borderRadius:u,boxShadow:l,padding:c},[`${t}-title`]:{minWidth:r,marginBottom:p,color:s,fontWeight:i},[`${t}-inner-content`]:{color:n}})},(0,a.ZP)(e,{colorBg:"var(--antd-arrow-background-color)"}),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]},u=e=>{const{componentCls:t}=e;return{[t]:i.i.map((n=>{const o=e[`${n}6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":o,[`${t}-inner`]:{backgroundColor:o},[`${t}-arrow`]:{background:"transparent"}}}}))}},d=e=>{const{componentCls:t,lineWidth:n,lineType:o,colorSplit:r,paddingSM:a,controlHeight:i,fontSize:c,lineHeight:l,padding:s}=e,u=i-Math.round(c*l);return{[t]:{[`${t}-inner`]:{padding:0},[`${t}-title`]:{margin:0,padding:`${u/2}px ${s}px ${u/2-n}px`,borderBottom:`${n}px ${o} ${r}`},[`${t}-inner-content`]:{padding:`${a}px ${s}px`}}}};t.Z=(0,c.Z)("Popover",(e=>{const{colorBgElevated:t,colorText:n,wireframe:o}=e,a=(0,l.TS)(e,{popoverPadding:12,popoverBg:t,popoverColor:n});return[s(a),u(a),o&&d(a),(0,r._y)(a,"zoom-big")]}),(e=>({width:177,minWidth:177,zIndexPopup:e.zIndexPopupBase+30})),{resetStyle:!1,deprecatedTokens:[["width","minWidth"]]})},8378:function(e,t){"use strict";t.Z=e=>({[e.componentCls]:{[`${e.antCls}-motion-collapse-legacy`]:{overflow:"hidden","&-active":{transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}},[`${e.antCls}-motion-collapse`]:{overflow:"hidden",transition:`height ${e.motionDurationMid} ${e.motionEaseInOut},\n opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`}}})},48209:function(e,t,n){"use strict";n.d(t,{Z:function(){return B}});var o=n(2507),r=n(12295),a=n(78475),i=n(26063),c=n(1565),l=n(59301),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 298.4H521L403.7 186.2a8.15 8.15 0 00-5.5-2.2H144c-17.7 0-32 14.3-32 32v592c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V330.4c0-17.7-14.3-32-32-32zM840 768H184V256h188.5l119.6 114.4H840V768z"}}]},name:"folder",theme:"outlined"},u=n(68475),d=function(e,t){return l.createElement(u.Z,(0,c.Z)({},e,{ref:t,icon:s}))};var p=l.forwardRef(d),f=n(92310),h=n.n(f),m=n(35654),v=n(71430),x=n(36355),g={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M300 276.5a56 56 0 1056-97 56 56 0 00-56 97zm0 284a56 56 0 1056-97 56 56 0 00-56 97zM640 228a56 56 0 10112 0 56 56 0 00-112 0zm0 284a56 56 0 10112 0 56 56 0 00-112 0zM300 844.5a56 56 0 1056-97 56 56 0 00-56 97zM640 796a56 56 0 10112 0 56 56 0 00-112 0z"}}]},name:"holder",theme:"outlined"},y=function(e,t){return l.createElement(u.Z,(0,c.Z)({},e,{ref:t,icon:g}))};var b=l.forwardRef(y),j=n(62892),_=n(20648);function w(e){const{dropPosition:t,dropLevelOffset:n,prefixCls:o,indent:r,direction:a="ltr"}=e,i="ltr"===a?"left":"right",c={[i]:-n*r+4,["ltr"===a?"right":"left"]:0};switch(t){case-1:c.top=-3;break;case 1:c.bottom=-3;break;default:c.bottom=-3,c[i]=r+4}return l.createElement("div",{style:c,className:`${o}-drop-indicator`})}var C=n(37877);const k=l.forwardRef(((e,t)=>{const{getPrefixCls:n,direction:r,virtual:a,tree:i}=l.useContext(x.E_),{prefixCls:c,className:s,showIcon:u=!1,showLine:d,switcherIcon:p,blockNode:f=!1,children:m,checkable:v=!1,selectable:g=!0,draggable:y,motion:k,style:O}=e,S=n("tree",c),E=n(),N=null!=k?k:Object.assign(Object.assign({},(0,j.Z)(E)),{motionAppear:!1}),P=Object.assign(Object.assign({},e),{checkable:v,selectable:g,showIcon:u,motion:N,blockNode:f,showLine:Boolean(d),dropIndicatorRender:w}),[Z,D]=(0,_.ZP)(S),I=l.useMemo((()=>{if(!y)return!1;let e={};switch(typeof y){case"function":e.nodeDraggable=y;break;case"object":e=Object.assign({},y)}return!1!==e.icon&&(e.icon=e.icon||l.createElement(b,null)),e}),[y]);return Z(l.createElement(o.Z,Object.assign({itemHeight:20,ref:t,virtual:a},P,{style:Object.assign(Object.assign({},null==i?void 0:i.style),O),prefixCls:S,className:h()({[`${S}-icon-hide`]:!u,[`${S}-block-node`]:f,[`${S}-unselectable`]:!g,[`${S}-rtl`]:"rtl"===r},null==i?void 0:i.className,s,D),direction:r,checkable:v?l.createElement("span",{className:`${S}-checkbox-inner`}):v,selectable:g,switcherIcon:e=>l.createElement(C.Z,{prefixCls:S,switcherIcon:p,treeNodeProps:e,showLine:d}),draggable:I}),m))}));var O,S=k;function E(e,t){e.forEach((function(e){const{key:n,children:o}=e;!1!==t(n,e)&&E(o||[],t)}))}function N(e){let{treeData:t,expandedKeys:n,startKey:o,endKey:r}=e;const a=[];let i=O.None;if(o&&o===r)return[o];if(!o||!r)return[];return E(t,(e=>{if(i===O.End)return!1;if(function(e){return e===o||e===r}(e)){if(a.push(e),i===O.None)i=O.Start;else if(i===O.Start)return i=O.End,!1}else i===O.Start&&a.push(e);return n.includes(e)})),a}function P(e,t){const n=(0,r.Z)(t),o=[];return E(e,((e,t)=>{const r=n.indexOf(e);return-1!==r&&(o.push(t),n.splice(r,1)),!!n.length})),o}!function(e){e[e.None=0]="None",e[e.Start=1]="Start",e[e.End=2]="End"}(O||(O={}));var Z=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function D(e){const{isLeaf:t,expanded:n}=e;return t?l.createElement(a.Z,null):n?l.createElement(i.Z,null):l.createElement(p,null)}function I(e){let{treeData:t,children:n}=e;return t||(0,v.zn)(n)}const R=(e,t)=>{var{defaultExpandAll:n,defaultExpandParent:o,defaultExpandedKeys:a}=e,i=Z(e,["defaultExpandAll","defaultExpandParent","defaultExpandedKeys"]);const c=l.useRef(),s=l.useRef(),[u,d]=l.useState(i.selectedKeys||i.defaultSelectedKeys||[]),[p,f]=l.useState((()=>(()=>{const{keyEntities:e}=(0,v.I8)(I(i));let t;return t=n?Object.keys(e):o?(0,m.r7)(i.expandedKeys||a||[],e):i.expandedKeys||a,t})()));l.useEffect((()=>{"selectedKeys"in i&&d(i.selectedKeys)}),[i.selectedKeys]),l.useEffect((()=>{"expandedKeys"in i&&f(i.expandedKeys)}),[i.expandedKeys]);const{getPrefixCls:g,direction:y}=l.useContext(x.E_),{prefixCls:b,className:j,showIcon:_=!0,expandAction:w="click"}=i,C=Z(i,["prefixCls","className","showIcon","expandAction"]),k=g("tree",b),O=h()(`${k}-directory`,{[`${k}-directory-rtl`]:"rtl"===y},j);return l.createElement(S,Object.assign({icon:D,ref:t,blockNode:!0},C,{showIcon:_,expandAction:w,prefixCls:k,className:O,expandedKeys:p,selectedKeys:u,onSelect:(e,t)=>{var n;const{multiple:o}=i,{node:a,nativeEvent:l}=t,{key:u=""}=a,f=I(i),h=Object.assign(Object.assign({},t),{selected:!0}),m=(null==l?void 0:l.ctrlKey)||(null==l?void 0:l.metaKey),v=null==l?void 0:l.shiftKey;let x;o&&m?(x=e,c.current=u,s.current=x,h.selectedNodes=P(f,x)):o&&v?(x=Array.from(new Set([].concat((0,r.Z)(s.current||[]),(0,r.Z)(N({treeData:f,expandedKeys:p,startKey:u,endKey:c.current}))))),h.selectedNodes=P(f,x)):(x=[u],c.current=u,s.current=x,h.selectedNodes=P(f,x)),null===(n=i.onSelect)||void 0===n||n.call(i,x,h),"selectedKeys"in i||d(x)},onExpand:(e,t)=>{var n;return"expandedKeys"in i||f(e),null===(n=i.onExpand)||void 0===n?void 0:n.call(i,e,t)}}))};var T=l.forwardRef(R);const $=S;$.DirectoryTree=T,$.TreeNode=o.O;var B=$},25769:function(e,t,n){"use strict";var o=n(98040),r={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,c,l,s,u=!1;t||(t={}),n=t.debug||!1;try{if(i=o(),c=document.createRange(),l=document.getSelection(),(s=document.createElement("span")).textContent=e,s.ariaHidden="true",s.style.all="unset",s.style.position="fixed",s.style.top=0,s.style.clip="rect(0, 0, 0, 0)",s.style.whiteSpace="pre",s.style.webkitUserSelect="text",s.style.MozUserSelect="text",s.style.msUserSelect="text",s.style.userSelect="text",s.addEventListener("copy",(function(o){if(o.stopPropagation(),t.format)if(o.preventDefault(),void 0===o.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=r[t.format]||r.default;window.clipboardData.setData(a,e)}else o.clipboardData.clearData(),o.clipboardData.setData(t.format,e);t.onCopy&&(o.preventDefault(),t.onCopy(o.clipboardData))})),document.body.appendChild(s),c.selectNodeContents(s),l.addRange(c),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(o){n&&console.error("unable to copy using execCommand: ",o),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(o){n&&console.error("unable to copy using clipboardData: ",o),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(c):l.removeAllRanges()),s&&document.body.removeChild(s),i()}return u}},83145:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CopyToClipboard=void 0;var o=a(n(59301)),r=a(n(25769));function a(e){return e&&e.__esModule?e:{default:e}}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function l(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function d(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?f(e):t}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=function(e){function t(){var e,n;s(this,t);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return m(f(n=d(this,(e=p(t)).call.apply(e,[this].concat(i)))),"onClick",(function(e){var t=n.props,a=t.text,i=t.onCopy,c=t.children,l=t.options,s=o.default.Children.only(c),u=(0,r.default)(a,l);i&&i(a,u),s&&s.props&&"function"==typeof s.props.onClick&&s.props.onClick(e)})),n}var n,a,i;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),n=t,a=[{key:"render",value:function(){var e=this.props,t=(e.text,e.onCopy,e.options,e.children),n=l(e,["text","onCopy","options","children"]),r=o.default.Children.only(t);return o.default.cloneElement(r,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{onClick:this.onClick}))}}],a&&u(n.prototype,a),i&&u(n,i),t}(o.default.PureComponent);t.CopyToClipboard=v,m(v,"defaultProps",{onCopy:void 0,options:void 0})},56102:function(e,t,n){"use strict";var o=n(83145).CopyToClipboard;o.CopyToClipboard=o,e.exports=o},98040:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],o=0;o<e.rangeCount;o++)n.push(e.getRangeAt(o));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}}}]);