1import{an as L,b6 as N,l as U,p as M,aF as W,o as m,c as F,a as S,w as g,b as r,T as H,t as b,aG as z,k as G,ax as o,R as O,m as h,q as _,d as y,ag as I,v as R,al as J,cT as X,f as Z,g as ee,bn as te,V as oe}from"./index-CgxcxX9c.js";import{_ as re}from"./ManageLayout-BNl7P0d-.js";import{_ as ae}from"./CustomTableControls-ZVNMatYV.js";import{_ as j}from"./SearchMiniIcon-DVnTahDt.js";import{_ as q}from"./ConfirmDialog-CCScX4Cr.js";import{_ as se}from"./CreateTrafficSourceDialog-CmBPrJVJ.js";import{u as B}from"./trafficSourcesStore-CFhZuIbu.js";import{F as ne}from"./filterKeys-mnbXh9WL.js";import{_ as ie}from"./CustomDataTable-DkPon6Ol.js";import{_ as ce}from"./DetailAction-IUUoSxcY.js";import"./ArrowSelect-D87KNEp8.js";import"./FormSelect-BRaLJRDD.js";import"./CrossIcon-Cfm-FAfX.js";import"./PlusIcon-CN2GTR9T.js";import"./ArrowInputIconBottom-D50zN8Wy.js";import"./PencilIcon-BY8nXHAT.js";import"./EyeIcon24x24-ySDM4T1Q.js";const le={class:"pt-4 pb-2"},ue={__name:"TrafficSourcesTableControls",setup($){const i=[ne.event],t=B(),u=L(),a=N(),f=U(),v=M(),d=h(!1),p=h(!1),D=_(()=>u.permissions.trafficSources.edit),P=_(()=>u.permissions.trafficSources.delete),T=_(()=>a.getTable(o.trafficSource));function w(){d.value=!0}function k(){p.value=!0}async function A(){await t.goToDeleteTrafficSource(t.selected.map(e=>e.slug))&&(p.value=!1)}function x(c,e){switch(e){case"deleteAll":a.removeAllSorting(o.trafficSource),a.sendFiltersSorting(o.trafficSource),t.changePage(1);break;case"delete":a.changeSelectedSortingAfterDelete(c,o.trafficSource),a.sendFiltersSorting(o.trafficSource),t.changePage(1);break;case"update":a.sendFiltersSorting(o.trafficSource),t.changePage(1);break;default:a.changeSelectedSortingAfterAdd(c,o.trafficSource),a.sendFiltersSorting(o.trafficSource),t.changePage(1)}}function E(){a.resetSortFilter(o.trafficSource),t.changePage(1)}function C(c){a.updateSelectedFilters(c,o.trafficSource),t.changePage(1)}function V({slug:c}){v.push({name:O.detailTrafficSource,params:{workspace:f.params.workspace,slug:c}})}return(c,e)=>{const s=W("tippy");return m(),F("div",le,[S(ae,{showMultipleActions:!!r(t).selected.length,headerType:r(o).trafficSource,keysForFilterListEmpty:i,controlsParams:r(a).controlParams(r(o).trafficSource),selectedSorting:T.value.selectedSorting,selectedFilters:T.value.selectedFilters,searchValue:r(t).search,onPage:r(t).onPage,showButton:D.value,onPageConfig:{max:100,min:10,height:"h-10"},dropdownButtonConfig:{height:"h-10"},showOnPage:"",showFilter:"",showSort:"",showSearch:"",showReload:"",showSettings:"",onOnAdd:w,onOnChangeOnPage:r(t).changeOnPage,onOnSelectedSorting:x,onOnSelectedFilters:C,onClearSortFilter:E,onOnSearch:r(t).onSearch,onOnReload:e[2]||(e[2]=l=>r(t).goToLoadTrafficSources())},{multipleActions:g(()=>[P.value?H((m(),b(j,{key:0,class:"text-gray-200 hover:text-purple transition-colors cursor-pointer",onClick:k},null,512)),[[s,r(z)("Delete")]]):G("",!0)]),dialogs:g(()=>[S(se,{modelValue:d.value,"onUpdate:modelValue":e[0]||(e[0]=l=>d.value=l),withCreateCustom:"",onCreatedSuccessfully:V},null,8,["modelValue"]),S(q,{modelValue:p.value,"onUpdate:modelValue":e[1]||(e[1]=l=>p.value=l),loading:r(t).actionLoading,title:"Delete Selected Traffic Sources",subTitle:"Are you sure you want to delete the selected Traffic Sources?",prop:"",confirmButtons:["Cancel","Confirm"],onSubmitForm:A},null,8,["modelValue","loading"])]),_:1},8,["showMultipleActions","headerType","controlsParams","selectedSorting","selectedFilters","searchValue","onPage","showButton","onOnChangeOnPage","onOnSearch"])])}}},fe={class:"pb-3 max-mob:pb-1.5"},de={key:0,class:"gap-x-1 flex items-center"},me={class:"w-6"},ge={class:"max-w-inherit truncate"},Se={key:1},pe={class:"max-w-inherit truncate"},he={class:"max-w-inherit truncate"},_e={class:"flex items-center justify-center gap-x-1.5"},ve={__name:"TrafficSourcesTable",setup($){const i=B(),t=L(),u=M(),a=U(),f=h(!1),v=h({}),d=h(""),p=h(""),D=_(()=>t.permissions.trafficSources.edit),P=_(()=>t.permissions.trafficSources.delete),T=_({get(){return i.page},set(e){i.changePage(e)}}),w=_({get(){return i.selected},set(e){i.changeSelectedItems(e)}});function k({integration:e={}}){const{type_id:s}=e;return X(s)}function A({integration:e={}}){const{type:s={}}=e,{name:l}=s;return l}function x({integration:e,event:s,postback_enabled:l}){return e||!l?"-//-":s?s.name:"Connected Call"}function E({vendor:e}){return e?e.name:"-//-"}function C({slug:e}){u.push({name:O.detailTrafficSource,params:{workspace:a.params.workspace,slug:e}})}function V(e){f.value=!0,v.value=e,d.value="Delete Traffic Source",p.value="Are you sure you want to delete Traffic Source? Conditions containing this Traffic Source will be deleted"}async function c(e){await i.goToDeleteTrafficSource([e.slug])&&(f.value=!1)}
1return(e,s)=>{const l=W("tippy");return m(),F("div",fe,[S(ie,{page:T.value,"onUpdate:page":s[1]||(s[1]=n=>T.value=n),selected:w.value,"onUpdate:selected":s[2]||(s[2]=n=>w.value=n),headerType:r(o).trafficSource,items:r(i).items,loading:r(i).loading,total:r(i).total,showSelect:"",onEditAction:C},{"item.integration":g(({item:n})=>[n.integration?(m(),F("div",de,[y("div",me,[(m(),b(J(k(n).icon())))]),y("div",ge,R(A(n)),1)])):(m(),F("div",Se," -//- "))]),"item.event":g(({item:n})=>[y("div",pe,R(x(n)),1)]),"item.vendor":g(({item:n})=>[y("div",he,R(E(n)),1)]),"item.actions":g(({item:n})=>[y("div",_e,[S(ce,{class:"text-gray-200 hover:text-purple transition-colors cursor-pointer",edit:D.value,onClick:I(Y=>C(n),["stop"])},null,8,["edit","onClick"]),P.value?H((m(),b(j,{key:0,class:"text-gray-200 hover:text-purple transition-colors cursor-pointer",onClick:I(Y=>V(n),["stop"])},null,8,["onClick"])),[[l,r(z)("Delete")]]):G("",!0)])]),dialogs:g(()=>[S(q,{modelValue:f.value,"onUpdate:modelValue":s[0]||(s[0]=n=>f.value=n),loading:r(i).actionLoading,item:v.value,title:d.value,subTitle:p.value,confirmButtons:["Cancel","Confirm"],onSubmitForm:c},null,8,["modelValue","loading","item","title","subTitle"])]),_:1},8,["page","selected","headerType","items","loading","total"])])}}},K=[{name:"Name",value:"name",sortSettings:{key:"",sortBy:"byName"},filterSettings:{},disabled:!0,editAction:!0,minWidth:100,grow:!0},{name:"Integration",value:"integration",minWidth:100,grow:!0},{name:"Events",value:"event",align:"center",filterSettings:{},minWidth:115}],Te={name:"Vendor",value:"vendor",sortSettings:{key:"",sortBy:"byVendor"},filterSettings:{},minWidth:115,grow:!0},Q={name:"Actions",value:"actions",minWidth:114,align:"center",disabled:!0},ye=[...K,Q],we=[...K,Te,Q],Ue={__name:"ManageTrafficSources",setup($){const i=Z(),t=B(),u=N(),a=h("");return ee(()=>{u.initializeTableSettings(o.trafficSource),u.setHeaders(o.trafficSource,i.isManager?we:ye),u.getQueryLocalStorage(o.trafficSource),t.getLocalStorageOnPage(),t.goToLoadTrafficSourceFiltersAndSorting(),t.goToLoadTrafficSources()}),te((f,v,d)=>{a.value=f.name,d()}),oe(()=>{a.value!==O.detailTrafficSource&&t.$reset(),t.clearItems(),u.removeFilter(o.trafficSource)}),(f,v)=>(m(),b(re,{title:"Manage Traffic Sources"},{default:g(()=>[S(ue),S(ve)]),_:1}))}};export{Ue as default}; 2//# sourceMappingURL=ManageTrafficSources-CeuVpqmr.js.map
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.