System.register(["./index-c820db66.system.js","./index-dc84aac6.system.js","./index-2d937df8.system.js","./index-9ceb7f8c.system.js","./_commonjsHelpers-c8881874.system.js","./index-b0fe4e4c.system.js"],(function(e){"use strict";var t,i,s,n,a,r;return{setters:[function(e){t=e.r;i=e.j;s=e.h;n=e.g},function(e){a=e.e},function(e){r=e.d},function(){},function(){},function(){}],execute:function(){var d={Add:"Lägg till"};function l(e){return r.create({sv:d},e)}var o=".sc-ig-email-addresses-h{display:block}smoothly-icon.sc-ig-email-addresses{cursor:pointer;float:right;margin-top:-1.5em;padding-bottom:.5em;visibility:hidden}ig-email-address.sc-ig-email-addresses{clear:both}.sc-ig-email-addresses-h:hover smoothly-icon.sc-ig-email-addresses{visibility:visible}";var u=e("ig_email_addresses",function(){function e(e){t(this,e);this.changed=i(this,"changed",7);this.editable=true;this.adding=false}Object.defineProperty(e.prototype,"types",{get:function(){var e=this;return a.types.filter((function(t){return a.is(e.value)?!e.value[t]:e.value?t!="primary":t}))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"emailAddresses",{get:function(){return a.is(this.value)?Object.assign({},this.value):{primary:this.value}},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){this.t=l(this.element)};e.prototype.onEdit=function(e){var t=e.detail.type;delete e.detail.type;var i;if(!a.is(this.value))i=e.detail.value;else{i=Object.assign({},this.value);i[t]=e.detail.value}this.changed.emit(this.value=i)};e.prototype.onDelete=function(e){var t=e.detail;var i=Object.assign({},this.emailAddresses);delete i[t];this.changed.emit(this.value=i)};e.prototype.onAdd=function(e){var t=e.detail.type;var i=e.detail.value;var s=this.emailAddresses;s[t]=i;this.changed.emit(this.value=s);this.adding=false};e.prototype.render=function(){var e=this;return[this.adding?s("ig-email-input",{onEdit:function(){return e.adding=false},types:this.types,mode:"add",onAdd:function(t){return e.onAdd(t)}}):[],this.editable&&this.types.length>0?s("smoothly-icon",{name:"add-circle",toolTip:this.t("Add"),fill:"clear",size:"medium",color:"success",style:this.adding?{display:"none"}:{},onClick:function(){return e.adding=true}}):[],a.is(this.value)?a.map(this.value,(function(t,i){return[s("ig-email-address",{value:i,type:t,editable:e.editable,onEdit:function(t){return e.onEdit(t)},onDelete:function(t){return e.onDelete(t)}})]})):this.value?s("ig-email-address",{value:this.value,editable:this.editable,onEdit:function(t){return e.onEdit(t)},onDelete:function(t){return e.onDelete(t)}}):[]]};Object.defineProperty(e.prototype,"element",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());u.style=o}}}));