PageSourceSearch

https://bikebook.co.uk/_next/static/chunks/pages/admin/skarper-config-8fd0ae1079ad1aa0.js

js bikebook.co.uk collected 2026-09-24 09:50:50 UTC 8,220 bytes, 2 lines download raw bytes

1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},i=(new e.Error).stack;i&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[i]="65fa6540-dcf5-4968-b195-2e1583baac19",e._sentryDebugIdIdentifier="sentry-dbid-65fa6540-dcf5-4968-b195-2e1583baac19")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6163],{4340:(e,i,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/skarper-config",function(){return t(66538)}])},66538:(e,i,t)=>{"use strict";t.r(i),t.d(i,{default:()=>D});var s=t(6029),a=t(75155),n=t(46232),r=t(43613),l=t(30961),d=t(13918),o=t(72091),c=t(35197),u=t(80956),m=t(16568),p=t(84473),b=t(55729),h=t(68020),g=t(8013),f=t(38002),y=t(81278),v=t(73832),x=t(70839),P=t(59550),S=t(48378),N=t(33636),j=t(95051),k=t(31377),I=t(46831);function C(e){let i,t,n,r,l,d,o,c,u=(0,a.c)(24),{open:m,setOpen:p,onSuccess:h}=e,f=(0,g.jL)(),[y,x]=(0,b.useState)(null),{mutateAsync:P,isPending:S}=(0,v.St)();u[0]!==P||u[1]!==f||u[2]!==h||u[3]!==y||u[4]!==p?(i=async()=>{null!=y&&await P({params:{businessId:y.businessId}}).then(()=>{h(),p(!1),f((0,I.kw)("success","Business attached to Skarper")),x(null)})},u[0]=P,u[1]=f,u[2]=h,u[3]=y,u[4]=p,u[5]=i):i=u[5];let N=i;u[6]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{x(e)},u[6]=t):t=u[6];let C=t;return u[7]!==p?(n=()=>p(!1),u[7]=p,u[8]=n):n=u[8],u[9]!==p?(r={type:"button",content:"Close",hideOnMobile:!0,buttonProps:{onClick:()=>{p(!1)}},side:"left"},u[9]=p,u[10]=r):r=u[10],u[11]!==N||u[12]!==S?(l={type:"button",content:"Attach Business",buttonProps:{onClick:N,loading:S},side:"right"},u[11]=N,u[12]=S,u[13]=l):l=u[13],u[14]!==r||u[15]!==l?(d=[r,l],u[14]=r,u[15]=l,u[16]=d):d=u[16],u[17]!==y?(o=(0,s.jsx)(k.A,{size:"medium",onSelect:C,selectedBusiness:y}),u[17]=y,u[18]=o):o=u[18],u[19]!==m||u[20]!==n||u[21]!==d||u[22]!==o?(c=(0,s.jsx)(j.A,{open:m,onClose:n,maxWidth:"sm",fullWidth:!0,title:"Select a business to attach",subheader:"Select a business to attach to Skarper",actions:d,children:o}),u[19]=m,u[20]=n,u[21]=d,u[22]=o,u[23]=c):c=u[23],c}var w=t(29113);function A(e){let{openAttachBusinessDialog:i,setOpenAttachBusinessDialog:t}=e,{themeStretch:a}=(0,h.A)();(0,m.A)(),(0,y.useRouter)();let{data:n}=(0,v.P6)(),{refreshToken:r}=(0,g.GV)(e=>e.business.service),[l,d]=(0,b.useState)(0),{mutateAsync:k,isPending:A}=(0,v.Ui)(),[_,T]=(0,b.useState)(!1),[D,E]=(0,b.useState)(null),{data:R}=(0,v.xT)("Skarper",{query:{staleTime:0,gcTime:0,queryKey:["partnerEmbedConfiguration",r,l]}}),W=null==R?void 0:R.data,B=(0,g.wA)(),M=null==n?void 0:n.data;(0,b.useCallback)((0,f.A)((e,i)=>{setFilterName(e)},200),[]);let V=(e,i)=>{B((0,S.zE)(e.row.serviceId))},z=()=>{d(l+1)};(0,b.useEffect)(()=>{z()},[]);let H=async e=>{await k({params:{businessId:e}}).then(()=>{z(),T(!1),B((0,I.kw)("success","Business removed from Skarper"))})};if(null==M)return null;var O=null==W?void 0:W.businesses.map(e=>({...e,id:e.businessId}));return null==O&&(O=[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.A,{spacing:2,children:[(0,s.jsx)(c.A,{}),(0,s.jsx)(p.A,{objectName:"Business",defaultPageSize:20,tableId:"skarper-businesses",title:"Skarper Businesses",refreshDataToken:l,defaultDensity:"standard",disableHeaderFilters:!0,rowReorderingPropName:"DisplayName",disableSorting:!0,rowReordering:!0,checkboxSelection:!1,columns:[{field:"DisplayName",type:"string",headerName:"Business Name",numeric:!1,disablePadding:!0,minWidth:100,flex:1,getPropValue:e=>e.displayName},{field:"Email",type:"string",headerName:"Email",filterable:!1,sortable:!1,numeric:!1,disablePadding:!0,getPropValue:e=>e.contactEmail},{field:"ContactNumber",type:"string",headerName:"Number",numeric:!0,disablePadding:!0,getPropValue:e=>e.contactNumber?e.contactNumber:"N/a"},{field:"action",type:"action",headerName:"",numeric:!1,disablePadding:!0,options:[{label:"Remove",onClick:e=>{T(!0),E(e.businessId)},icon:(0,s.jsx)(w.l,{size:20})}]}],dataOverride:O,additionalReqProps:{includeProfile:!1},defaultSortModel:{field:"Created",sort:"desc"},sx:{border:"none","& .MuiCardHeader-root":{padding:0}}}),null==M?void 0:M.map(e=>(0,s.jsx)(p.A,{objectName:"Service",defaultPageSize:50,tableId:e.value+"_services",checkboxSelection:!1,detailPanelEnabled:!0,onRowClick:V,mergePropertyId:"serviceId",refreshDataToken:r,rowReordering:!0,defaultHeight:"500px",rowReorderingPropName:"name",getRowClassName:e=>"mui-data-grid-clickable",disableHeaderFilters:!0,disableSorting:!0,title:"Skarper Services",columns:[{field:"Name",type:"string",headerName:"Name",placeholder:"Premium service",numeric:!0,flex:1.5,minWidth:150,disablePadding:!0,getPropValue:e=>null!=e.allowedServiceItemType&&null!=e.subName?(0,s.jsx)(u.A,{title:"The [level] equivalent is used to compare services among mechanics in our search results, so please try to match them accordingly.",placement:"top",children:(0,s.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[(0,s.jsx)("span",{style:{lineHeight:"16px"},children:e.name}),(0,s.jsxs)("span",{style:{fontSize:10,lineHeight:"12px"},children:[e.subName," Equivalent"]})]})}):e.name},{field:"ServiceGroup.Name",type:"string",headerName:"Category",filterable:!1,numeric:!0,flex:1,minWidth:150,disablePadding:!0,getPropValue:e=>e.serviceGroup.name},{field:"ServicePricingType",type:"singleSelect",headerName:"Pricing Type",numeric:!0,flex:1,minWidth:150,disablePadding:!0,getPropValue:e=>x.t[e.servicePricingType].label},{field:"Price",type:"number",headerName:"Price",placeholder:(0,P.TI)(100),numeric:!0,flex:.7,minWidth:100,disablePadding:!0,getPropValue:e=>"SetPrice"==e.servicePricingType?(0,P.TI)(e.price):"-"},{field:"DurationInMinutes",type:"string",headerName:"Duration",placeholder:"30 minutes",flex:.7,minWidth:120,disablePadding:!0,getPropValue:e=>e.durationInMinutes?e.durationInMinutes+" minutes":"-"},{field:"Included",type:"string",headerName:"Included",flex:.7,filterable:!1,sortable:!1,minWidth:120,disablePadding:!0,getPropValue:e=>{var i,t,a,n;return null==e.serviceItems||0==e.serviceItems.length?"-":(0,s.jsx)("div",{children:(0,s.jsx)(u.A,{title:(0,s.jsx)("ul",{children:(i=[...null!=(a=e.serviceItems)?a:[]],i.sort((e,i)=>e.serviceItemCategory.name.localeCompare(i.serviceItemCategory.name)).map(e=>(0,s.jsx)("li",{children:"[".concat(e.serviceItemCategory.name,"] ").concat(e.name)}
1,e.id)))}),children:(0,s.jsx)("div",{children:"".concat(null!=(n=null==e||null==(t=e.serviceItems)?void 0:t.length)?n:0," items")})})})}},...e.adminLocked?[]:[{field:"action",type:"action",headerName:"",numeric:!1,disablePadding:!0,renderCell:i=>(0,s.jsx)(ServicesMoreMenu,{service:i.row,serviceGroup:e})}]],defaultDensity:"standard",additionalReqProps:{categoryFilters:["skarper"]},dataOverride:e.services,disableExport:!0,sx:{border:"none","& .MuiCardHeader-root":{padding:0}},defaultSortModel:{field:"Price",sort:"desc"}}))]}),(0,s.jsx)(N.A,{}),(0,s.jsx)(C,{open:i,setOpen:t,onSuccess:z}),(0,s.jsx)(j.A,{open:_,onClose:()=>T(!1),title:"Remove business?",maxWidth:"sm",fullWidth:!0,content:"Are you sure you want to remove this business from Skarper?",actions:[{type:"button",content:"Cancel",side:"left",buttonProps:{onClick:()=>T(!1)}},{type:"button",content:"Remove",side:"right",buttonProps:{loading:A,color:"error",onClick:()=>H(D)}}]})]})}var _=t(15086),T=t(89783);let D=()=>{let e,i,t,o=(0,a.c)(4),[c,u]=(0,b.useState)(!1);return o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,s.jsx)(l.l,{size:20}),o[0]=e):e=o[0],o[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,s.jsx)(_.A,{title:"Skarper Config",icon:e,actions:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.A,{size:"small",variant:"outlined",color:"inherit",startIcon:(0,s.jsx)(d.f,{size:16}),onClick:()=>{u(!0)},children:"Add Business"})," "]})}),o[1]=i):i=o[1],o[2]!==c?(t=(0,s.jsxs)(T.A,{children:[i,(0,s.jsx)(r.A,{maxWidth:"xl",children:(0,s.jsx)(A,{openAttachBusinessDialog:c,setOpenAttachBusinessDialog:u})})]}),o[2]=c,o[3]=t):t=o[3],t}}},e=>{e.O(0,[1474,8600,9664,3652,3761,1909,737,9610,4454,7874,3834,512,8149,6282,5506,3115,299,4148,5328,6531,4100,1933,2330,6593,636,8792],()=>e(e.s=4340)),_N_E=e.O()}]);
2//# sourceMappingURL=skarper-config-8fd0ae1079ad1aa0.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.