forked from rebillar/site-accueil-insa
20 lines
No EOL
23 KiB
JavaScript
20 lines
No EOL
23 KiB
JavaScript
(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 P})),n.d(t,"ManageSmsProvider",(function(){return T})),n.d(t,"SmsProviderCredentials",(function(){return b})),n.d(t,"DelegateMobileMessagingSettings",(function(){return L})),n.d(t,"ManageMobilePhoneNumbers",(function(){return pe})),n.d(t,"SelectPhoneNumbers",(function(){return V})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var i=n("8bbf"),l=n("19dc");function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var c={key:0};function s(e,t,n,o,r,l){var s=Object(i["resolveComponent"])("Field");return e.fields?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",c,[(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"])(s,{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),{},a({},t.name,n)))},title:e.translate(t.title)},null,8,["uicontrol","name","model-value","onUpdate:modelValue","title"])})),128))])):Object(i["createCommentVNode"])("",!0)}var d=n("a5a2"),u=Object(i["reactive"])({}),m=Object(i["defineComponent"])({props:{provider:{type:String,required:!0},modelValue:Object},emits:["update:modelValue"],components:{Field:d["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]})))):l["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]}}});m.render=s;var b=m,p=(Object(l["createAngularJsAdapter"])({component:b,scope:{provider:{angularJsBind:"="},credentials:{angularJsBind:"=value"}},directiveName:"smsProviderCredentials",transclude:!0,events:{"update:modelValue":function(e,t,n,o,r,i,l){var a=i?i.$viewValue:n.value;e!==a&&l((function(){i?(i.$setViewValue(e),i.$render()):n.value=e}))}},postCreate:function(e,t,n,o,r){var a=r;a?(a.$render=function(){Object(i["nextTick"])((function(){e.modelValue=Object(l["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value?a.$setViewValue(t.value):a.$setViewValue(e.modelValue)):t.$watch("value",(function(t){t!==e.modelValue&&Object(i["nextTick"])((function(){e.modelValue=t}))}))}}),{class:"mobile"}),g={id:"mobilePhoneNumbersHelp",class:"inline-help-node"},v=Object(i["createElementVNode"])("span",{class:"icon-info",style:{"margin-right":"3.5px"}},null,-1),h={key:0,style:{"margin-right":"3.5px"}},f={key:1,style:{"margin-right":"3.5px"}},j=["href"];
|
||
/*!
|
||
* Matomo - free/libre analytics platform
|
||
*
|
||
* @link https://matomo.org
|
||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||
*/function O(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("Field");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",p,[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",g,[v,0===e.phoneNumbers.length?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",h,Object(i["toDisplayString"])(e.translate("MobileMessaging_MobileReport_NoPhoneNumbers")),1)):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",f,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,j)])]})),_:1},8,["model-value","introduction","title","disabled","options"])])}var N=Object(i["defineComponent"])({props:{modelValue:Array,phoneNumbers:{type:[Array,Object],required:!0},withIntroduction:Boolean},emits:["update:modelValue"],components:{Field:d["Field"]},methods:{linkTo:function(e){return"?".concat(l["MatomoUrl"].stringify(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),e)))}}});N.render=O;var V=N,M=(Object(l["createAngularJsAdapter"])({component:V,require:"?ngModel",scope:{phoneNumbers:{angularJsBind:"<"},withIntroduction:{angularJsBind:"<"},value:{angularJsBind:"<",vue:"modelValue"}},$inject:["$timeout"],directiveName:"matomoSelectPhoneNumbers",events:{"update:modelValue":function(e,t,n,o,r,i,l){i&&e!==i.$viewValue&&l((function(){i.$setViewValue(e),i.$render()}))}},postCreate:function(e,t,n,o,r){var a=r;a.$render=function(){Object(i["nextTick"])((function(){e.modelValue=Object(l["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value?a.$setViewValue(t.value):a.$setViewValue(e.modelValue)}}),{key:0});
|
||
/*!
|
||
* Matomo - free/libre analytics platform
|
||
*
|
||
* @link https://matomo.org
|
||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||
*/function y(e,t,n,o,r,l){var a=Object(i["resolveComponent"])("SelectPhoneNumbers");return e.report&&"mobile"===e.report.type?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",M,[Object(i["createVNode"])(a,{"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="mobile",S=Object(i["defineComponent"])({props:{report:{type:Object,required:!0},phoneNumbers:{type:[Array,Object],required:!0}},components:{SelectPhoneNumbers:V},emits:["change"],created:function(){var e=window,t=e.resetReportParametersFunctions,n=e.updateReportParametersFunctions,o=e.getReportParametersFunctions;t[C]||(t[C]=function(e){e.phoneNumbers=[],e.formatmobile="sms"}),n[C]||(n[C]=function(e){null!==e&&void 0!==e&&e.parameters&&(e.parameters&&e.parameters.phoneNumbers&&(e.phoneNumbers=e.parameters.phoneNumbers),e.formatmobile="sms")}),o[C]||(o[C]=function(e){var t=e.phoneNumbers;return{phoneNumbers:t||[""]}})}});S.render=y;var P=S,A=Object(i["createElementVNode"])("div",{id:"ajaxErrorManageSmsProviderSettings"},null,-1),E={key:0},k={key:0},_=Object(i["createElementVNode"])("br",null,null,-1),B={key:1},w=Object(i["createElementVNode"])("br",null,null,-1),x=["innerHTML"],D={key:1},F={id:"accountForm"},U=["innerHTML"];function $(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"]),A,e.credentialSupplied?(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",E,[e.credentialError?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",k,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_CredentialInvalid",e.provider)),1),_,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.credentialError),1)])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",B,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_CredentialProvided",e.provider))+" "+Object(i["toDisplayString"])(e.creditLeft),1)),w,Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.updateOrDeleteAccountText),onClick:t[0]||(t[0]=function(t){return e.onUpdateOrDeleteClick(t)})},null,8,x)])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("p",D,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_PleaseSignUp")),1)),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",F,[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,U)],512),[[i["vShow"],!e.credentialSupplied||e.showAccountForm],[u]])])}var H=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:l["ActivityIndicator"],Field:d["Field"],SaveButton:d["SaveButton"],SmsProviderCredentials:b},directives:{Form:d["Form"]},data:function(){return{isDeletingAccount:!1,isUpdatingAccount:!1,showAccountForm:!1,credentials:null,smsProvider:this.provider}},methods:{deleteApiAccount:function(){var e=this;this.isDeletingAccount=!0,l["AjaxHelper"].fetch({method:"MobileMessaging.deleteSMSAPICredential"},{errorElement:"#ajaxErrorManageSmsProviderSettings"}).then((function(){l["Matomo"].helper.redirect()})).finally((function(){e.isDeletingAccount=!1}))},showUpdateAccount:function(){this.showAccountForm=!0},updateAccount:function(){var e=this;this.isUpdateAccountPossible&&(this.isUpdatingAccount=!0,l["AjaxHelper"].post({method:"MobileMessaging.setSMSAPICredential"},{provider:this.smsProvider,credentials:this.credentials},{errorElement:"#ajaxErrorManageSmsProviderSettings"}).then((function(){l["Matomo"].helper.redirect()})).finally((function(){e.isUpdatingAccount=!1})))},deleteAccount:function(){var e=this;l["Matomo"].helper.modalConfirm("#confirmDeleteAccount",{yes:function(){e.isDeletingAccount=!0,l["AjaxHelper"].fetch({method:"MobileMessaging.deleteSMSAPICredential"},{errorElement:"#ajaxErrorManageSmsProviderSettings"}).then((function(){e.isDeletingAccount=!1,l["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(l["translate"])("MobileMessaging_Settings_UpdateOrDeleteAccount",'<a id="displayAccountForm">',"</a>",'<a id="deleteAccount">',"</a>")},currentProviderDescription:function(){return this.smsProvider&&this.smsProviders?this.smsProviders[this.smsProvider]:""}}});H.render=$;var T=H;function q(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:d["Field"],SaveButton:d["SaveButton"]},data:function(){return{isLoading:!1,enabled:this.delegatedManagement?1:0}},methods:{save:function(){var e=this;this.isLoading=!0,l["AjaxHelper"].post({method:"MobileMessaging.setDelegatedManagement"},{delegatedManagement:this.enabled&&"0"!==this.enabled?"true":"false"}).then((function(){var e=l["NotificationsStore"].show({message:Object(l["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"mobileMessagingSettings",type:"transient",context:"success"});l["NotificationsStore"].scrollToNotification(e),l["Matomo"].helper.redirect()})).finally((function(){e.isLoading=!1}))}}});I.render=q;var L=I,J={key:0},R={class:"row"},z={class:"col s12"},G={class:"form-group row"},Y={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",J,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_DelegatedPhoneNumbersOnlyUsedByYou")),1)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",R,[Object(i["createElementVNode"])("h3",z,Object(i["toDisplayString"])(e.translate("MobileMessaging_Settings_PhoneNumbers_Add")),1)]),Object(i["createElementVNode"])("div",G,[Object(i["createElementVNode"])("div",Y,[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:d["Field"],SaveButton:d["SaveButton"],Alert:l["Alert"],ActivityIndicator:l["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,l["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(l["translate"])("MobileMessaging_Settings_PhoneActivated");o=l["NotificationsStore"].show({message:r,context:"success",id:"MobileMessaging_ValidatePhoneNumber",type:"transient"}),n.isActivated[t]=!0}else{var i=Object(l["translate"])("MobileMessaging_Settings_InvalidActivationCode");o=l["NotificationsStore"].show({message:i,context:"error",id:"MobileMessaging_ValidatePhoneNumber",type:"transient"})}l["NotificationsStore"].scrollToNotification(o)})).finally((function(){n.isChangingPhoneNumber=!1}))}},removePhoneNumber:function(e){var t=this;e&&(this.isChangingPhoneNumber=!0,l["AjaxHelper"].post({method:"MobileMessaging.removePhoneNumber"},{phoneNumber:e},{errorElement:"#invalidVerificationCodeAjaxError"}).then((function(){t.isChangingPhoneNumber=!1,l["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,l["AjaxHelper"].post({method:"MobileMessaging.addPhoneNumber"},{phoneNumber:t},{errorElement:"#ajaxErrorAddPhoneNumber"}).then((function(){e.isAddingPhonenumber=!1,l["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;
|
||
/*!
|
||
* 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
|