var TcHmi;!function(TcHmi){!function(Controls){!function(Beckhoff){class TcHmiIFrame extends TcHmi.Controls.System.TcHmiControl{constructor(element,pcElement,attrs){super(element,pcElement,attrs),this.__localizedElements=new Map,this.__localizationReader=void 0,this.__destroyLocalizationWatch=null,this.__loadHandler=this.__onLoad()}__previnit(){if(this.__elementTemplateRoot=this.__element.find(".TcHmi_Controls_Beckhoff_TcHmiIFrame-template"),0===this.__elementTemplateRoot.length&&(this.__elementTemplateRoot=this.__element.find(".tchmi-iframe-template")),this.__elementFrame=this.__elementTemplateRoot.find(".TcHmi_Controls_Beckhoff_TcHmiIFrame-template-frame"),0===this.__elementFrame.length&&(this.__elementFrame=this.__elementTemplateRoot.find(".tchmi-iframe-template-frame")),0===this.__elementTemplateRoot.length||0===this.__elementFrame.length)throw new Error("Invalid Template.html");TCHMI_DESIGNER&&(this.__destroyLocalizationWatch=this.__localization.watchEx({level:TcHmi.Locale.Level.Engineering},(data=>{if(data.error===TcHmi.Errors.NONE&&data.reader){this.__localizationReader=data.reader;for(const[key,info]of this.__localizedElements){let localizedText=data.reader.get(key);info.innerHTML=localizedText}}}))),super.__previnit()}__init(){super.__init();this.__elementFrame[0].addEventListener("load",this.__loadHandler,!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!0,capture:!1})}__attach(){super.__attach(),this.__processSrc()}__detach(){super.__detach()}destroy(){if(this.__keepAlive)return;super.destroy();this.__elementFrame[0].removeEventListener("load",this.__loadHandler,!!TCHMI_EVENT_OPTION_OBJECT_SUPPORTED&&{passive:!0,capture:!1}),this.__destroyLocalizationWatch?.(),this.__destroyLocalizationWatch=null}setSrc(valueNew){let convertedValue=TcHmi.ValueConverter.toString(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal("Src")),convertedValue!==this.__src&&(this.__src=convertedValue,TcHmi.EventProvider.raise(this.__id+".onPropertyChanged",{propertyName:"Src"}),this.__processSrc())}getSrc(){return this.__src}__processSrc(){if(TCHMI_DESIGNER){const designerMessage=this.__element.find(".tchmi-designer-control-message")[0]??document.createElement("div");designerMessage.classList.add("tchmi-designer-control-message"),this.__src?(this.__localizedElements.delete("Engineering_Not_Configured"),designerMessage.innerHTML=this.__src):(designerMessage.innerHTML="Engineering_Not_Configured",this.__localizedElements.set("Engineering_Not_Configured",designerMessage),this.__localizationReader&&(designerMessage.innerHTML=this.__localizationReader.get("Engineering_Not_Configured"))),this.__element[0].appendChild(designerMessage)}else{const iframeObj=this.__elementFrame[0];this.__src&&TcHmi.Access.checkAccess(this,"observe")&&this.getIsEnabled()?iframeObj.getAttribute("src")!==this.__src&&(iframeObj.src=this.__src):""!==iframeObj.getAttribute("src")&&(iframeObj.src="")}}__processAccessConfig(){super.__processAccessConfig(),this.__processSrc()}__processIsEnabled(){super.__processIsEnabled(),this.__processSrc()}__onLoad(){return e=>{this.getIsEnabled()&&(this.__processWidth(),this.__processHeight(),TcHmi.EventProvider.raise(this.__id+".onLoad",e))}}}Beckhoff.TcHmiIFrame=TcHmiIFrame}(Controls.Beckhoff||(Controls.Beckhoff={}))}(TcHmi.Controls||(TcHmi.Controls={}))}(TcHmi||(TcHmi={})),TcHmi.Controls.registerEx("TcHmiIFrame","TcHmi.Controls.Beckhoff",TcHmi.Controls.Beckhoff.TcHmiIFrame);