<%@ page language="VB" masterpagefile="~/Template/Master.master" autoeventwireup="false" inherits="Clients_Subscriptions, MachSol.MachPanel.Web" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Content" runat="Server">

    <script type="module">

        import { createApp } from 'vue'
        import SubscriptionsList from '/Components/Clients/SubscriptionsList.js?v=3.6'
        import { getLabelText } from '/Components/Common/utils.js?v=3.6'

        createApp({
            data() {
                return {
                    readOnly: <%= Helper.ReadOnlyRole %>,
                    showWHMCS: <%= Helper.ShowWHMCSColumn.ToString().ToLower() %>,
                    showConvertToPaid: <%= ShowConvertToPaid.ToString().ToLower() %>,
                    sortPreference: <%= Newtonsoft.Json.JsonConvert.SerializeObject(InitialSortPreference) %>,
                    companyId: '<%= HttpContext.Current.Session("CompanyId") %>',
                    customerId: '<%= IIf(Helper.IsLoggedInAsCustomer OrElse Helper.IsLoggedInAsCustomerContact, HttpContext.Current.Session("CustomerId"), "0") %>'
                }
            },
            methods: {
                getLabelText,
                //getString: function (key) {
                //    return Translation[key];
                //}
            },
            created: function () {

                let urlParams = new URLSearchParams(window.location.search);
                if (urlParams.has('E')) {
                    if (urlParams.get('E') == 1)
                        displayErrorMsg(Error(this.getLabelText('SMI5036')));
                    else if (urlParams.get('E') == 2)
                        displayErrorMsg(Error(this.getLabelText('SMI01021')));
                }
                if (urlParams.has('M')) {
                    if (urlParams.get('M') == 1)
                        displaySuccessMsg(this.getLabelText('SPT002780'));
                }
                if (urlParams.has('Su')) {
                    displaySuccessMsg(this.getLabelText('EGN0000011'));
                }
                if (urlParams.has('TI')) {
                    this.currentTab = urlParams.get('TI');
                }

            },
            components: {
                SubscriptionsList
            },
            template: `

<SubscriptionsList :sortPreference="sortPreference" :readOnly="readOnly" :showWHMCS="showWHMCS" :companyId="companyId" :customerId="customerId" 
    :showConvertToPaid="showConvertToPaid" />

                        
`
        }).mount('#app')

    </script>

    <div id="app">
    </div>

</asp:Content>

