import{registerTemplate as e,freezeTemplate as t,registerDecorators as s,registerComponent as i}from"@kdcloudjs/kwc";import o from"./shadowBaseClassPrivate.js";import{registerDomain as n,unregisterDomain as a}from"./messageDispatcher.js";import{i as r}from"../ssr-C2pjZzfv.js";import"../observable-tloG64m6.js";import"../i18n-B98kiI7M.js";import"./utilsPrivate.js";import"../client-Ddi3i8XR.js";import"../normalize-C0Pp7GJL.js";import"./iso8601Utils.js";import"../colorValid-qIPgkqGp.js";import"../empty_html-CjXB8rB4.js";var l=[function(e,t,s){return".kdds-non-salseforce-resource"+(e?"["+e+"]":"")+" {display: none;}"}];function c(e,t,s,i){const{b:o,h:n}=e,{_m0:a}=i;return[n("iframe",{style:t.frameStyle,attrs:{src:t.src,title:t.title,width:t.width,height:t.height,lang:t.language},key:0,on:a||(i._m0={load:o(t.handleContentLoad)})})]}var d=e(c);c.stylesheets=[],c.stylesheetToken="kwc-7d89m8ebf1g",c.legacyStylesheetToken="D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveIframe-undefined_primitiveIframe",l&&c.stylesheets.push.apply(c.stylesheets,l),t(c);class m extends o{constructor(...e){super(...e),this.src=void 0,this.domain=void 0,this.width="100%",this.height="100%",this.frameStyle="",this.title=void 0,this.language=void 0}connectedCallback(){super.connectedCallback(),n(this.src)}renderedCallback(){this.language=r&&document.documentElement.lang||null}disconnectedCallback(){a(this.src)}handleContentLoad(){const e=new CustomEvent("iframeload",{detail:{callbacks:{postToWindow:this.postToWindow.bind(this)}}});this.contentWindow=this.template.querySelector("iframe").contentWindow,this.dispatchEvent(e)}postToWindow(e){this.contentWindow&&this.contentWindow.postMessage(e,this.domain)}}s(m,{publicProps:{src:{config:0},domain:{config:0},width:{config:0},height:{config:0},frameStyle:{config:0},title:{config:0}},publicMethods:["postToWindow"],fields:["language"]});const h=i(m,{tmpl:d,sel:"D:\\new_workspace\\workspace\\kingdee-base-components\\src\\modules\\kd\\primitiveIframe-",apiVersion:63});export{h as default};
