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