1import{b as e}from"./element-plus.80abf16b.js";import{c1 as l,bM as a,bK as o,bQ as r,bP as i,c2 as n,c3 as t,cp as d,ca as s,cf as u,cd as c,c9 as p,ch as b,ce as m,bI as v,c7 as g,c8 as f,ep as h,eq as y,eu as k}from"./commonmodules.b9c1dd40.js";import{_ as S,u as C,a as x,m as w,g as P}from"./index.d3bd9396.js";import L from"./RenderHtml.81f5c09a.js";import"./lodash-es.480d1bd8.js";import"./axios.1263d4b1.js";import"./vue-router.5e13d197.js";const R=e=>(h("data-v-324bc701"),e=e(),y(),e),I={key:0,action:"/Account/RedirectPersonalInfo",method:"get",id:"loginForm"},U=["disabled","aria-describedby"],N=["value"],T=R((()=>s("input",{id:"policyName",type:"hidden",name:"policyName",value:"ELearning"},null,-1))),_=["value"],z=["id"],$=["disabled","aria-describedby"],j={action:"/Account/RedirectPersonalInfo",method:"get",id:"loginForm"},B=["value"],D=R((()=>s("input",{id:"policyName",type:"hidden",name:"policyName",value:"ELearning"},null,-1))),A=["value"];var E=S(l({__name:"ButtonField",props:{domId:null,componentData:null},setup(l){const h=l,y=a({fieldName:"",fontSize:0,fontColor:"",bgColor:"",borderRadius:0,width:0,height:0,topSpace:0,displayAsPlain:!1,plainColor:""});let S,R=!1;const E=C(),F=o((()=>{const e=E.state.detail.data;return R=!!e.isELearningProgramme,R&&(S=e.programmeTypeFlag),y.value.fieldName?e[y.value.fieldName]:null})),W=o((()=>{const e=E.state.detail.data;return(null==e?void 0:e.reviewButton)||null})),M=a(!1),q=o((()=>E.state.render.isLogin)),J=o((()=>{var e;return null==(e=E.state.render.userProfile)?void 0:e.nonce}));o((()=>{var e;return null==(e=E.state.render.ELearningProgrammeInfo)?void 0:e.link}));const O=async()=>{var e,l,a;if(null==(e=F.value)?void 0:e.link)if(R){if(await E.dispatch("render/checkLogin"),q.value,q.value||E.commit(w.render.setLoginDialog,{showLoginDialog:!0}),E.commit(w.render.setProgrammeType,{programmeType:S}),E.commit(w.render.setELearningProgrammeInfo,{link:F.value.link}),q.value){const{courseUrl:e,pageUrl:o}=(e=>{const l=e.replace(/\/$/,"").match(/\/course\/([^\/]+)\/([^\/]+)$/);return l?{courseUrl:l[1],pageUrl:l[2]}:{courseUrl:"",pageUrl:""}})(null==(l=F.value)?void 0:l.link);let r;if(e&&o&&(r=await P(`/api/v1/courseapi/getleftnav?courseUrl=${e}&pageUrl=${o}`)),null==r?void 0:r.needRegister){J.value||await E.dispatch("render/getUserProfile",{userType:3});const e=document.querySelector("div #RedirectPersonalInfo");e&&(null==(a=F.value)||a.link,e.click())}else x.isCurrentSiteUrl(F.value.link)?window.open(F.value.link,"_self"):E.commit(w.render.setLeaveSite,{hasLeaveSiteWarning:!0,leaveSiteProceedUrl:F.value.link})}}else x.isCurrentSiteUrl(F.value.link)?window.open(F.value.link,"_self"):E.commit(w.render.setLeaveSite,{hasLeaveSiteWarning:!0,leaveSiteProceedUrl:F.value.link})},H=(e,l)=>{e&&(x.isCurrentSiteUrl(e)?window.open(e,"_self"):E.commit(w.render.setLeaveSite,{hasLeaveSiteWarning:!0,leaveSiteProceedUrl:F.value.link}))},K=o((()=>{var e;if(null==(e=F.value)?void 0:e.message)return k(F.value.message,x.getXssWhiteList())}));return h.componentData&&(y.value=JSON.parse(null==h?void 0:h.componentData)),r((()=>h.componentData),(e=>{y.value=JSON.parse(e)})),(a,o)=>{var r,h,k,C,x,w,P,E,q,Q,X,G,V,Y,Z,ee;const le=e;return i(y).displayAsPlain?(n(),t(v,{key:0},[i(y).displayAsPlain?(n(),t("div",{key:0,class:"plain-button-wrapper camps-flex-center",style:d({marginTop:i(y).topSpace+"px",color:i(y).plainColor})},[i(F)?(n(),t("form",I,[s("button",{type:"button",class:"plain-button",onClick:o[0]||(o[0]=e=>O()),disabled:null==(r=i(F))?void 0:r.disabled,"aria-describedby":l.domId,style:d({width:i(y).width+"px",height:i(y).height+"px",borderRadius:i(y).borderRadius+"px",fontSize:i(y).fontSize+"px",color:i(y).plainColor,borderColor:i(F).borderColor})},u(null==(h=i(F))?void 0:h.label),13,U),s("button",{type:"submit",style:{display:"none"},class:"btn btn-normal",id:"RedirectPersonalInfo",name:"nonce",value:i(J)},[s("span",null,u(null==(k=i(F))?void 0:k.label),1)],8,N),T,s("input",{"data-v-3957b31f":"",id:"returnurl",type:"hidden",name:"returnurl",value:`${null==(C=i(F))?void 0:C.link}?programmeType=${i(S)}&hasSingpass=true`},null,8,_)])):c("",!0),i(F)&&(null==(x=i(F))?void 0:x.message)?(n(),t("div",{key:1,class:"icon-ffl icon-ffl-info",onMouseover:o[1]||(o[1]=e=>M.value=!0),onMouseleave:o[2]||(o[2]=e=>M.value=!1)},[p(s("div",{class:"tip",id:l.domId,style:d({borderColor:i(y).plainColor})},[m(u(null==(w=i(F))?void 0:w.message)+" ",1),s("span",{class:"triangle",style:d({borderBottomColor:i(y).plainColor})},null,4)],12,z),[[b,i(M)]])],32)):c("",!0),i(F)&&i(R)&&i(W)?(n(),t("button",{key:2,type:"button",class:"plain-button hhhhhhh",onClick:o[3]||(o[3]=e=>H(i(W).link,i(W).label)),disabled:null==(P=i(W))?void 0:P.disabled,"aria-describedby":l.domId,style:d({width:i(y).width+"px",height:i(y).height+"px",borderRadius:i(y).borderRadius+"px",fontSize:i(y).fontSize+"px",color:i(W).textColor,borderColor:i(W).borderColor,marginTop:i(y).topSpace+"px"})},u(null==(E=i(W))?void 0:E.label),13,$)):c("",!0)],4)):c("",!0)],64)):(n(),t(v,{key:1},[s("form",j,[i(F)?(n(),g(le,{key:0,class:"default-button","aria-label":null==(q=i(F))?void 0:q.label,"aria-describedby":l.domId,color:(null==(Q=i(F))?void 0:Q.backgroundColor)||i(y).plainColor,onClick:o[4]||(o[4]=e=>O()),disabled:null==(X=i(F))?void 0:X.disabled,style:d({width:i(y).width+"px",height:i(y).height+"px",borderRadius:i(y).borderRadius+"px",fontSize:i(y).fontSize+"px",color:i(F).textColor,marginTop:i(y).topSpace+"px",borderColor:i(F).borderColor})},{default:f((()=>{var e;return[m(u((null==(e=i(F))?void 0:e.label)||"Button"),1)]})),_:1},8,["aria-label","aria-describedby","color","disabled","style"])):c("",!0),i(K)&&"Book Now"==(null==(G=i(F))?void 0:G.label)?(n(),g(L,{key:1,class:"tip-message",content:i(K)},null,8,["content"])):c("",!0),s("button",{type:"submit",style:{display:"none"},class:"btn btn-normal",id:"RedirectPersonalInfo",name:"nonce",value:i(J)},[s("span",null,u(null==(V=i(F))?void 0:V.label),1)],8,B),D,s("input",{"data-v-3957b31f":"",id:"returnurl",type:"hidden",name:"returnurl",value:`${null==(Y=i(F))?void 0:Y.link}?programmeType=${i(S)}&hasSingpass=true`},null,8,A)]),i(R)&&i(W)?(n(),g(le,{key:0,class:"default-button","aria-label":null==(Z=i(W))?void 0:Z.label,"aria-describedby":l.domId,color:i(W).backgroundColor,onClick:o[5]||(o[5]=e=>H(i(W).link,i(W).label)),disabled:null==(ee=i(W))?void 0:ee.disabled,style:d({width:i(y).width+"px",height:i(y).height+"px",borderRadius:i(y).borderRadius+"px",fontSize:i(y).fontSize+"px",color:i(W).textColor,marginTop:i(y).topSpace+"px",borderColor:i(W).borderColor})},{default:f((()=>{var e;return[m(u((null==(e=i(W))?void 0:e.label)||"Button"),1)]})),_:1},8,["aria-label","aria-describedby","color","disabled","style"])):c("",!0)],64))}}}),[["__scopeId","data-v-324bc701"]]);export{E 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.