PageSourceSearch

https://app.helpspace.com/build/assets/index-Ba1aykP2.js

js helpspace.com collected 2026-10-09 23:14:19 UTC 33,492 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/empty-state-BWQhM0zw.js","assets/translation-D__16jkl.js","assets/translation-DGfc5ist.css","assets/_isIterateeCall-D_jJeRnx.js","assets/app-DiJ3gBzv.js","assets/bootstrap-CY0Ip2mn.js","assets/vue-directives-CnKVJup6.js","assets/coupon-B-rA1fk2.js","assets/coupon-BzWZGw92.css","assets/app-DWPPUsYG.css","assets/no-channel-DARNtGHi.js"])))=>i.map(i=>d[i]);
2import{k as E,x,y as ne,z as ae,B as oe,C as le,D as ce,E as de,g as ue,h as he,f as j,G as V,e as K,j as me,l as pe,H as J}from"./app-DiJ3gBzv.js";import{a as g}from"./bootstrap-CY0Ip2mn.js";import{a6 as ge,aJ as fe,aK as ke,aM as ye,g as be,v as Q,R as m,Y as O,z as l,C as y,y as c,U as u,P as T,M as o,N as h,W as $,X as I,B as p,E as f,_ as L,af as G,a3 as _e,D as A,F as H,S as Te,$ as ve,at as xe,a0 as $e,Z as Ie}from"./translation-D__16jkl.js";import{n as we,_ as Se}from"./vue-directives-CnKVJup6.js";import{f as U}from"./coupon-B-rA1fk2.js";function Le(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var Ae=Le,Oe=ge,Ce=we;function De(e,t){return t.length<2?e:Oe(e,Ce(t,0,-1))}var Ne=De,Fe=fe,Me=Ae,qe=Ne,R=ke,Be=Object.prototype,Pe=Be.hasOwnProperty;function je(e,t){t=Fe(t,e);var i=-1,a=t.length;if(!a)return!0;for(;++i<a;){var r=R(t[i]);if(r==="__proto__"&&!Pe.call(e,"__proto__")||(r==="constructor"||r==="prototype")&&i<a-1)return!1}var s=qe(e,t);return s==null||delete s[R(Me(t))]}var Ve=je,Ke=Ve,He=ye,Ue=Array.prototype,Re=Ue.splice;function Ee(e,t){for(var i=e?t.length:0,a=i-1;i--;){var r=t[i];if(i==a||r!==s){var s=r;He(r)?Re.call(e,r,1):Ke(e,r)}}return e}var Je=Ee,Qe=Se,Ge=Je;function We(e,t){var i=[];if(!(e&&e.length))return i;var a=-1,r=[],s=e.length;for(t=Qe(t);++a<s;){var b=e[a];t(b,a,e)&&(i.push(b),r.push(a))}return Ge(e,r),i}var Xe=We;const Ye=be(Xe),Ze={components:{SpmDropdown:E,FvlTagSelect:U},props:{filters:{type:Object,default:()=>({})}},emits:["apply"],data(){return{draft:{},pendingTerms:{},autoApplyTimer:null,fields:[{key:"andTicketIds",label:"Ticket IDs"},{key:"contacts",label:"Contacts",url:"/selectable/email-contacts",searchKeys:["email","name"],optionKey:"email",optionValue:"email"},{key:"status",label:"Status",url:"/selectable/ticket-status"},{key:"orTags",label:"Tags",url:"/selectable/tags/ticket"},{key:"subject",label:"Subject"},{key:"body",label:"Body"},{key:"subjectOrBody",label:"Subject or body"},{key:"assignees",label:"Agents",url:"/selectable/users?canAccess=tickets"},{key:"teams",label:"Teams",url:"/selectable/teams?canAccess=tickets"}]}},computed:{count(){return Object.values(x(this.filters)).reduce((e,t)=>e+t.length,0)}},mounted(){document.addEventListener("click",this.closeInactiveFields,!0)},beforeUnmount(){document.removeEventListener("click",this.closeInactiveFields,!0),this.cancelAutoApply()},methods:{loadInitialOptions(){U.methods.getRemoteOptions.flush()},closeInactiveFields(e){for(const t of this.$refs.filterFields||[])t.$el.contains(e.target)||t.close()},resetDraft(){this.cancelAutoApply(),this.pendingTerms={},this.draft=x(this.filters)},updateDraft(e,t){this.draft[e]=t,delete this.pendingTerms[e],this.scheduleAutoApply()},onFieldInput(e,t){e.url||!t.target||(this.pendingTerms[e.key]=t.target.value,this.scheduleAutoApply())},clearDraft(){this.draft={},this.pendingTerms={},this.scheduleAutoApply()},cancelAutoApply(){clearTimeout(this.autoApplyTimer),this.autoApplyTimer=null},scheduleAutoApply(){this.cancelAutoApply(),this.autoApplyTimer=setTimeout(()=>{this.autoApplyTimer=null,this.apply()},200)},apply(e){this.cancelAutoApply();const t={...this.draft};for(const[a,r]of Object.entries(this.pendingTerms))t[a]=[...t[a]||[],r];const i=x(t);JSON.stringify(i)!==JSON.stringify(x(this.filters))&&this.$emit("apply",i),e&&e()}}},ze=["title","aria-label","aria-expanded"],et=["innerHTML"],tt={key:0,class:"ml-1 min-h-[1.125rem] min-w-[1.125rem] px-1 flex items-center justify-center rounded-full bg-primary-600 text-white text-[0.625rem] font-semibold leading-none tabular-nums"},st={class:"font-semibold text-gray-800 mb-3"},it={class:"max-h-[60vh] overflow-y-auto"},rt=["onInput"],nt={key:0},at={key:1},ot={class:"flex justify-between items-center gap-2 border-t pt-3 mt-3"};function lt(e,t,i,a,r,s){const b=m("fvl-tag-select"),w=m("spm-dropdown");return l(),O(w,{ref:"dropdown",placement:"bottom-start","hide-after-dropdown-click":!1,"trigger-toggles-dropdown":!0,"close-on-esc":!1,"dropdown-class":"!w-[32rem] !max-w-[calc(100vw-2rem)]",onOpen:s.resetDraft,onClose:s.cancelAutoApply},{trigger:y(({isOpen:v})=>[o("button",{type:"button",class:f(["inline-flex items-center shrink-0 h-8 px-2 rounded-lg bg-gray-200 text-gray-800 hover:bg-gray-300",{"ring-2 ring-primary-400 ring-inset":s.count>0}]),title:e.$trans.get("Advanced Search Options"),"aria-label":e.$trans.get("Advanced Search Options"),"aria-expanded":v},[o("span",{innerHTML:e.svg("feather-sliders","stroke-icon h-4 w-4")},null,8,et),s.count?(l(),c("span",tt,h(s.count),1)):u("",!0)],10,ze)]),dropdown:y(({hide:v,isOpen:S})=>[S?(l(),c("div",{key:0,class:"p-4",onClick:t[1]||(t[1]=T(()=>{},["stop"]))},[o("h3",st,h(e.$trans.get("Advanced Search Options")),1),o("div",it,[(l(!0),c($,null,I(r.fields,d=>(l(),c("div",{key:d.key,onInput:k=>s.onFieldInput(d,k)},[p(b,{ref_for:!0,ref:"filterFields","model-value":r.draft[d.key],"onUpdate:modelValue":k=>s.updateDraft(d.key,k),name:"advanced-"+d.key,label:e.$trans.get(d.label),"options-url":d.url,"lazy-load":!1,onVnodeMounted:s.loadInitialOptions,options:[],"search-keys":d.searchKeys||["name"],"option-key":d.optionKey||"id","option-value":d.optionValue||"name","response-data-path":"data","allow-new":!d.url||d.key==="contacts","search-remote":d.key==="contacts","open-on-click":!0,placeholder:e.$trans.get(d.url?"Select...":"Add search term..."),class:"w-full"},{option:y(({option:k})=>[d.key==="contacts"?(l(),c("span",nt,h(k.name)+" — "+h(k.email),1)):(l(),c("span",at,h(k.name),1))]),_:2},1032,["model-value","onUpdate:modelValue","name","label","options-url","onVnodeMounted","search-keys","option-key","option-value","allow-new","search-remote","placeholder"])],40,rt))),128))]),o("div",ot,[o("button",{type:"button",class:"text-sm text-gray-600",onClick:t[0]||(t[0]=(...d)=>s.clearDraft&&s.clearDraft(...d))},h(e.$trans.get("Reset")),1),u("",!0)])])):u("",!0)]),_:1},8,["onOpen","onClose"])}const ct=Q(Ze,[["render",lt]]),dt=G(()=>J(()=>
2import("./empty-state-BWQhM0zw.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),ut=G(()=>J(()=>import("./no-channel-DARNtGHi.js"),__vite__mapDeps([10,1,2]))),ht={provide(){return{ticketList:this}},components:{SpmAdvancedSearch:ct,SpmDropdown:E,SpmDropdownTags:he,SpmTag:ue,SpmInfiniteLoading:de,SpmNavigationTop:ce,SpmSubmenuLeft:le,SpmEmptyState:dt,SpmCheckSubscriptionCouponTrial:oe,SpmCheckSubscriptionConditions:ae,SpmLoader:_e,vuescroll:ne,SpmNoChannel:ut},data(){return{query:"",selectedTagCache:{},tagOptions:[],tagsLoading:!1,tagsLoaded:!1,filter:[],selectedItems:[],menuButtons:[{name:"createticket",text:this.$trans.get("Create Ticket"),disabled:!1,handler:()=>{this.$store.commit("showFormModal",{component:"tickets/modals/_create-ticket.modal.vue"})}}],menu:[{name:this.$trans.get("Inbox"),sortable:!0,items:[{id:"1",name:this.$trans.get("Unassigned"),link:"unassigned",badge:!0,icon:"feather-inbox"},{id:"2",name:this.$trans.get("Mine"),link:"mine",badge:!0,icon:"feather-user"},{id:"3",name:this.$trans.get("Watching"),link:"watching",badge:!0,icon:"feather-eye"},{id:"4",name:this.$trans.get("Assigned"),link:"assigned",badge:!0,icon:"feather-users",items:[]},{id:"5",name:this.$trans.get("All"),link:"all",badge:!0,icon:"feather-inbox"},{id:"6",name:this.$trans.get("Closed"),link:"closed",badge:!1,icon:"feather-lock"},{id:"7",name:this.$trans.get("Spam"),link:"spam",badge:!0,icon:"feather-shield"}]},{name:this.$trans.get("Teams"),sortable:!0,items:[]}]}},computed:{advancedFilters(){return this.$store.getters.searchAdvancedFilters},searchedItems(){return this.$store.getters.ticketListSearchedItems},sectionsCounts(){return this.$store.state.sectionCounts},isEmptyState(){return this.listItems.length===0&&!this.isTicketSearchActive&&!this.$store.getters.nextPageLink},isTicketSearchActive(){return this.$store.getters.isTicketSearchActive},searchTagIds(){return this.$store.getters.searchTagIds},tagsTagFilterDisabled(){return this.tagsLoading||this.tagsLoaded&&!this.tagOptions.length},selectedTags(){return this.searchTagIds.map(e=>this.selectedTagCache[e]||this.tagOptions.find(t=>t.id===e)).filter(Boolean)},searchLabel(){return this.searchQuery?this.searchQuery:this.$trans.get(Object.keys(this.advancedFilters).length?"Advanced Search Options":"selected tags")},section(){return this.$store.getters.section},isLoading(){return this.$store.getters.ticketListSearchIsLoading?this.$store.getters.ticketListSearchIsLoading:this.$store.getters.ticketListIsLoading},items(){return this.$store.getters.ticketList},listItems(){return this.isTicketSearchActive?this.searchedItems:this.items},searchQuery(){return this.$store.getters.searchQuery},currentIndex(){let e=this;return pe(this.listItems,function(t){return t.id==e.$route.params.id})},lastIndex(){return this.listItems.length-1},breadcrumb(){let e=this.$store.getters.sectionsCounts(this.section)>0?this.$store.getters.sectionsCounts(this.section):"",t=[];typeof this.menu[1]<"u"?t=me(this.menu[0].items,this.menu[1].items):t=this.menu[0].items;let i=K(t,["link",this.section]);i=i?i.name+" "+e:"";let a=[];return a.push({name:this.$trans.get("Tickets"),arrow:!0}),a.push({name:i,arrow:!0}),a},unselectNumTickets(){return this.selectedItems.length-50>0?this.selectedItems.length-50:0}},watch:{"$route.query"(e){const t=V(e.advanced),i=String(e.tags||"").split(",").map(Number).filter(r=>Number.isInteger(r)&&r>0),a=typeof e.search=="string"?e.search:"";JSON.stringify(t)===JSON.stringify(this.advancedFilters)&&JSON.stringify(i)===JSON.stringify(this.searchTagIds)&&a===this.query||(this.$store.commit("setSearchAdvancedFilters",t),this.$store.commit("setSearchTagIds",i),this.query=a,this.$store.dispatch("searchTickets",a))},section(e,t){this.isTicketSearchActive&&e!=t&&this.$store.dispatch("searchTickets",this.query).then(i=>{})},query(e){this.$store.dispatch("searchTicketsDebounced",e)},currentIndex(e,t){this.$nextTick(()=>{this.scrollToTicket(this.$route.params.id,!1)})},isLoading(e){e==!1&&this.$nextTick(()=>{this.scrollToTicket(this.$route.params.id,!1)})}},created(){this.$store.commit("setSearchAdvancedFilters",V(this.$route.query.advanced)),this.$store.commit("setSearchTagIds",String(this.$route.query.tags||"").split(",").map(Number).filter(t=>Number.isInteger(t)&&t>0)),(Object.keys(this.advancedFilters).length||this.searchTagIds.length)&&this.$store.dispatch("searchTickets",this.$route.query.search||""),this.loadTags(),this.$route.query.search&&(this.query=this.$route.query.search);let e=this;this.$userHasRole(["superadmin","admin"])&&e.menu[0].items.push({id:"8",name:this.$trans.get("Trash"),link:"trash",badge:!0,icon:"feather-trash-2"}),this.menu[0].items=this.$filters.mapOrder(this.menu[0].items,JSON.parse(localStorage.getItem("SubmenuOrderTicketsInbox"))??[],"id"),this.$store.getters.user&&this.$store.getters.user.teams&&this.$store.getters.user.teams.length&&(this.$store.getters.user.teams.forEac
2h(function(t){e.menu[1].items.push({id:"team"+t.id,name:t.name,link:t.name.toLowerCase(),badge:!0})}),this.menu[1].items=this.$filters.mapOrder(this.menu[1].items,JSON.parse(localStorage.getItem("SubmenuOrderTicketsTeams"))??[],"id")),g.get("/selectable/users?canAccess=tickets").then(t=>{t.data.data.forEach(function(i){K(e.menu[0].items,["link","assigned"]).items.push({id:"assigned-"+i.id,name:i.name,link:"assigned-"+i.id,linkParams:{id:0,user:i.id},hidden:!1,badge:!0})})}),this.$store.commit("setRouter",this.$router),this.$store.dispatch("updateSectionsCounts"),this.$route.params.section?(this.$store.dispatch("getTicket",{id:this.$route.params.id,fetch:!0}),this.$store.dispatch("getTicketList",{section:this.$route.params.section,id:this.$route.params.id})):this.$store.getters.getRouter.push({name:"tickets-section",params:{section:"mine"}})},unmounted(){this.$bus.off("print.ticket")},mounted(){this.$bus.on("print.ticket",()=>this.printTicket()),this.mountKeydownListener(),window.Echo.private(this.$store.getters.user.workspace+".ticket").listen("NewTicketMessageCreated",e=>{this.$store.dispatch("fetchTicketAndPushToTicketList",e.ticket.id),this.$store.dispatch("updateSectionsCountsOnly"),this.$store.dispatch("reloadTicketListIfPageOne")}).listen("NewTicketCreated",e=>{this.$store.dispatch("fetchTicketAndPushToTicketList",e.ticket.id),this.$store.dispatch("updateSectionsCountsOnly"),this.$store.dispatch("reloadTicketListIfPageOne")})},beforeUnmount(){this.$store.commit("setSearchQuery",""),this.$store.commit("setTicketListSearchedItems",[]),this.unMountKeydownListener()},methods:{applyAdvancedFilters(e){this.$store.commit("setSearchAdvancedFilters",e),this.$store.dispatch("searchTickets",this.query)},openTicket(e){this.selectedItems=[],this.goto(e)},tagLabel(e){var i;const t=e==null?void 0:e.name;if(typeof t=="string")return t;if(t&&typeof t=="object"){const a=typeof((i=this.$i18n)==null?void 0:i.locale)=="string"?this.$i18n.locale.split("-")[0]:"";return t[a]||t.en||Object.values(t).find(Boolean)||""}return String((e==null?void 0:e.slug)||(e==null?void 0:e.id)||"")},displayTagBody(e){return{id:e.id,color:e.color||"#848484",name:this.tagLabel(e)}},loadTags(){this.tagsLoading=!0,g.get("/selectable/tags/ticket").then(e=>{var t;this.tagOptions=((t=e.data)==null?void 0:t.data)??[]}).catch(()=>{this.tagOptions=[]}).finally(()=>{this.tagsLoading=!1,this.tagsLoaded=!0})},onFilterTagsUpdated(e){const t=Array.isArray(e)?e.slice():[];t.forEach(i=>{const a=this.tagOptions.find(r=>r.id===i);a&&(this.selectedTagCache[i]=a)}),this.$store.commit("setSearchTagIds",t),this.$store.dispatch("searchTickets",this.query)},clearTagFilters(){this.selectedTagCache={},this.$store.commit("setSearchTagIds",[]),this.$store.dispatch("searchTickets",this.query)},clearQuery(){this.query="",this.$store.dispatch("searchTickets","")},selectItem(e){this.selectedItems.length||this.selectedItems.push(parseInt(this.$route.params.id)),this.selectedItems.indexOf(e)===-1?this.selectedItems.push(e):this.selectedItems=Ye(this.selectedItems,t=>t!==e)},selectItemsBetween(e){let t=e<this.currentIndex?e:this.currentIndex,i=e<this.currentIndex?this.currentIndex:e,a=this.listItems.slice(t,i+1);this.selectedItems=j(a,"id")},selectAllItems(){this.selectedItems=j(this.listItems,"id")},elementInTicketListVisible(e){var t=e.getBoundingClientRect(),i=t.top,a=t.bottom,r=i>=100&&a<=window.innerHeight+50;return r},goto:L(function(e){this.$store.getters.getRouter.push({name:"tickets-section",params:{section:this.section,id:e},query:this.$route.query}),this.$store.commit("showView")},0),gotoSection:L(function(e){let t=typeof e=="object"?e.link:e;this.$store.getters.getRouter.push({name:"tickets-section",params:{section:t,id:0},query:this.$route.query}),this.$store.dispatch("updateSectionsCounts"),setTimeout(()=>{this.selectedItems=[]},500)},0),scrollToTicket:L(function(e,t){if(typeof this.$refs["ticket"+e]<"u"&&typeof this.$refs["ticket"+e][0]<"u"){if(this.elementInTicketListVisible(this.$refs["ticket"+this.$route.params.id][0])&&!t)return;this.$refs.scrollbarTicketList.scrollIntoView("#spm-ticket-list-item-"+e,300)}},300),getNextIndexIfSelection(e){if(this.selectedItems.length<=0)return-1;const t=this.selectedItems,i=this.listItems.map(function(s,b){if(t.includes(s.id
2))return b}).filter(s=>typeof s<"u"),a={first:i[0],last:i[i.length-1]},r={next:a.last+1<this.listItems.length?a.last+1:-1,prev:a.first-1>=0?a.first-1:-1};switch(e){case"next":return r.next;case"prev":return r.prev;case"prevOrNext":return r.prev>=0?r.prev:r.next>=0?r.next:-1;default:return r.next>=0?r.next:r.prev>=0?r.prev:-1}},gotoNextAndDeleteOneFromTicketList(e,t){this.gotoNext(!0),setTimeout(()=>{this.$store.commit("deleteTicketFromTicketList",{ticket_id:e,section:t})},150)},gotoNextAndDeleteAllFromTicketList(e,t){this.gotoNext(!0),setTimeout(()=>{this.$store.dispatch("deleteTicketsFromTicketList",{ids:e,section:t})},150)},gotoNext(e){if(this.selectedItems.length>=0){const i=this.getNextIndexIfSelection();if(i>=0&&typeof this.listItems[i]<"u"){this.selectedItems=[],this.goto(this.listItems[i].id);return}}if(e=typeof e<"u"&&e===!0,e&&this.currentIndex==this.lastIndex){this.gotoPrevious();return}const t=this.currentIndex<this.lastIndex?this.currentIndex+1:this.lastIndex;typeof this.listItems[t]<"u"&&(this.selectedItems=[],this.goto(this.listItems[t].id))},gotoPrevious(){if(this.selectedItems.length>=0){const t=this.getNextIndexIfSelection("prevOrNext");if(t>=0&&typeof this.listItems[t]<"u"){this.selectedItems=[],this.goto(this.listItems[t].id);return}}const e=this.currentIndex>1?this.currentIndex-1:0;typeof this.listItems[e]<"u"&&this.goto(this.listItems[e].id)},goToTicketListPage(e){e&&(this.$router.push({name:"tickets-section",params:{section:this.$store.getters.section,id:this.$store.getters.ticketId},query:{page:e}}),this.$store.dispatch("fetchTicketList",{section:this.$store.getters.section,id:this.$store.getters.ticketId}))},canAddSidebarKeys(){if(this.$store.getters.dialogModal.show||this.$store.getters.ticketList.length<=0||this.$store.getters.searchedWithoutResults)return!1;let e=document.getElementById("spm-ticket-list");if(e==null||document.activeElement.id==="spm-ticket-list-search-bar")return!1;if(document.activeElement.classList.contains("spm-ticket-list-add-keylistener")||document.body==document.activeElement||e instanceof Object&&e.contains(document.activeElement))return!0;let t=document.getElementById("spm-nav-left");if(t instanceof Object&&t.contains(document.activeElement))return!0;let i=document.getElementById("spm-sidebar");return!!(i instanceof Object&&i.contains(document.activeElement))},deleteTicket(e){e&&this.confirmTicketDeletion([e],()=>this.performTicketDeletion(e))},confirmTicketDeletion(e,t){if(!this.$store.getters.dialogModal.show){if(this.$store.getters.user.settings.ticket.confirm_before_delete===!1){t();return}this.$store.commit("showDialogModal",{component:"tickets/modals/_confirm-delete.modal",params:{count:e.length,onConfirm:t},buttons:[],closeOnEsc:!1})}},performTicketDeletion(e){this.gotoNextAndDeleteOneFromTicketList(e,this.$store.getters.section),g.delete("/tickets/"+e).then(t=>{this.$store.dispatch("cacheTicket",t.data.data),this.$store.dispatch("updateSectionsCountsOnly")})},restoreTicket(e){e&&(this.gotoNextAndDeleteOneFromTicketList(e,this.$store.getters.section),g.patch(`/tickets/${e}/restore`).then(t=>{this.$store.dispatch("cacheTicket",t.data.data),this.$store.dispatch("updateSectionsCountsOnly")}))},toggleDisplayTagsInTicketList(){g.patch("/auth/user/",{toggleDisplayTagsInTicketList:!0}).then(e=>{this.$store.commit("setUserData",e.data.data),this.$store.dispatch("reloadTicketListIfPageOne")})},destroyTicket(e){e&&(this.gotoNextAndDeleteOneFromTicketList(e,this.$store.getters.section),g.delete(`/tickets/${e}/force-destroy`).then(()=>{}).catch(t=>{this.$notify.error(t.message?t.message:this.$trans.get("Could not delete ticket."))}).finally(()=>{this.$store.dispatch("updateSectionsCountsOnly")}))},bulkDeleteTickets(e){if(!e.length)return this.$notify.error(this.$trans.get("Nothing selected."));const t=[...e];this.confirmTicketDeletion(t,()=>this.performBulkTicketDeletion(t))},performBulkTicketDeletion(e){this.gotoNextAndDeleteAllFromTicketList(e,this.$store.getters.section),g.post("/tickets/bulk/delete",{ids:e}).then(()=>{}).catch(t=>{this.$notify.error(t.message?t.message:this.$trans.get("Could not delete tickets."))}).finally(()=>{this.$store.dispatch("updateSectionsCountsOnly")})}
2,bulkRestoreTickets(e){if(!e.length)return this.$notify.error(this.$trans.get("Nothing selected."));this.gotoNextAndDeleteAllFromTicketList(e,this.$store.getters.section),g.post("/tickets/bulk/restore",{ids:e}).then(()=>{}).catch(t=>{this.$notify.error(t.message?t.message:this.$trans.get("Could not restore tickets."))}).finally(()=>{this.$store.dispatch("updateSectionsCountsOnly")})},bulkForceDestroyTickets(e){e.length&&(this.gotoNextAndDeleteAllFromTicketList(e,this.$store.getters.section),g.post("/tickets/bulk/force-destroy",{ids:e}).then(()=>{}).finally(()=>{this.$store.dispatch("updateSectionsCountsOnly")}))},generateTldrSummary(e){e&&g.patch(`/tickets/${e}/generate-tldr`).then(()=>{}).finally(()=>{})},addKeyCombinationsToSidebar(e){if(this.canAddSidebarKeys()){if(["ArrowUp","ArrowLeft"].includes(e.key)){this.gotoPrevious(),e.stopPropagation(),e.preventDefault();return}if(["ArrowDown","ArrowRight"].includes(e.key)){this.gotoNext(),e.stopPropagation(),e.preventDefault();return}if(e.metaKey&&e.key==="a"&&!e.ctrlKey||e.ctrlKey&&e.key==="a"&&!e.ctrlKey){this.selectAllItems(),e.stopPropagation(),e.preventDefault();return}if(e.metaKey&&e.key==="p"||e.ctrlKey&&e.key==="p"){e.stopPropagation(),e.preventDefault(),this.$bus.emit("print.ticket");return}(e.metaKey&&e.key==="Backspace"||e.ctrlKey&&e.key==="Backspace"||e.key==="Delete")&&(this.selectedItems.length?this.bulkDeleteTickets(this.selectedItems):this.deleteTicket(this.$route.params.id))}},mountKeydownListener(){window.document.addEventListener("keydown",this.addKeyCombinationsToSidebar,!1)},unMountKeydownListener(){window.document.removeEventListener("keydown",this.addKeyCombinationsToSidebar,!1)},printTicket(){var e=document.getElementById("spm-ticket-stream-print").outerHTML,t=document.getElementById("spm-side-info-first").outerHTML,i=window.open("",`Ticket #${this.$store.getters.ticketId}</title>`);i.document.write(`<html><head><title>Ticket #${this.$store.getters.ticketId}</title>`),Array.from(document.getElementsByTagName("link")).forEach(a=>{a.getAttribute("rel")=="stylesheet"&&i.document.write(a.outerHTML)}),i.document.write("</head><body>"),i.document.write("<style> * {font-size:90%} #spm-ticket-stream-print { padding:1.6em} #spm-side-info-first {margin:2.2em; padding-top:0} .spm-dropdown.trigger, .spm-avatar-uploader-wrapper-overlay, #spm-side-info-first > .flex.items-stretch.w-full.h-13 {display:none;} #spm-ticket-subject {font-size:100%} .spm-relative-date {display:none;} .spm-absolute-date {display:inline;}</style>"),i.document.write(t),i.document.write(e),i.document.write("</body></html>"),i.document.close(),i.onload=function(){i.focus(),i.print(),i.onafterprint=function(){i.close()}}},ticketListLoadMoreItems(e){this.isTicketSearchActive?this.$store.dispatch("appendTicketListSearchedItems",{section:this.$store.getters.section,query:this.searchQuery}):this.$store.dispatch("appendTicketList",{section:this.$store.getters.section})}}},mt={class:"flex"},pt={class:"flex-grow h-screen"},gt={class:"flex h-full"},ft={class:"flex flex-strech w-full pr-2 pl-2 md:pr-1"},kt={class:"flex flex-col flex-grow self-center text-gray-700 py-2 px-2 box-style gap-2"},yt={class:"flex items-stretch gap-1 w-full"},bt={class:"relative inline-flex flex-1 min-w-0 bg-gray-200 rounded-lg input-wrapper"},_t=["placeholder"],Tt=["innerHTML"],vt=["disabled","title","aria-label"],xt=["innerHTML"],$t={key:0,class:"ml-1 min-h-[1.125rem] min-w-[1.125rem] px-1 flex items-center justify-center rounded-full bg-primary-600 text-white text-[0.625rem] font-semibold leading-none tabular-nums"},It={class:"flex w-5 items-center"},wt=["innerHTML"],St={ref:"options",class:"spm-list"},Lt={key:0,class:"flex flex-wrap items-center gap-x-2 gap-y-1"},At={key:0,class:"w-full text-center pr-1 pl-2 text-xs font-medium"},Ot={class:"inline-block bg-red-200 text-red-600 rounded-lg p-1 px-2 mt-2"},Ct={class:"relative h-full pt-2 pb-13"},Dt={key:0,class:"absolute w-full text-gray-800 text-xs font-medium text-center ml-3 mr-2 mb-2 truncate"},Nt={key:1,class:"p-4 w-full text-center font-semibold text-sm text-gray-700"},Ft={class:"leading-loose p-4 pt-2 box-style rounded-lg mt-4 text-left font-normal text-gray-800"},Mt={class:"text-gray-700 border-b font-bold border-gray-500 pb-2 mb-2"},qt={key:2,class:"p-4 w-full text-center font-semibold text-sm text-gray-600"},Bt={key:3,class:"h-full w-full focus:outline-none",tabindex:"0"}
2,Pt=["id","onClick"],jt={class:"spm-ticket-list-subject flex text-gray-700 px-4 pt-3"},Vt={class:"flex p-2 pb-1 text-right items-center"},Kt={class:"spm-ticket-list-name truncate flex flex-grow text-sm text-gray-600 px-6 pb-1 items-center"},Ht=["innerHTML"],Ut=["textContent"],Rt=["innerHTML"],Et={key:2,class:"flex-shrink truncate"},Jt={class:"flex text-gray-600 px-4 pb-1"},Qt={key:0,class:"absolute -mt-1 -ml-7 rounded-lg h-[1.35rem] w-[1.35rem]"},Gt=["src"],Wt=["textContent"],Xt=["title"],Yt={key:0,class:"spm-ticket-list-item-tags text-left content-center items-center pl-6 pr-2 mt-px mb-px"};function Zt(e,t,i,a,r,s){var C;const b=m("spm-submenu-left"),w=m("portal"),v=m("spm-navigation-top"),S=m("spm-empty-state"),d=m("spm-no-channel"),k=m("spm-dropdown-tags"),W=m("spm-advanced-search"),X=m("spm-dropdown"),Y=m("spm-tag"),Z=m("spm-loader"),z=m("spm-infinite-loading"),ee=m("vuescroll"),te=m("router-view"),se=m("spm-check-subscription-coupon-trial"),ie=m("spm-check-subscription-conditions");return l(),c("div",mt,[p(w,{to:"submenuleft"},{default:y(()=>[p(b,{name:e.$trans.get("Tickets"),menu:r.menu,route:e.$route,dimmed:"","sub-items-toggle":"",buttons:e.$store.getters.channels.length?r.menuButtons:null,onGoto:s.gotoSection},null,8,["name","menu","route","buttons","onGoto"])],void 0,!0),_:1}),o("div",pt,[p(v,{breadcrumb:s.breadcrumb},null,8,["breadcrumb"]),A(p(S,{"is-loading":s.isLoading,section:s.section,onGoto:s.gotoSection},null,8,["is-loading","section","onGoto"]),[[H,s.isEmptyState&&e.$store.getters.channels.length]]),!s.isLoading&&!e.$store.getters.channels.length?(l(),O(d,{key:0})):u("",!0),A(o("div",gt,[o("div",{id:"spm-ticket-list",class:f(["flex-wrap flex-shrink-0 h-full w-screen my-0 md:w-70 xl:w-80 4xl:w-[24rem] pb-12 md:block",{hidden:!e.$store.getters.listIsVisible}])},[o("div",ft,[o("div",kt,[o("div",yt,[o("div",bt,[A(o("input",{id:"spm-ticket-list-search-bar","onUpdate:modelValue":t[0]||(t[0]=n=>r.query=n),class:f(["flex-grow w-full bg-gray-200 h-8 text-sm px-3 rounded-lg",{"pr-8":r.query.length>0}]),type:"text",placeholder:e.$trans.get("Search in :section",{section:e.$trans.get(s.section)})},null,10,_t),[[Te,r.query]]),r.query.length>0?(l(),c("div",{key:0,class:"absolute bg-primary-600 text-white rounded-lg p-1 px-1 text-sm right-0 mt-1 mr-1 cursor-pointer",onClick:t[1]||(t[1]=(...n)=>s.clearQuery&&s.clearQuery(...n)),innerHTML:e.svg("feather-x","stroke-icon h-4")},null,8,Tt)):u("",!0)]),p(k,{"options-url":"/selectable/tags/ticket",tags:s.selectedTags,disabled:s.tagsTagFilterDisabled,placement:"bottom-start",small:!0,"dropdown-class":"min-w-[16rem]",onUpdated:s.onFilterTagsUpdated},{default:y(()=>[o("button",{type:"button",class:f(["inline-flex items-center shrink-0 h-8 px-2 rounded-lg bg-gray-200 text-gray-800 hover:bg-gray-300 border border-transparent transition",{"ring-2 ring-primary-400 ring-inset border-primary-200":s.searchTagIds.length>0}]),disabled:s.tagsTagFilterDisabled,title:e.$trans.get("Filter by tags"),"aria-label":e.$trans.get("Filter by tags")},[o("span",{class:"flex items-center shrink-0",innerHTML:e.svg("feather-tag","stroke-icon h-4 w-4")},null,8,xt),s.searchTagIds.length>0?(l(),c("span",$t,h(s.searchTagIds.length),1)):u("",!0)],10,vt)],void 0,!0),_:1},8,["tags","disabled","onUpdated"]),["jak","std","Support"].includes((C=e.$store.getters.user)==null?void 0:C.workspace_name)?(l(),O(W,{key:0,filters:s.advancedFilters,onApply:s.applyAdvancedFilters},null,8,["filters","onApply"])):u("",!0),o("div",It,[p(X,{small:!0,"hide-after-dropdown-click":"","dropdown-class":"max-w-8",placement:"bottom-end"},{trigger:y(()=>[o("span",{class:"flex-shrink-0 hover:text-gray-700 text-gray-600 cursor-pointer rounded items-center",innerHTML:e.svg("feather-more-vertical","stroke-icon h-4")},null,8,wt)]),dropdown:y(()=>[o("ul",St,[e.$store.getters.user.settings.ticket.listview.display.tags?(l(),c("li",{key:0,onClick:t[2]||(t[2]=n=>s.toggleDisplayTagsInTicketList())},h(e.$trans.get("Hide Tags")),1)):(l(),c("li",{key:1,onClick:t[3]||(t[3]=n=>s.toggleDisplayTagsInTicketList())},h(e.$trans.get("Display Tags")),1))],512)]),_:1})])]),s.selectedTags.length>0?(l(),c("div",Lt,[(l(!0),c($,null,I(s.selectedTags,n=>(l(),c("div",{key:"chip-"+n.id,class:"inline-flex max-w-full items-center gap-1"},[p(Y,{tag:s.displayTagBody(n),class:"mr-0 mb-0"},null,8,["tag"])]))),128)),o("button",{type:"button",class:"text-xs font-medium text-primary-700 hover:text-primary-900 py-1",onClick:t[4]||(t[4]=(...n)=>s.clearTagFilters&&s.clearTagFilters(...n))},h(e.$trans.get("Clear tag filters")),1)])):u("",!0)])]),s.unselectNumTickets?(l(),c("div",At,[o("span",Ot,h(e.$trans.get("Please unselect :num ticket(s) for bulk action",{num:s.unselectNumTickets})),1)])):u("",!0),o("div",Ct,[!s.isLoading&&s.isTicketSearchActive&&s.listItems.length?(l(),c("div",Dt,h(e.$trans.get(":num item(s) found for “:value”",{num:e.$store.getters.ticketListMeta.total?e.$store.getters.ticketListMeta.total:0,value:s.searchLabel})),1)):u("",!0),!s.isLoading&&!s.listItems.length&&s.isTicketSearchActive?(l(),c("div",Nt,[ve(h(e.$trans.get("No search result for “:value”",{value:s.searchLabel}))+" ",1),o("ul",Ft,[o("h4",Mt,h(e.$trans.get("Advanced Search Options")),1),t[5]||(t[5]=xe("
2<li><b>#</b>54</li><li><b>subject:</b>bug</li><li><b>body:</b>&quot;important note&quot;</li><li><b>subjectOrBody:</b>&quot;some term&quot;</li><li><b>contact:</b>&quot;Mike&quot;</li><li><b>tag:</b>bug</li><li><b>agent:</b>mike</li><li><b>team:</b>sales</li><li><b>status:</b>waiting</li>",9))])])):u("",!0),s.isLoading&&s.isTicketSearchActive?(l(),c("div",qt,[p(Z,{"show-instant":""})])):u("",!0),!s.isLoading&&s.listItems.length?(l(),c("div",Bt,[p(ee,{ref:"scrollbarTicketList"},{default:y(()=>[p($e,{id:"ticketlist",ref:"ticketlist",tag:"div",name:"list",class:f(["relative min-h-full pr-2 pl-2 md:pr-1",{"pt-5":!s.isLoading&&s.isTicketSearchActive&&s.listItems.length}])},{default:y(()=>[(l(!0),c($,null,I(s.listItems,(n,re)=>{var D,N,F,M,q,B,P;return l(),c("div",{id:"spm-ticket-list-item-"+n.id,ref_for:!0,ref:"ticket"+n.id,key:n.id,class:f([{active:(e.$route.params.id==n.id||!e.$route.params.id&&n.id==e.$store.getters.ticketId)&&!r.selectedItems.length||r.selectedItems.indexOf(n.id)!=-1,"opacity-50":n.status=="waiting"},"spm-ticket-list-item select-none pb-4"]),onClick:[T(_=>s.openTicket(n.id),["exact","prevent"]),T(_=>s.selectItem(n.id),["meta","prevent","stop","exact"]),T(_=>s.selectItem(n.id),["ctrl","prevent","stop","exact"]),T(_=>s.selectItemsBetween(re),["shift","prevent","stop","exact"])]},[o("div",jt,[o("div",{class:f(["flex-grow p-2 font-medium pb-1 text-sm truncate whitespace-nowrap",(D=n.latest_message)!=null&&D.from&&n.latest_message.from.is_customer?"font-bold":""])},h(n.subject),3),o("div",Vt,[o("span",{class:f(["priority ring-2 ring-white inline-block rounded-full","status-bg-"+n.status])},null,2)])]),o("div",Kt,[((N=n.contact)==null?void 0:N.type)==="instagram"?(l(),c("span",{key:0,innerHTML:e.svg("feather-instagram","stroke-icon h-4 w-4 pr-1 self-center")},null,8,Ht)):u("",!0),o("div",{class:"flex-shrink truncate",textContent:h(n.contact?n.contact.name:e.$trans.get("No Contact"))},null,8,Ut),n.assignee&&s.section!="mine"?(l(),c("div",{key:1,class:"flex flex-shrink truncate items-center opacity-75",innerHTML:e.svg("feather-arrow-exchange","stroke-icon h-[0.6rem]")},null,8,Rt)):u("",!0),n.assignee&&s.section!="mine"?(l(),c("div",Et,h(n.assignee.name),1)):u("",!0)]),o("div",Jt,[o("div",{class:f(["spm-ticket-list-message flex-grow px-2 py-1 ml-2 bg-gray-200 text-gray-700 text-xs rounded-lg truncate whitespace-nowrap",{"pl-7":(M=(F=n.latest_message)==null?void 0:F.from)==null?void 0:M.avatar}])},[(q=n.latest_message)!=null&&q.from?(l(),c("span",Qt,[(P=(B=n.latest_message)==null?void 0:B.from)!=null&&P.avatar?(l(),c("img",{key:0,src:n.latest_message.from.avatar,class:"avatar rounded-lg h-[1.35rem] w-[1.35rem]"},null,8,Gt)):u("",!0)])):u("",!0),n.latest_message!=null?(l(),c("i",{key:1,textContent:h(n.latest_message.excerpt)},null,8,Wt)):u("",!0)],2),o("div",{class:"flex px-2 py-1 text-xs whitespace-nowrap text-right items-center",title:e.$filters.datetime(n.last_contact)},h(e.$filters.distanceInWordsToNow(n.last_contact)),9,Xt)]),n!=null&&n.tags&&e.$store.getters.user.settings.ticket.listview.display.tags?(l(),c("div",Yt,[(l(!0),c($,null,I(n.tags,_=>(l(),c("div",{key:_.id,class:"spm-ticket-list-item-tag inline-block align-middle content-center items-center mr-[0.30rem] text-[0.7rem] rounded-md font-medium bg-gray-150 px-2 py-1 my-[0.15rem]"},[o("span",{class:"align-middle w-[.40rem] h-[.40rem] ring-white inline-block rounded-full mr-[0.2rem] mb-[0.2rem]",style:Ie("background-color:"+_.color+";")},null,4),o("span",{class:f(["text-gray-650",{"text-white":(e.$route.params.id==n.id||!e.$route.params.id&&n.id==e.$store.getters.ticketId)&&!r.selectedItems.length||r.selectedItems.indexOf(n.id)!=-1}])},h(_.name),3)]))),128))])):u("",!0)],10,Pt)}),128))],void 0,!0),_:1},8,["class"]),p(z,{"is-loading":s.isLoading,meta:e.$store.getters.ticketListMeta,onOnShow:s.ticketListLoadMoreItems},null,8,["is-loading","meta","onOnShow"]),t[6]||(t[6]=o("div",{class:"h-20"},null,-1))],void 0,!0),_:1},512)])):u("",!0)])],2),p(te)],512),[[H,!s.isEmptyState]])]),p(se),p(ie)])}const rs=Q(ht,[["render",Zt]]);export{rs as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.