/*! Built with http://stenciljs.com */
var __generator=this&&this.__generator||function(e,t){var n,r,o,i,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(o=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=(o=l.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};webcomponents.loadBundle("pgbjiupi",["exports","./chunk-3b741dc6.js"],function(e,t){var n=window.webcomponents.h,r=function(){function e(){this.type="template"}return e.prototype.componentDidLoad=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.loadSvg=function(){return e=this,t=void 0,r=function(){var e;return __generator(this,function(t){switch(t.label){case 0:return this.loading=!0,[4,fetch(""+this.src).then(function(e){return e.text()}).catch(function(e){return console.error("Error:",e)})];case 1:return e=t.sent(),this.loading=!1,[2,e]}})},new((n=void 0)||(n=Promise))(function(o,i){function l(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(l,s)}a((r=r.apply(e,t||[])).next())});var e,t,n,r},e.prototype.parseSvg=function(e){var n=this,r=t.StringUtil;this._svg=e,e=e.replace("]>",""),e=r.replaceAll(e,"{{ ","{{"),e=r.replaceAll(e,"{{  ","{{"),e=r.replaceAll(e," }}","}}"),e=r.replaceAll(e,"  }}","}}"),this.data&&Object.keys(this.data).forEach(function(t){e=r.replaceAll(e,"{{"+t+"}}",n.data[t])}),this.svgResult=e,setTimeout(function(t){n.el.querySelector(".embedded").innerHTML=e,setTimeout(function(e){n.el.querySelector("svg")&&(n._svgElement=n.el.querySelector("svg"),n.renderSvg())},40),n.getElements()},20)},e.prototype.getElements=function(){var e=this;this.elements=[];var n=["Shape","Oval","Rectangle","Line","Group"],r=this.el.querySelectorAll("*");return Array.prototype.forEach.call(r,function(r){if(t.DomUtil.getAttributes(r).id){var o=t.DomUtil.getAttributes(r).id,i=!1;n.forEach(function(e){o.match(e)&&(i=!0)}),i||(o.match("btn-")&&(r.style.cursor="pointer",r.style.opacity="0"),e.elements.push({id:o,el:r}))}}),this.setClickHandlers(),this.elements},e.prototype.svgElementClickHandler=function(e){var t;e.stopPropagation(),this.elements.forEach(function(n){n.el===e.target&&(t=n)}),t&&this.svgElementClick.emit(t)},e.prototype.setClickHandlers=function(){var e=this;this.elements.forEach(function(t){document.getElementById(t.id).addEventListener("click",function(t){e.svgElementClickHandler(t)}),t.id.match("btn-")})},e.prototype.renderSvg=function(){var e,t,n,r=this._svgElement,o=!(-1===this.el.className.indexOf("img-responsive"));if(r.getAttribute("viewBox")&&(e=r.getAttribute("viewBox")),console.log("--------------"),console.log("svg: type="+this.type),console.log("responsive="+o),console.log("viewBox="+e),e&&(t=e.split(" ")[2],n=e.split(" ")[3],!1===o)){this.el.style.width=t+"px",this.el.style.maxWidth=t+"px",this.el.style.height=n+"px",this.el.style.maxHeight=n+"px",r.style.width=t+"px",r.style.maxWidth=t+"px",r.style.height=n+"px",r.style.maxHeight=n+"px";var i=void 0;(i=document.createAttribute("width")).value=t,r.setAttributeNode(i),(i=document.createAttribute("height")).value=n,r.setAttributeNode(i)}},e.prototype.render=function(){var e=this;return this.dataJson&&(this.data=JSON.parse(this.dataJson)),this.src&&this.loadSvg().then(function(t){e.parseSvg(t)}),n("div",null,n("div",{class:"svg-container embedded"}))},Object.defineProperty(e,"is",{get:function(){return"ema-svg"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{data:{state:!0},dataJson:{type:"Any",attr:"data-json"},el:{elementRef:!0},getElements:{method:!0},src:{type:String,attr:"src"},svgResult:{state:!0},type:{type:String,attr:"type"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"svgElementClick",method:"svgElementClick",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),e}();e.EmaSvg=r,Object.defineProperty(e,"__esModule",{value:!0})});