(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{3091:function(t,e,r){},3302:function(t,e,r){"use strict";r(3091)},3340:function(t,e,r){"use strict";r.r(e);r(76),r(97),r(46),r(13),r(9),r(11),r(15),r(12),r(16),r(56);var n=r(30),a=r(281),i=r(2068),s=(r(73),r(62),r(42),{name:"GroupedAvatars",components:{Thumbnail:r(274).a},props:{users:{type:Array,default:function(){return[]}}}}),l=r(8),o={name:"AvailableAgents",components:{GroupedAvatars:Object(l.a)(s,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex"},t._l(t.users,(function(t,r){return e("span",{key:t.id,class:(r?"-ml-4":"")+" inline-block rounded-full text-white shadow-solid"},[e("thumbnail",{attrs:{size:"36px",username:t.name,src:t.avatar,"has-border":""}})],1)})),0)}),[],!1,null,null,null).exports},props:{agents:{type:Array,default:function(){return[]}}},computed:{users:function(){return this.agents.slice(0,4).map((function(t){return{id:t.id,avatar:t.avatar_url,name:t.name}}))}}},c=Object(l.a)(o,(function(){return(0,this._self._c)("grouped-avatars",{attrs:{users:this.users}})}),[],!1,null,null,null).exports,u=r(351),p=r(1804),d=r(321),f=r(96),v=r(343);function b(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?b(Object(r),!0).forEach((function(e){g(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function g(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var m={name:"TeamAvailability",components:{AvailableAgents:c,FluentIcon:d.a},mixins:[u.a,i.a,p.a],props:{availableAgents:{type:Array,default:function(){}},hasConversation:{type:Boolean,default:!1},unreadCount:{type:Number,default:0}},computed:h(h({},Object(n.mapGetters)({widgetColor:"appConfig/getWidgetColor"})),{},{textColor:function(){return Object(a.f)(this.widgetColor)},isOnline:function(){var t=this.channelConfig.workingHoursEnabled,e=this.availableAgents.length>0;return t?this.isInBetweenTheWorkingHours:e}}),methods:{startConversation:function(){this.$emit("start-conversation"),this.hasConversation||f.a.sendMessage({event:"onEvent",eventIdentifier:v.c,data:{hasConversation:!1}})}}},w=Object(l.a)(m,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"p-4 shadow-sm rounded-md bg-white dark:bg-slate-700"},[e("div",{staticClass:"flex items-center justify-between"},[e("div",{staticClass:""},[e("div",{staticClass:"text-sm font-medium text-slate-700 dark:text-slate-50"},[t._v("\n        "+t._s(t.isOnline?t.$t("TEAM_AVAILABILITY.ONLINE"):t.$t("TEAM_AVAILABILITY.OFFLINE"))+"\n      ")]),t._v(" "),e("div",{staticClass:"text-sm mt-1 text-slate-500 dark:text-slate-100"},[t._v("\n        "+t._s(t.replyWaitMessage)+"\n      ")])]),t._v(" "),t.isOnline?e("available-agents",{attrs:{agents:t.availableAgents}}):t._e()],1),t._v(" "),e("button",{staticClass:"inline-flex text-sm font-medium rounded-md py-1 mt-2 px-2 -ml-2 leading-6 text-slate-800 dark:text-slate-50 justify-between items-center hover:bg-slate-25 dark:hover:bg-slate-800",style:{color:t.widgetColor},on:{click:t.startConversation}},[e("span",{staticClass:"pr-2 text-sm"},[t._v("\n      "+t._s(t.hasConversation?t.$t("CONTINUE_CONVERSATION"):t.$t("START_CONVERSATION"))+"\n    ")]),t._v(" "),e("fluent-icon",{attrs:{icon:"arrow-right",size:"14"}})],1)])}),[],!1,null,null,null).exports,y=(r(3301),{components:{FluentIcon:d.a},props:{link:{type:String,default:""},title:{type:String,default:""}},data:function(){return{}},methods:{onClick:function(){this.$emit("click",this.link)}}}),O={components:{ArticleListItem:Object(l.a)(y,(function(){var t=this,e=t._self._c;return e("li",{staticClass:"py-1 flex items-center justify-between -mx-1 px-1 hover:bg-slate-25 dark:hover:bg-slate-600 rounded cursor-pointer text-slate-700 dark:text-slate-50 dark:hover:text-slate-25 hover:text-slate-900",attrs:{role:"button"},on:{click:t.onClick}},[e("button",{staticClass:"underline-offset-2 text-sm leading-6 text-left"},[t._v("\n    "+t._s(t.title)+"\n  ")]),t._v(" "),e("span",{staticClass:"pl-1 arrow"},[e("fluent-icon",{attrs:{icon:"arrow-right",size:"14"}})],1)])}),[],!1,null,null,null).exports},props:{articles:{type:Array,default:function(){return[]}}},data:function(){return{}},methods:{onClick:function(t){this.$emit("click",t)}}},C=Object(l.a)(O,(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"py-2",attrs:{role:"list"}},t._l(t.articles,(function(r){return e("article-list-item",{key:r.slug,attrs:{link:r.link,title:r.title},on:{click:t.onClick}})})),1)}),[],!1,null,null,null).exports;function A(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var j={components:{FluentIcon:d.a,ArticleList:C},props:{title:{type:String,default:""},articles:{type:Array,default:function(){return[]}}},computed:function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){_(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({},Object(n.mapGetters)({widgetColor:"appConfig/getWidgetColor"})),methods:{onArticleClick:function(t){this.$emit("view",t)}}},k=j,x=(r(3302),{components:{CategoryCard:Object(l.a)(k,(function(){var t=this,e=t._self._c;return e("div",[e("h3",{staticClass:"text-sm font-medium text-slate-800 dark:text-slate-50 mb-0"},[t._v("\n    "+t._s(t.title)+"\n  ")]),t._v(" "),e("article-list",{attrs:{articles:t.articles},on:{click:t.onArticleClick}}),t._v(" "),e("button",{staticClass:"inline-flex text-sm font-medium rounded-md px-2 py-1 -ml-2 leading-6 text-slate-800 dark:text-slate-50 justify-between items-center hover:bg-slate-25 dark:hover:bg-slate-800 see-articles",style:{color:t.widgetColor},on:{click:function(e){return t.$emit("view-all")}}},[e("span",{staticClass:"pr-2 text-sm"},[t._v(t._s(t.$t("PORTAL.VIEW_ALL_ARTICLES")))]),t._v(" "),e("fluent-icon",{attrs:{icon:"arrow-right",size:"14"}})],1)],1)}),[],!1,null,"109d0cc8",null).exports},props:{articles:{type:Array,default:function(){return[]}},categoryPath:{type:String,default:""}},methods:{onArticleClick:function(t){this.$emit("view",t)}}}),P=Object(l.a)(x,(function(){var t=this;return(0,t._self._c)("category-card",{attrs:{title:t.$t("PORTAL.POPULAR_ARTICLES"),articles:t.articles.slice(0,6)},on:{"view-all":function(e){return t.$emit("view-all")},view:t.onArticleClick}})}),[],!1,null,null,null).exports,I=Object(l.a)({},(function(){this._self._c;return this._m(0)}),[function(){var t=this,e=t._self._c;return e("div",{staticClass:"py-4 space-y-4 bg-white dark:bg-slate-700"},[e("div",{staticClass:"space-y-2 animate-pulse"},[e("div",{staticClass:"h-6 bg-slate-100 dark:bg-slate-500 rounded w-2/5"})]),t._v(" "),e("div",{staticClass:"space-y-2 animate-pulse"},[e("div",{staticClass:"h-4 bg-slate-100 dark:bg-slate-500 rounded"}),t._v(" "),e("div",{staticClass:"h-4 bg-slate-100 dark:bg-slate-500 rounded"}),t._v(" "),e("div",{staticClass:"h-4 bg-slate-100 dark:bg-slate-500 rounded"})]),t._v(" "),e("div",{staticClass:"space-y-2 animate-pulse"},[e("div",{staticClass:"h-4 bg-slate-100 dark:bg-slate-500 rounded w-1/5"})])])}],!1,null,null,null).exports,L=r(312),E=r(1787);function S(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?S(Object(r),!0).forEach((function(e){F(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var $={name:"Home",components:{ArticleHero:P,TeamAvailability:w,ArticleCardSkeletonLoader:I},mixins:[u.a,E.a,L.a],props:{hasFetched:{type:Boolean,default:!1},isCampaignViewClicked:{type:Boolean,default:!1}},computed:T(T({},Object(n.mapGetters)({availableAgents:"agent/availableAgents",activeCampaign:"campaign/getActiveCampaign",conversationSize:"conversation/getConversationSize",unreadMessageCount:"conversation/getUnreadMessageCount",popularArticles:"article/popularArticles",articleUiFlags:"article/uiFlags"})),{},{widgetLocale:function(){return this.$i18n.locale||"en"},portal:function(){return window.chatwootWebChannel.portal},showArticles:function(){return this.portal&&!this.articleUiFlags.isFetching&&this.popularArticles.length},defaultLocale:function(){var t=this.widgetLocale,e=this.portal.config,r=e.allowed_locales,n=e.default_locale;return r.includes(t)?t:n}}),mounted:function(){if(this.portal&&0===this.popularArticles.length){var t=this.defaultLocale;this.$store.dispatch("article/fetch",{slug:this.portal.slug,locale:t})}},methods:{startConversation:function(){return this.preChatFormEnabled&&!this.conversationSize?this.replaceRoute("prechat-form"):this.replaceRoute("messages")},openArticleInArticleViewer:function(t){var e="".concat(t,"?show_plain_layout=true");this.prefersDarkMode&&(e="".concat(e,"&theme=dark")),this.$router.push({name:"article-viewer",params:{link:e}})},viewAllArticles:function(){var t=this.defaultLocale,e=window.chatwootWebChannel.portal.slug;this.openArticleInArticleViewer("/hc/".concat(e,"/").concat(t))}}},D=Object(l.a)($,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"z-50 rounded-md w-full flex flex-1 flex-col",class:{"pb-2":t.showArticles,"justify-end":!t.showArticles}},[e("div",{staticClass:"px-4 pt-4 w-full"},[e("team-availability",{attrs:{"available-agents":t.availableAgents,"has-conversation":!!t.conversationSize,"unread-count":t.unreadMessageCount},on:{"start-conversation":t.startConversation}})],1),t._v(" "),t.showArticles?e("div",{staticClass:"px-4 py-2 w-full"},[e("div",{staticClass:"p-4 rounded-md bg-white dark:bg-slate-700 shadow-sm w-full"},[t.articleUiFlags.isFetching||t.articleUiFlags.isError||!t.popularArticles.length?t._e():e("article-hero",{attrs:{articles:t.popularArticles},on:{view:t.openArticleInArticleViewer,"view-all":t.viewAllArticles}})],1)]):t._e(),t._v(" "),t.articleUiFlags.isFetching?e("div",{staticClass:"px-4 py-2 w-full"},[e("div",{staticClass:"p-4 rounded-md bg-white dark:bg-slate-700 shadow-sm w-full"},[e("article-card-skeleton-loader")],1)]):t._e()])}),[],!1,null,null,null);e.default=D.exports}}]);
//# sourceMappingURL=90-0e5844a7002259150cff.chunk.js.map