%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/nextcloud.varak.net/apps_old/apps/cospend/js/
Upload File :
Create Path :
Current File : //www/varak.net/nextcloud.varak.net/apps_old/apps/cospend/js/cospend-dashboard-lazy.js

"use strict";(self.webpackChunkcospend=self.webpackChunkcospend||[]).push([["dashboard-lazy"],{57437:(t,e,i)=>{i.d(e,{A:()=>o});var s=i(71354),n=i.n(s),r=i(76314),c=i.n(r)()(n());c.push([t.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const o=c},56082:(e,i,s)=>{s.d(i,{default:()=>S});const n={name:"CospendIcon",props:{title:{type:String,default:""},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var r=s(14486);const c=(0,r.A)(n,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon cospend-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{attrs:{fill:t.fillColor,width:t.size,height:t.size,"enable-background":"new 0 0 947.383 947.383",version:"1.1",viewBox:"0 0 947.38 947.38","xml:space":"preserve",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"m566.83 2.896-93.137 49.266-93.454-49.434c-17.958-9.499-38.475 7.352-32.646 26.814l50.675 169.2c24.891-7.776 50.084-11.69 75.425-11.69 24.992 0 49.839 3.814 74.396 11.378l51.356-168.62c5.936-19.482-14.611-36.438-32.615-26.915z"}}),t._v(" "),e("path",{attrs:{d:"m782.74 722.66c0-230.95-79.884-515.21-310.83-515.21s-314.29 292.35-314.29 523.29c0 230.94 85.655 208.11 316.6 208.11 230.95 3e-3 308.52 14.762 308.52-216.18zm-275.1 50.106v41.03c0 13.261-10.751 24.011-24.012 24.011h-20.699c-13.262 0-24.012-10.75-24.012-24.011v-37.351c-28.598-3.5132-62.94-13.998-91.284-32.799-10.341-6.8598-13.319-21.063-6.6458-31.526l21.365-33.491c6.7448-10.57 20.756-13.856 31.409-7.2392 24.561 15.26 45.289 21.612 66.018 21.612 30.68 0 42.952-10.433 42.952-34.361 0-49.091-158.31-55.838-158.31-163.21 0-61.974 34.974-104.92 94.492-117.81v-40.814c0-12.702 10.297-23 23-23h22.722c12.703 0 23 10.297 23 23v39.586c30.098 4.7771 54.617 17.739 75.583 35.408 9.852 8.303 11.098 23.018 2.6576 32.751l-23.163 26.702c-7.7384 8.924-21.012 10.711-30.677 3.9261-15.733-11.045-30.691-16.567-47.716-16.567-26.383 0-39.269 7.3623-39.269 31.906 0 46.634 158.31 49.089 158.31 160.76-1e-3 59.521-31.295 106.15-95.72 121.49z","stroke-width":"1.15"}})])])}),[],!1,null,null,null).exports;var o=s(46296),l=s(63814),a=s(92457),d=s(51651),h=s(22011),u=s(10833),p=s(9518);const v={name:"Dashboard",components:{CospendIcon:c,DashboardWidget:h.Z,NcEmptyContent:u.A,NcButton:p.A},props:{title:{type:String,required:!0}},data:()=>({activities:[],showMoreUrl:(0,l.Jv)("/apps/activity")+"?filter=cospend",cospendUrl:(0,l.Jv)("/apps/cospend"),loop:null,state:"loading",darkThemeColor:"dark"===OCA.Accessibility?.theme?"181818":"ffffff",windowVisibility:!0}),computed:{items(){return this.activities.map((t=>({id:t.activity_id,targetUrl:this.getTarget(t),avatarUsername:this.getUserId(t),mainText:this.getMainText(t),subText:this.getSubline(t)})))},lastDate(){return this.activities.length>0?this.activities[0].datetime:null},lastMoment(){return(0,d.A)(this.lastDate)},lastActivityId(){return this.activities.length>0?this.activities[0].activity_id:0}},watch:{windowVisibility(t){t?this.launchLoop():this.stopLoop()}},beforeDestroy(){document.removeEventListener("visibilitychange",this.changeWindowVisibility)},beforeMount(){this.launchLoop(),document.addEventListener("visibilitychange",this.changeWindowVisibility)},mounted(){},methods:{changeWindowVisibility(){this.windowVisibility=!document.hidden},stopLoop(){clearInterval(this.loop)},launchLoop(){this.loadActivity(),this.loop=setInterval(this.loadActivity,6e4)},async loadActivity(){if(!this.windowVisibility)return;const t=new URLSearchParams;t.append("format","json"),t.append("limit",50);try{const e=await o.A.get((0,l.KT)("apps/activity/api/v2/activity")+"/cospend?"+t);this.processActivities(e.data.ocs.data),this.state="ok"}catch(t){this.state="error"}},processActivities(t){if(this.lastActivityId){let e=0;for(;e<t.length&&this.lastActivityId<t[e].activity_id;)e++;if(e>0){const i=this.filterActivities(t.slice(0,e));this.activities=i.concat(this.activities)}}else this.activities=this.filterActivities(t)},filterActivities:t=>t.filter((t=>t.user!==(0,a.HW)().uid)),getUserId:t=>t.user,getTarget(t){const e=t.subject_rich[1].project.id;return(0,l.Jv)("/apps/cospend?project="+e)},getSubline(t){const e=t.subject_rich[1].project.name;let i;return"project_share"===t.link?i="🔗":"project_unshare"===t.link?i="🛇":"bill_create"===t.link?i="➕":"bill_delete"===t.link?i="🗑️":"bill_update"===t.link&&(i="️✏️"),i+" "+e},getMainText(e){if("project_share"===e.link){const i=e.subject_rich[1].project.name,s=e.subject_rich[1].user.name,n=e.subject_rich[1].who.name;return t("cospend","{user} shared {project} with {who}",{user:s,project:i,who:n})}if("project_unshare"===e.link){const i=e.subject_rich[1].project.name,s=e.subject_rich[1].user.name,n=e.subject_rich[1].who.name;return t("cospend","{user} unshared {project} with {who}",{user:s,project:i,who:n})}if(["bill_create","bill_delete","bill_update"].includes(e.link)){const i=e.subject_rich[1].user.name,s=e.subject_rich[1].bill.name;if("bill_create"===e.link)return t("cospend","{user} created {bill}",{user:i,bill:s});if("bill_delete"===e.link)return t("cospend","{user} deleted {bill}",{user:i,bill:s});if("bill_update"===e.link)return t("cospend","{user} edited {bill}",{user:i,bill:s})}}}};var b=s(85072),m=s.n(b),f=s(97825),y=s.n(f),g=s(77659),w=s.n(g),_=s(55056),A=s.n(_),k=s(10540),j=s.n(k),C=s(41113),x=s.n(C),I=s(57437),T={};T.styleTagTransform=x(),T.setAttributes=A(),T.insert=w().bind(null,"head"),T.domAPI=y(),T.insertStyleElement=j();m()(I.A,T);I.A&&I.A.locals&&I.A.locals;const S=(0,r.A)(v,(function(){var t=this,e=t._self._c;return e("DashboardWidget",{attrs:{items:t.items,"show-more-url":t.showMoreUrl,"show-more-text":t.title,loading:"loading"===t.state},scopedSlots:t._u([{key:"empty-content",fn:function(){return[e("NcEmptyContent",{attrs:{name:t.t("cospend","No recent activity"),title:t.t("cospend","No recent activity")},scopedSlots:t._u([{key:"icon",fn:function(){return[e("CospendIcon")]},proxy:!0},{key:"action",fn:function(){return[e("a",{attrs:{href:t.cospendUrl}},[e("NcButton",[t._v("\n\t\t\t\t\t\t"+t._s(t.t("cospend","Go to Cospend"))+"\n\t\t\t\t\t")])],1)]},proxy:!0}])})]},proxy:!0}])})}),[],!1,null,"4f41722c",null).exports}}]);
//# sourceMappingURL=cospend-dashboard-lazy.js.map?v=aba0b68e490dd2e49d5f

Zerion Mini Shell 1.0