define("checkout/components/change_plan/utils",["require","exports","checkout/common/ts_utils","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/types"],(function(e,t,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContractLengthUnitNames=void 0;var n=s.storefront_platform.StorefrontPlatformContractLengthUnit;t.getContractLengthUnitNames=(e,t)=>{switch(e){case n.MONTH:return{name:t.formatMessage({id:"hWZaN5",defaultMessage:"month"}),recurringName:t.formatMessage({id:"20yh+Q",defaultMessage:"monthly"})};case n.YEAR:return{name:t.formatMessage({id:"y6hDW0",defaultMessage:"year"}),recurringName:t.formatMessage({id:"mSLwek",defaultMessage:"yearly"})};case n.DAY:return{name:t.formatMessage({id:"wuivV4",defaultMessage:"day"}),recurringName:t.formatMessage({id:"P4syht",defaultMessage:"daily"})};case n.UNKNOWN_CONTRACT_LENGTH_UNIT:case n.UNLIMITED:default:a.enforceExhaustive(e)}}})),define("typescript/component_libraries/family/src/common/features",["require","exports","tslib","react"],(function(e,t,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useFeatureFlag=t.FeatureFlagProvider=t.FAMILY_FEATURE_FLAGS=void 0,s=a.__importStar(s);const{createContext:n,useContext:i}=s;(t.FAMILY_FEATURE_FLAGS||(t.FAMILY_FEATURE_FLAGS={})).HAS_FAMILY_SHARED_FOLDER="has_family_shared_folder";const o=n({});t.FeatureFlagProvider=({children:e,flags:t})=>s.createElement(o.Provider,{value:t},e),t.FeatureFlagProvider.displayName="FeatureFlagProvider",t.useFeatureFlag=function(e){return!!i(o)[e]}})),define("typescript/component_libraries/family/src/common/links",["require","exports","tslib","react","dig-components/typography"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ageGatingHelpCenterLink=t.AGE_GATING_HELP_CENTER_ARTICLE=t.REMOVE_MEMBER_HELP_CENTER_ARTICLE=t.FAMILY_ROOM_HELP_CENTER_ARTICLE=void 0,s=a.__importStar(s),t.FAMILY_ROOM_HELP_CENTER_ARTICLE="https://help.dropbox.com/accounts-billing/plans-upgrades/share-files-family-plan#familyroom",t.REMOVE_MEMBER_HELP_CENTER_ARTICLE="https://help.dropbox.com/accounts-billing/plans-upgrades/manage-family-plan#remove",t.AGE_GATING_HELP_CENTER_ARTICLE="https://help.dropbox.com/accounts-billing/plans-upgrades/dropbox-family-age-requirements",t.ageGatingHelpCenterLink=e=>s.createElement(n.Link,{href:t.AGE_GATING_HELP_CENTER_ARTICLE},e)})),define("metaserver/static/js/modules/clean/account_page/constants",["require","exports","metaserver/static/js/modules/core/uri"],(function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GIGABYTE_IN_BYTES=t.MEGABYTE_IN_BYTES=t.ROOT_DOWNGRADE_URI=t.CancellationType=void 0,(function(e){e[e.ALL=1]="ALL",e[e.PLAN=2]="PLAN",e[e.SCHEDULE=3]="SCHEDULE",e[e.LICENSES=4]="LICENSES",e[e.ADDON=5]="ADDON",e[e.IND_SUBSCRIPTION=6]="IND_SUBSCRIPTION",e[e.FAMILY_NONPAYER=7]="FAMILY_NONPAYER"})(t.CancellationType||(t.CancellationType={})),t.ROOT_DOWNGRADE_URI=new a.URI({path:"/downgrade",query:{oqa:"acc_cancel"}}),t.MEGABYTE_IN_BYTES=1048576,t.GIGABYTE_IN_BYTES=1073741824})),define("metaserver/static/js/modules/clean/account_page/tabs/billing",["require","exports","tslib","react","react-redux","styled-components","metaserver/static/js/modules/clean/account_page/components/key_value_block","metaserver/static/js/modules/clean/account_page/components/loading","metaserver/static/js/modules/clean/account_page/widgets/billing/action_creators","metaserver/static/js/modules/clean/account_page/widgets/billing/payment_methods_util","metaserver/static/js/modules/clean/payments/billing_instrument/payment_methods_util","metaserver/static/js/modules/clean/account_page/widgets/billing/views/billing_history","metaserver/static/js/modules/clean/account_page/widgets/billing/views/invoice_details","metaserver/static/js/modules/clean/account_page/widgets/plan/action_creators","metaserver/static/js/modules/clean/account_page/widgets/plan/add_ons/action_creators","metaserver/static/js/modules/clean/account_page/widgets/plan/views/add_schedule_modal","metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/dbmodal_stack","metaserver/static/js/modules/clean/event_handler","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/payments/skus/sku_content","metaserver/static/js/modules/clean/payments/skus/subscription_status","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/clean/react/payments/edit_invoice_address_modal/edit_invoice_address_modal_loader","metaserver/static/js/modules/clean/react/payments/error/browser_update_required_modal","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_billing_modal_loader","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_store_creator","metaserver/static/js/modules/clean/teams/admin/lib/billing_history","metaserver/static/js/modules/clean/web_timing_logger","metaserver/static/js/modules/constants/trademark","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/clean/account_page/widgets/plan/api","metaserver/static/js/modules/clean/subscription/constants"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v,M,S,E,C,P,A,T,w,I,N,L,D,x,j,k,B,O){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initialize_module=t.moduleInit=t.BillingTab=t.BillingTabView=void 0,s=a.__importDefault(s),n=a.__importStar(n),i=a.__importDefault(i),D=a.__importStar(D);const R=i.default.div` .billing-table-container { border-radius: 0; border: 1px solid var(--color__faint__border); .billing-history-table { width: 100%; border-collapse: collapse; .row-header { background-color: var(--color__faint__background); padding: var(--spacing__unit--2) 0; color: var(--color__faint__text); font-size: var(--type__body__standard--fontsize); height: auto; font-weight: normal; } .caret { vertical-align: middle; } .date-header-cell { font-weight: normal; text-align: left; color: var(--color__faint__text); } .date-row { padding-left: var(--spacing__unit--2); padding-right: var(--spacing__unit--3); width: 80px; font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); } .desc-row { font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); } .price-row { padding-left: var(--spacing__unit--3); padding-right: var(--spacing__unit--2); width: 100px; font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); } .row-content { height: 56px; border-top: 1px solid var(--color__faint__border); color: var(--color__standard__text); &__links { white-space: nowrap; padding: var(--spacing__base_unit); text-align: right; a, button { &:not(:first-child) { margin-left: var(--spacing__base_unit); } } } } .row-content__date { padding-left: var(--spacing__unit--2); padding-right: var(--spacing__unit--3); width: 80px; text-align: left; color: var(--color__standard__text); } .row-content__description { color: var(--color__standard__text); .description-line { margin: 0; } } .row-content__price { padding-left: var(--spacing__unit--3); padding-right: var(--spacing__unit--2); width: 100px; text-align: left; color: var(--color__standard__text); } .billing-history-row { border-top: 1px solid var(--color__faint__border); } .billing-history-col { text-align: center; height: ver(--spacing__unit--5); } } } `;let U=class extends s.default.Component{constructor(e){super(e),this.browserUpdateRequired=()=>!!this.props.browserUpdateRequired&&(A.BrowserUpdateModalLoader.showInstance(),!0),this.handlePaymentUpdate=()=>{var e,t;if(!this.browserUpdateRequired())if(y.ProEventsLogger.log("de_billing_tab_update_payment_method_click"),this.props.billingInfo.scheduled_for_downgrade){const a=this.props.billingInfo.subscription_id;f.CancelSubsWarningModal.showInstance({renewalDate:(null===(t=null===(e=this.subStatus)||void 0===e?void 0:e.subState)||void 0===t?void 0:t.formattedNextBillingDate)||"",transitionPerformed:this.reloadData,subscriptionId:a,useStorefrontPlatformEndpoints:Boolean(a)})}else T.IndividualUpdateBillingModalLoader.showInstance()},this.handlePaymentAdd=()=>{this.browserUpdateRequired()||(y.ProEventsLogger.log("de_billing_tab_add_payment_method_click"),T.IndividualUpdateBillingModalLoader.showInstance())},this.handlePaymentAddToResubscribe=()=>{this.browserUpdateRequired()||(y.ProEventsLogger.log("de_billing_tab_add_payment_method_resubscribe_click"),j.Notify.success(x.intl.formatMessage({id:"CDgQc9",defaultMessage:"Please update your billing information to be resubscribed."})),T.IndividualUpdateBillingModalLoader.showInstance())},this.reloadData=()=>{const{loadBillingInfo:e,loadPlanDataIfNecessary:t,loadAddonsInfoIfNecessary:a,loadAvailableAddonsInfoIfNecessary:s}=this.props;B.resetApolloStore(),e(!0),a(!0),s(!0),t(!0)},this.handleRebillUpsell=e=>{e&&e.showChangePlanConfirm&&D.redirect(`${O.SINGLE_SEAT_FSS_CHANGE_PLAN_ROUTE}?_tk=rebill_upsell`)},this.handleAddBillUpsell=()=>{this.props.trialsConfig&&this.props.showNptScheduleModal&&(_.AddScheduleModalView.showInstance({project:this.props.trialsConfig.project,productType:S.SkuContentClient.deserialize(this.props.trialsConfig.trialPlan.skuContent).dropboxDisplayName(),userId:this.user.id,skuCode:this.props.trialsConfig.trialPlan.skuCode,duration:this.props.trialsConfig.trialPlan.duration,billingId:this.props.billingInfo.payment_info.gateway_id}),y.ProEventsLogger.log("de_billing_tab_trigger_add_schedule_modal",{source:"billing_info_updated",project:this.props.trialsConfig.project}))},this.onEditInvoiceDetailsClick=()=>{y.ProEventsLogger.log("de_billing_tab_edit_invoice_modal_open"),P.EditInvoiceAddressModalLoader.showUpdateTaxProfileModal(!1,this.onInvoiceDetailsUpdated)},this.onInvoiceDetailsUpdated=()=>{this.props.loadBillingInfo(!0)},this.renderBillingHistory=()=>{const{transactions:e,show_edit_invoice_modal:t,edit_past_invoices:a}=this.props.billingInfo,n=t&&a;let i=!1;if(null!==e&&e.transactions.length>0){i=I.getHistoryData(e.transactions).length>3}return s.default.createElement(u.BillingHistory,{showEditInvoiceModal:n,transactions:e.transactions,filters:e.filters,hasMore:i})},this.renderPaymentMethod=()=>{var e,t;if(this.disallowChangesToCurrentBilling)return;if(this.props.trialsConfig&&this.props.trialsConfig.hideBillingModal)return;const{gateway_id:a,expiration_date:n,description:i,is_reseller_billing:r,end_date:l,deactivated:u,is_on_trial:m,reseller_name:p,reseller_link:g}=this.props.billingInfo.payment_info;if(r){const e=x.intl.formatMessage({id:"b9rPCC",defaultMessage:"Go to {reseller_name} to view or make changes to your account details"},{reseller_name:p}),t=s.default.createElement("a",{href:g,target:"_blank",rel:"noopener noreferrer"},e);return s.default.createElement(o.KeyValueBlock,{className:"jest-update-payment",keyText:t})}if(-1===a)return;if(!d.shouldHidePaymentMethod(a)&&!this.props.billingInfo.payment_method)return s.default.createElement(o.KeyValueBlock,{className:"add-payment jest-update-payment",keyText:x.intl.formatMessage({id:"7Au+O9",defaultMessage:"You can add your payment information now to have your subscription automatically renew when it expires"}),linkText:x.intl.formatMessage({id:"YcxVqg",defaultMessage:"Add"}),onLinkClick:this.handlePaymentAddToResubscribe});if(c.isLicenseKey(a))return s.default.createElement("div",{className:"account-page-block"},s.default.createElement(o.KeyValueBlock,{className:"jest-update-payment",keyText:x.intl.formatMessage({id:"DlX7Ow",defaultMessage:"Payment method"}),subtext:x.intl.formatMessage({id:"nST3rs",defaultMessage:"Add your payment information now to have your subscription automatically renew when it expires"}),linkText:x.intl.formatMessage({id:"CyOG7U",defaultMessage:"Add payment method"}),onLinkClick:this.handlePaymentAdd}));if(d.shouldHidePaymentMethod(a)){const n=d.getPaymentMethodDisabledMessage(a,r,(null===(t=null===(e=this.subStatus)||void 0===e?void 0:e.subState.plan)||void 0===t?void 0:t.displayName())||L.TRADEMARK_PLUS,l,u,m);return s.default.createElement(o.KeyValueBlock,{className:"jest-update-payment",keyText:n})}let _=i;return null!==n&&(_=x.intl.formatMessage({id:"3tRkOA",defaultMessage:"{payment_description}, exp: {expiration_date}"},{payment_description:i,expiration_date:n})),s.default.createElement(o.KeyValueBlock,{className:"update-payment-key-value jest-update-payment",keyText:x.intl.formatMessage({id:"DlX7Ow",defaultMessage:"Payment method"}),valueText:_,linkText:x.intl.formatMessage({id:"+5HiT6",defaultMessage:"Update"}),onLinkClick:this.handlePaymentUpdate})},this.renderInvoiceDetails=()=>{const{show_edit_invoice_modal:e,payment_info:t,payment_method:a,has_invoice_details:n}=this.props.billingInfo;if(this.user.paid&&e&&!d.shouldHideBillingChange(t.gateway_id,t.is_reseller_billing)&&t.period)return s.default.createElement(m.InvoiceDetails,{onLinkClick:this.onEditInvoiceDetailsClick,has_invoice_details:n,country_code:a?a.country_code:void 0})},this.user=h.mustGetActiveUser(),b.DBModalStack.register(w.BILLING_INFO_UPDATED,e=>{y.ProEventsLogger.log("de_payment_modal_save_click"),B.resetApolloStore(),this.props.loadBillingInfo(!0),this.props.loadPlanDataIfNecessary(!0),this.handleRebillUpsell(e.detail),this.handleAddBillUpsell()})}componentDidMount(){this.props.loadBillingInfo(),this.checkTTIstate(),y.ProEventsLogger.log("de_billing_tab_view"),this.events.on(window,"hashchange",()=>{this.displayResubscribeBillingModal(),this.displayUpdateBillingModal(),this.displayAddScheduleModal()}),this.displayResubscribeBillingModal(),this.displayUpdateBillingModal(),this.displayAddScheduleModal()}componentDidUpdate(){this.checkTTIstate()}displayUpdateBillingModal(){var e;const t=D.get_hash(),a=void 0!==t&&-1!==t.search("billing_info")&&-1===t.search("resubscribe_billing_info"),s=k.URI.parse(D.get_href()).getQuery().modal,n=s&&"billing_info"===s,i=k.URI.parse(D.get_href()).getQuery().reason;if(a||n){if(!this.user.paid)return;if(this.browserUpdateRequired())return;if(this.props.trialsConfig&&this.props.trialsConfig.hideBillingModal)return;T.IndividualUpdateBillingModalLoader.showInstance(),y.ProEventsLogger.log("de_billing_tab_trigger_update_billing_modal",{reason:i,project:null===(e=this.props.trialsConfig)||void 0===e?void 0:e.project})}}displayResubscribeBillingModal(){const e=D.get_hash();if(void 0!==e&&-1!==e.search("resubscribe_billing_info")){if(this.browserUpdateRequired())return;T.IndividualUpdateBillingModalLoader.showInstance()}}displayAddScheduleModal(){const e=D.get_hash(),t=void 0!==e&&-1!==e.search("add_schedule"),a=k.URI.parse(D.get_href()).getQuery().modal;(t||a&&"add_schedule"===a)&&this.user.paid&&!this.browserUpdateRequired()&&this.props.trialsConfig&&!this.props.trialsConfig.hideBillingModal&&(_.AddScheduleModalView.showInstance({project:this.props.trialsConfig.project,productType:S.SkuContentClient.deserialize(this.props.trialsConfig.trialPlan.skuContent).dropboxDisplayName(),userId:this.user.id,skuCode:this.props.trialsConfig.trialPlan.skuCode,duration:this.props.trialsConfig.trialPlan.duration,billingId:this.props.billingInfo.payment_info.gateway_id}),y.ProEventsLogger.log("de_billing_tab_trigger_add_schedule_modal",{source:"redirect_url",project:this.props.trialsConfig.project}))}get subStatus(){const{serialized_sub_status:e}=this.props.billingInfo;if(e)return E.SubscriptionStatus.deserialize(e)}get isFamilyNonPayerPlan(){var e,t;return(null===(t=null===(e=this.subStatus)||void 0===e?void 0:e.subState.plan)||void 0===t?void 0:t.productType)===M.ProductPlanType.FAMILY_NONPAYER}get disallowChangesToCurrentBilling(){return!this.user.paid||this.isFamilyNonPayerPlan}checkTTIstate(){this.props.dataLoadedForTTI&&(N.mark_time_to_view(),N.mark_time_to_interactive())}isLoading(){return"ready"!==this.props.loadingState}render(){return this.isLoading()?s.default.createElement(r.Loading,null):s.default.createElement(R,{className:"account-page-tab"},this.renderPaymentMethod(),this.renderInvoiceDetails(),this.renderBillingHistory())}};U.displayName="BillingTabView",U=a.__decorate([v.eventHandler],U),t.BillingTabView=U;const F=n.connect((e,t)=>({browserUpdateRequired:t.browserUpdateRequired,billingInfo:e.billingInfo.billingInfo,loadingState:e.billingInfo.loadingState,dataLoadedForTTI:"ready"===e.billingInfo.loadingState}),e=>({loadBillingInfo:(t=!1)=>e(l.loadDataIfNecessary(t)),loadPlanDataIfNecessary:(t=!1,a)=>e(p.loadDataIfNecessary(t,a)),loadAddonsInfoIfNecessary:(t=!1)=>e(g.loadAddonsInfoIfNecessary(t)),loadAvailableAddonsInfoIfNecessary:(t=!1)=>e(g.loadAvailableAddonsInfoIfNecessary(t))}))(U);t.BillingTab=C.requireCssWithComponent(F,["/static/css/plan_management-vflirqNOR.css"]),t.moduleInit=function(e){},t.initialize_module=function(e){}})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/payment_methods_util",["require","exports","tslib","react","styled-components","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/payments/billing_instrument/payment_method_constants"],(function(e,t,a,s,n,i,o,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPaymentMethodDisabledMessage=t.getBillingDisabledMessage=t.getAppleLink=t.shouldHideBillingSummary=t.shouldHideBillingChange=t.shouldHidePaymentMethod=void 0,s=a.__importDefault(s);const d=(n=a.__importDefault(n)).default.a` font-size: var(--type__body__small--fontsize); color: var(--color__dbx__blue--100); text-align: left; width: 500px; `;function c(e){return[l.GOOGLE_PLAY_SUBSCRIPTION,l.IOS_ONE_TIME_PAYMENT,l.IOS_SANDBOX_ONE_TIME_PAYMENT,l.IOS_RECURRING_PAYMENT,l.IOS_SANDBOX_RECURRING_PAYMENT,l.NO_CHARGE_GATEWAY,l.RESELLER_LICENSE_KEY].includes(e)}function u(){o.ProEventsLogger.log("account_plan_ios_apple_cancel_help_clicked")}function m(){return s.default.createElement(d,{href:"https://support.apple.com/HT202039",target:"_blank",rel:"noopener noreferrer",onClick:u},i.intl.formatMessage({id:"KmMbqM",defaultMessage:"Learn how to manage your Apple App Store subscription"}))}t.shouldHidePaymentMethod=c,t.shouldHideBillingChange=function(e,t){return t||c(e)},t.shouldHideBillingSummary=function(e,t){const a=null==e?void 0:e.gateway_id;return a&&a===l.NO_CHARGE_GATEWAY&&t===r.ProductPlanType.FREE},t.getAppleLink=m,t.getBillingDisabledMessage=function(e){return e.isResellerBilling?s.default.createElement("a",{href:e.resellerLink,target:"_blank",rel:"noopener noreferrer"},i.intl.formatMessage({id:"sCHiez",defaultMessage:"Go to {reseller_name} to view or make changes to your account details."},{reseller_name:e.resellerName})):e.gatewayId===l.GOOGLE_PLAY_SUBSCRIPTION?i.intl.formatMessage({id:"qmzNq4",defaultMessage:"You purchased Dropbox {dropbox_plan} through Google Play. To make changes to your subscription, visit the Google Play Store."},{dropbox_plan:e.dropboxPlan}):e.gatewayId===l.IOS_ONE_TIME_PAYMENT?i.intl.formatMessage({id:"9Oab9R",defaultMessage:"You purchased Dropbox {dropbox_plan} through the iOS app. Your plan will expire on {end_date}."},{dropbox_plan:e.dropboxPlan,end_date:e.endDate}):[l.IOS_RECURRING_PAYMENT,l.IOS_SANDBOX_RECURRING_PAYMENT].includes(e.gatewayId)?e.deactivated?i.intl.formatMessage({id:"TDhZyM",defaultMessage:"Your subscription from Apple is no longer active."}):e.isOnTrial?s.default.createElement("div",null,s.default.createElement("span",null,i.intl.formatMessage({id:"W5pK97",defaultMessage:"You started a Dropbox {dropbox_plan} trial through the iOS app."},{dropbox_plan:e.dropboxPlan})),s.default.createElement("br",null),m()):s.default.createElement("div",null,s.default.createElement("span",null,i.intl.formatMessage({id:"J5IeA4",defaultMessage:"You purchased Dropbox {dropbox_plan} through the iOS app."},{dropbox_plan:e.dropboxPlan})),s.default.createElement("br",null),m()):i.intl.formatMessage({id:"R8sDaj",defaultMessage:"Sorry, you cannot change your billing schedule at this time."})},t.getPaymentMethodDisabledMessage=function(e,t,a,n,o,r){return t?i.intl.formatMessage({id:"FN1EQh",defaultMessage:"You’re being externally billed."}):e===l.GOOGLE_PLAY_SUBSCRIPTION?i.intl.formatMessage({id:"qmzNq4",defaultMessage:"You purchased Dropbox {dropbox_plan} through Google Play. To make changes to your subscription, visit the Google Play Store."},{dropbox_plan:a}):e===l.IOS_ONE_TIME_PAYMENT?i.intl.formatMessage({id:"9Oab9R",defaultMessage:"You purchased Dropbox {dropbox_plan} through the iOS app. Your plan will expire on {end_date}."},{dropbox_plan:a,end_date:n}):[l.IOS_RECURRING_PAYMENT,l.IOS_SANDBOX_RECURRING_PAYMENT].includes(e)?o?i.intl.formatMessage({id:"TDhZyM",defaultMessage:"Your subscription from Apple is no longer active."}):r?s.default.createElement("div",null,s.default.createElement("span",null,i.intl.formatMessage({id:"W5pK97",defaultMessage:"You started a Dropbox {dropbox_plan} trial through the iOS app."},{dropbox_plan:a})),s.default.createElement("br",null),m()):s.default.createElement("div",null,s.default.createElement("span",null,i.intl.formatMessage({id:"J5IeA4",defaultMessage:"You purchased Dropbox {dropbox_plan} through the iOS app."},{dropbox_plan:a})),s.default.createElement("br",null),m()):i.intl.formatMessage({id:"R8sDaj",defaultMessage:"Sorry, you cannot change your billing schedule at this time."})}})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/action_creators",["require","exports","tslib","metaserver/static/js/modules/clean/account_page/widgets/billing/api","metaserver/static/js/modules/clean/active_user"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadDataIfNecessary=void 0,t.loadDataIfNecessary=function(e=!1){return(t,i)=>a.__awaiter(this,void 0,void 0,(function*(){if("never_loaded"===i().billingInfo.loadingState||e){t({type:"billing_info_load"});const e=yield s.getBillingInfo(n.mustGetActiveUserId());return t({type:"billing_info_loaded",billingInfo:e}),!0}return!1}))}})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/api",["require","exports","metaserver/static/js/modules/clean/deprecated_ajax/ajax_as_promised_jquery"],(function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBillingInfo=void 0,t.getBillingInfo=function(e){return a.WebRequest({url:"/account/ajax_billing_tab_model",subject_user:e,dataType:"json"})}})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/billing_history/api",["require","exports","tslib","metaserver/static/js/modules/clean/deprecated_ajax/ajax_as_promised_jquery"],(function(e,t,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBillingHistory=void 0,t.getBillingHistory=function(e,t,n,i){return a.__awaiter(this,void 0,void 0,(function*(){return s.WebRequest({url:"/account/ajax_load_more_billing_history/",data:{block:t,filter_type:n,filter_change:i},subject_user:e,dataType:"json"})}))}})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/billing_history/types",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingHistoryOrder=void 0,(function(e){e.ASCENDING="ASCENDING",e.DESCENDING="DESCENDING"})(t.BillingHistoryOrder||(t.BillingHistoryOrder={}))})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/views/billing_history",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/teams/admin/widgets/billing_history/billing_history_table","metaserver/static/js/modules/clean/teams/admin/lib/billing_history","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/account_page/widgets/billing/billing_history/api","metaserver/static/js/modules/clean/account_page/widgets/billing/billing_history/types","dig-components/progress_indicators"],(function(e,t,a,s,n,i,o,r,l,d,c,u){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingHistory=void 0,s=a.__importDefault(s);class m extends s.default.Component{constructor(e){super(e),this.loadMoreBillingHistory=e=>a.__awaiter(this,void 0,void 0,(function*(){this.setState({isLoading:!0}),l.ProEventsLogger.log("de_billing_history_view_more_click"),e.preventDefault();const t=yield d.getBillingHistory(i.mustGetActiveUserId(),this.state.numBlocksLoaded,this.state.filter,!1);return this.setState(e=>({transactions:e.isInitialLoad?t.transactions:e.transactions.concat(t.transactions),hasMore:t.hasMore,isLoading:!1,numBlocksLoaded:e.numBlocksLoaded+1,isInitialLoad:!1})),!1})),this.changeFilter=e=>a.__awaiter(this,void 0,void 0,(function*(){this.setState({isLoading:!0,filter:e}),l.ProEventsLogger.log("de_billing_history_change_filter_click");const t=yield d.getBillingHistory(i.mustGetActiveUserId(),this.state.numBlocksLoaded,e,!0);if(this.state.isInitialLoad){const e=r.getHistoryData(t.transactions);t.hasMore=e.length>3}return this.setState(e=>({transactions:t.transactions,hasMore:t.hasMore,isLoading:!1,numBlocksLoaded:e.numBlocksLoaded,isInitialLoad:e.isInitialLoad})),!1})),this.changeOrder=()=>{this.setState(e=>({order:e.order===c.BillingHistoryOrder.ASCENDING?c.BillingHistoryOrder.DESCENDING:c.BillingHistoryOrder.ASCENDING})),l.ProEventsLogger.log("de_billing_history_change_order_click")},this.handlePopoverSelection=e=>{this.state.filter!==e&&this.state.order!==e&&(e===c.BillingHistoryOrder.ASCENDING||e===c.BillingHistoryOrder.DESCENDING?this.changeOrder():this.changeFilter(e))},this.state={transactions:this.props.transactions?this.props.transactions.slice():[],hasMore:this.props.hasMore,isLoading:!1,numBlocksLoaded:0,isInitialLoad:!0,filter:"all_time",order:c.BillingHistoryOrder.ASCENDING}}render(){return s.default.createElement("div",{className:"account-page-block"},s.default.createElement("h2",{className:"account-page-block__heading"},n.intl.formatMessage({id:"h9UTH1",defaultMessage:"Billing history"})),s.default.createElement("p",{className:"account-page-block__subtext"},n.intl.formatMessage({id:"efUvgd",defaultMessage:"View invoices and receipts for all payments made on your Dropbox account."})),s.default.createElement("div",{className:"billing-table-container"},s.default.createElement(o.BillingHistoryTable,{billingHistoryRecords:this.getHistory(),amountLabel:n.intl.formatMessage({id:"Q9yFMv",defaultMessage:"Amount"}),displayNoTransactionsOnEmptyRecords:!0,showEditInvoiceModal:this.props.showEditInvoiceModal,noTransactionLabel:n.intl.formatMessage({id:"lj3d2i",defaultMessage:"No transaction history"}),footer:this.buildFooter(),logAccountBillingTabEvents:!0,isTeam:!1,filter:this.state.filter,order:this.state.order,onSelection:this.handlePopoverSelection,filters:this.props.filters})))}getHistory(){let e=[];return this.state.transactions.length>0&&(e=r.getHistoryData(this.state.transactions),this.state.isInitialLoad&&(e=e.slice(0,3))),this.state.order===c.BillingHistoryOrder.ASCENDING?e:e.reverse()}buildFooter(){return this.state.isLoading?s.default.createElement("tr",{className:"billing-history-row"},s.default.createElement("td",{colSpan:4,className:"billing-history-col"},s.default.createElement(u.Spinner,{size:"small","aria-valuetext":n.intl.formatMessage({id:"jybGUg",defaultMessage:"Loading"})}))):this.state.hasMore?s.default.createElement("tr",{className:"billing-history-row"},s.default.createElement("td",{colSpan:4,className:"billing-history-col"},s.default.createElement("a",{href:"#",className:"account-page__link",rel:"noopener noreferrer",onClick:this.loadMoreBillingHistory},n.intl.formatMessage({id:"Td8CMX",defaultMessage:"View more billing history"})))):void 0}}t.BillingHistory=m,m.displayName="BillingHistory"})),define("metaserver/static/js/modules/clean/account_page/widgets/billing/views/invoice_details",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/account_page/components/key_value_block","metaserver/static/js/modules/clean/payments/validation"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvoiceDetails=void 0,s=a.__importDefault(s);class r extends s.default.Component{render(){const{country_code:e,has_invoice_details:t}=this.props;let a=n.intl.formatMessage({id:"uD4mCH",defaultMessage:"Add details to your invoice, such as company name and address."});e&&o.hasVat(e)&&(a=n.intl.formatMessage({id:"uhx0D0",defaultMessage:"Add details to your invoice, such as company name, address, and VAT ID."}));const r=t?n.intl.formatMessage({id:"+5HiT6",defaultMessage:"Update"}):n.intl.formatMessage({id:"VLPo6o",defaultMessage:"Add invoice details"});return s.default.createElement(i.KeyValueBlock,{className:"jest-invoice-details",keyText:n.intl.formatMessage({id:"IyXKYR",defaultMessage:"Invoice details"}),linkText:r,subtext:a,onLinkClick:this.props.onLinkClick})}}t.InvoiceDetails=r,r.displayName="InvoiceDetails"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/action_creators",["require","exports","tslib","metaserver/static/js/modules/clean/account_page/widgets/plan/api","metaserver/static/js/modules/clean/active_user"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadDataIfNecessary=void 0,t.loadDataIfNecessary=function(e,t){return(i,o)=>a.__awaiter(this,void 0,void 0,(function*(){if("never_loaded"===o().planTab.loadingState||e){t||i({type:"plan_tab_load_info"});const e=yield s.getPlanInfo(n.mustGetActiveUserId());return i({type:"plan_tab_info_loaded",planInfo:e}),!0}return!1}))}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/add_ons/action_creators",["require","exports","tslib","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/account_page/widgets/plan/add_ons/api"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadAvailableAddonsInfoIfNecessary=t.loadAddonsInfoIfNecessary=void 0,t.loadAddonsInfoIfNecessary=function(e,t){return(i,o)=>a.__awaiter(this,void 0,void 0,(function*(){if("never_loaded"===o().planTab.addonsLoadingState||e){let e;if(i({type:"load_addons_info"}),t){const t=new n.AddonsInfoTeamClient;e=yield t.getCurrentAddonsInfoForTeam(s.mustGetActiveUserId())}else{const t=new n.AddonsInfoClient;e=yield t.getCurrentAddonsInfo(s.mustGetActiveUserId())}return i({type:"addons_info_loaded",addonsInfo:e.addons_info}),!0}return!1}))},t.loadAvailableAddonsInfoIfNecessary=function(e){return(t,i)=>a.__awaiter(this,void 0,void 0,(function*(){if("never_loaded"===i().planTab.availableAddonsLoadingState||e){t({type:"load_available_addons_info"});const e=new n.AddonsInfoClient,a=yield e.getAvailableAddonsInfo(s.mustGetActiveUserId());return t({type:"available_addons_info_loaded",availableAddonsInfo:a.available_addons_info}),!0}return!1}))}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/add_ons/api",["require","exports","metaserver/static/js/api_v2/user_client","metaserver/static/js/api_v2/team_client","metaserver/static/js/modules/clean/viewer"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.performAddonTransition=t.getAddonTransitionPreview=t.AddonsInfoTeamClient=t.AddonsInfoClient=void 0;class i extends a.UserApiV2Client{getCurrentAddonsInfo(e){return this.ns("growth_plans").rpc("get_current_addons_info",void 0,{subjectUserId:e})}getAvailableAddonsInfo(e){return this.ns("growth_plans").rpc("get_available_addons_info",void 0,{subjectUserId:e})}getAddonTransitionPreview(e,t){return this.ns("growth_plans").rpc("get_addon_transition_preview",t,{subjectUserId:e})}performAddonTransition(e,t){return this.ns("growth_plans").rpc("perform_addon_transition",t,{subjectUserId:e})}}t.AddonsInfoClient=i;class o extends s.TeamApiV2Client{getCurrentAddonsInfoForTeam(e){return this.ns("growth_plans").rpc("get_current_addons_info_for_team",void 0,{subjectUserId:e})}getAvailableAddonsInfoForTeam(e){return this.ns("growth_plans").rpc("get_available_addons_info_for_team",void 0,{subjectUserId:e})}getAddonTransitionPreviewForTeam(e,t){return this.ns("growth_plans").rpc("get_addon_transition_preview_for_team",t,{subjectUserId:e})}performAddonTransitionForTeam(e,t){return this.ns("growth_plans").rpc("perform_addon_transition_for_team",t,{subjectUserId:e})}}t.AddonsInfoTeamClient=o,t.getAddonTransitionPreview=(e,t,a)=>r(e)?(new i).getAddonTransitionPreview(t,a):(new o).getAddonTransitionPreviewForTeam(t,a),t.performAddonTransition=(e,t,a)=>r(e)?(new i).performAddonTransition(t,a):(new o).performAddonTransitionForTeam(t,a);const r=e=>{const t=n.Viewer.get_viewer();return"personal"===e||t.team_is_limited}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/api",["require","exports","tslib","metaserver/static/js/modules/clean/deprecated_ajax/ajax_as_promised_jquery","metaserver/static/js/api_v2/default_user_client","metaserver/static/js/apiql/client/apollo","metaserver/static/js/modules/clean/active_user"],(function(e,t,a,s,n,i,o){"use strict";let r;function l(){return r||(r=i.createApolloClient(o.mustGetActiveUserId(),{connectToDevTools:!0})),r}Object.defineProperty(t,"__esModule",{value:!0}),t.resetApolloStore=t.getApolloClient=t.getFamilyQuotaInfo=t.getPlanInfo=void 0,t.getPlanInfo=function(e){return a.__awaiter(this,void 0,void 0,(function*(){return s.WebRequest({url:"/account/ajax_plan_tab_model",subject_user:e,dataType:"json"})}))},t.getFamilyQuotaInfo=function(e){return a.__awaiter(this,void 0,void 0,(function*(){const t=new n.DefaultUserApiV2Client(e);return(yield t.ns("users").rpc("get_current_account",void 0,{})).family_quota_info}))},t.getApolloClient=l,t.resetApolloStore=function(){l().resetStore()}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/notifications/action_creators",["require","exports","tslib"],(function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setProductChangeNotificationSeen=t.setCancellationNotificationSeen=void 0,t.setCancellationNotificationSeen=function(){return e=>a.__awaiter(this,void 0,void 0,(function*(){return e({type:"cancellation_notification_seen"}),!0}))},t.setProductChangeNotificationSeen=function(){return e=>a.__awaiter(this,void 0,void 0,(function*(){return e({type:"product_change_notification_seen"}),!0}))}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/constants",["require","exports","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/types"],(function(e,t,a,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.personalProductPlanTypeToStorefrontPlatformProductType=t.addonProductTypeToStorefrontPlatformProductType=t.planTypeToUpgrades=t.CHANGE_IND_PLAN_MODAL_UPDATED=void 0;var n=s.storefront_platform.StorefrontPlatformProductType;t.CHANGE_IND_PLAN_MODAL_UPDATED="change_inv_plan_modal:updated",t.planTypeToUpgrades={[a.ProductPlanType.FAMILY_PAYER]:[a.ProductPlanType.PROFESSIONAL],[a.ProductPlanType.PROFESSIONAL]:[a.ProductPlanType.FAMILY_PAYER,a.ProductPlanType.HS_DBX_PRO_BUNDLE],[a.ProductPlanType.PLUS]:[a.ProductPlanType.PROFESSIONAL,a.ProductPlanType.FAMILY_PAYER,a.ProductPlanType.HS_DBX_PRO_BUNDLE],[a.ProductPlanType.STANDARD]:[a.ProductPlanType.PROFESSIONAL,a.ProductPlanType.FAMILY_PAYER,a.ProductPlanType.HS_DBX_PRO_BUNDLE],[a.ProductPlanType.TRANSFER]:[a.ProductPlanType.PROFESSIONAL],[a.ProductPlanType.SYNC_EVERYTHING]:[a.ProductPlanType.PLUS,a.ProductPlanType.PROFESSIONAL]},t.addonProductTypeToStorefrontPlatformProductType=e=>{switch(e){case a.ProductAddonType.CAPTURE:return n.CAPTURE;case a.ProductAddonType.EVH:case a.ProductAddonType.EVH_FREE:case a.ProductAddonType.EVH_FREE_THREE_MONTHS:return n.EVH;case a.ProductAddonType.LEGAL_HOLD:return n.LEGAL_HOLD;case a.ProductAddonType.SUPPORT:return n.SUPPORT;case a.ProductAddonType.QUOTA:return n.QUOTA;default:return n.UNKNOWN_PRODUCT_TYPE}},t.personalProductPlanTypeToStorefrontPlatformProductType=e=>{if(!e)return null;switch(e){case a.ProductPlanType.BASIC:case a.ProductPlanType.BASIC_PLUS:return n.INDIVIDUAL_BASIC;case a.ProductPlanType.LEGACY:return n.LEGACY_PLUS;case a.ProductPlanType.STARTER:case a.ProductPlanType.PREMIUM:case a.ProductPlanType.MOBILE:return n.INDIVIDUAL_DEPRECATED;case a.ProductPlanType.PLUS:case a.ProductPlanType.PLUS_TRIAL:case a.ProductPlanType.PLUS_WITH_SS:case a.ProductPlanType.PLUS_WITH_SS_TRIAL:return n.PLUS;case a.ProductPlanType.PROFESSIONAL:case a.ProductPlanType.PROFESSIONAL_TRIAL:return n.PROFESSIONAL;case a.ProductPlanType.FAMILY_PAYER:return n.FAMILY_PAYER;case a.ProductPlanType.FAMILY_NONPAYER:return n.FAMILY_NONPAYER;case a.ProductPlanType.TRANSFER:return n.TRANSFER;case a.ProductPlanType.SYNC_EVERYTHING:return n.BACKUP;case a.ProductPlanType.HS_DBX_PRO_BUNDLE:return n.HS_DBX_PRO_BUNDLE;default:return n.UNKNOWN_PRODUCT_TYPE}}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/strings",["require","exports","react-intl","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/payments/cash","metaserver/static/js/modules/clean/family/constants","metaserver/static/js/modules/clean/account_page/constants","metaserver/static/js/modules/clean/display_format","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/types"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getResubscribeUpsellDescription=t.getResubscribeUpsellPlanDetailsButtonText=t.getResubscribeUpsellResubscribeButtonText=t.getDowngradeSnackbarMessage=t.CANCEL_LINK=t.CANCEL_HEADER=t.CANCEL_DESCRIPTION=t.getPaidPlanScheduledToCancelDescription=t.getPlanFeatureDescription=t.getPaidPlanDefaultDescription=t.getPriceBreakdownByPlan=t.getPaidPlanDefaultBillingSummary=t.getPaidPlanName=t.getLockedTeamPlanName=void 0;var c=d.storefront_platform.StorefrontPlatformContractLengthUnit;t.getLockedTeamPlanName=(e,t)=>{const a=e?s.intl.formatMessage({id:"h2UqcJ",defaultMessage:"(team downgraded)"}):s.intl.formatMessage({id:"LGoRkl",defaultMessage:"(trial ended)"});return s.intl.formatMessage({id:"3onAtc",defaultMessage:"{plan_name} {downgraded_text}"},{plan_name:t,downgraded_text:a})},t.getPaidPlanName=(e,t,a)=>{let i,o;return 1024===e.specQuotaGb||e.productFamily===n.ProductFamily.FAMILY?(i=e.displayName(!1,!1,a),o=s.intl.formatMessage({id:"Trr3KV",defaultMessage:"Dropbox {plan}"},{plan:i})):o=e.displayName(!0),o},t.getPaidPlanDefaultBillingSummary=(e,t)=>{let a="";return(null==t?void 0:t.scheduleDescriptionNoun)&&(null==e?void 0:e.total)&&(a=s.intl.formatMessage({id:"fRlyEz",defaultMessage:"{total} per {period}."},{total:i.Cash.formatWithTaxLabels(e.total,e),period:t.scheduleDescriptionNoun})),a},t.getPriceBreakdownByPlan=(e,t,a)=>{if(!t||!e||!a)return"";const n=e.lineItems.find(e=>e.sku.productType===a.productType);return n?s.intl.formatMessage({id:"Sd6QRw",defaultMessage:"{total} per {period}."},{total:n.price.formatCurrency(),period:t.scheduleDescriptionNoun}):""},t.getPaidPlanDefaultDescription=(e,t,a,n)=>{let i;return i=n?s.intl.formatMessage({id:"pO8IP6",defaultMessage:"Your {plan} plan will renew on {date}. {billing_summary}"},{plan:e,date:a,billing_summary:t}):s.intl.formatMessage({id:"Ofo1Y4",defaultMessage:"This account’s {plan} plan will renew on {date}. {billing_summary}"},{plan:e,date:a,billing_summary:t}),i},t.getPlanFeatureDescription=(e,t)=>{const a=e.content&&e.content.spaceShortFormTb();switch(e.productType){case n.ProductPlanType.STANDARD:case n.ProductPlanType.PLUS:return a?s.intl.formatMessage({id:"gK4PxX",defaultMessage:"Smart Sync, stress-free sharing, offline folders on mobile, and {plan_space} storage."},{plan_space:a}):s.intl.formatMessage({id:"/Jj95M",defaultMessage:"Smart Sync, stress-free sharing, offline folders on mobile."});case n.ProductPlanType.HS_DBX_PRO_BUNDLE:return a&&(null==t?void 0:t.isEsignUpsell)?s.intl.formatMessage({id:"7XEHpu",defaultMessage:"Includes {space} of storage and unlimited e-signatures. Up to 20% off vs. buying each separately."},{space:a}):s.intl.formatMessage({id:"IXOQ0a",defaultMessage:"Includes Dropbox Pro and unlimited e-signatures with HelloSign Essentials."});case n.ProductPlanType.PROFESSIONAL:return a?s.intl.formatMessage({id:"Muci4i",defaultMessage:"Everything in Plus, shared link controls, and {plan_space} storage."},{plan_space:a}):s.intl.formatMessage({id:"wULqRj",defaultMessage:"Everything in Plus, with shared link controls."},{plan_space:a});case n.ProductPlanType.FAMILY_PAYER:return s.intl.formatMessage({id:"9Ru4ky",defaultMessage:"{count, plural, one{Up to {count} member, easy family sharing, and {plan_space} storage.} other{Up to {count} members, easy family sharing, and {plan_space} storage.}}"},{count:o.MAX_LICENSES,plan_space:a});case n.ProductPlanType.TRANSFER:return s.intl.formatMessage({id:"4k1fvl",defaultMessage:"Send transfers up to {transfer_send_size_limit} at a time with password protection and customized experiences."},{transfer_send_size_limit:l.format_bytes(100*r.GIGABYTE_IN_BYTES,2,!0,!0,!1)});case n.ProductPlanType.SYNC_EVERYTHING:return s.intl.formatMessage({id:"ACkjCJ",defaultMessage:"Automatic backup and recovery protection for one device."})}return""},t.getPaidPlanScheduledToCancelDescription=(e,t,a)=>{let n;return n=a?s.intl.formatMessage({id:"DbT6E7",defaultMessage:"Your {plan} will downgrade to Dropbox Basic on {date}."},{plan:e,date:t}):s.intl.formatMessage({id:"KxyGh1",defaultMessage:"This account’s {plan} will downgrade to Dropbox Basic on {date}."},{plan:e,date:t}),n},t.CANCEL_DESCRIPTION=a.defineMessages({default_plan:{id:"XHP8sT",defaultMessage:"If you cancel your plan, your account will drop from {quota} to {basic_space_short_form_gb} of space (plus any bonus space earned previously)."},family_non_payer_no_shared_folder:{id:"kBU+3Q",defaultMessage:"Your account will be downgraded to {dropbox_basic}, and you’ll lose access to {trademark_family} storage and features."},default_all:{id:"KnEPNJ",defaultMessage:"If you cancel your plan, you will lose access to all premium features."},group:{id:"Nb/10N",defaultMessage:"If you leave your plan, you will lose access to all premium features."}}),t.CANCEL_HEADER=a.defineMessages({leave:{id:"UmXVI9",defaultMessage:"Leave plan"},cancel:{id:"QSD+lY",defaultMessage:"Cancel plan"}}),t.CANCEL_LINK=a.defineMessages({leave:{id:"B1q2xt",defaultMessage:"Leave plan"},cancel:{id:"briiwg",defaultMessage:"Cancel plan"}}),t.getDowngradeSnackbarMessage=e=>e?s.intl.formatMessage({id:"K7hrab",defaultMessage:"Done! Your paid plan will end on {endDate}. You won't be charged again."},{endDate:e}):s.intl.formatMessage({id:"tL5Ofr",defaultMessage:"Done! Your paid plan has been cancelled. You won't be charged again."}),t.getResubscribeUpsellResubscribeButtonText=()=>s.intl.formatMessage({id:"vEt76n",defaultMessage:"Resubscribe"}),t.getResubscribeUpsellPlanDetailsButtonText=()=>s.intl.formatMessage({id:"06582P",defaultMessage:"See plan details"}),t.getResubscribeUpsellDescription=(e,t,a,n)=>{const i=s.intl.formatMessage({id:"ZydEtp",defaultMessage:"You cancelled {planName} on {endDate}. Resubscribe for {billingPrice} per month."},{planName:e,endDate:t,billingPrice:a}),o=s.intl.formatMessage({id:"P1UfTK",defaultMessage:"You cancelled {planName} on {endDate}. Resubscribe for {billingPrice} per year."},{planName:e,endDate:t,billingPrice:a});return n===c.MONTH?i:o}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/types",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AccountState=t.ProductAddonType=t.PerformPlanTransition=void 0,(function(e){e[e.MONTHLY=1]="MONTHLY",e[e.YEARLY=2]="YEARLY",e[e.PLUS=3]="PLUS",e[e.PROFESSIONAL=4]="PROFESSIONAL",e[e.ADD_EVH=5]="ADD_EVH",e[e.REMOVE_EVH=6]="REMOVE_EVH",e[e.FAMILY_PAYER=7]="FAMILY_PAYER",e[e.BACKUP=8]="BACKUP",e[e.HS_DBX_PRO_BUNDLE=9]="HS_DBX_PRO_BUNDLE",e[e.TRANSFER=10]="TRANSFER"})(t.PerformPlanTransition||(t.PerformPlanTransition={})),(function(e){e.EVH="EVH",e.QUOTA="QUOTA",e.LEGAL_HOLD="LEGAL_HOLD",e.PREMIUM_SUPPORT="PREMIUM_SUPPORT",e.MEDIA="MEDIA",e.API_RATE="API_RATE"})(t.ProductAddonType||(t.ProductAddonType={})),(function(e){e.DEFAULT="DEFAULT",e.TRIAL="TRIAL",e.REBILL_FAILURE="REBILL_FAILURE",e.SCHEDULED_CANCELLATION="SCHEDULED_CANCELLATION"})(t.AccountState||(t.AccountState={}))})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/add_schedule_modal",["require","exports","tslib","react","classnames","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/account_page/util","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/react/components/css","spectrum/button/index","dig-components/modal","metaserver/static/js/modules/clean/react/components/modal","dig-components/typography","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/payments/checkout/components/inputs/labeled_checkbox_input","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/clean/react/growth/trials/requests","metaserver/static/js/modules/clean/react/growth/logging_util","metaserver/static/js/modules/clean/account_page/widgets/plan/views/npt_billing_schedule_items"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddScheduleModalView=t.REFRESH_DELAY_SECONDS=void 0,s=a.__importDefault(s),n=a.__importDefault(n),u=a.__importStar(u),h=a.__importStar(h),t.REFRESH_DELAY_SECONDS=5;class M extends s.default.Component{constructor(e){super(e),this.closeModals=()=>{this.setState({isOpen:!1})},this.onTermsCheck=()=>{this.setState({displayTermsErrorMsg:!1,termsChecked:!this.state.termsChecked})},this.redirectToBilling=()=>{h.redirect("/account/billing")},this.onAccept=()=>{const{project:e,userId:a,skuCode:s,billingId:n}=this.props,{trialPriceConversions:o,finalBillingScheduleId:r,termsChecked:l}=this.state;if(!l)return void this.setState({displayTermsErrorMsg:!0});const d={trial_sku_code:s,conversion_token:o[r].conversion_token,billing_id:n.toString()};this.setState({submitting:!0}),i.ProEventsLogger.log("add_schedule_modal_accept",{scheduleId:r,advertised_monthly_price:o[r].advertised_monthly_price,advertised_yearly_price:o[r].advertised_yearly_price,currency:o[r].currency,total_amount:o[r].total_amount,project:e}),y.enableAutoConvert(a,e,b.ComponentName.TRIAL_ENABLE_AUTO_CONVERT_MODAL,d,()=>{f.Notify.success(g.intl.formatMessage({id:"RNIIJ0",defaultMessage:"You’ve added your billing period!"}),t.REFRESH_DELAY_SECONDS,this.redirectToBilling)},()=>{f.Notify.error(g.intl.formatMessage({id:"OXfp6E",defaultMessage:"There was an error adding the billing period!"})),this.doneSubmittingRequest(),this.closeModals()})},this.changeProductScheduleType=e=>{this.setState({finalBillingScheduleId:e})},this.getTermsErrorString=()=>{const{displayTermsErrorMsg:e}=this.state,t=g.intl.formatMessage({id:"a2NBnL",defaultMessage:"Please agree to the terms of service."});return e?t:""},this.onDismissModal=()=>{i.ProEventsLogger.log("add_schedule_modal_dismiss",{project:this.props.project}),this.closeModals()},this.state={displayTermsErrorMsg:!1,finalBillingScheduleId:r.ScheduleId.YEARLY,loadingContent:!0,submitting:!1,termsChecked:!1,trialPriceConversions:{},type:"",isOpen:!0}}static showInstance(e){u.Modal.showInstance(s.default.createElement(M.AddScheduleModal,Object.assign({},e)))}componentDidMount(){this.loadPlanTransitions()}loadPlanTransitions(){const{project:e,productType:t,userId:a,skuCode:s,duration:n}=this.props,i={trial_sku_code:s,trial_duration:n,schedule_ids:[r.ScheduleId.MONTHLY,r.ScheduleId.YEARLY]};y.getPriceConversionsForSchedule(a,e,b.ComponentName.TRIAL_ENABLE_AUTO_CONVERT_MODAL,i,e=>{if(e){const a=e.trial_price_conversions;a[r.ScheduleId.MONTHLY]&&a[r.ScheduleId.YEARLY]||(f.Notify.error(g.intl.formatMessage({id:"C2BKnZ",defaultMessage:"Failed to load modal."})),this.closeModals()),this.setState({loadingContent:!1,type:t,trialPriceConversions:a})}},()=>{f.Notify.error(g.intl.formatMessage({id:"C2BKnZ",defaultMessage:"Failed to load modal."})),this.closeModals()})}doneSubmittingRequest(){this.setState(e=>Object.assign(Object.assign({},e),{submitting:!1}))}get scheduleTransitionText(){const{trialPriceConversions:e,finalBillingScheduleId:t}=this.state,a=e[t.toString()],n=t===r.ScheduleId.MONTHLY?"month":"year",i=g.intl.formatMessage({id:"OUUNz7",defaultMessage:"I agree to the Dropbox Terms and the Automatic Renewal Terms above"},{link:(...e)=>s.default.createElement("a",{"aria-label":g.intl.formatMessage({id:"zmINZ0",defaultMessage:"terms"}),className:"terms-info__tos--terms-link",href:"#",key:"link_dbx",onClick:o.logClickAndOpenTab("de_terms_link_click","/terms",{from:"add_schedule_modal"})},e),strong:(...e)=>s.default.createElement("strong",null,e)}),l=s.default.createElement("span",null,i);return s.default.createElement("div",null,s.default.createElement("span",{className:"change-summary"},g.intl.formatMessage({id:"38ZvV3",defaultMessage:"Purchase summary"})),s.default.createElement("p",{className:"plan-transition"},g.intl.formatMessage({id:"Ufvtdi",defaultMessage:"Your trial ends on {date}. If you don’t cancel your free trial by that date, we’ll charge you {scheduled_total} per {schedule} (including applicable taxes) until you cancel your plan. If you have any charges after your trial, they won’t be refunded when you cancel, unless it’s legally required. All amounts shown are in {currency}."},{date:a.formatted_trial_end_date,schedule:n,scheduled_total:a.total_amount,currency:a.currency,strong:e=>s.default.createElement("strong",null,e),cancelLink:e=>s.default.createElement("a",{"aria-label":g.intl.formatMessage({id:"lGpNw6",defaultMessage:"CancelLink"}),href:"#",onClick:o.logClickAndOpenTab("de_cancel_link_click","/help/accounts-billing/cancellations-refunds/cancel-free-trial",{from:"add_schedule_modal"})},e),refundLink:e=>s.default.createElement("a",{"aria-label":g.intl.formatMessage({id:"WSrUNs",defaultMessage:"RefundLink"}),href:"#",onClick:o.logClickAndOpenTab("de_refund_link_click","/terms",{from:"add_schedule_modal"})},e),downgradeLink:e=>s.default.createElement("a",{"aria-label":g.intl.formatMessage({id:"zuLHeg",defaultMessage:"DowngradeLink"}),href:"#",onClick:o.logClickAndOpenTab("de_downgrade_link_click","/help/accounts-billing/cancellations-refunds/downgrade-dropbox-plus-professional-plans",{from:"add_schedule_modal"})},e),legalLink:e=>s.default.createElement("a",{"aria-label":g.intl.formatMessage({id:"enHZxv",defaultMessage:"LegalLink"}),href:"#",onClick:o.logClickAndOpenTab("de_legal_link_click","/help/accounts-billing/payments-billing/refund",{from:"add_schedule_modal"})},e)})),s.default.createElement(_.LabeledCheckboxInput,{checked:this.state.termsChecked,onChange:this.onTermsCheck,labelText:l,name:"terms-checkbox",className:"billing-terms-and-service",errorText:this.getTermsErrorString()}))}get acceptButtonDisabled(){const{loadingContent:e,submitting:t}=this.state;return e||t}render(){const{loadingContent:e,trialPriceConversions:t,finalBillingScheduleId:a,type:i}=this.state;let o;const r=g.intl.formatMessage({id:"nRgwkK",defaultMessage:"Step 2/2: choose your billing period"});o=e?s.default.createElement("div",{className:"loading-indicator"},s.default.createElement("img",{src:p.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:g.intl.formatMessage({id:"jybGUg",defaultMessage:"Loading"})})):s.default.createElement("div",null,s.default.createElement("div",null,s.default.createElement(v.NptBillingScheduleItems,{trialPriceConversions:t,finalBillingScheduleId:a,planName:i,changeProductScheduleType:this.changeProductScheduleType})),s.default.createElement("div",{className:"plan-footer u-font-meta"},this.scheduleTransitionText));const l=n.default("change-plan-modal");return s.default.createElement(c.Modal,{overlayClassName:l,open:this.state.isOpen,isCentered:!0,withCloseButton:g.intl.formatMessage({id:"11bV9n",defaultMessage:"Cancel"}),shouldCloseOnOverlayClick:!1,onRequestClose:this.onDismissModal,onAfterClose:u.Modal.close},s.default.createElement(c.Modal.Header,{hasBottomSpacing:"title-standard"},s.default.createElement(m.Title,{isBold:!1,size:"small"},r)),s.default.createElement(c.Modal.Body,{hasVerticalSpacing:!0},o),s.default.createElement(c.Modal.Footer,{hasTopBorder:!0},s.default.createElement(d.Button,{variant:"secondary",onClick:this.onDismissModal},g.intl.formatMessage({id:"dqvpHx",defaultMessage:"Cancel"})),s.default.createElement(d.Button,{className:"confirm-purchase-button",disabled:this.acceptButtonDisabled,variant:"primary",onClick:this.onAccept},g.intl.formatMessage({id:"/w1aTc",defaultMessage:"Confirm purchase"}))))}}t.AddScheduleModalView=M,M.AddScheduleModal=l.requireCssWithComponent(M,["/static/css/teams/admin/widgets/add_schedule_modal/add_schedule_modal-vflzjyX-t.css"]),M.displayName="AddScheduleModalView"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/addon_info_component",["require","exports","tslib","react","styled-components","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/analytics","dig-components/buttons","dig-components/icons","dig-components/icons/src","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/strings"],(function(e,t,a,s,n,i,o,r,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonInfoComponent=t.AddonDropdown=t.AddonCTA=t.AddonDescription=t.AddonTitle=t.AddonDetailsContainer=t.AddonContainer=void 0,s=a.__importDefault(s),n=a.__importDefault(n),t.AddonContainer=n.default.div` margin-bottom: var(--spacing__unit--3); margin-top: 0px; font-size: var(--type__body__standard--fontsize); display: flex; justify-content: space-between; min-width: 500px; `,t.AddonDetailsContainer=n.default.div` margin-right: 48px; `,t.AddonTitle=n.default.p` margin-bottom: var(--spacing__unit--1); color: var(--color__standard__text); `,t.AddonDescription=n.default.p` margin-bottom: 0; color: var(--color__faint__text); line-height: var(--type__body__standard--lineheight); width: 100%; box-sizing: border-box; `,t.AddonCTA=n.default.div` display: flex; align-items: self-end; `,t.AddonDropdown=n.default.div` display: flex; align-items: center; color: var(--color__standard__text); margin-bottom: 32px; `,t.AddonInfoComponent=e=>{const{addonInfo:a,addonIndex:n,addonButton:u,addonSectionStatus:m,addonsInfoMinimized:p,showButton:g,showPrice:_,defaultAddonsToShow:f,billingSchedule:h,updateMinimizedState:y}=e,b=()=>{y(),o.ProEventsLogger.log("addons_showall",{addon_status:m})},v=i.intl.formatMessage({id:"vAUdR2",defaultMessage:"View all add-ons"}),{name:M,description:S,formatted_total_amount:E,is_license_based:C}=a,P=(_?c.getPaidAddonBillingSummary(E,C,h)+" ":"")+S,A=n===f&&p;let T;return n=f&&!p?T=s.default.createElement(t.AddonContainer,null,s.default.createElement(t.AddonDetailsContainer,null,s.default.createElement(t.AddonTitle,{"data-testid":"plan-status-addon-title"},M),s.default.createElement(t.AddonDescription,{"data-testid":"plan-status-addon-addonDescription"},P)),s.default.createElement(t.AddonCTA,null,g&&u)):A&&(T=s.default.createElement(t.AddonDropdown,null,s.default.createElement(l.UIIcon,{size:"standard",src:d.ChevronDownLine}),s.default.createElement(r.Button,{variant:"transparent",className:"jest-addons-info-dropdown-cta",size:"standard",onClick:b},v))),s.default.createElement("div",{key:n,className:"jest-addons-info-section"},T)},t.AddonInfoComponent.displayName="AddonInfoComponent"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/addon_management_modal",["require","exports","tslib","react","metaserver/static/js/modules/core/browser","dig-components/typography","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_confirmation_modal","metaserver/static/js/modules/clean/account_page/widgets/plan/add_ons/api","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/account_page/widgets/plan/api","metaserver/static/js/modules/clean/teams/admin/widgets/update_billing_modal/update_billing_modal_loader","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_billing_modal_loader","metaserver/static/js/modules/clean/react/payments/error/browser_update_required_modal","metaserver/static/js/modules/clean/account_page/widgets/plan/views/update_billing_info","metaserver/static/js/modules/clean/dbmodal_stack","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_store_creator","metaserver/static/js/modules/clean/payments/three_ds_helper","metaserver/static/js/modules/clean/account_page/widgets/plan/views/individual_inline_payment_method","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/strings","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/constants","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/logging","metaserver/static/js/modules/clean/subscription/tools/amp_logger"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v,M,S,E,C,P){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManagementModal=void 0,s=a.__importDefault(s),n=a.__importStar(n);class A extends s.default.Component{constructor(e){super(e),this.updateThreeDsData=e=>{this.threeDsData=e},this.isPersonalUser=()=>"personal"===this.currentUser.role,this.getLoggingExtra=()=>{const{addonInfo:e}=this.props,t=this.isPersonalUser(),a={addon_family:e.addon_family,addon_name:e.name,is_team:!t};return t||(a.team_addon_id=C.getTeamAddonIdForLogging(e)),a},this.onAccept=()=>{this.setState({submitting:!0});const{addonInfo:e,isAddition:t,onAddonUpdate:a}=this.props,s=this.isPersonalUser()?E.AddonRedirectPath.ACCOUNT_PAGE:E.AddonRedirectPath.BILLING_PAGE,i=t?"addon_purchase_confirm":"addon_remove_confirm";u.ProEventsLogger.log(i,this.getLoggingExtra());const r={offering_id:e.offering_id,is_addition:t,preview_request_token:this.previewResult.preview_request_token,redirect_path:s,browser_info:v.collectBrowserInfo(),three_ds_data:this.threeDsData};l.performAddonTransition(this.currentUser.role,this.currentUser.id,r).then(e=>{if(this.modalLogger.logModalSuccess(),e.change_completed)return a();if(e.redirect_url&&n.redirect(e.redirect_url),e.three_ds_error_data&&this.threeDsMessageHandler){const t=JSON.parse(e.three_ds_error_data);this.threeDsMessageHandler(t)}}).catch(e=>{o.Notify.error(e.message),this.modalLogger.logModalError("modal_submit")}).finally(()=>{this.setState({submitting:!1}),this.updateThreeDsData(""),this.closeModal()})},this.onCancel=()=>{const e=this.props.isAddition?"addon_purchase_cancel":"addon_remove_cancel";u.ProEventsLogger.log(e,this.getLoggingExtra()),this.closeModal()},this.closeModal=()=>{this.setState({open:!1}),d.Modal.close()},this.onCancelSubscriptionLinkClick=()=>{n.open_tab("https://help.dropbox.com/accounts-billing/cancellations-refunds/downgrade-dropbox-plus-professional-plans")},this.onRefundLinkClick=()=>{n.open_tab("https://help.dropbox.com/accounts-billing/payments-billing/refund")},this.updateBillingInfo=e=>{const t=this.isPersonalUser();u.ProEventsLogger.log("addon_update_billing",{is_team:!t}),this.closeModal(),y.DBModalStack.register(b.BILLING_INFO_UPDATED,()=>{p.resetApolloStore(),A.showInstance(this.props)}),this.props.browserUpdateRequired?f.BrowserUpdateModalLoader.showInstance():t?_.IndividualUpdateBillingModalLoader.showInstance():g.UpdateBillingModalLoader.showInstance()},this.currentUser=c.mustGetActiveUser(),this.threeDsData="",this.state={open:!0,loadingContent:!0,submitting:!1},this.modalLogger=P.getSubscriptionAMPLogger({ns:this.isPersonalUser()?"personal":"team",modal:P.ModalTypes.ADDON_MANAGEMENT_MODAL})}static showInstance(e){d.Modal.showInstance(s.default.createElement(A,Object.assign({},e)))}componentDidMount(){const{isAddition:e,addonInfo:t,trigger:a}=this.props,s=Date.now(),n=e?"addon_purchase_view":"addon_remove_view",i=Object.assign(Object.assign({},this.getLoggingExtra()),{refer_parameters:a});u.ProEventsLogger.log(n,i);const r={offering_id:t.offering_id,is_addition:e};l.getAddonTransitionPreview(this.currentUser.role,this.currentUser.id,r).then(e=>{const t=new v.ThreeDsHandler({updateThreeDsData:this.updateThreeDsData,submitThreeDsChallenge:this.onAccept,triggerThreeDsChallenge:()=>{},submitThreeDsFingerprint:this.onAccept,triggerThreeDsFingerprint:()=>{},isDesktop:!1,isSeleniumChangesTest:!1});this.threeDsMessageHandler=t.handle3DsMessage,this.previewResult=e}).catch(e=>{o.Notify.error(e.message),this.modalLogger.logModalError("modal_init"),this.closeModal()}).finally(()=>{this.setState({loadingContent:!1});const e=Date.now()-s;this.modalLogger.logModalTTI(e)})}getPaymentInfo(){const{active_payment_method_type:e,last_digits:t}=this.previewResult;if(!e)return;const a={active_payment_method_type:e[".tag"],last_digits:t||null,can_update_payment_method_via_web_storefront:!0};return s.default.createElement(M.IndividualInlinePaymentMethodView,{accountPaymentInfo:a})}getDescription(){if(this.state.loadingContent)return"";const{isAddition:e,addonInfo:t,totalQuota:a,planQuota:n,billingSchedule:o,formattedAddonAttribute:r}=this.props,{name:l,description:d,addon_family:c}=t,{upcoming_bill_date:u,upcoming_bill_total_price:p,upcoming_bill_addon_price:g,current_bill_addon_price:_,total_includes_taxes:f,last_digits:y}=this.previewResult,b=m.intl.formatMessage({id:"69RiKK",defaultMessage:"{price} (taxes included)"},{price:p}),v=f?b:p,M=e?E.AddonTransitionType.ADD:E.AddonTransitionType.REMOVE,C=S.getAddonDescription(c,M),P=S.getAddonLegalDescription(M,!this.isPersonalUser());return s.default.createElement("div",null,s.default.createElement(i.Text,null,m.intl.formatMessage(C,{addon_name:l,addon_description:d,schedule_noun:null==o?void 0:o.scheduleDescriptionNoun,upcoming_addon_price:g,addon_quota:r,addon_retention:r,total_quota:a,plan_quota:n})),s.default.createElement(i.Text,{size:"small",color:"faint"},m.intl.formatMessage(P,{br:s.default.createElement("br",null),schedule:null==o?void 0:o.scheduleDescriptionAdjective,schedule_noun:null==o?void 0:o.scheduleDescriptionNoun,current_addon_price:_,upcoming_addon_price:g,next_billing_date:u,new_total:v,payment_info:this.getPaymentInfo(),last_digits:y,cancelSubscriptionLink:e=>s.default.createElement(i.Link,{href:"#","aria-label":m.intl.formatMessage({id:"vMob1H",defaultMessage:"Link to cancel subscription help article."}),onClick:this.onCancelSubscriptionLinkClick,hasNoUnderline:!0},e),refundLink:e=>s.default.createElement(i.Link,{href:"#","aria-label":m.intl.formatMessage({id:"U8EUPD",defaultMessage:"Link to refund help article"}),onClick:this.onRefundLinkClick,hasNoUnderline:!0},e),updateBillingInfoLink:s.default.createElement(h.UpdateBillingInfoLink,{updateBillingCTA:this.updateBillingInfo})})))}render(){const{isAddition:e,addonInfo:t}=this.props,{open:a,loadingContent:n,submitting:i}=this.state,o=m.intl.formatMessage(S.getAddonTitle(e),{addon_name:t.name}),l=m.intl.formatMessage({id:"v9SfkL",defaultMessage:"Confirm"}),d=m.intl.formatMessage({id:"uVzYam",defaultMessage:"Cancel"});return s.default.createElement(r.ChangeConfirmationModal,{acceptButtonDisabled:i,acceptButtonText:l,description:this.getDescription(),dismissButtonText:d,loadingContent:n,onAccept:this.onAccept,onDismiss:this.onCancel,open:a,submitting:i,title:o})}}t.AddonManagementModal=A,A.displayName="AddonManagementModal"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/addon_section",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","dig-components/buttons","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/addon_info_component","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/utils","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/constants","metaserver/static/js/modules/clean/account_page/components/key_value_block"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonSection=void 0,s=a.__importStar(s),t.AddonSection=e=>{const[t,a]=s.useState(!0),c=()=>{a(!1)},{addonSectionStatus:u,addonsInfo:m,addonsLoadingState:p,billingSchedule:g,browserUpdateRequired:_,onAddonUpdate:f,isPersonalUser:h}=e;if("ready"!==p||!(null==m?void 0:m.length))return null;if(u===l.AddonSectionStatus.CURRENT){const{formattedSpecQuotaGb:a,totalQuota:d}=e;r.logAddonsView(u,h);const p=n.intl.formatMessage({id:"bnNVIg",defaultMessage:"Remove"}),y=m.map((n,m)=>{const y=s.default.createElement(i.Button,{variant:"transparent",className:"plan-status-section__remove-addon-button",onClick:()=>r.openAddonManagementModal(n,l.AddonManagementModalTrigger.BUTTON,!1,f,h,g,_,a,d)},p),{showPrice:b,showButton:v}=(t=>{const{isPersonalUser:a,eligibleFor1tb:s,onlyShowDescription:n}=e,i=t.is_paid_addon&&!t.scheduled_to_remove;let o,r;return a?(o=i,r=i&&!s):(o=i&&!n,r=i&&!n),{showPrice:o,showButton:r}})(n);return s.default.createElement(o.AddonInfoComponent,{key:`current-addon-${m}`,addonIndex:m,addonInfo:n,addonButton:y,addonSectionStatus:u,billingSchedule:g,addonsInfoMinimized:t,showButton:v,showPrice:b,defaultAddonsToShow:2,updateMinimizedState:c})});return s.default.createElement("div",{className:"account-addons-section"},y)}{const{inGracePeriod:a}=e;r.logAddonsView(u,h);const p=n.intl.formatMessage({id:"ZkhfIA",defaultMessage:"Add"}),y=m.map((e,n)=>{const d=s.default.createElement(i.Button,{variant:"transparent",className:"plan-status-section__add-addon-button","data-offeringid":e.offering_id,onClick:()=>r.openAddonManagementModal(e,l.AddonManagementModalTrigger.BUTTON,!0,f,h,g,_),disabled:a},p);return s.default.createElement(o.AddonInfoComponent,{key:`available-addon-${n}`,addonIndex:n,addonInfo:e,addonButton:d,addonSectionStatus:u,billingSchedule:g,addonsInfoMinimized:t,showButton:!0,showPrice:!0,defaultAddonsToShow:1,updateMinimizedState:c})}),b=n.intl.formatMessage({id:"lfz3xn",defaultMessage:"Available add-ons"});return s.default.createElement("div",{className:"account-plan-section addons-section"},h?s.default.createElement(d.KeyValueBlock,{className:"zero_padding",keyText:b}):s.default.createElement("h1",{className:"f2 addons-section-header"},b),s.default.createElement("div",{className:"account-addons-section"},y))}},t.AddonSection.displayName="AddonSection"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/constants",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AddonTransitionType=t.AddonSectionStatus=t.AddonRedirectPath=t.AddonManagementModalTrigger=void 0,(function(e){e.BUTTON="button",e.QUERY_PARAM="query_param"})(t.AddonManagementModalTrigger||(t.AddonManagementModalTrigger={})),(function(e){e.ACCOUNT_PAGE="/account/plan",e.BILLING_PAGE="/team/admin/billing"})(t.AddonRedirectPath||(t.AddonRedirectPath={})),(function(e){e.CURRENT="current",e.AVAILABLE="available"})(t.AddonSectionStatus||(t.AddonSectionStatus={})),(function(e){e.ADD="Add",e.REMOVE="Remove"})(t.AddonTransitionType||(t.AddonTransitionType={}))})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/logging",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTeamAddonIdForLogging=void 0,t.getTeamAddonIdForLogging=e=>e.addon_attribute?`${e.addon_family}_${e.addon_attribute.attribute_value}`:e.addon_family})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/strings",["require","exports","react-intl","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/account_page/widgets/plan/types","metaserver/static/js/modules/clean/ts_utils","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/constants"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPaidAddonBillingSummary=t.getAddonLegalDescription=t.getAddonDescription=t.getAddonTitle=t.ADDON_STRINGS=void 0,t.ADDON_STRINGS=a.defineMessages({ADD_ADDON_TITLE:{id:"7WmcLH",defaultMessage:"Add {addon_name}"},REMOVE_ADDON_TITLE:{id:"P2d7hJ",defaultMessage:"Remove {addon_name}"},BILLING_SUMMARY:{id:"utV4HI",defaultMessage:"{price} per {period}."},LICENSE_BILLING_SUMMARY:{id:"mNQboU",defaultMessage:"{price} per license per {period}."},EVH_ADD:{id:"frV3Nx",defaultMessage:"You're buying {addon_retention} file recovery and version history for {upcoming_addon_price} per {schedule_noun}, which applies to any file deleted or modified after purchase."},EVH_REMOVE:{id:"EZeHar",defaultMessage:"When you remove Extended Version History, you will lose access to {addon_retention} file recovery and version history."},QUOTA_ADD:{id:"pM2UbV",defaultMessage:"You're buying {addon_quota} of additional storage space for {upcoming_addon_price} per {schedule_noun}."},QUOTA_REMOVE:{id:"rACkS4",defaultMessage:"Your storage space will decrease from {total_quota} to {plan_quota}. If you've used over {plan_quota} of storage space, Dropbox will stop syncing files to your devices."},LEGAL_HOLD_REMOVE:{id:"LDxrjw",defaultMessage:"When you remove Data Governance, you will lose access to compliance and audit support tools."},PREMIUM_SUPPORT_REMOVE:{id:"JXecv3",defaultMessage:"When you remove Premium Support, your team members will lose access to enhanced customer support."},MEDIA_REMOVE:{id:"4MOAh3",defaultMessage:"When you remove Media Creative tools, you will lose access to simplified media support tools."},API_RATE_REMOVE:{id:"6VfUNX",defaultMessage:"When you remove Unlimited API Call Rate, you will lose access to unlimited API calls."},LEGAL_ADD:{id:"S3fgQV",defaultMessage:"{br}{br}When you click confirm, we'll charge you {current_addon_price} now, which is prorated for the current billing period. Starting on {next_billing_date} your {schedule} subscription will increase by {upcoming_addon_price} and your new {schedule} total will be {new_total} until you cancel. If you cancel, previous charges won't be refunded unless it's legally required.{br}{br}{payment_info} {updateBillingInfoLink}."},LEGAL_REMOVE:{id:"I1A5yW",defaultMessage:"{br}{br}By clicking Confirm, your {schedule} subscription will decrease by {upcoming_addon_price} per {schedule_noun} on {next_billing_date}, and your subscription will be {new_total} per {schedule_noun}."},LEGAL_ADD_WITHOUT_UPDATE_BILLING_LINK:{id:"y1cSFW",defaultMessage:"{br}{br}When you click confirm, we'll charge you {current_addon_price} now, which is prorated for the current billing period. Starting on {next_billing_date} your {schedule} subscription will increase by {upcoming_addon_price} and your new {schedule} total will be {new_total} until you cancel. If you cancel, previous charges won't be refunded unless it's legally required.{br}{br}{payment_info}"}}),t.getAddonTitle=e=>e?t.ADDON_STRINGS.ADD_ADDON_TITLE:t.ADDON_STRINGS.REMOVE_ADDON_TITLE,t.getAddonDescription=(e,a)=>{switch(e){case n.ProductAddonType.EVH:return a===o.AddonTransitionType.ADD?t.ADDON_STRINGS.EVH_ADD:t.ADDON_STRINGS.EVH_REMOVE;case n.ProductAddonType.QUOTA:return a===o.AddonTransitionType.ADD?t.ADDON_STRINGS.QUOTA_ADD:t.ADDON_STRINGS.QUOTA_REMOVE;case n.ProductAddonType.LEGAL_HOLD:return t.ADDON_STRINGS.LEGAL_HOLD_REMOVE;case n.ProductAddonType.PREMIUM_SUPPORT:return t.ADDON_STRINGS.PREMIUM_SUPPORT_REMOVE;case n.ProductAddonType.MEDIA:return t.ADDON_STRINGS.MEDIA_REMOVE;case n.ProductAddonType.API_RATE:return t.ADDON_STRINGS.API_RATE_REMOVE;default:return i.enforceExhaustive(e)}},t.getAddonLegalDescription=(e,a=!1)=>e===o.AddonTransitionType.ADD?a?t.ADDON_STRINGS.LEGAL_ADD_WITHOUT_UPDATE_BILLING_LINK:t.ADDON_STRINGS.LEGAL_ADD:t.ADDON_STRINGS.LEGAL_REMOVE,t.getPaidAddonBillingSummary=(e,a,n)=>{let i="";if(null==n?void 0:n.scheduleDescriptionNoun){const o=a?t.ADDON_STRINGS.LICENSE_BILLING_SUMMARY:t.ADDON_STRINGS.BILLING_SUMMARY;i=s.intl.formatMessage(o,{price:e,period:n.scheduleDescriptionNoun})}return i}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/utils",["require","exports","tslib","metaserver/static/js/modules/clean/display_format","metaserver/static/js/modules/clean/account_page/widgets/plan/types","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/addon_management_modal","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/logging"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAvailableAddonsInfoFromQuery=t.clearAvailableAddonsInfoFromQuery=t.formatQuota=t.getAddonAttribute=t.isAddonUpdateIncludedWithLicenseChange=t.addonScheduledForRemoval=t.logAddonsView=t.openAddonManagementModal=void 0,l=a.__importStar(l),t.openAddonManagementModal=(e,a,s,n,r,l,c,u,m)=>{const p={addon_family:e.addon_family,addon_name:e.name,trigger:a,is_team:!r};r||(p.team_addon_id=d.getTeamAddonIdForLogging(e)),s?i.ProEventsLogger.log("addon_add_click",p):i.ProEventsLogger.log("addon_remove_click",p),t.clearAvailableAddonsInfoFromQuery(e);const g=t.getAddonAttribute(e);o.AddonManagementModal.showInstance({addonInfo:e,trigger:a,isAddition:s,billingSchedule:l,onAddonUpdate:n,formattedAddonAttribute:g,browserUpdateRequired:c,planQuota:u,totalQuota:t.formatQuota(m)})},t.logAddonsView=(e,t)=>{const a={addon_status:e,is_team:!t};i.ProEventsLogger.log("addons_view",a)},t.addonScheduledForRemoval=(e,t)=>{for(const a of t)if(e.productType===a.productType)return!1;return!0},t.isAddonUpdateIncludedWithLicenseChange=(e,a)=>{if(a&&e){const s=e.addons.skus,n=a.addons.skus;for(const e of s)if(e.isLicenseBased&&!t.addonScheduledForRemoval(e,n))return!0}return!1},t.getAddonAttribute=e=>{const{addon_attribute:t,addon_family:a}=e;switch(a){case n.ProductAddonType.EVH:if(null==t?void 0:t.vacuuming_policy_max_days)return null==t?void 0:t.vacuuming_policy_max_days;break;case n.ProductAddonType.QUOTA:if(null==t?void 0:t.quota_gb)return s.formatGigabytes(t.quota_gb,2,!0,!0)}return""},t.formatQuota=e=>e?s.format_bytes(e,2,!0,!0,!1):"",t.clearAvailableAddonsInfoFromQuery=e=>{var t;const a=r.URI.parse(l.get_href()),s=a.getQuery();delete s.modal,delete s.addon_family,e.addon_attribute&&delete s[null===(t=e.addon_attribute)||void 0===t?void 0:t.attribute_name],a.setQuery(s);const n=a.toString();window.history.pushState({path:n},"",n)},t.getAvailableAddonsInfoFromQuery=(e,t)=>{const a=r.URI.parse(l.get_href()).getQuery();return e.filter(e=>{var s,n;if(a.addon_family!==e.addon_family)return!1;if(!t){const t=null===(s=e.addon_attribute)||void 0===s?void 0:s.attribute_name,i=null===(n=e.addon_attribute)||void 0===n?void 0:n.attribute_value;return t&&a[t]&&a[t]===i}return!0})}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/basic_plan_status",["require","exports","tslib","react","metaserver/static/js/modules/core/browser","styled-components","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/constants/trademark","dig-components/typography","dig-components/buttons","metaserver/static/js/modules/clean/hql/index","metaserver/static/js/dropbox/proto/hql_events/revenue/revenue","metaserver/static/js/dropbox/proto/hql_events/extensions","metaserver/static/js/dropbox/proto/hql_events/taxonomy"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasicPlanStatusSection=void 0,s=a.__importDefault(s),n=a.__importStar(n),i=a.__importDefault(i);const f=_.hql_events.TaxonomyAppSurface.AppSurface,h=_.hql_events.TaxonomyActionSurface.ActionSurface,y=i.default.div` flex-basis: 140px; text-align: right; display: flex; flex-direction: column; justify-content: center; `,b=i.default.div` width: 36px; margin: 0 var(--spacing__unit--2) auto var(--spacing__base_unit); height: 69px; `,v=i.default.div` display: flex; padding-top: var(--spacing__unit--2); `,M=i.default.div` flex-grow: 1; color: var(--color__faint__text); font-size: var(--type__body__small--fontsize); line-height: var(--type__body__large--lineight); `,S=i.default(c.Title)` font-size: var(--type__body__large--fontsize); margin-bottom: 0; color: var(--color__standard__text); `,E=i.default(u.Button)` .plan-status-section__link--inline { font-style: italic; } `;t.BasicPlanStatusSection=e=>{const{planName:t=d.DROPBOX_BASIC,plansUrl:a="/plans?oqa=acc_general_upgrade",limitedTeam:i,hidePlansLink:c,hideUpgradeButton:C}=e;let{upgradePlanButton:P}=e;const A=()=>{(()=>{const e=g.hql_events.HQLEventIdentity.create({eventClass:g.hql_events.HQLEventIdentity.EventClass.create({className:_.hql_events.TaxonomyClass.ClassName.SEE_AND_CLICK}),legacyEvent:g.hql_events.HQLEventIdentity.LegacyEvent.create({table:"pro_events",name:"de_general_tab_upgrade_to_plus_click"}),actionEventId:g.hql_events.HQLEventIdentity.ActionEventIdentity.create({object:"basic_upgrade_button",action:_.hql_events.TaxonomyAction.Action.SELECT})});m.logEvent(p.hql_events.SelectBasicUpgradeButton.create({hqlMetadata:g.hql_events.HQLMetadata.create({appSurface:f.WEB,actionSurface:h.CENTER_PANE_GENERAL_TAB,identityOverride:e})}))})(),l.ProEventsLogger.log("de_general_tab_upgrade_to_plus_click",{},()=>{n.redirect("/upgrade?oqa=acc_general_upgrade")})};return P||(P=s.default.createElement(y,{className:"plan-status-section__upgrade_btn"},s.default.createElement(u.Button,{variant:"primary",size:"standard",role:"link",onClick:A,className:"jest-upgrade-plan-button"},o.intl.formatMessage({id:"7/M9u2",defaultMessage:"Upgrade"})))),s.default.createElement(s.default.Fragment,null,s.default.createElement("div",{className:"plan-status-section__infohead account-plan-section__title"},o.intl.formatMessage({id:"7Fz7qP",defaultMessage:"Current plan"})),s.default.createElement(v,{className:"plan-status-section has-no-border"},s.default.createElement(b,{className:"plan-status-section__icon"},s.default.createElement("img",{src:r.static_url("/static/images/logo_catalog/dropbox-business-icon_m1-vflczuza3.svg"),alt:o.intl.formatMessage({id:"ORB1Kv",defaultMessage:"See other plans"})})),s.default.createElement(M,{className:"plan-status-section__description"},s.default.createElement(S,{size:"small",isBold:!0,className:"plan-status-section__title"},t),i,!c&&s.default.createElement(E,{size:"small",className:"plan-status-section__link",variant:"transparent",onClick:()=>{n.open_tab(a)},role:"link"},o.intl.formatMessage({id:"ORB1Kv",defaultMessage:"See other plans"}))),!C&&P))}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/billing_period",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/account_page/components/key_value_block","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/current_plan"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingPeriod=void 0,s=a.__importDefault(s);var r=o.storefront_platform.StorefrontPlatformContractLengthUnit;class l extends s.default.Component{render(){const{handleBillingChange:e,isInRebillFailure:t,period:a}=this.props,o=a===r.YEAR?n.intl.formatMessage({id:"qklV/o",defaultMessage:"Plan billed yearly"}):n.intl.formatMessage({id:"tWmQYf",defaultMessage:"Plan billed monthly"});return s.default.createElement(i.KeyValueBlock,{className:"change-billing-period account-plan-section",keyText:n.intl.formatMessage({id:"OrbqQ3",defaultMessage:"Billing Period"}),subtext:o,linkText:n.intl.formatMessage({id:"ZPvZld",defaultMessage:"Change"}),onLinkClick:e,disabled:t})}}t.BillingPeriod=l,l.displayName="BillingPeriod"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancel_changes_modal",["require","exports","tslib","react","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/clean/account_page/widgets/plan/constants","metaserver/static/js/modules/clean/account_page/constants","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/payments/skus/subscription_service","metaserver/static/js/modules/constants/trademark","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/dbmodal_stack","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_confirmation_modal","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/core/exception","metaserver/static/js/modules/clean/account_page/widgets/plan/views/loading_view","metaserver/static/js/modules/clean/subscription/tools/amp_logger","checkout/components/change_plan/utils","metaserver/static/js/modules/clean/storefront_platform/utils","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/types","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/subscription_info"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v,M,S,E,C){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancelChangesModal=void 0,s=a.__importDefault(s),n=a.__importStar(n);var P=E.storefront_platform.StorefrontPlatformContractLengthUnit,A=E.storefront_platform.StorefrontPlatformProductType,T=C.storefront_platform.ScheduledActionType;const w=e=>{switch(e){case o.CancellationType.ADDON:return T.ADDON_REMOVAL;case o.CancellationType.IND_SUBSCRIPTION:return T.PLAN_CANCELLATION;case o.CancellationType.PLAN:return T.PLAN_DOWNGRADE;case o.CancellationType.SCHEDULE:return T.BILLING_SCHEDULE_CHANGE;default:return T.UNKNOWN_SCHEDULED_ACTION}};var I;(function(e){e[e.NeverLoaded=0]="NeverLoaded",e[e.Loading=1]="Loading",e[e.Ready=2]="Ready"})(I||(I={}));const N=m.intl.formatMessage({id:"yhOAKQ",defaultMessage:"There was an issue cancelling your changes, please contact Customer Support."}),L=m.intl.formatMessage({id:"dC654w",defaultMessage:"You’ve cancelled your change!"});class D extends s.default.Component{constructor(e){super(e),this.onAccept=()=>{const{cancellationType:e,addonProductType:t,useStorefrontPlatformEndpoints:a}=this.props;a?this.cancelScheduledChange(e,t):this.cancelScheduledChangeLegacy(e,t)},this.closeModals=()=>{const{onClose:e}=this.props;e&&e(),this.setState({open:!1})},this.loadDowngradeInfo=()=>{this.setState({loading:I.Loading}),(new h.UserApiV2Client).ns("growth").rpc("get_cancel_changes_info",void 0,{subjectUserId:g.mustGetActiveUserId()}).then(e=>{this.setState({loading:I.Ready,downgradeInfo:{subState:e.sub_state,finalSubState:e.final_sub_state}})}).catch(()=>{_.Notify.error(N),y.reportException({err:new Error(`get_cancel_changes_info call failed for user attempting to cancel changes of type: ${this.props.cancellationType}`),severity:y.SEVERITY.CRITICAL}),this.modalLogger.logModalError("modal_init"),this.closeModals()})},new c.SubscriptionService,this.state={loading:I.NeverLoaded,submitting:!1,open:!0},this.modalLogger=v.getSubscriptionAMPLogger({ns:"personal",modal:v.ModalTypes.CANCEL_CHANGES_MODAL})}static showInstance(e){r.Modal.showInstance(s.default.createElement(D,Object.assign({},e)))}previewCancelScheduledChange(){this.setState({loading:I.Loading});const e={subscription_id:this.props.scheduledChangesInfo.subscriptionId,scheduled_action_type:w(this.props.cancellationType)};this.props.cancellationType===o.CancellationType.ADDON&&(e.addon_product_type=S.convertProductTypeToApiv2(this.props.addonProductType));const t=g.mustGetActiveUserId();(new h.UserApiV2Client).ns("plan_configuration").rpc("preview_cancel_scheduled_change",e,{subjectUserId:t}).then(e=>{this.setState({loading:I.Ready,previewPlanId:e.price_quote.storefront_plan_id,previewToken:e.price_quote.preview_token})}).catch(()=>{_.Notify.error(N),y.reportException({err:new Error(`preview_cancel_scheduled_change failed for user ${t} cancelling change of type ${this.props.cancellationType}`),severity:y.SEVERITY.CRITICAL}),this.modalLogger.logModalError("modal_init"),this.closeModals()})}componentDidMount(){this.props.useStorefrontPlatformEndpoints?this.previewCancelScheduledChange():this.loadDowngradeInfo()}submittingRequest(){this.setState(e=>Object.assign(Object.assign({},e),{submitting:!0}))}doneSubmittingRequest(){this.setState(e=>Object.assign(Object.assign({},e),{submitting:!1}))}cancelScheduledChangeLegacy(e,t){const{scheduledChangesInfo:a,transitionPerformed:s,productLine:r}=this.props,{downgradeInfo:c}=this.state;if(!c)return;this.submittingRequest();const u=M.getContractLengthUnitNames(a.currentContractLengthUnit,m.intl),f=M.getContractLengthUnitNames(a.scheduledContractLengthUnit,m.intl);let h;t===A.EVH?h=d.ProductAddonType.EVH:t===A.QUOTA&&(h=d.ProductAddonType.QUOTA),n.WebRequest({url:"/account/ajax_cancel_scheduled_change",data:{scheduled_change_type:e,addon_family_type:h,product_line:r},subject_user:g.mustGetActiveUserId(),success:t=>{_.Notify.success(m.intl.formatMessage({id:"dC654w",defaultMessage:"You’ve cancelled your change!"})),e===o.CancellationType.SCHEDULE&&(l.ProEventsLogger.log("de_change_billing_cancel_change"),l.ProEventsLogger.log("scheduled_billing_change_prompt_click_confirmed",{cta:"cancel_change_confirm",currentBillingSchedule:u.recurringName,nextBillingSchedule:f.recurringName})),e===o.CancellationType.ADDON&&l.ProEventsLogger.log("de_addon_modal_cancel_change"),e===o.CancellationType.PLAN&&l.ProEventsLogger.log("scheduled_plan_change_prompt_click_confirmed",{cta:"cancel_change_confirm"}),this.modalLogger.logModalSuccess(),s&&s(),this.doneSubmittingRequest(),this.closeModals(),this.props.reOpenModalDialogAfterCancellation&&p.DBModalStack.trigger(i.CHANGE_IND_PLAN_MODAL_UPDATED,null)},error:()=>{_.Notify.error(m.intl.formatMessage({id:"iQ7Rjk",defaultMessage:"Failed to cancel changes."})),this.modalLogger.logModalError("modal_submit"),this.doneSubmittingRequest(),this.closeModals(),this.props.reOpenModalDialogAfterCancellation&&p.DBModalStack.trigger(i.CHANGE_IND_PLAN_MODAL_UPDATED,null)}})}cancelScheduledChange(e,t){const{scheduledChangesInfo:a,transitionPerformed:s}=this.props;this.submittingRequest();const n={subscription_id:a.subscriptionId,storefront_plan_id:this.state.previewPlanId,preview_token:this.state.previewToken||"",cancel_scheduled_addon_removals:e===o.CancellationType.IND_SUBSCRIPTION};e===o.CancellationType.ADDON&&(n.cancelled_change_addon_type=S.convertProductTypeToApiv2(t)),(new h.UserApiV2Client).ns("plan_configuration").rpc("cancel_scheduled_change",n,{subjectUserId:g.mustGetActiveUserId()}).then(()=>{if(_.Notify.success(L),e===o.CancellationType.SCHEDULE){const e=M.getContractLengthUnitNames(a.currentContractLengthUnit,m.intl),t=M.getContractLengthUnitNames(a.scheduledContractLengthUnit,m.intl);l.ProEventsLogger.log("de_change_billing_cancel_change"),l.ProEventsLogger.log("scheduled_billing_change_prompt_click_confirmed",{cta:"cancel_change_confirm",currentBillingSchedule:e.recurringName,nextBillingSchedule:t.recurringName})}else e===o.CancellationType.ADDON?l.ProEventsLogger.log("de_addon_modal_cancel_change"):e===o.CancellationType.PLAN&&l.ProEventsLogger.log("scheduled_plan_change_prompt_click_confirmed",{cta:"cancel_change_confirm"});this.modalLogger.logModalSuccess(),s&&s(),this.doneSubmittingRequest(),this.closeModals(),this.props.reOpenModalDialogAfterCancellation&&p.DBModalStack.trigger(i.CHANGE_IND_PLAN_MODAL_UPDATED,null)}).catch(()=>{_.Notify.error(N),this.modalLogger.logModalError("modal_submit"),this.doneSubmittingRequest(),this.closeModals(),this.props.reOpenModalDialogAfterCancellation&&p.DBModalStack.trigger(i.CHANGE_IND_PLAN_MODAL_UPDATED,null)})}render(){const{cancellationType:e,scheduledChangesInfo:t,useStorefrontPlatformEndpoints:a}=this.props,{open:n,submitting:i,downgradeInfo:r,loading:l}=this.state,d=M.getContractLengthUnitNames(t.scheduledContractLengthUnit,m.intl),c=l!==I.Ready||!a&&!r;let p,g=m.intl.formatMessage({id:"G4ktGR",defaultMessage:"Confirm cancelling change"});if(c)p=s.default.createElement(b.LoadingView,{className:"cancel_changes_modal__loading-indicator"}),g="";else switch(e){case o.CancellationType.PLAN:p=t.scheduledContractLengthUnit===P.YEAR?m.intl.formatMessage({id:"1VHHGq",defaultMessage:"You’re cancelling your scheduled plan change. Your Dropbox {plan} plan will renew on {date} and you will be billed yearly."},{trademark_plus:u.TRADEMARK_PLUS,plan:t.currentProductDisplayName,date:t.renewalDate,strong:e=>s.default.createElement("strong",null,e)}):m.intl.formatMessage({id:"hOx+lQ",defaultMessage:"You’re cancelling your scheduled plan change. Your Dropbox {plan} plan will renew on {date} and you will be billed monthly."},{trademark_plus:u.TRADEMARK_PLUS,plan:t.currentProductDisplayName,date:t.renewalDate,strong:e=>s.default.createElement("strong",null,e)});break;case o.CancellationType.SCHEDULE:p=t.currentContractLengthUnit===P.YEAR?m.intl.formatMessage({id:"U+lU7/",defaultMessage:"You’re cancelling your scheduled billing change. Your Dropbox {plan} plan will renew on {date} and you will be billed yearly."},{plan:t.scheduledProductDisplayName,date:t.renewalDate,strong:e=>s.default.createElement("strong",null,e)}):m.intl.formatMessage({id:"AtC6hy",defaultMessage:"You’re cancelling your scheduled billing change. Your Dropbox {plan} plan will renew on {date} and you will be billed monthly."},{plan:t.scheduledProductDisplayName,date:t.renewalDate,strong:e=>s.default.createElement("strong",null,e)});break;case o.CancellationType.ADDON:p=m.intl.formatMessage({id:"30QKkb",defaultMessage:"You’re cancelling your add-on changes. Your Dropbox {plan} plan will renew on {date} and you will be billed {schedule}."},{plan:t.currentProductDisplayName,date:t.renewalDate,schedule:d.recurringName,strong:e=>s.default.createElement("strong",null,e)});break;case o.CancellationType.IND_SUBSCRIPTION:g=m.intl.formatMessage({id:"NCTtwj",defaultMessage:"Confirmation"}),p=m.intl.formatMessage({id:"ikAVu1",defaultMessage:"By confirming, your downgrade to Dropbox Basic will be cancelled."});break;case o.CancellationType.ALL:g=m.intl.formatMessage({id:"NCTtwj",defaultMessage:"Confirmation"}),p=m.intl.formatMessage({id:"AmEj2/",defaultMessage:"By confirming, all existing scheduled changes will be cancelled."});break;default:g=m.intl.formatMessage({id:"NCTtwj",defaultMessage:"Confirmation"}),p=m.intl.formatMessage({id:"kMZoFx",defaultMessage:"By confirming, the scheduled change will be cancelled."})}const _=m.intl.formatMessage({id:"BKISIV",defaultMessage:"Confirm"}),h=m.intl.formatMessage({id:"7VYYNS",defaultMessage:"Don’t cancel"});return s.default.createElement(f.ChangeConfirmationModal,{acceptButtonDisabled:i,acceptButtonText:_,description:p,dismissButtonText:h,loadingContent:c,onAccept:this.onAccept,onDismiss:this.closeModals,open:n,submitting:i,title:g})}}t.CancelChangesModal=D,D.displayName="CancelChangesModal"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal",["require","exports","tslib","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/core/notify","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/account_page/constants","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_confirmation_modal","metaserver/static/js/modules/clean/subscription/tools/amp_logger","metaserver/static/js/api_v2/user_client","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/subscription_info"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancelSubsWarningModal=void 0,s=a.__importStar(s),i=a.__importDefault(i);var g=p.storefront_platform.ScheduledActionType;const _=o.intl.formatMessage({id:"iQ7Rjk",defaultMessage:"Failed to cancel changes."}),f=o.intl.formatMessage({id:"dC654w",defaultMessage:"You’ve cancelled your change!"});class h extends i.default.Component{constructor(e){super(e),this.closeModals=()=>{this.setState({open:!1}),d.Modal.close()},this.state={ready:!1,submitting:!1,open:!0},this.modalLogger=u.getSubscriptionAMPLogger({ns:"personal",modal:u.ModalTypes.CANCEL_SUBS_WARNING_MODAL})}static showInstance(e){d.Modal.showInstance(i.default.createElement(h,Object.assign({},e)))}submittingRequest(){this.setState(e=>Object.assign(Object.assign({},e),{submitting:!0}))}doneSubmittingRequest(){this.setState(e=>Object.assign(Object.assign({},e),{submitting:!1}))}cancelScheduledChangeLegacy(){const{transitionPerformed:e,userIdOverride:t}=this.props,a=t||r.mustGetActiveUserId();this.submittingRequest(),s.WebRequest({url:"/account/ajax_cancel_scheduled_change",data:{scheduled_change_type:l.CancellationType.IND_SUBSCRIPTION},subject_user:a,success:t=>{n.Notify.success(f),e&&e(),this.modalLogger.logModalSuccess(),this.doneSubmittingRequest(),this.closeModals()},error:()=>{n.Notify.error(_),this.modalLogger.logModalError("modal_submit"),this.doneSubmittingRequest(),this.closeModals()}})}previewCancelScheduledChange(){const{subscriptionId:e,userIdOverride:t}=this.props,a=t||r.mustGetActiveUserId(),s={subscription_id:e,scheduled_action_type:g.PLAN_CANCELLATION};(new m.UserApiV2Client).ns("plan_configuration").rpc("preview_cancel_scheduled_change",s,{subjectUserId:a}).then(e=>{this.setState({ready:!0,previewPlanId:e.price_quote.storefront_plan_id,previewToken:e.price_quote.preview_token})}).catch(()=>{n.Notify.error(_),this.modalLogger.logModalError("modal_init"),this.closeModals()})}cancelScheduledChange(){const{subscriptionId:e,transitionPerformed:t,userIdOverride:a}=this.props,s=a||r.mustGetActiveUserId();this.submittingRequest();const i={subscription_id:e,storefront_plan_id:this.state.previewPlanId,preview_token:this.state.previewToken||"",cancel_scheduled_addon_removals:!0};(new m.UserApiV2Client).ns("plan_configuration").rpc("cancel_scheduled_change",i,{subjectUserId:s}).then(()=>{n.Notify.success(f),t&&t(),this.modalLogger.logModalSuccess(),this.doneSubmittingRequest(),this.closeModals()}).catch(()=>{n.Notify.error(_),this.modalLogger.logModalError("modal_submit"),this.doneSubmittingRequest(),this.closeModals()})}handleAccept(){this.props.useStorefrontPlatformEndpoints?this.cancelScheduledChange():this.cancelScheduledChangeLegacy()}componentDidMount(){this.props.useStorefrontPlatformEndpoints?this.previewCancelScheduledChange():this.setState({ready:!0})}render(){const{renewalDate:e}=this.props,{submitting:t,open:a}=this.state,{title:s,getDescription:n,acceptButtonText:r,dismissButtonText:l}={title:o.intl.formatMessage({id:"Au8OeU",defaultMessage:"Plan downgrade scheduled"}),getDescription:e=>o.intl.formatMessage({id:"tQTXOk",defaultMessage:"Your plan is scheduled to be downgraded to Dropbox Basic on {date}. If you want to make any changes, first cancel your scheduled downgrade."},{date:e,strong:e=>i.default.createElement("strong",null,e)}),acceptButtonText:o.intl.formatMessage({id:"vhlPqJ",defaultMessage:"Cancel downgrade"}),dismissButtonText:o.intl.formatMessage({id:"DYOfu0",defaultMessage:"Dismiss"})};return i.default.createElement(c.ChangeConfirmationModal,{acceptButtonDisabled:t,acceptButtonText:r,description:n(e),dismissButtonText:l,loadingContent:!this.state.ready,onAccept:()=>this.handleAccept(),onDismiss:this.closeModals,open:a,submitting:t,title:s})}}t.CancelSubsWarningModal=h,h.displayName="CancelSubsWarningModal"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancellable_notifications_view",["require","exports","tslib","react","classnames","styled-components","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/account_page/widgets/billing/payment_methods_util","metaserver/static/js/modules/clean/teams/admin/widgets/billing_notifications/cancellable_item","metaserver/static/js/modules/clean/account_page/constants","metaserver/static/js/modules/constants/trademark","metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancel_changes_modal","metaserver/static/js/modules/clean/analytics","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/ts_utils","checkout/components/change_plan/utils","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/types"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellableNotificationsView=t.CancellableNotificationsViewControl=void 0,s=a.__importDefault(s),n=a.__importDefault(n),i=a.__importDefault(i);var b=y.storefront_platform.StorefrontPlatformContractLengthUnit,v=y.storefront_platform.StorefrontPlatformProductType;const M=i.default.div` border-bottom: 1px solid var(--color__faint__background); `;class S extends s.default.Component{constructor(){super(...arguments),this.state={},this.getFamilyPayerScheduledChange=e=>{(new g.UserApiV2Client).ns("growth_plans").rpc("get_scheduled_change_family_manager",void 0,{subjectUserId:_.mustGetActiveUserId()}).then(t=>{this.setState({payerHasScheduledDowngrade:t.has_scheduled_plan_change,payerScheduledChangeDate:t.scheduled_change_date},e)})},this.handleCancelSubscriptionAction=()=>{this.handleCancelActions(c.CancellationType.IND_SUBSCRIPTION)},this.handleCancelPlanAction=()=>{this.shouldLogScheduledProToPlusChange()&&p.ProEventsLogger.log("scheduled_plan_change_prompt_click",{cta:"cancel_change"}),this.handleCancelActions(c.CancellationType.PLAN)},this.handleCancelScheduleAction=()=>{const{scheduledChangesInfo:e}=this.props;this.shouldLogScheduledBillingChange()&&p.ProEventsLogger.log("scheduled_billing_change_prompt_click",{cta:"cancel_change",currentBillingSchedule:e.currentContractLengthUnit===b.MONTH?"monthly":"yearly",nextBillingSchedule:e.scheduledContractLengthUnit===b.MONTH?"monthly":"yearly"}),this.handleCancelActions(c.CancellationType.SCHEDULE)},this.handleCancelAddonAction=e=>{this.handleCancelActions(c.CancellationType.ADDON,e)},this.handleCancelActions=(e,t)=>{const{scheduledChangesInfo:a,transitionPerformed:s,useStorefrontPlatformEndpoints:n}=this.props;m.CancelChangesModal.showInstance({transitionPerformed:s,cancellationType:e,useStorefrontPlatformEndpoints:n,addonProductType:t,scheduledChangesInfo:a,reOpenModalDialogAfterCancellation:!1})}}componentDidMount(){const{scheduledChangesInfo:e,scheduledForDowngrade:t}=this.props;e.currentProductType===v.FAMILY_NONPAYER&&this.getFamilyPayerScheduledChange(()=>{this.shouldLogScheduledFamilyMemberDowngradePrompt()&&p.ProEventsLogger.log("scheduled_family_member_downgrade_prompt_view")}),this.shouldLogScheduledProToPlusChange()&&p.ProEventsLogger.log("scheduled_plan_change_prompt_view"),this.shouldLogScheduledBillingChange()&&p.ProEventsLogger.log("scheduled_billing_change_prompt_view",{currentBillingSchedule:e.currentContractLengthUnit===b.MONTH?"monthly":"yearly",nextBillingSchedule:e.scheduledContractLengthUnit===b.MONTH?"monthly":"yearly"}),t&&p.ProEventsLogger.log("cancel_banner_view")}shouldDisplayFamilyPayersScheduledChange(){return this.props.scheduledChangesInfo.currentProductType===v.FAMILY_NONPAYER&&!0===this.state.payerHasScheduledDowngrade&&void 0!==this.state.payerScheduledChangeDate}renderCancelSubscriptionNotification(){const{scheduledChangesInfo:e,scheduledForDowngrade:t}=this.props;if(t)return s.default.createElement(d.CancellableItemView,{title:r.intl.formatMessage({id:"97TpvL",defaultMessage:"Cancellation scheduled for {date}."},{date:e.renewalDate,b:e=>s.default.createElement("b",null,e)}),handleAction:this.handleCancelSubscriptionAction,useCTA:!0,useAlternateStyle:!0})}shouldRenderDowngradePlanNotif(){const{scheduledChangesInfo:e,scheduledForDowngrade:t}=this.props;return!t&&e.currentProductType!==e.scheduledProductType}shouldRenderBillingChangeNotif(){const{scheduledChangesInfo:e,scheduledForDowngrade:t}=this.props;return!t&&e.scheduledContractLengthUnit!==b.UNKNOWN_CONTRACT_LENGTH_UNIT&&e.currentContractLengthUnit!==e.scheduledContractLengthUnit}shouldLogScheduledProToPlusChange(){const{scheduledChangesInfo:e}=this.props;return!!this.shouldRenderDowngradePlanNotif()&&(e.currentProductType===v.PROFESSIONAL&&e.scheduledProductType===v.PLUS)}shouldLogScheduledBillingChange(){return this.shouldRenderBillingChangeNotif()}shouldLogScheduledFamilyMemberDowngradePrompt(){return this.shouldDisplayFamilyPayersScheduledChange()}renderDowngradePlanNotification(){const{scheduledChangesInfo:e}=this.props;if(this.shouldRenderDowngradePlanNotif()){const t=r.intl.formatMessage({id:"McVRyL",defaultMessage:"Dropbox {scheduled_plan}"},{scheduled_plan:e.scheduledProductDisplayName});return s.default.createElement(d.CancellableItemView,{title:r.intl.formatMessage({id:"4c06XP",defaultMessage:"Scheduled plan change"}),description:t,handleAction:this.handleCancelPlanAction,useCTA:!0,className:"cancel-plan-schedule"})}}renderFamilyMemberScheduledChange(){if(this.shouldDisplayFamilyPayersScheduledChange())return s.default.createElement(d.CancellableItemView,{title:r.intl.formatMessage({id:"27UqZZ",defaultMessage:"Your plan will change from {dropbox_family} to {dropbox_basic}"},{dropbox_family:u.DROPBOX_FAMILY,dropbox_basic:u.DROPBOX_BASIC}),className:"cancel-plan-schedule"})}renderScheduledChange(){const{scheduledChangesInfo:e}=this.props;if(this.shouldRenderBillingChangeNotif()){const t=h.getContractLengthUnitNames(e.scheduledContractLengthUnit,r.intl).recurringName;return s.default.createElement(d.CancellableItemView,{title:r.intl.formatMessage({id:"pSiFZ2",defaultMessage:"Scheduled billing period"}),description:r.intl.formatMessage({id:"HCfuYu",defaultMessage:"{billing} billing"},{billing:t.charAt(0).toUpperCase()+t.slice(1)}),handleAction:this.handleCancelScheduleAction,useCTA:!0,className:"cancel-billing-schedule"})}}getAddonCancellationNotificationText(e){switch(e){case v.EVH:return r.intl.formatMessage({id:"ruwa4d",defaultMessage:"Remove extended version history"});case v.QUOTA:return r.intl.formatMessage({id:"OgTPbs",defaultMessage:"Remove storage space"});default:return}}renderAddonChange(){const{scheduledChangesInfo:e,scheduledForDowngrade:t}=this.props;if(!t&&e.addonsScheduledForRemoval)return e.addonsScheduledForRemoval.map((e,t)=>s.default.createElement(d.CancellableItemView,{key:t,title:r.intl.formatMessage({id:"3YA4ZU",defaultMessage:"Scheduled add-on change"}),description:this.getAddonCancellationNotificationText(e),handleAction:()=>{this.handleCancelAddonAction(e)},useCTA:!0,className:"cancel-addon-removal"}))}appendAllCancellationTypes(e){e.push(this.renderCancelSubscriptionNotification()),e.push(this.renderDowngradePlanNotification()),e.push(this.renderScheduledChange()),e.push(this.renderAddonChange())}render(){const{displaySingleChangeCancellationItem:e,paymentInfo:t,scheduledChangesInfo:a}=this.props;if(!t||l.shouldHideBillingChange(t.gateway_id,t.is_reseller_billing))return s.default.createElement("noscript",null);if(null===a.currentProductType)return s.default.createElement("noscript",null);let i=[];if(e)switch(e){case c.CancellationType.IND_SUBSCRIPTION:i.push(this.renderCancelSubscriptionNotification());break;case c.CancellationType.PLAN:i.push(this.renderDowngradePlanNotification());break;case c.CancellationType.SCHEDULE:i.push(this.renderScheduledChange());break;case c.CancellationType.ADDON:i.push(this.renderAddonChange());break;case c.CancellationType.FAMILY_NONPAYER:i.push(this.renderFamilyMemberScheduledChange());break;case c.CancellationType.ALL:this.appendAllCancellationTypes(i);break;case c.CancellationType.LICENSES:break;default:f.enforceExhaustive(e)}if(i=i.filter(e=>void 0!==e),!i.length)return s.default.createElement("noscript",null);const o=n.default("cancellable-scheduled-notifications cancellable-scheduled-notifications__items","cancellable-scheduled-notifications__items--alternate");return s.default.createElement(M,{className:"cancellable-scheduled-notifications personal-cancellable-scheduled-notifications"},s.default.createElement("div",{className:o},i))}}t.CancellableNotificationsViewControl=S,S.displayName="CancellableNotificationsViewControl",t.CancellableNotificationsView=o.requireCssWithComponent(S,["/static/css/teams/admin/widgets/billing_notifications/cancellable_scheduled_notifications-vflBpufaG.css"])})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_confirmation_modal",["require","exports","tslib","react","styled-components","spectrum/modal/index","dig-components/buttons","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/static_urls","dig-components/typography"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeConfirmationModal=void 0,s=a.__importDefault(s);const c=(n=a.__importDefault(n)).default(i.Modal)` color: var(--color__standard__text); display: flex; flex-direction: column; font-size: var(--type__body__standard--fontsize); border-radius: 0; `,u=n.default.div` font-family: var(--type__body__standard--fontfamily); padding: var(--spacing__unit--3); `,m=n.default(d.Title)` font-family: var(--type__title__small--fontfamily); font-size: var(--type__title__small--fontsize); font-weight: var(--type__title__small--fontweight_strong); margin-bottom: var(--spacing__unit--3); `,p=n.default.div` display: flex; justify-content: space-between; align-items: center; height: 65px; padding-left: var(--spacing__unit--3); padding-right: var(--spacing__unit--3); .change-confirmation-modal__btn-submit { margin-left: var(--spacing__base_unit); } `,g=n.default.div` white-space: nowrap; `,_=n.default.div` display: flex; justify-content: center; padding: 100px; `;class f extends s.default.Component{constructor(){super(...arguments),this.handleAccept=()=>{this.props.onAccept()},this.handleDismiss=()=>{this.props.onDismiss()}}render(){const{acceptButtonDisabled:e,acceptButtonText:t,description:a,dismissButtonText:n,loadingContent:i,open:f,link:h,title:y,submitting:b}=this.props;let v;return v=i?s.default.createElement(_,{className:"change-confirmation-modal__loading-indicator"},s.default.createElement("img",{src:l.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:r.intl.formatMessage({id:"60HSB/",defaultMessage:"Loading"})})):s.default.createElement("div",{className:"change-confirmation-modal","data-testid":"change-confirmation-modal"},s.default.createElement(u,null,s.default.createElement(m,{className:"change-confirmation-modal__title"},y),s.default.createElement(d.Text,{className:"change-confirmation-modal__description"},a)),s.default.createElement(p,null,s.default.createElement(g,null,h),s.default.createElement("div",null,s.default.createElement(o.Button,{className:"change-confirmation-modal__btn-cancel",variant:"opacity",disabled:b,onClick:this.handleDismiss},n),s.default.createElement(o.Button,{className:"change-confirmation-modal__btn-submit",variant:"primary",disabled:e,onClick:this.handleAccept,"data-testid":"change-confirmation-modal-submit-button"},t)))),s.default.createElement(c,{appElement:document.getElementById("embedded-app")||document.body,ariaLabel:r.intl.formatMessage({id:"qgM6UX",defaultMessage:"Change Confirmation Modal"}),className:"ChangeConfirmationModal",displayCloseButton:!n,onRequestClose:this.handleDismiss,open:f,overlayClickClose:!1,width:560},v)}}t.ChangeConfirmationModal=f,f.displayName="ChangeConfirmationModal"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/confirm_age_modal",["require","exports","tslib","classnames","react","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/core/exception","metaserver/static/js/modules/core/i18n","dig-components/modal","dig-components/typography","dig-components/text_fields","dig-components/form_row","dig-components/buttons","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/metrics/index","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/clean/react/components/modal"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfirmAgeModalView=t.reportMetric=void 0,s=a.__importDefault(s),n=a.__importDefault(n),y=a.__importStar(y),b=a.__importStar(b),t.reportMetric=(e,t)=>{_.getMetricsReporter().createStats({ns:"personal_plan_management",name:e},Object.assign({},t)).record(1)};class v extends n.default.Component{constructor(e){super(e),this.onChange=(e,t)=>{const{target:a}=e,{value:s}=a,n=parseInt(s,10);s&&isNaN(n)||this.setState(e=>Object.assign(Object.assign({},e),{[t]:s,isValid:!0}))},this.onBlur=(e,t)=>{const{target:a}=e,{value:s}=a;if(!s)return;const n=parseInt(s,10);this.setState(e=>Object.assign(Object.assign({},e),{[t]:n.toString().padStart(2,"0")}))},this.onModalCloses=(e,t)=>{t||this.logEvent("age_gate_close"),this.setState(e=>Object.assign(Object.assign({},e),{open:!1}))},this.onAccept=()=>a.__awaiter(this,void 0,void 0,(function*(){const{day:e,month:a,year:s}=this.state,n=new Date(`${a}/${e}/${s}`),l=new Date;if(2!==e.length||2!==a.length||4!==s.length||isNaN(n.getTime())||n>l)return void this.setState(e=>Object.assign(Object.assign({},e),{isValid:!1}));if(n.getMonth()+1!==parseInt(a,10))return void this.setState(e=>Object.assign(Object.assign({},e),{isValid:!1}));const d={success:"true"};let c;try{this.setState(e=>Object.assign(Object.assign({},e),{confirmDisabled:!0})),c=yield this.setBirthdate(n),this.logEvent("age_gate_submit")}catch(e){return i.Notify.error(r.intl.formatMessage({id:"sFDDem",defaultMessage:"There was an error setting your date of birth. Please try again."})),o.reportException({err:new Error("Error setting user date of birth"),severity:o.SEVERITY.NONCRITICAL,tags:["owner:subscription-mgmt","set_birthdate"]}),void(d.success="false")}finally{t.reportMetric("set_birthdate",d),this.setState(e=>Object.assign(Object.assign({},e),{confirmDisabled:!1}))}if("will_be_disabled"===(null==c?void 0:c[".tag"]))return y.redirect("/age_gating/block");const{onAccept:u,onErrorHandler:m,loggingExtra:p}=this.props;u(m,p),this.onModalCloses(void 0,!0)})),this.setBirthdate=e=>a.__awaiter(this,void 0,void 0,(function*(){const t=e.getTime()/1e3;return(new p.UserApiV2Client).ns("age_gating").rpc("set_birthdate",{birthdate_ts:t},{subjectUserId:f.mustGetActiveUserId()}).then(e=>e.gating_status)})),this.logEvent=e=>{const{currentPlan:t}=this.props;g.ProEventsLogger.log(e,{current_plan:t})},this.state={open:!0,day:"",month:"",year:"",isValid:!0,confirmDisabled:!1},this.logEvent("age_gate_view")}static showInstance(e){l.Modal.setAppElement(document.getElementById("embedded-app")||document.body),b.Modal.showInstance(n.default.createElement(t.ConfirmAgeModalView,Object.assign({},e)))}render(){const{open:e,day:t,month:a,year:i,isValid:o,confirmDisabled:p}=this.state,g=r.intl.formatMessage({id:"QIV/Tj",defaultMessage:"Confirm your date of birth"}),_=r.intl.formatMessage({id:"CyX8FV",defaultMessage:"To use Dropbox Family, we need your date of birth."}),f=r.intl.formatMessage({id:"jsBun9",defaultMessage:"Day"}),h=r.intl.formatMessage({id:"5ymFrB",defaultMessage:"Month"}),y=r.intl.formatMessage({id:"brSw8D",defaultMessage:"Year"}),b=r.intl.formatMessage({id:"QQiv4/",defaultMessage:"Confirm"}),v=r.intl.formatMessage({id:"ztOd9D",defaultMessage:"Please enter a valid date of birth."}),M=r.intl.formatMessage({id:"Pxv2Bf",defaultMessage:"Close"}),S=s.default("confirm-age-modal");return n.default.createElement(l.Modal,{open:e,isCentered:!0,withCloseButton:M,shouldCloseOnOverlayClick:!1,overlayClassName:S,onRequestClose:this.onModalCloses},n.default.createElement(l.Modal.Header,{hasBottomSpacing:"title-standard"},n.default.createElement(d.Title,null,g)),n.default.createElement(l.Modal.Body,null,n.default.createElement(d.Text,{size:"large"},_),n.default.createElement("div",{className:"age-container"},n.default.createElement(u.FormRow,null,n.default.createElement(u.FormLabel,{htmlFor:"confirm-age-day"},f),n.default.createElement(c.TextInput,{placeholder:"DD","aria-label":f,id:"confirm-age-day",maxLength:2,onChange:e=>this.onChange(e,"day"),onBlur:e=>this.onBlur(e,"day"),value:t,isInvalid:!o})),n.default.createElement(u.FormRow,null,n.default.createElement(u.FormLabel,{htmlFor:"confirm-age-month"},h),n.default.createElement(c.TextInput,{placeholder:"MM","aria-label":h,id:"confirm-age-month",maxLength:2,onChange:e=>this.onChange(e,"month"),onBlur:e=>this.onBlur(e,"month"),value:a,isInvalid:!o})),n.default.createElement(u.FormRow,null,n.default.createElement(u.FormLabel,{htmlFor:"confirm-age-year"},y),n.default.createElement(c.TextInput,{placeholder:"YYYY","aria-label":y,id:"confirm-age-year",maxLength:4,onChange:e=>this.onChange(e,"year"),value:i,isInvalid:!o}))),!o&&n.default.createElement(d.Text,{color:"error"},v)),n.default.createElement(l.Modal.Footer,null,n.default.createElement(m.Button,{className:"confirm-age-button",variant:"primary",size:"large",onClick:this.onAccept,disabled:p},b)))}}v.displayName="ConfirmAgeModal",t.ConfirmAgeModalView=h.requireCssWithComponent(v,["/static/css/teams/admin/widgets/confirm_age_modal/confirm_age_modal-vflSKFVWn.css"])})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/confirm_cancel_modal",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_confirmation_modal","metaserver/static/js/modules/clean/subscription/tools/amp_logger"],(function(e,t,a,s,n,i,o,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfirmCancelModal=void 0,s=a.__importDefault(s);class d extends s.default.Component{constructor(e){super(e),this.closeModals=()=>{o.Modal.close()},this.onAccept=()=>{this.closeModals(),this.modalLogger.logModalSuccess(),this.props.onAccept()},this.state={modalContent:void 0},this.modalLogger=l.getSubscriptionAMPLogger({ns:"personal",modal:l.ModalTypes.CANCEL_SUBS_WARNING_MODAL})}static showInstance(e){o.Modal.showInstance(s.default.createElement(d,Object.assign({},e)))}componentDidMount(){const e=(function(e){if(e===i.ProductPlanType.SYNC_EVERYTHING)return{title:n.intl.formatMessage({id:"yOnuCE",defaultMessage:"All set."}),getDescription:e=>n.intl.formatMessage({id:"muP0dn",defaultMessage:"You’ll have access to your plan until {date}. After that, your backup will remain available but it’ll be limited to the 2 GB storage quota of the Dropbox Basic plan. If you exceed your quota, automatic backups will stop."},{date:e,strong:e=>s.default.createElement("strong",null,e)}),acceptButtonText:n.intl.formatMessage({id:"bGzf4A",defaultMessage:"I changed my mind, keep Backup"}),dismissButtonText:n.intl.formatMessage({id:"eyC1rP",defaultMessage:"Close"})};if(e===i.ProductPlanType.HS_DBX_PRO_BUNDLE)return{title:n.intl.formatMessage({id:"RQS9wP",defaultMessage:"Are you sure you want to cancel?"}),getDescription:(e,{dropboxDisplayName:t,spaceShortFormTb:a})=>n.intl.formatMessage({id:"w/CLLG",defaultMessage:"If you cancel today, you’ll be moved to a free plan on {date}, and you’ll lose access to {current_plan} features including:{br}"},{br:s.default.createElement("br",null),current_plan:t,date:e,li:e=>s.default.createElement("li",{style:{marginBottom:"var(--spacing__unit--1)"}},e),strong:e=>s.default.createElement("strong",null,e),space_quota:a,ul:e=>s.default.createElement("ul",{style:{paddingLeft:0,listStylePosition:"inside"}},e)}),acceptButtonText:n.intl.formatMessage({id:"1wtgq1",defaultMessage:"Confirm cancel"}),dismissButtonText:n.intl.formatMessage({id:"ZyFp/R",defaultMessage:"Don’t cancel"})};return})(this.props.planType);e?this.setState({modalContent:e}):this.closeModals()}render(){const{subStatus:e}=this.props,{modalContent:t}=this.state;if(!e||!t)return s.default.createElement("noscript",null);const{title:a,getDescription:n,acceptButtonText:i,dismissButtonText:o}=t,l=e.subState.formattedNextBillingDate,d=(function(e){var t,a,s,n;const i=(null===(a=null===(t=e.subState.plan)||void 0===t?void 0:t.content)||void 0===a?void 0:a.dropboxDisplayName())||"",o=(null===(n=null===(s=e.subState.plan)||void 0===s?void 0:s.content)||void 0===n?void 0:n.spaceShortFormTb())||"";return{dropboxDisplayName:i,spaceShortFormTb:o}})(e);return s.default.createElement(r.ChangeConfirmationModal,{acceptButtonDisabled:!1,acceptButtonText:i,description:n(l,d),dismissButtonText:o,loadingContent:!1,onAccept:this.onAccept,onDismiss:this.closeModals,open:!0,submitting:!1,title:a})}}t.ConfirmCancelModal=d,d.displayName="ConfirmCancelModal"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_schedule_modal",["require","exports","tslib","metaserver/static/js/modules/core/browser","react","dig-components/typography","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/subscription/tools/amp_logger","metaserver/static/js/modules/clean/account_page/widgets/plan/constants","metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancel_changes_modal","metaserver/static/js/modules/clean/account_page/widgets/plan/types","metaserver/static/js/modules/clean/payments/billing_instrument/payment_method_constants","metaserver/static/js/modules/clean/account_page/widgets/plan/views/individual_inline_payment_method","metaserver/static/js/modules/clean/account_page/widgets/plan/views/update_billing_info","metaserver/static/js/modules/clean/account_page/util","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/account_page/widgets/plan/views/change_confirmation_modal","metaserver/static/js/modules/clean/dbmodal_stack","metaserver/static/js/modules/clean/payments/cash","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/payments/skus/subscription_change_plan","metaserver/static/js/modules/clean/payments/skus/subscription_status","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/react/payments/error/browser_update_required_modal","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_billing_modal_loader","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_store_creator","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/account_page/constants","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/hql/index","metaserver/static/js/dropbox/proto/hql_events/revenue/revenue","metaserver/static/js/dropbox/proto/hql_events/extensions","metaserver/static/js/dropbox/proto/hql_events/taxonomy","metaserver/static/js/modules/clean/account_page/widgets/plan/api"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v,M,S,E,C,P,A,T,w,I,N,L,D,x,j){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChangeScheduleModalView=void 0,s=a.__importStar(s),n=a.__importDefault(n);const k=x.hql_events.TaxonomyAppSurface.AppSurface,B=x.hql_events.TaxonomyActionSurface.ActionSurface;class O extends n.default.Component{constructor(e){super(e),this._timeModalOpened=null,this.closeModals=()=>{this.setState({open:!1})},this.onAccept=()=>{const e=this.getSubChangePlan();let t,a;e&&(e.finalSubState.billingSchedule.id===v.ScheduleId.MONTHLY&&(a=u.PerformPlanTransition.YEARLY,t=u.PerformPlanTransition.MONTHLY),e.finalSubState.billingSchedule.id===v.ScheduleId.YEARLY&&(a=u.PerformPlanTransition.MONTHLY,t=u.PerformPlanTransition.YEARLY),t&&a?(this.setState(e=>(e.submitting=!0,e)),o.WebRequest({url:"/account/perform_personal_transition",data:{transition_change_type:t},subject_user:f.mustGetActiveUserId(),success:e=>{const t=JSON.parse(e);if(t.redirect)return s.redirect(t.redirect);I.Notify.success(T.intl.formatMessage({id:"dVc1qR",defaultMessage:"You’ve changed your billing period!"})),this.logChangeSchedule(),this.modalLogger.logModalSuccess(),this.props.transitionPerformed&&this.props.transitionPerformed(),this.closeModals()},error:()=>{I.Notify.error(T.intl.formatMessage({id:"wiPRXu",defaultMessage:"There was an error changing the billing period!"})),this.modalLogger.logModalError("modal_submit"),this.setState(e=>(e.submitting=!1,e))}})):I.Notify.error(T.intl.formatMessage({id:"wiPRXu",defaultMessage:"There was an error changing the billing period!"})))},this.updateBillingInfo=e=>{r.ProEventsLogger.log("de_update_billing_info_click"),this.closeModals(),y.DBModalStack.register(A.BILLING_INFO_UPDATED,()=>{j.resetApolloStore(),O.showInstance(this.props)}),this.props.browserUpdateRequired?C.BrowserUpdateModalLoader.showInstance():P.IndividualUpdateBillingModalLoader.showInstance()},this.handleCancelScheduleAction=()=>(this.handleCancelActions(w.CancellationType.SCHEDULE),!1),this.handleCancelActions=e=>{const{scheduledChangesInfo:t,transitionPerformed:a}=this.props;return c.CancelChangesModal.showInstance({transitionPerformed:a,cancellationType:e,reOpenModalDialogAfterCancellation:!1,scheduledChangesInfo:t}),!1},this.transitionPerformedClosure=e=>{if(this.props.transitionPerformed)return this.props.transitionPerformed()},this.onDismissModal=()=>{r.ProEventsLogger.log("de_cancel_billing_change_modal"),this.setState({open:!1})},this.state={loadingContent:!0,subChangePlans:[],submitting:!1,hasLicenseKey:!1,open:!0},this.modalLogger=l.getSubscriptionAMPLogger({ns:"personal",modal:l.ModalTypes.CHANGE_SCHEDULE_MODAL})}get isProfessionalTrialPlan(){const{subStatus:e}=this.state;return!(!e||!e.subState.plan)&&e.subState.plan.productType===v.ProductPlanType.PROFESSIONAL_TRIAL}get isPlusTrialPlan(){var e;const{subStatus:t}=this.state;return(null===(e=null==t?void 0:t.subState.plan)||void 0===e?void 0:e.productType)===v.ProductPlanType.PLUS_TRIAL}get productTypeStr(){var e,t,a;return null===(a=null===(t=null===(e=this.state.subStatus)||void 0===e?void 0:e.subState)||void 0===t?void 0:t.plan)||void 0===a?void 0:a.productType.toString()}static showInstance(e){E.Modal.showInstance(n.default.createElement(O,Object.assign({},e)))}componentDidMount(){this._timeModalOpened=Date.now(),this.logChangeScheduleModalOpen(),this.loadPlanTransitions()}logTTI(){if(this._timeModalOpened){const e=Date.now()-this._timeModalOpened;this.modalLogger.setProductPlanType(this.productTypeStr),this.modalLogger.logModalTTI(e)}}loadPlanTransitions(){o.WebRequest({url:"/account/ajax_change_plan_schedule",subject_user:f.mustGetActiveUserId(),success:e=>{const t=JSON.parse(e);this.setState(e=>{var a;const s=Object.assign({},e);s.loadingContent=!1,s.subStatus=S.SubscriptionStatus.deserialize(t.serializedSubStatus),s.paymentMethod=t.paymentMethod,s.hasLicenseKey=t.hasLicenseKey;const n=s.subStatus.finalSubState;if(!n.billingSchedule||!n.plan)throw"A base plan is required, in order to change it.";return s.subChangePlans=t.serializedSubChangePlans.map(e=>M.SubscriptionChangePlan.deserialize(e)),s.allSubStatuses=s.subChangePlans.map(e=>e),s.allSubStatuses.push(s.subStatus),r.ProEventsLogger.log("de_plan_tab_change_billing_load_modal",{from:(null===(a=s.subStatus.subState.billingSchedule)||void 0===a?void 0:a.id)===v.ScheduleId.MONTHLY?"monthly":"yearly"}),s},this.logTTI)},error:e=>{var t;(null===(t=JSON.parse(e.responseText).paymentMethod)||void 0===t?void 0:t.gateway_id)===m.DLOCAL_RBI_GATEWAY?I.Notify.error(T.intl.formatMessage({id:"KV0uLd",defaultMessage:"UPI payment does not support different billing period."})):I.Notify.error(T.intl.formatMessage({id:"C2BKnZ",defaultMessage:"Failed to load modal."})),this.modalLogger.logModalError("modal_init"),this.closeModals()}})}getSubChangePlan(){return this.state.subChangePlans.filter(e=>{const t=e.finalSubState;return!(!t.plan||!t.billingSchedule)&&(t.plan.productType===this.currentPlanType&&t.billingSchedule.id===this.scheduleToSwitchTo)}).pop()}get subStatusScheduleId(){const{subStatus:e}=this.state;return e&&e.finalSubState.billingSchedule?e.finalSubState.billingSchedule.id:v.ScheduleId.MONTHLY}get scheduleToSwitchTo(){if(!this.state.subStatus)return v.ScheduleId.MONTHLY;return this.state.subStatus.subState.billingSchedule.id===v.ScheduleId.MONTHLY?v.ScheduleId.YEARLY:v.ScheduleId.MONTHLY}get currentPlanType(){var e,t;return(null===(t=null===(e=this.state.subStatus)||void 0===e?void 0:e.finalSubState.plan)||void 0===t?void 0:t.productType)||v.ProductPlanType.STANDARD}logChangeScheduleModalOpen(){const{isFromBillingTab:e}=this.props;let t,a;e?(t=B.CENTER_PANE_BILLING_TAB,a="de_billing_tab_change_billing_open_modal"):(t=B.CENTER_PANE_PLAN_TAB,a="de_plan_tab_change_billing_open_modal");const s=D.hql_events.HQLEventIdentity.create({eventClass:D.hql_events.HQLEventIdentity.EventClass.create({className:x.hql_events.TaxonomyClass.ClassName.SEE_AND_CLICK}),legacyEvent:D.hql_events.HQLEventIdentity.LegacyEvent.create({table:"pro_events",name:a}),actionEventId:D.hql_events.HQLEventIdentity.ActionEventIdentity.create({object:"change_billing_schedule_modal",action:x.hql_events.TaxonomyAction.Action.SHOWN})});N.logEvent(L.hql_events.ShownChangeBillingScheduleModal.create({hqlMetadata:D.hql_events.HQLMetadata.create({appSurface:k.WEB,actionSurface:t,identityOverride:s})}))}logChangeSchedule(){const{subStatus:e}=this.state;e&&e.subState.billingSchedule&&r.ProEventsLogger.log("de_change_billing_change_schedule",{from:e.subState.billingSchedule.id===v.ScheduleId.MONTHLY?"monthly":"yearly",to:e.subState.billingSchedule.id===v.ScheduleId.MONTHLY?"yearly":"monthly"})}isBillingScheduleToChange(){const{subStatus:e,hasLicenseKey:t}=this.state;return!t&&(!!(e&&e.subState.billingSchedule&&e.finalSubState.billingSchedule)&&e.subState.billingSchedule.id!==e.finalSubState.billingSchedule.id)}get changesSummaryContent(){const{subStatus:e,paymentMethod:t}=this.state,a=this.getSubChangePlan();if(!e||!e.subState.plan)return;if(e.subState.plan.scheduleId!==e.finalSubState.plan.scheduleId&&!this.isProfessionalTrialPlan)return T.intl.formatMessage({id:"uGbqz6",defaultMessage:"You’ve already requested a change to your billing period. If you want to choose a different billing period, first cancel your pending change. Cancel change"},{cancelChangeLink:e=>n.default.createElement(i.Link,{href:"#","aria-label":T.intl.formatMessage({id:"7kgsyk",defaultMessage:"Cancel change"}),className:"change-confirmation-modal__link",onClick:this.handleCancelScheduleAction,variant:"primary",hasNoUnderline:!0},e)});const s={nextBillingDate:e.subState.formattedNextBillingDate,scheduleId:a.finalSubState.billingSchedule.id,totalPrice:b.Cash.formatWithTaxLabels(a.nextBillingSummary.total,a.nextBillingSummary)},o=n.default.createElement(p.IndividualInlinePaymentMethodView,{accountPaymentInfo:p.convertLegacyPaymentInfo(t),renderUpdateLink:n.default.createElement(g.UpdateBillingInfoLink,{updateBillingCTA:this.updateBillingInfo}),transitionDetails:s});return T.intl.formatMessage({id:"pVEqbN",defaultMessage:"{paymentInfo}{br}{br}Charges will continue until you cancel, and previous charges won’t be refunded unless it’s legally required."},{br:n.default.createElement("br",null),strong:e=>n.default.createElement("strong",null,e),cancelLink:e=>n.default.createElement(i.Link,{href:"#","aria-label":T.intl.formatMessage({id:"A3cCkZ",defaultMessage:"Cancel link"}),onClick:_.logClickAndRedirect("de_cancel_link_click","/help/billing/cancel-dropbox-plus",{from:"change_plan_modal"}),variant:"primary",hasNoUnderline:!0},e),legalLink:e=>n.default.createElement(i.Link,{href:"#","aria-label":T.intl.formatMessage({id:"5Kyedz",defaultMessage:"Legal link"}),onClick:_.logClickAndRedirect("de_legal_link_click","/help/billing/plus-refund",{from:"change_plan_modal"}),variant:"primary",hasNoUnderline:!0},e),paymentInfo:o})}get acceptButtonDisabled(){const{paymentMethod:e}=this.state,{loadingContent:t,submitting:a}=this.state;return t||a||!e||this.isBillingScheduleToChange()}render(){const{subStatus:e,loadingContent:t,submitting:a,open:s}=this.state,{transitionPerformed:i}=this.props;e&&i&&!this.isProfessionalTrialPlan&&!this.isPlusTrialPlan&&(y.DBModalStack.clear(),y.DBModalStack.register(d.CHANGE_IND_PLAN_MODAL_UPDATED,()=>{O.showInstance({transitionPerformed:this.transitionPerformedClosure,scheduledChangesInfo:this.props.scheduledChangesInfo})}));const o=T.intl.formatMessage({id:"BKISIV",defaultMessage:"Confirm"}),r=T.intl.formatMessage({id:"d9/SE1",defaultMessage:"Cancel"}),l=this.isBillingScheduleToChange()&&!this.isProfessionalTrialPlan?T.intl.formatMessage({id:"ewZ2I2",defaultMessage:"Change billing period"}):this.scheduleToSwitchTo===v.ScheduleId.YEARLY?T.intl.formatMessage({id:"z17QUa",defaultMessage:"You’re switching to yearly billing"}):T.intl.formatMessage({id:"/tHQbR",defaultMessage:"You’re switching to monthly billing"}),c=n.default.createElement(g.UpdateBillingInfoButton,{updateBillingCTA:this.updateBillingInfo});return n.default.createElement(h.ChangeConfirmationModal,{acceptButtonDisabled:this.acceptButtonDisabled,acceptButtonText:o,description:this.changesSummaryContent,dismissButtonText:r,link:c,loadingContent:t,onAccept:this.onAccept,onDismiss:this.onDismissModal,open:s,submitting:a,title:l})}}t.ChangeScheduleModalView=O,O.displayName="ChangeScheduleModalView"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/disband_family_confirmation_modal",["require","exports","tslib","react","styled-components","dig-components/modal","dig-components/typography","dig-components/controls","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/dbmodal_stack","dig-components/buttons","metaserver/static/js/modules/constants/trademark","typescript/component_libraries/family/src/common/links"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.showDisbandModal=t.DisbandFamilyConfirmationModal=t.FAMILY_DISBAND_MODAL_GO_BACK=void 0,s=a.__importDefault(s);const g=(n=a.__importDefault(n)).default.div` display: flex; margin-bottom: var(--spacing__unit--2); &:last-child { margin-bottom: 0; } `,_=n.default(r.Checkbox)` margin-top: var(--spacing__unit--0_5); max-width: 20px; flex: 1; margin-right: var(--spacing__base_unit); `,f=n.default.div` margin-bottom: var(--spacing__unit--3); `,h=n.default(o.Text)` flex: 2; `,y=({children:e})=>s.default.createElement(o.Link,{href:p.FAMILY_ROOM_HELP_CENTER_ARTICLE,target:"_blank",rel:"noreferrer",variant:"monochromatic"},e);y.displayName="FamilyRoomHelpCenterArticle",t.FAMILY_DISBAND_MODAL_GO_BACK="disband_family_confirmation_modal:goback",t.DisbandFamilyConfirmationModal=e=>{const[a,n]=s.default.useState(!1),[r,p]=s.default.useState(!1),[b,v]=s.default.useState(!1),[M,S]=s.default.useState(!1),E=!a||!r||!b||M,C=()=>{d.Modal.close()},P=()=>{S(!1)};return s.default.createElement(i.Modal,{open:!0,className:"disband-family-confirmation-modal",overlayClassName:"disband-family-confirmation-modal-overlay",width:"small",onRequestClose:C},s.default.createElement(i.Modal.Header,{hasBottomSpacing:"title-standard"},s.default.createElement(o.Title,{isBold:!0},l.intl.formatMessage({id:"I9CTpA",defaultMessage:"Are you sure you want to change plans?"}))),s.default.createElement(i.Modal.Body,null,s.default.createElement(f,null,s.default.createElement(h,null,l.intl.formatMessage({id:"QDkSaP",defaultMessage:"{dropbox_family} will be canceled, and active members of your {family_plan} plan will have their accounts downgraded to {dropbox_basic}"},{dropbox_family:m.DROPBOX_FAMILY,family_plan:m.TRADEMARK_FAMILY,dropbox_basic:m.DROPBOX_BASIC}))),s.default.createElement(f,null,s.default.createElement(h,{isBold:!0},l.intl.formatMessage({id:"Md6TJX",defaultMessage:"If you still want to change plans, please acknowledge the following:"}))),s.default.createElement(g,null,s.default.createElement(_,{onChange:()=>{n(!a)},checked:a,className:"disband-confirmation-checkbox downgrade-acknowledged"}),s.default.createElement(h,null,l.intl.formatMessage({id:"+E9wLh",defaultMessage:"By proceeding, {family_plan} plan members will be downgraded to a {basic_space_quota} {dropbox_basic} plan."},{family_plan:m.TRADEMARK_FAMILY,dropbox_basic:m.DROPBOX_BASIC,basic_space_quota:e.basicSkuQuotaGb}))),s.default.createElement(g,null,s.default.createElement(_,{onChange:()=>{v(!b)},checked:b,className:"disband-confirmation-checkbox family-shared-folder-acknowledged"}),s.default.createElement(h,null,l.intl.formatMessage({id:"DaDVT1",defaultMessage:"All members will keep a copy of your Family Room folder."},{link:e=>s.default.createElement(y,null,e)}))),s.default.createElement(g,null,s.default.createElement(_,{onChange:()=>{p(!r)},checked:r,className:"disband-confirmation-checkbox over-quota-acknowledged"}),s.default.createElement(h,null,l.intl.formatMessage({id:"zGHPY9",defaultMessage:"If members are using more than {basic_space_quota} of storage, Dropbox will stop syncing, additional files can’t be uploaded, and files can’t be restored to earlier versions."},{basic_space_quota:e.basicSkuQuotaGb})))),s.default.createElement(i.Modal.Footer,null,s.default.createElement(u.Button,{className:"disband-family-confirmation-modal-back",disabled:M,variant:"transparent",onClick:()=>{d.Modal.close(),c.DBModalStack.trigger(t.FAMILY_DISBAND_MODAL_GO_BACK,{})}},l.intl.formatMessage({id:"lhKaOC",defaultMessage:"Back"})),s.default.createElement(u.Button,{className:"disband-family-confirmation-modal-cancel",disabled:M,variant:"opacity",onClick:C},l.intl.formatMessage({id:"d9/SE1",defaultMessage:"Cancel"})),s.default.createElement(u.Button,{className:"disband-family-confirmation-modal-confirm",variant:"primary",onClick:()=>{S(!0),e.confirmChangePlan(P)},disabled:E},l.intl.formatMessage({id:"ZCkVHN",defaultMessage:"Confirm change"}))))},t.showDisbandModal=function(e){d.Modal.showInstance(s.default.createElement(t.DisbandFamilyConfirmationModal,Object.assign({},e)))}})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/license_keys",["require","exports","tslib","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/browser","react","styled-components","metaserver/static/js/modules/clean/account_page/components/account_table","metaserver/static/js/modules/clean/account_page/components/key_value_block","metaserver/static/js/modules/clean/payments/skus/constants"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LicenseKeys=void 0,n=a.__importStar(n),i=a.__importDefault(i);const c=(o=a.__importDefault(o)).default(r.BodyRow)` height: 56px; border-top: 1px solid var(--color__faint__border); `,u=o.default(r.HeaderCell)` font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); width: 240px; padding-left: var(--spacing__unit--2); `,m=o.default(r.HeaderCell)` font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); width: 170px; padding-right: var(--spacing__unit--2); `,p=o.default(r.HeaderRow)` height: var(--spacing__unit--5); background-color: var(--color__faint__background); font-weight: normal; `,g=o.default(r.Table)` width: 100%; border-collapse: collapse; .activated { background-color: var(--color__faint__background); } `,_=o.default(r.TableFooter)` width: 100%; text-align: center; border-top: 1px solid var(--color__faint__border); `,f=o.default.tr` height: 45px; `,h=o.default(r.BodyCell)` color: var(--color__standard__text); text-align: left; `,y=o.default(r.BodyCell)` color: var(--color__standard__text); text-align: left; `,b=o.default(r.BodyCell)` color: var(--color__standard__text); text-align: left; width: 170px; padding-right: var(--spacing__unit--2); `,v=o.default(r.BodyCell)` color: var(--color__standard__text); text-align: left; width: 240px; padding-left: var(--spacing__unit--2); `;class M extends i.default.Component{constructor(e){super(e),this.licenseRowsIncrement=3,this.handleRedeemClick=()=>{n.redirect("/pro/redeem_key")},this.buildLicenseFooter=()=>{if(this.state.showViewMore)return i.default.createElement(f,{className:"license-footer-row"},i.default.createElement("td",{colSpan:4},i.default.createElement("a",{onClick:this.showMoreLicense,href:"",rel:"noopener noreferrer"},s.intl.formatMessage({id:"fiL806",defaultMessage:"View more license keys"}))))},this.showMoreLicense=e=>{e.preventDefault(),this.setState((e,t)=>{const a=e.maxShow+this.licenseRowsIncrement;return{maxShow:a,showViewMore:ae.activated?s.intl.formatMessage({id:"7rnsEt",defaultMessage:"Activated on {activated_date}"},{activated_date:e.activated_date}):s.intl.formatMessage({id:"QJkpjq",defaultMessage:"Scheduled for future use"}),this.buildDuration=e=>e.duration?e.duration:s.intl.formatMessage({id:"CNLpjm",defaultMessage:"N/A"}),this.buildLicenseKeyTable=()=>{const e=this.props.licenseKeys;if(0!==e.length)return i.default.createElement("div",null,i.default.createElement(g,{className:"license-table"},i.default.createElement(r.TableHead,null,i.default.createElement(p,null,i.default.createElement(u,null,s.intl.formatMessage({id:"xn3SDu",defaultMessage:"Key"})),i.default.createElement(r.HeaderCell,null,s.intl.formatMessage({id:"Ncw9cm",defaultMessage:"Redeemed"})),i.default.createElement(r.HeaderCell,null,s.intl.formatMessage({id:"E3AATa",defaultMessage:"Duration"})),i.default.createElement(m,null,s.intl.formatMessage({id:"uufVvn",defaultMessage:"Status"})))),i.default.createElement(_,null,this.buildLicenseFooter()),i.default.createElement(r.TableBody,null,e.map((e,t)=>{if(!(t>=this.state.maxShow))return i.default.createElement(c,{className:"license-body-row "+(e.activated?"activated":"unused"),key:e.key},i.default.createElement(v,null,e.key),i.default.createElement(h,{className:"license-redeemded"},e.redeemed_date),i.default.createElement(y,null,this.buildDuration(e)),i.default.createElement(b,null,this.buildStatus(e)))}))))},this.state={maxShow:3,showViewMore:!1}}componentDidMount(){this.setState((e,t)=>({showViewMore:e.maxShows.createElement("div",{className:e.className},s.createElement("img",Object.assign({src:i.static_url("/static/images/icons/ajax-loading-small-blue-vflVk_QNP.gif"),alt:n.intl.formatMessage({id:"jybGUg",defaultMessage:"Loading"})},e.imageProps)))})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/individual_inline_payment_method",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/payments/billing_instrument/payment_method_constants"],(function(e,t,a,s,n,i,o){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IndividualInlinePaymentMethodView=t.convertLegacyPaymentInfo=t.AccountPaymentInfoType=void 0,s=a.__importDefault(s),(function(e){e.Card="card",e.Sepa="sepa",e.Ideal="ideal",e.Paypal="paypal",e.Unknown="unknown"})(r=t.AccountPaymentInfoType||(t.AccountPaymentInfoType={})),t.convertLegacyPaymentInfo=function(e){if(!e)return;let t,a="unknown"===e.account?null:e.account.slice(-4),s=!0;switch(e.gateway_id){case o.BRAINTREE:t=r.Card;break;case o.ADYEN_SEPA_GATEWAY:t=r.Sepa;break;case o.ADYEN_IDEAL_GATEWAY:t=r.Ideal;break;case o.PAYPAL_REFERENCE_TRANSACTION:t=r.Paypal,a=null;break;default:t=r.Unknown,s=!1}return{active_payment_method_type:t,last_digits:a,vat_country_code:e.country_code,can_update_payment_method_via_web_storefront:s}};class l extends s.default.Component{renderCreditCard(){const{accountPaymentInfo:e,transitionDetails:t}=this.props;if(e){const a=e.last_digits;let o;if(t){const{nextBillingDate:e,scheduleId:r,totalPrice:l}=t;return o=r===i.ScheduleId.YEARLY?n.intl.formatMessage({id:"IK0bTU",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per year on your card ending in {last4}."},{last4:a,date:e,scheduled_total:l,strong:e=>s.default.createElement("strong",null,e)}):n.intl.formatMessage({id:"QRWsYu",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per month on your card ending in {last4}."},{last4:a,date:e,scheduled_total:l,strong:e=>s.default.createElement("strong",null,e)}),s.default.createElement("span",null,o," ")}return o=n.intl.formatMessage({id:"GK+TXw",defaultMessage:"We’ll charge your card ending in {last4}."},{last4:a}),s.default.createElement("span",null,o," ",this.props.renderUpdateLink)}return s.default.createElement("span",null)}renderDirectDebit(){const{accountPaymentInfo:e,transitionDetails:t}=this.props;if(e){const a=e.last_digits;let o;if(t){const{nextBillingDate:e,scheduleId:r,totalPrice:l}=t;return o=r===i.ScheduleId.YEARLY?n.intl.formatMessage({id:"5ZcdXx",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per year on your IBAN ending in {last4}."},{last4:a,date:e,scheduled_total:l,strong:e=>s.default.createElement("strong",null,e)}):n.intl.formatMessage({id:"j+Ib+Z",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per month on your IBAN ending in {last4}."},{last4:a,date:e,scheduled_total:l,strong:e=>s.default.createElement("strong",null,e)}),s.default.createElement("span",null,o," ")}return o=n.intl.formatMessage({id:"RFtAL9",defaultMessage:"We’ll charge your IBAN ending in {last4}."},{last4:a}),s.default.createElement("span",null,o," ",this.props.renderUpdateLink)}return s.default.createElement("span",null)}renderPaypal(){const{renderUpdateLink:e,transitionDetails:t}=this.props;if(t){const{nextBillingDate:e,scheduleId:a,totalPrice:o}=t,r=a===i.ScheduleId.YEARLY?n.intl.formatMessage({id:"GvhVZe",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per year on your PayPal account."},{date:e,scheduled_total:o,strong:e=>s.default.createElement("strong",null,e)}):n.intl.formatMessage({id:"S7Wy/F",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per month on your PayPal account."},{date:e,scheduled_total:o,strong:e=>s.default.createElement("strong",null,e)});return s.default.createElement("span",null,r," ")}return s.default.createElement("span",null,n.intl.formatMessage({id:"aQ9deh",defaultMessage:"We’ll charge your PayPal account."})," ",e)}renderIdeal(){const{renderUpdateLink:e,transitionDetails:t}=this.props;if(t){const{nextBillingDate:e,scheduleId:a,totalPrice:o}=t,r=a===i.ScheduleId.YEARLY?n.intl.formatMessage({id:"TZiYnT",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per year on your iDEAL account."},{date:e,scheduled_total:o,strong:e=>s.default.createElement("strong",null,e)}):n.intl.formatMessage({id:"8MQcfN",defaultMessage:"Starting {date}, we’ll charge you {scheduled_total} per month on your iDEAL account."},{date:e,scheduled_total:o,strong:e=>s.default.createElement("strong",null,e)});return s.default.createElement("span",null,r," ")}return s.default.createElement("span",null,n.intl.formatMessage({id:"7EJCsH",defaultMessage:"We’ll charge your iDEAL account."})," ",e)}get currentChargeText(){var e;let t;return(null===(e=this.props.transitionDetails)||void 0===e?void 0:e.proratedPrice)&&(t=n.intl.formatMessage({id:"5Yw6yE",defaultMessage:"We’ll charge you {prorated_price} now, which is prorated for the current billing period. "},{prorated_price:this.props.transitionDetails.proratedPrice,strong:e=>s.default.createElement("strong",null,e)})),t}render(){const{accountPaymentInfo:e,paymentErrorMessage:t}=this.props;if(!e&&t)return s.default.createElement("span",null,t," ",this.props.renderUpdateLink);if(!e)return s.default.createElement("span",null);const a=this.currentChargeText;let n;switch(e.active_payment_method_type){case r.Card:n=this.renderCreditCard();break;case r.Sepa:n=this.renderDirectDebit();break;case r.Paypal:n=this.renderPaypal();break;case r.Ideal:n=this.renderIdeal();break;default:n=null}return s.default.createElement("span",null,a,n)}}t.IndividualInlinePaymentMethodView=l,l.displayName="IndividualInlinePaymentMethodView"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/npt_billing_schedule_items",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list_item","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list"],(function(e,t,a,s,n,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NptBillingScheduleItems=void 0,s=a.__importDefault(s);class l extends s.default.Component{changeProductScheduleTypeClosure(e){return()=>{this.props.changeProductScheduleType(e)}}getScheduleDescription(e,t,a,s){switch(e){case o.ScheduleId.YEARLY:return n.intl.formatMessage({id:"Fd23KZ",defaultMessage:"{plan_name} is {price_per_year} per year. You’ll save {savePercentage} over monthly billing."},{plan_name:this.props.planName,price_per_year:a,savePercentage:s});case o.ScheduleId.MONTHLY:return n.intl.formatMessage({id:"XD9xb9",defaultMessage:"{plan_name} is {price_per_month} per month. You’ll spend {price_per_year} per year."},{plan_name:this.props.planName,price_per_month:t,price_per_year:a})}return""}getBillingItemTitle(e){switch(e){case o.ScheduleId.YEARLY:return n.intl.formatMessage({id:"onubGk",defaultMessage:"Billed yearly"});case o.ScheduleId.MONTHLY:return n.intl.formatMessage({id:"ytUb1D",defaultMessage:"Billed monthly"})}return""}render(){const{trialPriceConversions:e,finalBillingScheduleId:t}=this.props;return s.default.createElement(r.AdminPricedList,null,Object.keys(e).map(a=>{const r=parseInt(a,10),l=r===t,d=e[a];let c=d.advertised_monthly_price,u=n.intl.formatMessage({id:"0OYZsq",defaultMessage:"per month"});return r===o.ScheduleId.YEARLY&&(c=d.advertised_yearly_price,u=n.intl.formatMessage({id:"1BL+ll",defaultMessage:"per year"})),s.default.createElement(i.AdminPricedListItem,{key:d.conversion_token.plan_sku_code,isSelected:l,title:this.getBillingItemTitle(r),titleWarningText:void 0,titleSecondaryText:void 0,description:this.getScheduleDescription(r,d.advertised_monthly_price,d.advertised_yearly_price,d.advertised_yearly_price_savings),price:void 0,priceString:c,detailsLink:void 0,unit:u,onClick:this.changeProductScheduleTypeClosure(r),disableItem:!1,recommended:r===o.ScheduleId.YEARLY})}))}}t.NptBillingScheduleItems=l,l.displayName="NptBillingScheduleItems"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/plan_status",["require","exports","tslib","metaserver/static/js/modules/core/browser","react","styled-components","metaserver/static/js/modules/clean/viewer","metaserver/static/js/modules/core/assert","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/exception","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_billing_modal_loader","metaserver/static/js/modules/clean/account_page/widgets/plan/strings","metaserver/static/js/modules/clean/account_page/widgets/billing/payment_methods_util","metaserver/static/js/modules/clean/payments/billing_instrument/payment_methods_util","metaserver/static/js/modules/clean/payments/billing_instrument/payment_method_constants","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/clean/react/payments/error/browser_update_required_modal","metaserver/static/js/modules/clean/payments/cash","metaserver/static/js/modules/clean/account_page/widgets/plan/views/cancel_subs_warning_modal","metaserver/static/js/modules/clean/payments/skus/constants","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/constants/trademark","dig-components/buttons","metaserver/static/js/modules/clean/account_page/widgets/plan/views/basic_plan_status","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/hql/index","metaserver/static/js/dropbox/proto/hql_events/activation/activation","metaserver/static/js/dropbox/proto/hql_events/revenue/revenue","metaserver/static/js/dropbox/proto/hql_events/extensions","metaserver/static/js/dropbox/proto/hql_events/taxonomy","metaserver/static/js/modules/clean/account_page/components/key_value_block","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/addon_section","metaserver/static/js/modules/clean/account_page/widgets/plan/views/addons/constants","metaserver/static/js/modules/clean/subscription/constants","dig-components/typography"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v,M,S,E,C,P,A,T,w,I,N,L,D,x,j,k){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PlanStatus=void 0,s=a.__importStar(s),n=a.__importDefault(n),i=a.__importDefault(i),c=a.__importStar(c);const B=N.hql_events.TaxonomyAppSurface.AppSurface,O=N.hql_events.TaxonomyActionSurface.ActionSurface,R=i.default(L.KeyValueBlock)` .account-key-value-block__value { margin-right: 0; } `,U=i.default.div` display: flex; .plan-status-section__link { white-space: nowrap; font-size: var(--type__body__standard--fontsize); } .ukraine-grace-period-container { margin-top: 10px; } .ukraine-grace-period-message { padding-right: var(--spacing__unit--1); color: var(--color__faint__text); } `,F=i.default.div` flex-grow: 1; color: var(--color__faint__text); font-size: var(--type__body__small--fontsize); line-height: var(--type__body__large--lineheight); `,q=i.default.h1` font-size: var(--type__body__large--fontsize); margin-bottom: var(--spacing__unit--2); color: var(--color__standard__text); `,H=i.default.p` color: var(--color__faint__text); font-size: var(--type__body__standard--fontsize); line-height: var(--type__body__standard--lineheight); width: 100%; max-width: 520px; padding-right: 8px; box-sizing: border-box; `,Y=i.default.div` flex-basis: 140px; text-align: right; display: flex; flex-direction: column; justify-content: center; height: var(--spacing__unit--4); margin-top: 30px; `,V=i.default.span` font-size: var(--type__body__small--fontsize); `,G=i.default.a` font-style: italic; `,z=i.default.div` width: 36px; margin: var(--spacing__base_unit) var(--spacing__unit--2) auto var(--spacing__base_unit); height: 69px; `,W=i.default.p` padding: 0; margin: 0; `,Q=i.default.div` .plan-status-section__try-free-trial { position: relative; p { width: 370px; margin: 0; } } `;var K,X;(function(e){e[e.Cancel=0]="Cancel",e[e.Change=1]="Change",e[e.Manage=2]="Manage",e[e.Upgrade=3]="Upgrade"})(K||(K={})),(function(e){e.PLAN_CHANGE="plan",e.FAMILY_PLAN_CHANGE="plus_to_family"})(X||(X={}));class Z extends n.default.Component{constructor(e){super(e),this.isOverQuota=()=>this.usage>this.quota,this.logSeePlanDetails=()=>{const{isTransactionInformationPage:e}=this.props;A.logEvent(T.hql_events.SelectMoreDetails.create({isTransactionInformationPage:Boolean(e),hqlMetadata:I.hql_events.HQLMetadata.create({appSurface:B.WEB,actionSurface:O.CENTER_PANE})})),M.ProEventsLogger.log("de_plan_tab_details_click")},this.cancelPlanClick=()=>{this.props.isPersonalUser?s.redirect("/cancel-subscription"):s.redirect("/team/cancel")},this.hasAddons=()=>{const{addonsInfo:e}=this.props;return!!e&&0!==e.length},this.canShowChangePlan=e=>{var t;const{subStatus:a,eligibleFor1tb:s,addonsLoadingState:n}=this.props,i=[v.ProductPlanType.STANDARD,v.ProductPlanType.PLUS,v.ProductPlanType.PROFESSIONAL,v.ProductPlanType.TRANSFER,v.ProductPlanType.SYNC_EVERYTHING,v.ProductPlanType.HS_DBX_PRO_BUNDLE,v.ProductPlanType.FAMILY_PAYER];e||i.push(v.ProductPlanType.FAMILY_NONPAYER);const o=null===(t=null==a?void 0:a.subState.plan)||void 0===t?void 0:t.productType;return!(!o||-1===i.indexOf(o))&&(!("ready"===n&&this.hasAddons())&&(!(this.props.hasUnusedLicenseKey||!this.isInStandardSchedule()||s)&&!this.isExternallyManagedSubscription))},this.onUpdateBillingClick=e=>{e.preventDefault(),this.props.browserUpdateRequired?h.BrowserUpdateModalLoader.showInstance():u.IndividualUpdateBillingModalLoader.showInstance()},this.logUpgradeButtonClick=()=>{const e=I.hql_events.HQLEventIdentity.create({eventClass:I.hql_events.HQLEventIdentity.EventClass.create({className:N.hql_events.TaxonomyClass.ClassName.SEE_AND_CLICK}),legacyEvent:I.hql_events.HQLEventIdentity.LegacyEvent.create({table:"pro_events",name:"de_plan_tab_upgrade_to_plus_click"}),actionEventId:I.hql_events.HQLEventIdentity.ActionEventIdentity.create({object:"basic_upgrade_button",action:N.hql_events.TaxonomyAction.Action.SELECT})});A.logEvent(w.hql_events.SelectBasicUpgradeButton.create({hqlMetadata:I.hql_events.HQLMetadata.create({appSurface:B.WEB,actionSurface:O.CENTER_PANE_PLAN_TAB,identityOverride:e})}))},this.redirectToUpgrade=()=>{this.logUpgradeButtonClick(),M.ProEventsLogger.log("de_plan_tab_upgrade_to_plus_click");const e=this.isOverQuota()?"acc_plan_upgrade_overquota_btn":"acc_plan_upgrade",t=new l.URI({path:"/upgrade",query:{oqa:e}}).toString();s.redirect(t)},this.contactSupportClick=()=>{M.ProEventsLogger.log("de_plan_tab_contact_support_click"),s.redirect("/support")},this.addPaymentClick=()=>{M.ProEventsLogger.log("de_plan_tab_add_payment_method_click"),u.IndividualUpdateBillingModalLoader.showInstance()},this.logPlanChangeNavigation=()=>{var e;const{subStatus:t}=this.props;if((null===(e=null==t?void 0:t.subState.plan)||void 0===e?void 0:e.productClass)===v.ProductClass.PLAN){const e=t.subState.plan.productType;M.ProEventsLogger.log("change_plan_modal_view",{current_product_plan_type:v.ProductPlanType[e]})}else c.reportException({err:new Error("Change plan modal opened without a plan"),severity:"non-critical"})},this.handlePlanChangeAttempt=(e,t=X.PLAN_CHANGE)=>{var a,n;if(e&&e.preventDefault(),this.props.isLoggedInUser)if(this.props.scheduledForDowngrade)b.CancelSubsWarningModal.showInstance({renewalDate:(null===(n=null===(a=this.props.subStatus)||void 0===a?void 0:a.subState)||void 0===n?void 0:n.formattedNextBillingDate)||"",transitionPerformed:this.props.onAddonUpdate,userIdOverride:this.getUserForModal(),subscriptionId:this.props.subscriptionId});else{const e=l.URI.parse(s.get_href()).getQuery().option;e?s.redirect(`${j.SINGLE_SEAT_FSS_CHANGE_PLAN_ROUTE}?option=${e}`):t===X.FAMILY_PLAN_CHANGE?s.redirect(`${j.SINGLE_SEAT_FSS_CHANGE_PLAN_ROUTE}?option=family&_tk=family_upsell`):s.redirect(`${j.SINGLE_SEAT_FSS_CHANGE_PLAN_ROUTE}`),this.logPlanChangeNavigation()}else this.props.isPersonalUser?s.redirect("/account/plan"):s.redirect("/team/admin/billing/manage")},this.renderContactSupportLink=()=>n.default.createElement("a",{href:"#",className:"plan-status-section__link account-page__link plan-status-section__contact_support_link",onClick:this.contactSupportClick},d.intl.formatMessage({id:"NYuVLU",defaultMessage:"Contact support to change plan"})),this.renderBillingPeriod=()=>{const{paymentInfo:e,scheduledForDowngrade:t,hasUnusedLicenseKey:a,subStatus:s}=this.props;if(this.isFamilyNonPayerPlan())return;if(this.isBackupPlan())return;if(!e||!this.props.showChangeBillingPeriod||a||!s||!s.subState.plan)return;const{gateway_id:i,is_reseller_billing:o,end_date:r,deactivated:l,is_on_trial:c,reseller_name:u,reseller_link:m,schedule_switchable:g}=e;if(!g&&!t||this.isExternallyManagedSubscription){const e=p.getBillingDisabledMessage({gatewayId:i,isResellerBilling:o,resellerName:u,resellerLink:m,dropboxPlan:s.subState.plan.displayName(),endDate:r,deactivated:l,isOnTrial:c});return n.default.createElement(V,{className:"plan-status-section__message"},e)}return e.is_in_grace_period?e.is_ukraine_market?n.default.createElement("div",{className:"ukraine-grace-period-container"},n.default.createElement(k.Text,{className:"ukraine-grace-period-message"},d.intl.formatMessage({id:"mQEAEm",defaultMessage:"We're providing payment relief for all customers based in Ukraine. However, until your billing information is updated, you'll be unable to make changes to your subscription. "})),n.default.createElement("a",{href:"#",className:"plan-status-section__link account-page__link",onClick:this.onUpdateBillingClick},d.intl.formatMessage({id:"bqlRfd",defaultMessage:"Update Billing Info"}))):n.default.createElement("a",{href:"#",className:"plan-status-section__link account-page__link",onClick:this.onUpdateBillingClick},d.intl.formatMessage({id:"iq/tnl",defaultMessage:"Please update your billing information"})):void 0},this.managePlanClick=()=>{s.redirect("/team/admin/billing/manage")},this.renderPlanStatusTitle=e=>n.default.createElement(R,{className:"zero_padding plan-status__subscription-summary",keyText:d.intl.formatMessage({id:"oy8WXs",defaultMessage:"Subscriptions"}),valueText:e}),this.renderChangePlanButton=e=>{const{paymentInfo:t,isLoggedInUser:a,isLoggedInAsTransactionOwner:s}=this.props;if(a&&!s)return this.renderLoginInstructions(K.Change);const i=this.getChangePlanButtonText(),o=this.getChangePlanClickHandler(e);return n.default.createElement(Y,{className:"plan-status-section__upgrade_btn"},n.default.createElement(E.Button,{className:"jest-change-plan-button",variant:"primary",onClick:o,disabled:null==t?void 0:t.is_in_grace_period},i))},this.getChangePlanButtonText=()=>this.isFamilyNonPayerPlan()?d.intl.formatMessage({id:"I9CJF0",defaultMessage:"See other plans"}):d.intl.formatMessage({id:"w1kkK2",defaultMessage:"Change plan"}),this.getChangePlanClickHandler=e=>{let t;return t=e?()=>{this.props.subStatus.subState.plan.isEnterprise?s.redirect("/team/admin/help?role=work"):s.redirect("/team/admin/billing/manage?show_switch_plan")}:this.isFamilyNonPayerPlan()?()=>{M.ProEventsLogger.log("de_plan_tab_see_other_plans_family_member_click"),s.redirect(this.plansURL)}:this.handlePlanChangeAttempt,t},this.logUpgradeOverquotaBtn=e=>{M.GrowthEventsLogger.log("acc_plan_upgrade_overquota_btn",{action:e,button_text:"Upgrade now",destination_url:"http://www.dropbox.com/upgrade",location:"in_product",quota_status:"over",upsell_type:"modal"})},this.onUpgradePlanButtonClick=()=>{this.logUpgradeOverquotaBtn("click"),this.redirectToUpgrade()},this.state={addonsInfoMinimized:!0}}componentDidMount(){var e,t;const a=l.URI.parse(s.get_href()).getQuery().modal;a&&("plan"===a||"plus_to_family"===a?this.canShowChangePlan(!0)?Promise.resolve().then(()=>{this.handlePlanChangeAttempt(void 0,a)}):P.Notify.error(d.intl.formatMessage({id:"Ruu9sN",defaultMessage:"You cannot change plans at this time."})):"downgrade"===a&&this.props.scheduledForDowngrade&&b.CancelSubsWarningModal.showInstance({renewalDate:(null===(t=null===(e=this.props.subStatus)||void 0===e?void 0:e.subState)||void 0===t?void 0:t.formattedNextBillingDate)||"",transitionPerformed:this.props.onAddonUpdate,userIdOverride:this.getUserForModal(),subscriptionId:this.props.subscriptionId}))}get plansURL(){const{isLoggedInUser:e,isTransactionInformationPage:t}=this.props,a={oqa:"acc_plan_upgrade"};return t&&!e&&(a.trigger="nr"),this.isTransferPlan()?"https://help.dropbox.com/accounts-billing/plans-upgrades/dropbox-transfer-plan":this.isBackupPlan()?"https://help.dropbox.com/accounts-billing/plans-upgrades/dropbox-backup-plan":new l.URI({path:"/plans",query:a}).toString()}get usage(){const{usageBreakdown:e}=this.props;return e.usage}get quota(){const{usageBreakdown:e}=this.props;return e.quota||.01}get isExternallyManagedSubscription(){const{paymentInfo:e,isExternallyBilled:t}=this.props;return t||e&&p.shouldHideBillingChange(e.gateway_id,e.is_reseller_billing)}renderCancelPlanButton(){return this.props.isLoggedInUser&&!this.props.isLoggedInAsTransactionOwner?this.renderLoginInstructions(K.Cancel):n.default.createElement(Y,{className:"plan-status-section__upgrade_btn"},n.default.createElement(E.Button,{onClick:this.cancelPlanClick,variant:"outline"},d.intl.formatMessage({id:"vQndaY",defaultMessage:"Cancel plan"})))}isTransferPlan(){const{subStatus:e}=this.props;return!(!e||!e.subState.plan)&&e.subState.plan.productType===v.ProductPlanType.TRANSFER}isBackupPlan(){var e,t;return(null===(t=null===(e=this.props.subStatus)||void 0===e?void 0:e.subState.plan)||void 0===t?void 0:t.productType)===v.ProductPlanType.SYNC_EVERYTHING}isHSProPlan(){var e,t;return(null===(t=null===(e=this.props.subStatus)||void 0===e?void 0:e.subState.plan)||void 0===t?void 0:t.productType)===v.ProductPlanType.HS_DBX_PRO_BUNDLE}isFamilyPayerPlan(){var e,t;return(null===(t=null===(e=this.props.subStatus)||void 0===e?void 0:e.subState.plan)||void 0===t?void 0:t.productType)===v.ProductPlanType.FAMILY_PAYER}isFamilyNonPayerPlan(){var e,t;return(null===(t=null===(e=this.props.subStatus)||void 0===e?void 0:e.subState.plan)||void 0===t?void 0:t.productType)===v.ProductPlanType.FAMILY_NONPAYER}isFamilyPlan(){return this.isFamilyPayerPlan()||this.isFamilyNonPayerPlan()}isFreePlusPlan(){const{subStatus:e}=this.props;return!(!e||!e.subState.plan)&&e.subState.plan.productType===v.ProductPlanType.FREE}isInStandardSchedule(){const{subStatus:e}=this.props;if(e&&e.subState&&e.subState.billingSchedule){const t=e.subState.billingSchedule.id;return t===v.ScheduleId.MONTHLY||t===v.ScheduleId.YEARLY}return!1}isTaurusPlan(){const{subStatus:e}=this.props;if(e&&e.subState.plan){const t=e.subState.plan.productType;return t===v.ProductPlanType.PLUS||t===v.ProductPlanType.PLUS_TRIAL||t===v.ProductPlanType.PROFESSIONAL||t===v.ProductPlanType.PROFESSIONAL_TRIAL||t===v.ProductPlanType.PLUS_WITH_SS||t===v.ProductPlanType.PLUS_WITH_SS_TRIAL}return!1}getGatewayId(){const{paymentInfo:e}=this.props;return e?e.gateway_id:_.NOT_APPLICABLE}isLicensePlan(){const{hasLicenseKey:e,paymentInfo:t}=this.props;return!!t&&(e||g.isLicenseKey(t.gateway_id))}renderLoginInstructions(e){let t,a;return a=this.props.userEmail?this.props.userEmail:d.intl.formatMessage({id:"fZ1ZfV",defaultMessage:"the account user"}),t=e===K.Cancel?d.intl.formatMessage({id:"diOSTv",defaultMessage:"Please login as {email}{br}to cancel your plan."},{br:n.default.createElement("br",null),email:a}):e===K.Change?d.intl.formatMessage({id:"7/qGqI",defaultMessage:"Please login as {email}{br}to change your plan."},{br:n.default.createElement("br",null),email:a}):e===K.Manage?d.intl.formatMessage({id:"yHAcZL",defaultMessage:"Please login as {email}{br}to manage your plan."},{br:n.default.createElement("br",null),email:a}):e===K.Upgrade?d.intl.formatMessage({id:"EYQ0Wr",defaultMessage:"Please login as {email}{br}to upgrade your plan."},{br:n.default.createElement("br",null),email:a}):d.intl.formatMessage({id:"wBh1Uk",defaultMessage:"Please login as {email}."},{email:a}),n.default.createElement("div",{className:"plan-status-section__login-msg"},t)}getUserForModal(){const{isPersonalUser:e,useSpecifiedRole:t,isLoggedInAsTransactionOwner:a}=this.props;let s=null;if(t&&a){const t=o.Viewer.get_viewer();s=e?t.personal_user?t.personal_user.id:null:t.work_user?t.work_user.id:null,r.assert(null!=s,"Could not find user for specified role; modal will fail")}return s}renderDropboxLogo(){return n.default.createElement(z,{className:"plan-status-section__icon u-mar-right-s"},n.default.createElement("img",{src:f.static_url("/static/images/logo_catalog/dropbox-business-icon_m1-vflczuza3.svg"),alt:""}))}getTeamName(){return this.props.isLoggedInAsTransactionOwner&&o.Viewer.get_viewer().team_name?o.Viewer.get_viewer().team_name:this.props.teamName?this.props.teamName:null}renderManagePlanButton(){return this.props.isLoggedInUser&&!this.props.isLoggedInAsTransactionOwner?this.renderLoginInstructions(K.Manage):n.default.createElement(Y,{className:"plan-status-section__upgrade_btn"},n.default.createElement(E.Button,{variant:"primary",onClick:this.managePlanClick},d.intl.formatMessage({id:"RBsGH7",defaultMessage:"Manage plan"})))}renderBusinessPlanSection(){const{subStatus:e,isTeamAdmin:t,scheduledForDowngrade:a,showCancelButton:s,addonsInfo:i,addonsLoadingState:r,browserUpdateRequired:l,onAddonUpdate:c}=this.props;if(e&&e.subState.isDeactivatedTeam)return this.renderBasicPlanSection();if(!e||!e.subState.plan)return;const u=e.subState.plan.productType===v.ProductPlanType.STANDARD;let m=e.subState.plan.displayName(!1,u);u||(m=d.intl.formatMessage({id:"15/NF/",defaultMessage:"{trade_mark} {plan_title}"},{trade_mark:S.TRADEMARK_BUSINESS,plan_title:m}));let p="";const g=this.getTeamName();let _,f;g&&(t?(p=d.intl.formatMessage({id:"TcIDqw",defaultMessage:"You’re an admin of the {team_name} Dropbox account."},{team_name:g}),this.props.isLoggedInAsTransactionOwner||(p=d.intl.formatMessage({id:"J98s/Q",defaultMessage:"This account is an admin of the {team_name} Dropbox account."},{team_name:g}))):(p=d.intl.formatMessage({id:"jgGyr5",defaultMessage:"You’re a member of the {team_name} Dropbox account."},{team_name:g}),this.props.isLoggedInAsTransactionOwner||(p=d.intl.formatMessage({id:"2c6DhA",defaultMessage:"This account is a member of the {team_name} Dropbox account."},{team_name:g}))));const h=o.Viewer.get_viewer(),y=e.subState.plan.isEnterprise;return this.props.isLoggedInUser&&!this.props.isLoggedInAsTransactionOwner?_=this.renderLoginInstructions():y?_=null:t||!this.props.isLoggedInUser?(_=this.renderManagePlanButton(),s&&(_=a?this.renderManagePlanButton():this.renderCancelPlanButton())):!t&&h.is_paired&&(f=n.default.createElement("p",null,d.intl.formatMessage({id:"7bN4Js",defaultMessage:"Looking for details on another plan?"})," ",n.default.createElement(G,{className:"plan-status-section__link plan-status-section__link--inline account-page__link",href:"/account/plan?role=personal"},d.intl.formatMessage({id:"JejsPF",defaultMessage:"Visit your personal account page."})))),n.default.createElement(U,{className:"plan-status-section"},this.renderDropboxLogo(),n.default.createElement(F,{className:"plan-status-section__description"},n.default.createElement(q,{className:"plan-status-section__title"},m),n.default.createElement(H,{className:"plan-status-section__title_description"},p),f,n.default.createElement(D.AddonSection,{addonSectionStatus:x.AddonSectionStatus.CURRENT,addonsInfo:i,addonsLoadingState:r,billingSchedule:e.finalSubState.billingSchedule,formattedSpecQuotaGb:e.subState.plan.formattedSpecQuotaGb,totalQuota:this.quota,onlyShowDescription:!0,browserUpdateRequired:l,onAddonUpdate:c,isPersonalUser:!1})),_)}showBasicPlanWithTrial(){const{trialsConfig:e}=this.props;return e&&e.trialBanner&&e.currentPlan&&e.currentPlan.skuContent&&e.currentPlan.skuContent.name===S.TRADEMARK_BASIC}renderUpgradePlanButton(e){return this.props.trialsConfig&&this.props.trialsConfig.trialBanner?n.default.createElement("div",null):this.props.isLoggedInUser&&!this.props.isLoggedInAsTransactionOwner?this.renderLoginInstructions(K.Upgrade):(this.isOverQuota()&&this.logUpgradeOverquotaBtn("view"),n.default.createElement(Y,{className:"plan-status-section__upgrade_btn"},n.default.createElement(E.Button,{variant:"primary",className:"jest-upgrade-plan-button",onClick:this.onUpgradePlanButtonClick},e)))}renderBasicPlanSection(){var e;const{subStatus:t,isLimitedTeam:a,isLockedTeam:s,isPaidTeam:i}=this.props;let o=S.DROPBOX_BASIC;if(!t)return;s&&(null===(e=t.subState.planSku)||void 0===e?void 0:e.content)?o=m.getLockedTeamPlanName(i,t.subState.planSku.content.dropboxDisplayName()):!this.showBasicPlanWithTrial()&&t.subState.plan&&(o=t.subState.plan.displayName());let r=void 0;if(a||t.subState.isDeactivatedTeam){const e=this.getTeamName();let t=d.intl.formatMessage({id:"jgGyr5",defaultMessage:"You’re a member of the {team_name} Dropbox account."},{team_name:e});this.props.isLoggedInAsTransactionOwner||(t=d.intl.formatMessage({id:"2c6DhA",defaultMessage:"This account is a member of the {team_name} Dropbox account."},{team_name:e})),r=n.default.createElement(W,{className:"plan-status-section__team_desc"},t)}const l=this.isOverQuota()?d.intl.formatMessage({id:"F2lDMN",defaultMessage:"Upgrade now"}):d.intl.formatMessage({id:"IqV88I",defaultMessage:"Upgrade"}),c=this.renderUpgradePlanButton(l);return n.default.createElement(C.BasicPlanStatusSection,{planName:o,plansUrl:this.plansURL,limitedTeam:r,upgradePlanButton:c,hidePlansLink:this.isExternallyManagedSubscription,hideUpgradeButton:s})}renderResellerPlan(){const e=d.intl.formatMessage({id:"mAtx6/",defaultMessage:"Dropbox {plus} 1TB"},{plus:S.TRADEMARK_PLUS});return n.default.createElement(U,{className:"plan-status-section"},this.renderDropboxLogo(),n.default.createElement(F,{className:"plan-status-section__description"},n.default.createElement(q,{className:"plan-status-section__title"},e),n.default.createElement(H,{className:"plan-status-section__title_description"},this.renderBillingPeriod())))}renderPaidPlanSection(){const{subStatus:e,isLimitedTeam:t,hasUnusedLicenseKey:a,paymentInfo:s,scheduledForDowngrade:i,isLoggedInAsTransactionOwner:o,showCancelButton:r,addonsInfo:l,addonsLoadingState:c,eligibleFor1tb:u,browserUpdateRequired:g,onAddonUpdate:_}=this.props;if(!e||!e.scheduledSubState||!e.subState.plan)return;const f=e.subState.plan,h=m.getPaidPlanName(f,!1,this.getGatewayId());let y,b,v,M,S,E;if(p.shouldHideBillingSummary(s,e.subState.plan.productType)||(M=m.getPaidPlanDefaultBillingSummary(e.nextBillingSummary,e.finalSubState.billingSchedule)),a&&(S=o?d.intl.formatMessage({id:"E5PyhP",defaultMessage:"Your license key will be activated and no charge made to your payment method on file."}):d.intl.formatMessage({id:"Yutfxu",defaultMessage:"This account’s license key will be activated and no charge made to the payment method on file."})),!this.isExternallyManagedSubscription){let t="";if(this.isFamilyNonPayerPlan())t=d.intl.formatMessage({id:"w5oksG",defaultMessage:"You’re a member of the {family} plan."},{family:f.displayName()});else if(a)t=S||"";else if(!i&&(v=d.intl.formatMessage({id:"mNB218",defaultMessage:"{billing_summary} Renews on {date}."},{date:e.formattedNextBillingDate,billing_summary:M||"",strong:e=>n.default.createElement("strong",null,e)}),t=m.getPlanFeatureDescription(f),this.hasAddons())){t=`${m.getPriceBreakdownByPlan(e.nextBillingSummary,e.finalSubState.billingSchedule,e.scheduledSubState.plan)} ${t}`}y=n.default.createElement("span",{className:"plan-status-section__description-content"},t," ")}if(i){const e=m.getPlanFeatureDescription(f);y=n.default.createElement("span",null,e," ")}if(t){const e=this.getTeamName();let t=d.intl.formatMessage({id:"X0wsLF",defaultMessage:"You’re a member of the {team_name} Dropbox account."},{team_name:e});o||(t=d.intl.formatMessage({id:"/IIBtR",defaultMessage:"This account is a member of the {team_name} Dropbox account."},{team_name:e})),b=n.default.createElement(W,{className:"plan-status-section__team_desc"},t)}return this.canShowChangePlan(!1)&&(E=this.renderChangePlanButton(!1)),r&&!i&&(E=this.renderCancelPlanButton()),n.default.createElement("div",null,this.renderPlanStatusTitle(v),n.default.createElement(U,{className:"plan-status-section"},this.renderDropboxLogo(),n.default.createElement(F,{className:"plan-status-section__description"},n.default.createElement(q,{className:"plan-status-section__title"},h),b,n.default.createElement(H,{className:"plan-status-section__title_description"},y,this.renderPlanDetails(),n.default.createElement("br",null),this.renderBillingPeriod()),n.default.createElement(D.AddonSection,{addonSectionStatus:x.AddonSectionStatus.CURRENT,addonsInfo:l,addonsLoadingState:c,billingSchedule:e.finalSubState.billingSchedule,formattedSpecQuotaGb:e.subState.plan.formattedSpecQuotaGb,totalQuota:this.quota,eligibleFor1tb:u,browserUpdateRequired:g,onAddonUpdate:_,isPersonalUser:!0})),E))}renderPlanDetails(){if(this.isHSProPlan())return;if(this.props.eligibleFor1tb||!this.isExternallyManagedSubscription&&!this.isInStandardSchedule()||this.isFreePlusPlan()||this.props.hasUnusedLicenseKey)return this.renderContactSupportLink();let e=d.intl.formatMessage({id:"GPqIVb",defaultMessage:"What’s included?"});if(this.isFamilyPlan())e=d.intl.formatMessage({id:"um7qHG",defaultMessage:"What’s included?"});else if(this.isTaurusPlan()){if(this.isExternallyManagedSubscription)return;e=d.intl.formatMessage({id:"RuKlo2",defaultMessage:"See plan details"})}else if(this.isBackupPlan())e=d.intl.formatMessage({id:"3hCG9P",defaultMessage:"See plan info"});else{if(this.isExternallyManagedSubscription)return;e=d.intl.formatMessage({id:"VEb96o",defaultMessage:"See available plans"})}return n.default.createElement("a",{className:"plan-status-section__link account-page__link jest-see-plan-details-btn",onClick:this.logSeePlanDetails,href:this.plansURL,target:"_blank",rel:"noopener noreferrer"},e)}get hasSelfServablePaymentAfterLicensekey(){const{paymentInfo:e}=this.props;return e&&!g.isLicenseKey(e.gateway_id)&&!p.shouldHidePaymentMethod(e.gateway_id)}renderLicensePlanSection(){const{subStatus:e,isLoggedInAsTransactionOwner:t}=this.props;if(!e||!e.subState||!e.subState.plan)return n.default.createElement("noscript",null);const a=d.intl.formatMessage({id:"625HOw",defaultMessage:"Dropbox {plus}"},{plus:e.subState.plan.displayName()});let s,i=n.default.createElement("noscript",null);if(this.props.hasUnusedLicenseKey){s=t?d.intl.formatMessage({id:"jQ1eDP",defaultMessage:"Your Dropbox {plus} plan was activated with a license key. Your next license key will be activated on {date}."},{plus:S.TRADEMARK_PLUS,date:e.formattedNextBillingDate}):d.intl.formatMessage({id:"yXjZBq",defaultMessage:"This Dropbox {plus} plan was activated with a license key. The next license key will be activated on {date}."},{plus:S.TRADEMARK_PLUS,date:e.formattedNextBillingDate});let a=n.default.createElement("noscript",null);if(this.hasSelfServablePaymentAfterLicensekey)a=n.default.createElement("div",null,d.intl.formatMessage({id:"flOh9z",defaultMessage:"No charge made to your payment method on file."})),this.props.isLoggedInAsTransactionOwner||(a=n.default.createElement("div",null,d.intl.formatMessage({id:"c1bGK9",defaultMessage:"No charge made to the payment method on file."})));else{let e=d.intl.formatMessage({id:"nswDHh",defaultMessage:"You can add your payment information now to have your subscription automatically renew when your keys expire."});this.props.isLoggedInAsTransactionOwner||(e=d.intl.formatMessage({id:"/Xs7Nm",defaultMessage:"The account owner can add payment information now to have this subscription automatically renew when the keys expire."})),a=n.default.createElement("div",null,e,n.default.createElement("br",null),n.default.createElement("a",{href:"#",onClick:this.addPaymentClick},d.intl.formatMessage({id:"2zkZ/z",defaultMessage:"Add payment method."})))}i=n.default.createElement("div",null,s,n.default.createElement("br",null),a)}else if(this.hasSelfServablePaymentAfterLicensekey&&!this.props.scheduledForDowngrade){const t=e.scheduledSubState.billingSchedule.scheduleDescriptionNoun;let a=d.intl.formatMessage({id:"QoelR9",defaultMessage:"Your Dropbox {plus} plan was activated with a license key. The plan will renew on {date}."},{plus:S.TRADEMARK_PLUS,date:e.formattedNextBillingDate}),s=d.intl.formatMessage({id:"DrEa0N",defaultMessage:"{new_total} per {new_period} will be charged to your payment method on file."},{new_total:y.Cash.formatWithTaxLabels(e.nextBillingSummary.total,e.nextBillingSummary),new_period:t});this.props.isLoggedInAsTransactionOwner||(a=d.intl.formatMessage({id:"kQDw1e",defaultMessage:"This Dropbox {plus} plan was activated with a license key. The plan will renew on {date}."},{plus:S.TRADEMARK_PLUS,date:e.formattedNextBillingDate}),s=d.intl.formatMessage({id:"xhxvHj",defaultMessage:"{new_total} per {new_period} will be charged to the payment method on file."},{new_total:y.Cash.formatWithTaxLabels(e.nextBillingSummary.total,e.nextBillingSummary),new_period:t})),i=n.default.createElement("div",null,a,n.default.createElement("br",null),s,n.default.createElement("br",null),this.renderBillingPeriod())}else{let t=d.intl.formatMessage({id:"6ejtCb",defaultMessage:"Your Dropbox {plus} plan was activated with a license key. The plan is active until {date}."},{plus:S.TRADEMARK_PLUS,date:e.formattedNextBillingDate}),a=d.intl.formatMessage({id:"vNTGeR",defaultMessage:"You can add your payment information now to have your subscription automatically renew when it expires."});this.props.isLoggedInAsTransactionOwner||(t=d.intl.formatMessage({id:"uTD2X0",defaultMessage:"This account’s Dropbox {plus} plan was activated with a license key. The plan is active until {date}."},{plus:S.TRADEMARK_PLUS,date:e.formattedNextBillingDate}),a=d.intl.formatMessage({id:"fEZEwT",defaultMessage:"The account owner can add payment information now to have this subscription automatically renew when it expires."})),i=n.default.createElement("div",null,t,n.default.createElement("br",null),a,n.default.createElement("br",null),n.default.createElement("a",{href:"#",onClick:this.addPaymentClick},d.intl.formatMessage({id:"fSZaj1",defaultMessage:"Add payment method."})))}return n.default.createElement(U,{className:"plan-status-section"},this.renderDropboxLogo(),n.default.createElement(F,{className:"plan-status-section__description"},n.default.createElement(q,{className:"plan-status-section__title"},a),n.default.createElement(H,{className:"plan-status-section__title_description"},i),this.renderContactSupportLink()))}renderPlanSection(){const{subStatus:e,isExternallyBilled:t,paymentInfo:a,isLimitedTeam:s}=this.props;return this.showBasicPlanWithTrial()?this.renderBasicPlanSection():t&&void 0!==a&&null!==a.reseller_name?this.renderResellerPlan():t&&s&&void 0!==a&&a.gateway_id===_.NOT_APPLICABLE?void 0:e&&e.subState.plan&&[v.ProductFamily.PRO,v.ProductFamily.FAMILY].includes(e.subState.plan.productFamily)?this.isLicensePlan()?this.renderLicensePlanSection():this.renderPaidPlanSection():this.renderBasicPlanSection()}render(){const{isPersonalUser:e,isLimitedTeam:t}=this.props,a=e||t?this.renderPlanSection():this.renderBusinessPlanSection();return n.default.createElement(Q,{className:"plan-status account-plan-section"},a)}}t.PlanStatus=Z,Z.displayName="PlanStatus"})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/resubscribe_plan_upsell",["require","exports","tslib","react","metaserver/static/js/modules/clean/react/components/css","dig-components/buttons","dig-components/typography","metaserver/static/js/dropbox/proto/storefront_platform_js_init_data/types","metaserver/static/js/modules/core/browser","metaserver/static/js/modules/clean/account_page/widgets/plan/strings","metaserver/static/js/modules/clean/analytics"],(function(e,t,a,s,n,i,o,r,l,d,c){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResubscribePlanUpsell=void 0,s=a.__importDefault(s),l=a.__importStar(l);var u=r.storefront_platform.StorefrontPlatformContractLengthUnit;class m extends s.default.Component{constructor(){super(...arguments),this.onResubscribeClick=(e,t)=>()=>{c.ProEventsLogger.log("plan_resubscribe_click",{plan_id:e}),l.redirect(t)},this.onPlanDetailsClick=(e,t)=>()=>{c.ProEventsLogger.log("plan_details_click",{plan_id:e}),l.redirect(t)}}render(){const{planProductType:e,planDisplayName:t,planEndedDate:a,planBillingUnitPrice:n,planBillingFrequency:r,purchaseEndpoint:l,productDetailsEndpoint:m}=this.props;if(!(e&&t&&a&&n&&(r===u.MONTH||r===u.YEAR)&&l&&m))return null;c.ProEventsLogger.log("plan_resubscribe_upsell_shown",{plan_id:e});const p=t,g=d.getResubscribeUpsellDescription(t,a,n,r);return s.default.createElement("div",{className:"resubscribe-plan-upsell"},s.default.createElement(o.Title,{size:"small",className:"resubscribe-plan-upsell__header"},p),s.default.createElement(o.Text,{className:"resubscribe-plan-upsell__description"},g),s.default.createElement("div",{className:"resubscribe-plan-upsell-actions"},s.default.createElement(i.Button,{variant:"outline",className:"resubscribe-plan-upsell-actions__resubscribe-button",onClick:this.onResubscribeClick(e,l)},d.getResubscribeUpsellResubscribeButtonText()),s.default.createElement(i.Button,{variant:"transparent",className:"resubscribe-plan-upsell-actions__plan-details-button",onClick:this.onPlanDetailsClick(e,m)},d.getResubscribeUpsellPlanDetailsButtonText())))}}m.displayName="ResubscribePlanUpsellView",t.ResubscribePlanUpsell=n.requireCssWithComponent(m,["/static/css/growth_pages/account_plan_tab/resubscribe_plan_upsell-vflGFC8mz.css"])})),define("metaserver/static/js/modules/clean/account_page/widgets/plan/views/update_billing_info",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","dig-components/buttons"],(function(e,t,a,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateBillingInfoButton=t.UpdateBillingInfoLink=void 0,s=a.__importDefault(s),t.UpdateBillingInfoLink=({className:e,updateBillingCTA:t})=>s.default.createElement("a",{key:"updateBillingInfo",className:e||"",href:"#",onClick:e=>{e.stopPropagation(),e.preventDefault(),t(e)},"data-testid":"update-billing-info-link"},n.intl.formatMessage({id:"ipgitK",defaultMessage:"Update billing information"})),t.UpdateBillingInfoLink.displayName="UpdateBillingInfoLink",t.UpdateBillingInfoButton=({updateBillingCTA:e})=>s.default.createElement(i.Button,{variant:"transparent",onClick:t=>{t.stopPropagation(),t.preventDefault(),e(t)}},n.intl.formatMessage({id:"LcZnrF",defaultMessage:"Update billing info"})),t.UpdateBillingInfoButton.displayName="UpdateBillingInfoButton"})),define("metaserver/static/js/modules/clean/react/campaigns/campaign_events_api",["require","exports","tslib","react","metaserver/static/js/modules/core/exception","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/active_user","metaserver/static/js/modules/clean/react/user_metadata/api"],(function(e,t,a,s,n,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CampaignContext=t.parseIntOrUndefined=t.reportException=t.logCampaignControl=t.logCampaignDismissed=t.setCampaignDismissedInUserMetadata=t.getIsCampaignDismissedInUserMetadata=t.logCampaignClick=t.logCampaignImpressionDeclined=t.logCampaignImpression=t.createMegaphoneCampaignImpressionContextFromMegaphoneImpressionContext=t.createMegaphoneCampaignImpressionContext=t.createMegaphoneCampaignImpressionContextFromEnrichedCampaignImpressionContext=void 0,s=a.__importDefault(s),n=a.__importStar(n);function l(e,t,a){let s=void 0;try{s={campaignId:t,campaignVariantId:a,campaignImpressionId:e,userId:o.mustGetActiveUserId()}}catch(e){reportException({err:e})}return s}function reportException({err:e,severity:t=n.SEVERITY.NONCRITICAL,exc_extra:a={}}){n.reportException({err:e,tags:["megaphone","robe"],severity:t,exc_extra:a})}function d(e,t,a){const s=new i.UserApiV2Client,n={megaphone_impression_id:e.campaignImpressionId,megaphone_request_context:{user_id:e.userId},campaign_event_name:t,campaign_event_info:a,campaign_id:c(e.campaignId),version_id:c(e.campaignVariantId)};return s.ns("megaphone").rpc("log_campaign_event",n,{subjectUserId:e.userId}).catch(a=>{reportException({err:a,exc_extra:{user_id:e.userId,impression_id:e.campaignImpressionId,event_name:t[".tag"]}})})}function c(e){switch(typeof e){case"string":return parseInt(e,10);case"number":return e;default:return}}t.createMegaphoneCampaignImpressionContextFromEnrichedCampaignImpressionContext=function(e){var t,a;return l(e.megaphone_impression_id||"",null===(t=e.campaign_variant_descriptor)||void 0===t?void 0:t.campaign_id,null===(a=e.campaign_variant_descriptor)||void 0===a?void 0:a.variant_id)},t.createMegaphoneCampaignImpressionContext=l,t.createMegaphoneCampaignImpressionContextFromMegaphoneImpressionContext=function(e){var t,a,s,n;if(e.megaphone_impression_id)return l(e.megaphone_impression_id,null===(a=null===(t=e.version_info)||void 0===t?void 0:t.campaign_id)||void 0===a?void 0:a.toString(),null===(n=null===(s=e.version_info)||void 0===s?void 0:s.version_id)||void 0===n?void 0:n.toString())},t.logCampaignImpression=function(e){return d(e,{".tag":"impression"})},t.logCampaignImpressionDeclined=function(e){return d(e,{".tag":"impression_declined"})},t.logCampaignClick=function(e,t){return d(e,{".tag":"click"},{cta_id:t})},t.getIsCampaignDismissedInUserMetadata=function(e,t,s){return a.__awaiter(this,void 0,void 0,(function*(){if(e)try{const{CAMPAIGNS_TOOLKIT_USER_DISMISSED_CAMPAIGNS:t}=yield r.getUserMetadata(["CAMPAIGNS_TOOLKIT_USER_DISMISSED_CAMPAIGNS"],s);return!!t&&new Set(t.split(":")).has(`${e}`)}catch(a){return reportException({err:a,exc_extra:{user_id:s,impression_id:t,campaign_id:e,event_name:"getIsCampaignDismissedInUserMetadata"}}),!0}return!1}))},t.setCampaignDismissedInUserMetadata=function(e,t,s){return a.__awaiter(this,void 0,void 0,(function*(){if(e)try{const{CAMPAIGNS_TOOLKIT_USER_DISMISSED_CAMPAIGNS:t}=yield r.getUserMetadata(["CAMPAIGNS_TOOLKIT_USER_DISMISSED_CAMPAIGNS"],s),a=new Set(t?t.split(":"):"").add(`${e}`),n=Array.from(a).join(":");yield r.setUserMetadata({CAMPAIGNS_TOOLKIT_USER_DISMISSED_CAMPAIGNS:n},s)}catch(a){reportException({err:a,exc_extra:{user_id:s,impression_id:t,campaign_id:e,event_name:"setCampaignDismissedInUserMetadata"}})}}))},t.logCampaignDismissed=function(e){return d(e,{".tag":"dismissed"})},t.logCampaignControl=function(e){return d(e,{".tag":"control"})},t.reportException=reportException,t.parseIntOrUndefined=c,t.CampaignContext=s.default.createContext(void 0)})),define("metaserver/static/js/modules/clean/family/constants",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MAX_LICENSES=t.getFamilyJoinUrl=t.FAMILY_INVITE_URI_PATH_SUCCESS=t.FAMILY_INVITE_URI_PATH=t.FAMILY_HOME_PATH=void 0,t.FAMILY_HOME_PATH="/h",t.FAMILY_INVITE_URI_PATH="/family/invite",t.FAMILY_INVITE_URI_PATH_SUCCESS="/family/invite?success",t.getFamilyJoinUrl=e=>`/family/join/${e}`,t.MAX_LICENSES=6})),define("metaserver/static/js/modules/clean/react/growth/trials/util",["require","exports","tslib","metaserver/static/js/api_v2/user_client","metaserver/static/js/modules/clean/payments/skus/constants"],(function(e,t,a,s,n){"use strict";function i(e){return{href:e.href,onClickType:e.on_click_type,text:e.text}}var o;Object.defineProperty(t,"__esModule",{value:!0}),t.getTransitionChangeType=t.PerformPlanTransitionForTrials=t.fetchModalConfig=t.formatCtaConfigResult=void 0,t.formatCtaConfigResult=i,t.fetchModalConfig=function(e,t){return a.__awaiter(this,void 0,void 0,(function*(){const a={primaryCTA:{}},n=new s.UserApiV2Client;try{const a=yield n.ns("trials").rpc("get_trials_modal_config",{modal_type:t},{subjectUserId:e}),{description:s,features:o,heading:r,primary_cta:l,secondary_cta:d}=a;return{description:s,features:o,heading:r,primaryCTA:l?i(l):void 0,secondaryCTA:d?i(d):void 0}}catch(e){return a}}))},(function(e){e[e.PLUS=3]="PLUS",e[e.PROFESSIONAL=4]="PROFESSIONAL"})(o=t.PerformPlanTransitionForTrials||(t.PerformPlanTransitionForTrials={})),t.getTransitionChangeType=function(e){if(e.finalSubState.planSku){if(e.finalSubState.planSku.productType===n.ProductPlanType.PLUS)return o.PLUS;if(e.finalSubState.planSku.productType===n.ProductPlanType.PROFESSIONAL)return o.PROFESSIONAL}return null}})),define("metaserver/static/js/modules/clean/react/payments/edit_invoice_address_modal/edit_invoice_address_modal_loader",["require","exports","tslib","metaserver/static/js/modules/core/notify","react","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/clean/react/sprite","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/arbor/aspen/elements/arbor_inputs","metaserver/static/js/modules/clean/payments/validation","metaserver/static/js/modules/clean/react/components/modal","dig-components/modal","dig-components/typography","spectrum/button/index","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/clean/react/tooltip","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/deprecated_ajax/ajax_as_promised_jquery","metaserver/static/js/modules/clean/subscription/tools/amp_logger"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b){"use strict";function v(e){return t=>null==t||t.length<=e}function M(e,t){return n.default.createElement(f.Tooltip,{position:f.TooltipPosition.RIGHT,tooltip_contents:t},e,n.default.createElement(o.Sprite,{group:"web",name:"info",className:"info-sprite",alt:""}))}Object.defineProperty(t,"__esModule",{value:!0}),t.EditInvoiceAddressModalLoader=void 0,n=a.__importDefault(n),u=a.__importStar(u);const S=l.intl.formatMessage({id:"F5ADP7",defaultMessage:"Country and postal code must match your account’s payment information."}),E=l.intl.formatMessage({id:"XjVAbc",defaultMessage:"Your tax rate on this invoice cannot be updated."}),C={addressName:l.intl.formatMessage({id:"B6dG2q",defaultMessage:"Billing name"}),address:l.intl.formatMessage({id:"fz9og9",defaultMessage:"Billing address"}),city:l.intl.formatMessage({id:"QnFif0",defaultMessage:"City"}),state:l.intl.formatMessage({id:"pyUCBn",defaultMessage:"State"}),zip:M(l.intl.formatMessage({id:"10Ms2o",defaultMessage:"Postal code"}),S),country:M(l.intl.formatMessage({id:"1SPrvR",defaultMessage:"Country"}),S),exclusionId:l.intl.formatMessage({id:"eZAuK1",defaultMessage:"VAT number (optional)"}),exclusionIdWithTooltip:M(l.intl.formatMessage({id:"eZAuK1",defaultMessage:"VAT number (optional)"}),E)};class P extends n.default.Component{constructor(e){super(e),this.disableds={addressName:!1,address:!1,city:!1,state:!1,zip:!0,country:!0,exclusionId:!1,exclusionIdWithTooltip:!1},this.addressNameLength=100,this.addressLength=250,this.cityLength=50,this.stateLength=50,this.vatLength=25,this.undefinedLength=void 0,this.validateHandlers={addressName:v(this.addressNameLength),address:v(this.addressLength),city:v(this.cityLength),state:v(this.stateLength),zip:()=>!0,country:()=>!0,exclusionId:()=>!0,exclusionIdWithTooltip:()=>!0},this.maxLengths={addressName:this.addressNameLength,address:this.addressLength,city:this.cityLength,state:this.stateLength,zip:this.undefinedLength,country:this.undefinedLength,exclusionId:this.vatLength,exclusionIdWithTooltip:this.vatLength},this.errorTexts={addressName:l.intl.formatMessage({id:"M9vy6c",defaultMessage:"Too long"}),address:l.intl.formatMessage({id:"M9vy6c",defaultMessage:"Too long"}),city:l.intl.formatMessage({id:"M9vy6c",defaultMessage:"Too long"}),state:l.intl.formatMessage({id:"M9vy6c",defaultMessage:"Too long"}),zip:"",country:"",exclusionId:"",exclusionIdWithTooltip:""},this.onSave=()=>{const{formState:e}=this.state,{invoice:t}=this.props;if(e)if(this.logActions("edit_billing_address_started"),this.setState({submitting:!0}),this.isInputValid()){const a={address_name:e.addressName,address:e.address,city:e.city,state:e.state,exclusion_id:e.exclusionId};t&&(a.invoice_id=r.URI.parse(t.link).getQuery().id.toString()),this.makeEditBillingAddressRequest(a)}else this.setState({submitting:!1,showErrors:!0})},this.onCancel=()=>{this.logActions("edit_billing_address_cancelled"),this.setState(e=>Object.assign(Object.assign({},e),{open:!1}))},this.state={submitting:!1,showErrors:!1,open:!0},e.isTeam?(this.editUrl="/edit_billing_address",this.viewModelUrl="/edit_billing_address_view_model",this.vatClass="grid__item--1-1",this.modalClass="edit-invoice-modal"):(this.editUrl="/edit_billing_address_individual",this.viewModelUrl="/edit_billing_address_individual_view_model",this.vatClass="grid__item--1-2",this.modalClass="edit-invoice-modal professional-modal")}static showInstance(e,a){const s=n.default.createElement(t.EditInvoiceAddressModalLoader,{invoice:e,isTeam:a});u.Modal.showInstance(s)}static showUpdateTaxProfileModal(e,a){const s=n.default.createElement(t.EditInvoiceAddressModalLoader,{isTeam:e,onUpdated:a});u.Modal.showInstance(s)}componentDidMount(){var e;let t=void 0;this.props.invoice&&(t=null===(e=r.URI.parse(this.props.invoice.link).getQuery().id)||void 0===e?void 0:e.toString(),this.disableds.exclusionIdWithTooltip=!0),this.makeRequest(t)}makeRequest(e){return a.__awaiter(this,void 0,void 0,(function*(){try{const t={invoice_id:e},a=yield y.WebRequest({url:this.viewModelUrl,data:t,dataType:"json"});c.hasVat(a.countryCode)&&(this.errorTexts.exclusionId=l.intl.formatMessage({id:"LW2miv",defaultMessage:"Please enter a valid VAT number, e.g. {examples}."},{examples:c.getVatExamples(a.countryCode).join(", ")}),this.validateHandlers.exclusionId=e=>!e||c.validateVat(a.countryCode,e)),this.setState({formState:a})}catch(e){this.setState(e=>Object.assign(Object.assign({},e),{open:!1}))}}))}render(){const{formState:e,showErrors:t,submitting:a}=this.state,{isTeam:s,invoice:i}=this.props;let o;if(e){let t=null;if(c.hasVat(e.countryCode)){const a=c.getVatPrefix(e.countryCode);t=i?this.renderInput("exclusionIdWithTooltip",this.vatClass):this.renderInput("exclusionId",this.vatClass,a)}o=s?n.default.createElement("div",{className:".type--arbor grid__container grid__container--p-large grid--x-bookend"},this.renderInstructions(e.countryCode),this.renderInput("addressName","grid__item--1-1"),this.renderInput("address","grid__item--1-1"),this.renderInput("city","grid__item--1-2"),this.renderInput("state","grid__item--11-24"),this.renderInput("zip","grid__item--7-24"),this.renderInput("country","grid__item--2-3"),t):n.default.createElement("div",{className:".type--arbor grid__container grid__container--p-large grid--x-bookend"},this.renderInput("addressName","grid__item--1-1"),this.renderInput("address","grid__item--1-2"),this.renderInput("city","grid__item--1-4"),this.renderInput("state","grid__item--1-4"),this.renderInput("zip","grid__item--1-2"),this.renderInput("country","grid__item--1-2"),t,this.renderInstructions(e.countryCode))}else o=n.default.createElement("div",{className:"loading-spinner"},n.default.createElement("img",{src:_.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:l.intl.formatMessage({id:"jybGUg",defaultMessage:"Loading"})}));const r=n.default.createElement(m.Modal.Footer,{hasTopBorder:!s,className:"oq-modal__buttons"},n.default.createElement(g.Button,{className:"edit-invoice-modal__cancel-button",variant:"secondary",onClick:this.onCancel},l.intl.formatMessage({id:"d9/SE1",defaultMessage:"Cancel"})),n.default.createElement(g.Button,{disabled:!e||a||t&&!this.isInputValid(),variant:"primary",onClick:this.onSave},l.intl.formatMessage({id:"F5NZs5",defaultMessage:"Save changes"})));return n.default.createElement(m.Modal,{open:this.state.open,isCentered:!0,withCloseButton:l.intl.formatMessage({id:"bv7A4+",defaultMessage:"Close"}),onRequestClose:this.onCancel,overlayClassName:this.modalClass,shouldCloseOnOverlayClick:!1,onAfterClose:u.Modal.close},n.default.createElement(m.Modal.Header,{hasBottomSpacing:"title-standard"},n.default.createElement(p.Title,{color:"faint",isBold:!1,size:"small"},l.intl.formatMessage({id:"/WFCIJ",defaultMessage:"Edit invoice details"}))),n.default.createElement(m.Modal.Body,null,n.default.createElement("div",{className:"dynamic-content"},o)),r)}logActions(e){this.props.isTeam?h.TeamsWebActionsLogger.log(e):h.UserActivityLogger.log("web",e)}makeEditBillingAddressRequest(e){return a.__awaiter(this,void 0,void 0,(function*(){const{onUpdated:t,isTeam:a}=this.props,n=b.getSubscriptionAMPLogger({ns:a?"team":"personal",modal:b.ModalTypes.EDIT_INVOICE_MODAL});try{const a=this.editUrl;yield y.WebRequest({url:a,data:e}),this.logActions("edit_billing_address_success"),s.Notify.success(l.intl.formatMessage({id:"Il5prr",defaultMessage:"Invoice details updated."})),n.logModalSuccess()}catch(e){this.logActions("edit_billing_address_edit_failure"),n.logModalError("modal_submit")}finally{t&&t(),this.setState(e=>Object.assign(Object.assign({},e),{open:!1}))}}))}renderInstructions(e){const{invoice:t}=this.props;let a;if(a=t?l.intl.formatMessage({id:"Wc4dM+",defaultMessage:"You are editing details for the {date} invoice."},{date:t.date}):l.intl.formatMessage({id:"MhniSh",defaultMessage:"You are editing details for all future invoices. To edit past invoices, click “Edit” on the invoice item instead."}),c.hasVat(e)){let e=l.intl.formatMessage({id:"Qyx8hc",defaultMessage:"Please note that changing your VAT number could impact your applicable tax rate."});t&&(e=l.intl.formatMessage({id:"q3KPUy",defaultMessage:"To add or change a VAT number or request a tax refund, contact support."})),a=a.concat(" ",e)}return n.default.createElement(p.Text,{variant:"paragraph",size:"small",color:"faint",className:"grid__item--1-1 instructions"},a)}renderInput(e,t,a){const{formState:s,showErrors:i}=this.state;let o="";return s&&(o=s[e]),n.default.createElement(d.ArborTextInput,{name:e,id:e,containerClassName:t,isValid:i?!!this.validateHandlers[e](o)&&"":"",labelText:C[e],errorText:this.errorTexts[e],value:o,onChange:this.onChangeFactory(e),disabled:this.disableds[e],placeholderText:a,maxLength:this.maxLengths[e]})}onChangeFactory(e){return(t,a,s)=>{const{formState:n}=this.state;n&&this.setState(t=>(n[e]=s,t))}}isInputValid(){const{formState:e}=this.state;return!!e&&(this.validateHandlers.addressName(e.addressName)&&this.validateHandlers.address(e.address)&&this.validateHandlers.city(e.city)&&this.validateHandlers.state(e.state)&&this.validateHandlers.exclusionId(e.exclusionId))}}P.displayName="EditInvoiceAddressModal",t.EditInvoiceAddressModalLoader=i.requireCssWithComponent(P,["/static/css/payments/edit_invoice_address_modal/edit_invoice_address_modal-vflTqEhcT.css"])})),define("metaserver/static/js/modules/clean/react/payments/downgrade/components/downgrade_family_manager_data",["require","exports","tslib","react","spectrum/checkbox/index","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/clean/display_format","metaserver/static/js/modules/constants/trademark","metaserver/static/js/modules/clean/react/payments/downgrade/components/downgrade_helpers","dig-components/icons","dig-components/icons/src","metaserver/static/js/modules/clean/dropbox_form","typescript/component_libraries/family/src/common/features"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DowngradeFamilyManagerData=t.DowngradeFamilyManagerHeader=t.DowngradeFamilyManagerFooter=t.DowngradeFamilyFeatureItem=t.DowngradeFamilyManagerDataView=void 0,s=a.__importDefault(s);class g extends s.default.Component{constructor(){super(...arguments),this.state={disbandFamilyAcknowledged:!1,overQuotaAcknowledged:!1,familySharedFolderAcknowledged:!1},this.handleDisbandFamilyAcknowledgment=e=>{this.setState({disbandFamilyAcknowledged:!this.state.disbandFamilyAcknowledged})},this.handleOverQuotaAcknowledgment=e=>{this.setState({overQuotaAcknowledged:!this.state.overQuotaAcknowledged})},this.handleFamilySharedFolderAcknowledgement=e=>{this.setState({familySharedFolderAcknowledged:!this.state.familySharedFolderAcknowledged})},this.hasFamilySharedFolder=()=>{var e;return!!(null===(e=this.props.familyFeatureFlags)||void 0===e?void 0:e[p.FAMILY_FEATURE_FLAGS.HAS_FAMILY_SHARED_FOLDER])},this.renderFamilyAcknowledgements=()=>{const{freeQuota:e}=this.props,t=this.hasFamilySharedFolder(),{overQuotaAcknowledged:a,disbandFamilyAcknowledged:o,familySharedFolderAcknowledged:d}=this.state;return s.default.createElement("div",null,s.default.createElement("div",{className:"family-payer-disband-downgrade"},s.default.createElement(n.Checkbox,{className:"family-payer-disband-downgrade-check disband-acknowledgement",checked:o?"checked":"unchecked",onChange:this.handleDisbandFamilyAcknowledgment}),s.default.createElement("p",null,i.intl.formatMessage({id:"gMMxaZ",defaultMessage:"You and every member of your {trademark_family} plan will be downgraded to {dropbox_basic}, which only allows up to {free_quota} of storage."},{trademark_family:l.TRADEMARK_FAMILY,dropbox_basic:l.DROPBOX_BASIC,free_quota:r.format_bytes(e,0)}))),s.default.createElement("div",{className:"family-payer-disband-downgrade"},s.default.createElement(n.Checkbox,{className:"family-payer-disband-downgrade-check over-quota-acknowledgement",checked:a?"checked":"unchecked",onChange:this.handleOverQuotaAcknowledgment}),s.default.createElement("p",null,i.intl.formatMessage({id:"Uu4dKU",defaultMessage:"If you or a member of your plan are using more than {free_quota} of storage, you’ll be over-quota. That means your files will stop syncing, you won’t be able to upload any new files or folders, and you won’t be able to restore earlier versions of your files."},{free_quota:r.format_bytes(e,0)}))),t&&s.default.createElement("div",{className:"family-payer-disband-downgrade"},s.default.createElement(n.Checkbox,{checked:d?"checked":"unchecked",className:"family-payer-disband-downgrade-check","data-testid":"family-shared-folder-acknowledgement",onChange:this.handleFamilySharedFolderAcknowledgement}),s.default.createElement("p",null,i.intl.formatMessage({id:"jaE2Yv",defaultMessage:"Your Family Room folder will dissolve. All members will receive a copy of the folder in their Dropbox."}))))}}shouldDisableConfirmDowngradeButton(){return!this.state.overQuotaAcknowledged||!this.state.disbandFamilyAcknowledged||!(!this.hasFamilySharedFolder()||this.state.familySharedFolderAcknowledged)}render(){const e=d.createFamilyFeatureList(this.props.currentPlanSpace,this.props.basicDeviceLimit);return s.default.createElement("div",null,s.default.createElement(t.DowngradeFamilyManagerHeader,{handleChangeMindCTA:this.props.handleChangeMindCTA}),s.default.createElement("div",{className:"section section--features family-payer-benefits-section"},s.default.createElement("h3",{className:"type--title-4"},i.intl.formatMessage({id:"R07Z49",defaultMessage:"Without {dropbox_family}, you’ll lose access to the following:"},{dropbox_family:l.DROPBOX_FAMILY})),s.default.createElement("ul",{className:"features-list family-payer-features-list"},e.map((e,a)=>s.default.createElement(t.DowngradeFamilyFeatureItem,{key:a,featureInfo:e}))),s.default.createElement("div",null,s.default.createElement("p",null,i.intl.formatMessage({id:"I5xM/O",defaultMessage:"If you still want to cancel, please acknowledge the following:"})),this.renderFamilyAcknowledgements())),s.default.createElement(t.DowngradeFamilyManagerFooter,{shouldDisableConfirmDowngradeButton:this.shouldDisableConfirmDowngradeButton(),handleContactSupportCTA:this.props.handleContactSupportCTA,handleChangeMindCTA:this.props.handleChangeMindCTA}))}}t.DowngradeFamilyManagerDataView=g,g.displayName="DowngradeFamilyManagerData",t.DowngradeFamilyFeatureItem=e=>{const{header:t,description:a}=e.featureInfo;return s.default.createElement("li",{className:"features-list__item family-payer-features-list-item"},s.default.createElement(c.UIIcon,{src:u.CloseLine}),s.default.createElement("div",{className:"family-payer-downgrade-feature-description"},t,s.default.createElement("div",{className:"features-list__copy"},a)))},t.DowngradeFamilyFeatureItem.displayName="DowngradeFamilyFeatureItem",t.DowngradeFamilyManagerFooter=e=>{const{handleContactSupportCTA:t,handleChangeMindCTA:a,shouldDisableConfirmDowngradeButton:n}=e,o=[d.downgradePageButtonsMap[d.DowngradeButtonTypes.ContactSupport],d.downgradePageButtonsMap[d.DowngradeButtonTypes.StayWithFamily]];return s.default.createElement("section",{className:"section section--buttons family-payer-section-buttons"},s.default.createElement("div",{className:"section-content"},s.default.createElement("div",{className:"buttons"},o.map(e=>{return s.default.createElement("div",{key:e.type,className:"buttons__item"},s.default.createElement("h3",{className:"type--copy-large"},e.header),s.default.createElement(d.DowngradePageButton,{isPrimaryButton:!0,buttonInfo:e,onClickCTA:(n=e.type,n===d.DowngradeButtonTypes.StayWithFamily?a:t)}));var n}),s.default.createElement("div",{className:"buttons__item downgrade-button"},s.default.createElement("h3",{className:"type--copy-large"},i.intl.formatMessage({id:"FkaCY0",defaultMessage:"I’m sure"})),s.default.createElement(m.DropboxForm,{action:"/downgrade/process",method:"post"},s.default.createElement(d.DowngradeConfirmationButton,{shouldDisableButton:n}))))))},t.DowngradeFamilyManagerFooter.displayName="DowngradeFamilyManagerFooter",t.DowngradeFamilyManagerHeader=e=>s.default.createElement("header",{className:"section section--hero family-payer-header-section"},s.default.createElement("div",{className:"section-content"},s.default.createElement("h1",{className:"type--title-2 type--first type--center"},i.intl.formatMessage({id:"TejRDA",defaultMessage:"Are you sure you want to cancel {dropbox_family}?"},{dropbox_family:l.DROPBOX_FAMILY})),s.default.createElement("h2",{className:"type--copy-standard"},i.intl.formatMessage({id:"Gj7aSc",defaultMessage:"You and your family members will lose access to the plan’s storage and features, and your accounts will be downgraded to {dropbox_basic}."},{dropbox_basic:l.DROPBOX_BASIC,span:e=>s.default.createElement("span",{className:"quota-drop"},e)})),s.default.createElement(d.DowngradePageButton,{isPrimaryButton:!0,buttonInfo:d.downgradePageButtonsMap[d.DowngradeButtonTypes.ChangedMind],onClickCTA:e.handleChangeMindCTA}))),t.DowngradeFamilyManagerHeader.displayName="DowngradeFamilyManagerHeader",t.DowngradeFamilyManagerData=o.requireCssWithComponent(g,["/static/css/pro/pages/downgrade-vfle_vhUD.css"])})),define("metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_billing_modal_loader",["require","exports","tslib","classnames","react","spectrum/button/index","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/clean/react/components/modal","dig-components/modal","dig-components/typography","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/clean/react/payments/unified_module/unified_payment_form_async","metaserver/static/js/modules/clean/subscription/tools/amp_logger","metaserver/static/js/modules/core/uri","metaserver/static/js/modules/core/browser","dig-components/snackbar","dig-components/buttons","dig-components/icons","dig-components/icons/src"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b,v,M,S){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IndividualUpdateBillingModalLoader=void 0,s=a.__importDefault(s),n=a.__importDefault(n),d=a.__importStar(d),u=a.__importStar(u),y=a.__importStar(y);class E extends n.default.Component{constructor(e){super(e),this.state={submitting:!1,open:!0,showRedirectForAutoConvertSnackbar:!1},this.onAccept=()=>{var e,t;this.unifiedPaymentFormAsync&&this.unifiedPaymentFormAsync.onAccept(void 0,this.props.useDeclaratively),l.UserActivityLogger.log("web","update_billing_modal_started",{isNptBillingModal:null===(e=this.state.loadedProps)||void 0===e?void 0:e.showNptBillingModal,project:null===(t=this.state.loadedProps)||void 0===t?void 0:t.trialProjectType})},this.onDismiss=()=>{var e,t;const{useDeclaratively:a,onModalDismiss:s}=this.props;l.UserActivityLogger.log("web","update_billing_modal_cancelled",{isNptBillingModal:null===(e=this.state.loadedProps)||void 0===e?void 0:e.showNptBillingModal,project:null===(t=this.state.loadedProps)||void 0===t?void 0:t.trialProjectType}),a||this.setState(e=>Object.assign(Object.assign({},e),{open:!1})),s&&s()},this.saveUnifiedPaymentFormAsync=e=>{this.unifiedPaymentFormAsync=e},this.setSubmittingStatus=e=>{this.setState(t=>Object.assign(Object.assign({},t),{submitting:e}))},this.onSuccess=()=>{const{useDeclaratively:e,onModalSuccess:t}=this.props;e||this.setState(e=>Object.assign(Object.assign({},e),{open:!1})),t&&t(),this.modalLogger.logModalSuccess()},this.onError=()=>{this.modalLogger.logModalError("modal_submit")},this.closeRedirectForAutoConvertSnackbar=()=>{this.setState({showRedirectForAutoConvertSnackbar:!1})},e.appElement&&m.Modal.setAppElement(e.appElement)}static showInstance(){u.Modal.showInstance(n.default.createElement(t.IndividualUpdateBillingModalLoader,null))}componentDidMount(){this.modalLogger=f.getSubscriptionAMPLogger({ns:"personal",modal:f.ModalTypes.UPDATE_BILLING_MODAL});const e=Date.now();d.WebRequest({url:"/account/unified_payment_view",success:t=>{var a,s;const n=JSON.parse(t),i="auto_convert"===h.URI.parse(y.get_href()).getQuery().reason;this.setState(e=>Object.assign(Object.assign({},e),{loadedProps:{viewModel:n,showNptBillingModal:n.paymentExperiments.showNptBillingModal,trialProjectType:n.paymentExperiments.trialProjectType},showRedirectForAutoConvertSnackbar:i})),l.UserActivityLogger.log("web","update_billing_modal_success",{isNptBillingModal:null===(a=this.state.loadedProps)||void 0===a?void 0:a.showNptBillingModal,project:null===(s=this.state.loadedProps)||void 0===s?void 0:s.trialProjectType});const o=Date.now()-e;this.modalLogger.logModalTTI(o)},error:e=>{const{useDeclaratively:t,onModalDismiss:a}=this.props;o.Notify.error(r.intl.formatMessage({id:"EZm8Rx",defaultMessage:"Failed to load modal."})),l.UserActivityLogger.log("web","update_billing_modal_failure",{request_id:e.getResponseHeader("x-dropbox-request-id"),status:e.status}),this.modalLogger.logModalError("modal_init"),t||this.setState(e=>Object.assign(Object.assign({},e),{open:!1})),a&&a()}})}get modalTitle(){var e;let t=r.intl.formatMessage({id:"OyZpYC",defaultMessage:"Update billing information"});return(null===(e=this.state.loadedProps)||void 0===e?void 0:e.showNptBillingModal)&&(t=r.intl.formatMessage({id:"yacDmF",defaultMessage:"Step 1/2: add your billing info"})),t}get primaryButtonText(){var e;let t=r.intl.formatMessage({id:"vBFpIq",defaultMessage:"Save changes"});return(null===(e=this.state.loadedProps)||void 0===e?void 0:e.showNptBillingModal)&&(t=r.intl.formatMessage({id:"1ZUfS7",defaultMessage:"Next"})),t}renderButtons(){const{loadedProps:e,submitting:t}=this.state;return n.default.createElement(m.Modal.Footer,{hasTopBorder:!0,className:"db-modal-buttons"},n.default.createElement(i.Button,{className:"cancel-button",variant:"secondary",onClick:this.onDismiss},r.intl.formatMessage({id:"whhn4M",defaultMessage:"Cancel"})),n.default.createElement(i.Button,{className:"js-save-button",disabled:!e||t,variant:"primary",onClick:this.onAccept},this.primaryButtonText))}renderContent(){const{loadedProps:e}=this.state;return e?n.default.createElement(_.UnifiedPaymentFormAsync,{isSubmittingStatus:this.setSubmittingStatus,onSuccess:this.onSuccess,ref:this.saveUnifiedPaymentFormAsync,isTeam:!1,preloadedViewModel:e.viewModel,onError:this.onError}):n.default.createElement("div",{className:"loading-spinner"},n.default.createElement("img",{src:g.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:r.intl.formatMessage({id:"oXILe3",defaultMessage:"Loading"})}))}renderRedirectForAutoConvertSnackbar(){return n.default.createElement(b.Snackbar,{open:this.state.showRedirectForAutoConvertSnackbar,timeout:6e3,onRequestClose:this.closeRedirectForAutoConvertSnackbar},n.default.createElement(M.UIIcon,{src:S.WarningLine}),n.default.createElement(b.Snackbar.Message,null,r.intl.formatMessage({id:"SGQt9u",defaultMessage:"Manage your trial billing details on your account page."})),n.default.createElement(b.Snackbar.Actions,null,n.default.createElement(v.Button,{variant:"transparent",inverse:!0,onClick:this.closeRedirectForAutoConvertSnackbar},r.intl.formatMessage({id:"Bs0dLM",defaultMessage:"Got it"}))))}render(){const{useDeclaratively:e}=this.props,t=s.default("update-billing-modal");return n.default.createElement(m.Modal,{open:!!e||this.state.open,isCentered:!0,withCloseButton:r.intl.formatMessage({id:"Pxv2Bf",defaultMessage:"Close"}),overlayClassName:t,onRequestClose:this.onDismiss,shouldCloseOnOverlayClick:!1,onAfterClose:e?void 0:u.Modal.close,modalBaseIndex:1050},n.default.createElement(m.Modal.Header,{hasBottomSpacing:"title-standard"},n.default.createElement(p.Title,{isBold:!1,size:"small"},this.modalTitle)),n.default.createElement(m.Modal.Body,{hasVerticalSpacing:!0},this.renderContent()),this.renderButtons(),this.renderRedirectForAutoConvertSnackbar())}}E.displayName="UpdateBillingModalLoaderView",t.IndividualUpdateBillingModalLoader=c.requireCssWithComponent(E,["/static/css/pro/components/update_billing_modal_individual-vfl7p5pp4.css"])})),define("metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_store_creator",["require","exports","tslib","redux","redux-thunk","metaserver/static/js/modules/clean/redux/unsupported","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/dbmodal_stack","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/react/payments/common/middleware/payments_ux_logger","metaserver/static/js/modules/clean/react/payments/common/form/middleware/middleware","metaserver/static/js/modules/clean/react/payments/common/payments/state/store_creator","metaserver/static/js/modules/clean/react/payments/common/form_value_factory","metaserver/static/js/modules/clean/react/snackbar","metaserver/static/js/modules/clean/top_notif","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/notify"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f){"use strict";function h(e){return e=>a=>{var s;if("SubmitFormSuccess"!==a.type)return e(a);const n=e(a),i=void 0!==a.additionalData&&a.additionalData.showRebillUpsell;return o.ProEventsLogger.log("update_billing_open_save_changes_success"),g.TopNotificationBar.hideById("rebill-bar"),i?(f.Notify.clear(),p.Snackbar.complete(_.intl.formatMessage({id:"jMyZGp",defaultMessage:"Payment method successfully updated."})),r.DBModalStack.trigger(t.BILLING_INFO_UPDATED,{showChangePlanConfirm:!0})):(f.Notify.success(_.intl.formatMessage({id:"p28rXC",defaultMessage:"We’ve successfully updated your account’s billing information."})),(null===(s=a.additionalData)||void 0===s?void 0:s.forDeclarativeModal)||l.Modal.close(),r.DBModalStack.trigger(t.BILLING_INFO_UPDATED,null)),n}}function y(e,t,a){const{vat:s,cpf:n,countryCode:i,userInfo:o}=e,{city:r,address:l,phone:d,name:c,paymentMethod:p,countryCode:g,zipCode:_,vat:f,cpf:h,nonce:y,payPalNonce:b,adyenEncryptedCard:v,encryptedCardForNetworkToken:M,applePayToken:S,bin:E,browserInfo:C,threeDsData:P,accountHolderName:A,iban:T,mandateSigned:w,termsAndService:I,idealBankId:N,idealBankName:L,pan:D,addressNumber:x,addressStreet:j}=u.createPaymentFormData(e,t,a);return{city:r,address:l,phone:d,name:c,paymentMethod:p,countryCode:g,zipCode:_,vat:s?m.FormValueFactory.createVat(s,i):f,cpf:n?m.FormValueFactory.createCpf(n):h,cpfName:m.FormValueFactory.createCpfNamePrefill("","",o.displayName),nonce:y,payPalNonce:b,adyenEncryptedCard:v,encryptedCardForNetworkToken:M,applePayToken:S,bin:E,browserInfo:C,threeDsData:P,accountHolderName:A,iban:T,mandateSigned:w,termsAndService:I,idealBankId:N,idealBankName:L,pan:D,addressStreet:j,addressNumber:x}}Object.defineProperty(t,"__esModule",{value:!0}),t.createFormData=t.createBillingStore=t.submitFormSuccessMiddleware=t.BILLING_INFO_UPDATED=void 0,s=a.__importStar(s),n=a.__importDefault(n),t.BILLING_INFO_UPDATED="billing_info_modal:updated",t.submitFormSuccessMiddleware=h,t.createBillingStore=function(e,t){const a=(function(e){const t=(function(e){const{paymentFormSpec:t}=u.createPaymentPageState(e);return{countryToCurrencyMap:e.countryToCurrencyMap,submitSuccess:!1,submitState:null,submitting:!1,submitSeq:0,paypalEmail:"",requestId:e.requestId,paymentFormSpec:t}})(e),a=(function(e){const{countryCode:t,countryCodeLoading:a,hasCurrencyChanged:s,hasTaxChangedWithinCountry:n,loadingPrices:i,requestToken:o,recentLoadEvent:r}=u.createPaymentPricingState(e);return{countryCode:t,countryCodeLoading:a,hasCurrencyChanged:s,hasTaxChangedWithinCountry:n,loadingPrices:i,requestToken:o,recentLoadEvent:r}})(e);return{pricingState:a,pageState:t,formData:y(e,t,a)}})(e);let o=s.applyMiddleware(n.default,c.submitFormErrorMiddleware,h,new d.PaymentsUXLogger(e.requestId).reduxMiddleware);return i.createStore(t,a,o)},t.createFormData=y})),define("metaserver/static/js/modules/clean/subscription/tools/amp_logger",["require","exports","apex-metrics/index","metaserver/static/js/modules/clean/metrics/index"],(function(e,t,a,s){"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.findInitLoggingErrorSeverity=t.logTabError=t.getSubscriptionAMPLogger=t.SubscriptionAMPLogger=t.ModalTypes=void 0,(function(e){e.PERSONAL="personal_plan_management",e.TEAM="team_plan_management"})(n||(n={})),(function(e){e.SUCCESS="modal_success",e.ERROR="modal_error",e.TTI="modal_tti"})(i||(i={})),(function(e){e.ADDON_MANAGEMENT_MODAL="addon_management_modal",e.CHANGE_LICENSES_MODAL="change_licenses_modal",e.CHANGE_PLAN_MODAL="change_plan_modal",e.CHANGE_PLAN_DUAL_MODAL="change_plan_dual_modal",e.CHANGE_SCHEDULE_MODAL="change_schedule_modal",e.CANCEL_CHANGES_MODAL="cancel_changes_modal",e.CANCEL_SURVEY_MODAL="cancel_survey_modal",e.CANCEL_SUBS_WARNING_MODAL="cancel_subs_warning_modal",e.CONFIRM_CANCEL_MODAL="confirm_cancel_modal",e.UPDATE_BILLING_MODAL="update_billing_modal",e.EDIT_INVOICE_MODAL="edit_invoice_modal",e.BLOCKING_CHANGES_MODAL="blocking_changes_modal",e.SWITCH_CONTRACT_LENGTH_MODAL="switch_contract_length_modal"})(t.ModalTypes||(t.ModalTypes={}));class o{constructor(e){this.namespace="team"===e.ns?n.TEAM:n.PERSONAL,this.modal=e.modal,this.productPlanType=e.productPlanType||"unknown"}logModalTTI(e){s.getMetricsReporter().createStats({ns:this.namespace,name:i.TTI},{modal:this.modal,productType:this.productPlanType}).recordDuration(e,a.TimeUnit.MILLISECONDS)}logModalSuccess(){this.logModalEvent(i.SUCCESS)}logModalError(e,t){this.logModalEvent(i.ERROR,{errorType:e,errorSeverity:t})}setProductPlanType(e){e&&(this.productPlanType=e)}logModalEvent(e,t={}){const a={modal:this.modal,productType:this.productPlanType};t.errorType&&(a.errorType=t.errorType,a.errorSeverity=t.errorSeverity||"critical"),s.getMetricsReporter().createStats({ns:this.namespace,name:e},a).record(1)}}t.SubscriptionAMPLogger=o,t.getSubscriptionAMPLogger=function(e){return new o(e)},t.logTabError=function(e,t,a="unknown"){const i={tab:e,productType:a,errorType:t};s.getMetricsReporter().createStats({ns:n.PERSONAL,name:"account_tab_error"},i).record(1)},t.findInitLoggingErrorSeverity=function(e){return e&&e.responseText&&e.responseText.indexOf("err:")>-1?"noncritical":e&&e.status&&"success"===(e=e).status?"noncritical":"critical"}})),define("metaserver/static/js/modules/clean/teams/admin/lib/billing_history",["require","exports","metaserver/static/js/modules/clean/teams/admin/types/billing_history"],(function(e,t,a){"use strict";function s(e){const t=e.description;return!!t&&(-1!==t.indexOf("Google")||-1!==t.indexOf("Apple")&&-1===t.indexOf("ApplePay"))}Object.defineProperty(t,"__esModule",{value:!0}),t.getHistoryData=t.SelectedYearTypes=void 0,t.SelectedYearTypes={ALL_TIME:"all-time",YEAR_TO_DATE:"year-to-date"},t.getHistoryData=function(e,n=t.SelectedYearTypes.ALL_TIME){let i=(function(e){const t=[];for(let i=0;i-1)})}var n;return t})(e);const o=(new Date).getFullYear().toString();return n===t.SelectedYearTypes.ALL_TIME||(i=n===t.SelectedYearTypes.YEAR_TO_DATE?i.filter(e=>e.payment?-1!==e.payment.date.indexOf(o):!!e.invoice&&-1!==e.invoice.date.indexOf(o)):i.filter(e=>e.payment?-1!==e.payment.date.indexOf(n):!!e.invoice&&-1!==e.invoice.date.indexOf(n))),i=i.filter(e=>e.invoice&&null!==e.invoice.description||e.payment&&null!==e.payment.description),i}})),define("metaserver/static/js/modules/clean/teams/admin/types/billing_history",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingRowType=void 0,(function(e){e[e.Invoice=0]="Invoice",e[e.Payment=1]="Payment",e[e.Legacy=2]="Legacy"})(t.BillingRowType||(t.BillingRowType={}))})),define("metaserver/static/js/modules/clean/teams/admin/types/constants",["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TeamBillingErrorType=void 0,(function(e){e[e.SUBSCRIPTION_EXPIRED=100]="SUBSCRIPTION_EXPIRED",e[e.UNSUPPORTED_BROWSER=200]="UNSUPPORTED_BROWSER"})(t.TeamBillingErrorType||(t.TeamBillingErrorType={}))})),define("metaserver/static/js/modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list",["require","exports","tslib","react","metaserver/static/js/modules/clean/react/components/css"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdminPricedList=void 0,s=a.__importDefault(s);class i extends s.default.Component{render(){return s.default.createElement("div",{className:"admin-priced-list"},s.default.createElement("div",null,this.props.children))}}i.displayName="AdminPricedListView",t.AdminPricedList=n.requireCssWithComponent(i,["/static/css/teams/admin/widgets/admin_priced_list/admin_priced_list-vfl4n4jXj.css"])})),define("metaserver/static/js/modules/clean/teams/admin/widgets/admin_priced_list/admin_priced_list_item",["require","exports","tslib","react","classnames","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/badge","metaserver/static/js/modules/clean/account_page/widgets/plan/views/loading_view"],(function(e,t,a,s,n,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AdminPricedListItem=void 0,s=a.__importDefault(s),n=a.__importDefault(n);class l extends s.default.Component{constructor(){super(...arguments),this.onChange=()=>{}}renderTitleWarningText(){const{titleWarningText:e}=this.props;if(e)return s.default.createElement("span",{className:"admin-priced-list-item__content_title_warning"}," ",e)}renderTitleSecondaryText(){const{titleSecondaryText:e}=this.props;if(e)return s.default.createElement("span",{className:"admin-priced-list-item__content_title_secondary"}," ",e)}renderRecommendedSign(){const{titleSecondaryText:e,titleWarningText:t,recommended:a}=this.props;if(!e&&!t&&a)return s.default.createElement("div",{className:"admin-priced-list-item__content_title_recommended"},i.intl.formatMessage({id:"430h7a",defaultMessage:"RECOMMENDED"}))}renderEffectiveDate(){const{price:e,priceString:t,effectiveDate:a}=this.props;if(!e&&!t)return s.default.createElement("div",{className:"admin-priced-list-item__content_title_effective_date"},a)}getClickHandler(){if(!this.props.disableItem)return this.props.onClick}render(){const{description:e,price:t,title:a,unit:i,detailsLink:l,disableItem:d,effectiveDate:c,loadingPrice:u}=this.props,m=this.props.className?this.props.className:"";let p,g;u||(this.props.priceString?(p=this.props.priceString,g=i):t?(p=t.toString(),g=i):(p=c?"":"-",g=""));const _=n.default({"admin-priced-list-item":!0,active:!0===this.props.isSelected,[m]:!0,disabled:d});return s.default.createElement("div",{className:_,onClick:this.getClickHandler()},s.default.createElement("div",{className:"admin-priced-list-item__content"},s.default.createElement("div",{className:"admin-priced-list-item__content_title"},s.default.createElement("input",{type:"radio",checked:this.props.isSelected,onChange:this.onChange,disabled:this.props.disableItem}),s.default.createElement("h1",{className:"admin-priced-list-item__content_title_text"},a,this.props.badge&&s.default.createElement(o.Badge,Object.assign({},this.props.badge)),this.renderTitleWarningText(),this.renderTitleSecondaryText()),this.renderRecommendedSign(),this.renderEffectiveDate()),s.default.createElement("div",{className:"admin-priced-list-item__content_description u-font-meta"},e,l)),u?s.default.createElement(r.LoadingView,null):p&&s.default.createElement("div",{className:"admin-priced-list-item__pricing"},s.default.createElement("div",{className:"admin-priced-list-item__pricing_price"},p),s.default.createElement("div",{className:"admin-priced-list-item__pricing_unit"},g)))}}t.AdminPricedListItem=l,l.displayName="AdminPricedListItem"})),define("metaserver/static/js/modules/clean/teams/admin/widgets/billing_history/billing_history_row",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/payments/edit_invoice_address_modal/edit_invoice_address_modal_loader","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/react/tooltip","metaserver/static/js/modules/clean/react/sprite","dig-components/buttons"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingHistoryTableRow=void 0,s=a.__importDefault(s);class c extends s.default.Component{constructor(){super(...arguments),this.onEdit=()=>{const{row:e,isTeam:t}=this.props;e.invoice&&i.EditInvoiceAddressModalLoader.showInstance(e.invoice,t)},this.logReceiptLinkClick=()=>{this.props.logAccountBillingTabEvents&&o.ProEventsLogger.log("de_billing_tab_receipt_link_click")},this.logInvoiceLinkClick=()=>{this.props.logAccountBillingTabEvents&&o.ProEventsLogger.log("de_billing_tab_invoice_link_click")}}renderDate(){const{invoice:e,payment:t}=this.props.row;return e&&e.date?e.date:t&&t.date?t.date:null}renderDescription(){const{invoice:e,payment:t,isMobile:a}=this.props.row;let i=null,o=null;return e&&e.description?i=e.description:t&&t.description&&(i=t.description),a&&e&&e.description&&t&&t.description&&(i=`${t.description} | ${e.description}`),(e&&e.isVoided||t&&t.isVoided)&&(o=s.default.createElement("span",null," (",n.intl.formatMessage({id:"Raqf73",defaultMessage:"Voided"}),")")),s.default.createElement("div",null,s.default.createElement("p",{className:"description-line"},s.default.createElement("span",null,i),o))}renderLinks(){let e=[];if(!0===this.props.renderPublicLinks)e=this.renderInvoiceAndReceiptLink(this.props.publicInvoiceLink,this.props.publicReceiptLink);else{const{row:t,showEditInvoiceModal:a,canEditBilling:i}=this.props,{invoice:o,payment:r}=t;let l="",c="";o&&o.link&&(l=o.link),!t.isMobile&&r&&r.link&&(c=r.link),e=this.renderInvoiceAndReceiptLink(l,c),a&&o&&!o.isOpen&&o.isEditable&&i&&e.push(s.default.createElement(d.Button,{variant:"transparent",key:"edit-link",className:"button-as-link",onClick:this.onEdit},n.intl.formatMessage({id:"UwFkjc",defaultMessage:"Edit"}))),e.length||(o&&o.infoTooltip?e.push(this.renderInfoTooltip(o)):r&&r.infoTooltip&&e.push(this.renderInfoTooltip(r)))}return e.length?s.default.createElement("span",null,e):null}renderInvoiceAndReceiptLink(e,t){const a=[];return e&&a.push(s.default.createElement("a",{key:"invoice-link",className:"account-page__link",href:e,target:"_blank",rel:"noopener noreferrer",onClick:this.logInvoiceLinkClick},n.intl.formatMessage({id:"+fOIGM",defaultMessage:"Invoice"}))),t&&a.push(s.default.createElement("a",{key:"payment-link",className:"account-page__link",href:t,target:"_blank",rel:"noopener noreferrer",onClick:this.logReceiptLinkClick},n.intl.formatMessage({id:"9s47b8",defaultMessage:"Receipt"}))),a}renderInfoTooltip(e){return s.default.createElement(r.Tooltip,{position:r.TooltipPosition.TOP,tooltip_contents:e.infoTooltip},s.default.createElement(l.Sprite,{group:"teams",name:"info_active",alt:"",className:"info-sprite"}))}renderPrice(){const{invoice:e,payment:t,isMobile:a}=this.props.row;if(a)return null;let n=null;return e&&t?n=e.isVoided||t.isVoided?s.default.createElement("span",{className:"row-content__price--line-through"},e.billed):e.billed:t?n=t.paid:e&&(n=e.billed),n}render(){const{row:e}=this.props;return e.invoice||e.payment?s.default.createElement("tr",{className:"row-content","data-variant":!0},s.default.createElement("td",{className:"row-content__date"},this.renderDate()),s.default.createElement("td",{className:"row-content__description"},this.renderDescription()),s.default.createElement("td",{className:"row-content__links"},this.renderLinks()),s.default.createElement("td",{className:"row-content__price"},this.renderPrice())):null}}c.defaultProps={canEditBilling:!0},c.displayName="BillingHistoryTableRowComponent",t.BillingHistoryTableRow=c})),define("metaserver/static/js/modules/clean/teams/admin/widgets/billing_history/billing_history_table",["require","exports","tslib","react","styled-components","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/teams/admin/widgets/billing_history/billing_history_row","metaserver/static/js/modules/clean/account_page/widgets/billing/billing_history/types","dig-components/menu","dig-components/buttons"],(function(e,t,a,s,n,i,o,r,l,d){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingHistoryTable=void 0,s=a.__importDefault(s);const c=(n=a.__importDefault(n)).default.div` .billing-table-container { border-radius: 0; border: 1px solid var(--color__faint__border); .billing-history-table { width: 100%; border-collapse: collapse; .row-header { background-color: var(--color__faint__background); padding: var(--spacing__unit--2) 0; color: var(--color__faint__text); font-size: var(--type__body__standard--fontsize); height: auto; font-weight: normal; } .caret { vertical-align: middle; } .date-header-cell { font-weight: normal; text-align: left; color: var(--color__faint__text); } .date-row { padding-left: var(--spacing__unit--2); padding-right: var(--spacing__unit--3); width: 80px; font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); } .desc-row { font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); } .price-row { padding-left: var(--spacing__unit--3); padding-right: var(--spacing__unit--2); width: 100px; font-weight: normal; text-align: left; font-size: var(--type__body__small--fontsize); color: var(--color__faint__text); } .row-content { height: 56px; border-top: 1px solid var(--color__faint__border); color: var(--color__standard__text); &__links { white-space: nowrap; padding: var(--spacing__base_unit); text-align: right; a, button { &:not(:first-child) { margin-left: var(--spacing__base_unit); } &:not(:first-child):before { content: none; } } } } .row-content__date { padding-left: var(--spacing__unit--2); padding-right: var(--spacing__unit--3); width: 80px; text-align: left; color: var(--color__standard__text); } .row-content__description { color: var(--color__standard__text); .description-line { margin: 0; } } .row-content__price { padding-left: var(--spacing__unit--3); padding-right: var(--spacing__unit--2); width: 100px; text-align: left; color: var(--color__standard__text); } .billing-history-row { border-top: 1px solid var(--color__faint__border); } .billing-history-col { text-align: center; height: ver(--spacing__unit--5); } .account-page__link { color: inherit; padding-bottom: var(--spacing__unit--0_5); border-bottom: 1px solid var(--color__standard__border); font-weight: var(--type__body__standard--fontweight_strong); &:hover { border-bottom: 1px solid var(--color__standard__text); } } } } `;class u extends s.default.Component{buildFooterIfNecessary(){if(null!==this.props.footer)return s.default.createElement("tfoot",{className:"row-footer"},this.props.footer)}buildHeaderDate(){return s.default.createElement("th",{className:"row-header date-row"},s.default.createElement(l.Menu.Wrapper,{onSelection:this.props.onSelection},({getContentProps:e,getTriggerProps:t})=>s.default.createElement(s.default.Fragment,null,s.default.createElement(d.Button,Object.assign({className:"date-header-cell"},t(),{variant:"transparent",withDropdownIcon:!0,hasNoUnderline:!0}),i.intl.formatMessage({id:"65pLwc",defaultMessage:"Date"})),s.default.createElement(l.Menu.Content,Object.assign({},e()),s.default.createElement(l.Menu.Segment,{withLabel:i.intl.formatMessage({id:"HXV3TA",defaultMessage:"Order"})},s.default.createElement(l.Menu.SelectItem,{value:r.BillingHistoryOrder.ASCENDING,selected:r.BillingHistoryOrder.ASCENDING===this.props.order},i.intl.formatMessage({id:"KyJseU",defaultMessage:"Ascending"})),s.default.createElement(l.Menu.SelectItem,{value:r.BillingHistoryOrder.DESCENDING,selected:r.BillingHistoryOrder.DESCENDING===this.props.order},i.intl.formatMessage({id:"Njd630",defaultMessage:"Descending"}))),s.default.createElement(l.Menu.Segment,{withLabel:i.intl.formatMessage({id:"2X0e4z",defaultMessage:"Show"})},s.default.createElement(l.Menu.SelectItem,{value:"all_time",selected:"all_time"===this.props.filter},i.intl.formatMessage({id:"261J2J",defaultMessage:"All time"})),s.default.createElement(l.Menu.SelectItem,{value:"year_to_date",selected:"year_to_date"===this.props.filter},i.intl.formatMessage({id:"EqTfoU",defaultMessage:"Year-to-date"})),this.renderMenuItems())))))}renderMenuItems(){const e=[],{filters:t,filter:a}=this.props;return t&&t.forEach(t=>{e.push(s.default.createElement(l.Menu.SelectItem,{key:t,value:t,selected:t===a},t))}),e}render(){const{amountLabel:e,canEditBilling:t,displayNoTransactionsOnEmptyRecords:a,showEditInvoiceModal:n,logAccountBillingTabEvents:r,isTeam:l,renderPublicLinks:d,publicInvoiceLink:u,publicReceiptLink:m}=this.props,p=this.props.billingHistoryRecords,g=e||i.intl.formatMessage({id:"PoJI4y",defaultMessage:"Price"});let _;if(a&&0===p.length){const e=this.props.noTransactionLabel?this.props.noTransactionLabel:i.intl.formatMessage({id:"SNLY2j",defaultMessage:"No transactions"});_=s.default.createElement("tr",{className:"row-content"},s.default.createElement("td",{className:"row-content__date"}),s.default.createElement("td",{className:"row-content__description"},e),s.default.createElement("td",{className:"row-content__links"}),s.default.createElement("td",{className:"row-content__price"}))}return s.default.createElement(c,null,s.default.createElement("div",{className:"billing-table-container"},s.default.createElement("table",{className:"billing-history-table",cellSpacing:"0"},s.default.createElement("thead",null,s.default.createElement("tr",null,this.buildHeaderDate(),s.default.createElement("th",{className:"row-header desc-row u-font-meta",colSpan:2},i.intl.formatMessage({id:"VfjryA",defaultMessage:"Description"})),s.default.createElement("th",{className:"row-header price-row u-font-meta"},g))),this.buildFooterIfNecessary(),s.default.createElement("tbody",null,_,p.map((function(e,a){return s.default.createElement(o.BillingHistoryTableRow,{canEditBilling:t,isTeam:l,key:e.id,logAccountBillingTabEvents:r,renderPublicLinks:d,publicInvoiceLink:u,publicReceiptLink:m,row:e,showEditInvoiceModal:n})}))))))}}u.defaultProps={onSelection:()=>{}},u.displayName="BillingHistoryTableComponent",t.BillingHistoryTable=u})),define("metaserver/static/js/modules/clean/teams/admin/widgets/billing_notifications/cancellable_item",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","classnames","dig-components/buttons"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CancellableItemView=void 0,s=a.__importDefault(s),i=a.__importDefault(i);class r extends s.default.Component{render(){const{title:e,description:t,handleAction:a,useCTA:n,CTAText:r}=this.props,l=this.props.className?this.props.className:"",d=i.default("cancellable-item__title",{"cancellable-item__title--alternate":this.props.useAlternateStyle}),c=i.default({"cancellable-item__button":!0,"link-button":!0,"link-button--alternate":this.props.useAlternateStyle,[l]:!0});let u;return n&&(u=s.default.createElement(o.Button,{variant:"transparent",className:c,onClick:a},r)),s.default.createElement("div",{className:"cancellable-item"},s.default.createElement("span",{className:d},e)," ",s.default.createElement("span",{className:"cancellable-item__desc"},t),u)}}t.CancellableItemView=r,r.defaultProps={CTAText:n.intl.formatMessage({id:"7kgsyk",defaultMessage:"Cancel change"}),useCTA:!1},r.displayName="CancellableItemView"})),define("metaserver/static/js/modules/clean/teams/admin/widgets/update_billing_modal/update_billing_modal_loader",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/clean/react/components/css","metaserver/static/js/modules/clean/payments/validation","metaserver/static/js/modules/constants/trademark","metaserver/static/js/modules/clean/teams/admin/types/constants","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/react/payments/unified_module/unified_payment_form_async","metaserver/static/js/modules/clean/react/payments/error/browser_update_required_modal","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/subscription/tools/amp_logger","dig-components/buttons","dig-components/typography"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UpdateBillingModalLoader=t.RenewSubscriptionContent=t.UpdateBillingButtons=t.BillingDisclaimer=t.UpdateBillingContent=t.SubscriptionExpiredButtons=t.SubscriptionExpiredContent=t.UpdateBillingModalLoaderView=void 0,s=a.__importDefault(s),i=a.__importStar(i);class h extends s.default.Component{constructor(){super(...arguments),this.state={isLoading:!0,submitting:!1,hasError:!1,loadedProps:void 0},this.handleLoadFailure=()=>{p.Notify.error(n.intl.formatMessage({id:"2SDgBc",defaultMessage:"Failed to load modal."})),this.modalLogger.logModalError("modal_init"),c.Modal.close(),this.props.onClose&&this.props.onClose()},this.logModalLoaded=()=>{if(this.startTime){const e=Date.now()-this.startTime;this.modalLogger.logModalTTI(e)}},this.onSave=()=>{this.unifiedPaymentFormAsync&&this.unifiedPaymentFormAsync.onAccept()},this.onDismiss=()=>{c.Modal.close(),this.props.onClose&&this.props.onClose()},this.onSuccess=()=>{this.props.onSuccess&&this.props.onSuccess(),this.modalLogger.logModalSuccess()},this.onError=()=>{this.modalLogger.logModalError("modal_submit")},this.saveUnifiedPaymentFormAsync=e=>{this.unifiedPaymentFormAsync=e},this.setSubmittingStatus=e=>{this.setState(t=>Object.assign(Object.assign({},t),{submitting:e}))}}static showInstance(e,a){c.Modal.showInstance(s.default.createElement(t.UpdateBillingModalLoader,{onClose:e,onSuccess:a}))}componentDidMount(){this.startTime=Date.now(),this.modalLogger=g.getSubscriptionAMPLogger({ns:"team",modal:g.ModalTypes.UPDATE_BILLING_MODAL}),i.WebRequest({url:"/account/team/update_billing_modal_view_model",success:e=>{const t=JSON.parse(e),{isError:a,errorType:s,countryCode:n,useNewRenewExperience:i,subscriptionData:o}=t;if(a)if(s===d.TeamBillingErrorType.SUBSCRIPTION_EXPIRED){const e={hasError:!0,errorType:s,isLoading:!1};i&&o?this.setState(Object.assign(Object.assign({},e),{loadedProps:{countryCode:n,subscriptionData:o,useNewRenewExperience:i}})):this.setState(Object.assign({},e))}else s===d.TeamBillingErrorType.UNSUPPORTED_BROWSER?(this.handleLoadFailure(),m.BrowserUpdateModalLoader.showInstance()):this.handleLoadFailure();else this.setState({hasError:!1,isLoading:!1,loadedProps:{countryCode:n}},this.logModalLoaded)},error:this.handleLoadFailure})}get modalComponents(){const{hasError:e,errorType:a,submitting:i,loadedProps:o,isLoading:r}=this.state;return r?[n.intl.formatMessage({id:"58BoNM",defaultMessage:"Loading..."}),null,s.default.createElement(c.ModalButtons,{key:"loading-modal-buttons",className:"oq-modal__buttons"},s.default.createElement(_.Button,{variant:"primary",isLoading:!0},n.intl.formatMessage({id:"b3WASj",defaultMessage:"Loading..."})))]:e&&a===d.TeamBillingErrorType.SUBSCRIPTION_EXPIRED?o&&o.useNewRenewExperience&&o.subscriptionData?[n.intl.formatMessage({id:"E44+fA",defaultMessage:"Renew subscription"}),s.default.createElement(t.RenewSubscriptionContent,{key:"renew-subscription-modal-content",setSubmittingStatus:this.setSubmittingStatus,saveUnifiedPaymentFormAsync:this.saveUnifiedPaymentFormAsync,onSuccess:this.onSuccess,onError:this.onError,subscriptionData:o.subscriptionData}),s.default.createElement(t.UpdateBillingButtons,{key:"renew-subscription-modal-buttons",submitting:i,loadedProps:o,hasError:e,onCancel:this.onDismiss,onSave:this.onSave,isTeamRenew:!0})]:[null,s.default.createElement(t.SubscriptionExpiredContent,{key:"subscription-expired-modal-content"}),s.default.createElement(t.SubscriptionExpiredButtons,{key:"subscription-expired-modal-buttons"})]:[n.intl.formatMessage({id:"9Sg95d",defaultMessage:"Update billing information"}),s.default.createElement(t.UpdateBillingContent,{key:"update-billing-modal-content",setSubmittingStatus:this.setSubmittingStatus,saveUnifiedPaymentFormAsync:this.saveUnifiedPaymentFormAsync,onSuccess:this.onSuccess,onError:this.onError}),s.default.createElement(t.UpdateBillingButtons,{key:"update-billing-modal-buttons",submitting:i,loadedProps:o,hasError:e,onCancel:this.onDismiss,onSave:this.onSave,isTeamRenew:!1})]}render(){const[e,t,a]=this.modalComponents;return s.default.createElement(c.Modal,{className:"update-billing-modal update-billing-modal-maestro",autoClose:!1,buttonComponent:a,title:e,onDismiss:this.props.onClose},s.default.createElement("div",{className:"dynamic-content"},t))}}t.UpdateBillingModalLoaderView=h,h.displayName="UpdateBillingModalLoaderView",t.SubscriptionExpiredContent=()=>s.default.createElement("div",{className:"subscription-expired"},s.default.createElement("h3",{className:"subscription-expired--header"},n.intl.formatMessage({id:"j2f1b7",defaultMessage:"Your subscription has expired"})),s.default.createElement("div",{className:"subscription-expired--copy"},n.intl.formatMessage({id:"Az4Zv4",defaultMessage:"To change your billing information, please first renew your {trademark_business} account. During the renewal process you'll be able to choose a different payment method."},{trademark_business:l.TRADEMARK_BUSINESS}))),t.SubscriptionExpiredContent.displayName="SubscriptionExpiredContent",t.SubscriptionExpiredButtons=()=>s.default.createElement("div",{className:"subscription-expired--buttons"},s.default.createElement("a",{href:"/team/renew",className:"subscription-expired--button c-btn c-btn--primary"},n.intl.formatMessage({id:"4GySWu",defaultMessage:"Renew Your Account"}))),t.SubscriptionExpiredButtons.displayName="SubscriptionExpiredButtons",t.UpdateBillingContent=({setSubmittingStatus:e,saveUnifiedPaymentFormAsync:t,onSuccess:a,onError:n})=>s.default.createElement(u.UnifiedPaymentFormAsync,{ref:t,isSubmittingStatus:e,onSuccess:a,onError:n,isTeam:!0,requireTOS:!1}),t.UpdateBillingContent.displayName="UpdateBillingContent",t.BillingDisclaimer=({countryCode:e})=>{if(!e)return null;const t=n.intl.formatMessage({id:"pd1g0O",defaultMessage:"Please note: changing your billing location or VAT number could impact your applicable tax rate."}),a=n.intl.formatMessage({id:"sOdAwa",defaultMessage:"Please note: changing your billing location could impact your applicable tax rate."}),i=r.hasVat(e)?t:a;return s.default.createElement("div",{className:"db-modal-lower-left-message"},i)},t.BillingDisclaimer.displayName="BillingDisclaimer",t.UpdateBillingButtons=({submitting:e,loadedProps:a,hasError:i,onCancel:o,onSave:r,isTeamRenew:l})=>{const d=n.intl.formatMessage({id:"yZHDVO",defaultMessage:"Renew now"}),u=n.intl.formatMessage({id:"XWGH7B",defaultMessage:"Save changes"});return s.default.createElement(c.ModalButtons,{className:"oq-modal__buttons"},a&&s.default.createElement(t.BillingDisclaimer,{countryCode:a.countryCode}),s.default.createElement(_.Button,{className:"cancel-button",variant:"opacity",onClick:o},n.intl.formatMessage({id:"euRey+",defaultMessage:"Cancel"})),s.default.createElement(_.Button,{className:"save-button",isLoading:!a||e||i&&!l,variant:"primary",onClick:r},l?d:u))},t.UpdateBillingButtons.displayName="UpdateBillingButtons",t.RenewSubscriptionContent=({saveUnifiedPaymentFormAsync:e,setSubmittingStatus:t,onSuccess:a,onError:i,subscriptionData:o})=>{const{dropboxPlanName:r,billingScheduleName:l,totalLicenses:d,totalAmount:c}=o,m=n.intl.formatMessage({id:"fAeo52",defaultMessage:"{plan_name} - {billing_schedule} subscription for {total_licenses} licenses"},{plan_name:r,billing_schedule:l,total_licenses:d}),p=n.intl.formatMessage({id:"1sN37s",defaultMessage:"Bill now {total_amount}"},{total_amount:c});return s.default.createElement("div",{className:"renew_subscription_modal_content"},s.default.createElement("div",{className:"banner"},s.default.createElement(f.Text,{tagName:"div",isBold:!0},m),s.default.createElement(f.Text,{tagName:"div"},p)),s.default.createElement(u.UnifiedPaymentFormAsync,{ref:e,isSubmittingStatus:t,onSuccess:a,onError:i,isTeam:!0,requireTOS:!0}))},t.RenewSubscriptionContent.displayName="RenewSubscriptionContent",t.UpdateBillingModalLoader=o.requireCssWithComponent(h,["/static/css/teams/admin/widgets/update_billing_modal/update_billing_modal-vflXcftha.css"])})),define("metaserver/static/js/modules/clean/react/growth/trials/requests",["require","exports","tslib","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/growth/logging_util","metaserver/static/js/modules/clean/react/growth/trials/util","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/react/growth/trials/types","metaserver/static/js/modules/clean/react/snackbar","metaserver/static/js/api_v2/user_client"],(function(e,t,a,s,n,i,o,r,l,d,c){"use strict";function u(e,t,a,s,o,l){const c=s||n.intl.formatMessage({id:"bLA3rA",defaultMessage:"There was a problem completing this request."});i.logAjaxError(e,t,a,{errorMessage:c}),r.Notify.error(c),l&&d.Snackbar.close(l),o&&o()}function m(e,t,a,s,n){i.logAjaxSuccess(e,t,a),s&&(n?s(n):s())}function p(e,t,s,o,r,l){return a.__awaiter(this,void 0,void 0,(function*(){const a="cancel-trial-notification";d.Snackbar.sync(n.intl.formatMessage({id:"jXr05+",defaultMessage:"Canceling trial..."}),!1,a);const p=()=>{d.Snackbar.complete(n.intl.formatMessage({id:"RBkBP9",defaultMessage:"You’ve successfully canceled your trial."}),a),r&&r()};try{const n=new c.UserApiV2Client,r={trial_sku_code:s,trial_project_type:e},d=yield n.ns("trials").rpc("cancel",r,{subjectUserId:o});d&&"ok"===d.status?m(e,t,i.RequestType.CANCEL_TRIAL,p):u(e,t,i.RequestType.CANCEL_TRIAL,void 0,l,a)}catch(s){u(e,t,i.RequestType.CANCEL_TRIAL,(e=>{if(e.error&&"not_in_trial"===e.error[".tag"])return n.intl.formatMessage({id:"Ui1I/f",defaultMessage:"You’ve already canceled your trial."})})(s),l,a)}}))}function g(e,t,a,o){const r="cancel-trial-notification";d.Snackbar.sync(n.intl.formatMessage({id:"jXr05+",defaultMessage:"Canceling trial..."}),!1,r);const l=i.RequestType.CANCEL_TRIAL,c=()=>{d.Snackbar.complete(n.intl.formatMessage({id:"RBkBP9",defaultMessage:"You’ve successfully canceled your trial."}),r),a&&a()};s.WebRequest({url:"/downgrade/process",data:{trial_project_type:e},success:()=>m(e,t,l,c),error:(a,s,n)=>u(e,t,l,n,o,r)})}Object.defineProperty(t,"__esModule",{value:!0}),t.enableAutoConvert=t.getPriceConversionsForSchedule=t.transitionPlan=t.cancelTransitionTrial=t.cancelPlatformTrial=t.cancelTrial=void 0,s=a.__importStar(s),t.cancelTrial=function(e,t,a,s,n,i,o){return s===l.TrialSource.TRANSITIONS_TRIAL?g(e,t,i,o):s===l.TrialSource.PLATFORM_TRIAL?p(e,t,a,n,i,o):null},t.cancelPlatformTrial=p,t.cancelTransitionTrial=g,t.transitionPlan=function(e,t,a,n,r,l){const d=i.RequestType.TRANSITION_PLAN,c=o.getTransitionChangeType(e);c?s.WebRequest({type:"POST",url:"/account/perform_personal_transition",data:{transition_change_type:c},subject_user:t,success:()=>m(a,n,d,r),error:(e,t,s)=>u(a,n,d,s,l)}):u(a,n,d)},t.getPriceConversionsForSchedule=function(e,t,s,n,o,r){return a.__awaiter(this,void 0,void 0,(function*(){const a=i.RequestType.GET_PRICE_CONVERSIONS_FOR_SCHEDULE;try{const i=new c.UserApiV2Client,l=yield i.ns("trials").rpc("get_price_conversions_for_schedule",n,{subjectUserId:e});l?m(t,s,a,o,l):u(t,s,a,void 0,r)}catch(e){u(t,s,a,void 0,r)}}))},t.enableAutoConvert=function(e,t,s,n,o,r){return a.__awaiter(this,void 0,void 0,(function*(){const a=i.RequestType.ENABLE_AUTO_CONVERT;try{const i=new c.UserApiV2Client,l=yield i.ns("trials").rpc("enable_auto_convert",n,{subjectUserId:e});l&&"ok"===l.status?m(t,s,a,o,l):u(t,s,a,void 0,r)}catch(e){u(t,s,a,void 0,r)}}))}})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_actions/unified_submit_action",["require","exports","tslib","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/react/payments/common/form/actions/actions","metaserver/static/js/modules/clean/react/payments/unified_module/unified_data_export"],(function(e,t,a,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.submitUnifiedForm=void 0,s=a.__importStar(s),t.submitUnifiedForm=function(e,t,a,o={}){return(r,l)=>{const d=l(),c=d.formData.countryCode.formattedValue,u=d.pageState.paymentFormSpec,m=d.formData.paymentMethod.formattedValue,p=i.getPaymentFieldNamesToSubmit(c,u,m);let g;o.payment_method=d.formData.paymentMethod.formattedValue,o.request_id=d.pageState.requestId,o.submit_seq=d.pageState.submitSeq,g=d.pageState.paymentFormSpec.isTeam()?m===s.PaymentMethod.CreditCard?"/team/payments/ajax_update_billing_credit_card":m===s.PaymentMethod.DirectDeposit?"/team/payments/ajax_update_billing_direct_debit":"/team/payments/ajax_update_billing_paypal":m===s.PaymentMethod.CreditCard||m===s.PaymentMethod.DlocalRBI?"/update_credit_card_billing_info_ajax":m===s.PaymentMethod.DirectDeposit?"/update_direct_debit_billing_info_ajax":m===s.PaymentMethod.Ideal?"/update_ideal_billing_info_ajax":"/paypal_billing_info",r(n.submitForm(g,p,e,o,void 0,t,a))}}})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_actions/unified_store",["require","exports","tslib","redux","metaserver/static/js/modules/clean/react/payments/common/form/actions/actions","metaserver/static/js/modules/clean/react/payments/update_team_billing/update_team_actions","metaserver/static/js/modules/clean/react/payments/buy/actions/page_actions","metaserver/static/js/modules/clean/react/payments/unified_module/unified_actions/unified_submit_action","metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/apple_pay"],(function(e,t,a,s,n,i,o,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bindUnifiedBillingActions=void 0,s=a.__importStar(s),n=a.__importStar(n),i=a.__importStar(i),o=a.__importStar(o),r=a.__importStar(r),t.bindUnifiedBillingActions=function(e){return s.bindActionCreators({applePayAction:l.applePayAction,updateHistory:o.updateHistory,showFormFieldErrors:n.showFormFieldErrors,submitBillingForm:r.submitUnifiedForm,updatePaymentMethod:n.updatePaymentMethod,updateCountryCode:i.updateBillingCountryCode,updateZipCode:n.updateZipCode,updateVat:n.updateVat,updateCpf:n.updateCpf,updateCpfName:n.updateCpfName,updateNonce:n.updateNonce,updatePayPalNonce:n.updatePayPalNonce,updateAdyenEncryptedCard:n.updateAdyenEncryptedCard,updateEncryptedCardForNetworkToken:n.updateEncryptedCardForNetworkToken,updateApplePayToken:n.updateApplePayToken,updateBrowserInfo:n.updateBrowserInfo,updateThreeDsData:n.updateThreeDsData,triggerThreeDsChallenge:n.triggerThreeDsChallenge,triggerThreeDsFingerprint:n.triggerThreeDsFingerprint,updateBIN:n.updateBIN,updateAccountHolderName:n.updateAccountHolderName,updateIBAN:n.updateIBAN,updateMandateSigned:n.updateMandateSigned,updateTermsAndService:n.updateTermsAndService,updateIdealBank:n.updateIdealBank,blurCCField:n.blurCCField,blurZipCode:n.blurZipCode,blurVat:n.blurVat,blurCpf:n.blurCpf,blurAccountHolderName:n.blurAccountHolderName,blurIBAN:n.blurIBAN,updateName:n.updateName,blurName:n.blurName,updatePan:n.updatePan,blurPan:n.blurPan,updateAddressStreet:n.updateAddressStreet,blurAddressStreet:n.blurAddressStreet,updateAddressNumber:n.updateAddressNumber,blurAddressNumber:n.blurAddressNumber},e.dispatch)}})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_cpf_field",["require","exports","tslib","react","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_text_input_field","metaserver/static/js/modules/clean/react/payments/common/form_value_helpers","metaserver/static/js/modules/core/i18n"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedCPFField=void 0,s=a.__importDefault(s);class r extends s.default.Component{constructor(){super(...arguments),this.onCpfChange=e=>{this.props.actions.updateCpf(e.value)},this.onCpfNameChange=e=>{this.props.actions.updateCpfName(e.value)}}cpfErrorString(){const e=this.props.formData.cpf;return!i.FormValueHelper.isValid(e)&&e.showError?o.intl.formatMessage({id:"MQDRWx",defaultMessage:"Please enter a valid CPF number."}):""}render(){const{paymentSpec:e,formData:t}=this.props;let a=null;return e.should_require_cpf(t.countryCode.formattedValue,t.paymentMethod.formattedValue)&&(a=s.default.createElement("div",{className:"grid__item"},s.default.createElement(n.UnifiedTextInputField,{autoSetupForm:t.cpf,name:"cpf",labelText:o.intl.formatMessage({id:"Z1BdZ2",defaultMessage:"CPF/CNPJ"}),errorText:this.cpfErrorString(),onChange:this.onCpfChange}),s.default.createElement(n.UnifiedTextInputField,{labelDivClassName:"billing-cpf grid__item",name:"cpf_name",labelText:o.intl.formatMessage({id:"cJojIg",defaultMessage:"Name"}),value:t.cpfName.rawValue,onChange:this.onCpfNameChange}))),a}}t.UnifiedCPFField=r,r.displayName="UnifiedCPFField"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_vat_field",["require","exports","tslib","classnames","react","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_text_input_field","metaserver/static/js/modules/clean/react/payments/common/form_value_helpers","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/payments/validation"],(function(e,t,a,s,n,i,o,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedVatField=void 0,s=a.__importDefault(s),n=a.__importDefault(n);class d extends n.default.Component{onVatChange(e){this.props.actions.updateVat(e.value)}vatErrorString(){const e=this.props.formData.vat;return!o.FormValueHelper.isValid(e)&&e.showError?r.intl.formatMessage({id:"iRjYtd",defaultMessage:"Please enter a valid VAT number (ex: {examples})."},{examples:l.getVatExamples(this.props.formData.countryCode.formattedValue).join(", ")}):""}render(){const{paymentSpec:e,formData:t}=this.props;let a=null;if(e.should_show_vat_for_country(t.countryCode.formattedValue)){const e=l.getVatPrefix(t.countryCode.formattedValue),o=s.default({"billing-vat":!0,grid__item:!0});a=n.default.createElement(i.UnifiedTextInputField,{labelDivClassName:o,autoSetupForm:t.vat,name:"vat",labelText:r.intl.formatMessage({id:"eZAuK1",defaultMessage:"VAT number (optional)"}),errorText:this.vatErrorString(),placeholder:e,onChange:this.onVatChange.bind(this)})}return a}}t.UnifiedVatField=d,d.displayName="UnifiedVatField"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_generic_input",["require","exports","tslib","classnames","dompurify","react"],(function(e,t,a,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedGenericInput=void 0,s=a.__importDefault(s),n=a.__importDefault(n),i=a.__importDefault(i);class o extends i.default.Component{render(){const e=s.default({"input__label--errormodal":Boolean(this.props.errorText)},this.props.className,"label-input","input__label");let t=i.default.createElement("label",{className:`label ${this.props.labelClass?this.props.labelClass:""}`,htmlFor:this.props.htmlFor},this.props.labelText),a=null;this.props.labelAfterElement&&(a=t,t=null);let o=null;o=this.props.rightLabelElement?i.default.createElement("div",{className:"grid__item grid--x-bookend"},t,i.default.createElement("div",null,this.props.rightLabelElement)):t;let r=null;this.props.errorText?r=this.props.errorText:this.props.errorHTML&&(r=i.default.createElement("span",{dangerouslySetInnerHTML:{__html:n.default.sanitize(this.props.errorHTML)}}));const l=i.default.createElement("label",{className:"error-message",htmlFor:this.props.htmlFor},r);return i.default.createElement("div",{className:e},o,this.props.children,a,l)}}t.UnifiedGenericInput=o,o.displayName="UnifiedGenericInput"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_select_input_field",["require","exports","tslib","react","react-dom","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_generic_input"],(function(e,t,a,s,n,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedLabeledSelectInput=void 0,s=a.__importDefault(s),n=a.__importStar(n);class o extends s.default.Component{onChange(e){this.props.onChange&&this.props.onChange(n.findDOMNode(this.input))}onClick(e){this.props.onClick&&this.props.onClick(n.findDOMNode(this.input))}componentDidMount(){if(this.props.onChange){const e=n.findDOMNode(this.input),t=e.value;t&&t!==this.props.value&&this.props.onChange(e)}}render(){const{name:e,className:t,labelClass:a,labelText:n,rightLabelElement:o,errorText:r,errorHTML:l,autoComplete:d}=this.props;return s.default.createElement(i.UnifiedGenericInput,{className:t,errorHTML:l,errorText:r,labelClass:a,htmlFor:e,labelText:n,rightLabelElement:o},s.default.createElement("select",{autoComplete:d,className:"option-selector",id:e,name:e,onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),value:this.props.value,ref:e=>{this.input=e}},this.props.children))}}t.UnifiedLabeledSelectInput=o,o.displayName="UnifiedLabeledSelectInput"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_text_input_field",["require","exports","tslib","classnames","react","react-dom","metaserver/static/js/modules/clean/react/payments/common/form_value_helpers","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_generic_input"],(function(e,t,a,s,n,i,o,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedTextInputField=void 0,s=a.__importDefault(s),n=a.__importDefault(n),i=a.__importStar(i);class l extends n.default.Component{constructor(){super(...arguments),this.onBlur=e=>{this.props.onBlur&&this.props.onBlur(i.findDOMNode(this.refToInput))},this.onFocus=e=>{this.props.onFocus&&this.props.onFocus(i.findDOMNode(this.refToInput))},this.onChange=e=>{this.props.onChange&&this.props.onChange(i.findDOMNode(this.refToInput))}}componentDidMount(){if(this.props.onChange){const e=i.findDOMNode(this.refToInput),t=e.value;t&&t!==this.props.value&&this.props.onChange(e)}}render(){let{labelDivClassName:e,disabled:t,errorText:a,errorHTML:i,labelClass:l,labelText:d,maxLength:c,name:u,placeholder:m,value:p,autoComplete:g,autoSetupForm:_}=this.props;const f=this.props.type||"text";let h=null;if(_){const t=_.errorState&&_.showError;p=p||_.rawValue,i=i||_.serverError,i=t?i:void 0,a=t?a:void 0;const n="billing-"+u+"-input",r=""!==_.formattedValue&&o.FormValueHelper.isValid(_)?"billing-"+u+"-input--valid":"";h=s.default({baseInputClass:n,invalidClass:r});const l="billing-"+u;e=s.default(e,l,{grid__item:!0})}const y=s.default({input__text:!0,"input__text--errormodal":Boolean(a)||Boolean(i)},this.props.inputClassName,h);return n.default.createElement(r.UnifiedGenericInput,{className:e,errorHTML:i,errorText:a,htmlFor:u,labelClass:l,labelText:d},n.default.createElement("input",{autoComplete:g,className:y,type:f,name:u,id:u,ref:e=>{this.refToInput=e},value:null===p?"":p,disabled:t,onBlur:this.onBlur,onChange:this.onChange,onFocus:this.onFocus,maxLength:c,placeholder:m}))}}t.UnifiedTextInputField=l,l.displayName="UnifiedTextInputField"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_address_form",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/payments/common/form_value_helpers","metaserver/static/js/modules/clean/react/payments/common/constants","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_text_input_field","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_fields_base/unified_select_input_field"],(function(e,t,a,s,n,i,o,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedAddressForms=void 0,s=a.__importDefault(s);class d extends s.default.Component{constructor(){super(...arguments),this.onCountryCodeChange=e=>{this.props.actions.updateCountryCode(e.value)},this.onZipCodeBlur=e=>{this.props.actions.blurZipCode(e.value)},this.onZipCodeChange=e=>{this.props.actions.updateZipCode(e.value)},this.zipCodeErrorString=()=>{const e=this.props.formData.zipCode;return!i.FormValueHelper.isValid(e)&&e.showError?o.ZipCodeErrorMessage:""}}renderCountrySelector(e){let t="grid__item--2-3";!0===e&&(t="grid__item");const a=this.props.countryList.map(e=>{const[t,a]=e;return s.default.createElement("option",{key:`location-${t}`,value:t,"aria-selected":t===this.props.formData.countryCode.formattedValue},a)});return s.default.createElement(l.UnifiedLabeledSelectInput,{autoComplete:"country",className:t,labelText:n.intl.formatMessage({id:"1SPrvR",defaultMessage:"Country"}),name:"country_code",onChange:this.onCountryCodeChange,value:this.props.formData.countryCode.rawValue},a)}renderZipCodeInput(){const e=n.intl.formatMessage({id:"5kJrVX",defaultMessage:"Postal Code"}),t="US"===this.props.formData.countryCode.formattedValue?n.intl.formatMessage({id:"ciLB6A",defaultMessage:"Billing ZIP"}):e,a=!this.props.paymentSpec.allow_zip_code_for_country(this.props.formData.countryCode.formattedValue);return s.default.createElement(r.UnifiedTextInputField,{autoComplete:"postal-code",labelDivClassName:"billing-zip payment-info__zip grid__item grid__item--7-24",disabled:a,errorText:this.zipCodeErrorString(),errorHTML:this.props.formData.zipCode.serverError,labelText:t,name:"zip",onChange:this.onZipCodeChange,value:this.props.formData.zipCode.rawValue,onBlur:this.onZipCodeBlur})}render(){return s.default.createElement(s.default.Fragment,null,this.renderCountrySelector(!1),this.renderZipCodeInput())}}t.UnifiedAddressForms=d,d.displayName="UnifiedAddressForms"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_payment_form_async",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/payments/unified_module/unified_payment_form","metaserver/static/js/modules/clean/react/payments/unified_module/unified_actions/unified_store","metaserver/static/js/modules/clean/react/payments/common/form/actions/actions","metaserver/static/js/modules/clean/react/payments/update_team_billing/update_team_store_creator","metaserver/static/js/modules/clean/react/payments/update_team_billing/reducers","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/deprecated_ajax/ajax_jquery","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/static_urls","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_store_creator","metaserver/static/js/modules/clean/analytics"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedPaymentFormAsync=void 0,s=a.__importDefault(s),u=a.__importStar(u);class f extends s.default.Component{constructor(e){super(e),this.calledOnSuccess=!1,this.calledOnError=!1,this.loaded=!1,this.handleLoadSuccess=e=>{if(e.isError)this.setState({}),this.handleLoadFailure();else{const t={countryList:e.countryList,iframeUrl:e.iframeUrl,vat:e.vat,userInfo:e.userInfo,countryToCurrencyMap:e.countryToCurrencyMap,countryCode:e.countryCode,serializedPaymentFormSpec:e.serializedPaymentFormSpec,requestId:e.requestId,submitSeq:0};this.loaded=!0,this.iFrameUrl=e.iframeUrl,this.countryList=e.countryList,this.paymentExperiments=e.paymentExperiments,this.paymentOptionalSettings=e.paymentOptionalSettings,this.props.isTeam?this.store=l.createBillingStore(t,d.BillingReducer):this.store=g.createBillingStore(t,d.BillingReducer),this.setState(this.store.getState()),this.store.subscribe(()=>{const e=this.store.getState();if(!e.pageState.submitSuccess)if(this.props.isSubmittingStatus){const t=this.props.isSubmittingStatus;this.setState(a=>(t(e.pageState.submitting),e))}else this.setState(t=>e);e.pageState.submitSuccess&&!this.calledOnSuccess&&(this.props.onSuccess(),this.calledOnSuccess=!0),"error"===e.pageState.submitState&&this.props.onError&&!this.calledOnError&&(this.props.onError(),this.calledOnError=!0)})}},this.handleLoadFailure=()=>{m.Notify.error(n.intl.formatMessage({id:"DznP1t",defaultMessage:"Failed to load payment form."}))},this.saveUnifiedPaymentMethodForm=e=>{this.unifiedPaymentForm=e},this.prepareForSubmission=()=>(_.UserActivityLogger.log("web","update_billing_modal_try_submit",{payment_method:c.PaymentMethod[this.state.formData.paymentMethod.rawValue],country_code:this.state.formData.countryCode.rawValue,zip_code:this.state.formData.zipCode.rawValue,isNptBillingModal:this.paymentExperiments.showNptBillingModal,project:this.paymentExperiments.trialProjectType}),this.unifiedPaymentForm.prepareForSubmission()),this.onAccept=(e=r.SubmitFormTriggerType.ButtonClick,t)=>{this.actions.submitBillingForm(this.prepareForSubmission,this.unifiedPaymentForm.getCreditCardFrame().handle3DsMessage,e,this.generateAdditionalInfo(t))},this.iFrameUrl=""}componentDidMount(){const{preloadedViewModel:e,isTeam:t,requireTOS:a}=this.props;e?this.handleLoadSuccess(e):u.WebRequest({url:"/account/unified_payment_view",data:{isTeam:t,requireTOS:a},success:e=>{const t=JSON.parse(e);this.handleLoadSuccess(t)},error:()=>{this.handleLoadFailure()}})}get actions(){return o.bindUnifiedBillingActions(this.store)}generateAdditionalInfo(e){const t={};return this.paymentOptionalSettings.showRebillUpsell&&(t.showRebillUpsell=this.paymentOptionalSettings.showRebillUpsell),this.paymentOptionalSettings.isScheduledDowngradeToBasic,t.forDeclarativeModal=e,t}renderLoading(){return s.default.createElement("div",{className:"loading-spinner"},s.default.createElement("img",{src:p.static_url("/static/images/icons/ajax-loading-small-vfl3Wt7C_.gif"),alt:n.intl.formatMessage({id:"aAKod9",defaultMessage:"Loading"})}))}render(){return this.loaded?s.default.createElement("div",{className:"payment-info-section"},s.default.createElement("div",{className:"payment-method-section grid__container"},s.default.createElement(i.UnifiedPaymentForm,{ref:this.saveUnifiedPaymentMethodForm,paymentSpec:this.state.pageState.paymentFormSpec,iframeUrl:this.iFrameUrl,countryList:this.countryList,formData:this.state.formData,actions:this.actions,submitForm:this.onAccept,payment_experiments:this.paymentExperiments,payment_optional_settings:this.paymentOptionalSettings,requireTOS:this.props.requireTOS}))):this.renderLoading()}}t.UnifiedPaymentFormAsync=f,f.displayName="UnifiedPaymentFormAsync"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_payment_form",["require","exports","tslib","classnames","metaserver/static/js/modules/clean/analytics","react","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/credit_card_frame","metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/direct_debit_form","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/payment_method_selector","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_cpf_field","metaserver/static/js/modules/clean/react/payments/unified_module/unified_fields/unified_vat_field","metaserver/static/js/modules/clean/react/payments/unified_module/unified_address_form","metaserver/static/js/modules/clean/react/payments/unified_module/unified_data_export","metaserver/static/js/modules/clean/react/payments/buy/components/payments/ideal_form","dig-components/typography","metaserver/static/js/modules/clean/react/payments/buy/components/payments/dlocal_rbi_form","metaserver/static/js/modules/clean/react/payments/buy/components/payments/tos","metaserver/static/js/modules/clean/react/payments/checkout/components/california_legal_terms"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_,f,h,y,b){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnifiedPaymentForm=void 0,s=a.__importDefault(s),i=a.__importDefault(i);class v extends i.default.Component{constructor(e){super(e)}getPaymentData(){return g.getDataIfValid(this.props.formData,this.props.paymentSpec,this.prepareForSubmission(),this.props.payment_experiments)}componentDidMount(){const e=this.props.formData.countryCode.formattedValue;n.TeamsWebActionsLogger.log("uj-billing-country",{country:e}),"BR"===e&&n.TeamsWebActionsLogger.log("uj-cpf-viewed-field"),this.props.actions.updateHistory()}prepareForSubmission(){return this.props.formData.paymentMethod.formattedValue===d.PaymentMethod.CreditCard?this.creditCardFrame.tokenize():Promise.resolve(!0)}getCreditCardFrame(){return this.creditCardFrame}renderLocationFields(){const{paymentSpec:e,formData:t,actions:a,countryList:s,payment_experiments:n,payment_optional_settings:r}=this.props;let l=null,d=o.intl.formatMessage({id:"wQlV/K",defaultMessage:"Please note: changing your billing location could impact your applicable tax rate."});return e.should_show_vat_for_country(t.countryCode.formattedValue)&&(d=o.intl.formatMessage({id:"oORi2w",defaultMessage:"Please note: changing your billing location or VAT number could impact your applicable tax rate."})),n.showNptBillingModal&&(d=o.intl.formatMessage({id:"4D+h/K",defaultMessage:"You won't be charged until you confirm your purchase on the next screen."})),e.isTeam()||(l=i.default.createElement("div",{className:(null==r?void 0:r.isScheduledDowngradeToBasic)?"disclaimer-message-full-width":"disclaimer-message"},d,(null==r?void 0:r.isScheduledDowngradeToBasic)&&i.default.createElement("span",null," ",o.intl.formatMessage({id:"n4lfCe",defaultMessage:"Updating your billing information will cancel your scheduled plan downgrade. If you still wish to downgrade, you will need to schedule it again."})))),i.default.createElement("div",{className:"location-info-fields grid__item grid--x-bookend"},i.default.createElement(p.UnifiedAddressForms,{paymentSpec:e,formData:t,actions:a,countryList:s}),i.default.createElement(m.UnifiedVatField,{paymentSpec:e,formData:t,actions:a,payment_experiments:n}),i.default.createElement(u.UnifiedCPFField,{paymentSpec:e,formData:t,actions:a,payment_experiments:n}),i.default.createElement(f.Text,{size:"small",color:"faint",variant:"paragraph"},l))}render(){const{paymentSpec:e,actions:t,formData:a,iframeUrl:n,submitForm:o,requireTOS:u}=this.props,m=this.renderLocationFields();let p=m;a.paymentMethod.formattedValue===d.PaymentMethod.DirectDeposit?p=i.default.createElement(l.DirectDebitForm,{locationFields:m,formData:a,actions:t}):a.paymentMethod.formattedValue===d.PaymentMethod.Ideal?p=i.default.createElement(_.IdealForm,{locationFields:m,formData:a,actions:t,idealBanks:e.idealBanks()}):a.paymentMethod.formattedValue===d.PaymentMethod.DlocalRBI&&(p=i.default.createElement(h.DlocalRBIForm,{locationFields:m,formData:a,actions:t}));const g=s.default({grid__item:!0,"payment-form":!0,"payment-form--responsive":!0}),f=a.zipCode.formattedValue;return i.default.createElement("div",{className:g},i.default.createElement(c.PaymentMethodSelector,{isTeam:!1,paymentSpec:e,paymentMethod:a.paymentMethod.rawValue,updatePaymentMethod:t.updatePaymentMethod,countryCode:a.countryCode.rawValue,zipCode:a.zipCode.rawValue}),i.default.createElement(r.CreditCardFrame,{getHeightFromIframe:!0,iframeUrl:n,isResponsive:!0,hidden:a.paymentMethod.formattedValue!==d.PaymentMethod.CreditCard,actions:t,ref:e=>{this.creditCardFrame=e},nonce:a.nonce,bin:a.bin,submitForm:o}),p,u&&i.default.createElement(i.default.Fragment,null,i.default.createElement(b.CaliforniaLegalTerms,{zipCode:f}),i.default.createElement(y.TermsOfService,{formData:a,actions:t,additionalTermsOfService:null,additionalPrivacyPolicy:null,isMultiSeatPlan:!0})))}}t.UnifiedPaymentForm=v,v.displayName="UnifiedPaymentForm"})),define("metaserver/static/js/modules/clean/react/payments/unified_module/unified_data_export",["require","exports","tslib","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/react/payments/business/state/business_state","metaserver/static/js/modules/clean/react/payments/common/form_value_helpers"],(function(e,t,a,s,n,i){"use strict";function o(e,t,a){const n=["countryCode"];return t.allow_zip_code_for_country(e)&&n.push("zipCode"),t.should_show_vat_for_country(e)&&n.push("vat"),t.should_require_cpf(e,a)&&(n.push("cpf"),n.push("cpfName")),t.requires_tos()&&n.push("termsAndService"),a===s.PaymentMethod.CreditCard?(n.push("nonce"),n.push("adyenEncryptedCard"),n.push("encryptedCardForNetworkToken"),n.push("bin"),n.push("browserInfo"),n.push("threeDsData")):a===s.PaymentMethod.DirectDeposit?n.push("accountHolderName","iban","mandateSigned"):a===s.PaymentMethod.Ideal?n.push("idealBankId","idealBankName"):a===s.PaymentMethod.ApplePay?n.push("applePayToken"):a===s.PaymentMethod.DlocalRBI&&(n.push("name"),n.push("pan"),n.push("addressStreet"),n.push("addressNumber")),n}function r(e,t){return t[e]}Object.defineProperty(t,"__esModule",{value:!0}),t.getPaymentFieldNamesToSubmit=t.getDataIfValid=void 0,s=a.__importStar(s),t.getDataIfValid=function(e,t,a,s){const l=o(e.countryCode.formattedValue,t,e.paymentMethod.formattedValue);return(function(e,t){for(const a of e){const e=r(a,t);if(!i.FormValueHelper.isValid(e))return!1}return!0})(l,e)?a.then(()=>(function(e,t){const a={};for(const s of e)a[n.fieldsToServerProps[s]]=r(s,t).formattedValue;return a})(l,e)):Promise.resolve(null)},t.getPaymentFieldNamesToSubmit=o})),define("metaserver/static/js/modules/clean/react/payments/checkout/components/inputs/radio_input",["require","exports","tslib","react","react-dom"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RadioInput=void 0,s=a.__importDefault(s),n=a.__importStar(n);class i extends s.default.Component{onChange(e){this.props.onChange&&this.props.onChange(n.findDOMNode(this.input))}componentDidMount(){if(this.props.onChange){const e=n.findDOMNode(this.input),t=e.checked;t&&t!==this.props.checked&&this.props.onChange(e)}}render(){const{name:e,id:t,className:a,checked:n,value:i,disabled:o}=this.props;return s.default.createElement("input",{type:"radio",className:a,name:e,id:t,value:i,checked:n,onChange:this.onChange.bind(this),disabled:o,ref:e=>{this.input=e}})}}t.RadioInput=i,i.displayName="RadioInput"})),define("metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/payment_method_option",["require","exports","tslib","react","metaserver/static/js/modules/core/i18n","classnames","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/react/payments/checkout/components/inputs/radio_input","metaserver/static/js/modules/clean/react/payments/pro/components/inputs/inputs"],(function(e,t,a,s,n,i,o,r,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethodOption=void 0,s=a.__importDefault(s),i=a.__importDefault(i);class d extends s.default.Component{onChange(e){this.props.onSelected(this.props.paymentMethod)}render(){const{icons:e,labelText:t,paymentMethod:a}=this.props,d=[],c=["payment-method-option","payment-info__option"];let u,m;if(this.props.isTeam?(c.push("grid__item"),c.push("grid__item--medium--shrink"),c.push("grid--y-middle"),c.push("grid__container--p-micro")):this.props.numberOfPaymentMethods&&this.props.numberOfPaymentMethods>2?c.push("grid__item--medium--1-4"):c.push("grid__item--medium--1-2"),t&&(u="payment-method-label#debit",d.push(s.default.createElement("span",{key:u,className:"debit"},this.props.labelText))),e){if(a===o.PaymentMethod.CreditCard){const t=e.join(", ").replace("_","-"),a=n.intl.formatMessage({id:"IBCGt3",defaultMessage:"Credit card. We accept {payment_methods}"},{payment_methods:t});u="payment-method-label#creditcard",d.push(s.default.createElement("span",{key:u,className:"ax-visually-hidden"},a))}else a===o.PaymentMethod.PayPal?(u="payment-method-label#paypal",d.push(s.default.createElement("span",{key:u,className:"ax-visually-hidden"},n.intl.formatMessage({id:"RxvBVG",defaultMessage:"Paypal"})))):a===o.PaymentMethod.DlocalRBI&&(u="payment-method-label#upi",d.push(s.default.createElement("span",{key:u,className:"ax-visually-hidden"},n.intl.formatMessage({id:"8pWyzf",defaultMessage:"UPI"}))));for(const t of e)u=`payment-method-icon#${t}`,d.push(s.default.createElement("span",{key:u,className:t}))}return m=this.props.isTeam?s.default.createElement("div",{className:i.default(c)},s.default.createElement(r.RadioInput,{name:"payment_method",id:`payment_method_${a}`,value:a.toString(),checked:this.props.selected,onChange:this.onChange.bind(this)}),s.default.createElement("label",{htmlFor:`payment_method_${a}`,className:"payment-method-label"},d)):s.default.createElement("div",{className:i.default(c)},s.default.createElement(l.LabeledRadioInput,{id:`payment_method_${a}`,name:"payment_method",className:"payment-info__payment",value:a.toString(),checked:this.props.selected,onClick:this.onChange.bind(this)}),s.default.createElement("label",{htmlFor:`payment_method_${a}`,className:"payment-info__method-label",onClick:this.onChange.bind(this)},d)),m}}t.PaymentMethodOption=d,d.displayName="PaymentMethodOption"})),define("metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/payment_method_selector",["require","exports","tslib","react","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/react/payments/checkout/components/payment_method_form/payment_method_option","metaserver/static/js/modules/core/i18n"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PaymentMethodSelector=void 0,s=a.__importDefault(s);class r extends s.default.Component{constructor(){super(...arguments),this.onPaymentMethodSelected=e=>{this.props.updatePaymentMethod(e)}}getLabelForMethodId(e){return e===n.PaymentMethod.CreditCard?s.default.createElement(i.PaymentMethodOption,{key:`payment-method#${e}`,paymentMethod:n.PaymentMethod.CreditCard,selected:this.props.paymentMethod===n.PaymentMethod.CreditCard,onSelected:this.onPaymentMethodSelected,icons:this.props.paymentSpec.supported_credit_cards_for_country(this.props.countryCode),isTeam:this.props.isTeam,numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length}):e===n.PaymentMethod.PayPal?s.default.createElement(i.PaymentMethodOption,{key:`payment-method#${e}`,paymentMethod:n.PaymentMethod.PayPal,selected:this.props.paymentMethod===n.PaymentMethod.PayPal,onSelected:this.onPaymentMethodSelected,icons:["paypal"],isTeam:this.props.isTeam,numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length}):e===n.PaymentMethod.DirectDeposit?s.default.createElement(i.PaymentMethodOption,{key:`payment-method#${e}`,isTeam:this.props.isTeam,labelText:o.intl.formatMessage({id:"H1vHwe",defaultMessage:"Direct Debit"}),numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,onSelected:this.onPaymentMethodSelected,paymentMethod:n.PaymentMethod.DirectDeposit,selected:this.props.paymentMethod===n.PaymentMethod.DirectDeposit}):e===n.PaymentMethod.Ideal?s.default.createElement(i.PaymentMethodOption,{key:`payment-method#${e}`,isTeam:this.props.isTeam,paymentMethod:n.PaymentMethod.Ideal,selected:this.props.paymentMethod===n.PaymentMethod.Ideal,onSelected:this.onPaymentMethodSelected,icons:["ideal"],numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,labelText:o.intl.formatMessage({id:"DgNBM/",defaultMessage:"iDEAL"})}):e===n.PaymentMethod.DlocalRBI?s.default.createElement(i.PaymentMethodOption,{key:`payment-method#${e}`,isTeam:this.props.isTeam,paymentMethod:n.PaymentMethod.DlocalRBI,selected:this.props.paymentMethod===n.PaymentMethod.DlocalRBI,onSelected:this.onPaymentMethodSelected,numberOfPaymentMethods:this.props.paymentSpec.available_payment_methods_for_country(this.props.countryCode).length,icons:["upi"]}):null}render(){const{countryCode:e,paymentSpec:t}=this.props,a=t.available_payment_methods_for_country(e).map(e=>this.getLabelForMethodId(e));return s.default.createElement("div",{className:"payment-method-selector payment-info__selector grid__item"},a)}}t.PaymentMethodSelector=r,r.displayName="PaymentMethodSelector"})),define("metaserver/static/js/modules/clean/react/payments/update_team_billing/reducers",["require","exports","metaserver/static/js/modules/clean/react/payments/common/form/reducers/reducers","metaserver/static/js/modules/clean/react/payments/common/payments/reducers/reducers","metaserver/static/js/modules/clean/react/payments/common/pricing/reducers/reducers"],(function(e,t,a,s,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BillingReducer=void 0,t.BillingReducer=(function(...e){return e.reduce((e,t)=>(a,s)=>t(e(a,s),s))})((function(e,t){return"SubmitFormSuccess"!==t.type?e:Object.assign(Object.assign({},e),{pageState:Object.assign(Object.assign({},e.pageState),{submitSuccess:!0})})}),a.FormReducer,...s.PaymentMethodReducers,...s.TermsAndServiceReducers,...n.TransitionManagementReducers)})),define("metaserver/static/js/modules/clean/react/payments/update_team_billing/update_team_actions",["require","exports","tslib","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/payments/payment_form/payment_form_spec","metaserver/static/js/modules/clean/react/payments/common/form/actions/actions"],(function(e,t,a,s,n,i,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateBillingCountryCode=t.submitTeamBillingForm=void 0,i=a.__importStar(i),t.submitTeamBillingForm=function(e,t,a){return(s,n)=>{const r=n(),l=r.formData.countryCode.formattedValue,d=r.pageState.paymentFormSpec,c=["countryCode"];let u;d.allow_zip_code_for_country(l)&&c.push("zipCode"),d.should_show_vat_for_country(l)&&c.push("vat"),d.should_require_cpf(l,r.formData.paymentMethod.formattedValue)&&c.push("cpf"),r.formData.paymentMethod.formattedValue===i.PaymentMethod.CreditCard?(c.push("nonce"),c.push("adyenEncryptedCard"),c.push("encryptedCardForNetworkToken"),c.push("bin"),c.push("browserInfo"),c.push("threeDsData"),u="/team/payments/ajax_update_billing_credit_card"):r.formData.paymentMethod.formattedValue===i.PaymentMethod.DirectDeposit?(c.push("accountHolderName","iban","mandateSigned"),u="/team/payments/ajax_update_billing_direct_debit"):u="/team/payments/ajax_update_billing_paypal",s(o.submitForm(u,c,e,{payment_method:r.formData.paymentMethod.formattedValue,request_id:r.pageState.requestId,submit_seq:r.pageState.submitSeq},void 0,t,a))}},t.updateBillingCountryCode=function(e){return(t,a)=>{const i=a(),r=i.pageState.countryToCurrencyMap;!(e in r)&&i.formData.countryCode.formattedValue in r?n.Notify.error(s.intl.formatMessage({id:"K81Lqx",defaultMessage:"You can’t change to a country with a different currency. For help, contact support."}),3):t(o.updateCountryCode(e))}}})),define("metaserver/static/js/modules/clean/react/payments/update_team_billing/update_team_store_creator",["require","exports","tslib","redux","redux-thunk","metaserver/static/js/modules/clean/react/payments/common/middleware/payments_ux_logger","metaserver/static/js/modules/clean/redux/unsupported","metaserver/static/js/modules/clean/analytics","metaserver/static/js/modules/clean/dbmodal_stack","metaserver/static/js/modules/clean/react/components/modal","metaserver/static/js/modules/clean/react/payments/common/form/middleware/middleware","metaserver/static/js/modules/clean/react/payments/common/payments/state/store_creator","metaserver/static/js/modules/clean/react/payments/common/form_value_factory","metaserver/static/js/modules/core/i18n","metaserver/static/js/modules/core/notify","metaserver/static/js/modules/clean/react/payments/update_individual_billing/update_individual_store_creator"],(function(e,t,a,s,n,i,o,r,l,d,c,u,m,p,g,_){"use strict";function f(e){return e=>t=>{if("SubmitFormSuccess"!==t.type)return e(t);const a=e(t);return g.Notify.success(p.intl.formatMessage({id:"fMNNpH",defaultMessage:"We’ve successfully updated your team’s billing information."})),r.TeamsWebActionsLogger.log("update_billing_open_save_changes_success"),d.Modal.close(),l.DBModalStack.trigger(_.BILLING_INFO_UPDATED,null),a}}function h(e,t,a){const{vat:s,countryCode:n,userInfo:i}=e,{paymentMethod:o,countryCode:r,zipCode:l,vat:d,cpf:c,nonce:p,payPalNonce:g,adyenEncryptedCard:_,encryptedCardForNetworkToken:f,applePayToken:h,bin:y,browserInfo:b,threeDsData:v,accountHolderName:M,iban:S,mandateSigned:E,termsAndService:C,idealBankId:P,idealBankName:A,city:T,phone:w,name:I,address:N,pan:L,addressStreet:D,addressNumber:x}=u.createPaymentFormData(e,t,a);return{city:T,phone:w,name:I,address:N,paymentMethod:o,countryCode:r,zipCode:l,vat:s?m.FormValueFactory.createVat(s,n):d,cpf:c,cpfName:m.FormValueFactory.createCpfNamePrefill("","",i.displayName),nonce:p,payPalNonce:g,bin:y,browserInfo:b,threeDsData:v,adyenEncryptedCard:_,encryptedCardForNetworkToken:f,applePayToken:h,accountHolderName:M,iban:S,mandateSigned:E,termsAndService:C,idealBankId:P,idealBankName:A,pan:L,addressStreet:D,addressNumber:x}}Object.defineProperty(t,"__esModule",{value:!0}),t.createFormData=t.createBillingStore=t.submitFormSuccessMiddleware=void 0,s=a.__importStar(s),n=a.__importDefault(n),t.submitFormSuccessMiddleware=f,t.createBillingStore=function(e,t){const a=(function(e){const t=(function(e){const{paymentFormSpec:t}=u.createPaymentPageState(e);return{countryToCurrencyMap:e.countryToCurrencyMap,submitState:null,submitSuccess:!1,submitting:!1,submitSeq:0,paypalEmail:"",requestId:e.requestId,paymentFormSpec:t}})(e),a=(function(e){const{countryCode:t,countryCodeLoading:a,hasCurrencyChanged:s,hasTaxChangedWithinCountry:n,loadingPrices:i,recentLoadEvent:o,requestToken:r}=u.createPaymentPricingState(e);return{countryCode:t,countryCodeLoading:a,hasCurrencyChanged:s,hasTaxChangedWithinCountry:n,loadingPrices:i,recentLoadEvent:o,requestToken:r}})(e);return{pricingState:a,pageState:t,formData:h(e,t,a)}})(e);let r=s.applyMiddleware(n.default,c.submitFormErrorMiddleware,f,new i.PaymentsUXLogger(e.requestId).reduxMiddleware);return o.createStore(t,a,r)},t.createFormData=h})); //# sourceMappingURL=pkg-account_subscription_core.min.js-vflYhH2jB.map