/
notifications-node_modules_moment_locale_sync_recursive_-src_NotificationsApp_vue-data_image_svg_xml_base64-ab95a3.js
3 lines (3 loc) · 33.1 KB
/
notifications-node_modules_moment_locale_sync_recursive_-src_NotificationsApp_vue-data_image_svg_xml_base64-ab95a3.js
1
2
3
/*! For license information please see notifications-node_modules_moment_locale_sync_recursive_-src_NotificationsApp_vue-data_image_svg_xml_base64-ab95a3.js.LICENSE.txt */
(self.webpackChunknotifications=self.webpackChunknotifications||[]).push([["node_modules_moment_locale_sync_recursive_-src_NotificationsApp_vue-data_image_svg_xml_base64-ab95a3"],{92462:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(87537),n=i.n(s),a=i(23645),o=i.n(a)()(n());o.push([t.id,".notification[data-v-df6663b6]{background-color:var(--color-main-background)}.notification[data-v-df6663b6] img.notification-icon{display:flex;width:32px;height:32px;filter:var(--background-invert-if-dark)}.notification[data-v-df6663b6] .rich-text--wrapper{white-space:pre-wrap;word-break:break-word}.notification .notification-subject[data-v-df6663b6]{padding:4px}.notification a.notification-subject[data-v-df6663b6]:focus-visible{box-shadow:inset 0 0 0 2px var(--color-main-text) !important}","",{version:3,sources:["webpack://./src/Components/Notification.vue"],names:[],mappings:"AACA,+BACC,6CAAA,CAEA,qDACC,YAAA,CACA,UAAA,CACA,WAAA,CACA,uCAAA,CAED,mDACC,oBAAA,CACA,qBAAA,CAGD,qDACC,WAAA,CAGD,oEACC,4DAAA",sourcesContent:["\n.notification {\n\tbackground-color: var(--color-main-background);\n\n\t:deep(img.notification-icon) {\n\t\tdisplay: flex;\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tfilter: var(--background-invert-if-dark);\n\t}\n\t:deep(.rich-text--wrapper) {\n\t\twhite-space: pre-wrap;\n\t\tword-break: break-word;\n\t}\n\n\t.notification-subject {\n\t\tpadding: 4px;\n\t}\n\n\ta.notification-subject:focus-visible {\n\t\tbox-shadow: inset 0 0 0 2px var(--color-main-text) !important; // override rule in core/css/headers.scss #header a:focus-visible\n\t}\n}\n\n"],sourceRoot:""}]);const r=o},36839:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(87537),n=i.n(s),a=i(23645),o=i.n(a)()(n());o.push([t.id,'.external[data-v-39222bd6]:after{content:" ↗"}',"",{version:3,sources:["webpack://./DefaultParameter.vue","webpack://./src/Components/Parameters/DefaultParameter.vue"],names:[],mappings:"AAAA,iCCCA,YACC",sourcesContent:['.external:after{content:" ↗"}',"\n.external:after {\n\tcontent: ' ↗';\n}\n"],sourceRoot:""}]);const r=o},59160:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(87537),n=i.n(s),a=i(23645),o=i.n(a)()(n());o.push([t.id,".mention[data-v-b064c4b8]{display:contents;white-space:nowrap}","",{version:3,sources:["webpack://./src/Components/Parameters/User.vue"],names:[],mappings:"AACA,0BACC,gBAAA,CACA,kBAAA",sourcesContent:["\n.mention {\n\tdisplay: contents;\n\twhite-space: nowrap;\n}\n"],sourceRoot:""}]);const r=o},22627:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var s=i(87537),n=i.n(s),a=i(23645),o=i.n(a)()(n());o.push([t.id,".notification-container[data-v-280ff602]{overflow:hidden}.notification-wrapper[data-v-280ff602]{max-height:calc(100vh - 200px);overflow:auto}[data-v-280ff602] .empty-content{margin:12vh 10px}[data-v-280ff602] .empty-content p{color:var(--color-text-maxcontrast)}.icon-alert-outline[data-v-280ff602]{background-size:64px;width:64px;height:64px}.fade-enter-active[data-v-280ff602],.fade-leave-active[data-v-280ff602]{transition:opacity var(--animation-quick) ease}.fade-enter-from[data-v-280ff602],.fade-leave-to[data-v-280ff602]{opacity:0}.list-move[data-v-280ff602],.list-enter-active[data-v-280ff602],.list-leave-active[data-v-280ff602]{transition:all var(--animation-quick) ease}.list-enter-from[data-v-280ff602],.list-leave-to[data-v-280ff602]{opacity:0;transform:translateX(30px)}.list-leave-active[data-v-280ff602]{width:100%}","",{version:3,sources:["webpack://./src/NotificationsApp.vue"],names:[],mappings:"AACA,yCAEC,eAAA,CAGD,uCACC,8BAAA,CACA,aAAA,CAGD,iCACC,gBAAA,CAEA,mCACC,mCAAA,CAIF,qCACC,oBAAA,CACA,UAAA,CACA,WAAA,CAGD,wEAEC,8CAAA,CAGD,kEAEC,SAAA,CAGD,oGAGC,0CAAA,CAGD,kEAEC,SAAA,CACA,0BAAA,CAGD,oCACC,UAAA",sourcesContent:["\n.notification-container {\n\t/* Prevent slide animation to go out of the div */\n\toverflow: hidden;\n}\n\n.notification-wrapper {\n\tmax-height: calc(100vh - 50px * 4);\n\toverflow: auto;\n}\n\n::v-deep .empty-content {\n\tmargin: 12vh 10px;\n\n\tp {\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n}\n\n.icon-alert-outline {\n\tbackground-size: 64px;\n\twidth: 64px;\n\theight: 64px;\n}\n\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity var(--animation-quick) ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.list-move,\n.list-enter-active,\n.list-leave-active {\n\ttransition: all var(--animation-quick) ease;\n}\n\n.list-enter-from,\n.list-leave-to {\n\topacity: 0;\n\ttransform: translateX(30px);\n}\n\n.list-leave-active {\n\twidth: 100%;\n}\n"],sourceRoot:""}]);const r=o},46700:(t,e,i)=>{var s={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function n(t){var e=a(t);return i(e)}function a(t){if(!i.o(s,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return s[t]}n.keys=function(){return Object.keys(s)},n.resolve=a,t.exports=n,n.id=46700},67068:(e,i,s)=>{"use strict";s.r(i),s.d(i,{default:()=>nt});var n=s(93664),a=s(57274),o=s(82675),r=s(56194),c=s(64024),l=s(43554),u=s(41766),d=s(69183);const h={name:"Action",components:{NcButton:a.Z},props:{label:{type:String,default:"",required:!0},link:{type:String,default:"",required:!0},type:{type:String,default:"",required:!0},primary:{type:Boolean,default:!1,required:!0},notificationIndex:{type:Number,required:!0}},data:()=>({tabbed:!1}),computed:{isWebLink(){return"WEB"===this.typeWithDefault},typeWithDefault(){return this.type||"GET"},buttonType(){return this.primary?"primary":"secondary"}},methods:{async onClickActionButtonWeb(e){try{const t={cancelAction:!1,notification:this.$parent.$props,action:{url:this.link,type:this.typeWithDefault}};await(0,d.j8)("notifications:action:execute",t),t.cancelAction&&e.preventDefault()}catch(e){console.error("Failed to perform action",e),(0,c.x2)(t("notifications","Failed to perform action"))}},async onClickActionButton(){try{const t={cancelAction:!1,notification:this.$parent.$props,action:{url:this.link,type:this.typeWithDefault}};if(await(0,d.j8)("notifications:action:execute",t),t.cancelAction)return;await(0,n.Z)({method:this.typeWithDefault,url:this.link}),this.$parent._$el.fadeOut(OC.menuSpeed),this.$parent.$emit("remove",this.notificationIndex),(0,d.j8)("notifications:action:executed",t);try{$("body").trigger(new $.Event("OCA.Notification.Action",{notification:this.$parent,action:{url:this.link,type:this.typeWithDefault}}))}catch(t){console.error(t)}}catch(e){console.error("Failed to perform action",e),(0,c.x2)(t("notifications","Failed to perform action"))}}}};var p=s(51900);const f=(0,p.Z)(h,(function(){var t=this,e=t._self._c;return t.isWebLink?e("NcButton",{staticClass:"action-button pull-right",attrs:{type:"primary",href:t.link},on:{click:t.onClickActionButtonWeb}},[t._v("\n\t"+t._s(t.label)+"\n")]):t.isWebLink?t._e():e("NcButton",{staticClass:"action-button pull-right",attrs:{type:t.buttonType},on:{click:t.onClickActionButton}},[t._v("\n\t"+t._s(t.label)+"\n")])}),[],!1,null,null,null).exports;var g=s(79753),m=s(80351),v=s.n(m),b=s(48238);const j={name:"DefaultParameter",props:{type:{type:String,required:!0},id:{type:[Number,String],required:!0},name:{type:String,required:!0},link:{type:String,default:""}},computed:{hasInternalLink(){return this.link&&("deck-board"===this.type||"deck-card"===this.type)}}};var y=s(93379),A=s.n(y),C=s(7795),w=s.n(C),_=s(90569),k=s.n(_),I=s(3565),N=s.n(I),x=s(19216),S=s.n(x),Z=s(44589),B=s.n(Z),M=s(36839),D={};D.styleTagTransform=B(),D.setAttributes=N(),D.insert=k().bind(null,"head"),D.domAPI=w(),D.insertStyleElement=S();A()(M.Z,D);M.Z&&M.Z.locals&&M.Z.locals;const T=(0,p.Z)(j,(function(){var t=this,e=t._self._c;return t.hasInternalLink?e("a",{attrs:{href:t.link}},[e("strong",[t._v(t._s(t.name))])]):t.link?e("a",{staticClass:"external",attrs:{href:t.link,target:"_blank",rel:"noopener noreferrer"}},[e("strong",[t._v(t._s(t.name))])]):e("strong",[t._v(t._s(t.name))])}),[],!1,null,"39222bd6",null).exports;const P={name:"File",props:{type:{type:String,required:!0},id:{type:[Number,String],required:!0},name:{type:String,required:!0},path:{type:String,default:""},link:{type:String,default:""}},computed:{title(){const e=this.path.lastIndexOf("/"),i=this.path.indexOf("/"),s=this.path.substring(0===i?1:0,e);return 0===s.length?"":t("notifications","in {path}",{path:s})}}};const L=(0,p.Z)(P,(function(){var t=this;return(0,t._self._c)("a",{staticClass:"filename",attrs:{title:t.title,href:t.link}},[t._v(t._s(t.name))])}),[],!1,null,null,null).exports;const O={name:"User",components:{NcUserBubble:s(91562).Z},props:{type:{type:String,required:!0},id:{type:String,required:!0},name:{type:String,required:!0},server:{type:String,default:""}},computed:{cloudId(){return this.server?this.id+"@"+this.server:""}}};var z=s(59160),R={};R.styleTagTransform=B(),R.setAttributes=N(),R.insert=k().bind(null,"head"),R.domAPI=w(),R.insertStyleElement=S();A()(z.Z,R);z.Z&&z.Z.locals&&z.Z.locals;const G=(0,p.Z)(O,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"mention"},[t.cloudId?e("strong",{attrs:{title:t.cloudId}},[t._v("\n\t\t"+t._s(t.name)+"\n\t")]):e("NcUserBubble",{attrs:{"display-name":t.name,user:t.id}})],1)}),[],!1,null,"b064c4b8",null).exports,E={name:"Notification",components:{Action:f,NcButton:a.Z,Close:o.default,Message:r.Z,RichText:b.ZP},props:{notificationId:{type:Number,default:-1},datetime:{type:String,default:""},app:{type:String,default:""},icon:{type:String,default:""},link:{type:String,default:""},externalLink:{type:String,default:""},user:{type:String,default:""},message:{type:String,default:""},messageRich:{type:String,default:""},messageRichParameters:{type:[Object,Array],default:()=>({})},subject:{type:String,default:""},subjectRich:{type:String,default:""},subjectRichParameters:{type:[Object,Array],default:()=>({})},objectType:{type:String,default:""},objectId:{type:String,default:""},shouldNotify:{type:Boolean,default:!0},actions:{type:Array,default:()=>[]},index:{type:Number,default:-1}},data:()=>({showFullMessage:!1}),_$el:null,computed:{timestamp(){return"warning"===this.datetime?0:new Date(this.datetime).valueOf()},absoluteDate(){return"warning"===this.datetime?"":v()(this.timestamp).format("LLL")},relativeDate(){if("warning"===this.datetime)return"";const e=v()().diff(v()(this.timestamp));return e>=0&&e<45e3?t("core","seconds ago"):v()(this.timestamp).fromNow()},useLink(){if(!this.link)return!1;let t=!1;return Object.keys(this.subjectRichParameters).forEach((e=>{this.subjectRichParameters[e].link&&(t=!0)})),!t},preparedSubjectParameters(){return this.prepareParameters(this.subjectRichParameters)},preparedMessageParameters(){return this.prepareParameters(this.messageRichParameters)},isCollapsedMessage(){return this.message.length>200&&!this.showFullMessage}},mounted(){if(this._$el=$(this.$el),void 0===this.$parent.$parent.$parent.showBrowserNotifications&&console.error("Failed to read showBrowserNotifications property from App component"),this.$parent.$parent.$parent.backgroundFetching){const t={notification:this.$props};(0,d.j8)("notifications:notification:received",t)}if(this.shouldNotify&&this.$parent.$parent.$parent.showBrowserNotifications)if(this._createWebNotification(),"spreed"===this.app&&"call"===this.objectType){if((0,l.j)("notifications","sound_talk")){new u.Howl({src:[(0,g.generateFilePath)("notifications","img","talk.ogg")],volume:.5}).play()}}else if((0,l.j)("notifications","sound_notification")){new u.Howl({src:[(0,g.generateFilePath)("notifications","img","notification.ogg")],volume:.5}).play()}},methods:{prepareParameters(t){const e={};return Object.keys(t).forEach((i=>{const s=t[i].type;e[i]="user"===s?{component:G,props:t[i]}:"file"===s?{component:L,props:t[i]}:{component:T,props:t[i]}})),e},onClickMessage(t){(t.target.closest(".rich-text--wrapper")||!this.messageRich&&this.message)&&(this.showFullMessage=!this.showFullMessage)},onDismissNotification(){n.Z.delete((0,g.generateOcsUrl)("apps/notifications/api/v2/notifications/{id}",{id:this.notificationId})).then((()=>{this.$emit("remove",this.index)})).catch((()=>{(0,c.x2)(t("notifications","Failed to dismiss notification"))}))},_createWebNotification(){const t=new Notification(this.subject,{title:this.subject,lang:OC.getLocale(),body:this.message,icon:this.icon,tag:this.notificationId});this.link&&(t.onclick=async function(t){const e={cancelAction:!1,notification:this.$props,action:{url:this.link,type:"WEB"}};await(0,d.j8)("notifications:action:execute",e),e.cancelAction||(console.debug("Redirecting because of a click onto a notification",this.link),window.location.href=this.link),window.focus()}.bind(this))}}};var W=s(92462),F={};F.styleTagTransform=B(),F.setAttributes=N(),F.insert=k().bind(null,"head"),F.domAPI=w(),F.insertStyleElement=S();A()(W.Z,F);W.Z&&W.Z.locals&&W.Z.locals;const q=(0,p.Z)(E,(function(){var t=this,e=t._self._c;return e("li",{staticClass:"notification",attrs:{"data-id":t.notificationId,"data-timestamp":t.timestamp,"data-object-type":t.objectType,"data-app":t.app}},[e("div",{staticClass:"notification-heading"},[e("span",{staticClass:"hidden-visually"},[t._v(t._s(t.absoluteDate))]),t._v(" "),t.timestamp?e("span",{staticClass:"notification-time live-relative-timestamp",attrs:{title:t.absoluteDate,"data-timestamp":t.timestamp}},[t._v(t._s(t.relativeDate))]):t._e(),t._v(" "),t.timestamp?e("NcButton",{staticClass:"notification-dismiss-button",attrs:{type:"tertiary","aria-label":t.t("notifications","Dismiss")},on:{click:t.onDismissNotification},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Close",{attrs:{size:20}})]},proxy:!0}],null,!1,2121748766)}):t._e()],1),t._v(" "),t.externalLink?e("a",{staticClass:"notification-subject full-subject-link external",attrs:{href:t.externalLink,target:"_blank",rel:"noreferrer noopener"}},[e("span",{staticClass:"image"},[e("img",{staticClass:"notification-icon",attrs:{src:t.icon,alt:""}})]),t._v(" "),e("span",{staticClass:"subject"},[t._v(t._s(t.subject)+" ↗")])]):t.useLink?e("a",{staticClass:"notification-subject full-subject-link",attrs:{href:t.link}},[t.icon?e("span",{staticClass:"image"},[e("img",{staticClass:"notification-icon",attrs:{src:t.icon,alt:""}})]):t._e(),t._v(" "),t.subjectRich?e("RichText",{attrs:{text:t.subjectRich,arguments:t.preparedSubjectParameters}}):e("span",{staticClass:"subject"},[t._v(t._s(t.subject))])],1):e("div",{staticClass:"notification-subject"},[t.icon?e("span",{staticClass:"image"},[e("img",{staticClass:"notification-icon",attrs:{src:t.icon,alt:""}})]):t._e(),t._v(" "),t.subjectRich?e("RichText",{attrs:{text:t.subjectRich,arguments:t.preparedSubjectParameters}}):e("span",{staticClass:"subject"},[t._v(t._s(t.subject))])],1),t._v(" "),t.message?e("div",{staticClass:"notification-message",on:{click:t.onClickMessage}},[e("div",{staticClass:"message-container",class:{collapsed:t.isCollapsedMessage}},[t.messageRich?e("RichText",{attrs:{text:t.messageRich,arguments:t.preparedMessageParameters,autolink:!0}}):e("span",[t._v(t._s(t.message))])],1),t._v(" "),t.isCollapsedMessage?e("div",{staticClass:"notification-overflow"}):t._e()]):t._e(),t._v(" "),t.actions.length?e("div",{staticClass:"notification-actions"},t._l(t.actions,(function(i,s){return e("Action",t._b({key:s,attrs:{"notification-index":t.index}},"Action",i,!1))})),1):t.externalLink?e("div",{staticClass:"notification-actions"},[e("NcButton",{staticClass:"action-button pull-right",attrs:{type:"primary",href:"https://nextcloud.com/fairusepolicy",target:"_blank",rel:"noreferrer noopener"},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Message",{attrs:{size:20}})]},proxy:!0}])},[t._v("\n\t\t\t"+t._s(t.t("notifications","Contact Nextcloud GmbH"))+" ↗\n\t\t")])],1):t._e()])}),[],!1,null,"df6663b6",null).exports;var H=s(77958);const U=(0,s(62556).Kc)("notifications").clearOnLogout().persist().build(),Y=t=>(t.notificationId=t.notification_id,t.objectId=t.object_id,t.objectType=t.object_type,delete t.notification_id,delete t.object_id,delete t.object_type,t),X=async t=>{let e={};t&&(e={headers:{"If-None-Match":t}});try{const t=await n.Z.get((0,g.generateOcsUrl)("apps/notifications/api/v2/notifications"),e);U.setItem("status",""+t.status),204!==t.status&&(U.setItem("headers",JSON.stringify(t.headers)),U.setItem("data",JSON.stringify(t.data.ocs.data.map(Y))))}catch(t){var i;null!=t&&null!==(i=t.response)&&void 0!==i&&i.status?U.setItem("status",""+t.response.status):U.setItem("status","500")}};var J=s(22534),Q=s(59639),V=s(22175),K=s(42515),tt=s(78378);const et={name:"NotificationsApp",components:{NcButton:a.Z,Close:o.default,Bell:Q.Z,Message:r.Z,NcEmptyContent:V.Z,NcHeaderMenu:tt.Z,Notification:q},data(){var t;return{webNotificationsGranted:!1,backgroundFetching:!1,hasNotifyPush:!1,shutdown:!1,theming:(null===(t=(0,K.getCapabilities)())||void 0===t?void 0:t.theming)||{},hasThrottledPushNotifications:(0,l.j)("notifications","throttled_push_notifications"),notifications:[],lastETag:null,lastTabId:null,userStatus:null,tabId:null,pollIntervalBase:3e4,pollIntervalCurrent:3e4,interval:null,pushEndpoints:null,open:!1}},_$icon:null,computed:{isRedThemed(){var t;if(null!==(t=this.theming)&&void 0!==t&&t.color){const t=this.rgbToHsl(this.theming.color.substring(1,3),this.theming.color.substring(3,5),this.theming.color.substring(5,7)),e=360*t[0];return(e>=330||e<=15)&&t[1]>.4&&(t[2]>.1||t[2]<.6)}return!1},isOrangeThemed(){var t;if(null!==(t=this.theming)&&void 0!==t&&t.color){const t=this.rgbToHsl(this.theming.color.substring(1,3),this.theming.color.substring(3,5),this.theming.color.substring(5,7)),e=360*t[0];return(e>=305||e<=64)&&t[1]>.7&&(t[2]>.1||t[2]<.6)}return!1},showBrowserNotifications(){return this.backgroundFetching&&this.webNotificationsGranted&&"dnd"!==this.userStatus&&this.tabId===this.lastTabId},emptyContentMessage(){return null===this.webNotificationsGranted?t("notifications","Requesting browser permissions to show notifications"):this.hasThrottledPushNotifications?t("notifications","Push notifications might be unreliable"):t("notifications","No notifications")},emptyContentDescription(){return this.hasThrottledPushNotifications?t("notifications","Nextcloud GmbH sponsors a free push notification gateway for private users. To ensure good service, the gateway limits the number of push notifications per server. For enterprise users, a more scalable gateway is available. Contact Nextcloud GmbH for more information."):""},warningIcon:()=>(0,g.imagePath)("core","actions/alert-outline.svg")},mounted(){this.tabId=OC.requestToken||""+Math.random(),this._$icon=$(this.$refs.icon),this._oldcount=0,console.debug("Registering notifications container as a menu"),OC.registerMenu($(this.$refs.button),$(this.$refs.container),void 0,!0),this.checkWebNotificationPermissions(),this._fetch();(0,J.listen)("notify_notification",(()=>{this._fetchAfterNotifyPush()}))&&(console.debug("Has notify_push enabled, slowing polling to 15 minutes"),this.pollIntervalBase=9e5,this.hasNotifyPush=!0),this._setPollingInterval(this.pollIntervalBase),this._watchTabVisibility(),(0,d.Ld)("networkOffline",this.handleNetworkOffline),(0,d.Ld)("networkOnline",this.handleNetworkOnline),(0,d.Ld)("user_status:status.updated",this.userStatusUpdated)},beforeDestroy(){(0,d.r1)("user_status:status.updated",this.userStatusUpdated),(0,d.r1)("networkOffline",this.handleNetworkOffline),(0,d.r1)("networkOnline",this.handleNetworkOnline)},methods:{userStatusUpdated(t){(0,H.ts)().uid===t.userId&&(this.userStatus=t.status)},onOpen(){this.requestWebNotificationPermissions()},handleNetworkOffline(){console.debug("Network is offline, slowing down pollingInterval to "+10*this.pollIntervalBase),this._setPollingInterval(10*this.pollIntervalBase)},handleNetworkOnline(){this._fetch(),console.debug("Network is online, reseting pollingInterval to "+this.pollIntervalBase),this._setPollingInterval(this.pollIntervalBase)},setupBackgroundFetcher(){OC.config.session_keepalive?(console.debug("Started background fetcher as session_keepalive is enabled"),this.interval=window.setInterval(this._backgroundFetch.bind(this),this.pollIntervalCurrent)):console.debug("Did not start background fetcher as session_keepalive is off")},onDismissAll(){n.Z.delete((0,g.generateOcsUrl)("apps/notifications/api/v2/notifications")).then((()=>{this.notifications=[]})).catch((()=>{(0,c.x2)(t("notifications","Failed to dismiss all notifications"))}))},onRemove(t){this.notifications.splice(t,1)},rgbToHsl(t,e,i){t=parseInt(t,16)/255,e=parseInt(e,16)/255,i=parseInt(i,16)/255;const s=Math.max(t,e,i),n=Math.min(t,e,i);let a,o;const r=(s+n)/2;if(s===n)a=o=0;else{const c=s-n;switch(o=r>.5?c/(2-s-n):c/(s+n),s){case t:a=(e-i)/c+(e<i?6:0);break;case e:a=(i-t)/c+2;break;case i:a=(t-e)/c+4}a/=6}return[a,o,r]},_updateDocTitleOnNewNotifications(t){t.length>this._oldcount&&(this._oldcount=t.length,this.backgroundFetching&&document.hidden&&(document.title.startsWith("* ")||(document.title="* "+document.title)))},_restoreTitle(){document.title.startsWith("* ")&&(document.title=document.title.substring(2))},_fetchAfterNotifyPush(){this.backgroundFetching=!0,this.hasNotifyPush&&this.tabId!==this.lastTabId?(console.debug("Deferring notification refresh from browser storage are notify_push event to give the last tab the chance to do it"),setTimeout((()=>{this._fetch()}),5e3)):(console.debug("Refreshing notifications are notify_push event"),this._fetch())},async _fetch(){const t=await(async(t,e,i,s)=>{const n=parseInt(U.getItem("lastUpdated"),10),a=U.getItem("tabId"),o=v()().format("X");return(i||a===t&&n+25<o||a===t&&s||n+35<o)&&(U.setItem("tabId",t),U.setItem("lastUpdated",o),await X(e)),{status:parseInt(U.getItem("status"),10),headers:JSON.parse(U.getItem("headers")||"[]"),data:JSON.parse(U.getItem("data")||"[]"),tabId:U.getItem("tabId"),lastUpdated:parseInt(U.getItem("lastUpdated"),10)}})(this.tabId,this.lastETag,!this.backgroundFetching,this.hasNotifyPush);204===t.status?(console.debug("Fetching notifications but no content, slowing down polling to "+10*this.pollIntervalBase),this._setPollingInterval(10*this.pollIntervalBase)):200===t.status?(this.userStatus=t.headers["x-nextcloud-user-status"],this.lastETag=t.headers.etag,this.lastTabId=t.tabId,this.notifications=t.data,console.debug("Got notification data, restoring default polling interval."),this._setPollingInterval(this.pollIntervalBase),this._updateDocTitleOnNewNotifications(this.notifications)):304===t.status?this._setPollingInterval(this.pollIntervalBase):503===t.status?(console.info("Slowing down notifications: instance is in maintenance mode."),this._setPollingInterval(10*this.pollIntervalBase)):404===t.status?(console.info("Slowing down notifications: app is disabled."),this._setPollingInterval(10*this.pollIntervalBase)):(console.info("Slowing down notifications: Status "+t.status),this._setPollingInterval(10*this.pollIntervalBase))},_backgroundFetch(){this.backgroundFetching=!0,this._fetch()},_watchTabVisibility(){document.addEventListener("visibilitychange",this._visibilityChange,!1)},_visibilityChange(){document.hidden||this._restoreTitle()},_setPollingInterval(t){this.interval&&t===this.pollIntervalCurrent||(console.debug("Polling interval updated to "+t),this.interval&&(window.clearInterval(this.interval),this.interval=null),this.pollIntervalCurrent=t,this.setupBackgroundFetcher())},_shutDownNotifications(t){console.debug("Shutting down notifications "+(t?"temporary":"bye")),this.interval&&(window.clearInterval(this.interval),this.interval=null),this.shutdown=!t},checkWebNotificationPermissions(){return"Notification"in window?"granted"===window.Notification.permission?(console.debug("Notifications permissions granted"),void(this.webNotificationsGranted=!0)):"denied"===window.Notification.permission?(console.debug("Notifications permissions denied"),void(this.webNotificationsGranted=!1)):"http:"===window.location.protocol?(console.debug("Notifications require HTTPS"),void(this.webNotificationsGranted=!1)):(console.info("Notifications permissions not yet requested"),void(this.webNotificationsGranted=null)):(console.info("Browser does not support notifications"),void(this.webNotificationsGranted=!1))},async requestWebNotificationPermissions(){null===this.webNotificationsGranted&&(console.info("Requesting notifications permissions"),window.Notification.requestPermission().then((t=>{this.webNotificationsGranted="granted"===t})))}}};var it=s(22627),st={};st.styleTagTransform=B(),st.setAttributes=N(),st.insert=k().bind(null,"head"),st.domAPI=w(),st.insertStyleElement=S();A()(it.Z,st);it.Z&&it.Z.locals&&it.Z.locals;const nt=(0,p.Z)(et,(function(){var t=this,e=t._self._c;return t.shutdown?t._e():e("NcHeaderMenu",{staticClass:"notifications-button",attrs:{id:"notifications","exclude-click-outside-selectors":[".popover"],open:t.open,"aria-label":t.t("notifications","Notifications")},on:{"update:open":function(e){t.open=e},open:t.onOpen},scopedSlots:t._u([{key:"trigger",fn:function(){return[0!==t.notifications.length||null===t.webNotificationsGranted||t.hasThrottledPushNotifications?e("svg",{staticClass:"notifications-button__icon",attrs:{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1",width:"20",height:"20",viewBox:"0 0 24 24",fill:"currentColor"}},[e("path",{attrs:{d:"M 19,11.79 C 18.5,11.92 18,12 17.5,12 14.47,12 12,9.53 12,6.5 12,5.03 12.58,3.7 13.5,2.71 13.15,2.28 12.61,2 12,2 10.9,2 10,2.9 10,4 V 4.29 C 7.03,5.17 5,7.9 5,11 v 6 l -2,2 v 1 H 21 V 19 L 19,17 V 11.79 M 12,23 c 1.11,0 2,-0.89 2,-2 h -4 c 0,1.11 0.9,2 2,2 z"}}),t._v(" "),e("path",{staticClass:"notification__dot",class:t.isRedThemed?"notification__dot--white":"",attrs:{d:"M 21,6.5 C 21,8.43 19.43,10 17.5,10 15.57,10 14,8.43 14,6.5 14,4.57 15.57,3 17.5,3 19.43,3 21,4.57 21,6.5"}}),t._v(" "),t.hasThrottledPushNotifications?e("path",{staticClass:"notification__dot notification__dot--warning",class:t.isOrangeThemed?"notification__dot--white":"",attrs:{d:"M 21,6.5 C 21,8.43 19.43,10 17.5,10 15.57,10 14,8.43 14,6.5 14,4.57 15.57,3 17.5,3 19.43,3 21,4.57 21,6.5"}}):t._e()]):e("Bell",{staticClass:"notifications-button__icon",attrs:{size:20,title:t.t("notifications","Notifications")}})]},proxy:!0}],null,!1,760905135)},[t._v(" "),e("div",{ref:"container",staticClass:"notification-container"},[e("transition",{attrs:{name:"fade",mode:"out-in"}},[t.notifications.length>0?e("div",[e("transition-group",{staticClass:"notification-wrapper",attrs:{name:"list",tag:"ul"}},[t.hasThrottledPushNotifications?e("Notification",{key:-2016,attrs:{datetime:"warning",app:"core",icon:t.warningIcon,"external-link":"https://nextcloud.com/fairusepolicy",message:t.emptyContentDescription,subject:t.emptyContentMessage,index:2016}}):t._e(),t._v(" "),t._l(t.notifications,(function(i,s){return e("Notification",t._b({key:i.notificationId,attrs:{index:s},on:{remove:t.onRemove}},"Notification",i,!1))}))],2),t._v(" "),t.notifications.length>0?e("span",{staticClass:"dismiss-all",on:{click:t.onDismissAll}},[e("NcButton",{attrs:{type:"tertiary"},on:{click:t.onDismissAll},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Close",{attrs:{size:20}})]},proxy:!0}],null,!1,2121748766)},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("notifications","Dismiss all notifications"))+"\n\t\t\t\t\t")])],1):t._e()],1):e("NcEmptyContent",{attrs:{name:t.emptyContentMessage,description:t.emptyContentDescription},scopedSlots:t._u([{key:"icon",fn:function(){return[t.hasThrottledPushNotifications?e("span",{staticClass:"icon icon-alert-outline"}):e("Bell")]},proxy:!0},t.hasThrottledPushNotifications?{key:"action",fn:function(){return[e("NcButton",{attrs:{type:"primary",href:"https://nextcloud.com/fairusepolicy",target:"_blank",rel:"noreferrer noopener"},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Message",{attrs:{size:20}})]},proxy:!0}],null,!1,1386745923)},[t._v("\n\t\t\t\t\t\t"+t._s(t.t("notifications","Contact Nextcloud GmbH"))+" ↗\n\t\t\t\t\t")])]},proxy:!0}:null],null,!0)})],1)],1)])}),[],!1,null,"280ff602",null).exports},42761:t=>{"use strict";t.exports="data:image/svg+xml;base64,PCEtLSBUaGlzIGljb24gaXMgcGFydCBvZiBNYXRlcmlhbCBVSSBJY29ucy4gQ29weXJpZ2h0IDIwMjAgR29vZ2xlIEluYy4sIEFwYWNoZS0yLjAgTGljZW5zZSAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTS00LTRoMjR2MjRILTRWLTR6IiBmaWxsPSJub25lIi8+PHBhdGggZD0iTTggMEMzLjYgMCAwIDMuNiAwIDhzMy42IDggOCA4IDgtMy42IDgtOC0zLjYtOC04LTh6IiBmaWxsPSIjZWQ0ODRjIi8+PHBhdGggZD0iTTUgNi41aDZjLjggMCAxLjUuNyAxLjUgMS41cy0uNyAxLjUtMS41IDEuNUg1Yy0uOCAwLTEuNS0uNy0xLjUtMS41UzQuMiA2LjUgNSA2LjV6IiBmaWxsPSIjZmRmZmZmIi8+PC9zdmc+Cg=="},87210:t=>{"use strict";t.exports="data:image/svg+xml;base64,PCEtLSBUaGlzIGljb24gaXMgcGFydCBvZiBNYXRlcmlhbCBVSSBJY29ucy4gQ29weXJpZ2h0IDIwMjAgR29vZ2xlIEluYy4sIEFwYWNoZS0yLjAgTGljZW5zZSAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZD0iTTQuOCAxMS4yaDYuNFY0LjhINC44djYuNHpNOCAwQzMuNiAwIDAgMy42IDAgOHMzLjYgOCA4IDggOC0zLjYgOC04LTMuNi04LTgtOHoiIGZpbGw9IiM0OWIzODIiLz48L3N2Zz4K"},94659:t=>{"use strict";t.exports="data:image/svg+xml;base64,PCEtLSBUaGlzIGljb24gaXMgcGFydCBvZiBNYXRlcmlhbCBVSSBJY29ucy4gQ29weXJpZ2h0IDIwMjAgR29vZ2xlIEluYy4sIEFwYWNoZS0yLjAgTGljZW5zZSAtLT4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTS00LTRoMjR2MjRILTR6Ii8+PHBhdGggZD0iTTYuOS4xQzMgLjYtLjEgNC0uMSA4YzAgNC40IDMuNiA4IDggOCA0IDAgNy40LTMgOC02LjktMS4yIDEuMy0yLjkgMi4xLTQuNyAyLjEtMy41IDAtNi40LTIuOS02LjQtNi40IDAtMS45LjgtMy42IDIuMS00Ljd6IiBmaWxsPSIjZjRhMzMxIi8+PC9zdmc+Cg=="}}]);
//# sourceMappingURL=notifications-node_modules_moment_locale_sync_recursive_-src_NotificationsApp_vue-data_image_svg_xml_base64-ab95a3.js.map?v=9dcc24aa2d9cc42e4fe0