PageSourceSearch

https://hub.trurating.com/_nuxt/CcP_k9yo.js

js trurating.com collected 2026-09-24 21:15:05 UTC 12,882 bytes, 3 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BXD3N4C5.js","./CpIqqZHE.js","./DFgjdueZ.js","./B6Wj8NBo.js","./t5sU5xfx.js","./entry.BS38WDZs.css","./BCmSbK4B.js","./DIpUK54m.js","./ou5BZcCh.js","./CiQ3ts6Y.js","./DQ0Eyi3J.js","./DhnzOELb.js","./DcCcIIKm.js","./BGv8GyJo.js","./C7OPMZza.js","./5637P65q.js","./jdnHvPea.js","./BOa7NBD4.js","./BIaXjozt.js","./CJ3xuVg7.js","./3GBo8fHD.js","./Bax1Rm2o.js","./D0ihFHJY.js","./DdDnEeVk.js","./HpTnemZ0.js","./BaKnBm5k.js","./CSvCVfB3.js","./DJCbBjSx.js"])))=>i.map(i=>d[i]);
2import{_ as Ot}from"./B6Wj8NBo.js";import{b$ as nt,bT as st,cf as Dt,c1 as Ft,bV as B,bY as V,c4 as Ct,c3 as St,cj as xt,b_ as rt,ck as Nt,cl as $t,bU as Mt,cm as At,cn as Rt,c5 as Ut,ce as Et}from"./CpIqqZHE.js";import{_ as jt}from"./BGv8GyJo.js";import Bt from"./DUxjJWfN.js";import qt from"./B8bad_ny.js";import Yt from"./C3CSG4LK.js";import zt from"./CixGHgXL.js";import{b as tt,d as et}from"./t5sU5xfx.js";import{u as Pt}from"./CSvCVfB3.js";import{d as it,U as lt,a_ as Qt,w as j,c as l,e as ut,f as Lt,N as e,aX as at,ay as x,ao as p,as as b,ap as H,u as _,r as i,q as m,Y as Vt,aa as Ht,ar as Wt,R as Xt,n as ot,a as Gt}from"./DFgjdueZ.js";import{g as Jt,c as Kt}from"./4Yhlz1mT.js";import{u as Zt}from"./28v4kSnk.js";import{_ as te}from"./c36Jv9BZ.js";import{_ as ee}from"./BY_-tWSI.js";import"./C7OPMZza.js";import"./5637P65q.js";import"./jdnHvPea.js";import"./BOa7NBD4.js";import"./DcCcIIKm.js";import"./DIpUK54m.js";import"./BIaXjozt.js";import"./CJ3xuVg7.js";import"./3GBo8fHD.js";import"./DhnzOELb.js";import"./Dj0LQeyP.js";import"./DQ0Eyi3J.js";import"./BaKnBm5k.js";import"./BRszY9Hr.js";import"./B6_4ZDsv.js";import"./DdDnEeVk.js";import"./BCmSbK4B.js";import"./CidyMyE_.js";import"./ou5BZcCh.js";import"./CiQ3ts6Y.js";import"./BLZu4zOZ.js";import"./sIcdKQag.js";import"./C0mAIAz7.js";import"./ml-hFp09.js";import"./CtR3FMex.js";import"./CpzH9359.js";import"./DVE8qutz.js";import"./Di-uw7TD.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"110685"};var u=new r.Error().stack;u&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[u]="d599a88d-103a-4419-93df-1185a44b9cc5",r._sentryDebugIdIdentifier="sentry-dbid-d599a88d-103a-4419-93df-1185a44b9cc5")}catch{}})();const ae=Vt(()=>Ot(()=>import("./BXD3N4C5.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]),import.meta.url).then(r=>r.default||r)),oe={class:"flex flex-wrap gap-2 lg:w-1/2 lg:flex-nowrap"},ne={class:"hidden w-1/2 items-center justify-end gap-2 lg:flex print:hidden"},se=it({__name:"FilterBar",props:{dashboardId:{},organisationId:{}},async setup(r){let u,y;const{t:d,locale:R}=lt(),U=nt(),h=r,N=i(!1),T=i([]),C=i(!1),O=i(!1),f=i(!1),v=i(!1),{fetchImpersonatorName:$}=st(),D=Dt(),q=Pt(),g=Ft(),{params:o}=B(q),{currentOrganisationTouchpoints:s}=B(D),{currentOrganisationId:F,numberOfAccessibleNodes:I}=B(g),k=m(()=>s.value.filter(t=>!(t.label==="inStore"&&U.path.includes("comment"))).map(t=>({key:t.id,label:t.translateLabel?d("dashboards.touchpoint.name."+t.label):t.label,touchpoint:t}))),Q=$()?"sm:top-[85px]":"sm:top-12 print:top-0",Y=i(!1),w=i(0),M=i(),X=i([]),S=i([]),z=i(),P=m(()=>k.value.length===1),A=m(()=>{if(P.value){const t=k.value[0]?.label;return typeof t=="string"?[t]:[]}return z.value?.filter(t=>typeof t=="string")??[]}),dt=m(()=>{if(P.value){const t=k.value[0]?.key;return typeof t=="string"?[t]:[]}return Array.isArray(S.value)?S.value.filter(t=>typeof t=="string"):[]}),ct=m(()=>o.value.dateFrom&&o.value.dateTo?d("reports.heatmap.timeFromTo",{minValue:et(o.value.dateFrom).format("DD MMM YYYY"),maxValue:et(o.value.dateTo).format("DD MMM YYYY")}):o.value.relativeDate?xt(o.value.relativeDate).map(a=>a.translationRequired?d(a.string,a?.options):a.string).join(" "):d("filters.dateFilter")),pt=m(()=>w.value?w.value.toString()+" "+d("organisations.outlet",w.value):d("organisations.outlet",2)),mt=m(()=>!A.value||!A.value.length?d("organisations.touchpoint",2):A.value.length>2?`${A.value.slice(0,2).join(", ")}
3    + ${A.value.length-2} ${d("more")}`:Jt(A.value)),ft=m(()=>{const t=c=>c?Array.isArray(c)?c.length:1:0,a=t(o.value.orOutletTags)+t(o.value.andOutletTags)+t(o.value.notOutletTags);return a?d("filters.outletTags.tag",a):d("filters.outletTags.title")}),L=m(()=>rt({permissions:["QuickFilters.Self.Read","QuickFilters.Organisation.Read"],allRequired:!1}));async function G(){await K(),C.value=!0}function J(){q.$reset(),U.path.includes("comment")&&Zt().resetFilters()}async function K(){const t=await V(`/api/v4/organisations/${h.organisationId}/filters`);X.value=t}async function vt(t){o.value.andOutletTags=t.orOutletTags?t.andOutletTags:[],o.value.orOutletTags=t.orOutletTags,o.value.notOutletTags=t.notOutletTags}async function gt(){if(h.dashboardId){if(Nt(o.value)){const t=await V(`/api/v4/dashboards/${h.dashboardId}/filters/user`);t&&t.config&&(o.value.relativeDate=t.config.relativeDate,o.value.dateFrom=t.config.dateFrom,o.value.dateTo=t.config.dateTo,o.value.touchpointIds=t.config.touchpointIds,o.value.organisationNodeIds=t.config.organisationNodeIds)}Y.value=!0}}const bt=async t=>{delete t.config.totalOutlets,o.value.relativeDate=t.config.relativeDate,o.value.dateFrom=t.config.dateFrom,o.value.dateTo=t.config.dateTo,o.value.touchpointIds=t.config.touchpointIds,o.value.organisationNodeIds=t.config.organisationNodeIds,o.value.andOutletTags=t.config.andOutletTags,o.value.orOutletTags=t.config.orOutletTags,o.value.notOutletTags=t.config.notOutletTags,M.value=t.config.organisationNodeIds,S.value=(t.config.touchpointIds??[]).filter(a=>
3typeof a=="string")},ht=tt(async()=>{!Y.value||!h.dashboardId||await V(`/api/v4/dashboards/${h.dashboardId}/filters/user`,{method:"post",body:{config:{...o.value}}})},1e3),Z=tt(async(t,a)=>{t&&(o.value[t]=a)},750);return[u,y]=Qt(()=>gt()),await u,y(),j(()=>o,()=>ht(),{deep:!0}),j(()=>o.value,()=>{M.value=o.value.organisationNodeIds?Array.isArray(o.value.organisationNodeIds)?o.value.organisationNodeIds:[o.value.organisationNodeIds]:void 0,P.value||(S.value=o.value.touchpointIds),!o.value.relativeDate&&!o.value.dateFrom&&!o.value.dateTo&&(o.value.relativeDate="since|startOf|month")},{deep:!0,immediate:!0}),j(()=>h.organisationId,()=>{g.getOrganisation(h.organisationId,!1,!1,R.value?R.value.split("-")[0]:void 0),g.setCurrentOrganisation(h.organisationId)},{deep:!0,immediate:!0}),j(()=>F.value,async()=>{if(!F.value)return;s.value.length||await D.fetchTouchpointForOrganisation(F.value);const t={touchpointIds:o.value?.touchpointIds,organisationNodeIds:o.value?.organisationNodeIds},a=Object.values(t).some(E=>E),c=await g.fetchOrganisationOutletTags(F.value,a?t:void 0);T.value=c.filter(E=>E.type==="custom")},{immediate:!0}),(t,a)=>{const c=Ct,E=St,_t=jt,yt=Bt,Tt=qt,It=Yt,kt=zt,wt=ae;return l(),ut("div",{class:Lt(["flex flex-wrap items-center justify-between gap-y-2 border-b border-zinc-200 bg-white p-3 sm:sticky sm:z-40 print:static print:w-full print:border-none",e(Q)])},[at("div",oe,[x(c,{id:"dashboard-date-filter-button",label:e(ct),"trailing-icon":"i-mdi-calendar-month-outline",onClick:a[0]||(a[0]=n=>O.value=!0)},null,8,["label"]),e(k).length?(l(),p(c,{key:0,id:"dashboard-touchpoint-filter-button",label:e(mt),"trailing-icon":"i-mdi-chevron-down",disabled:e(P)||!e(k).length,onClick:a[1]||(a[1]=n=>v.value=!0)},null,8,["label","disabled"])):b("",!0),e(I)>1?(l(),p(c,{key:1,id:"dashboard-outlet-filter-button",label:e(pt),"trailing-icon":"i-mdi-chevron-down",onClick:a[2]||(a[2]=n=>f.value=!0)},null,8,["label"])):b("",!0),e(T).length&&e(I)>1?(l(),p(E,{key:2,text:t.$t("filters.outletTags.noTagsAvailableWithFilters"),disabled:!!e(T).length,arrow:"",ui:{content:"h-auto text-xs text-clip text-wrap py-2 px-3 pointer-coarse:block!"}},{default:H(()=>[x(c,{id:"dashboard-outlet-tag-filter-button",label:e(ft),"trailing-icon":"i-mdi-chevron-down",disabled:e(T).length===0,onClick:a[3]||(a[3]=n=>N.value=!0)},null,8,["label","disabled"])]),_:1},8,["text","disabled"])):b("",!0),x(_t,{class:"lg:hidden",items:[[{label:e(d)("filters.quick.title"),icon:"i-mdi-sparkles-outline",hidden:!e(L),iconColor:"trublue",onClick:G}],[{label:t.$t("filters.reset"),icon:"i-mdi-replay",iconColor:"trublue",onClick:J}]],ui:{width:"min-w-32"}},{default:H(()=>[x(c,{label:t.$t("more"),"trailing-icon":"i-mdi-chevron-down",variant:"outline"},null,8,["label"])]),_:1},8,["items"])]),at("div",ne,[e(L)?(l(),p(c,{key:0,id:"dashboard-quick-filters-button",label:t.$t("filters.quick.title"),icon:"i-mdi-sparkles-outline",variant:"outline",onClick:G},null,8,["label"])):b("",!0),x(c,{id:"dashboard-reset-filters-button",label:t.$t("filters.reset"),icon:"i-mdi-replay",variant:"outline",onClick:J},null,8,["label"])]),x(yt,{open:e(O),"onUpdate:open":a[4]||(a[4]=n=>_(O)?O.value=n:null)},null,8,["open"]),x(Tt,{open:e(v),"onUpdate:open":[a[5]||(a[5]=n=>_(v)?v.value=n:null),a[9]||(a[9]=n=>v.value=n)],"selected-touchpoints":e(S),"onUpdate:selectedTouchpoints":[a[6]||(a[6]=n=>_(S)?S.value=n:null),a[8]||(a[8]=n=>e(Z)("touchpointIds",n))],"selected-touchpoint-names":e(z),"onUpdate:selectedTouchpointNames":a[7]||(a[7]=n=>_(z)?z.value=n:null),"available-touchpoints":e(k)},null,8,["open","selected-touchpoints","selected-touchpoint-names","available-touchpoints"]),e(I)>1?(l(),p(It,{key:0,open:e(f),"onUpdate:open":a[10]||(a[10]=n=>_(f)?f.value=n:null),"selected-outlets":e(M),"onUpdate:selectedOutlets":[a[11]||(a[11]=n=>_(M)?M.value=n:null),a[13]||(a[13]=n=>e(Z)("organisationNodeIds",n))],"total-selected-outlets-count":e(w),"onUpdate:totalSelectedOutletsCount":a[12]||(a[12]=n=>_(w)?w.value=n:null)},null,8,["open","selected-outlets","total-selected-outlets-count"])):b("",!0),e(I)>1?(l(),p(kt,{key:1,open:e(N),"onUpdate:open":a[14]||(a[14]=n=>_(N)?N.value=n:null),"relevant-tags":e(T),"onUpdate:relevantTags":a[15]||(a[15]=n=>_(T)?T.value=n:null),"confirm-function":vt},null,8,["open","relevant-tags"])):b("",!0),e(L)?(l(),p(wt,{key:2,open:e(C),"onUpdate:open":a[16]||(a[16]=n=>_(C)?C.value=n:null),"root-organisation-node-id":r.organisationId,"selected-touchpoints":e(dt),"selected-outlets":e(M),"relative-date":e(o).relativeDate,"date-from":e(o).dateFrom,"date-to":e(o).dateTo,"quick-filters":e(X),"refetch-data":K,"total-selected-outlets-count":e(w),"available-touchpoints":e(k),onApplyFilter:a[17]||(a[17]=n=>bt(n))},null,8,["open","root-organisation-node-id","selected-touchpoints","selected-outlets","relative-date","date-from","date-to","quick-filters","total-selected-outlets-count","available-touchpoints"])):b("",!0)],2)}}}),re=Object.assign(se,{__name:"DashboardFilterBar"}),ie={};function le(r,u){return l(),p(Wt,{defer:"",to:"#layout-toolbar"},[Ht(r.$slots,"default")])}const ue=Object.assign(te(ie,[["render",le]]),{__name:"LayoutPageToolbar"}),de=()=>{const r=$t("app-initializing",()=>!0);return{isAppInitializing:Xt(r)}},Ze=it({__name:"dashboard",setup(r){const{t:u}
3=lt(),y=nt(),{isAppInitializing:d}=de(),R=Mt(),U=st(),{fetchDashboard:h,setCurrentDashboardId:N}=R,{currentDashboard:T}=B(R),{currentUser:C}=B(U),O=i(!0),f=i(!1),v=i(u("dashboards.errors.403")),$=i(!0),D=i(!1),q=m(()=>{const s=T.value;if(!(!s||!Object.hasOwn(s,"config")||!O.value))return s}),g=m(()=>{if(D.value)return q.value}),o=m(()=>!d.value&&!g.value&&($.value||!D.value));return j(()=>y.params.id,async()=>{$.value=!0,f.value=!1,At();try{if(!y.params.id||y.params.id==="undefined"){f.value=!0,v.value=u("dashboards.errors.404");return}N(y.params.id);const s=await h(y.params.id);if(!s){f.value=!0,v.value=u("dashboards.errors.404");return}(!C.value||!C.value.permissions)&&(await U.fetchCurrentUser(),await ot());const F=s.type?Kt(s.type):"Default";let I=`Dashboards.${F}.Read`;F==="Default"&&(I=s.isOwner?"Dashboards.Default.Self.Read":"Dashboards.Default.Organisation.Read"),O.value=rt({permissions:[I],allRequired:!1})}catch(s){if(f.value=!0,s?.statusCode===404||s?.statusCode===400&&s.response._data.errors.dashboardId&&s.response._data.errors.dashboardId.includes("The input was not valid.")){v.value=u("dashboards.errors.404");return}if(s?.statusCode===403){v.value=u("dashboards.errors.403");return}throw Rt({statusCode:500,statusMessage:u("dashboards.errors.404"),fatal:!0})}finally{$.value=!1}},{immediate:!0,deep:!0}),Gt(()=>{ot(()=>{D.value=!0})}),(s,F)=>{const I=re,k=ue,W=ee,Q=Ut,Y=Et;return l(),ut("div",null,[e(D)?(l(),p(k,{key:0},{default:H(()=>[e(g)?(l(),p(I,{key:0,"dashboard-id":e(g).id,"organisation-id":e(g).rootOrganisationNodeId},null,8,["dashboard-id","organisation-id"])):b("",!0)]),_:1})):b("",!0),e(o)?(l(),p(W,{key:1})):b("",!0),e(g)?(l(),p(Q,{key:2,"page-key":w=>w.params.id,"dashboard-object":e(g)},null,8,["page-key","dashboard-object"])):e(D)&&!e($)&&(!e(O)||e(f))?(l(),p(Y,{key:3,"custom-title":e(v),"status-code":e(f)?404:403},null,8,["custom-title","status-code"])):b("",!0)])}}});export{Ze 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.