1import{d as we,a2 as be,s as ge,am as xe,ar as Ce,av as H,u as je,a as Se,r as w,I as $e,b as Q,o as n,c as l,e as o,w as _,f as i,L as m,V as Y,aw as b,K as r,t as a,M as Ie,q as G,g as k,j as v,aO as Pe,aM as Te,Q as J,i as L,er as X,es as Le,aP as Re,an as qe,B as Ne,ae as Oe,dH as Ve,ac as Be,ab as Fe,at as Me,af as Ue,eq as Ae}from"./index-OmJ62E3Y.js";import{i as De,j as ze}from"./review-daM1dgH1.js";import{C as Ee}from"./CheckList-Rn9Dv6tE.js";const Ke={key:0},We={class:"text-xl font-semibold"},He={class:"mt-3 text-b40"},Qe={class:"mt-6 space-y-3"},Ye={class:"text-b40"},Ge={class:"text-xl font-semibold"},Je={class:"font-semibold text-primary"},Xe={class:"mt-6"},Ze={key:0},et={key:0,class:"text-error"},tt={key:1},st={key:0,class:"mt-6 text-center"},ot={class:"text-xl font-semibold"},at={key:0},nt={class:"mt-4 text-center"},rt={class:"mt-8 text-center"},lt={class:"mb-6 text-center text-base"},dt=we({__name:"SendSurvey",setup(_t){const{t}=be(),g=ge("projectId"),Z=xe(),R=Ce(),{hasPermission:ee}=H(Z),{currencySymbol:te,currentProject:d,rewardText:B}=H(R),se=je(),F=Se(),oe=[{dataIndex:"completed_count",status:"Completed"},{dataIndex:"progress_count",status:"In Progress"},{dataIndex:"invited_count",status:"Invited"}],ae=[{title:B.value.uppercase,dataIndex:"title",key:"title",width:240},{title:t("common.type"),dataIndex:"reward_type",key:"reward_type",width:80},{title:t("review.survey.columns.backer_number"),dataIndex:"backers_count",key:"backers_count",width:100},{title:t("review.survey.columns.sending_survey"),dataIndex:"not_send",key:"not_send",width:100}],q=w(),N=w(!1),ne=w(!1),S=w(!1),x=w(1),C=w(["email"]),y=$e({ks_email:"",ks_password:""}),{loading:re,data:p}=Q(Ae,{defaultParams:[g]}),{loading:le,run:_e}=Q(ze,{manual:!0,onSuccess(e){e.code===200?O():L.error(e.message)}}),ce=()=>{var e,s,$,I,P,f;if(!N.value){L.error(t("review.survey.you_need_to_finish_all_the_required_steps_before_you_can_send_the_survey"));return}if(!((e=p.value)!=null&&e.data.finished)&&((s=d.value)==null?void 0:s.source)!="indiegogo"){b.confirm({title:t("review.survey.reminder"),content:o("div",{class:"text-center"},[t("review.survey.your_campaign_just_ended_within_7_days",[X(($=d.value)==null?void 0:$.source),(I=p.value)==null?void 0:I.data.not_collected_count,(P=d.value)==null?void 0:P.source]),t("review.survey.if_you_send_the_survey_now_thoses_pledges_will_be_marked_as_dropped_orders_in_pledgebox",[X((f=d.value)==null?void 0:f.source),B.value.lowercase])]),icon:null,width:800,okText:t("common.continue"),cancelText:t("common.back"),onOk(){M()},onCancel(){}});return}M()},M=()=>{var e;ne.value=!1,(e=d.value)!=null&&e.enable_test?b.confirm({title:t("common.warning"),content:t("review.survey.you_are_in_test_mode_turn_it_off_first"),icon:null,cancelText:t("common.cancel"),okText:t("review.survey.turn_off_test_mode"),async onOk(){try{await Le(g),R.getProject(g),U(),Promise.resolve()}catch{return console.log("Oops errors!")}},onCancel(){}}):U()},U=()=>{var e,s;((e=d.value)==null?void 0:e.source)==="kickstarter"&&((s=p.value)==null?void 0:s.data.not_invited_count)<=500?ie():O()},ie=()=>{b.confirm({title:t("review.survey.important_notice"),content:o("div",{class:"text-center text-base"},[o("div",{class:"mb-1"},[t("review.survey.once_the_survey_has_been_sent"),o("span",{class:"font-semibold"},[t("review.survey.the_shipping_fees_prices_product_variants_etc_are_not_editable")])]),o("div",null,[t("review.survey.if_you_need_any_modifications_please_reach_out_to_us_through_the_chat_box")])]),icon:null,width:560,onOk(){var e;S.value=!0,(e=q.value)==null||e.resetFields()},onCancel(){}})},ue=()=>{var e;if(C.value.length===0){L.error("You must choose the channel at least one");return}C.value.includes("ks_message")&&((e=d.value)==null?void 0:e.connect_type)!=="account"?x.value=2:O()},de=()=>{var e;(e=q.value)==null||e.validateFields().then(()=>{_e({project_id:g,...y})})},O=()=>{var e;S.value=!1,b.confirm({title:t("review.survey.please_confirm"),content:t("review.survey.you_are_about_to_send_the_survey_invitation_to_data_value_data_not_invited_count_backers_do_you_want_to_proceed",[(e=p.value)==null?void 0:e.data.not_invited_count]),icon:null,okText:t("common.confirm"),async onOk(){try{const s=await De({project_id:+se.params.project_id,survey_channel:C.value,...y});return s.code===200?(R.getProject(g),b.confirm({title:t("common.successfully"),content:t("review.survey.you_have_sent_the_survey_successfully_now_it_is_time_to_post_an_update_to_notify_the_backers"),okText:t("review.survey.lets_go"),onOk(){F.push({name:"helper_backer"})},onCancel(){F.replace({name:"project_stat"})}}),Promise.resolve()):(L.error(s.message),Promise.reject())}catch{return console.log("Oops errors!")}},onCancel(){}})};
1return(e,s)=>{const $=Y("i18n-t"),I=Re,P=qe,f=Ne,ve=Y("PageView"),me=Oe,pe=Ve,ye=Be,V=Fe,fe=Me,he=Ue,ke=b;return n(),l(m,null,[o(ve,{loading:i(re)},{default:_(()=>{var u,A,D;return[o(P,{bordered:!1},{default:_(()=>{var T,z,E,K;return[r("div",{class:G(["grid gap-x-16 gap-y-6 max-xl:grid-cols-1",((T=i(d))==null?void 0:T.smoke_status)===1?"grid-cols-[320px_minmax(0,_1fr)]":""])},[((z=i(d))==null?void 0:z.smoke_status)===1?(n(),l("div",Ke,[r("h5",We,a(e.$t("review.survey.smoke_test")),1),r("div",He,a(e.$t("review.survey.5_of_backers_from_each_pledge_level")),1),r("div",Qe,[(n(),l(m,null,Ie(oe,c=>{var j,h;return r("div",{class:"flex min-h-[6.5rem] flex-col justify-center rounded-lg bg-[#f5f6f8] px-6 py-4",key:c.status},[r("div",{class:G(["text-4xl font-semibold",{"text-success":c.status.toLocaleLowerCase()==="completed","text-primary":c.status.toLocaleLowerCase()==="in progress"||c.status.toLocaleLowerCase()==="invited"}])},a((h=(j=i(p))==null?void 0:j.data)==null?void 0:h[c.dataIndex]),3),r("div",Ye,a(c.status),1)])}),64))])])):k("",!0),r("div",null,[r("h5",Ge,a(e.$t("review.survey.survey_details")),1),o($,{class:"mt-3 text-b40",keypath:"review.survey.there_are_number_waiting_for_the_survey_invitation",scope:"global",tag:"div"},{default:_(()=>{var c;return[r("span",Je,a((c=i(p))==null?void 0:c.data.not_invited_count),1)]}),_:1}),r("div",Xe,[o(I,{class:"-mt-2",columns:ae,"data-source":((K=(E=i(p))==null?void 0:E.data)==null?void 0:K.rewards)||[],pagination:!1,scroll:{x:"100%",y:360}},{bodyCell:_(({column:c,record:j,text:h})=>{var W;return[c.key==="title"?(n(),l(m,{key:0},[v(a(i(te))+" "+a(i(Pe)(j.price))+" - "+a(h)+" ",1),((W=i(d))==null?void 0:W.smoke_status)===1?(n(),l("span",Ze,"(95%)")):k("",!0)],64)):c.key==="reward_type"?(n(),l(m,{key:1},[h==="secret"?(n(),l(m,{key:0},[v("Secret")],64)):h==="new"?(n(),l(m,{key:1},[v("New")],64)):(n(),l(m,{key:2},[v(a(null))],64))],64)):c.key==="backers_count"?(n(),l(m,{key:2},[v(a(i(Te)(h)),1)],64)):c.key==="not_send"?(n(),l(m,{key:3},[j.not_send?(n(),l("span",et,a(e.$t("common.no")),1)):(n(),l("span",tt,a(e.$t("common.yes")),1))],64)):k("",!0)]}),_:1},8,["data-source"])])])],2)]}),_:1}),r("div",null,[N.value?k("",!0):(n(),l("div",st,[r("h2",ot,a(e.$t("review.request.title")),1)])),o(Ee,{onCheck:s[0]||(s[0]=T=>N.value=T)})]),i(ee)?(n(),J(f,{key:0,class:"mx-auto mt-6 block w-full max-w-xs",type:"primary",disabled:((D=(A=(u=i(p))==null?void 0:u.data)==null?void 0:A.project)==null?void 0:D.send_status)===1,onClick:ce},{default:_(()=>[v(a(e.$t("review.survey.send_survey")),1)]),_:1},8,["disabled"])):k("",!0)]}),_:1},8,["loading"]),o(ke,{open:S.value,"onUpdate:open":s[5]||(s[5]=u=>S.value=u),title:e.$t("review.survey.channel"),"ok-text":e.$t("common.confirm"),footer:null,"after-close":()=>{x.value=1}},{default:_(()=>[x.value===1?(n(),l("div",at,[r("div",null,a(e.$t("review.survey.please_choose_the_channel_you_want_the_backers_receive_the_survey_invitation_message_recommended_choosing_both_channels")),1),r("div",nt,[o(pe,{value:C.value,"onUpdate:value":s[1]||(s[1]=u=>C.value=u)},{default:_(()=>[o(me,{value:"email",disabled:""},{default:_(()=>[v(a(e.$t("review.survey.through_email")),1)]),_:1})]),_:1},8,["value"])]),r("div",rt,[o(f,{type:"primary",onClick:ue},{default:_(()=>[v(a(e.$t("common.confirm")),1)]),_:1})])])):k("",!0),x.value===2?(n(),J(he,{key:1,ref_key:"formRef",ref:q,model:y,layout:"vertical",autocomplete:"off","hide-required-mark":""},{default:_(()=>[r("div",lt,a(e.$t("review.survey.please_input_the_kickstarter_account_to_enable_pledgebox_sending_survey_invitation_through_kickstarter_message")),1),o(V,{label:e.$t("project.kickstarter_account"),name:"ks_email",rules:[{required:!0,type:"email"}]},{default:_(()=>[o(ye,{value:y.ks_email,"onUpdate:value":s[2]||(s[2]=u=>y.ks_email=u),placeholder:"Email"},null,8,["value"])]),_:1},8,["label"]),o(V,{label:e.$t("project.kickstarter_password"),name:"ks_password",rules:[{required:!0}]},{default:_(()=>[o(fe,{value:y.ks_password,"onUpdate:value":s[3]||(s[3]=u=>y.ks_password=u),placeholder:"Password"},null,8,["value"])]),_:1},8,["label"]),o(V,{class:"mb-0 text-center"},{default:_(()=>[o(f,{onClick:s[4]||(s[4]=u=>x.value=1)},{default:_(()=>
1[v(a(e.$t("review.survey.previous_step")),1)]),_:1}),o(f,{class:"ml-3",type:"primary",loading:i(le),onClick:de},{default:_(()=>[v(a(e.$t("review.survey.next_step")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["model"])):k("",!0)]),_:1},8,["open","title","ok-text","after-close"])],64)}}});export{dt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.