"use strict";var e=require("@kdcloudjs/kwc"),t=require("../kddsCommon-CICoPypw.js"),s=require("./shadowBaseClassPrivate.js");require("../observable-BXDJFaLN.js");var r=require("../utilsPrivate-DL4VBetH.js");require("../client-Co_j5m_k.js"),require("../ssr-RXknEJpO.js"),require("../empty_html-hFq4zm9t.js"),require("../i18n-CP31jeWH.js"),require("./iso8601Utils.js"),require("../colorValid-BBnkvgd_.js");var n=[[function(e,t,s){return(t?(s?"":'[dir="rtl"]')+" :host":(s?"":'[dir="rtl"]')+" "+(e?"["+e+"-host]":""))+(s?":dir(rtl)":"")+" {direction: ltr;unicode-bidi: embed;}"}],[t.stylesheet0]];const o=e.parseFragment`<a${"a0:href"}${"a0:tabindex"}${3}>${"t1"}</a>`,i=e.parseFragment`<span${3}>${"t1"}</span>`;function l(e,t,s,r){const{ti:n,d:l,sp:c,st:a}=e;return[t.showLink?t.disabled?null:a(o,1,[c(0,{attrs:{href:t.link,tabindex:n(t.tabIndex)}},null),c(1,null,l(t.formattedPhoneNumber))]):null,t.showLink&&t.disabled?a(i,3,[c(1,null,l(t.formattedPhoneNumber))]):null]}var c=e.registerTemplate(l);l.stylesheets=[],l.stylesheetToken="kwc-7f8bcvsdlka",l.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedPhone-undefined_formattedPhone",n&&l.stylesheets.push.apply(l.stylesheets,n),e.freezeTemplate(l);class a extends s{constructor(...e){super(...e),this.value=void 0,this.disabled=!1,this.tabIndex=void 0,this._connected=!1}connectedCallback(){super.connectedCallback(),this._connected=!0}disconnectedCallback(){this._connected=!1}focus(){this.phoneAnchor&&this.phoneAnchor.focus()}blur(){this.phoneAnchor&&this.phoneAnchor.blur()}click(){const e=this.phoneAnchor;e&&e.click&&e.click()}get phoneAnchor(){if(this._connected&&this.showLink&&!this.disabled)return this.template.querySelector("a")}get showLink(){return null!=this.value&&""!==this.value}get formattedPhoneNumber(){return r.toNorthAmericanPhoneNumber(this.value)}get link(){return`tel:${this.value}`}}e.registerDecorators(a,{publicProps:{value:{config:0},disabled:{config:0},tabIndex:{config:0}},publicMethods:["focus","blur","click"],fields:["_connected"]});const d=e.registerComponent(a,{tmpl:c,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\formattedPhone-",apiVersion:63});module.exports=d;
