PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 2.1.0
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v2.1.0
2.1.0 2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 All 42 releases
← All changes | assets/admin/app.js +1 -1 2.0.102.1.0 View file →
@@ -1 +1 @@
1 -import{aO as e,S as t,Z as i,_ as s,T as a,$ as n,a0 as o,a7 as l,H as r,a9 as c,a2 as d,a6 as h,aP as f,a8 as m,a5 as u,ax as p,a_ as b,av as g,R as _,U as v,bx as y,bB as w,bC as k,bD as N,bE as C,bF as T,bG as $}from"../vendor.js?ver=2.0.10";import{P as S,D as M,C as I,T as L,a as x,m as A,g as E,b as B,s as F,t as P,c as q,d as U,f as V,e as D,h as R,v as O,i as W,j,k as H,$ as z,R as K,l as Q,S as Z,n as G,o as Y,r as X}from"../UpgradeUrl.js?ver=2.0.10";import{E as J,a as ee,b as te,c as ie,d as se,e as ae,f as ne,g as oe,h as le,i as re,j as ce,k as de,l as he,m as fe,n as me}from"../vendor-element-plus.js?ver=2.0.10";import{_ as ue,E as pe,I as be,B as ge,d as _e}from"../descriptionToPlainText.js?ver=2.0.10";const ve={class:"fbs_no_notification_found"};const ye={class:"fbs-notification-avatar-wrap"},we=["src","alt","title"],ke={key:2,class:"fbs-unread-mark","aria-hidden":"true"},Ne={class:"fbs-notification-card-content"},Ce={class:"fbs-notification-card-details"},Te={key:0,class:"fbs-notification-card-actor"},$e={key:1,class:"fbs-notification-card-action"},Se={key:2,class:"fbs-notification-card-action"},Me={class:"fbs-notification-card-action"},Ie={class:"fbs-notification-card-task-title"},Le={class:"fbs-notification-card-action"},xe={class:"fbs-notification-card-task-title"},Ae={key:0,class:"fbs-notification-card-actor"},Ee={class:"fbs-notification-card-action"},Be={class:"fbs-notification-card-details-bottom"};const Fe={class:"icon"},Pe={key:0,class:"fbs-notification-button-badge"},qe={class:"fbs-notification-actions"},Ue=["aria-label"],Ve=["aria-selected"],De=["aria-selected"],Re=["aria-selected"],Oe=["aria-selected"],We={class:"icon"},je={class:"icon"},He={key:0,class:"fbs-notification-loading-spacer"};const ze=ue({name:"Notification",inject:["eventBus"],components:{Icons:be,DrawerHeader:M,Pagination:S,NoNotificationFound:ue({name:"NoNotificationFound",components:{EmptyState:pe},props:{message:{type:String,required:!0}}},[["render",function(a,n,o,l,r,c){const d=e("empty-state");return t(),i("div",ve,[s(d,{message:o.message,"icon-width":120,"icon-height":92},null,8,["message"])])}]]),NotificationCard:ue({name:"NotificationCard",props:["notification"],data:()=>({descriptionActions:["task_due_date_changed","task_start_date_changed","task_priority_changed","task_moved_to_new_stage"]}),methods:{getDescriptionPreview(e){const t=this.notification.description||"";return t.length>e?t.substring(0,e)+"...":t},makeNotificationRead(){this.notification.read||this.$put("notifications/read",{notification_id:this.notification.id}).then(e=>{this.notification.read=e.notification.marked_read_at,this.emitter.emit("readSingleNotification",this.notification),this.notification.task_id&&this.emitter.emit("update-notification-in-card",this.notification.task_id)}).catch(e=>{this.handleError(e)})}}},[["render",function(f,m,u,p,b,g){const _=e("Avatar"),v=J;return t(),a(h(u.notification.task?"a":"div"),{class:d(["fbs-notification_card",{"fbs-notification_card--clickable":u.notification.task}]),href:u.notification.task?f.$getTaskUrl(u.notification.task,u.notification.settings):void 0,onClick:m[0]||(m[0]=e=>u.notification.task&&g.makeNotificationRead())},{default:n(()=>[o("span",ye,[u.notification.activitist?(t(),i("img",{key:0,class:"fbs-notification-user-avatar",src:u.notification.activitist.photo,alt:u.notification.activitist.display_name,title:u.notification.activitist.display_name},null,8,we)):(t(),a(v,{key:1,class:"fbs-notification-user-avatar fbs-notification-no-user"},{default:n(()=>[s(_)]),_:1})),u.notification.read?l("",!0):(t(),i("span",ke))]),o("span",Ne,[o("span",Ce,[u.notification.task?(t(),i(r,{key:0},[u.notification.activitist?(t(),i("span",Te,c(u.notification.activitist.display_name),1)):l("",!0),"task_assignee_changed"==u.notification.action?(t(),i("span",$e,c(" "+g.getDescriptionPreview(120)),1)):(t(),i("span",Se,c(" "+f.$t(u.notification.action)),1)),b.descriptionActions.includes(u.notification.action)?(t(),i(r,{key:3},[o("span",Me,c(" "+f.$t("to")+" "),1),o("span",Ie,c(g.getDescriptionPreview(120)),1)],64)):l("",!0),u.notification.task.title?(t(),i(r,{key:4},[o("span",Le,c(" "+f.$t("in")+" "),1),o("span",xe,c(u.notification.task.title),1)],64)):l("",!0)],64)):(t(),i(r,{key:1},[u.notification.activitist?(t(),i("span",Ae,c(u.notification.activitist.display_name),1)):l("",!0),o("span",Ee,c(u.notification.activitist?" "+g.getDescriptionPreview(120):g.getDescriptionPreview(120)),1)],64))]),o("span",Be,c(f.$humanTimeDiff(u.notification.created_at)),1)])]),_:1},8,["class","href"])}]])},data:()=>({board:null,loading:!1,totalUnread:0,notifications:[],toggle:!0,allNotifications:!1,unreadNotifications:!0,pagination:{current_page:0},drawer:!1,noMoreNotifications:!1,mentionedNotifications:!1,assignedNotifications:!1}),computed:{notificationEmptyMessage(){return this.unreadNotifications?"No unread notification":"No notification"}},mounted(){this.fetchNotificationNumber(),this.emitter.on("readSingleNotification",this.markNotificationAsRead),this.eventBus.on("fetch-notification-number",this.fetchNotificationNumber)},beforeUnmount(){this.emitter.off("readSingleNotification",this.markNotificationAsRead),this.eventBus.off("fetch-notification-number",this.fetchNotificationNumber)},methods:{showAllNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!0,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllNotifications()},showMentionedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!0,this.assignedNotifications=!1,this.fetchSpecificNotifications()},showAssignedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!0,this.fetchSpecificNotifications()},fetchSpecificNotifications(e={page:1}){this.loading=!0;let t=this.assignedNotifications?"task_assignee_changed":"task_comment_mentioned";this.$get("notifications/",{...e,action:t}).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})},markNotificationAsRead(e){this.unreadNotifications&&(this.notifications=this.notifications.filter(t=>t.id!=e.id),this.noMoreNotifications||this.fetchAllUnreadNotifications()),this.totalUnread--},fetchNotificationNumber(){this.$get("notifications/unread-count").then(e=>{this.totalUnread=e.total_unread}).catch(e=>{this.handleError(e)}).finally(()=>{})},markAllNotificationAsRead(){this.$put("notifications/read",{notification_id:null}).then(e=>{this.unreadNotifications?this.notifications=[]:this.fetchAllNotifications(),this.emitter.emit("update-notification-in-card",null)}).catch(e=>{this.handleError(e)}).finally(()=>{this.totalUnread=0})},openDrawer(){this.drawer=!0,this.unreadNotifications=this.totalUnread>0,this.allNotifications=!this.unreadNotifications,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.toggle=!0,this.notifications=[],this.unreadNotifications?this.fetchAllUnreadNotifications():this.fetchAllNotifications()},showUnreadNotifications(){this.notifications=[],this.pagination={current_page:0},this.unreadNotifications=!0,this.allNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllUnreadNotifications()},fetchAllNotifications(e={page:1}){this.loading=!0,this.$get("notifications/",e).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},handleScroll(){const e=this.$refs.notificationContainer;if(e){const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;if(t+s>=i-200){if(this.noMoreNotifications||this.loading)return;const e={page:this.pagination.current_page+1};this.mentionedNotifications||this.assignedNotifications?this.fetchSpecificNotifications(e):this.unreadNotifications?this.fetchAllUnreadNotifications(e):this.fetchAllNotifications(e)}}},fetchAllUnreadNotifications(e){this.loading=!0,this.$get("notifications/unread",e).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},setNotifications(e){this.notifications=this.updateNotificationsMerge(this.notifications,e.data),this.pagination=e,this.noMoreNotifications="last_page"in this.pagination&&this.pagination.last_page<=this.pagination.current_page&&this.pagination.last_page!=this.pagination.current_page},updateNotificationsMerge(e,t){const i=new Map;return e.forEach(e=>{i.set(e.id,e)}),t.forEach(e=>{i.set(e.id,e)}),Array.from(i.values())},drawerClosing(){this.notifications=[],this.pagination={current_page:0},this.noMoreNotifications=!1,this.allNotifications=!1,this.unreadNotifications=!0,this.mentionedNotifications=!1,this.assignedNotifications=!1}}},[["render",function(h,b,g,_,v,y){const w=e("Icons"),k=ee,N=te,C=e("drawer-header"),T=ae,$=se,S=ie,M=e("notification-card"),I=e("no-notification-found"),L=ne,x=oe,A=f("loading");return t(),i("div",null,[s(N,{effect:"dark",content:h.$t("Notifications"),placement:"bottom"},{default:n(()=>[s(k,{text:"",size:"small",class:"fbs_topbar_icon_btn only-icon-btn fbs-notification-button","aria-label":h.$t("Notifications"),onClick:y.openDrawer},{default:n(()=>[o("span",Fe,[s(w,{"icon-name":"bell"})]),v.totalUnread>0?(t(),i("span",Pe,c(v.totalUnread>99?"99+":v.totalUnread),1)):l("",!0)]),_:1},8,["aria-label","onClick"])]),_:1},8,["content"]),s(x,{modelValue:v.drawer,"onUpdate:modelValue":b[6]||(b[6]=e=>v.drawer=e),"append-to-body":"",class:"fbs_right_sidebar fbs-notification-drawer","with-header":!1,size:"min(440px, 100vw)",direction:h.appVars.is_rtl?"ltr":"rtl",onClose:y.drawerClosing},{default:n(()=>[s(C,{title:"Notification","icon-name":"notification",onClose:b[0]||(b[0]=e=>v.drawer=!1)}),o("div",qe,[o("div",{class:"fbs-notification-tabs",role:"tablist","aria-label":h.$t("Notifications")},[o("button",{type:"button",class:d(["fbs-switch-btn",v.allNotifications?"fbs-active":""]),role:"tab","aria-selected":v.allNotifications,onClick:b[1]||(b[1]=(...e)=>y.showAllNotifications&&y.showAllNotifications(...e))},c(h.$t("All")),11,Ve),o("button",{type:"button",class:d(["fbs-switch-btn",v.unreadNotifications?"fbs-active":""]),role:"tab","aria-selected":v.unreadNotifications,onClick:b[2]||(b[2]=(...e)=>y.showUnreadNotifications&&y.showUnreadNotifications(...e))},c(h.$t("Unread")),11,De),o("button",{type:"button",class:d(["fbs-switch-btn",v.mentionedNotifications?"fbs-active":""]),role:"tab","aria-selected":v.mentionedNotifications,onClick:b[3]||(b[3]=(...e)=>y.showMentionedNotifications&&y.showMentionedNotifications(...e))},c(h.$t("Mentioned")),11,Re),o("button",{type:"button",class:d(["fbs-switch-btn",v.assignedNotifications?"fbs-active":""]),role:"tab","aria-selected":v.assignedNotifications,onClick:b[4]||(b[4]=(...e)=>y.showAssignedNotifications&&y.showAssignedNotifications(...e))},c(h.$t("Assigned")),11,Oe)],8,Ue),s(S,{trigger:"click",class:"fbs-notification-dropdown",placement:"bottom-end"},{dropdown:n(()=>[s($,null,{default:n(()=>[s(T,{onClick:y.markAllNotificationAsRead},{default:n(()=>[o("span",je,[s(w,{"icon-name":"eye"})]),m(" "+c(h.$t("mark_all_read")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[s(k,{text:"",size:"small",class:"only-icon-btn","aria-label":h.$t("Menu")},{default:n(()=>[o("span",We,[s(w,{"icon-name":"dots","aria-hidden":"true"})])]),_:1},8,["aria-label"])]),_:1})]),u((t(),i("div",{onScroll:b[5]||(b[5]=(...e)=>y.handleScroll&&y.handleScroll(...e)),ref:"notificationContainer",class:"fbs_notification_container",id:"notification-container"},[(t(!0),i(r,null,p(v.notifications,e=>(t(),a(M,{key:e.id,notification:e},null,8,["notification"]))),128)),v.loading&&v.pagination.current_page>0?u((t(),i("p",He,null,512)),[[A,!0]]):l("",!0),0!==v.notifications.length||v.loading?l("",!0):(t(),a(L,{key:1},{default:n(()=>[s(I,{message:y.notificationEmptyMessage},null,8,["message"])]),_:1}))],32)),[[A,v.loading]])]),_:1},8,["modelValue","direction","onClose"])])}]]),Ke={class:"navigable_list_container fbs_global_search_result_container"},Qe={key:0,class:"no_results fbs_global_search_result_not_found"},Ze={class:"fbs_global_search_empty_state"},Ge={key:1},Ye={ref:"listContainer",class:"navigable_list fbs_global_search_result_list"},Xe=["tabindex","onClick","onKeydown"];const Je=[{key:"boards",title:"Boards",type:"board"},{key:"tasks",title:"Tasks",type:"task"}],et=["title","aria-label"],tt={class:"fbs_global_search_input_container"},it={key:0,class:"searched_item"},st={key:0,class:"fbs_global_search_commands"},at={class:"fbs_global_search_commands_label"},nt={key:0,class:"fbs_global_search_commands_list"},ot=["onClick","onMouseenter"],lt={class:"fbs_command_slash"},rt={class:"fbs_command_desc"},ct={key:1,class:"fbs_global_search_commands_empty"},dt={class:"fbs_global_searching_for"},ht={class:"fbs_global_searching_for_label"},ft={class:"fbs_global_searching_suggestion_list"},mt=["onClick"],ut={class:"fbs_global_search_no_result"},pt={key:2,class:"fbs-global-remote-result-container"},bt={class:"fbs-w-full"},gt={key:0,class:"fbs_global_search_subscriber"},_t={class:"fbs_global_search_subscriber_avatar"},vt={class:"fbs_global_search_subscriber_avatar_placeholder"},yt={class:"fbs_global_search_subscriber_info"},wt={class:"fbs_global_search_subscriber_name"},kt={class:"fbs_global_search_subscriber_meta"},Nt={class:"fbs_global_search_result_type"},Ct={key:1,class:"fbs_global_search_subscriber fbs_global_search_title_item"},Tt={class:"fbs_global_search_subscriber_name"},$t={class:"fbs_global_search_subscriber_meta"},St={key:0,class:"fbs_global_search_subscriber_email"},Mt={class:"fbs-global-search-stage-title"},It={class:"fbs_global_search_result_type"},Lt={class:"dialog-footer is-border"},xt={key:0,class:"fbs_search_tip"},At={class:"fbs_search_tip_label"},Et={class:"fbs_search_tip_text"},Bt={class:"fbs_search_commands"},Ft={class:"fbs_label"},Pt={class:"fbs_label"},qt={class:"fbs_label"};const Ut={class:"icon"},Vt={class:"fbs_board_list_item"},Dt={class:"fbs_board_list_item__content"},Rt={class:"fbs_board_list_item__title_row"},Ot=["title"],Wt=["title"],jt={class:"fbs_board_list_item__meta"},Ht=["title","aria-label","onClick"],zt={class:"icon fbs_board_card__pin__icon"},Kt={class:"icon fbs_board_card__pin__icon_outline"};const Qt=["aria-label"],Zt={class:"fbs-my-profile-avatar"},Gt=["src","alt"],Yt={class:"fbs-profile-menu-caret","aria-hidden":"true"},Xt={class:"fbs-profile-menu-head"},Jt={class:"fbs-profile-menu-head-avatar","aria-hidden":"true"},ei=["src","alt"],ti={class:"fbs-profile-menu-identity"},ii=["title"],si=["title"],ai={class:"fbs-profile-menu-item-label"},ni={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},oi={class:"fbs-profile-menu-item-label"},li={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},ri={class:"fbs-profile-menu-item-label"};const ci={class:"icon"},di={class:"icon"},hi={class:"icon"},fi={class:"icon"};const mi={class:"fl_app"},ui={key:0},pi={class:"fbs-global-menu-icons",ref:"global_menu_right"},bi={class:"fbs-global-action-buttons"},gi={class:"icon"},_i={class:"icon"},vi=["aria-label","aria-expanded"];const yi=ue({name:"DashboardApplication",inject:["eventBus"],components:{Icons:be,GlobalSearch:ue({name:"GlobalSearch",components:{NavigableList:ue({name:"NavigableList",components:{EmptyState:pe},props:{items:{type:Array,required:!0,default:()=>[]},noResultsText:{type:String,default:"No results found"},onAction:{type:Function,required:!0}},data:()=>({selectedIndex:-1}),methods:{navigate(e){const t=this.items.length;if(0===t)return;const i=t-1;"up"===e?this.selectedIndex=this.selectedIndex<=0?i:this.selectedIndex-1:"down"===e&&(this.selectedIndex=this.selectedIndex>=i?0:this.selectedIndex+1),this.scrollToSelectedElement()},scrollToSelectedElement(){const e=this.$refs.listContainer,t=this.$refs.listItem&&this.$refs.listItem[this.selectedIndex];t&&e&&(t.scrollIntoView({behavior:"smooth",block:"nearest"}),this.$nextTick(()=>{t.focus()}))},handleItemClick(e){this.selectedIndex=e,this.performAction(e)},performAction(e){e>=0&&e<this.items.length&&this.onAction(this.items[e],e)},resetSelection(){this.selectedIndex=-1},focusList(e){(e=null!=e?e:this.items.length-1)>=0&&(this.selectedIndex=e,this.$nextTick(()=>{const t=this.$refs.listItem&&this.$refs.listItem[e];t&&t.focus()}))},performFirstAction(){this.items.length>0?(this.selectedIndex=0,this.performAction(0)):this.selectedIndex=-1},performSelectedAction(){this.items.length<1?this.selectedIndex=-1:this.selectedIndex<0||this.selectedIndex>=this.items.length?this.performFirstAction():this.performAction(this.selectedIndex)}},watch:{items:{handler(){this.resetSelection()},immediate:!0}}},[["render",function(a,n,l,c,h,f){const m=e("empty-state");return t(),i("div",Ke,[0===l.items.length?(t(),i("div",Qe,[o("div",Ze,[s(m,{message:l.noResultsText,"icon-width":84,"icon-height":64},null,8,["message"])])])):(t(),i("div",Ge,[o("ul",Ye,[(t(!0),i(r,null,p(l.items,(e,s)=>(t(),i("li",{key:s,ref_for:!0,ref:"listItem",class:d({selected:s===h.selectedIndex}),tabindex:s,onClick:e=>f.handleItemClick(s),onKeydown:[n[0]||(n[0]=b(g(e=>f.navigate("up"),["prevent"]),["arrow-up"])),n[1]||(n[1]=b(g(e=>f.navigate("down"),["prevent"]),["arrow-down"])),b(e=>f.performAction(s),["enter"])]},[_(a.$slots,"default",{item:e,index:s,isSelected:s===h.selectedIndex})],42,Xe))),128))],512)]))])}]]),CustomIcon:I,Icons:be},data:()=>({visible:!1,query:"",scopeTag:null,loading:!1,results:[],payload:null,lastScope:null,searchTimer:null,activeTip:"",commandIndex:-1,perPage:20}),computed:{scopeTags:()=>[...Je],scope(){return this.scopeTag?this.scopeTag.key:"all"},isCommandMode(){return this.query.startsWith("/")},commandQuery(){return this.query.slice(1).toLowerCase().trim()},filteredCommands(){if(!this.isCommandMode)return[];const e=this.commandQuery;return this.scopeTags.filter(t=>!e||t.title.toLowerCase().includes(e))}},watch:{scopeTag(){this.query.trim()&&this.search()},filteredCommands(){this.commandIndex=this.filteredCommands.length?0:-1}},mounted(){window.addEventListener("keydown",this.onKeydown)},beforeUnmount(){clearTimeout(this.searchTimer),window.removeEventListener("keydown",this.onKeydown)},methods:{open(){this.setRandomTip(),this.visible=!0},onClosed(){var e;this.visible=!1,this.query="",this.scopeTag=null,this.results=[],this.payload=null,null==(e=this.$refs.listRef)||e.resetSelection()},focusInput(){this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()})},onInput(){clearTimeout(this.searchTimer),this.isCommandMode?this.results=[]:this.query.trim()?this.searchTimer=setTimeout(()=>this.search(),400):this.results=[]},search(){const e=this.query.trim();if(!e)return void(this.results=[]);if(this.payload&&this.lastScope===this.scope&&this.payload._query===e)return void this.applyPayload();const t={query:e,scope:"all",per_page:this.perPage};this.scopeTag&&"boards"!==this.scopeTag.key||(t.board_page=1),this.scopeTag&&"tasks"!==this.scopeTag.key||(t.task_page=1),this.loading=!0,this.$get("global-search",t).then(t=>{this.payload={...t,_query:e},this.lastScope=this.scope,this.applyPayload()}).catch(()=>{this.results=[]}).finally(()=>{this.loading=!1})},applyPayload(){if(!this.payload)return;const e=(this.payload.boards&&this.payload.boards.data||[]).map(e=>({...e,_resultType:"board"})),t=(this.payload.tasks&&this.payload.tasks.data||[]).map(e=>({...e,_resultType:"task"}));this.scopeTag&&"boards"===this.scopeTag.key?this.results=e:this.scopeTag&&"tasks"===this.scopeTag.key?this.results=t:this.results=[...e,...t]},focusList(e="down"){if(this.isCommandMode){const t=this.filteredCommands.length;if(!t)return;return void(this.commandIndex="up"===e?this.commandIndex<=0?t-1:this.commandIndex-1:this.commandIndex>=t-1?0:this.commandIndex+1)}const t=this.$refs.listRef;t&&this.results.length&&("up"!==e?t.focusList(0):t.focusList(this.results.length-1))},selectFromKeyboard(){if(this.isCommandMode){const e=this.filteredCommands[this.commandIndex];return void(e&&this.selectCommand(e))}const e=this.$refs.listRef;e&&this.results.length&&e.performSelectedAction()},selectCommand(e){this.scopeTag=e,this.query="",this.commandIndex=-1,this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()})},goToItem(e){const t="board"===e._resultType?this.$getBoardUrl(e):this.$getTaskUrl(e);t&&"#"!==t&&(window.location.href=t),this.visible=!1},resultTypeLabel(e){return this.$t({board:"Board",task:"Task"}[e._resultType]||"Item")},setRandomTip(){const e=[this.$t('Press "/" anywhere to open Search quickly'),this.$t("Use the Boards or Tasks chips to narrow results"),this.$t("Use ↑↓ keys to move through results"),this.$t("Press Enter to open the selected result"),this.$t('Type "id: 123" to find a board or task by id')];this.activeTip=e[Math.floor(Math.random()*e.length)]||""},onKeydown(e){var t;if("/"!==(null==(t=e.key)?void 0:t.toLowerCase())||e.metaKey||e.ctrlKey||e.altKey)return;const i=e.target,s=i&&i.tagName?i.tagName.toUpperCase():"";i&&(i.isContentEditable||"INPUT"===s||"TEXTAREA"===s||"SELECT"===s)||(e.preventDefault(),this.open(),this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()}))}}},[["render",function(a,h,_,v,y,w){const k=le,N=e("Icons"),C=e("custom-icon"),T=e("NavigableList"),$=re,S=f("loading");return t(),i(r,null,[o("button",{type:"button",class:"fbs_icon_btn fbs_global_search",title:a.$t("Global Search"),"aria-label":a.$t("Global Search"),onClick:h[0]||(h[0]=(...e)=>w.open&&w.open(...e))},[...h[7]||(h[7]=[o("span",{class:"icon"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[o("path",{d:"M12.0232 10.9627L15.2355 14.1742L14.1742 15.2355L10.9627 12.0232C9.7678 12.9812 8.2815 13.5022 6.75 13.5C3.024 13.5 0 10.476 0 6.75C0 3.024 3.024 0 6.75 0C10.476 0 13.5 3.024 13.5 6.75C13.5022 8.2815 12.9812 9.7678 12.0232 10.9627ZM10.5187 10.4062C11.4706 9.42741 12.0021 8.11532 12 6.75C12 3.849 9.65025 1.5 6.75 1.5C3.849 1.5 1.5 3.849 1.5 6.75C1.5 9.65025 3.849 12 6.75 12C8.11532 12.0021 9.42741 11.4706 10.4062 10.5187L10.5187 10.4062Z",fill:"currentColor",transform:"translate(2.5 2.5)"})])],-1),o("span",{class:"slash-icon"},"/",-1)])],8,et),s($,{modelValue:y.visible,"onUpdate:modelValue":h[6]||(h[6]=e=>y.visible=e),onOpened:w.focusInput,onClosed:w.onClosed,class:"fbs_global_search_container","modal-class":"fbs_global_search_modal","append-to-body":!0},{header:n(()=>[o("div",tt,[h[9]||(h[9]=o("span",{class:"icon"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[o("path",{d:"M12.0232 10.9627L15.2355 14.1742L14.1742 15.2355L10.9627 12.0232C9.7678 12.9812 8.2815 13.5022 6.75 13.5C3.024 13.5 0 10.476 0 6.75C0 3.024 3.024 0 6.75 0C10.476 0 13.5 3.024 13.5 6.75C13.5022 8.2815 12.9812 9.7678 12.0232 10.9627ZM10.5187 10.4062C11.4706 9.42741 12.0021 8.11532 12 6.75C12 3.849 9.65025 1.5 6.75 1.5C3.849 1.5 1.5 3.849 1.5 6.75C1.5 9.65025 3.849 12 6.75 12C8.11532 12.0021 9.42741 11.4706 10.4062 10.5187L10.5187 10.4062Z",fill:"var(--fbs-text-muted, #99a0ae)",transform:"translate(1 1)"})])],-1)),y.scopeTag?(t(),i("div",it,[m(c(y.scopeTag.title)+" ",1),o("span",{class:"icon",onClick:h[1]||(h[1]=e=>y.scopeTag=null)},[...h[8]||(h[8]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[o("path",{d:"M6 5.057L9.3 1.757l.943.943-3.3 3.3 3.3 3.3-.943.943-3.3-3.3-3.3 3.3-.943-.943 3.3-3.3-3.3-3.3.943-.943 3.3 3.3Z",fill:"currentColor"})],-1)])])])):l("",!0),s(k,{ref:"inputRef",modelValue:y.query,"onUpdate:modelValue":h[2]||(h[2]=e=>y.query=e),class:"mousetrap",placeholder:y.scopeTag?a.$t("Search")+" "+y.scopeTag.title:a.$t("Type to search or / to filter"),clearable:"",autofocus:"",onInput:w.onInput,onKeydown:[h[3]||(h[3]=b(g(e=>w.focusList("down"),["prevent"]),["arrow-down"])),h[4]||(h[4]=b(g(e=>w.focusList("up"),["prevent"]),["arrow-up"])),b(g(w.selectFromKeyboard,["prevent"]),["enter"]),h[5]||(h[5]=b(e=>""===y.query&&(y.scopeTag=null),["backspace"]))]},null,8,["modelValue","placeholder","onInput","onKeydown"])])]),default:n(()=>[w.isCommandMode?(t(),i("div",st,[o("div",at,c(a.$t("Filter by")),1),w.filteredCommands.length?(t(),i("ul",nt,[(t(!0),i(r,null,p(w.filteredCommands,(e,s)=>(t(),i("li",{key:e.key,class:d({selected:s===y.commandIndex}),onClick:t=>w.selectCommand(e),onMouseenter:e=>y.commandIndex=s},[o("span",lt,"/"+c(e.title.toLowerCase()),1),o("span",rt,c(a.$t("Search in")+" "+e.title),1)],42,ot))),128))])):(t(),i("div",ct,c(a.$t("No matching filters")),1))])):y.query?u((t(),i("div",pt,[s(T,{ref:"listRef",items:y.results,"no-results-text":y.query?"No matches found":"Type to search","on-action":w.goToItem},{default:n(({item:e})=>[o("div",bt,["board"===e._resultType?(t(),i("div",gt,[o("div",_t,[o("div",vt,c((e.title||"?").charAt(0).toUpperCase()),1)]),o("div",yt,[o("span",wt,c(e.title),1),o("div",kt,[o("span",Nt,c(w.resultTypeLabel(e)),1)])])])):(t(),i("div",Ct,[o("span",Tt,c(e.title),1),o("div",$t,[e.board?(t(),i("span",St,[m(c(e.board.title)+" ",1),e.stage&&e.stage.title?(t(),i(r,{key:0},[h[10]||(h[10]=m(" — ",-1)),o("span",Mt,[s(C,{"icon-name":"stage"}),m(c(e.stage.title),1)])],64)):l("",!0)])):l("",!0),o("span",It,c(w.resultTypeLabel(e)),1)])]))]),h[11]||(h[11]=o("div",{class:"action-icon"},[o("svg",{width:"6",height:"9",viewBox:"0 0 6 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M3.34125 4.2957L0 0.95445L0.95445 0L5.25015 4.2957L0.95445 8.5914L0 7.63695L3.34125 4.2957Z",fill:"var(--fbs-secondary-text, #525866)"})])],-1))]),_:1},8,["items","no-results-text","on-action"])])),[[S,y.loading]]):(t(),i(r,{key:1},[o("div",dt,[o("div",ht,c(a.$t("Searching for")),1),o("div",ft,[(t(!0),i(r,null,p(w.scopeTags,e=>(t(),i("div",{key:e.key,class:d(["fbs_global_searching_suggestion",{active:y.scopeTag&&y.scopeTag.key===e.key}]),onClick:t=>y.scopeTag=e},c(e.title),11,mt))),128))])]),o("div",ut,[s(N,{"icon-name":"search","icon-class":"fbs_global_search_empty_icon","aria-hidden":"true"}),o("p",null,c(a.$t("Start typing to find a board or task")),1)])],64)),o("div",Lt,[y.activeTip?(t(),i("div",xt,[o("span",At,c(a.$t("Tip"))+":",1),o("span",Et,c(y.activeTip),1)])):l("",!0),o("ul",Bt,[o("li",null,[h[12]||(h[12]=o("span",{class:"fbs_command_keys"},[o("span",{class:"fbs_command_key"},"↑"),o("span",{class:"fbs_command_key"},"↓")],-1)),o("span",Ft,c(a.$t("Navigate")),1)]),o("li",null,[h[13]||(h[13]=o("span",{class:"fbs_command_key"},"↵",-1)),o("span",Pt,c(a.$t("Select")),1)]),o("li",null,[h[14]||(h[14]=o("span",{class:"fbs_command_key"},"/",-1)),o("span",qt,c(a.$t("Filter")),1)])])])]),_:1},8,["modelValue","onOpened","onClosed"])],64)}]]),Notification:ze,PinnedBoards:ue({name:"PinnedBoards",components:{BoardBackgroundPreview:ge,Icons:be},data:()=>({pinnedBoards:[],loading:!1,selectedBoardId:null}),created(){this.fetchPinnedBoards()},methods:{handleDropdownVisible(e){e&&this.fetchPinnedBoards()},goToBoard(e){this.$router.push({name:"board",params:{id:e.id}})},fetchPinnedBoards(){this.loading=!0,this.$get("projects/pinned-boards").then(e=>{this.pinnedBoards=e.pinnedBoards}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})},plainText:e=>e?String(e).replace(/<[^>]*>/g,"").trim():"",plainDescription:e=>_e((null==e?void 0:e.description)||""),unpinBoard(e){this.loading=!0,this.selectedBoardId=e,this.$put("projects/"+e+"/unpin-board").then(t=>{this.pinnedBoards=this.pinnedBoards.filter(t=>t.id!==e),this.emitter.emit("remove-pinned-board",e),this.emitter.emit("board-pin-state-changed",{boardId:e,wasPinned:!0,isPinned:!1})}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.selectedBoardId=null})}}},[["render",function(l,d,h,b,_,v){const y=e("Icons"),w=ee,k=e("board-background-preview"),N=ae,C=se,T=ie,$=f("loading");return t(),a(T,{placement:"bottom-end",class:"fbs-pinned-boards",trigger:"click","popper-class":"fbs-pinned-boards-popper",onVisibleChange:v.handleDropdownVisible},{dropdown:n(()=>[u((t(),a(C,null,{default:n(()=>[_.pinnedBoards.length?(t(!0),i(r,{key:0},p(_.pinnedBoards,e=>(t(),a(N,{key:e.id,onClick:t=>v.goToBoard(e)},{default:n(()=>[u((t(),i("div",Vt,[s(k,{class:"fbs_board_list_item__cover",board:e,"hide-icon":!0},null,8,["board"]),o("div",Dt,[o("div",Rt,[o("h3",{title:v.plainText(e.title)},c(e.title),9,Ot)]),o("p",{class:"fbs_board_list_item__desc",title:v.plainDescription(e)},c(v.plainDescription(e)||l.$t("No description")),9,Wt)]),o("div",jt,[o("button",{type:"button",class:"fbs_board_card__pin fbs_board_card__pin--pinned",title:l.$t("board is pinned"),"aria-label":l.$t("board is pinned"),onClick:g(t=>v.unpinBoard(e.id),["stop"])},[o("span",zt,[s(y,{"icon-name":"pin-fill","aria-hidden":"true"})]),o("span",Kt,[s(y,{"icon-name":"pin","aria-hidden":"true"})])],8,Ht)])])),[[$,_.loading&&_.selectedBoardId===e.id]])]),_:2},1032,["onClick"]))),128)):(t(),a(N,{key:1,disabled:""},{default:n(()=>[m(c(l.$t("No pinned board yet!")),1)]),_:1}))]),_:1})),[[$,_.loading&&!_.selectedBoardId]])]),default:n(()=>[s(w,{"aria-label":l.$t("Pinned Boards")},{default:n(()=>[m(c(l.$t("Pinned"))+" ",1),o("span",Ut,[s(y,{"icon-name":"arrow-down"})])]),_:1},8,["aria-label"])]),_:1},8,["onVisibleChange"])}]]),ProfileMenu:ue({name:"ProfileMenu",components:{Icons:be},computed:{me(){var e;return(null==(e=this.appVars)?void 0:e.me)||{}},displayName(){return this.me.full_name||this.me.display_name||""}},methods:{goTo(e){const t={name:e,params:{user_id:this.me.id}};this.$route.name===e&&String(this.$route.params.user_id)===String(this.me.id)||this.$router.push(t)},logout(){this.me.logout_url&&(window.location.href=this.me.logout_url)}}},[["render",function(r,d,h,f,m,u){var p;const b=e("Icons"),g=ae,_=se,v=ie;return(null==(p=u.me)?void 0:p.id)?(t(),a(v,{key:0,placement:"bottom-end",class:"fbs-profile-menu",trigger:"click","popper-class":"fbs-profile-menu-popper"},{dropdown:n(()=>[s(_,{class:"fbs-profile-menu-list"},{default:n(()=>[o("li",Xt,[o("span",Jt,[o("img",{src:u.me.photo,alt:u.displayName},null,8,ei)]),o("span",ti,[o("span",{class:"fbs-profile-menu-name",title:u.displayName},c(u.displayName),9,ii),u.me.email?(t(),i("span",{key:0,class:"fbs-profile-menu-email",title:u.me.email},c(u.me.email),9,si)):l("",!0)])]),s(g,{class:"fbs-profile-menu-item",onClick:d[0]||(d[0]=e=>u.goTo("member-overview"))},{default:n(()=>[d[2]||(d[2]=o("span",{class:"fbs-profile-menu-item-icon","aria-hidden":"true"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[o("path",{d:"M10 10a3.333 3.333 0 1 0 0-6.667A3.333 3.333 0 0 0 10 10Zm0 1.667c-3.222 0-5.833 1.86-5.833 4.166 0 .46.373.834.833.834h10c.46 0 .833-.373.833-.834 0-2.306-2.611-4.166-5.833-4.166Z",stroke:"currentColor","stroke-width":"1.4","stroke-linejoin":"round"})])],-1)),o("span",ai,c(r.$t("Profile overview")),1)]),_:1}),s(g,{class:"fbs-profile-menu-item",onClick:d[1]||(d[1]=e=>u.goTo("member-tasks"))},{default:n(()=>[o("span",ni,[s(b,{"icon-name":"task"})]),o("span",oi,c(r.$t("My tasks")),1)]),_:1}),u.me.logout_url?(t(),a(g,{key:0,class:"fbs-profile-menu-item",onClick:u.logout},{default:n(()=>[o("span",li,[s(b,{"icon-name":"log-out"})]),o("span",ri,c(r.$t("Log out")),1)]),_:1},8,["onClick"])):l("",!0)]),_:1})]),default:n(()=>[o("button",{type:"button",class:"fbs-profile-menu-trigger","aria-label":r.$t("Profile menu")},[o("span",Zt,[o("img",{src:u.me.photo,alt:r.$t("My Profile")},null,8,Gt),o("span",Yt,[s(b,{"icon-name":"arrow-down"})])])],8,Qt)]),_:1})):l("",!0)}]]),ThemeMode:ue({name:"ThemeMode",components:{Icons:be},data:()=>({themeMode:L.getCurrentTheme()}),computed:{resolvedTheme(){return this.themeMode===L.MODE_SYSTEM?L.getSystemTheme():this.themeMode}},mounted(){this.onThemeChanged=()=>{this.themeMode=L.getCurrentTheme()},window.addEventListener(x,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(x,this.onThemeChanged)},methods:{selectTheme(e){this.themeMode!==e&&(this.themeMode=e,L.apply(e))}}},[["render",function(i,r,h,f,m,u){const p=e("Icons"),b=ee,g=ae,_=se,v=ie;return t(),a(v,{class:"fbs-theme-mode",trigger:"click",onCommand:u.selectTheme,"popper-class":"fbs-theme-mode-popper"},{dropdown:n(()=>[s(_,null,{default:n(()=>[s(g,{command:"light",class:d({"fbs-theme-mode-active":"light"===m.themeMode})},{default:n(()=>[o("span",di,[s(p,{"icon-name":"sun"})]),o("span",null,c(i.$t("Light")),1),"light"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"]),s(g,{command:"dark",class:d({"fbs-theme-mode-active":"dark"===m.themeMode})},{default:n(()=>[o("span",hi,[s(p,{"icon-name":"moon"})]),o("span",null,c(i.$t("Dark")),1),"dark"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"]),s(g,{command:"system",class:d({"fbs-theme-mode-active":"system"===m.themeMode})},{default:n(()=>[o("span",fi,[s(p,{"icon-name":"system"})]),o("span",null,c(i.$t("System")),1),"system"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"])]),_:1})]),default:n(()=>[s(b,{text:"",size:"small",class:"fbs_topbar_icon_btn only-icon-btn","aria-label":i.$t("Theme mode")},{default:n(()=>[o("span",ci,[s(p,{"icon-name":"theme-mode"})])]),_:1},8,["aria-label"])]),_:1},8,["onCommand"])}]])},data:()=>({onlineStatus:!0,willRender:!0,isFullScreen:!1,isBeta:!1,isActiveWindow:!0,intervalTimer:null,activeWindowHasDataChangeTimeOut:null,hasInitializedConnectionStatus:!1,connectionStatusCheckId:0,isMobileNavigationOpen:!1,mobileNavigationLinkClickHandler:null,mobileNavigationTrigger:null,mobileNavigationFocusFrame:null,mobileNavigationInertElements:[]}),watch:{onlineStatus(e,t){this.hasInitializedConnectionStatus&&e!==t&&(e?this.$notify({title:"Online",message:"You're back online.",type:"success"}):this.$notify({title:"Offline",message:"You are offline. Changes made now will not be saved.",type:"error"}))}},computed:{isSettingsRoute(){var e,t,i,s;return(null==(t=null==(e=this.$route)?void 0:e.matched)?void 0:t.some(e=>"settings"===e.name))||(null==(s=null==(i=this.$route)?void 0:i.path)?void 0:s.startsWith("/settings"))},mobileNavigationLabel(){return this.isMobileNavigationOpen?this.$t("Close Navigation Menu"):this.$t("Open Navigation Menu")}},methods:{goToSettings(){this.isSettingsRoute||this.$router.push({name:"general-settings"})},async checkBackendConnection(){var e,t;const i=null==(t=null==(e=this.appVars)?void 0:e.rest)?void 0:t.url;if(!i)return!1;const s="undefined"!=typeof AbortController?new AbortController:null;let a=null;s&&(a=setTimeout(()=>s.abort(),3e3));try{return(await fetch(i,{method:"HEAD",cache:"no-store",credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest"},signal:s?s.signal:void 0})).ok}catch(n){return!1}finally{a&&clearTimeout(a)}},async updateConnectionStatus(e=null){const t=++this.connectionStatusCheckId;if("offline"===(null==e?void 0:e.type))return void(this.onlineStatus=!1);const i=await this.checkBackendConnection();t===this.connectionStatusCheckId&&(this.onlineStatus=i)},toggleFullScreen(){this.isFullScreen="yes"==this.isFullScreen?"no":"yes",this.Storage.set("full_screen",this.isFullScreen),"yes"===this.isFullScreen?(document.body.classList.add("fbs_full_screen"),document.documentElement.classList.remove("wp-toolbar")):(document.body.classList.remove("fbs_full_screen"),document.documentElement.classList.add("wp-toolbar"))},getMobileNavigationWrapper(){var e;return(null==(e=this.$el)?void 0:e.closest(".warp"))||document.querySelector(".warp.fconnector_app")},setMobileNavigationOpen(e){const t=this.getMobileNavigationWrapper(),i=null==t?void 0:t.querySelector(".fframe_menu_small_screen"),s=null==t?void 0:t.querySelector(".fframe_menu_overlay"),a=Boolean(e),n=this.isMobileNavigationOpen;if(this.isMobileNavigationOpen=a,i&&i.classList.toggle("fframe_menu_small_screen_open",a),s&&s.classList.toggle("active",a),document.body.style.overflow=a?"hidden":"",a&&!n){this.mobileNavigationTrigger=(null==t?void 0:t.querySelector(".fframe_handheld"))||null;const e=null==i?void 0:i.querySelector("[data-fbs-menu-close]");this.mobileNavigationFocusFrame=window.requestAnimationFrame(()=>{this.mobileNavigationFocusFrame=null,this.isMobileNavigationOpen&&(e&&e.focus({preventScroll:!0}),this.setMobileNavigationInert(!0))})}else if(!a&&n){this.cancelMobileNavigationFocusFrame(),this.setMobileNavigationInert(!1);const e=this.mobileNavigationTrigger;this.mobileNavigationTrigger=null,e&&document.contains(e)&&e.focus({preventScroll:!0})}},handleMobileNavigationKeydown(e){var t;if(!this.isMobileNavigationOpen)return;if("Escape"===e.key||"Esc"===e.key)return void this.setMobileNavigationOpen(!1);if("Tab"!==e.key)return;const i=null==(t=this.getMobileNavigationWrapper())?void 0:t.querySelector(".fframe_menu_small_screen");if(!i)return;const s=this.getMobileNavigationFocusable(i);if(!s.length)return void e.preventDefault();const a=s[0],n=s[s.length-1],o=document.activeElement;e.shiftKey?o!==a&&i.contains(o)||(e.preventDefault(),n.focus({preventScroll:!0})):o!==n&&i.contains(o)||(e.preventDefault(),a.focus({preventScroll:!0}))},getMobileNavigationFocusable:e=>Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement),setMobileNavigationInert(e){e?(this.restoreMobileNavigationInert(),this.mobileNavigationInertElements=this.getMobileNavigationInertTargets().map(e=>({el:e,inert:e.inert,ariaHidden:e.getAttribute("aria-hidden")})),this.mobileNavigationInertElements.forEach(({el:e})=>{e.inert=!0,e.setAttribute("aria-hidden","true")})):this.restoreMobileNavigationInert()},restoreMobileNavigationInert(){this.mobileNavigationInertElements.forEach(({el:e,inert:t,ariaHidden:i})=>{document.contains(e)&&(e.inert=t,null===i?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",i))}),this.mobileNavigationInertElements=[]},getMobileNavigationInertTargets(){const e=this.getMobileNavigationWrapper();if(!e)return[];const t=new Set,i=e.querySelector(".fframe_app"),s=e.querySelector(".fframe_menu_small_screen"),a=e.querySelector(".fframe_menu_overlay");i&&Array.from(i.children).forEach(e=>{e!==s&&e!==a&&t.add(e)});let n=e;for(;n&&n!==document.body;){const e=n.parentElement;if(!e)break;Array.from(e.children).forEach(e=>{e===n||["SCRIPT","STYLE"].includes(e.tagName)||t.add(e)}),n=e}return Array.from(t).filter(e=>e!==s&&e!==a&&!(s&&e.contains(s)))},cancelMobileNavigationFocusFrame(){null!==this.mobileNavigationFocusFrame&&(window.cancelAnimationFrame(this.mobileNavigationFocusFrame),this.mobileNavigationFocusFrame=null)},toggleMobileNavigation(){this.setMobileNavigationOpen(!this.isMobileNavigationOpen)},bindMobileNavigationLinks(){const e=this.getMobileNavigationWrapper();e&&(this.mobileNavigationLinkClickHandler=()=>{this.setMobileNavigationOpen(!1)},e.querySelectorAll(".fframe_menu_small_screen .fframe_menu_item a").forEach(e=>{e.addEventListener("click",this.mobileNavigationLinkClickHandler)}),e.querySelectorAll("[data-fbs-menu-overlay], [data-fbs-menu-close]").forEach(e=>{e.addEventListener("click",this.mobileNavigationLinkClickHandler)}))},unbindMobileNavigationLinks(){const e=this.getMobileNavigationWrapper();e&&this.mobileNavigationLinkClickHandler&&(e.querySelectorAll(".fframe_menu_small_screen .fframe_menu_item a").forEach(e=>{e.removeEventListener("click",this.mobileNavigationLinkClickHandler)}),e.querySelectorAll("[data-fbs-menu-overlay], [data-fbs-menu-close]").forEach(e=>{e.removeEventListener("click",this.mobileNavigationLinkClickHandler)}))},handleMobileNavigationResize(){this.isMobileNavigationOpen&&window.innerWidth>1133&&this.setMobileNavigationOpen(!1)},updateViewClass(){const e=document.querySelector(".fluent_boards_frontend"),t=document.getElementById("fluent-boards-app");if(e){const e=document.querySelector(".fframe_main-menu-items"),i=document.querySelector(".fframe_menu_small_screen"),s=t.offsetWidth;s<=530?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_mobile_view"),t.classList.remove("fbs_app_tablet_view","fbs_app_laptop_view")):s<=809?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_tablet_view"),t.classList.remove("fbs_app_mobile_view","fbs_app_laptop_view")):s<=1133?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_laptop_view"),t.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view")):(e.classList.remove("fbs_small_screen_menu_items"),i.classList.remove("fbs_small_screen_menu_items"),t.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view","fbs_app_laptop_view"))}},handleWindowVisibilityChange(){"visible"===document.visibilityState?(this.isActiveWindow||(this.eventBus.emit("has-board-data-changed"),this.isActiveWindow=!0),this.activeWindowHasDataChangeTimeOut&&clearTimeout(this.activeWindowHasDataChangeTimeOut)):this.activeWindowHasDataChangeTimeOut=setTimeout(()=>{this.isActiveWindow=!1},3e5)}},async mounted(){jQuery(".notice-warning, .notice-error").remove(),window.addEventListener("online",this.updateConnectionStatus),window.addEventListener("offline",this.updateConnectionStatus),window.addEventListener("resize",this.updateViewClass),window.addEventListener("resize",this.handleMobileNavigationResize),document.addEventListener("keydown",this.handleMobileNavigationKeydown),document.addEventListener("visibilitychange",this.handleWindowVisibilityChange),this.bindMobileNavigationLinks(),await this.updateConnectionStatus({type:"initial"}),this.hasInitializedConnectionStatus=!0,this.intervalTimer=setInterval(()=>{navigator.onLine&&!window.request_is_pending&&this.isActiveWindow&&(this.eventBus.emit("has-board-data-changed"),this.eventBus.emit("fetch-notification-number"))},3e5)},beforeUnmount(){document.removeEventListener("visibilitychange",this.handleWindowVisibilityChange),window.removeEventListener("online",this.updateConnectionStatus),window.removeEventListener("offline",this.updateConnectionStatus),window.removeEventListener("resize",this.updateViewClass),window.removeEventListener("resize",this.handleMobileNavigationResize),document.removeEventListener("keydown",this.handleMobileNavigationKeydown),this.cancelMobileNavigationFocusFrame(),document.body.style.overflow="",this.setMobileNavigationInert(!1),this.unbindMobileNavigationLinks(),this.intervalTimer&&clearInterval(this.intervalTimer)},created(){L.apply(L.getCurrentTheme()),this.isBeta=this.appVars.is_beta,this.isFullScreen=this.Storage.get("full_screen","no"),this.updateViewClass(),"yes"===this.isFullScreen?document.body.classList.add("fbs_full_screen"):document.body.classList.remove("fbs_full_screen")}},[["render",function(r,c,h,f,u,p){const b=ce,g=e("router-view"),_=e("pinned-boards"),y=e("global-search"),w=e("notification"),k=e("Icons"),N=ee,C=e("theme-mode"),T=e("profile-menu");return t(),i("div",mi,[u.isBeta?(t(),i("div",ui,[s(b,{type:"warning",center:"",closable:!1,"close-text":!1},{default:n(()=>[...c[1]||(c[1]=[o("p",{style:{"font-size":"16px",color:"black"}},[m(" You are using FluentBoards Beta Version. We just launched special Lifetime Deal for Beta users "),o("a",{class:"el-button fbs-primary-btn",href:"https://fluentboards.com/discount-deal/",rel:"noopener",target:"_blank"},"Get FluentBoards Pro")],-1)])]),_:1})])):l("",!0),s(g),(t(),a(v,{to:"#fluent_app_actions"},[o("div",pi,[o("div",bi,[s(_),s(y),s(w),r.$isAdmin()?(t(),a(N,{key:0,text:"",size:"small",class:d(["fbs_topbar_icon_btn only-icon-btn",{"fbs_topbar_icon_btn--active":p.isSettingsRoute}]),title:r.$t("Settings"),"aria-label":r.$t("Settings"),onClick:p.goToSettings},{default:n(()=>[o("span",gi,[s(k,{"icon-name":"gear"})])]),_:1},8,["class","title","aria-label","onClick"])):l("",!0),s(C),s(N,{text:"",size:"small",class:"fbs_topbar_icon_btn fbs_full_screen_btn only-icon-btn",title:r.$t("Toggle Full Screen Mode"),"aria-label":r.$t("Toggle Full Screen Mode"),onClick:p.toggleFullScreen},{default:n(()=>[o("span",_i,[s(k,{"icon-name":"fullscreen"})])]),_:1},8,["title","aria-label","onClick"]),o("button",{type:"button",class:d(["fframe_handheld",{fframe_handheld_open:u.isMobileNavigationOpen}]),"aria-label":p.mobileNavigationLabel,"aria-expanded":u.isMobileNavigationOpen?"true":"false","aria-controls":"fframe_mobile_menu","aria-haspopup":"true",onClick:c[0]||(c[0]=(...e)=>p.toggleMobileNavigation&&p.toggleMobileNavigation(...e))},[s(k,{class:"icon menu-icon","icon-name":"menu"}),s(k,{class:"icon close-icon","icon-name":"close"})],10,vi),s(T)])],512)]))])}]]),wi=$(),ki=y(yi),Ni=$();ki.config.globalProperties.appVars=window.fluentAddonVars,ki.config.globalProperties.appVars.isFrontView="front"===window.fluentAddonVars.render_in,window.Fuse=w,window.moment=A;const Ci=()=>window.fluentAddonVars&&window.fluentAddonVars.is_rtl?"bottom-left":"bottom-right";ki.mixin({data:()=>({Storage:Z,hasPro:!!window.fluentAddonVars.has_pro,isTouchScreen:"ontouchstart"in window||navigator.maxTouchPoints>0}),methods:{$get:K.get,$post:K.post,$put:K.put,$del:K.delete,$uploadFile:K.uploadFile,formatNumber:(e,t=!1)=>!e&&t?"":(e||(e="0"),new Intl.NumberFormat("en-US").format(e)),$changeTitle(e=null){null!=e?jQuery("head title").text(e+" - FluentBoards"):jQuery("head title").text("FluentBoards")},$t:z,$humanTimeDiff:H,$handleError:j,handleError:j,convertToText:W,$validateEmail:O,smartDate:R,$smartDate:q,$checkOverdue:D,$formatDate:V,$smartDateRange:U,smartDateWithYear:q,taskGroupingByStages:P,sortTaskByPosition:F,$getPref:(e,t="")=>Z.get(e,t),$setPref(e,t){Z.set(e,t)},$getUpgradeUrl(e){return Q(this.appVars.upgrade_url,e)},$formatMinutes(e){let t=parseInt(e);if(!t)return"--";const i=Math.floor(t/60);return t%=60,i?t?`${i}h ${t}m`:`${i}h`:`${t}m`},$getTaskUrl:B,$getBoardUrl:E,$isAdmin(){let e=window.fluentAddonVars.me.fluent_boards_role;return"wordpress_admin"===e||"fluent_boards_admin"===e},$isMember:()=>"member"===window.fluentAddonVars.me.fluent_boards_role,$isBoardManager(e){const t=window.fluentAddonVars.me.fluent_boards_capabilities.find(t=>t.board_id==e);return!!t&&"board_admin"===t.role},$canCreateBoard:()=>!!window.fluentAddonVars.me.can_create_board}}),ki.config.globalProperties.$notify=e=>{de({...e,position:Ci(),style:{}})},ki.config.globalProperties.$notify.success=e=>{de({...e,position:Ci(),type:"success",style:{}})},ki.config.globalProperties.$notify.error=e=>{de({...e,position:Ci(),title:"Error",type:"error",style:{}})},ki.config.globalProperties.$notify.warning=e=>{de({...e,position:Ci(),title:"Warning",type:"warning",style:{}})},ki.config.globalProperties.$confirm=he.confirm,ki.config.globalProperties.emitter=wi;const Ti=k({routes:X,history:N(),scrollBehavior:Y}),$i=C();$i.use(T),ki.use(Ti),ki.use(fe),ki.use($i),ki.provide("eventBus",Ni),ki.directive("prevent-context-menu",G);for(const[Si,Mi]of Object.entries(me))ki.component(Si,Mi);ki.mount("#fluent-framework-app"),Ti.beforeEach((e,t,i)=>{window.fbsPreviousRoute=t,i()}),Ti.afterEach((e,t)=>{const i=e.meta.active_menu;jQuery(".fframe_menu li").removeClass("active_item"),jQuery(".fframe_menu li.fframe_item_"+i).addClass("active_item"),jQuery(".toplevel_page_fluent_frame li").removeClass("current"),jQuery(".toplevel_page_fluent_frame li.fluent_frame_"+i).addClass("current"),e.meta.title&&jQuery("head title").text(e.meta.title+" - Fluent Boards")});
1 +import{aO as e,S as t,Z as i,_ as s,T as a,$ as n,a0 as o,a7 as l,H as r,a9 as c,a2 as d,a6 as h,aP as f,a8 as m,a5 as u,ax as p,a_ as b,av as g,R as _,bB as v,bC as y,bD as w,U as N,bx as k,bE as C,bF as $,bG as T,bH as S,bI as M,bJ as L}from"../vendor.js?ver=2.1.0";import{P as I,D as B,C as A,T as x,a as E,m as P,g as F,b as V,s as q,t as U,c as D,d as R,f as O,e as W,h as j,v as H,i as z,j as K,k as Q,$ as Z,R as G,l as Y,S as X,n as J,o as ee,r as te}from"../UpgradeUrl.js?ver=2.1.0";import{E as ie,a as se,b as ae,c as ne,d as oe,e as le,f as re,g as ce,h as de,i as he,j as fe,k as me,l as ue,m as pe,n as be}from"../vendor-element-plus.js?ver=2.1.0";import{_ as ge,E as _e,I as ve,B as ye,d as we}from"../descriptionToPlainText.js?ver=2.1.0";const Ne={class:"fbs_no_notification_found"};const ke={class:"fbs-notification-avatar-wrap"},Ce=["src","alt","title"],$e={key:2,class:"fbs-unread-mark","aria-hidden":"true"},Te={class:"fbs-notification-card-content"},Se={class:"fbs-notification-card-details"},Me={key:0,class:"fbs-notification-card-actor"},Le={key:1,class:"fbs-notification-card-action"},Ie={key:2,class:"fbs-notification-card-action"},Be={class:"fbs-notification-card-action"},Ae={class:"fbs-notification-card-task-title"},xe={class:"fbs-notification-card-action"},Ee={class:"fbs-notification-card-task-title"},Pe={key:0,class:"fbs-notification-card-actor"},Fe={class:"fbs-notification-card-action"},Ve={class:"fbs-notification-card-details-bottom"};const qe={class:"icon"},Ue={key:0,class:"fbs-notification-button-badge"},De={class:"fbs-notification-actions"},Re=["aria-label"],Oe=["aria-selected"],We=["aria-selected"],je=["aria-selected"],He=["aria-selected"],ze={class:"icon"},Ke={class:"icon"},Qe={key:0,class:"fbs-notification-loading-spacer"};const Ze=ge({name:"Notification",inject:["eventBus"],components:{Icons:ve,DrawerHeader:B,Pagination:I,NoNotificationFound:ge({name:"NoNotificationFound",components:{EmptyState:_e},props:{message:{type:String,required:!0}}},[["render",function(a,n,o,l,r,c){const d=e("empty-state");return t(),i("div",Ne,[s(d,{message:o.message,"icon-width":120,"icon-height":92},null,8,["message"])])}]]),NotificationCard:ge({name:"NotificationCard",props:["notification"],data:()=>({descriptionActions:["task_due_date_changed","task_start_date_changed","task_priority_changed","task_moved_to_new_stage"]}),methods:{getDescriptionPreview(e){const t=this.notification.description||"";return t.length>e?t.substring(0,e)+"...":t},makeNotificationRead(){this.notification.read||this.$put("notifications/read",{notification_id:this.notification.id}).then(e=>{this.notification.read=e.notification.marked_read_at,this.emitter.emit("readSingleNotification",this.notification),this.notification.task_id&&this.emitter.emit("update-notification-in-card",this.notification.task_id)}).catch(e=>{this.handleError(e)})}}},[["render",function(f,m,u,p,b,g){const _=e("Avatar"),v=ie;return t(),a(h(u.notification.task?"a":"div"),{class:d(["fbs-notification_card",{"fbs-notification_card--clickable":u.notification.task}]),href:u.notification.task?f.$getTaskUrl(u.notification.task,u.notification.settings):void 0,onClick:m[0]||(m[0]=e=>u.notification.task&&g.makeNotificationRead())},{default:n(()=>[o("span",ke,[u.notification.activitist?(t(),i("img",{key:0,class:"fbs-notification-user-avatar",src:u.notification.activitist.photo,alt:u.notification.activitist.display_name,title:u.notification.activitist.display_name},null,8,Ce)):(t(),a(v,{key:1,class:"fbs-notification-user-avatar fbs-notification-no-user"},{default:n(()=>[s(_)]),_:1})),u.notification.read?l("",!0):(t(),i("span",$e))]),o("span",Te,[o("span",Se,[u.notification.task?(t(),i(r,{key:0},[u.notification.activitist?(t(),i("span",Me,c(u.notification.activitist.display_name),1)):l("",!0),"task_assignee_changed"==u.notification.action?(t(),i("span",Le,c(" "+g.getDescriptionPreview(120)),1)):(t(),i("span",Ie,c(" "+f.$t(u.notification.action)),1)),b.descriptionActions.includes(u.notification.action)?(t(),i(r,{key:3},[o("span",Be,c(" "+f.$t("to")+" "),1),o("span",Ae,c(g.getDescriptionPreview(120)),1)],64)):l("",!0),u.notification.task.title?(t(),i(r,{key:4},[o("span",xe,c(" "+f.$t("in")+" "),1),o("span",Ee,c(u.notification.task.title),1)],64)):l("",!0)],64)):(t(),i(r,{key:1},[u.notification.activitist?(t(),i("span",Pe,c(u.notification.activitist.display_name),1)):l("",!0),o("span",Fe,c(u.notification.activitist?" "+g.getDescriptionPreview(120):g.getDescriptionPreview(120)),1)],64))]),o("span",Ve,c(f.$humanTimeDiff(u.notification.created_at)),1)])]),_:1},8,["class","href"])}]])},data:()=>({board:null,loading:!1,totalUnread:0,notifications:[],toggle:!0,allNotifications:!1,unreadNotifications:!0,pagination:{current_page:0},drawer:!1,noMoreNotifications:!1,mentionedNotifications:!1,assignedNotifications:!1}),computed:{notificationEmptyMessage(){return this.unreadNotifications?"No unread notification":"No notification"}},mounted(){this.fetchNotificationNumber(),this.emitter.on("readSingleNotification",this.markNotificationAsRead),this.eventBus.on("fetch-notification-number",this.fetchNotificationNumber)},beforeUnmount(){this.emitter.off("readSingleNotification",this.markNotificationAsRead),this.eventBus.off("fetch-notification-number",this.fetchNotificationNumber)},methods:{showAllNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!0,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllNotifications()},showMentionedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!0,this.assignedNotifications=!1,this.fetchSpecificNotifications()},showAssignedNotifications(){this.notifications=[],this.pagination={current_page:0},this.allNotifications=!1,this.unreadNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!0,this.fetchSpecificNotifications()},fetchSpecificNotifications(e={page:1}){this.loading=!0;let t=this.assignedNotifications?"task_assignee_changed":"task_comment_mentioned";this.$get("notifications/",{...e,action:t}).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1})},markNotificationAsRead(e){this.unreadNotifications&&(this.notifications=this.notifications.filter(t=>t.id!=e.id),this.noMoreNotifications||this.fetchAllUnreadNotifications()),this.totalUnread--},fetchNotificationNumber(){this.$get("notifications/unread-count").then(e=>{this.totalUnread=e.total_unread}).catch(e=>{this.handleError(e)}).finally(()=>{})},markAllNotificationAsRead(){this.$put("notifications/read",{notification_id:null}).then(e=>{this.unreadNotifications?this.notifications=[]:this.fetchAllNotifications(),this.emitter.emit("update-notification-in-card",null)}).catch(e=>{this.handleError(e)}).finally(()=>{this.totalUnread=0})},openDrawer(){this.drawer=!0,this.unreadNotifications=this.totalUnread>0,this.allNotifications=!this.unreadNotifications,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.toggle=!0,this.notifications=[],this.unreadNotifications?this.fetchAllUnreadNotifications():this.fetchAllNotifications()},showUnreadNotifications(){this.notifications=[],this.pagination={current_page:0},this.unreadNotifications=!0,this.allNotifications=!1,this.mentionedNotifications=!1,this.assignedNotifications=!1,this.fetchAllUnreadNotifications()},fetchAllNotifications(e={page:1}){this.loading=!0,this.$get("notifications/",e).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},handleScroll(){const e=this.$refs.notificationContainer;if(e){const{scrollTop:t,scrollHeight:i,clientHeight:s}=e;if(t+s>=i-200){if(this.noMoreNotifications||this.loading)return;const e={page:this.pagination.current_page+1};this.mentionedNotifications||this.assignedNotifications?this.fetchSpecificNotifications(e):this.unreadNotifications?this.fetchAllUnreadNotifications(e):this.fetchAllNotifications(e)}}},fetchAllUnreadNotifications(e){this.loading=!0,this.$get("notifications/unread",e).then(e=>{this.setNotifications(e)}).catch(e=>{this.handleError(e)}).finally(()=>{this.loading=!1,this.fetchNotificationNumber()})},setNotifications(e){this.notifications=this.updateNotificationsMerge(this.notifications,e.data),this.pagination=e,this.noMoreNotifications="last_page"in this.pagination&&this.pagination.last_page<=this.pagination.current_page&&this.pagination.last_page!=this.pagination.current_page},updateNotificationsMerge(e,t){const i=new Map;return e.forEach(e=>{i.set(e.id,e)}),t.forEach(e=>{i.set(e.id,e)}),Array.from(i.values())},drawerClosing(){this.notifications=[],this.pagination={current_page:0},this.noMoreNotifications=!1,this.allNotifications=!1,this.unreadNotifications=!0,this.mentionedNotifications=!1,this.assignedNotifications=!1}}},[["render",function(h,b,g,_,v,y){const w=e("Icons"),N=se,k=ae,C=e("drawer-header"),$=le,T=oe,S=ne,M=e("notification-card"),L=e("no-notification-found"),I=re,B=ce,A=f("loading");return t(),i("div",null,[s(k,{effect:"dark",content:h.$t("Notifications"),placement:"bottom"},{default:n(()=>[s(N,{text:"",size:"small",class:"fbs_topbar_icon_btn only-icon-btn fbs-notification-button","aria-label":h.$t("Notifications"),onClick:y.openDrawer},{default:n(()=>[o("span",qe,[s(w,{"icon-name":"bell"})]),v.totalUnread>0?(t(),i("span",Ue,c(v.totalUnread>99?"99+":v.totalUnread),1)):l("",!0)]),_:1},8,["aria-label","onClick"])]),_:1},8,["content"]),s(B,{modelValue:v.drawer,"onUpdate:modelValue":b[6]||(b[6]=e=>v.drawer=e),"append-to-body":"",class:"fbs_right_sidebar fbs-notification-drawer","with-header":!1,size:"min(440px, 100vw)",direction:h.appVars.is_rtl?"ltr":"rtl",onClose:y.drawerClosing},{default:n(()=>[s(C,{title:"Notification","icon-name":"notification",onClose:b[0]||(b[0]=e=>v.drawer=!1)}),o("div",De,[o("div",{class:"fbs-notification-tabs",role:"tablist","aria-label":h.$t("Notifications")},[o("button",{type:"button",class:d(["fbs-switch-btn",v.allNotifications?"fbs-active":""]),role:"tab","aria-selected":v.allNotifications,onClick:b[1]||(b[1]=(...e)=>y.showAllNotifications&&y.showAllNotifications(...e))},c(h.$t("All")),11,Oe),o("button",{type:"button",class:d(["fbs-switch-btn",v.unreadNotifications?"fbs-active":""]),role:"tab","aria-selected":v.unreadNotifications,onClick:b[2]||(b[2]=(...e)=>y.showUnreadNotifications&&y.showUnreadNotifications(...e))},c(h.$t("Unread")),11,We),o("button",{type:"button",class:d(["fbs-switch-btn",v.mentionedNotifications?"fbs-active":""]),role:"tab","aria-selected":v.mentionedNotifications,onClick:b[3]||(b[3]=(...e)=>y.showMentionedNotifications&&y.showMentionedNotifications(...e))},c(h.$t("Mentioned")),11,je),o("button",{type:"button",class:d(["fbs-switch-btn",v.assignedNotifications?"fbs-active":""]),role:"tab","aria-selected":v.assignedNotifications,onClick:b[4]||(b[4]=(...e)=>y.showAssignedNotifications&&y.showAssignedNotifications(...e))},c(h.$t("Assigned")),11,He)],8,Re),s(S,{trigger:"click",class:"fbs-notification-dropdown",placement:"bottom-end"},{dropdown:n(()=>[s(T,null,{default:n(()=>[s($,{onClick:y.markAllNotificationAsRead},{default:n(()=>[o("span",Ke,[s(w,{"icon-name":"eye"})]),m(" "+c(h.$t("mark_all_read")),1)]),_:1},8,["onClick"])]),_:1})]),default:n(()=>[s(N,{text:"",size:"small",class:"only-icon-btn","aria-label":h.$t("Menu")},{default:n(()=>[o("span",ze,[s(w,{"icon-name":"dots","aria-hidden":"true"})])]),_:1},8,["aria-label"])]),_:1})]),u((t(),i("div",{onScroll:b[5]||(b[5]=(...e)=>y.handleScroll&&y.handleScroll(...e)),ref:"notificationContainer",class:"fbs_notification_container",id:"notification-container"},[(t(!0),i(r,null,p(v.notifications,e=>(t(),a(M,{key:e.id,notification:e},null,8,["notification"]))),128)),v.loading&&v.pagination.current_page>0?u((t(),i("p",Qe,null,512)),[[A,!0]]):l("",!0),0!==v.notifications.length||v.loading?l("",!0):(t(),a(I,{key:1},{default:n(()=>[s(L,{message:y.notificationEmptyMessage},null,8,["message"])]),_:1}))],32)),[[A,v.loading]])]),_:1},8,["modelValue","direction","onClose"])])}]]),Ge={class:"navigable_list_container fbs_global_search_result_container"},Ye={key:0,class:"no_results fbs_global_search_result_not_found"},Xe={class:"fbs_global_search_empty_state"},Je={key:1},et={ref:"listContainer",class:"navigable_list fbs_global_search_result_list"},tt=["tabindex","onClick","onKeydown"];const it=[{key:"boards",title:"Boards",type:"board"},{key:"tasks",title:"Tasks",type:"task"}],st=["title","aria-label"],at={class:"fbs_global_search_input_container"},nt={key:0,class:"searched_item"},ot={key:0,class:"fbs_global_search_commands"},lt={class:"fbs_global_search_commands_label"},rt={key:0,class:"fbs_global_search_commands_list"},ct=["onClick","onMouseenter"],dt={class:"fbs_command_slash"},ht={class:"fbs_command_desc"},ft={key:1,class:"fbs_global_search_commands_empty"},mt={class:"fbs_global_searching_for"},ut={class:"fbs_global_searching_for_label"},pt={class:"fbs_global_searching_suggestion_list"},bt=["onClick"],gt={class:"fbs_global_search_no_result"},_t={key:2,class:"fbs-global-remote-result-container"},vt={class:"fbs-w-full"},yt={key:0,class:"fbs_global_search_subscriber"},wt={class:"fbs_global_search_subscriber_avatar"},Nt={class:"fbs_global_search_subscriber_avatar_placeholder"},kt={class:"fbs_global_search_subscriber_info"},Ct={class:"fbs_global_search_subscriber_name"},$t={class:"fbs_global_search_subscriber_meta"},Tt={class:"fbs_global_search_result_type"},St={key:1,class:"fbs_global_search_subscriber fbs_global_search_title_item"},Mt={class:"fbs_global_search_subscriber_name"},Lt={class:"fbs_global_search_subscriber_meta"},It={key:0,class:"fbs_global_search_subscriber_email"},Bt={class:"fbs-global-search-stage-title"},At={class:"fbs_global_search_result_type"},xt={class:"dialog-footer is-border"},Et={key:0,class:"fbs_search_tip"},Pt={class:"fbs_search_tip_label"},Ft={class:"fbs_search_tip_text"},Vt={class:"fbs_search_commands"},qt={class:"fbs_label"},Ut={class:"fbs_label"},Dt={class:"fbs_label"};const Rt=ge({name:"GlobalSearch",components:{NavigableList:ge({name:"NavigableList",components:{EmptyState:_e},props:{items:{type:Array,required:!0,default:()=>[]},noResultsText:{type:String,default:"No results found"},onAction:{type:Function,required:!0}},data:()=>({selectedIndex:-1}),methods:{navigate(e){const t=this.items.length;if(0===t)return;const i=t-1;"up"===e?this.selectedIndex=this.selectedIndex<=0?i:this.selectedIndex-1:"down"===e&&(this.selectedIndex=this.selectedIndex>=i?0:this.selectedIndex+1),this.scrollToSelectedElement()},scrollToSelectedElement(){const e=this.$refs.listContainer,t=this.$refs.listItem&&this.$refs.listItem[this.selectedIndex];t&&e&&(t.scrollIntoView({behavior:"smooth",block:"nearest"}),this.$nextTick(()=>{t.focus()}))},handleItemClick(e){this.selectedIndex=e,this.performAction(e)},performAction(e){e>=0&&e<this.items.length&&this.onAction(this.items[e],e)},resetSelection(){this.selectedIndex=-1},focusList(e){(e=null!=e?e:this.items.length-1)>=0&&(this.selectedIndex=e,this.$nextTick(()=>{const t=this.$refs.listItem&&this.$refs.listItem[e];t&&t.focus()}))},performFirstAction(){this.items.length>0?(this.selectedIndex=0,this.performAction(0)):this.selectedIndex=-1},performSelectedAction(){this.items.length<1?this.selectedIndex=-1:this.selectedIndex<0||this.selectedIndex>=this.items.length?this.performFirstAction():this.performAction(this.selectedIndex)}},watch:{items:{handler(){this.resetSelection()},immediate:!0}}},[["render",function(a,n,l,c,h,f){const m=e("empty-state");return t(),i("div",Ge,[0===l.items.length?(t(),i("div",Ye,[o("div",Xe,[s(m,{message:l.noResultsText,"icon-width":84,"icon-height":64},null,8,["message"])])])):(t(),i("div",Je,[o("ul",et,[(t(!0),i(r,null,p(l.items,(e,s)=>(t(),i("li",{key:s,ref_for:!0,ref:"listItem",class:d({selected:s===h.selectedIndex}),tabindex:s,onClick:e=>f.handleItemClick(s),onKeydown:[n[0]||(n[0]=b(g(e=>f.navigate("up"),["prevent"]),["arrow-up"])),n[1]||(n[1]=b(g(e=>f.navigate("down"),["prevent"]),["arrow-down"])),b(e=>f.performAction(s),["enter"])]},[_(a.$slots,"default",{item:e,index:s,isSelected:s===h.selectedIndex})],42,tt))),128))],512)]))])}]]),CustomIcon:A,Icons:ve},data:()=>({visible:!1,query:"",scopeTag:null,loading:!1,results:[],payload:null,lastScope:null,searchTimer:null,activeTip:"",commandIndex:-1,perPage:20}),computed:{scopeTags:()=>[...it],scope(){return this.scopeTag?this.scopeTag.key:"all"},isCommandMode(){return this.query.startsWith("/")},commandQuery(){return this.query.slice(1).toLowerCase().trim()},filteredCommands(){if(!this.isCommandMode)return[];const e=this.commandQuery;return this.scopeTags.filter(t=>!e||t.title.toLowerCase().includes(e))}},watch:{scopeTag(){this.query.trim()&&this.search()},filteredCommands(){this.commandIndex=this.filteredCommands.length?0:-1}},mounted(){window.addEventListener("keydown",this.onKeydown)},beforeUnmount(){clearTimeout(this.searchTimer),window.removeEventListener("keydown",this.onKeydown)},methods:{open(){this.setRandomTip(),this.visible=!0},onClosed(){var e;this.visible=!1,this.query="",this.scopeTag=null,this.results=[],this.payload=null,null==(e=this.$refs.listRef)||e.resetSelection()},focusInput(){this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()})},onInput(){clearTimeout(this.searchTimer),this.isCommandMode?this.results=[]:this.query.trim()?this.searchTimer=setTimeout(()=>this.search(),400):this.results=[]},search(){const e=this.query.trim();if(!e)return void(this.results=[]);if(this.payload&&this.lastScope===this.scope&&this.payload._query===e)return void this.applyPayload();const t={query:e,scope:"all",per_page:this.perPage};this.scopeTag&&"boards"!==this.scopeTag.key||(t.board_page=1),this.scopeTag&&"tasks"!==this.scopeTag.key||(t.task_page=1),this.loading=!0,this.$get("global-search",t).then(t=>{this.payload={...t,_query:e},this.lastScope=this.scope,this.applyPayload()}).catch(()=>{this.results=[]}).finally(()=>{this.loading=!1})},applyPayload(){if(!this.payload)return;const e=(this.payload.boards&&this.payload.boards.data||[]).map(e=>({...e,_resultType:"board"})),t=(this.payload.tasks&&this.payload.tasks.data||[]).map(e=>({...e,_resultType:"task"}));this.scopeTag&&"boards"===this.scopeTag.key?this.results=e:this.scopeTag&&"tasks"===this.scopeTag.key?this.results=t:this.results=[...e,...t]},focusList(e="down"){if(this.isCommandMode){const t=this.filteredCommands.length;if(!t)return;return void(this.commandIndex="up"===e?this.commandIndex<=0?t-1:this.commandIndex-1:this.commandIndex>=t-1?0:this.commandIndex+1)}const t=this.$refs.listRef;t&&this.results.length&&("up"!==e?t.focusList(0):t.focusList(this.results.length-1))},selectFromKeyboard(){if(this.isCommandMode){const e=this.filteredCommands[this.commandIndex];return void(e&&this.selectCommand(e))}const e=this.$refs.listRef;e&&this.results.length&&e.performSelectedAction()},selectCommand(e){this.scopeTag=e,this.query="",this.commandIndex=-1,this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()})},goToItem(e){const t="board"===e._resultType?this.$getBoardUrl(e):this.$getTaskUrl(e);t&&"#"!==t&&(window.location.href=t),this.visible=!1},resultTypeLabel(e){return this.$t({board:"Board",task:"Task"}[e._resultType]||"Item")},setRandomTip(){const e=[this.$t('Press "/" anywhere to open Search quickly'),this.$t("Use the Boards or Tasks chips to narrow results"),this.$t("Use ↑↓ keys to move through results"),this.$t("Press Enter to open the selected result"),this.$t('Type "id: 123" to find a board or task by id')];this.activeTip=e[Math.floor(Math.random()*e.length)]||""},onKeydown(e){var t;if("/"!==(null==(t=e.key)?void 0:t.toLowerCase())||e.metaKey||e.ctrlKey||e.altKey)return;const i=e.target,s=i&&i.tagName?i.tagName.toUpperCase():"";i&&(i.isContentEditable||"INPUT"===s||"TEXTAREA"===s||"SELECT"===s)||(e.preventDefault(),this.open(),this.$nextTick(()=>{var e;return null==(e=this.$refs.inputRef)?void 0:e.focus()}))}}},[["render",function(a,h,_,v,y,w){const N=de,k=e("Icons"),C=e("custom-icon"),$=e("NavigableList"),T=he,S=f("loading");return t(),i(r,null,[o("button",{type:"button",class:"fbs_icon_btn fbs_global_search",title:a.$t("Global Search"),"aria-label":a.$t("Global Search"),onClick:h[0]||(h[0]=(...e)=>w.open&&w.open(...e))},[...h[7]||(h[7]=[o("span",{class:"icon"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[o("path",{d:"M12.0232 10.9627L15.2355 14.1742L14.1742 15.2355L10.9627 12.0232C9.7678 12.9812 8.2815 13.5022 6.75 13.5C3.024 13.5 0 10.476 0 6.75C0 3.024 3.024 0 6.75 0C10.476 0 13.5 3.024 13.5 6.75C13.5022 8.2815 12.9812 9.7678 12.0232 10.9627ZM10.5187 10.4062C11.4706 9.42741 12.0021 8.11532 12 6.75C12 3.849 9.65025 1.5 6.75 1.5C3.849 1.5 1.5 3.849 1.5 6.75C1.5 9.65025 3.849 12 6.75 12C8.11532 12.0021 9.42741 11.4706 10.4062 10.5187L10.5187 10.4062Z",fill:"currentColor",transform:"translate(2.5 2.5)"})])],-1),o("span",{class:"slash-icon"},"/",-1)])],8,st),s(T,{modelValue:y.visible,"onUpdate:modelValue":h[6]||(h[6]=e=>y.visible=e),onOpened:w.focusInput,onClosed:w.onClosed,class:"fbs_global_search_container","modal-class":"fbs_global_search_modal","append-to-body":!0},{header:n(()=>[o("div",at,[h[9]||(h[9]=o("span",{class:"icon"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none","aria-hidden":"true"},[o("path",{d:"M12.0232 10.9627L15.2355 14.1742L14.1742 15.2355L10.9627 12.0232C9.7678 12.9812 8.2815 13.5022 6.75 13.5C3.024 13.5 0 10.476 0 6.75C0 3.024 3.024 0 6.75 0C10.476 0 13.5 3.024 13.5 6.75C13.5022 8.2815 12.9812 9.7678 12.0232 10.9627ZM10.5187 10.4062C11.4706 9.42741 12.0021 8.11532 12 6.75C12 3.849 9.65025 1.5 6.75 1.5C3.849 1.5 1.5 3.849 1.5 6.75C1.5 9.65025 3.849 12 6.75 12C8.11532 12.0021 9.42741 11.4706 10.4062 10.5187L10.5187 10.4062Z",fill:"var(--fbs-text-muted, #99a0ae)",transform:"translate(1 1)"})])],-1)),y.scopeTag?(t(),i("div",nt,[m(c(y.scopeTag.title)+" ",1),o("span",{class:"icon",onClick:h[1]||(h[1]=e=>y.scopeTag=null)},[...h[8]||(h[8]=[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true"},[o("path",{d:"M6 5.057L9.3 1.757l.943.943-3.3 3.3 3.3 3.3-.943.943-3.3-3.3-3.3 3.3-.943-.943 3.3-3.3-3.3-3.3.943-.943 3.3 3.3Z",fill:"currentColor"})],-1)])])])):l("",!0),s(N,{ref:"inputRef",modelValue:y.query,"onUpdate:modelValue":h[2]||(h[2]=e=>y.query=e),class:"mousetrap",placeholder:y.scopeTag?a.$t("Search")+" "+y.scopeTag.title:a.$t("Type to search or / to filter"),clearable:"",autofocus:"",onInput:w.onInput,onKeydown:[h[3]||(h[3]=b(g(e=>w.focusList("down"),["prevent"]),["arrow-down"])),h[4]||(h[4]=b(g(e=>w.focusList("up"),["prevent"]),["arrow-up"])),b(g(w.selectFromKeyboard,["prevent"]),["enter"]),h[5]||(h[5]=b(e=>""===y.query&&(y.scopeTag=null),["backspace"]))]},null,8,["modelValue","placeholder","onInput","onKeydown"])])]),default:n(()=>[w.isCommandMode?(t(),i("div",ot,[o("div",lt,c(a.$t("Filter by")),1),w.filteredCommands.length?(t(),i("ul",rt,[(t(!0),i(r,null,p(w.filteredCommands,(e,s)=>(t(),i("li",{key:e.key,class:d({selected:s===y.commandIndex}),onClick:t=>w.selectCommand(e),onMouseenter:e=>y.commandIndex=s},[o("span",dt,"/"+c(e.title.toLowerCase()),1),o("span",ht,c(a.$t("Search in")+" "+e.title),1)],42,ct))),128))])):(t(),i("div",ft,c(a.$t("No matching filters")),1))])):y.query?u((t(),i("div",_t,[s($,{ref:"listRef",items:y.results,"no-results-text":y.query?"No matches found":"Type to search","on-action":w.goToItem},{default:n(({item:e})=>[o("div",vt,["board"===e._resultType?(t(),i("div",yt,[o("div",wt,[o("div",Nt,c((e.title||"?").charAt(0).toUpperCase()),1)]),o("div",kt,[o("span",Ct,c(e.title),1),o("div",$t,[o("span",Tt,c(w.resultTypeLabel(e)),1)])])])):(t(),i("div",St,[o("span",Mt,c(e.title),1),o("div",Lt,[e.board?(t(),i("span",It,[m(c(e.board.title)+" ",1),e.stage&&e.stage.title?(t(),i(r,{key:0},[h[10]||(h[10]=m(" — ",-1)),o("span",Bt,[s(C,{"icon-name":"stage"}),m(c(e.stage.title),1)])],64)):l("",!0)])):l("",!0),o("span",At,c(w.resultTypeLabel(e)),1)])]))]),h[11]||(h[11]=o("div",{class:"action-icon"},[o("svg",{width:"6",height:"9",viewBox:"0 0 6 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[o("path",{d:"M3.34125 4.2957L0 0.95445L0.95445 0L5.25015 4.2957L0.95445 8.5914L0 7.63695L3.34125 4.2957Z",fill:"var(--fbs-secondary-text, #525866)"})])],-1))]),_:1},8,["items","no-results-text","on-action"])])),[[S,y.loading]]):(t(),i(r,{key:1},[o("div",mt,[o("div",ut,c(a.$t("Searching for")),1),o("div",pt,[(t(!0),i(r,null,p(w.scopeTags,e=>(t(),i("div",{key:e.key,class:d(["fbs_global_searching_suggestion",{active:y.scopeTag&&y.scopeTag.key===e.key}]),onClick:t=>y.scopeTag=e},c(e.title),11,bt))),128))])]),o("div",gt,[s(k,{"icon-name":"search","icon-class":"fbs_global_search_empty_icon","aria-hidden":"true"}),o("p",null,c(a.$t("Start typing to find a board or task")),1)])],64)),o("div",xt,[y.activeTip?(t(),i("div",Et,[o("span",Pt,c(a.$t("Tip"))+":",1),o("span",Ft,c(y.activeTip),1)])):l("",!0),o("ul",Vt,[o("li",null,[h[12]||(h[12]=o("span",{class:"fbs_command_keys"},[o("span",{class:"fbs_command_key"},"↑"),o("span",{class:"fbs_command_key"},"↓")],-1)),o("span",qt,c(a.$t("Navigate")),1)]),o("li",null,[h[13]||(h[13]=o("span",{class:"fbs_command_key"},"↵",-1)),o("span",Ut,c(a.$t("Select")),1)]),o("li",null,[h[14]||(h[14]=o("span",{class:"fbs_command_key"},"/",-1)),o("span",Dt,c(a.$t("Filter")),1)])])])]),_:1},8,["modelValue","onOpened","onClosed"])],64)}]]);let Ot=null;const Wt=v("pinnedBoards",{state:()=>({pinnedBoards:[],loaded:!1,loading:!1,mutationVersion:0}),actions:{ensurePinnedBoards(e){if(this.loaded)return Promise.resolve(this.pinnedBoards);if(Ot)return Ot;this.loading=!0;const t=()=>{const i=this.mutationVersion;let s;try{s=e()}catch(a){s=Promise.reject(a)}return Promise.resolve(s).then(e=>i!==this.mutationVersion?t():(this.pinnedBoards=Array.isArray(null==e?void 0:e.pinnedBoards)?e.pinnedBoards:[],this.loaded=!0,this.pinnedBoards))};return Ot=t().finally(()=>{this.loading=!1,Ot=null}),Ot},upsertPinnedBoard(e){const t=Number(null==e?void 0:e.id);if(!Number.isFinite(t)||t<=0)return;this.mutationVersion+=1;const i={...e,id:t,is_pinned:!0},s=this.pinnedBoards.findIndex(e=>Number(e.id)===t);this.pinnedBoards=-1!==s?this.pinnedBoards.map((e,t)=>t===s?{...e,...i}:e):[...this.pinnedBoards,i]},removePinnedBoard(e){const t=Number(e);!Number.isFinite(t)||t<=0||(this.mutationVersion+=1,this.pinnedBoards=this.pinnedBoards.filter(e=>Number(e.id)!==t))}}}),jt={name:"PinnedBoards",components:{BoardBackgroundPreview:ye,Icons:ve},data:()=>({mutationLoading:!1,selectedBoardId:null}),computed:{...w(Wt,{pinnedBoards:e=>e.pinnedBoards,pinnedBoardsLoading:e=>e.loading}),loading(){return this.pinnedBoardsLoading||this.mutationLoading}},mounted(){this.emitter.on("board-pin-state-changed",this.handleBoardPinStateChanged)},beforeUnmount(){this.emitter.off("board-pin-state-changed",this.handleBoardPinStateChanged)},methods:{...y(Wt,["ensurePinnedBoards","upsertPinnedBoard","removePinnedBoard"]),handleDropdownVisible(e){e&&this.fetchPinnedBoards()},goToBoard(e){this.$router.push({name:"board",params:{id:e.id}})},fetchPinnedBoards(){return this.ensurePinnedBoards(()=>this.$get("projects/pinned-boards")).catch(e=>{this.handleError(e)})},plainText:e=>e?String(e).replace(/<[^>]*>/g,"").trim():"",plainDescription:e=>we((null==e?void 0:e.description)||""),handleBoardPinStateChanged({boardId:e,isPinned:t,board:i}){t&&i?this.upsertPinnedBoard(i):t||this.removePinnedBoard(e)},unpinBoard(e){this.mutationLoading=!0,this.selectedBoardId=e,this.$put("projects/"+e+"/unpin-board").then(()=>{const t=this.pinnedBoards.find(t=>Number(t.id)===Number(e));this.removePinnedBoard(e),this.emitter.emit("remove-pinned-board",e),this.emitter.emit("board-pin-state-changed",{boardId:e,wasPinned:!0,isPinned:!1,board:t})}).catch(e=>{this.handleError(e)}).finally(()=>{this.mutationLoading=!1,this.selectedBoardId=null})}}},Ht={class:"icon"},zt={class:"fbs_board_list_item"},Kt={class:"fbs_board_list_item__content"},Qt={class:"fbs_board_list_item__title_row"},Zt=["title"],Gt=["title"],Yt={class:"fbs_board_list_item__meta"},Xt=["title","aria-label","onClick"],Jt={class:"icon fbs_board_card__pin__icon"},ei={class:"icon fbs_board_card__pin__icon_outline"};const ti=["aria-label"],ii={class:"fbs-my-profile-avatar"},si=["src","alt"],ai={class:"fbs-profile-menu-caret","aria-hidden":"true"},ni={class:"fbs-profile-menu-head"},oi={class:"fbs-profile-menu-head-avatar","aria-hidden":"true"},li=["src","alt"],ri={class:"fbs-profile-menu-identity"},ci=["title"],di=["title"],hi={class:"fbs-profile-menu-item-label"},fi={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},mi={class:"fbs-profile-menu-item-label"},ui={class:"fbs-profile-menu-item-icon","aria-hidden":"true"},pi={class:"fbs-profile-menu-item-label"};const bi={class:"icon"},gi={class:"icon"},_i={class:"icon"},vi={class:"icon"};const yi={class:"fl_app"},wi={key:0},Ni={class:"fbs-global-menu-icons",ref:"global_menu_right"},ki={class:"fbs-global-action-buttons"},Ci={class:"icon"},$i={class:"icon"},Ti=["aria-label","aria-expanded"];const Si=ge({name:"DashboardApplication",inject:["eventBus"],components:{Icons:ve,GlobalSearch:Rt,Notification:Ze,PinnedBoards:ge(jt,[["render",function(l,d,h,b,_,v){const y=e("Icons"),w=se,N=e("board-background-preview"),k=le,C=oe,$=ne,T=f("loading");return t(),a($,{placement:"bottom-end",class:"fbs-pinned-boards",trigger:"click","popper-class":"fbs-pinned-boards-popper",onVisibleChange:v.handleDropdownVisible},{dropdown:n(()=>[u((t(),a(C,null,{default:n(()=>[l.pinnedBoards.length?(t(!0),i(r,{key:0},p(l.pinnedBoards,e=>(t(),a(k,{key:e.id,onClick:t=>v.goToBoard(e)},{default:n(()=>[u((t(),i("div",zt,[s(N,{class:"fbs_board_list_item__cover",board:e,"hide-icon":!0},null,8,["board"]),o("div",Kt,[o("div",Qt,[o("h3",{title:v.plainText(e.title)},c(e.title),9,Zt)]),o("p",{class:"fbs_board_list_item__desc",title:v.plainDescription(e)},c(v.plainDescription(e)||l.$t("No description")),9,Gt)]),o("div",Yt,[o("button",{type:"button",class:"fbs_board_card__pin fbs_board_card__pin--pinned",title:l.$t("board is pinned"),"aria-label":l.$t("board is pinned"),onClick:g(t=>v.unpinBoard(e.id),["stop"])},[o("span",Jt,[s(y,{"icon-name":"pin-fill","aria-hidden":"true"})]),o("span",ei,[s(y,{"icon-name":"pin","aria-hidden":"true"})])],8,Xt)])])),[[T,v.loading&&_.selectedBoardId===e.id]])]),_:2},1032,["onClick"]))),128)):(t(),a(k,{key:1,disabled:""},{default:n(()=>[m(c(l.$t("No pinned board yet!")),1)]),_:1}))]),_:1})),[[T,v.loading&&!_.selectedBoardId]])]),default:n(()=>[s(w,{"aria-label":l.$t("Pinned Boards")},{default:n(()=>[m(c(l.$t("Pinned"))+" ",1),o("span",Ht,[s(y,{"icon-name":"arrow-down"})])]),_:1},8,["aria-label"])]),_:1},8,["onVisibleChange"])}]]),ProfileMenu:ge({name:"ProfileMenu",components:{Icons:ve},computed:{me(){var e;return(null==(e=this.appVars)?void 0:e.me)||{}},displayName(){return this.me.full_name||this.me.display_name||""}},methods:{goTo(e){const t={name:e,params:{user_id:this.me.id}};this.$route.name===e&&String(this.$route.params.user_id)===String(this.me.id)||this.$router.push(t)},logout(){this.me.logout_url&&(window.location.href=this.me.logout_url)}}},[["render",function(r,d,h,f,m,u){var p;const b=e("Icons"),g=le,_=oe,v=ne;return(null==(p=u.me)?void 0:p.id)?(t(),a(v,{key:0,placement:"bottom-end",class:"fbs-profile-menu",trigger:"click","popper-class":"fbs-profile-menu-popper"},{dropdown:n(()=>[s(_,{class:"fbs-profile-menu-list"},{default:n(()=>[o("li",ni,[o("span",oi,[o("img",{src:u.me.photo,alt:u.displayName},null,8,li)]),o("span",ri,[o("span",{class:"fbs-profile-menu-name",title:u.displayName},c(u.displayName),9,ci),u.me.email?(t(),i("span",{key:0,class:"fbs-profile-menu-email",title:u.me.email},c(u.me.email),9,di)):l("",!0)])]),s(g,{class:"fbs-profile-menu-item",onClick:d[0]||(d[0]=e=>u.goTo("member-overview"))},{default:n(()=>[d[2]||(d[2]=o("span",{class:"fbs-profile-menu-item-icon","aria-hidden":"true"},[o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 20 20",fill:"none"},[o("path",{d:"M10 10a3.333 3.333 0 1 0 0-6.667A3.333 3.333 0 0 0 10 10Zm0 1.667c-3.222 0-5.833 1.86-5.833 4.166 0 .46.373.834.833.834h10c.46 0 .833-.373.833-.834 0-2.306-2.611-4.166-5.833-4.166Z",stroke:"currentColor","stroke-width":"1.4","stroke-linejoin":"round"})])],-1)),o("span",hi,c(r.$t("Profile overview")),1)]),_:1}),s(g,{class:"fbs-profile-menu-item",onClick:d[1]||(d[1]=e=>u.goTo("member-tasks"))},{default:n(()=>[o("span",fi,[s(b,{"icon-name":"task"})]),o("span",mi,c(r.$t("My tasks")),1)]),_:1}),u.me.logout_url?(t(),a(g,{key:0,class:"fbs-profile-menu-item",onClick:u.logout},{default:n(()=>[o("span",ui,[s(b,{"icon-name":"log-out"})]),o("span",pi,c(r.$t("Log out")),1)]),_:1},8,["onClick"])):l("",!0)]),_:1})]),default:n(()=>[o("button",{type:"button",class:"fbs-profile-menu-trigger","aria-label":r.$t("Profile menu")},[o("span",ii,[o("img",{src:u.me.photo,alt:r.$t("My Profile")},null,8,si),o("span",ai,[s(b,{"icon-name":"arrow-down"})])])],8,ti)]),_:1})):l("",!0)}]]),ThemeMode:ge({name:"ThemeMode",components:{Icons:ve},data:()=>({themeMode:x.getCurrentTheme()}),computed:{resolvedTheme(){return this.themeMode===x.MODE_SYSTEM?x.getSystemTheme():this.themeMode}},mounted(){this.onThemeChanged=()=>{this.themeMode=x.getCurrentTheme()},window.addEventListener(E,this.onThemeChanged)},beforeUnmount(){this.onThemeChanged&&window.removeEventListener(E,this.onThemeChanged)},methods:{selectTheme(e){this.themeMode!==e&&(this.themeMode=e,x.apply(e))}}},[["render",function(i,r,h,f,m,u){const p=e("Icons"),b=se,g=le,_=oe,v=ne;return t(),a(v,{class:"fbs-theme-mode",trigger:"click",onCommand:u.selectTheme,"popper-class":"fbs-theme-mode-popper"},{dropdown:n(()=>[s(_,null,{default:n(()=>[s(g,{command:"light",class:d({"fbs-theme-mode-active":"light"===m.themeMode})},{default:n(()=>[o("span",gi,[s(p,{"icon-name":"sun"})]),o("span",null,c(i.$t("Light")),1),"light"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"]),s(g,{command:"dark",class:d({"fbs-theme-mode-active":"dark"===m.themeMode})},{default:n(()=>[o("span",_i,[s(p,{"icon-name":"moon"})]),o("span",null,c(i.$t("Dark")),1),"dark"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"]),s(g,{command:"system",class:d({"fbs-theme-mode-active":"system"===m.themeMode})},{default:n(()=>[o("span",vi,[s(p,{"icon-name":"system"})]),o("span",null,c(i.$t("System")),1),"system"===m.themeMode?(t(),a(p,{key:0,"icon-name":"check","icon-class":"fbs_ml-auto"})):l("",!0)]),_:1},8,["class"])]),_:1})]),default:n(()=>[s(b,{text:"",size:"small",class:"fbs_topbar_icon_btn only-icon-btn","aria-label":i.$t("Theme mode")},{default:n(()=>[o("span",bi,[s(p,{"icon-name":"theme-mode"})])]),_:1},8,["aria-label"])]),_:1},8,["onCommand"])}]])},data:()=>({onlineStatus:!0,willRender:!0,isFullScreen:!1,isBeta:!1,isActiveWindow:!0,intervalTimer:null,activeWindowHasDataChangeTimeOut:null,hasInitializedConnectionStatus:!1,connectionStatusCheckId:0,isMobileNavigationOpen:!1,mobileNavigationLinkClickHandler:null,mobileNavigationTrigger:null,mobileNavigationFocusFrame:null,mobileNavigationInertElements:[]}),watch:{onlineStatus(e,t){this.hasInitializedConnectionStatus&&e!==t&&(e?this.$notify({title:this.$t("Online"),message:this.$t("You're back online."),type:"success"}):this.$notify({title:this.$t("Offline"),message:this.$t("You are offline. Changes made now will not be saved."),type:"error"}))}},computed:{isSettingsRoute(){var e,t,i,s;return(null==(t=null==(e=this.$route)?void 0:e.matched)?void 0:t.some(e=>"settings"===e.name))||(null==(s=null==(i=this.$route)?void 0:i.path)?void 0:s.startsWith("/settings"))},mobileNavigationLabel(){return this.isMobileNavigationOpen?this.$t("Close Navigation Menu"):this.$t("Open Navigation Menu")}},methods:{goToSettings(){this.isSettingsRoute||this.$router.push({name:"general-settings"})},async checkBackendConnection(){var e,t;const i=null==(t=null==(e=this.appVars)?void 0:e.rest)?void 0:t.url;if(!i)return!1;const s="undefined"!=typeof AbortController?new AbortController:null;let a=null;s&&(a=setTimeout(()=>s.abort(),3e3));try{return(await fetch(i,{method:"HEAD",cache:"no-store",credentials:"same-origin",headers:{"X-Requested-With":"XMLHttpRequest"},signal:s?s.signal:void 0})).ok}catch(n){return!1}finally{a&&clearTimeout(a)}},async updateConnectionStatus(e=null){const t=++this.connectionStatusCheckId;if("offline"===(null==e?void 0:e.type))return void(this.onlineStatus=!1);const i=await this.checkBackendConnection();t===this.connectionStatusCheckId&&(this.onlineStatus=i)},toggleFullScreen(){this.isFullScreen="yes"==this.isFullScreen?"no":"yes",this.Storage.set("full_screen",this.isFullScreen),"yes"===this.isFullScreen?(document.body.classList.add("fbs_full_screen"),document.documentElement.classList.remove("wp-toolbar")):(document.body.classList.remove("fbs_full_screen"),document.documentElement.classList.add("wp-toolbar"))},getMobileNavigationWrapper(){var e;return(null==(e=this.$el)?void 0:e.closest(".warp"))||document.querySelector(".warp.fconnector_app")},setMobileNavigationOpen(e){const t=this.getMobileNavigationWrapper(),i=null==t?void 0:t.querySelector(".fframe_menu_small_screen"),s=null==t?void 0:t.querySelector(".fframe_menu_overlay"),a=Boolean(e),n=this.isMobileNavigationOpen;if(this.isMobileNavigationOpen=a,i&&i.classList.toggle("fframe_menu_small_screen_open",a),s&&s.classList.toggle("active",a),document.body.style.overflow=a?"hidden":"",a&&!n){this.mobileNavigationTrigger=(null==t?void 0:t.querySelector(".fframe_handheld"))||null;const e=null==i?void 0:i.querySelector("[data-fbs-menu-close]");this.mobileNavigationFocusFrame=window.requestAnimationFrame(()=>{this.mobileNavigationFocusFrame=null,this.isMobileNavigationOpen&&(e&&e.focus({preventScroll:!0}),this.setMobileNavigationInert(!0))})}else if(!a&&n){this.cancelMobileNavigationFocusFrame(),this.setMobileNavigationInert(!1);const e=this.mobileNavigationTrigger;this.mobileNavigationTrigger=null,e&&document.contains(e)&&e.focus({preventScroll:!0})}},handleMobileNavigationKeydown(e){var t;if(!this.isMobileNavigationOpen)return;if("Escape"===e.key||"Esc"===e.key)return void this.setMobileNavigationOpen(!1);if("Tab"!==e.key)return;const i=null==(t=this.getMobileNavigationWrapper())?void 0:t.querySelector(".fframe_menu_small_screen");if(!i)return;const s=this.getMobileNavigationFocusable(i);if(!s.length)return void e.preventDefault();const a=s[0],n=s[s.length-1],o=document.activeElement;e.shiftKey?o!==a&&i.contains(o)||(e.preventDefault(),n.focus({preventScroll:!0})):o!==n&&i.contains(o)||(e.preventDefault(),a.focus({preventScroll:!0}))},getMobileNavigationFocusable:e=>Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>e.offsetWidth>0||e.offsetHeight>0||e===document.activeElement),setMobileNavigationInert(e){e?(this.restoreMobileNavigationInert(),this.mobileNavigationInertElements=this.getMobileNavigationInertTargets().map(e=>({el:e,inert:e.inert,ariaHidden:e.getAttribute("aria-hidden")})),this.mobileNavigationInertElements.forEach(({el:e})=>{e.inert=!0,e.setAttribute("aria-hidden","true")})):this.restoreMobileNavigationInert()},restoreMobileNavigationInert(){this.mobileNavigationInertElements.forEach(({el:e,inert:t,ariaHidden:i})=>{document.contains(e)&&(e.inert=t,null===i?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",i))}),this.mobileNavigationInertElements=[]},getMobileNavigationInertTargets(){const e=this.getMobileNavigationWrapper();if(!e)return[];const t=new Set,i=e.querySelector(".fframe_app"),s=e.querySelector(".fframe_menu_small_screen"),a=e.querySelector(".fframe_menu_overlay");i&&Array.from(i.children).forEach(e=>{e!==s&&e!==a&&t.add(e)});let n=e;for(;n&&n!==document.body;){const e=n.parentElement;if(!e)break;Array.from(e.children).forEach(e=>{e===n||["SCRIPT","STYLE"].includes(e.tagName)||t.add(e)}),n=e}return Array.from(t).filter(e=>e!==s&&e!==a&&!(s&&e.contains(s)))},cancelMobileNavigationFocusFrame(){null!==this.mobileNavigationFocusFrame&&(window.cancelAnimationFrame(this.mobileNavigationFocusFrame),this.mobileNavigationFocusFrame=null)},toggleMobileNavigation(){this.setMobileNavigationOpen(!this.isMobileNavigationOpen)},bindMobileNavigationLinks(){const e=this.getMobileNavigationWrapper();e&&(this.mobileNavigationLinkClickHandler=()=>{this.setMobileNavigationOpen(!1)},e.querySelectorAll(".fframe_menu_small_screen .fframe_menu_item a").forEach(e=>{e.addEventListener("click",this.mobileNavigationLinkClickHandler)}),e.querySelectorAll("[data-fbs-menu-overlay], [data-fbs-menu-close]").forEach(e=>{e.addEventListener("click",this.mobileNavigationLinkClickHandler)}))},unbindMobileNavigationLinks(){const e=this.getMobileNavigationWrapper();e&&this.mobileNavigationLinkClickHandler&&(e.querySelectorAll(".fframe_menu_small_screen .fframe_menu_item a").forEach(e=>{e.removeEventListener("click",this.mobileNavigationLinkClickHandler)}),e.querySelectorAll("[data-fbs-menu-overlay], [data-fbs-menu-close]").forEach(e=>{e.removeEventListener("click",this.mobileNavigationLinkClickHandler)}))},handleMobileNavigationResize(){this.isMobileNavigationOpen&&window.innerWidth>1133&&this.setMobileNavigationOpen(!1)},updateViewClass(){const e=document.querySelector(".fluent_boards_frontend"),t=document.getElementById("fluent-boards-app");if(e){const e=document.querySelector(".fframe_main-menu-items"),i=document.querySelector(".fframe_menu_small_screen"),s=t.offsetWidth;s<=530?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_mobile_view"),t.classList.remove("fbs_app_tablet_view","fbs_app_laptop_view")):s<=809?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_tablet_view"),t.classList.remove("fbs_app_mobile_view","fbs_app_laptop_view")):s<=1133?(e.classList.add("fbs_small_screen_menu_items"),i.classList.add("fbs_small_screen_menu_items"),t.classList.add("fbs_app_laptop_view"),t.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view")):(e.classList.remove("fbs_small_screen_menu_items"),i.classList.remove("fbs_small_screen_menu_items"),t.classList.remove("fbs_app_mobile_view","fbs_app_tablet_view","fbs_app_laptop_view"))}},handleWindowVisibilityChange(){"visible"===document.visibilityState?(this.isActiveWindow||(this.eventBus.emit("has-board-data-changed"),this.isActiveWindow=!0),this.activeWindowHasDataChangeTimeOut&&clearTimeout(this.activeWindowHasDataChangeTimeOut)):this.activeWindowHasDataChangeTimeOut=setTimeout(()=>{this.isActiveWindow=!1},3e5)}},async mounted(){jQuery(".notice-warning, .notice-error").remove(),window.addEventListener("online",this.updateConnectionStatus),window.addEventListener("offline",this.updateConnectionStatus),window.addEventListener("resize",this.updateViewClass),window.addEventListener("resize",this.handleMobileNavigationResize),document.addEventListener("keydown",this.handleMobileNavigationKeydown),document.addEventListener("visibilitychange",this.handleWindowVisibilityChange),this.bindMobileNavigationLinks(),await this.updateConnectionStatus({type:"initial"}),this.hasInitializedConnectionStatus=!0,this.intervalTimer=setInterval(()=>{navigator.onLine&&!window.request_is_pending&&this.isActiveWindow&&(this.eventBus.emit("has-board-data-changed"),this.eventBus.emit("fetch-notification-number"))},3e5)},beforeUnmount(){document.removeEventListener("visibilitychange",this.handleWindowVisibilityChange),window.removeEventListener("online",this.updateConnectionStatus),window.removeEventListener("offline",this.updateConnectionStatus),window.removeEventListener("resize",this.updateViewClass),window.removeEventListener("resize",this.handleMobileNavigationResize),document.removeEventListener("keydown",this.handleMobileNavigationKeydown),this.cancelMobileNavigationFocusFrame(),document.body.style.overflow="",this.setMobileNavigationInert(!1),this.unbindMobileNavigationLinks(),this.intervalTimer&&clearInterval(this.intervalTimer)},created(){x.apply(x.getCurrentTheme()),this.isBeta=this.appVars.is_beta,this.isFullScreen=this.Storage.get("full_screen","no"),this.updateViewClass(),"yes"===this.isFullScreen?document.body.classList.add("fbs_full_screen"):document.body.classList.remove("fbs_full_screen")}},[["render",function(r,c,h,f,u,p){const b=fe,g=e("router-view"),_=e("pinned-boards"),v=e("global-search"),y=e("notification"),w=e("Icons"),k=se,C=e("theme-mode"),$=e("profile-menu");return t(),i("div",yi,[u.isBeta?(t(),i("div",wi,[s(b,{type:"warning",center:"",closable:!1,"close-text":!1},{default:n(()=>[...c[1]||(c[1]=[o("p",{style:{"font-size":"16px",color:"black"}},[m(" You are using FluentBoards Beta Version. We just launched special Lifetime Deal for Beta users "),o("a",{class:"el-button fbs-primary-btn",href:"https://fluentboards.com/discount-deal/",rel:"noopener",target:"_blank"},"Get FluentBoards Pro")],-1)])]),_:1})])):l("",!0),s(g),(t(),a(N,{to:"#fluent_app_actions"},[o("div",Ni,[o("div",ki,[s(_),s(v),s(y),r.$isAdmin()?(t(),a(k,{key:0,text:"",size:"small",class:d(["fbs_topbar_icon_btn only-icon-btn",{"fbs_topbar_icon_btn--active":p.isSettingsRoute}]),title:r.$t("Settings"),"aria-label":r.$t("Settings"),onClick:p.goToSettings},{default:n(()=>[o("span",Ci,[s(w,{"icon-name":"gear"})])]),_:1},8,["class","title","aria-label","onClick"])):l("",!0),s(C),s(k,{text:"",size:"small",class:"fbs_topbar_icon_btn fbs_full_screen_btn only-icon-btn",title:r.$t("Toggle Full Screen Mode"),"aria-label":r.$t("Toggle Full Screen Mode"),onClick:p.toggleFullScreen},{default:n(()=>[o("span",$i,[s(w,{"icon-name":"fullscreen"})])]),_:1},8,["title","aria-label","onClick"]),o("button",{type:"button",class:d(["fframe_handheld",{fframe_handheld_open:u.isMobileNavigationOpen}]),"aria-label":p.mobileNavigationLabel,"aria-expanded":u.isMobileNavigationOpen?"true":"false","aria-controls":"fframe_mobile_menu","aria-haspopup":"true",onClick:c[0]||(c[0]=(...e)=>p.toggleMobileNavigation&&p.toggleMobileNavigation(...e))},[s(w,{class:"icon menu-icon","icon-name":"menu"}),s(w,{class:"icon close-icon","icon-name":"close"})],10,Ti),s($)])],512)]))])}]]),Mi=L(),Li=k(Si),Ii=L();Li.config.globalProperties.appVars=window.fluentAddonVars,Li.config.globalProperties.appVars.isFrontView="front"===window.fluentAddonVars.render_in,window.Fuse=C,window.moment=P;const Bi=()=>window.fluentAddonVars&&window.fluentAddonVars.is_rtl?"bottom-left":"bottom-right";Li.mixin({data:()=>({Storage:X,hasPro:!!window.fluentAddonVars.has_pro,isTouchScreen:"ontouchstart"in window||navigator.maxTouchPoints>0}),methods:{$get:G.get,$post:G.post,$put:G.put,$del:G.delete,$uploadFile:G.uploadFile,formatNumber:(e,t=!1)=>!e&&t?"":(e||(e="0"),new Intl.NumberFormat("en-US").format(e)),$changeTitle(e=null){null!=e?jQuery("head title").text(e+" - FluentBoards"):jQuery("head title").text("FluentBoards")},$t:Z,$humanTimeDiff:Q,$handleError:K,handleError:K,convertToText:z,$validateEmail:H,smartDate:j,$smartDate:D,$checkOverdue:W,$formatDate:O,$smartDateRange:R,smartDateWithYear:D,taskGroupingByStages:U,sortTaskByPosition:q,$getPref:(e,t="")=>X.get(e,t),$setPref(e,t){X.set(e,t)},$getUpgradeUrl(e){return Y(this.appVars.upgrade_url,e)},$formatMinutes(e){let t=parseInt(e);if(!t)return"--";const i=Math.floor(t/60);return t%=60,i?t?`${i}h ${t}m`:`${i}h`:`${t}m`},$getTaskUrl:V,$getBoardUrl:F,$isAdmin(){let e=window.fluentAddonVars.me.fluent_boards_role;return"wordpress_admin"===e||"fluent_boards_admin"===e},$isMember:()=>"member"===window.fluentAddonVars.me.fluent_boards_role,$isBoardManager(e){const t=window.fluentAddonVars.me.fluent_boards_capabilities.find(t=>t.board_id==e);return!!t&&"board_admin"===t.role},$canCreateBoard:()=>!!window.fluentAddonVars.me.can_create_board}}),Li.config.globalProperties.$notify=e=>{me({...e,position:Bi(),style:{}})},Li.config.globalProperties.$notify.success=e=>{me({...e,position:Bi(),type:"success",style:{}})},Li.config.globalProperties.$notify.error=e=>{me({...e,position:Bi(),title:Z("Error"),type:"error",style:{}})},Li.config.globalProperties.$notify.warning=e=>{me({...e,position:Bi(),title:Z("Warning"),type:"warning",style:{}})},Li.config.globalProperties.$confirm=ue.confirm,Li.config.globalProperties.emitter=Mi;const Ai=$({routes:te,history:T(),scrollBehavior:ee}),xi=S();xi.use(M),Li.use(Ai),Li.use(pe),Li.use(xi),Li.provide("eventBus",Ii),Li.directive("prevent-context-menu",J);for(const[Ei,Pi]of Object.entries(be))Li.component(Ei,Pi);Li.mount("#fluent-framework-app"),Ai.beforeEach((e,t,i)=>{window.fbsPreviousRoute=t,i()}),Ai.afterEach((e,t)=>{const i=e.meta.active_menu;jQuery(".fframe_menu li").removeClass("active_item"),jQuery(".fframe_menu li.fframe_item_"+i).addClass("active_item"),jQuery(".toplevel_page_fluent_frame li").removeClass("current"),jQuery(".toplevel_page_fluent_frame li.fluent_frame_"+i).addClass("current"),e.meta.title&&jQuery("head title").text(e.meta.title+" - Fluent Boards")});