(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501],{18281:function(e,i,n){Promise.resolve().then(n.bind(n,74120))},74120:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return p}});var t=n(57437),o=n(2265),l=n(48936),r=n(98964),s=n(44623),u=n(30695),c=n(77634),d=n(16463),a=n(54935);function p(){let{Paragraph:e}=l.Typography,{trigger:i}=(0,c.Z)("/v1/upload/streamers",u.wG),n=(0,d.useRouter)(),p=(0,o.useRef)(),[m,_]=(0,o.useState)("inset");return(0,o.useEffect)(()=>{let e=(0,s.ql)(s.f.lg,{match:()=>{_("left")},unmatch:()=>{_("top")}});return()=>e()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{display:"flex",flexDirection:"row-reverse",paddingRight:12},children:(0,t.jsx)(l.zx,{onClick:()=>{var e;null===(e=p.current)||void 0===e||e.submitForm()},type:"primary",icon:(0,t.jsx)(r.Z,{size:"large"}),theme:"solid",style:{marginTop:12,marginRight:4},children:"创建模板"})}),(0,t.jsx)("main",{style:{backgroundColor:"var(--semi-color-bg-0)",display:"flex",justifyContent:"space-around"},children:(0,t.jsx)(l.Form,{autoScrollToError:!0,onSubmit:async o=>{try{var r,s,u,c,d,a,p,m,_,h,v;let e={template_name:o.template_name,user_cookie:o.user_cookie,copyright:o.copyright,id:o.id,copyright_source:null!==(a=o.copyright_source)&&void 0!==a?a:"",tid:o.tid[1],cover_path:null!==(p=o.cover_path)&&void 0!==p?p:"",title:null!==(m=o.title)&&void 0!==m?m:"",description:null!==(_=o.description)&&void 0!==_?_:"",dynamic:null!==(h=o.dynamic)&&void 0!==h?h:"",tags:null!==(v=o.tags)&&void 0!==v?v:[],dolby:(null===(r=o.sound)||void 0===r?void 0:r.includes("dolby"))?1:0,hires:(null===(s=o.sound)||void 0===s?void 0:s.includes("hires"))?1:0,up_selection_reply:(null===(u=o.interaction)||void 0===u?void 0:u.includes("up_selection_reply"))?1:0,up_close_reply:(null===(c=o.interaction)||void 0===c?void 0:c.includes("up_close_reply"))?1:0,up_close_danmu:(null===(d=o.interaction)||void 0===d?void 0:d.includes("up_close_danmu"))?1:0,open_elec:o.open_elec?1:0,no_reprint:o.no_reprint?1:0,mission_id:o.mission_id,dtime:o.isDtime?null==o?void 0:o.dtime:null,credits:o.credits,uploader:o.uploader};await i(e),l.FN.success("创建成功"),n.push("/upload-manager")}catch(i){throw l.P_.error({title:"创建失败",content:(0,t.jsx)(e,{style:{maxWidth:450},children:i.message}),style:{width:"min-content"}}),i}},component:a.Z,getFormApi:e=>p.current=e,labelWidth:"180px",labelPosition:m})})]})}}},function(e){e.O(0,[798,674,86,949,753,293,406,862,936,617,781,411,971,23,744],function(){return e(e.s=18281)}),_N_E=e.O()}]);