1import{j as e,t as s,m as n,r as t,i as r,a as i,L as a,Q as o,B as c,P as d,e as l,N as u}from"./index-r-KClxtY.js";/* empty css */import{P as p}from"./Popup-CflKBRd8.js";import m from"./Iframe-DGOvosy-.js";const j=()=>e.jsx("div",{className:"DeactivationSurvey-wrapper",children:e.jsx(m,{src:"https://docs.google.com/forms/d/e/1FAIpQLSdnv-ucGt3UJTKvtt7afW78HNauy956cq4Q29T4ORkRyNDejw/viewform?embedded=true"})}),_=()=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"page-desc",children:s.user.subscriptions.unset_renew_confirmation}),e.jsx("h5",{className:"page-desc",children:s.user.subscriptions.unset_renew_help_us}),e.jsx(j,{})]}),h=()=>{const m=n(),[j,h]=t.useState(!1),[v,x]=t.useState(!1),[b,w]=t.useState("active"),[g,f]=t.useState([]),[N,k]=t.useState({});r();const{addNotice:I}=i();t.useEffect((()=>{m&&m.prevention_offers&&f(m.prevention_offers),m&&m.subscription&&k(m.subscription)}),[m]);const P=()=>{x(!0),l("/api/user/abbonamento/renew/unset/".concat(N.kAbbonamento),{}).then((e=>{const n=null==e?void 0:e.data;!1===(null==n?void 0:n.success)?I({title:s.notices.unset_renew_error,type:u.error,timeout:5e3}):w("deactivated")})).catch((e=>{I({title:s.notices.unset_renew_error,type:u.error,timeout:5e3}),Promise.reject(e||null)})).finally((()=>{x(!1),h(!1)}))};return e.jsxs("div",{className:"ManageRenew-wrapper route-wrapper",children:[v&&e.jsx(a,{}),e.jsx("h2",{className:"page-title",children:"active"==b?s.user.titles.manage_renew:s.user.titles.manage_renew_deactivated}),e.jsxs("div",{id:"dashboard-top",children:[e.jsxs("div",{id:"dashboard-main",children:["active"==b&&0!==g.length&&e.jsxs(e.Fragment,{children:[e.jsx(o,{offers:g,kAbbonamento:N.kAbbonamento}),e.jsxs("div",{className:"deactivation",children:[e.jsx("div",{className:"go-on",children:e.jsx(c,{className:"plain-btn",onClick:()=>{h(!0)},trackingId:"manage_renew",label:s.user.subscriptions.unset_renew_go_on})}),j&&e.jsxs(p,{className:"UnsetRenew-popup",closePopup:()=>{h(!1)},children:[e.jsx("h4",{children:s.user.subscriptions.unset_renew_confirm}),e.jsx("div",{className:"unset-options",children:e.jsx("div",{className:"unset",children:e.jsx(c,{label:s.user.subscriptions.unset_renew_deactivate,onClick:P,trackingId:"delete_renew",popupId:"manage_renew"})})})]})]})]}),"active"==b&&0==g.length&&e.jsxs(e.Fragment,{children:[e.jsx("div",{children:s.user.subscriptions.unset_renew_description_short}),e.jsx("h4",{children:s.user.subscriptions.unset_renew_confirm}),e.jsx("div",{className:"unset-options",children:e.jsxs("div",{className:"unset",children:[e.jsx(c,{label:s.user.subscriptions.unset_renew_deactivate,onClick:()=>{h(!0)},trackingId:"delete_renew"}),j&&e.jsxs(p,{className:"UnsetRenew-popup",closePopup:()=>{h(!1)},children:[e.jsx("h4",{children:s.user.subscriptions.unset_renew_confirm}),e.jsx("div",{className:"unset-options",children:e.jsx("div",{className:"unset",children:e.jsx(c,{label:s.user.subscriptions.unset_renew_deactivate,onClick:P,trackingId:"delete_renew",popupId:"manage_renew"})})})]})]})})]}),"deactivated"==b&&e.jsx(_,{})]}),e.jsx("div",{id:"dashboard-column",children:N&&(null==N?void 0:N.kTipoProdotto)&&e.jsx(d,{productType:N.kTipoProdotto,title:"active"==b?s.user.subscriptions.pros_giving_up:s.user.subscriptions.pros_given_up,showToggleIcon:!1})})]})]})};export{h 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.