1import{d as B,Q as F,c as L,Z as T,r as p,x,y,z as h,_ as V,K as o,H as N,L as K,m as a,I as D,P as I}from"./BJhlU1rR.js";import{a as M,_ as z,f as A}from"./Bxi2OfLn.js";import{_ as H}from"./DIheCY_a.js";import{f as O,s as Q}from"./BOVKW5Xp.js";import{u as P}from"./BXgMM1f5.js";import{u as W}from"./8mnopAEE.js";import"./BldDexor.js";import"./DxGZjgJY.js";import"./CL93qZiK.js";import"./C4-wI4XM.js";import"./v9y1S7hN.js";import"./BkGlnVwb.js";import"./BHREDrN6.js";import"./D7eu--uw.js";import"./BwAlTTr4.js";const Z={class:"flex flex-col mt-m gap-s"},j={class:"flex flex-col gap-2xs"},ue=B({__name:"cancel",setup(E){const g=F(),{t:f,locale:$}=L(),C=W(),{data:_,contract:k}=T(C),r=p(""),c=p(!1);async function w(e){var m,i,u,n,d;c.value=!0;const l={customerNumber:(m=k.value)==null?void 0:m.contractNumber,email:(i=_.value)==null?void 0:i.mail,firstName:(u=_.value)==null?void 0:u.firstName,lastName:(n=_.value)==null?void 0:n.lastName,reason:e.reason,textarea:e.comment},t=await A(l,$.value);if(c.value=!1,(d=t==null?void 0:t.data)!=null&&d.message){r.value=t.data.message;return}else t.ok||(r.value=f("dbc-error-server-issues"));t.ok&&t.status===200&&(await C.getContracts(),g.push({path:P("self-service-contract"),query:{update:"contract"}}))}const b=p(""),s=p(f("dbc-cancel-contract-textarea-message-placeholder"));function q(e){s.value=s.value.replace("*",""),b.value="",e.commentMandatory&&(b.value="required",s.value+="*")}return(e,l)=>{const t=K,m=M,i=H,u=z,n=I("FormKit"),d=Q,R=V;return x(),y(R,{name:"main-view",headline:e.$t("dbc-cancel-contract-button-request-cancellation")},{default:h(()=>[o(d,{pt:"formCardPassThrough"in e?e.formCardPassThrough:a(O)},{content:h(()=>[N("div",Z,[o(t,{name:"dbc-icon-heart",class:"self-center"}),o(m,{class:"mx-xs mb-0"})]),o(n,{actions:!1,type:"form","form-class":"rounded-lg p-4",onSubmit:w,"aria-invalid":a(r)},{default:h(({disabled:S,state:{valid:v}})=>[a(r)?(x(),y(i,{key:0,message:a(r),severity:"warn"},null,8,["message"])):D("",!0),o(u,{onOnReasonChanged:q}),o(n,{type:"textarea",name:a(s),id:"comment",rows:"1",maxlength:"500","aria-label":a(s),placeholder:a(s),validation:a(b)},null,8,["name","aria-label","placeholder","validation"]),N("div",j,[o(n,{type:"submit",id:"submit",label:v?e.$t("dbc-cancel-contract-button-request-cancellation"):e.$t("dbc-text-fill-in-mandatory-fields"),disabled:!!S||!v||a(c),loading:a(c),"aria-label":v?a(c)?e.$t("dbc-text-loading"):e.$t("dbc-cancel-contract-button-request-cancellation"):e.$t("dbc-text-fill-in-mandatory-fields")},null,8,["label","disabled","loading","aria-label"]),o(n,{type:"button",id:"abort",onClick:l[0]||(l[0]=G=>a(g).push({path:("usePagePath"in e?e.usePagePath:a(P))("self-service-contract")})),label:a(f)("dbc-btn-abort")},null,8,["label"])])]),_:1},8,["aria-invalid"])]),_:1},8,["pt"])]),_:1},8,["headline"])}}});export{ue 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.