(self.webpackChunkncpasswords=self.webpackChunkncpasswords||[]).push([[11],{14675(t,e,a){"use strict";a.r(e),a.d(e,{default:()=>i});const i={}},35404(t,e,a){"use strict";a.r(e),a.d(e,{default:()=>g});var i=function(){var t=this,e=t._self._c;return e("div",{class:t.className,attrs:{"data-tag-id":t.tag.id,"data-tag-title":t.tag.label},on:{click:function(e){return t.openAction(e)}}},[t.tag.favorite?e("star-icon",{staticClass:"favorite",attrs:{"data-item-action":"favorite","fill-color":"var(--color-element-warning)"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.favoriteAction.apply(null,arguments)}}}):e("star-outline-icon",{staticClass:"favorite",attrs:{"data-item-action":"favorite","fill-color":"var(--color-placeholder-dark)"},on:{click:function(e){return e.preventDefault(),e.stopPropagation(),t.favoriteAction.apply(null,arguments)}}}),t._v(" "),e("div",{staticClass:"favicon fa fa-tag",style:{color:this.tag.color},attrs:{title:t.tag.label}}),t._v(" "),e("div",{staticClass:"title",attrs:{title:t.tag.label}},[e("span",[t._v(t._s(t.tag.label))])]),t._v(" "),t._t("middle"),t._v(" "),e("div",{staticClass:"more",attrs:{"aria-label":t.t("More")},on:{click:function(e){return t.toggleMenu()}}},[e("i",{staticClass:"fa fa-ellipsis-h"},[e("a",{attrs:{href:"#","aria-label":t.t("More"),title:t.t("More")},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.toggleMenu()}}})]),t._v(" "),e("div",{staticClass:"tagActionsMenu popovermenu bubble menu",class:{open:t.showMenu},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:(e.stopPropagation(),e.preventDefault(),t.toggleMenu(!1))}}},[t._t("menu",function(){return[e("ul",[t._t("menu-top"),t._v(" "),e("li",[e("translate",{attrs:{tag:"li",href:"#","data-item-action":"edit",icon:"edit",say:"Edit"},on:{click:function(e){return e.preventDefault(),t.editAction()}}})],1),t._v(" "),e("li",[e("translate",{attrs:{tag:"li",href:"#","data-item-action":"delete",icon:"trash",say:"Delete"},on:{click:function(e){return e.preventDefault(),t.deleteAction()}}})],1),t._v(" "),t._t("menu-bottom")],2)]})],2)]),t._v(" "),e("div",{staticClass:"date",attrs:{title:t.dateTitle}},[t._v(t._s(t.getDate))])],2)};i._withStripped=!0;var n=a(53024),s=a(48163),o=a(16129),r=a(1708),l=a(37745),c=a(46216),u=a(80444);const d={components:{Translate:n.A,StarIcon:l.A,StarOutlineIcon:c.A},props:{tag:{type:Object}},data:()=>({showMenu:!1}),computed:{getDate(){return u.A.formatDate(this.tag.edited)},dateTitle(){return u.A.translate("Last modified on {date}",{date:u.A.formatDateTime(this.tag.edited)})},className(){let t="row tag";return o.A.status.active&&(t+=-1!==o.A.status.ids.indexOf(this.tag.id)?" search-visible":" search-hidden"),t}},mounted(){r.A.register(this.tag,this.$el)},methods:{favoriteAction(){this.tag.favorite=!this.tag.favorite,s.A.updateTag(this.tag).catch(()=>{this.tag.favorite=!this.tag.favorite})},toggleMenu(t=null){this.showMenu=t?!0===t:!this.showMenu,this.showMenu?document.addEventListener("click",this.menuEvent):document.removeEventListener("click",this.menuEvent)},menuEvent(t){null===t.target.closest('[data-tag-id="'+this.tag.id+'"] .more')&&(this.showMenu=!1,document.removeEventListener("click",this.menuEvent))},openAction(t){null===t.target.closest(".more")&&this.$router.push({name:"Tags",params:{tag:this.tag.id}})},deleteAction(){s.A.deleteTag(this.tag)},editAction(){s.A.editTag(this.tag).then(t=>{this.tag=t})}},watch:{tag(t){r.A.register(t,this.$el)}}};a(51690);const g=(0,a(14486).A)(d,i,[],!1,null,null,null).exports},51690(t,e,a){var i=a(14675);i.__esModule&&(i=i.default),"string"==typeof i&&(i=[[t.id,i,""]]),i.locals&&(t.exports=i.locals),(0,a(70534).A)("04ed8644",i,!1,{})}}]);