"use strict";(self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[975],{77975:function(i,t,l){l.r(t),l.d(t,{default:function(){return d}});var n=function(){var i=this,t=i._self._c;return t("zm-dialog",{ref:"dialog",attrs:{title:i.$t("editor.editLink"),visible:i.visible,"show-close":!1,width:"600px","append-to-body":"","close-on-press-escape":!0,"aria-label":i.$t("editor.editLink")},on:{close:i.close}},[t("div",{staticClass:"link-input"},[t("zm-form",{attrs:{"label-width":"140px","label-position":"left"}},[t("zm-form-item",{attrs:{label:i.$t("editor.textToDisplay")}},[t("zm-input",{ref:"linkDisplayText",attrs:{"zm-ta":"editor-link-dialog-text-input",max:"maxlength",maxlength:"2048",label:i.$t("editor.textToDisplay")},on:{change:i.unsetSync},model:{value:i.linkDisplayText,callback:function(t){i.linkDisplayText=t},expression:"linkDisplayText"}})],1),t("zm-form-item",{attrs:{label:i.$t("editor.linkTo")}},[t("zm-input",{ref:"linkUrl",attrs:{maxlength:"2048",label:i.$t("editor.linkTo"),"zm-ta":"editor-link-dialog-url-input"},model:{value:i.linkUrl,callback:function(t){i.linkUrl=t},expression:"linkUrl"}})],1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("zm-button",{attrs:{"zm-ta":"editor-link-dialog-cancel"},on:{click:i.onCancel}},[i._v(i._s(i.$t("operation.cancel")))]),t("zm-button",{attrs:{"zm-ta":"editor-link-dialog-confirm",type:"primary",disabled:!i.linkUrl},on:{click:i.onConfirm}},[i._v(" "+i._s(i.$t("operation.confirm"))+" ")])],1)])},e=[],s=(l(45794),l(77950),l(96857)),o=s.Utils.ALLOWED_URI_REGEXP,r={name:"AddEditorLinkDialog",props:{text:{type:String,default:""},link:{type:String,default:""}},data:function(){return{linkDisplayText:"",linkUrl:"",visible:!1,isDisplayTextSyncToUrl:!1}},computed:{trimmedLowCaseLinkUrl:function(i){var t=i.linkUrl;return t.trim().toLowerCase()},isLinkUrlValid:function(i){var t=i.trimmedLowCaseLinkUrl;return!!t.length&&o.test(t)}},watch:{linkUrl:function(i){this.isDisplayTextSyncToUrl&&(this.linkDisplayText=i)},isLinkUrlValid:function(){this.$refs.dialog.refreshAria()}},methods:{open:function(){var i=this;this.visible=!0,this.$store.commit("setPreventBack",!0),this.$nextTick((function(){var t;(i.linkDisplayText=i.text.trim(),i.linkUrl=i.link,i.isDisplayTextSyncToUrl=!i.linkDisplayText,i.isInputTextDisabled)&&(null===(t=i.$refs.linkUrl)||void 0===t||t.focus())}))},close:function(){this.linkDisplayText="",this.linkUrl="",this.visible=!1,this.$store.commit("setPreventBack",!1)},unsetSync:function(){this.isDisplayTextSyncToUrl=!1},onCancel:function(){this.close(),this.$emit("cancel")},onConfirm:function(){if(this.isLinkUrlValid){if(!this.linkUrl.includes(":")){var i=this.linkUrl.split("://");this.linkUrl="http://".concat(i[2===i.length?1:0])}console.log("confirm linkUrl ".concat(this.linkUrl," with displayText ").concat(this.linkDisplayText)),this.$emit("confirm",this.linkDisplayText||this.linkUrl,this.linkUrl),this.close()}else this.$msg(this.$t("editor.invalidLink"))}}},a=r,c=l(93483),k=(0,c.Z)(a,n,e,!1,null,null,null),d=k.exports}}]);