|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[73220],{75742:function(e,n,t){t.d(n,{Z:function(){return s}});var o=t(1565),a=t(59301),i={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"},l=t(68475),r=function(e,n){return a.createElement(l.Z,(0,o.Z)({},e,{ref:n,icon:i}))};var s=a.forwardRef(r)},89136:function(e,n,t){t.d(n,{Z:function(){return s}});var o=t(1565),a=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"}}]},name:"eye",theme:"outlined"},l=t(68475),r=function(e,n){return a.createElement(l.Z,(0,o.Z)({},e,{ref:n,icon:i}))};var s=a.forwardRef(r)},11407:function(e,n,t){t.d(n,{Z:function(){return s}});var o=t(1565),a=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},l=t(68475),r=function(e,n){return a.createElement(l.Z,(0,o.Z)({},e,{ref:n,icon:i}))};var s=a.forwardRef(r)},81407:function(e,n,t){t.d(n,{Z:function(){return s}});var o=t(1565),a=t(59301),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},l=t(68475),r=function(e,n){return a.createElement(l.Z,(0,o.Z)({},e,{ref:n,icon:i}))};var s=a.forwardRef(r)},24345:function(e,n,t){t.d(n,{Z:function(){return m}});var o=t(79800),a=t.n(o),i=t(59301),l=t(3113),r=t(8591),s=t(46651),c=t(81407),d=t(97650),u=t(27065),f="img___BgL9D",p=t(37712),m=function(e){var n=e.value,t=e.onChange,o=e.getFileProgress,m=(0,i.useState)(!1),v=a()(m,2),h=v[0],g=v[1],b=(0,p.jsx)(l.ZP,{loading:h,icon:(0,p.jsx)(c.Z,{}),children:"选择上传文件"});return(0,p.jsx)(i.Fragment,{children:n?(0,p.jsxs)("div",{className:f,children:[(0,p.jsx)("img",{src:u.Z.API_SERVER+"/api/attachments/"+n,alt:"avatar",style:{width:288}}),(0,p.jsx)("div",{children:(0,p.jsx)(d.Z,{onClick:function(){return t("")},style:{fontSize:"16px",color:"red"}})})]}):(0,p.jsxs)("div",{children:[(0,p.jsx)(s.Z,{withCredentials:!0,name:"file",showUploadList:!1,action:"".concat(u.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){if(o&&o(e),"uploading"!==e.file.status){if("done"===e.file.status){var n,a,i;if(g(!1),"done"===e.file.status&&-1===(null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.status))return void r.ZP.error(null===(i=e.file)||void 0===i||null===(i=i.response)||void 0===i?void 0:i.message);t(null==e||null===(a=e.file)||void 0===a||null===(a=a.response)||void 0===a?void 0:a.id)}}else g(!0)},accept:"image/*",children:b}),(0,p.jsx)("div",{className:"mt20 c-light-black",children:"说明:支持上传jpg/png等格式文件,文件大小不能超过2M,建议使用288*158像素;"}),(0,p.jsx)("div",{className:"c-light-black",children:"如不上传,默认使用系统图片。"})]})})}},35426:function(e,n,t){t.r(n),t.d(n,{default:function(){return K}});var o=t(7557),a=t.n(o),i=t(41498),l=t.n(i),r=t(79800),s=t.n(r),c=t(39647),d=t.n(c),u=t(82242),f=t.n(u),p=t(37205),m=t.n(p),v=t(59301),h=t(7880),g=t(11407),b=t(8591),x=t(43418),y=t(71418),A=t(93948),C=t(3113),j=t(98135),w=t(95237),_=t(24905),k="bg___A_od2",E="main___f6Wx0",O="uploadTop___Yx2Un",P="imgWrap___S6ChW",S="defaultImg___qUJQT",I="hoverImg___pZT3G",N="uploadTitle___FLy1b",Z="colorBlue___HfgxM",M="uploadDescription___Cn5KA",$="description___qbCxZ",B="colorOrange___ZuvEg",U="fileMain___asNqA",L="fileWrap___gPP0_",z="fileProgress___xmdZ4",V="fileCancel___ikgzZ",D="fileInputWrap___mvunl",R="fileImgWrap___zdrgz",T="fileInput___Tw2dZ",F="flexRowCenter___pGglA",H="continueAdd___SV9wg",G=t(9106),W=t(24345),Q=t(37231),q=t(6457),J=t(37712),X=["user","userDetail","globalSetting","loading","dispatch"],Y=function(e,n){var t,o,a,i=n.payload.uploadInfo;switch(n.type){case"addVideo":return console.log("videoList: ",i,i.videoId,[].concat(m()(e.videoList),[{name:i.file.name,size:i.file.size,type:i.file.type,filename:i.file.name,fileHash:i.fileHash,state:i.state,videoId:i.videoId,attachment_id:"",loaded:0,title:""}])),{videoList:[].concat(m()(e.videoList),[{name:i.file.name,size:i.file.size,type:i.file.type,filename:i.file.name,fileHash:i.fileHash,state:i.state,videoId:i.videoId,attachment_id:"",loaded:0,title:"",allow_skip:!0}])};case"removeVideo":return{videoList:e.videoList.filter((function(e){return e.name!==n.payload.name}))};case"removeAll":default:return[];case"updateProgress":return{videoList:e.videoList.map((function(e){return e.name===n.payload.uploadInfo.file.name?f()(f()({},e),{loaded:n.payload.progressPercent,videoId:i.videoId,fileHash:i.fileHash}):e}))};case"updateTitle":return{videoList:null===(t=e.videoList)||void 0===t?void 0:t.map((function(e){return e.name===n.payload.item.name?f()(f()({},e),{title:n.payload.title}):e}))};case"updateImg":return{videoList:null===(o=e.videoList)||void 0===o?void 0:o.map((function(e){return e.name===n.payload.item.name?f()(f()({},e),{attachment_id:n.payload.attachment_id}):e}))};case"updateAllowSkip":return{videoList:null===(a=e.videoList)||void 0===a?void 0:a.map((function(e){return e.name===n.payload.item.name?f()(f()({},e),{allow_skip:n.payload.allow_skip}):e}))}}},K=(0,h.connect)((function(e){var n=e.user,t=e.userDetail,o=e.loading;return{user:n,userDetail:t,globalSetting:e.globalSetting,loading:o.models.index}}))((function(e){var n,t=e.user,o=(e.userDetail,e.globalSetting,e.loading,e.dispatch),i=(d()(e,X),(0,h.useParams)()),r=((0,h.useLocation)(),(0,h.useSearchParams)()),c=s()(r,1)[0],u=(0,v.useState)(!1),f=s()(u,2),p=f[0],m=f[1],K=(0,v.useReducer)(Y,{videoList:[]}),ee=s()(K,2),ne=ee[0],te=ee[1],oe=(0,v.useRef)(),ae=(0,v.useRef)();(0,v.useEffect)((function(){return window.addEventListener("beforeunload",re),function(){window.removeEventListener("beforeunload",re)}}),[]);var ie,le,re=function(e){e.preventDefault(),e.returnValue=""},se=function(){document.getElementById("fileUpload").value=""},ce=function(e){var n='{"Vod":{}}';m(!0),oe.current?oe.current.addFile(e,null,null,null,n):(0,G.o)(null==i?void 0:i.username,"",{create:!oe,addFileSuccess:function(e){te({type:"addVideo",payload:{uploadInfo:e}})},onUploadProgress:function(e,n,t){var o=Math.ceil(100*t);te({type:"updateProgress",payload:{uploadInfo:e,progressPercent:o}}),se()},onUploadFailed:function(e){b.ZP.info("视频云服务出现异常,请重新上传。")},onUploadEnd:function(e){m(!1)},onUploadSucceed:function(e){m(!1),console.log("files.current",ae.current)},onUploadError:function(e){m(!1)},gotUploader:function(t){t.addFile(e,null,null,null,n),oe.current=t}})},de=function(){var e=l()(a()().mark((function e(){var n,t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==(n=ne.videoList)&&void 0!==n&&n.length){e.next=3;break}return b.ZP.info("请先上传视频"),e.abrupt("return");case 3:return e.next=5,(0,Q.dt)({username:i.username,videos:ne.videoList.map((function(e){return{video_id:e.videoId,title:e.title,filename:e.filename,attachment_id:e.attachment_id,course_id:i.coursesId,category_id:c.get("categoryId"),allow_skip:e.allow_skip}}))});case 5:0===(null==(t=e.sent)?void 0:t.status)&&((0,q.L9)(["教学课堂","视频","上传视频"]),h.history.back(),o({type:"classroomList/getClassroomLeftMenus",payload:{id:i.coursesId}}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ue=null===(n=ne.videoList)||void 0===n?void 0:n.length;return(0,J.jsxs)("section",{className:k,style:{width:"100%"},children:[(0,J.jsxs)("div",{className:"mt5",style:{display:"flex",alignItems:"baseline"},children:[(0,J.jsx)(g.Z,{style:{marginTop:"8px"},className:"current mr10 font16",onClick:function(){h.history.push("/classrooms/".concat(i.coursesId,"/video"))}}),(0,J.jsx)("h2",{children:"上传视频"})]}),ue?(0,J.jsxs)("div",{className:U,children:[(0,J.jsx)(y.Z,{spinning:p,children:null===(ie=ne.videoList)||void 0===ie?void 0:ie.map((function(e,n){return(0,J.jsxs)("div",{className:L,children:[(0,J.jsxs)("div",{children:[n+1,". ",e.name]}),(0,J.jsxs)("div",{className:z,children:[(0,J.jsx)(A.Z,{percent:e.loaded,status:100==e.loaded?"normal":"active"}),(0,J.jsx)("div",{className:V,children:(0,J.jsx)(C.ZP,{type:"primary",onClick:function(){return n=e.name,t=100==e.loaded,void x.Z.confirm({title:"提示",centered:!0,okText:"确定",cancelText:"取消",content:(0,J.jsxs)("div",{className:"tc",children:["您确认要",t?"删除":"取消上传","该视频吗?"]}),onOk:function(){se(),te({type:"removeVideo",payload:{name:n}})}});var n,t},children:100===e.loaded?"删除":"取消上传"})})]}),(0,J.jsxs)("div",{className:D,children:[(0,J.jsx)("span",{className:"mr5",children:"标题:"}),(0,J.jsx)(j.Z,{value:e.title,onChange:function(n){te({type:"updateTitle",payload:{title:n.target.value,item:e}})},className:T,placeholder:"标题支持最多".concat(30,"个字符"),maxLength:30,addonAfter:(0,J.jsxs)("span",{className:"c-light-black font12",children:[String(e.title.length),"/",30]})})]}),(0,J.jsxs)("div",{className:R,children:[(0,J.jsx)("aside",{className:"mr5",children:"上传封面图:"}),(0,J.jsx)(W.Z,{value:null==e?void 0:e.attachment_id,onChange:function(n){te({type:"updateImg",payload:{attachment_id:n,item:e}})}})]}),(0,J.jsxs)(w.Z,{align:"middle",className:"mt10",children:[(0,J.jsx)("span",{className:"mr5",children:"播放设置:"}),(0,J.jsx)(_.Z,{className:"font14",checked:e.allow_skip,onChange:function(n){te({type:"updateAllowSkip",payload:{allow_skip:n.target.checked,item:e}})},children:"允许快进播放"})]})]})}))}),(0,J.jsx)("div",{className:"mt10",children:(null===(le=ne.videoList)||void 0===le?void 0:le.length)<=2?(0,J.jsx)("label",{htmlFor:"fileUpload",className:"".concat(H," current"),children:"继续添加"}):"提示:单次最多支持3个视频文件上传"}),(0,J.jsxs)("div",{className:$,children:[(0,J.jsx)("div",{children:"上传说明:目前不支持断点续传,单个视频文件最大限制1G,单次最多支持3个视频文件上传 "}),(0,J.jsx)("div",{children:"视频规格:avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm、wmv "}),(0,J.jsxs)("div",{children:["温馨提示:",(0,J.jsx)("span",{className:B,children:"为了更好的播放体验,建议您优先上传MP4格式。如果您是自己录制视频,建议您保存的时候将视频编码设置为AVC(H264)"})]})]}),(0,J.jsx)("div",{className:F,children:(0,J.jsx)(C.ZP,{type:"primary",onClick:de,children:"立即发布"})}),(0,J.jsxs)("div",{className:"".concat(F," mt10"),children:["上传视频,即表示您已同意",(0,J.jsx)(h.Link,{to:"/users/".concat(null==i?void 0:i.username,"/videos/protocol"),className:Z,children:"上传内容协议"}),",不得上传未经他人授权的作品"]})]}):(0,J.jsxs)("div",{className:E,children:[(0,J.jsxs)("div",{className:O,children:[(0,J.jsxs)("label",{htmlFor:"fileUpload",className:P,children:[(0,J.jsx)("img",{className:S,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAwBAMAAABTZWEsAAAAIVBMVEVHcExMrf9Qr/9TuP9Mrf9Nrf9Mrf9MrP9Nrv9Orv9MrP98EuefAAAACnRSTlMA3CULV5jA84JH4j3LZgAAANVJREFUOMvl1a0OwjAUBeCb/QgcGckSphqeAASBoKaR4KpwJDwAYhaHQuGbLNtynpKWmTWs92rg2n45orc7I9qeEZzrjSgqwIxRtAI7M7rzoKMLjhScNRqqsAyDGC0BxIw9/UYQKQEUHQ9SoGSBBmoOpG4/JQO0A3UYpP2KyyDQaGG8CB/YgDnMfhjhAw2zgEmGER6wAVkEQzbiMQp29g07YCOmo2CDjBywEadRkOSqB5NcBa/6Dbhd/AmIq0Z41c/DL3y8n0AsMbEGxSIVq1gsc+l38AI000Nd23IRqQAAAABJRU5ErkJggg=="}),(0,J.jsx)("img",{className:I,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAABgBAMAAAAnVGd6AAAAJFBMVEVHcExMrf9Orf9Nrf90uv9MrP////95wP/M5//z+v+x2/9cs//eVCejAAAABXRSTlMA10ycBa32wqwAAAFsSURBVFjD7dk/TsMwFMfxJ8QNIHsHOABDduAGJXoyUnZTsmcoByg3KANz/0i9AHA6YruBIjXPr/6hLrWlLlXy0dcZrPSViOj+puCENb64Ir/Okm73xMjdf15y8qpuO+COgXXZASUCVN0TYGiNsB24PVxjwAP2CNxDKDBgjAMMrgxkIANHAr5aDPiwtoWAubVPCPBobSxBBmYOeEsHfIB9bpMBHxBJoGhAJIHiAXICxQPkBFIEiAmkCBATSBMgJZAmQEogMWDiPnMxgcSAlQOmYgJJAY1xgBETSApYeIDFBJICOABiAkkBW0BM2A8sQ0APhIR3PVBvA3ogJDR6wPTX94BPmBwILHYAn3AA4A7jhncBM3g87wemIeAX+PlGCdTrFf8FeP2acqybwa1nIAMZODWgHjyMtW+qM/BNlT+HjkItUL9s8i+WDGTgSECB3f8Ps7QSAyp8IAmPROGhLDwWxgfT8GgcHs6Dfw98A1V0Ca+XaA0MAAAAAElFTkSuQmCC"})]}),(0,J.jsx)("div",{className:N,children:"选择您要上传的视频"}),(0,J.jsxs)("div",{children:["上传视频,即表示您已同意",(0,J.jsx)(h.Link,{to:"/users/".concat(null==i?void 0:i.username,"/videos/protocol"),className:Z,children:"上传内容协议"}),",不得上传未经他人授权的作品"]})]}),(0,J.jsx)("div",{className:M,children:(0,J.jsxs)("div",{className:$,children:[(0,J.jsx)("div",{children:"上传说明:目前不支持断点续传,单个视频文件最大限制1G,单次最多支持3个视频文件上传 "}),(0,J.jsx)("div",{children:"视频规格:avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm、wmv "}),(0,J.jsxs)("div",{children:["温馨提示:",(0,J.jsx)("span",{className:B,children:"为了更好的播放体验,建议您优先上传MP4格式。如果您是自己录制视频,建议您保存的时候将视频编码设置为AVC(H264)"})]})]})})]}),(0,J.jsx)("input",{ref:ae,type:"file",id:"fileUpload",style:{display:"none"},onChange:function(e){var n,o,a,i=e.target.files[0];if(i){var l=i.name.toLowerCase();return l&&-1==l.indexOf(".avi")&&-1==l.indexOf(".flv")&&-1==l.indexOf(".f4v")&&-1==l.indexOf(".m4v")&&-1==l.indexOf(".mov")&&-1==l.indexOf(".mp4")&&-1==l.indexOf(".rmvb")&&-1==l.indexOf(".swf")&&-1==l.indexOf(".webm")&&-1==l.indexOf(".wmv")?(b.ZP.info("不支持的视频格式"),void se()):!(null!==(n=t.userInfo)&&void 0!==n&&n.admin||null!==(o=t.userInfo)&&void 0!==o&&o.business)&&i.size>1073741824?(b.ZP.info("视频大小超过".concat(1024,"M")),void se()):null!==(a=ne.videoList)&&void 0!==a&&a.find((function(e){return e.name===i.name}))?(b.ZP.info("你不能上传同一个视频文件名称,请重新选择。"),void se()):void ce(i)}se()},accept:".mkv, .flv, .f4v, .rmvb, .swf, video/mp4,video/x-m4v,video/flv,video/f4v,video/rmvb,video/swf,video/*"})]})}))},9106:function(e,n,t){t.d(n,{o:function(){return d}});var o,a=t(51136),i=t(93125),l=t.n(i),r="",s="";function c(e){!function(e){o=new(l().Vod)({timeout:6e4,partSize:1048576,parallel:5,retryCount:3,retryDuration:2,region:"ap-southeast-1",userId:0x6803cbd867207,enableUploadProgress:!1,addFileSuccess:function(n){console.log("addFileSuccess: "+n.file.name),e.addFileSuccess&&e.addFileSuccess(n),o.startUpload()},onUploadstarted:function(n){var t=n.file.name;if(n.videoId){var i="/api/users/".concat(r,"/video_auths.json");(0,a.ZP)(i,{method:"put",body:{video_id:n.videoId,title:t,file_name:t,virtual_classroom_id:s}}).then((function(t){if(-1!=t.status){var a=t.data,i=a.UploadAuth,l=a.UploadAddress;a.VideoId;o.setUploadAuthAndAddress(n,i,l)}else e.onUploadError&&e.onUploadError(n)})).catch((function(e){o.deleteFile(o._curIndex),o.nextUpload(),console.log(e)}))}else{var l="/api/users/".concat(r,"/video_auths.json"),c="";(0,a.ZP)(l,{method:"Post",body:{title:c+t,file_name:c+t,virtual_classroom_id:s}}).then((function(e){if(e){var t=e.data,a=t.UploadAuth,i=t.UploadAddress,l=t.VideoId;o.setUploadAuthAndAddress(n,a,i,l)}})).catch((function(e){o.deleteFile(o._curIndex),o.nextUpload(),console.log(e)})),console.log("文件开始上传...")}},onUploadSucceed:function(n){e.onUploadSucceed&&e.onUploadSucceed(n),console.log("文件上传成功!")},onUploadFailed:function(n,t,o){e.onUploadFailed&&e.onUploadFailed(n),console.log("文件上传失败!")},onUploadCanceled:function(e,n,t){console.log("文件上传已暂停!")},onUploadProgress:function(n,t,o){e.onUploadProgress&&e.onUploadProgress(n,t,o);Math.ceil(100*o);console.log("文件上传中...")},onUploadTokenExpired:function(e){console.log("文件上传超时!");var n="/api/users/".concat(r,"/video_auths.json");(0,a.ZP)(n,{method:"put",body:{video_id:e.videoId}}).then((function(e){var n=e.data.UploadAuth;o.resumeUploadWithAuth(n)})).catch((function(e){console.log(e)}))},onUploadEnd:function(n){e.onUploadEnd&&e.onUploadEnd(n),console.log("onUploadEnd: uploaded all the files")}}),e.gotUploader&&e.gotUploader(o)}(e)}function d(e,n,t){e&&(r=e),n&&(s=n),c(t)}},56762:function(e,n,t){t.d(n,{Z:function(){return a}});var o=t(59301);function a(){const[,e]=o.useReducer((e=>e+1),0);return e}},24905:function(e,n,t){t.d(n,{Z:function(){return w}});var o=t(92310),a=t.n(o),i=t(5630),l=t(59301),r=t(36355),s=t(1684),c=t(32441);var d=l.createContext(null),u=t(98447),f=t(14088),p=t(4572),m=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]])}return t};const v=(e,n)=>{var t;const{prefixCls:o,className:v,rootClassName:h,children:g,indeterminate:b=!1,style:x,onMouseEnter:y,onMouseLeave:A,skipGroup:C=!1,disabled:j}=e,w=m(e,["prefixCls","className","rootClassName","children","indeterminate","style","onMouseEnter","onMouseLeave","skipGroup","disabled"]),{getPrefixCls:_,direction:k,checkbox:E}=l.useContext(r.E_),O=l.useContext(d),{isFormItemInput:P}=l.useContext(c.aM),S=l.useContext(s.Z),I=null!==(t=(null==O?void 0:O.disabled)||j)&&void 0!==t?t:S,N=l.useRef(w.value);l.useEffect((()=>{null==O||O.registerValue(w.value)}),[]),l.useEffect((()=>{if(!C)return w.value!==N.current&&(null==O||O.cancelValue(N.current),null==O||O.registerValue(w.value),N.current=w.value),()=>null==O?void 0:O.cancelValue(w.value)}),[w.value]);const Z=_("checkbox",o),[M,$]=(0,u.ZP)(Z),B=Object.assign({},w);O&&!C&&(B.onChange=function(){w.onChange&&w.onChange.apply(w,arguments),O.toggleOption&&O.toggleOption({label:g,value:w.value})},B.name=O.name,B.checked=O.value.includes(w.value));const U=a()(`${Z}-wrapper`,{[`${Z}-rtl`]:"rtl"===k,[`${Z}-wrapper-checked`]:B.checked,[`${Z}-wrapper-disabled`]:I,[`${Z}-wrapper-in-form-item`]:P},null==E?void 0:E.className,v,h,$),L=a()({[`${Z}-indeterminate`]:b},p.A,$),z=b?"mixed":void 0;return M(l.createElement(f.Z,{component:"Checkbox",disabled:I},l.createElement("label",{className:U,style:Object.assign(Object.assign({},null==E?void 0:E.style),x),onMouseEnter:y,onMouseLeave:A},l.createElement(i.Z,Object.assign({"aria-checked":z},B,{prefixCls:Z,className:L,disabled:I,ref:n})),void 0!==g&&l.createElement("span",null,g))))};var h=l.forwardRef(v),g=t(12295),b=t(70521),x=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]])}return t};const y=(e,n)=>{const{defaultValue:t,children:o,options:i=[],prefixCls:s,className:c,rootClassName:f,style:p,onChange:m}=e,v=x(e,["defaultValue","children","options","prefixCls","className","rootClassName","style","onChange"]),{getPrefixCls:y,direction:A}=l.useContext(r.E_),[C,j]=l.useState(v.value||t||[]),[w,_]=l.useState([]);l.useEffect((()=>{"value"in v&&j(v.value||[])}),[v.value]);const k=l.useMemo((()=>i.map((e=>"string"==typeof e||"number"==typeof e?{label:e,value:e}:e))),[i]),E=y("checkbox",s),O=`${E}-group`,[P,S]=(0,u.ZP)(E),I=(0,b.Z)(v,["value","disabled"]),N=i.length?k.map((e=>l.createElement(h,{prefixCls:E,key:e.value.toString(),disabled:"disabled"in e?e.disabled:v.disabled,value:e.value,checked:C.includes(e.value),onChange:e.onChange,className:`${O}-item`,style:e.style,title:e.title},e.label))):o,Z={toggleOption:e=>{const n=C.indexOf(e.value),t=(0,g.Z)(C);-1===n?t.push(e.value):t.splice(n,1),"value"in v||j(t),null==m||m(t.filter((e=>w.includes(e))).sort(((e,n)=>k.findIndex((n=>n.value===e))-k.findIndex((e=>e.value===n)))))},value:C,disabled:v.disabled,name:v.name,registerValue:e=>{_((n=>[].concat((0,g.Z)(n),[e])))},cancelValue:e=>{_((n=>n.filter((n=>n!==e))))}},M=a()(O,{[`${O}-rtl`]:"rtl"===A},c,f,S);return P(l.createElement("div",Object.assign({className:M,style:p},I,{ref:n}),l.createElement(d.Provider,{value:Z},N)))},A=l.forwardRef(y);var C=l.memo(A);const j=h;j.Group=C,j.__ANT_CHECKBOX=!0;var w=j},98447:function(e,n,t){t.d(n,{C2:function(){return r}});var o=t(17313),a=t(37613),i=t(83116);const l=e=>{const{checkboxCls:n}=e,t=`${n}-wrapper`;return[{[`${n}-group`]:Object.assign(Object.assign({},(0,o.Wf)(e)),{display:"inline-flex",flexWrap:"wrap",columnGap:e.marginXS,[`> ${e.antCls}-row`]:{flex:1}}),[t]:Object.assign(Object.assign({},(0,o.Wf)(e)),{display:"inline-flex",alignItems:"baseline",cursor:"pointer","&:after":{display:"inline-block",width:0,overflow:"hidden",content:"'\\a0'"},[`& + ${t}`]:{marginInlineStart:0},[`&${t}-in-form-item`]:{'input[type="checkbox"]':{width:14,height:14}}}),[n]:Object.assign(Object.assign({},(0,o.Wf)(e)),{position:"relative",whiteSpace:"nowrap",lineHeight:1,cursor:"pointer",borderRadius:e.borderRadiusSM,alignSelf:"center",[`${n}-input`]:{position:"absolute",inset:0,zIndex:1,cursor:"pointer",opacity:0,margin:0,[`&:focus-visible + ${n}-inner`]:Object.assign({},(0,o.oN)(e))},[`${n}-inner`]:{boxSizing:"border-box",position:"relative",top:0,insetInlineStart:0,display:"block",width:e.checkboxSize,height:e.checkboxSize,direction:"ltr",backgroundColor:e.colorBgContainer,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,borderCollapse:"separate",transition:`all ${e.motionDurationSlow}`,"&:after":{boxSizing:"border-box",position:"absolute",top:"50%",insetInlineStart:"21.5%",display:"table",width:e.checkboxSize/14*5,height:e.checkboxSize/14*8,border:`${e.lineWidthBold}px solid ${e.colorWhite}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg) scale(0) translate(-50%,-50%)",opacity:0,content:'""',transition:`all ${e.motionDurationFast} ${e.motionEaseInBack}, opacity ${e.motionDurationFast}`}},"& + span":{paddingInlineStart:e.paddingXS,paddingInlineEnd:e.paddingXS}})},{[`\n ${t}:not(${t}-disabled),\n ${n}:not(${n}-disabled)\n `]:{[`&:hover ${n}-inner`]:{borderColor:e.colorPrimary}},[`${t}:not(${t}-disabled)`]:{[`&:hover ${n}-checked:not(${n}-disabled) ${n}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"},[`&:hover ${n}-checked:not(${n}-disabled):after`]:{borderColor:e.colorPrimaryHover}}},{[`${n}-checked`]:{[`${n}-inner`]:{backgroundColor:e.colorPrimary,borderColor:e.colorPrimary,"&:after":{opacity:1,transform:"rotate(45deg) scale(1) translate(-50%,-50%)",transition:`all ${e.motionDurationMid} ${e.motionEaseOutBack} ${e.motionDurationFast}`}}},[`\n ${t}-checked:not(${t}-disabled),\n ${n}-checked:not(${n}-disabled)\n `]:{[`&:hover ${n}-inner`]:{backgroundColor:e.colorPrimaryHover,borderColor:"transparent"}}},{[n]:{"&-indeterminate":{[`${n}-inner`]:{backgroundColor:e.colorBgContainer,borderColor:e.colorBorder,"&:after":{top:"50%",insetInlineStart:"50%",width:e.fontSizeLG/2,height:e.fontSizeLG/2,backgroundColor:e.colorPrimary,border:0,transform:"translate(-50%, -50%) scale(1)",opacity:1,content:'""'}}}}},{[`${t}-disabled`]:{cursor:"not-allowed"},[`${n}-disabled`]:{[`&, ${n}-input`]:{cursor:"not-allowed",pointerEvents:"none"},[`${n}-inner`]:{background:e.colorBgContainerDisabled,borderColor:e.colorBorder,"&:after":{borderColor:e.colorTextDisabled}},"&:after":{display:"none"},"& + span":{color:e.colorTextDisabled},[`&${n}-indeterminate ${n}-inner::after`]:{background:e.colorTextDisabled}}}]};function r(e,n){const t=(0,a.TS)(n,{checkboxCls:`.${e}`,checkboxSize:n.controlInteractiveSize});return[l(t)]}n.ZP=(0,i.Z)("Checkbox",((e,n)=>{let{prefixCls:t}=n;return[r(t,e)]}))},98135:function(e,n,t){t.d(n,{Z:function(){return Z}});var o=t(92310),a=t.n(o),i=t(59301),l=t(36355),r=t(32441),s=t(9937);var c=e=>{const{getPrefixCls:n,direction:t}=(0,i.useContext)(l.E_),{prefixCls:o,className:c}=e,d=n("input-group",o),u=n("input"),[f,p]=(0,s.ZP)(u),m=a()(d,{[`${d}-lg`]:"large"===e.size,[`${d}-sm`]:"small"===e.size,[`${d}-compact`]:e.compact,[`${d}-rtl`]:"rtl"===t},p,c),v=(0,i.useContext)(r.aM),h=(0,i.useMemo)((()=>Object.assign(Object.assign({},v),{isFormItemInput:!1})),[v]);return f(i.createElement("span",{className:m,style:e.style,onMouseEnter:e.onMouseEnter,onMouseLeave:e.onMouseLeave,onFocus:e.onFocus,onBlur:e.onBlur},i.createElement(r.aM.Provider,{value:h},e.children)))},d=t(9432),u=t(1565),f={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z"}},{tag:"path",attrs:{d:"M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z"}}]},name:"eye-invisible",theme:"outlined"},p=t(68475),m=function(e,n){return i.createElement(p.Z,(0,u.Z)({},e,{ref:n,icon:f}))};var v=i.forwardRef(m),h=t(89136),g=t(70521),b=t(16863),x=t(59412),y=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]])}return t};const A=e=>e?i.createElement(h.Z,null):i.createElement(v,null),C={click:"onClick",hover:"onMouseOver"};var j=i.forwardRef(((e,n)=>{const{visibilityToggle:t=!0}=e,o="object"==typeof t&&void 0!==t.visible,[r,s]=(0,i.useState)((()=>!!o&&t.visible)),c=(0,i.useRef)(null);i.useEffect((()=>{o&&s(t.visible)}),[o,t]);const u=(0,x.Z)(c),f=()=>{const{disabled:n}=e;n||(r&&u(),s((e=>{var n;const o=!e;return"object"==typeof t&&(null===(n=t.onVisibleChange)||void 0===n||n.call(t,o)),o})))},{className:p,prefixCls:m,inputPrefixCls:v,size:h}=e,j=y(e,["className","prefixCls","inputPrefixCls","size"]),{getPrefixCls:w}=i.useContext(l.E_),_=w("input",v),k=w("input-password",m),E=t&&(n=>{const{action:t="click",iconRender:o=A}=e,a=C[t]||"",l=o(r),s={[a]:f,className:`${n}-icon`,key:"passwordIcon",onMouseDown:e=>{e.preventDefault()},onMouseUp:e=>{e.preventDefault()}};return i.cloneElement(i.isValidElement(l)?l:i.createElement("span",null,l),s)})(k),O=a()(k,p,{[`${k}-${h}`]:!!h}),P=Object.assign(Object.assign({},(0,g.Z)(j,["suffix","iconRender","visibilityToggle"])),{type:r?"text":"password",className:O,prefixCls:_,suffix:E});return h&&(P.size=h),i.createElement(d.Z,Object.assign({ref:(0,b.sQ)(n,c)},P))})),w=t(11013),_=t(92343),k=t(3113),E=t(19716),O=t(33234),P=function(e,n){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&n.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)n.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(t[o[a]]=e[o[a]])}return t};var S=i.forwardRef(((e,n)=>{const{prefixCls:t,inputPrefixCls:o,className:r,size:s,suffix:c,enterButton:u=!1,addonAfter:f,loading:p,disabled:m,onSearch:v,onChange:h,onCompositionStart:g,onCompositionEnd:x}=e,y=P(e,["prefixCls","inputPrefixCls","className","size","suffix","enterButton","addonAfter","loading","disabled","onSearch","onChange","onCompositionStart","onCompositionEnd"]),{getPrefixCls:A,direction:C}=i.useContext(l.E_),j=i.useRef(!1),S=A("input-search",t),I=A("input",o),{compactSize:N}=(0,O.ri)(S,C),Z=(0,E.Z)((e=>{var n;return null!==(n=null!=s?s:N)&&void 0!==n?n:e})),M=i.useRef(null),$=e=>{var n;document.activeElement===(null===(n=M.current)||void 0===n?void 0:n.input)&&e.preventDefault()},B=e=>{var n,t;v&&v(null===(t=null===(n=M.current)||void 0===n?void 0:n.input)||void 0===t?void 0:t.value,e,{source:"input"})},U="boolean"==typeof u?i.createElement(w.Z,null):null,L=`${S}-button`;let z;const V=u||{},D=V.type&&!0===V.type.__ANT_BUTTON;z=D||"button"===V.type?(0,_.Tm)(V,Object.assign({onMouseDown:$,onClick:e=>{var n,t;null===(t=null===(n=null==V?void 0:V.props)||void 0===n?void 0:n.onClick)||void 0===t||t.call(n,e),B(e)},key:"enterButton"},D?{className:L,size:Z}:{})):i.createElement(k.ZP,{className:L,type:u?"primary":void 0,size:Z,disabled:m,key:"enterButton",onMouseDown:$,onClick:B,loading:p,icon:U},u),f&&(z=[z,(0,_.Tm)(f,{key:"addonAfter"})]);const R=a()(S,{[`${S}-rtl`]:"rtl"===C,[`${S}-${Z}`]:!!Z,[`${S}-with-button`]:!!u},r);return i.createElement(d.Z,Object.assign({ref:(0,b.sQ)(M,n),onPressEnter:e=>{j.current||p||B(e)}},y,{size:Z,onCompositionStart:e=>{j.current=!0,null==g||g(e)},onCompositionEnd:e=>{j.current=!1,null==x||x(e)},prefixCls:I,addonAfter:z,suffix:c,onChange:e=>{e&&e.target&&"click"===e.type&&v&&v(e.target.value,e,{source:"clear"}),h&&h(e)},className:R,disabled:m}))})),I=t(1643);const N=d.Z;N.Group=c,N.Search=S,N.TextArea=I.Z,N.Password=j;var Z=N},8378:function(e,n){n.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`}}})},5630:function(e,n,t){var o=t(1565),a=t(79770),i=t(22386),l=t(88703),r=t(52167),s=t(92310),c=t.n(s),d=t(37683),u=t(59301),f=["prefixCls","className","style","checked","disabled","defaultChecked","type","title","onChange"],p=(0,u.forwardRef)((function(e,n){var t,s=e.prefixCls,p=void 0===s?"rc-checkbox":s,m=e.className,v=e.style,h=e.checked,g=e.disabled,b=e.defaultChecked,x=void 0!==b&&b,y=e.type,A=void 0===y?"checkbox":y,C=e.title,j=e.onChange,w=(0,r.Z)(e,f),_=(0,u.useRef)(null),k=(0,d.Z)(x,{value:h}),E=(0,l.Z)(k,2),O=E[0],P=E[1];(0,u.useImperativeHandle)(n,(function(){return{focus:function(){var e;null===(e=_.current)||void 0===e||e.focus()},blur:function(){var e;null===(e=_.current)||void 0===e||e.blur()},input:_.current}}));var S=c()(p,m,(t={},(0,i.Z)(t,"".concat(p,"-checked"),O),(0,i.Z)(t,"".concat(p,"-disabled"),g),t));return u.createElement("span",{className:S,title:C,style:v},u.createElement("input",(0,o.Z)({},w,{className:"".concat(p,"-input"),ref:_,onChange:function(n){g||("checked"in e||P(n.target.checked),null==j||j({target:(0,a.Z)((0,a.Z)({},e),{},{type:A,checked:n.target.checked}),stopPropagation:function(){n.stopPropagation()},preventDefault:function(){n.preventDefault()},nativeEvent:n.nativeEvent}))},disabled:g,checked:!!O,type:A})),u.createElement("span",{className:"".concat(p,"-inner")}))}));n.Z=p}}]); |