(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["MobileMessaging"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["MobileMessaging"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/MobileMessaging/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ReportParameters",(function(){return N})),n.d(t,"ManageSmsProvider",(function(){return T})),n.d(t,"SmsProviderCredentials",(function(){return H})),n.d(t,"DelegateMobileMessagingSettings",(function(){return R})),n.d(t,"ManageMobilePhoneNumbers",(function(){return pe})),n.d(t,"SelectPhoneNumbers",(function(){return j})),n.d(t,"AdminPage",(function(){return ye})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var i=n("8bbf"),l={key:0};function a(e,t,n,o,r,a){var c=Object(i["resolveComponent"])("SelectPhoneNumbers");return e.report&&"mobile"===e.report.type?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",l,[Object(i["createVNode"])(c,{"phone-numbers":e.phoneNumbers,"with-introduction":!0,"model-value":e.report.phoneNumbers,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.$emit("change","phoneNumbers",t)})},null,8,["phone-numbers","model-value"])])):Object(i["createCommentVNode"])("",!0)}var c={class:"mobile"},s={id:"mobilePhoneNumbersHelp",class:"inline-help-node"},d=Object(i["createElementVNode"])("span",{class:"icon-info",style:{"margin-right":"3.5px"}},null,-1),u={key:0,style:{"margin-right":"3.5px"}},m={key:1,style:{"margin-right":"3.5px"}},b=["href"];function p(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[Object(i["createVNode"])(a,{uicontrol:"checkbox","var-type":"array",name:"phoneNumbers","model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.$emit("update:modelValue",t)}),introduction:e.withIntroduction?e.translate("ScheduledReports_SendReportTo"):void 0,title:e.translate("MobileMessaging_PhoneNumbers"),disabled:0===e.phoneNumbers.length,options:e.phoneNumbers},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",s,[d,0===e.phoneNumbers.length?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",u,Object(i["toDisplayString"])(e.translate("MobileMessaging_MobileReport_NoPhoneNumbers")),1)):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",m,Object(i["toDisplayString"])(e.translate("MobileMessaging_MobileReport_AdditionalPhoneNumbers")),1)),Object(i["createElementVNode"])("a",{href:e.linkTo({module:"MobileMessaging",action:"index",updated:null})},Object(i["toDisplayString"])(e.translate("MobileMessaging_MobileReport_MobileMessagingSettingsLink")),9,b)])]})),_:1},8,["model-value","introduction","title","disabled","options"])])}var g=n("19dc"),v=n("a5a2"),h=Object(i["defineComponent"])({props:{modelValue:Array,phoneNumbers:{type:[Array,Object],required:!0},withIntroduction:Boolean},emits:["update:modelValue"],components:{Field:v["Field"]},methods:{linkTo:function(e){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),e)))}}});h.render=p;var j=h,O="mobile",f=Object(i["defineComponent"])({props:{report:{type:Object,required:!0},phoneNumbers:{type:[Array,Object],required:!0}},components:{SelectPhoneNumbers:j},emits:["change"],created:function(){var e=window,t=e.resetReportParametersFunctions,n=e.updateReportParametersFunctions,o=e.getReportParametersFunctions;t[O]||(t[O]=function(e){e.phoneNumbers=[],e.formatmobile="sms"}),n[O]||(n[O]=function(e){null!==e&&void 0!==e&&e.parameters&&(e.parameters&&e.parameters.phoneNumbers&&(e.phoneNumbers=e.parameters.phoneNumbers),e.formatmobile="sms")}),o[O]||(o[O]=function(e){var t=e.phoneNumbers;return{phoneNumbers:t||[""]}})}});f.render=a;var N=f,M=Object(i["createElementVNode"])("div",{id:"ajaxErrorManageSmsProviderSettings"},null,-1),y={key:0},S={key:0},C=Object(i["createElementVNode"])("br",null,null,-1),P={key:1},V=Object(i["createElementVNode"])("br",null,null,-1),A=["innerHTML"],k={key:1},E={id:"accountForm"},_=["innerHTML"];function B(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("ActivityIndicator"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SmsProviderCredentials"),d=Object(i["resolveComponent"])("SaveButton"),u=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createVNode"])(a,{loading:e.isDeletingAccount},null,8,["loading"]),M,e.credentialSupplied?(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",y,[e.credentialError?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",S,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_CredentialInvalid",e.provider)),1),C,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.credentialError),1)])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",P,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_CredentialProvided",e.provider))+" "+Object(i["toDisplayString"])(e.creditLeft),1)),V,Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.updateOrDeleteAccountText),onClick:t[0]||(t[0]=function(t){return e.onUpdateOrDeleteClick(t)})},null,8,A)])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",k,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_PleaseSignUp")),1)),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",E,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"select",name:"smsProviders",modelValue:e.smsProvider,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.smsProvider=t}),title:e.translate("MobileMessaging_Settings_SMSProvider"),options:e.smsProviderOptions,value:e.provider},null,8,["modelValue","title","options","value"])]),Object(i["createVNode"])(s,{provider:e.smsProvider,modelValue:e.credentials,"onUpdate:modelValue":[t[2]||(t[2]=function(t){return e.credentials=t}),t[3]||(t[3]=function(t){e.credentials=t})],"model-value":e.credentials},null,8,["provider","modelValue","model-value"]),Object(i["createVNode"])(d,{id:"apiAccountSubmit",disabled:!e.isUpdateAccountPossible,saving:e.isUpdatingAccount,onConfirm:t[4]||(t[4]=function(t){return e.updateAccount()})},null,8,["disabled","saving"]),Object(i["createElementVNode"])("div",{class:"providerDescription",innerHTML:e.$sanitize(e.currentProviderDescription)},null,8,_)],512),[[i["vShow"],!e.credentialSupplied||e.showAccountForm],[u]])])}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var w={key:0};function D(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("Field");return e.fields?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",w,[(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.fields,(function(t){var n;return Object(i["openBlock"])(),Object(i["createBlock"])(a,{key:t.name,uicontrol:t.type,name:t.name,"model-value":null===(n=e.modelValue)||void 0===n?void 0:n[t.name],"onUpdate:modelValue":function(n){return e.$emit("update:modelValue",Object.assign(Object.assign({},e.modelValue),{},x({},t.name,n)))},title:e.translate(t.title)},null,8,["uicontrol","name","model-value","onUpdate:modelValue","title"])})),128))])):Object(i["createCommentVNode"])("",!0)}var U=Object(i["reactive"])({}),F=Object(i["defineComponent"])({props:{provider:{type:String,required:!0},modelValue:Object},emits:["update:modelValue"],components:{Field:v["Field"]},watch:{provider:function(){this.$emit("update:modelValue",null),this.getCredentialFields()}},created:function(){this.getCredentialFields()},methods:{getCredentialFields:function(){var e=this;U[this.provider]?this.$emit("update:modelValue",Object.fromEntries(U[this.provider].map((function(e){return[e.name,null]})))):g["AjaxHelper"].fetch({module:"MobileMessaging",action:"getCredentialFields",provider:this.provider}).then((function(t){e.$emit("update:modelValue",Object.fromEntries(t.map((function(e){return[e.name,null]})))),U[e.provider]=t}))}},computed:{fields:function(){return U[this.provider]}}});F.render=D;var H=F,q=Object(i["defineComponent"])({props:{credentialSupplied:Boolean,credentialError:String,provider:String,creditLeft:[Number,String],smsProviderOptions:{type:Object,required:!0},smsProviders:{type:Object,required:!0}},components:{ActivityIndicator:g["ActivityIndicator"],Field:v["Field"],SaveButton:v["SaveButton"],SmsProviderCredentials:H},directives:{Form:v["Form"]},data:function(){return{isDeletingAccount:!1,isUpdatingAccount:!1,showAccountForm:!1,credentials:null,smsProvider:this.provider}},methods:{deleteApiAccount:function(){var e=this;this.isDeletingAccount=!0,g["AjaxHelper"].fetch({method:"MobileMessaging.deleteSMSAPICredential"},{errorElement:"#ajaxErrorManageSmsProviderSettings"}).then((function(){g["Matomo"].helper.redirect()})).finally((function(){e.isDeletingAccount=!1}))},showUpdateAccount:function(){this.showAccountForm=!0},updateAccount:function(){var e=this;this.isUpdateAccountPossible&&(this.isUpdatingAccount=!0,g["AjaxHelper"].post({method:"MobileMessaging.setSMSAPICredential"},{provider:this.smsProvider,credentials:this.credentials},{errorElement:"#ajaxErrorManageSmsProviderSettings"}).then((function(){g["Matomo"].helper.redirect()})).finally((function(){e.isUpdatingAccount=!1})))},deleteAccount:function(){var e=this;g["Matomo"].helper.modalConfirm("#confirmDeleteAccount",{yes:function(){e.isDeletingAccount=!0,g["AjaxHelper"].fetch({method:"MobileMessaging.deleteSMSAPICredential"},{errorElement:"#ajaxErrorManageSmsProviderSettings"}).then((function(){e.isDeletingAccount=!1,g["Matomo"].helper.redirect()})).finally((function(){e.isDeletingAccount=!1}))}})},onUpdateOrDeleteClick:function(e){var t=e.target;"displayAccountForm"===t.id?this.showUpdateAccount():"deleteAccount"===t.id&&this.deleteAccount()}},computed:{isUpdateAccountPossible:function(){return!!this.smsProvider&&null!==this.credentials&&Object.values(this.credentials).every((function(e){return!!e}))},updateOrDeleteAccountText:function(){return Object(g["translate"])("MobileMessaging_Settings_UpdateOrDeleteAccount",'',"",'',"")},currentProviderDescription:function(){return this.smsProvider&&this.smsProviders?this.smsProviders[this.smsProvider]:""}}});q.render=B;var T=q;function L(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(a,{uicontrol:"radio",name:"delegatedManagement",title:e.translate("MobileMessaging_Settings_LetUsersManageAPICredential"),modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),"full-width":!0,options:e.delegateManagementOptions},null,8,["title","modelValue","options"])]),Object(i["createVNode"])(c,{onConfirm:t[1]||(t[1]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])])}var I=Object(i["defineComponent"])({props:{delegateManagementOptions:{type:Array,required:!0},delegatedManagement:[Number,Boolean]},components:{Field:v["Field"],SaveButton:v["SaveButton"]},data:function(){return{isLoading:!1,enabled:this.delegatedManagement?1:0}},methods:{save:function(){var e=this;this.isLoading=!0,g["AjaxHelper"].post({method:"MobileMessaging.setDelegatedManagement"},{delegatedManagement:this.enabled&&"0"!==this.enabled?"true":"false"}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"mobileMessagingSettings",type:"transient",context:"success"});g["NotificationsStore"].scrollToNotification(e),g["Matomo"].helper.redirect()})).finally((function(){e.isLoading=!1}))}}});I.render=L;var R=I,$={key:0},G={class:"row"},Y={class:"col s12"},z={class:"form-group row"},J={class:"col s12 m6"},K={class:"col s12 m6 form-help"},Q={class:"form-group row addPhoneNumber"},W={class:"col s12 m6"},X={class:"countryCode left"},Z=Object(i["createElementVNode"])("span",{class:"countryCodeSymbol"},"+",-1),ee={class:"phoneNumber left"},te={class:"addNumber left valign-wrapper"},ne={class:"col s12 m6 form-help"},oe=Object(i["createElementVNode"])("div",{id:"ajaxErrorAddPhoneNumber"},null,-1),re={key:1,class:"row"},ie={class:"col s12"},le={class:"col s12 m6"},ae={class:"phoneNumber"},ce=["onUpdate:modelValue","placeholder"],se={key:0,class:"form-help col s12 m6"},de=Object(i["createTextVNode"])("   "),ue=Object(i["createElementVNode"])("div",{id:"invalidVerificationCodeAjaxError",style:{display:"none"}},null,-1);function me(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveComponent"])("Alert"),d=Object(i["resolveComponent"])("ActivityIndicator");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_PhoneNumbers_Help")),1),e.isSuperUser?(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",$,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_DelegatedPhoneNumbersOnlyUsedByYou")),1)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",G,[Object(i["createElementVNode"])("h3",Y,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_PhoneNumbers_Add")),1)]),Object(i["createElementVNode"])("div",z,[Object(i["createElementVNode"])("div",J,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(a,{uicontrol:"select",name:"countryCodeSelect",title:e.translate("MobileMessaging_Settings_SelectCountry"),modelValue:e.countryCallingCode,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.countryCallingCode=t}),"full-width":!0,options:e.countries},null,8,["title","modelValue","options"])])]),Object(i["createElementVNode"])("div",K,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_PhoneNumbers_CountryCode_Help")),1)]),Object(i["createElementVNode"])("div",Q,[Object(i["createElementVNode"])("div",W,[Object(i["createElementVNode"])("div",X,[Z,Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(a,{uicontrol:"text",name:"countryCallingCode",title:e.translate("MobileMessaging_Settings_CountryCode"),modelValue:e.countryCallingCode,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.countryCallingCode=t}),"full-width":!0,maxlength:4},null,8,["title","modelValue"])])]),Object(i["createElementVNode"])("div",ee,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(a,{uicontrol:"text",name:"newPhoneNumber",modelValue:e.newPhoneNumber,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.newPhoneNumber=t}),title:e.translate("MobileMessaging_Settings_PhoneNumber"),"full-width":!0,maxlength:80},null,8,["modelValue","title"])])]),Object(i["createElementVNode"])("div",te,[Object(i["createVNode"])(c,{class:"valign",disabled:!e.canAddNumber||e.isAddingPhonenumber,onConfirm:t[3]||(t[3]=function(t){return e.addPhoneNumber()}),value:e.translate("General_Add")},null,8,["disabled","value"])]),Object(i["withDirectives"])(Object(i["createVNode"])(s,{severity:"warning",id:"suspiciousPhoneNumber"},{default:Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_SuspiciousPhoneNumber","54184032")),1)]})),_:1},512),[[i["vShow"],e.showSuspiciousPhoneNumber]])]),Object(i["createElementVNode"])("div",ne,Object(i["toDisplayString"])(e.strHelpAddPhone),1)]),oe,Object(i["createVNode"])(d,{loading:e.isAddingPhonenumber},null,8,["loading"]),Object.keys(e.phoneNumbers||{}).length>0?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",re,[Object(i["createElementVNode"])("h3",ie,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_ManagePhoneNumbers")),1)])):Object(i["createCommentVNode"])("",!0),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.phoneNumbers||[],(function(t,n,o){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:"form-group row",key:o},[Object(i["createElementVNode"])("div",le,[Object(i["createElementVNode"])("span",ae,Object(i["toDisplayString"])(n),1),t||e.isActivated[o]?Object(i["createCommentVNode"])("",!0):Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("input",{key:0,type:"text",class:"verificationCode","onUpdate:modelValue":function(t){return e.validationCode[o]=t},placeholder:e.translate("MobileMessaging_Settings_EnterActivationCode"),style:{"margin-right":"3.5px"}},null,8,ce)),[[i["vModelText"],e.validationCode[o]]]),t||e.isActivated[o]?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:1,disabled:!e.validationCode[o]||e.isChangingPhoneNumber,onConfirm:function(t){return e.validateActivationCode(n,o)},value:e.translate("MobileMessaging_Settings_ValidatePhoneNumber")},null,8,["disabled","onConfirm","value"])),Object(i["createVNode"])(c,{disabled:e.isChangingPhoneNumber,onConfirm:function(t){return e.removePhoneNumber(n)},value:e.translate("General_Remove"),style:{"margin-left":"3.5px"}},null,8,["disabled","onConfirm","value"])]),t||e.isActivated[o]?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",se,[Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_VerificationCodeJustSent")),1),de]))])})),128)),ue,Object(i["createVNode"])(d,{loading:e.isChangingPhoneNumber},null,8,["loading"])])}var be=Object(i["defineComponent"])({props:{isSuperUser:Boolean,defaultCallingCode:String,countries:{type:Array,required:!0},strHelpAddPhone:{type:String,required:!0},phoneNumbers:Object},components:{Field:v["Field"],SaveButton:v["SaveButton"],Alert:g["Alert"],ActivityIndicator:g["ActivityIndicator"]},data:function(){return{isAddingPhonenumber:!1,isChangingPhoneNumber:!1,isActivated:{},countryCallingCode:this.defaultCallingCode||"",newPhoneNumber:"",validationCode:{}}},methods:{validateActivationCode:function(e,t){var n=this;if(this.validationCode[t]){var o=this.validationCode[t];this.isChangingPhoneNumber=!0,g["AjaxHelper"].post({method:"MobileMessaging.validatePhoneNumber"},{phoneNumber:e,verificationCode:o},{errorElement:"#invalidVerificationCodeAjaxError"}).then((function(e){var o;if(n.isChangingPhoneNumber=!1,e&&e.value){var r=Object(g["translate"])("MobileMessaging_Settings_PhoneActivated");o=g["NotificationsStore"].show({message:r,context:"success",id:"MobileMessaging_ValidatePhoneNumber",type:"transient"}),n.isActivated[t]=!0}else{var i=Object(g["translate"])("MobileMessaging_Settings_InvalidActivationCode");o=g["NotificationsStore"].show({message:i,context:"error",id:"MobileMessaging_ValidatePhoneNumber",type:"transient"})}g["NotificationsStore"].scrollToNotification(o)})).finally((function(){n.isChangingPhoneNumber=!1}))}},removePhoneNumber:function(e){var t=this;e&&(this.isChangingPhoneNumber=!0,g["AjaxHelper"].post({method:"MobileMessaging.removePhoneNumber"},{phoneNumber:e},{errorElement:"#invalidVerificationCodeAjaxError"}).then((function(){t.isChangingPhoneNumber=!1,g["Matomo"].helper.redirect()})).finally((function(){t.isChangingPhoneNumber=!1})))},addPhoneNumber:function(){var e=this,t="+".concat(this.countryCallingCode).concat(this.newPhoneNumber);this.canAddNumber&&t.length>1&&(this.isAddingPhonenumber=!0,g["AjaxHelper"].post({method:"MobileMessaging.addPhoneNumber"},{phoneNumber:t},{errorElement:"#ajaxErrorAddPhoneNumber"}).then((function(){e.isAddingPhonenumber=!1,g["Matomo"].helper.redirect()})).finally((function(){e.isAddingPhonenumber=!1})))}},computed:{showSuspiciousPhoneNumber:function(){return 0===this.newPhoneNumber.trim().lastIndexOf("0",0)},canAddNumber:function(){return!!this.newPhoneNumber&&""!==this.newPhoneNumber}}});be.render=me;var pe=be,ge={class:"manageMobileMessagingSettings"},ve={key:0},he={key:0},je={class:"ui-confirm",id:"confirmDeleteAccount"},Oe=["value"],fe=["value"];function Ne(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("DelegateMobileMessagingSettings"),c=Object(i["resolveComponent"])("ContentBlock"),s=Object(i["resolveComponent"])("ManageSmsProvider"),d=Object(i["resolveComponent"])("ManageMobilePhoneNumbers");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ge,[e.isSuperUser?(Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:0,"content-title":e.translate("MobileMessaging_SettingsMenu")},{default:Object(i["withCtx"])((function(){return[Object(i["createVNode"])(a,{"delegate-management-options":e.delegateManagementOptions,"delegated-management":e.delegatedManagement},null,8,["delegate-management-options","delegated-management"])]})),_:1},8,["content-title"])):Object(i["createCommentVNode"])("",!0),e.accountManagedByCurrentUser?(Object(i["openBlock"])(),Object(i["createBlock"])(c,{key:1,"content-title":e.translate("MobileMessaging_Settings_SMSProvider"),feature:"true"},{default:Object(i["withCtx"])((function(){return[e.isSuperUser&&e.delegatedManagement?(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",ve,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_DelegatedSmsProviderOnlyAppliesToYou")),1)):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(s,{"credential-supplied":e.credentialSupplied,"credential-error":e.credentialError,provider:e.provider,"credit-left":e.creditLeft,"sms-provider-options":e.smsProviderOptions,"sms-providers":e.smsProviders},null,8,["credential-supplied","credential-error","provider","credit-left","sms-provider-options","sms-providers"])]})),_:1},8,["content-title"])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(c,{"content-title":e.translate("MobileMessaging_PhoneNumbers")},{default:Object(i["withCtx"])((function(){return[e.credentialSupplied?(Object(i["openBlock"])(),Object(i["createBlock"])(d,{key:1,"is-super-user":e.isSuperUser,"default-calling-code":e.defaultCallingCode,countries:e.countries,"str-help-add-phone":e.strHelpAddPhone,"phone-numbers":e.phoneNumbers},null,8,["is-super-user","default-calling-code","countries","str-help-add-phone","phone-numbers"])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",he,Object(i["toDisplayString"])(e.accountManagedByCurrentUser?e.translate("MobileMessaging_Settings_CredentialNotProvided"):e.translate("MobileMessaging_Settings_CredentialNotProvidedByAdmin")),1))]})),_:1},8,["content-title"]),Object(i["createElementVNode"])("div",je,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_DeleteAccountConfirm")),1),Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Oe),Object(i["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,fe)])])}var Me=Object(i["defineComponent"])({props:{delegateManagementOptions:{type:Array,required:!0},delegatedManagement:[Number,Boolean],isSuperUser:Boolean,defaultCallingCode:String,countries:{type:Array,required:!0},strHelpAddPhone:{type:String,required:!0},phoneNumbers:Object,accountManagedByCurrentUser:Boolean,credentialSupplied:Boolean,credentialError:String,provider:String,creditLeft:[Number,String],smsProviderOptions:{type:Object,required:!0},smsProviders:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],DelegateMobileMessagingSettings:R,ManageMobilePhoneNumbers:pe,ManageSmsProvider:T}});Me.render=Ne;var ye=Me; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */}})})); //# sourceMappingURL=MobileMessaging.umd.min.js.map