1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},r=(new e.Error).stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="585aa77e-3d52-46a6-824c-32709e8606d2",e._sentryDebugIdIdentifier="sentry-dbid-585aa77e-3d52-46a6-824c-32709e8606d2")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9725],{4887:function(e,r,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/bestellen/mijnaccount/herhaalbestellingen",function(){return n(67079)}])},67079:function(e,r,n){"use strict";n.r(r),n.d(r,{default:function(){return herhaalbestellingen}});var t=n(52322),a=n(20843),s=n(90600),l=n(81862),i=n(22970),d=n(60646),o=n(39097),c=n.n(o),u=n(83022),h=n(68233),m=n(57267),g=n(44643),x=n(85165),f=n(55197),_=n(27690),y=n(15234),b=n(37475),p=n(83146),v=n(2784);let j=v.forwardRef(function({title:e,titleId:r,...n},t){return v.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":r},n),e?v.createElement("title",{id:r},e):null,v.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 0 1-9.201 2.466l-.312-.311h2.433a.75.75 0 0 0 0-1.5H3.989a.75.75 0 0 0-.75.75v4.242a.75.75 0 0 0 1.5 0v-2.43l.31.31a7 7 0 0 0 11.712-3.138.75.75 0 0 0-1.449-.39Zm1.23-3.723a.75.75 0 0 0 .219-.53V2.929a.75.75 0 0 0-1.5 0V5.36l-.31-.31A7 7 0 0 0 3.239 8.188a.75.75 0 1 0 1.448.389A5.5 5.5 0 0 1 13.89 6.11l.311.31h-2.432a.75.75 0 0 0 0 1.5h4.243a.75.75 0 0 0 .53-.219Z",clipRule:"evenodd"}))});var w=n(3913),N=n(48135),k=n(55830),E=n(46074),O=n(41077),C=n(12580),D=n(4443),M=n(5632),RecurringOrdersContainer=function(){var e,r=(0,N.L)(function(e){return e.user}),n=r.id,a=(0,M.useRouter)(),s=(0,N.L)(function(e){return e.customerBusinessId}),o=(0,D.p)(function(e){return e.logisticData}),v=(0,h.q)(),T=v.isOpen,R=v.onClose,H=v.onOpen,B=(0,O.J_)(new Date,"yyyy-MM-dd"),L=(0,_.g3k)({currentDate:B}),Z=L.isLoading,I=L.data,V=(0,_.NgE)().mutateAsync,q=(0,_.ZDi)().mutateAsync,A=(0,_.Wet)().mutateAsync,W=(0,k.NL)(),J=(e=(0,l._)(function(e){var t,l,d,c;return(0,i.Jh)(this,function(i){switch(i.label){case 0:if(i.trys.push([0,5,,6]),!r)throw Error("User not found");return t=(0,f.Zb)({dayOfMonth:e.dayOfMonth,daysOfWeek:e.daysOfWeek,endDate:e.endDate,startDate:e.startDate,frequency:e.frequency,patternType:e.patternType}),[4,V({variables:{customer_id:n,customer_business_id:s,start_date:e.startDate||null,end_date:e.endDate||null,name:e.name,address:(null==o?void 0:o.address)||r.street,house_number:(null==o?void 0:o.houseNumber)||r.house_number,lat:(null==o?void 0:o.lat)||r.lat,lng:(null==o?void 0:o.lng)||r.long,postal_code:(null==o?void 0:o.postalCode)||r.postal_code,city:(null==o?void 0:o.city)||r.city,house_number_addition:(null==o?void 0:o.houseNumberAddition)||r.house_number_addition,customer_business_location_id:(null==o?void 0:o.customerBusinessLocationId)||null}})];case 1:if(!(l=i.sent()).insert_recurring_order_one)throw Error("Could not create recurring order");return d=l.insert_recurring_order_one.id,[4,q({variables:{day_of_month:e.dayOfMonth,days_of_week:e.daysOfWeek,frequency:e.frequency,pattern_type:e.patternType,recurring_order_id:d}})];case 2:return i.sent(),[4,A({variables:t.map(function(e){var r;return{is_rescheduled:e.isRescheduled,rescheduled_reason:null!==(r=e.rescheduleReason)&&void 0!==r?r:null,recurring_order_id:d,run_date:e.date}})})];case 3:return i.sent(),[4,W.invalidateQueries([_.CN7.Query.GetRecurringOrders])];case 4:return i.sent(),R(),a.push("/bestellen/mijnaccount/herhaalbestellingen/".concat(d)).c
1atch(function(){}),(0,b.x9)("Herhaalbestelling is aangemaakt"),[3,6];case 5:return c=i.sent(),(0,y.H)(c),(0,b._N)("Er is iets misgegaan bij het aanmaken van de herhaalbestelling"),[3,6];case 6:return[2]}})}),function(r){return e.apply(this,arguments)});return Z?(0,t.jsx)(E.X,{}):(0,t.jsxs)(x.X,{title:"Herhaalbestellingen",subTitle:"Bekijk hier jouw herhaalbestellingen",children:[(0,t.jsx)(m.V,{isOpen:T,onClose:R,modalTitle:"Herhaalbestelling aanmaken",children:(0,t.jsx)(g.f,{onFormSubmit:J})}),(0,t.jsxs)("div",{className:"py-6",children:[(null==I?void 0:I.recurring_order)&&0===I.recurring_order.length&&(0,t.jsx)(u.u,{header:"Je hebt nog geen herhaalbestellingen",subHeader:"Herhaalbestellingen zijn bestellingen die je in de toekomst automatisch laat plaatsen. Je kunt een herhaalbestelling aanpassen of verwijderen.",buttonText:"Herhaalbestelling aanmaken",onButtonClick:H}),(null==I?void 0:I.recurring_order)&&I.recurring_order.length>0&&(0,t.jsxs)("ul",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3",children:[(0,t.jsx)("button",{"aria-label":"Herhaalbestelling aanmaken",className:" hover:shadow-md col-span-1 flex items-center align-center justify-center divide-y divide-gray-200 rounded-lg bg-white text-center shadow",type:"button",onClick:H,children:(0,t.jsxs)("div",{className:"flex items-center flex-col",children:[(0,t.jsx)(p.Z,{className:"h-12 w-12 text-gray-600","aria-hidden":"true"}),(0,t.jsxs)(d.x,{hierarchyVariant:"secondaryText",children:["Herhaalbestelling ",(0,t.jsx)("br",{})," aanmaken"]})]})}),I.recurring_order.map(function(e){var r,n,a=(0,O.MG)(e.name.charAt(0)),s=(0,O.FK)(e.name,a);return(0,t.jsx)("li",{children:(0,t.jsxs)(c(),{href:"/bestellen/mijnaccount/herhaalbestellingen/".concat(e.id),className:"col-span-1 flex flex-col divide-y divide-gray-200 rounded-lg bg-white text-center shadow",children:[(0,t.jsxs)("div",{className:"flex flex-1 flex-col p-6",children:[(0,t.jsx)("img",{className:"mx-auto h-18 w-18 flex-shrink-0 rounded-full",src:s,alt:""}),(0,t.jsxs)("h3",{className:"mt-6 text-sm font-medium text-gray-900",children:[e.name,(0,t.jsxs)("span",{className:"text-xs",children:[" ","(",null!==(n=null===(r=e.recurring_order_items_aggregate.aggregate)||void 0===r?void 0:r.count)&&void 0!==n?n:0,")"]})]}),(0,t.jsxs)("dl",{className:"mt-1 flex flex-grow flex-col justify-between",children:[(0,t.jsx)("dt",{className:"sr-only",children:"Title"}),e.recurring_order_pattern&&(0,t.jsx)("dd",{className:"text-sm text-gray-500",children:(0,O.yR)({dayOfMonth:e.recurring_order_pattern.day_of_month,daysOfWeek:e.recurring_order_pattern.days_of_week,frequency:e.recurring_order_pattern.frequency,patternType:e.recurring_order_pattern.pattern_type})}),(0,t.jsx)("dt",{className:"sr-only",children:"Status"}),(0,t.jsx)("dd",{className:"mt-3",children:(0,t.jsx)(C.Ct,{formatVariant:"formatRecurringOrderStatusText",text:e.status,color:(0,C.Cj)(e.status)})}),(0,t.jsx)("dt",{className:"sr-only",children:"Volgende runs"}),e.recurring_order_runs&&e.recurring_order_runs.length>0&&(0,t.jsxs)("dd",{className:"text-sm mt-2 text-gray-500",children:[(0,t.jsx)(j,{className:"h-4 w-4 inline-block text-gray-400 mr-2","aria-hidden":"true"}),(0,O.J_)(new Date(e.recurring_order_runs[0].run_date),"EEEE d MMMM")]})]})]}),(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:"-mt-px flex divide-x divide-gray-200",children:(0,t.jsx)("div",{className:"-ml-px flex w-0 flex-1",children:(0,t.jsxs)("div",{className:"relative hover:cursor inline-flex w-0 flex-1 items-center justify-center gap-x-3 rounded-br-lg border border-transparent py-4 text-sm font-semibold text-gray-900",children:["Bekijken",(0,t.jsx)(w.Z,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})]})})})})]})},e.id)})]})]})]})},T=n(97729),R=n.n(T),herhaalbestellingen=function(){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R(),{children:(0,t.jsx)("title",{children:"Herhaalbestellingen | Lokalist"})}),(0,t.jsx)(s.G,{allowedRoles:a.su,children:(0,t.jsx)(RecurringOrdersContainer,{})})]})}},83022:function(e,r,n){"use strict";n.d(r,{u:function(){return EmptyState}});var t=n(52322),a=n(83146),s=n(79895),l=n(30180),EmptyState=function(e){var r=e.buttonText,n=e.onButtonClick,i=e.buttonIcon,d=e.header,o=e.subHeader,c=e.withIcon,u=e.disabled,h=e.isButtonLoading,m=e.children;return(0,t.jsxs)(l.W,{className:"bg-white p-6 text-center shadow",children:[(void 0===c||c)&&
1(0,t.jsx)("svg",{className:"mx-auto h-8 w-8 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})}),(0,t.jsx)("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:d}),(0,t.jsx)("p",{className:"mt-1 text-sm text-gray-500",children:o}),(0,t.jsx)("div",{className:"mt-1 text-sm text-gray-500",children:m}),(0,t.jsx)("div",{className:"mt-6",children:n&&r&&(0,t.jsx)(s.Button,{loading:h,icon:i||(0,t.jsx)(a.Z,{className:"mr-2 -ml-1 h-5 w-5","aria-hidden":"true"}),onClick:n,type:"button",disabled:u,className:"mx-auto",children:r})})]})}},57267:function(e,r,n){"use strict";n.d(r,{V:function(){return ModalDrawer}});var t=n(52322),a=n(22241),s=n(87466),l=n(88141),ModalDrawer=function(e){var r=e.isOpen,n=e.onClose,i=e.children,d=e.icon,o=e.modalDescription,c=e.modalTitle,u=e.customDialogPanel,h=e.className,m=e.fullscreen,g=(0,l.B)();return(0,l.i)(g)?(0,t.jsx)(a.d,{fullscreen:void 0!==m&&m,isOpen:r,onClose:n,title:c,description:o,children:i}):(0,t.jsx)(s.u,{isOpen:r,onClose:n,icon:d,modalTitle:c,modalDescription:o,className:void 0===h?"":h,customDialogPanel:void 0!==u&&u,children:i})}},3913:function(e,r,n){"use strict";var t=n(2784);let a=t.forwardRef(function({title:e,titleId:r,...n},a){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:a,"aria-labelledby":r},n),e?t.createElement("title",{id:r},e):null,t.createElement("path",{fillRule:"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z",clipRule:"evenodd"}))});r.Z=a}},function(e){e.O(0,[8834,8472,8983,1988,4081,2891,79,6074,9774,2888,179],function(){return e(e.s=4887)}),_N_E=e.O()}]);
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.