1/*! For license information please see 611.819928aa.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunktelescope=self.webpackChunktelescope||[]).push([[611],{1806:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(57499),a=n(70551),i=n(94188);function s(e,t){var n;(0,a.A)(1,arguments);var s=(0,i.A)(null!==(n=null==t?void 0:t.additionalDigits)&&void 0!==n?n:2);if(2!==s&&1!==s&&0!==s)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var h,x=function(e){var t,n={},r=e.split(o.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?t=r[0]:(n.date=r[0],t=r[1],o.timeZoneDelimiter.test(n.date)&&(n.date=e.split(o.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var a=o.timezone.exec(t);a?(n.time=t.replace(a[1],""),n.timezone=a[1]):n.time=t}return n}(e);if(x.date){var v=function(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};var a=r[1]?parseInt(r[1]):null,i=r[2]?parseInt(r[2]):null;return{year:null===i?a:100*i,restDateString:e.slice((r[1]||r[2]).length)}}(x.date,s);h=function(e,t){if(null===t)return new Date(NaN);var n=e.match(c);if(!n)return new Date(NaN);var r=!!n[4],a=d(n[1]),i=d(n[2])-1,s=d(n[3]),o=d(n[4]),l=d(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,o,l)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var a=7*(t-1)+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+a),r}(t,o,l):new Date(NaN);var u=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(f[t]||(m(e)?29:28))}(t,i,s)&&function(e,t){return t>=1&&t<=(m(e)?366:365)}(t,a)?(u.setUTCFullYear(t,i,Math.max(a,s)),u):new Date(NaN)}(v.restDateString,v.year)}if(!h||isNaN(h.getTime()))return new Date(NaN);var b,y=h.getTime(),g=0;if(x.time&&(g=function(e){var t=e.match(l);if(!t)return NaN;var n=p(t[1]),a=p(t[2]),i=p(t[3]);return function(e,t,n){return 24===e?0===t&&0===n:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,a,i)?n*r.s0+a*r.Cg+1e3*i:NaN}(x.time),isNaN(g)))return new Date(NaN);if(!x.timezone){var j=new Date(y+g),N=new Date(0);return N.setFullYear(j.getUTCFullYear(),j.getUTCMonth(),j.getUTCDate()),N.setHours(j.getUTCHours(),j.getUTCMinutes(),j.getUTCSeconds(),j.getUTCMilliseconds()),N}return b=function(e){if("Z"===e)return 0;var t=e.match(u);if(!t)return 0;var n="+"===t[1]?-1:1,a=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,i)?n*(a*r.s0+i*r.Cg):NaN}(x.timezone),isNaN(b)?new Date(NaN):new Date(y+g+b)}var o={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},c=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,l=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,u=/^([+-])(\d{2})(?::?(\d{2}))?$/;function d(e){return e?parseInt(e):1}function p(e){return e&&parseFloat(e.replace(",","."))||0}var f=[31,null,31,30,31,30,31,31,30,31,30,31];function m(e){return e%400==0||e%4==0&&e%100!=0}},13603:(e,t,n)=>{n.d(t,{A:()=>r});const r=(0,n(9407).A)("hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]])},20586:(e,t,n)=>{n.r(t),n.d(t,{default:()=>Ot});var r=n(96540),a=n(24180),i=n(56848),s=n(35906),o=n(4852),c=n(65127),l=n(10467),u=n(80296),d=n(60312),p=n(44921),f=n(69438),m=n(51881),h=n(94969),x=n(24407),v=n(12052),b=n(7725),y=n(50640),g=n(36348),j=n(64467),N=n(5556),O=n.n(N),T=n(35456),_=n(46942),A=n.n(_),w=n(36256),E=n(74848),P=function(e){var t=e.patientName,n=e.phoneNumber,a=e.phoneType,i=e.hidePhoneNumber,s=void 0!==i&&i,c=(0,r.useState)(!1),l=(0,u.A)(c,2),d=l[0],p=l[1],m=(0,r.useState)(!1),h=(0,u.A)(m,2),x=h[0],v=h[1],b=(0,o.Ff)(y.A),g=function(){v(!x)},j=function(){p(!d)};return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)(f.Ol,{patientName:t,phoneNumber:n,hidePhoneNumber:s,phoneType:a,isOpen:x,setIsOpen:g}),(0,E.jsxs)("div",{className:"relative flex",children:[(0,E.jsx)(f.tz,{isOpen:d,onBlur:j,className:"flex flex-col flex-grow bg-white-0.0 shadow rounded absolute z-10 mt-6 ml-4 border border-white-2.0",children:(0,E.jsxs)("div",{className:"flex flex-col w-40 py-3",children:[(0,E.jsx)("p",{className:"py-1 hover:bg-white-1.0 px-4 my-auto cursor-pointer",onClick:g,children:b.sendMessage}),!s&&(0,E.jsx)(f.Vv,{phoneNumber:n,children:(0,E.jsx)("p",{className:"py-1 hover:bg-white-1.0 px-4 my-auto cursor-pointer",children:b.goToInbox})})]})}),(0,E.jsx)("i",{className:"text-gray-1.0 text-xl icon-more_vertical_icon cursor-pointer my-auto",onClick:j})]})]})};
2P.propTypes={patientName:O().string.isRequired,phoneNumber:O().string.isRequired,phoneType:O().number.isRequired,hidePhoneNumber:O().bool};const S=P;var R=function(e){var t=e.status,n=e.size,r=void 0===n?"":n,a=(0,o.Ff)(y.A);return t===b.Bp.ACCEPTED?(0,E.jsx)(f.Q1,{title:a.accepted,textColorClass:"text-green-1.0",bgClassName:"bg-green-0.0",dataTestId:"appointment-request-accepted",size:r}):t===b.Bp.ACCEPTING?(0,E.jsx)(f.Q1,{title:a.accepting,textColorClass:"text-green-1.0",bgClassName:"bg-green-0.0",dataTestId:"appointment-request-accepting",size:r}):t===b.Bp.SYNC_FAILED?(0,E.jsx)(f.Q1,{title:a.syncFailed,textColorClass:"text-red-1.0",bgClassName:"bg-red-2.0",dataTestId:"appointment-request-sync-failed",size:r}):t===b.Bp.REJECTED?(0,E.jsx)(f.Q1,{title:a.rejected,textColorClass:"text-pink-1.0",bgClassName:"bg-pink-2.0",dataTestId:"appointment-request-rejected",size:r}):(0,E.jsx)(f.Q1,{title:a.removed,textColorClass:"text-blue-1.0",bgClassName:"bg-blue-2.0",dataTestId:"appointment-request-removed",size:r})};R.propTypes={status:O().number.isRequired,size:O().string};const C=R;function I(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return D(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(D(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,D(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,D(d,"constructor",l),D(l,"constructor",c),c.displayName="GeneratorFunction",D(l,a,"GeneratorFunction"),D(d),D(d,a,"Generator"),D(d,r,function(){return this}),D(d,"toString",function(){return"[object Generator]"}),(I=function(){return{w:i,m:p}})()}function D(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}D=function(e,t,n,r){function i(t,n){D(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},D(e,t,n,r)}function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var L={isRejectModalOpen:!1,isRemoveModalOpen:!1,hasProviderConflict:!1,hasChairConflict:!1,status:b.hr.NO_ACTION},M=function(e){var t,n,a=e.appointmentRequest,i=e.isAppointmentRequestUnacceptable,c=void 0!==i&&i,p=(0,o.Ff)(y.A),m=(0,o.F7)().account,h=(0,g.Ay)().setAppointmentRequestNewValue,x=(0,r.useState)(L),j=(0,u.A)(x,2),N=j[0],O=j[1],_=N.isRejectModalOpen,P=N.isRemoveModalOpen,R=N.status,D="".concat(a.first_name," ").concat(a.last_name),q=R===b.hr.ACCEPTING,M=R===b.hr.REJECTING,F=R===b.hr.REMOVING,G=M||F||q,B=G||c,U=(null===(t=a.patient.phones[0])||void 0===t?void 0:t.number)||"",z=(null===(n=a.patient.phones[0])||void 0===n?void 0:n.phone_type)||s.YP.LANDLINE,H=function(e){O(function(t){return k(k({},t),{},{status:e})})},V=function(){O(function(e){return k(k({},e),{},{isRejectModalOpen:!_})})},Q=function(){O(function(e){return k(k({},e),{},{isRemoveModalOpen:!P})})},Y=function(e){h(a.id,"status",e)},Z=function(){var e=(0,l.A)(I().m(function e(){var t,n,r;return I().w(function(e){for(;;)switch(e.p=e.n){case 0:return H(b.hr.ACCEPTING),e.p=1,e.n=2,(0,v.Jj)({appointmentRequestId:a.id});case 2:t=e.v,Y((0,b.kD)(m.calendar_type)?b.Bp.ACCEPTING:b.Bp.ACCEPTED),f.y8.success((0,w.pr)(t)),e.n=4;break;case 3:e.p=3,r=e.v,H(b.hr.NO_ACTION),f.y8.error(null!==(n=(0,w.MV)(r))&&void 0!==n?n:s.OG.ACCEPT_APPOINTMENT_FAILURE);case 4:return e.a(2)}},e,null,[[1,3]])}
2));return function(){return e.apply(this,arguments)}}(),J=function(){var e=(0,l.A)(I().m(function e(){return I().w(function(e){for(;;)switch(e.p=e.n){case 0:return H(b.hr.REJECTING),V(),e.p=1,e.n=2,(0,v._e)({appointmentRequestId:a.id});case 2:Y(b.Bp.REJECTED),f.y8.success(s.OG.REJECT_APPOINTMENT_SUCCESS),e.n=4;break;case 3:e.p=3,e.v,H(b.hr.NO_ACTION),f.y8.error(s.OG.REJECT_APPOINTMENT_FAILURE);case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}(),W=function(){var e=(0,l.A)(I().m(function e(){return I().w(function(e){for(;;)switch(e.p=e.n){case 0:return H(b.hr.REMOVING),Q(),e.p=1,e.n=2,(0,v.RB)(a.id);case 2:Y(b.Bp.REMOVED),f.y8.success(s.OG.REMOVE_APPOINTMENT_SUCCESS),e.n=4;break;case 3:e.p=3,e.v,H(b.hr.NO_ACTION),f.y8.error(s.OG.REMOVE_APPOINTMENT_FAILURE);case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}();return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(f.aF,{approveText:p.yes,cancelText:p.no,isModalOpen:_,actionFunc:J,closeModal:V,approveBtnColor:"danger",children:[(0,E.jsx)("p",{className:"pb-2 font-semibold",children:p.rejectDialogTitle}),(0,E.jsx)("p",{className:"small font-semibold text-gray-1.0",children:p.rejectDialogDisclaimer})]}),(0,E.jsxs)(f.aF,{approveText:p.removeAppointment,cancelText:p.cancel,isModalOpen:P,actionFunc:W,closeModal:Q,approveBtnColor:"danger",btnPosition:"mx-auto",children:[(0,E.jsx)("p",{className:"pb-2 font-semibold",children:p.removeModalTitle}),(0,E.jsx)("p",{className:"small font-semibold text-gray-1.0",children:p.removeModalDisclaimer})]}),(0,E.jsxs)("div",{className:"flex border-b border-white-3.0 px-6 pt-6 pb-4",children:[(0,E.jsx)("h3",{id:"sensitive-info",className:"my-auto",children:D}),a.status===b.Bp.SYNC_FAILED&&(0,E.jsx)("span",{className:"my-auto ml-3",children:(0,E.jsx)(C,{status:a.status,size:"small"})}),(0,E.jsx)(S,{patientName:D,phoneNumber:U,hidePhoneNumber:(0,T.qm)(a),phoneType:z}),(0,E.jsxs)("div",{className:"flex my-auto ml-auto",children:[(0,E.jsx)(f.a6,{title:F?(0,E.jsxs)("div",{className:"flex my-auto",children:[(0,E.jsx)(d.RoundDotLoading,{variant:"primary"}),(0,E.jsx)("p",{className:"ml-3 text-gray-1.0 font-semibold",children:p.removing})]}):(0,E.jsx)("p",{className:"text-gray-1.0 font-semibold my-auto",children:p.removeAppointment}),className:"px-4 py-2 mr-2",onClick:Q,tooltipMessage:p.removeAppointmentTooltip,disabled:G}),(0,E.jsx)(f.a6,{title:M?(0,E.jsxs)("div",{className:"flex my-auto",children:[(0,E.jsx)(d.RoundDotLoading,{variant:"primary"}),(0,E.jsx)("p",{className:"ml-3 text-primary-0.0 font-semibold",children:p.rejecting})]}):(0,E.jsxs)("div",{className:"flex my-auto",children:[(0,E.jsx)("i",{className:"my-auto mr-1 icon-reject_icon text-xl text-red-1.0"}),(0,E.jsx)("p",{className:"text-primary-0.0 font-semibold",children:p.reject})]}),className:"px-4 py-2 mr-2",disabled:G,onClick:V}),(0,E.jsx)(f.a6,{title:q?(0,E.jsxs)("div",{className:"flex my-auto",children:[(0,E.jsx)(d.RoundDotLoading,{variant:"primary"}),(0,E.jsx)("p",{className:"ml-3 text-primary-0.0 font-semibold",children:p.accepting})]}):(0,E.jsxs)("div",{className:"flex my-auto",children:[(0,E.jsx)("i",{className:A()("mr-1 icon-check_icon text-2xl",c?"text-white-3.0":"text-secondary-1.0")}),(0,E.jsx)("p",{className:A()("font-semibold my-auto",c?"text-white-3.0":"text-primary-1.0"),children:p.accept})]}),color:"secondary",className:"px-4 py-2",disabled:B,onClick:Z})]})]})]})};M.propTypes={appointmentRequest:O().object.isRequired,isAppointmentRequestUnacceptable:O().bool};const F=M;var G=n(96285),B=n(54625);function U(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return z(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(z(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,z(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,z(d,"constructor",l),z(l,"constructor",c),c.displayName="GeneratorFunction",z(l,a,"GeneratorFunction"),z(d),z(d,a,"Generator"),z(d,r,function(){return this}),z(d,"toString",function(){return"[object Generator]"}),(U=function(){return{w:i,m:p}})()}function z(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}z=function(e,t,n,r){function i(t,n){z(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},z(e,t,n,r)}function H(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Q=h.A,Y=[b.Bp.ACCEPTED,b.Bp.ACCEPTING],Z=function(e){if(!e)return{timeInterval:"",name:""};var t=G.c9.fromISO(e.start_time).toLocaleString(V(V({},G.c9.TIME_SIMPLE),{},{timeZoneName:"short"})),n=G.c9.fromISO(e.end_time).toLocaleString(V(V({},G.c9.TIME_SIMPLE),{},{timeZoneName:"short"}));return{timeInterval:"".concat(t," - ").concat(n),name:e.patient?"".concat(e.patient.first_name," ").concat(e.patient.last_name):""}},J=function(e,t){return 0===e.length?null:e.find(function(e){return!!e.chair&&e.chair.id===t})},W=function(e){var t=e.patientName,n=e.startTime,a=void 0===n?null:n,i=e.endTime,c=void 0===i?null:i,d=e.chairId,f=e.providerId,m=void 0===f?null:f,h=e.hasProviderConflict,x=e.hasChairConflict,b=e.handleSetProviderConflict,g=e.handleSetChairConflict,j=(0,r.useState)(null),N=(0,u.A)(j,2),O=N[0],T=N[1],_=(0,r.useState)(null),w=(0,u.A)(_,2),P=w[0],S=w[1],R=(0,r.useState)([]),C=(0,u.A)(R,2),I=C[0],D=C[1],q=(0,r.useState)([]),k=(0,u.A)(q,2),L=k[0],M=k[1],F=(0,o.F7)(),z=F.account,H=F.isStandalone,W=(0,o.hb)(),K=(0,p.Ay)(Q,{share:!0,filter:function(e){return W(e,[s.mB.APPOINTMENT_REQUEST_UPDATE])}}).lastJsonMessage,X=(0,o.Ff)(y.A),$=(0,o.Z2)(function(e){var t;return(null===(t=e.scheduling.accountSettings.appointmentRequestDuration)||void 0===t?void 0:t.value)||30}),ee=(0,r.useMemo)(function(){return G.c9.now()},[]),te=null!=a?a:ee.toISO(),ne=null!=c?c:ee.plus({minutes:$}).toISO(),re=G.c9.fromISO(te).toLocaleString(V(V({},G.c9.DATETIME_FULL),{},{weekday:"long"})),ae=G.c9.fromISO(ne).toLocaleString(G.c9.TIME_SIMPLE),ie=G.c9.fromISO(te).toLocaleString(G.c9.TIME_SIMPLE),se=G.c9.fromISO(te).set({milliseconds:0}).toISO({suppressMilliseconds:!0}),oe=G.c9.fromISO(ne).set({milliseconds:0}).toISO({suppressMilliseconds:!0}),ce=function(e,t,n){return J(e,n)||J(t,n)}(L,I,d),le=function(e,t){return e.calendar_type===s.We.BRAINHI?t.calendarConflicts:e.calendar_type===s.We.SECURECLAIM?t.agendaConflicts:t.chairConflicts}(z,X),ue=Z(O),de=ue.timeInterval,pe=ue.name,fe=Z(ce),me=fe.timeInterval,he=fe.name,xe=Z(P),ve=xe.timeInterval,be=xe.name,ye=(0,r.useCallback)((0,l.A)(U().m(function e(){var t,n,r,a;return U().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,(0,v.wF)(se,oe,d,m);case 1:t=e.v,n=t.data,T(n.prev_appointment),S(n.next_appointment),D(n.provider_conflicts),M(n.chair_conflicts),r=n.provider_conflicts.length>0,b(r),a=n.chair_conflicts.length>0,g(a),e.n=3;break;case 2:e.p=2,e.v,T(null),S(null),D([]),M([]);case 3:return e.a(2)}},e,null,[[0,2]])})),[d,m,se,oe,g,b]);return(0,r.useEffect)(function(){ye()},[ye]),(0,r.useEffect)(function(){if(K){var e=K.appointment_request;G.c9.fromISO(e.start_time).toFormat("YYYY-MM-DD")===G.c9.fromISO(te).toFormat("YYYY-MM-DD")&&Y.includes(e.status)&&ye()}},[ye,K,te]),(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"flex flex-row",children:[(0,E.jsx)("h3",{className:"text-xl",children:X.appointmentDay}),(0,E.jsx)("p",{className:"small text-gray-2.0 ml-2 self-center",children:X.allProviders})]}),(0,E.jsx)("p",{className:"mt-1 mb-5",children:re}),(0,E.jsxs)("div",{className:"flex flex-col",children:[(0,E.jsxs)("div",{className:A()("flex px-4 py-2 rounded mt-3",de?"bg-white-3.0":"border border-primary-2.0"),children:[(0,E.jsx)("p",{className:A()("text-primary-2.0 my-auto font-bold",de?"text-white-0.0":"text-primary-2.0"),children:de}),(0,E.jsx)("p",{className:A()("truncate text-primary-2.0 my-auto font-bold xl:ml-auto",pe?"text-white-0.0":"text-primary-2.0"),children:pe||X.noAppointment})]}),(0,E.jsxs)("div",{className:A()("flex xl:flex-row flex-col px-4 py-2 rounded mt-3",x?"bg-red-1.0":"bg-primary-3.0"),children:[(0,E.jsxs)("p",{className:"text-white-0.0 my-auto font-bold",children:[ie," - ",ae]}),(0,E.jsx)("p",{id:"sensitive-info",className:"truncate text-white-0.0 my-auto xl:ml-auto font-bold",children:t})]}),ce&&(0,E.jsxs)("div",{className:"flex xl:flex-row flex-col px-4 py-2 rounded mt-3 bg-white-3.0",children:[(0,E.jsx)("p",{className:"font-bold my-auto text-white-0.0",children:me}),(0,E.jsx)("p",{className:"truncate text-white-0.0 xl:ml-auto font-bold",children:he})]}),(0,E.jsxs)("div",{className:A()("flex px-4 py-2 rounded mt-3",ve?"bg-white-3.0":"border border-primary-2.0"),children:[(0,E.jsx)("p",{className:A()("text-primary-2.0 my-auto font-bold",ve?"text-white-0.0":"text-primary-2.0"),children:ve}),(0,E.jsx)("p",{className:A()("truncate font-bold text-primary-2.0 my-auto xl:ml-auto",be?"text-white-0.0":"text-primary-2.0"),children:be||X.noAppointment})]})]}),!H&&(0,E.jsx)("div",{className:"flex mt-4",children:(0,E.jsx)(B.N_,{to:"".concat(s.o2,"/appointments"),className:"ml-auto text-primary-2.0 border-b border-primary-2.0",children:X.seeAllAppointments})}),x&&(0,E.jsxs)("div",{className:"flex mx-auto mt-4",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"my-auto font-semibold",children:le})]}),h&&(0,E.jsxs)("div",{className:"flex mx-auto mt-4",children:[(0,E.jsx)("i",{className:"my-auto text-yellow-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"my-auto font-semibold",children:X.providerConflicts})]})]})};
2W.propTypes={patientName:O().string.isRequired,startTime:O().string,endTime:O().string,chairId:O().string.isRequired,providerId:O().string,hasProviderConflict:O().bool.isRequired,hasChairConflict:O().bool.isRequired,handleSetProviderConflict:O().func.isRequired,handleSetChairConflict:O().func.isRequired};const K=(0,r.memo)(W);var X=n(95093),$=n.n(X),ee=n(46005),te=n(48191),ne=n(13292),re=function(e){var t=e.appointmentRequestId,n=e.calendarDay,a=void 0===n?null:n,i=e.setAppointmentRequestDate,o=e.canClear,c=void 0!==o&&o,l=e.disabled,d=void 0!==l&&l,p=a?$()(a,$().HTML5_FMT.DATE):null,m=(0,r.useState)(!1),h=(0,u.A)(m,2),x=h[0],v=h[1];return(0,E.jsxs)("div",{className:"bh-date-picker flex",children:[(0,E.jsx)(f.K0,{onClick:function(){return v(!0)},contract:"white-0.0",icon:"icon-calendar_icon",className:"m-0",color:"secondary",disabled:d}),(0,E.jsx)(ne.SingleDatePicker,{numberOfMonths:1,id:"appointment-date-".concat(t),onDateChange:function(e){return i(e)},onFocusChange:function(e){var t=e.focused;return v(t)},focused:x,date:p,displayFormat:s.g1,placeholder:s.g1,disabled:d,showClearDate:c,reopenPickerOnClearDate:!1,small:!0})]})};re.propTypes={appointmentRequestId:O().string.isRequired,calendarDay:O().string,setAppointmentRequestDate:O().func.isRequired,canClear:O().bool,disabled:O().bool};const ae=re;function ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ie(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return ce(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ce(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,ce(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,ce(d,"constructor",l),ce(l,"constructor",c),c.displayName="GeneratorFunction",ce(l,a,"GeneratorFunction"),ce(d),ce(d,a,"Generator"),ce(d,r,function(){return this}),ce(d,"toString",function(){return"[object Generator]"}),(oe=function(){return{w:i,m:p}})()}function ce(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ce=function(e,t,n,r){function i(t,n){ce(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},ce(e,t,n,r)}var le=(0,w.n8)(15,6,18),ue=w.ki.defaultSelectStyle,de=w.ki.defaultSelectStyleWithError,pe={provider:0,name:0,chair:0,color:0,patient:0},fe=function(e){var t=e.appointmentRequestId,n=e.chair,a=void 0===n?null:n,i=e.provider,c=void 0===i?null:i,d=e.service,p=void 0===d?null:d,m=e.color,h=void 0===m?null:m,x=e.patient,N=e.potentialPatients,O=void 0===N?[]:N,T=e.startTime,_=void 0===T?null:T,A=e.endTime,P=void 0===A?null:A,S=e.isStandaloneScheduling,R=void 0!==S&&S,C=e.chairs,I=e.services,D=e.providers,q=(0,o.F7)(),k=q.account,L=q.language,M=q.isHealthcare,F=q.isStandalone,B=(0,o.Ff)(y.A),U=(0,g.Ay)().setAppointmentRequestNewValue,z=(0,o.Z2)(function(e){var t;return(null===(t=e.scheduling.accountSettings.appointmentRequestDuration)||void 0===t?void 0:t.value)||30}),H=(0,r.useState)(pe),V=(0,u.A)(H,2),Q=V[0],Y=V[1],Z=(0,r.useState)(0),J=(0,u.A)(Z,2),W=J[0],K=J[1],X=(0,r.useState)(null),ne=(0,u.A)(X,2),re=ne[0],ie=ne[1],ce=(0,r.useState)(null),fe=(0,u.A)(ce,2),xe=fe[0],ve=fe[1];(0,r.useEffect)(function(){_&&(ie(null),ve(null))},[_]);var be,ye,ge,je,Ne=k.calendar_type===s.We.OPEN_DENTAL,Oe=k.calendar_type===s.We.SECURECLAIM,Te=k.calendar_type===s.We.PRACTICE_FUSION,_e=O.length>1,Ae=a&&!a.scheduling_enabled&&F,we=(be=_,ye=P,ge=(0,w.dB)(be,ye),je=b.O9.findIndex(function(e){return e.value===ge}),b.O9[je]),Ee=function(){var e=(0,l.A)(oe().m(function e(n,r){var a,i,o,c;return oe().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=r.name,i=n.id,o=n,"end_time"===a&&(c=n.value,i=$()(_).add(c,"minutes").format(),o=i),e.p=1,Ce(a,1),e.n=2,(0,v.E_)(t,a,i);case 2:U(t,a,o),Ce(a,2),f.y8.success(s.OG.UPDATE_APPOINTMENT_SUCCESS),e.n=4;break;case 3:e.p=3,e.v,Ce(a,0),f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 4:return e.a(2)}},e,null,[[1,3]])}
2));return function(t,n){return e.apply(this,arguments)}}(),Pe=function(){var e=(0,l.A)(oe().m(function e(n,r){var a,i;return oe().w(function(e){for(;;)switch(e.p=e.n){case 0:return a="start_time",i="end_time",e.p=1,K(1),e.n=2,(0,v.bI)(t,n,r);case 2:U(t,a,n),U(t,i,r),ie(null),ve(null),K(2),setTimeout(function(){K(0)},1500),e.n=4;break;case 3:e.p=3,e.v,K(0),f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 4:return e.a(2)}},e,null,[[1,3]])}));return function(t,n){return e.apply(this,arguments)}}(),Se=function(){var e=(0,l.A)(oe().m(function e(n){var r,a,i,o,c,l;return oe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(_){e.n=4;break}if(re){e.n=1;break}return ve(n),e.a(2);case 1:if(r=(0,w.N3)({pickedDate:re,optionValue:n.value,durationMins:z,timezone:k.timezone})){e.n=2;break}return(0,te.A)({action:"first-slot",appointmentRequestId:t,timezone:k.timezone,optionValue:n.value}),e.a(2);case 2:return e.n=3,Pe(r.startTime,r.endTime);case 3:return e.a(2);case 4:if(a="start_time",i="end_time",o=(0,w.S1)({startTime:_,optionValue:n.value,durationMins:z,timezone:k.timezone})){e.n=5;break}return(0,te.A)({action:"change-time",appointmentRequestId:t,timezone:k.timezone,optionValue:n.value}),e.a(2);case 5:return c=o.startTime,l=o.endTime,e.p=6,K(1),e.n=7,(0,v.bI)(t,c,l);case 7:U(t,a,c),U(t,i,l),K(2),setTimeout(function(){K(0)},1500),e.n=9;break;case 8:e.p=8,e.v,K(0),f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 9:return e.a(2)}},e,null,[[6,8]])}));return function(t){return e.apply(this,arguments)}}(),Re=function(){var e=(0,l.A)(oe().m(function e(n){var r,a,i,o,c,l;return oe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n){e.n=2;break}if(_){e.n=1;break}return ie(null),e.a(2);case 1:return f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE),e.a(2);case 2:if(_){e.n=6;break}if(xe){e.n=3;break}return ie(n),e.a(2);case 3:if(r=(0,w.N3)({pickedDate:n,optionValue:xe.value,durationMins:z,timezone:k.timezone})){e.n=4;break}return(0,te.A)({action:"first-slot",appointmentRequestId:t,timezone:k.timezone,optionValue:xe.value}),e.a(2);case 4:return e.n=5,Pe(r.startTime,r.endTime);case 5:return e.a(2);case 6:if(a="start_time",i="end_time",o=(0,w.Fx)({startTime:_,endTime:P,pickedDate:n,timezone:k.timezone})){e.n=7;break}return(0,te.A)({action:"change-date",appointmentRequestId:t,timezone:k.timezone}),e.a(2);case 7:return c=o.startTime,l=o.endTime,e.p=8,e.n=9,(0,v.bI)(t,c,l);case 9:U(t,a,c),U(t,i,l),f.y8.success(s.OG.UPDATE_APPOINTMENT_SUCCESS),e.n=11;break;case 10:e.p=10,e.v,f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 11:return e.a(2)}},e,null,[[8,10]])}));return function(t){return e.apply(this,arguments)}}(),Ce=function(e,t){Y(function(n){return se(se({},n),{},(0,j.A)({},e,t))}),2===t&&setTimeout(function(){Y(function(t){return se(se({},t),{},(0,j.A)({},e,0))})},2e3)},Ie=_?(0,w.zj)(_,k.timezone):(null==xe?void 0:xe.value)||"",De=P?(0,w.zj)(P,k.timezone):"",qe=_?(0,w.eM)(_,k.timezone):(null==re?void 0:re.format($().HTML5_FMT.DATE))||null,ke=B.chair,Le=B.noChair,Me=B.selectChair,Fe=B.services,Ge=B.noService,Be=B.selectService,Ue=M?B.patient:B.client;return Oe&&(ke=B.agenda,Le=B.noAgenda),Te&&(ke=B.facility,Le=B.noFacility,Fe=B.appointmentType,Ge=B.noAppointmentType,Be
2=B.selectAppointmentType,Me=B.selectFacility),R&&(ke=B.calendar,Le=L.noCalendar,Me=B.selectCalendar),(0,E.jsxs)(E.Fragment,{children:[R&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[B.appointmentDate,":"]}),(0,E.jsx)("div",{id:"sensitive-info",className:"-mx-2",children:(0,E.jsx)(ae,{appointmentRequestId:t,calendarDay:qe,setAppointmentRequestDate:Re,canClear:!_})}),(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mt-6 mb-1",children:[B.appointmentTime,":"]}),(0,E.jsxs)("div",{className:"mb-3",id:"sensitive-info",children:[(0,E.jsx)(ee.Ay,{value:le.find(function(e){return e.value===Ie}),options:le,components:{IndicatorSeparator:function(){return he(W)}},styles:de(!Ie),placeholder:B.selectHour,getOptionValue:function(e){return e.value},getOptionLabel:function(e){return e.value},onChange:Se,className:"w-3/4"}),!Ie&&(0,E.jsxs)("div",{className:"flex mt-1 ml-1",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"small my-auto font-semibold",children:B.noTime})]}),!_&&(re||xe)&&(0,E.jsx)("p",{className:"small text-gray-2.0 mt-1",children:B.pickBothDateAndTime})]})]}),(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[ke,":"]}),(0,E.jsx)(ee.Ay,{value:a,options:C,components:{IndicatorSeparator:function(){return he(Q.chair)}},getOptionLabel:function(e){return e.name},getOptionValue:function(e){return e.id},isSearchable:!1,styles:de(!a||Ae),placeholder:Me,onChange:Ee,name:"chair"}),!a&&(0,E.jsxs)("div",{className:"flex mt-1 ml-1",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"small my-auto font-semibold",children:Le})]}),Ae&&(0,E.jsxs)("div",{className:"flex mt-1 ml-1",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"small my-auto font-semibold",children:B.chairDisabled})]}),(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mt-6 mb-1",children:[B.providers,":"]}),(0,E.jsx)(ee.Ay,{value:c,options:D,components:{IndicatorSeparator:function(){return he(Q.provider)}},getOptionValue:function(e){return e.id},getOptionLabel:function(e){return e.display_name||e.calendar_name},isSearchable:!1,styles:de(!c),placeholder:B.selectProvider,onChange:Ee,name:"provider"}),!c&&(0,E.jsxs)("div",{className:"flex mt-1 ml-1",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"small my-auto font-semibold",children:B.noProvider})]}),!R&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mt-6 mb-1",children:[Fe,":"]}),(0,E.jsx)(ee.Ay,{value:p,options:I,components:{IndicatorSeparator:function(){return he(Q.service)}},getOptionLabel:function(e){return e.display_name||e.name},getOptionValue:function(e){return e.id},isSearchable:!1,placeholder:Be,onChange:Ee,name:"service",styles:de(!p&&Oe)}),_e&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mt-6 mb-1",children:[Ue,":"]}),(0,E.jsx)(ee.Ay,{value:x,options:O,components:{IndicatorSeparator:function(){return he(Q.patient)}},getOptionLabel:function(e){return function(e){var t="ID";Ne&&(t="PatNum");var n=G.c9.fromISO(e.date_of_birth).toLocaleString(G.c9.DATE_MED);return"".concat(e.first_name," ").concat(e.last_name," (").concat(t,": ").concat(e.calendar_id,", DOB: ").concat(n,")")}(e)},getOptionValue:function(e){return e.id},isSearchable:!1,onChange:Ee,styles:de(!x),name:"patient"})]}),!p&&Oe&&(0,E.jsxs)("div",{className:"flex mt-1 ml-1",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"small my-auto font-semibold",children:Ge})]})]}),(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mt-6 mb-1",children:[B.appointmentDuration,":"]}),(0,E.jsx)(ee.Ay,{className:"w-28",components:{IndicatorSeparator:function(){return he(Q.end_time)}},value:we,options:b.O9,isSearchable:!1,getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},styles:ue,onChange:Ee,name:"end_time"}),Ie&&De&&(0,E.jsxs)("p",{className:"small text-gray-2.0 font-semibold mt-1 ml-1",children:[Ie," - ",De]}
2),!Oe&&!Te&&!R&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mt-6 mb-1",children:[B.colors,":"]}),(0,E.jsx)(ee.Ay,{className:"w-24",components:{IndicatorSeparator:function(){return he(Q.color)}},placeholder:"Color",value:h,options:[],getOptionValue:function(e){return e.id},isSearchable:!1,styles:ue,formatOptionLabel:me,onChange:Ee,name:"color"})]})]})},me=function(e){var t=e?e.hex:"#FFFFFF";return(0,E.jsx)("div",{className:"flex",children:(0,E.jsx)("div",{className:"border-medium-gray w-4 h-4 border rounded-full",style:{backgroundColor:t}})})},he=function(e){return 1===e?(0,E.jsx)(d.RoundDotLoading,{variant:"secondary"}):2===e?(0,E.jsx)("i",{className:"text-secondary-1.0 icon-check_icon text-xl"}):null};fe.propTypes={appointmentRequestId:O().string.isRequired,chair:O().object,provider:O().object,service:O().object,color:O().object,patient:O().object.isRequired,potentialPatients:O().array,startTime:O().string,endTime:O().string,isStandaloneScheduling:O().bool,chairs:O().array.isRequired,services:O().array.isRequired,providers:O().array.isRequired};const xe=fe;var ve=n(74812),be=n(24523);function ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ge(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var je=function(e){var t,n,r,a,i,c=e.dateOfBirth,l=e.startTime,u=void 0===l?null:l,d=e.preferredWeekdays,p=void 0===d?[]:d,m=e.preferredTimeOfDay,h=void 0===m?null:m,x=e.isNewPatient,v=e.phones,b=e.hidePhone,g=void 0!==b&&b,j=e.insuranceName,N=e.gender,O=e.isGenderCollected,_=void 0!==O&&O,A=e.reason,w=e.isTelemedicine,P=e.email,S=void 0===P?"":P,R=e.groupNumber,C=void 0===R?"":R,I=e.planNumber,D=void 0===I?"":I,q=(0,o.F7)().account,k=(0,ve.F)(y.A),L=(null===(t=q.company_industry)||void 0===t?void 0:t.name)!==s.hX.HEALTH_INSURANCE,M=(0,o.Z2)(function(e){return e.scheduling}).schedulingLinkSettings,F=M.is_new_patient_enabled,B=M.is_insurance_enabled,U=M.is_date_of_birth_enabled,z=M.is_email_enabled,H=Boolean(u),V=H?"":(0,be.A)(p,h,k),Q=H?"":V||k.noDateAssigned,Y=V?k.preferredTimingLabel:"".concat(k.appointmentDate,":"),Z=H?(r=(n=G.c9.fromISO(u)).setZone(q.timezone),a=function(e){return e.toLocaleString(ge(ge({},G.c9.TIME_SIMPLE),{},{timeZoneName:"short"}))},{localDate:(i=function(e){return e.toLocaleString(ge({},G.c9.DATE_MED))})(n),localTime:a(n),accountDate:i(r),accountTime:a(r)}):null,J=H?Z.localDate:Q,W=H?Z.localTime:"",K=H?Z.accountDate:"",X=H?Z.accountTime:"",$=q.has_live_agent_support,ee=v.length>0?v[0].number:null,te=c?G.c9.fromISO(c).toLocaleString(G.c9.DATE_MED):k.noDateOfBirth,ne=x?k.yes:k.no,re=C||k.none,ae=D||k.none,ie=j||k.none,se=(0,T.Ay)(N,_,k),oe=Boolean(se),ce=w?k.yes:k.no,le=S||k.none,ue=k.newPatient;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsx)("p",{className:"small font-bold text-gray-1.0 mb-1",children:Y}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{id:"sensitive-info",children:J}),H&&$&&J!==K?(0,E.jsx)("p",{id:"sensitive-info",className:"text-gray-2.0",children:"(".concat(K," ").concat(k.inAccountTimezone,")")}):null]})]}),H&&(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.appointmentTime,":"]}),(0,E.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,E.jsx)("p",{id:"sensitive-info",children:"".concat(W," ").concat(k.inLocalTimezone)}),$&&W!==X?(0,E.jsx)("p",{id:"sensitive-info",className:"text-gray-2.0",children:"(".concat(X," ").concat(k.inAccountTimezone,")")}):null]})]})]}),(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.phone,":"]}),(0,E.jsx)("span",{children:g&&ee?(0,E.jsx)(f.$7,{phoneNumber:ee,hiddenLabel:k.phoneHiddenUntilAccepted}):ee})]}),U?(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.dateOfBirth,":"]}),(0,E.jsx)("p",{children:te})]}):null]}),(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[oe?(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.gender,":"]}),(0,E.jsx)("p",{children:se})]}):null,F?(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[ue,":"]}
2),(0,E.jsx)("p",{children:ne})]}):null]}),B&&L&&(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.insurance,":"]}),(0,E.jsx)("p",{children:ie})]}),(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.insuranceNumber,":"]}),(0,E.jsx)("p",{children:ae})]})]}),(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[B&&L?(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.insuranceGroup,":"]}),(0,E.jsx)("p",{children:re})]}):null,q.has_telemedicine&&(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.telemedicine,":"]}),(0,E.jsx)("p",{children:ce})]})]}),z?(0,E.jsx)("div",{className:"flex pb-8",children:(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.email,":"]}),(0,E.jsx)("p",{children:le})]})}):null,(0,E.jsx)("div",{className:"border-t border-white-3.0",children:(0,E.jsxs)("div",{className:"flex-col mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[k.appointmentReason,":"]}),(0,E.jsx)("p",{children:A})]})})]})};je.propTypes={hidePhone:O().bool,dateOfBirth:O().string.isRequired,startTime:O().string,preferredWeekdays:O().arrayOf(O().number),preferredTimeOfDay:O().number,isNewPatient:O().bool.isRequired,phones:O().array.isRequired,insuranceName:O().string.isRequired,gender:O().number.isRequired,isGenderCollected:O().bool,reason:O().string.isRequired,isTelemedicine:O().bool.isRequired,email:O().string,groupNumber:O().string,planNumber:O().string};const Ne=(0,r.memo)(je);function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Te(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Oe(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var _e={hasProviderConflict:!1,hasChairConflict:!1},Ae=function(e){var t,n=e.appointmentRequest,a=e.chairs,i=e.services,c=e.providers,l=(0,r.useState)(_e),d=(0,u.A)(l,2),p=d[0],f=d[1],m=p.hasProviderConflict,h=p.hasChairConflict,x="".concat(n.first_name," ").concat(n.last_name),v=(0,o.F7)().account,b=(0,o.Ff)(y.A),g=!n.service&&v.calendar_type===s.We.SECURECLAIM,j=!n.chair||!n.provider||h||g,N=(0,r.useCallback)(function(e){f(function(t){return Te(Te({},t),{},{hasProviderConflict:e})})},[]),O=(0,r.useCallback)(function(e){f(function(t){return Te(Te({},t),{},{hasChairConflict:e})})},[]);return(0,E.jsxs)("div",{className:"mt-10 rounded border border-white-3.0",id:n.id,children:[(0,E.jsx)(F,{appointmentRequest:n,isAppointmentRequestUnacceptable:j}),(0,E.jsxs)("div",{className:"xl:px-6 flex px-4",children:[(0,E.jsx)("div",{className:"w-35/100 xl:pr-6 py-6 pr-4",children:(0,E.jsx)(Ne,{dateOfBirth:n.date_of_birth,startTime:n.start_time,preferredWeekdays:n.preferred_weekdays,preferredTimeOfDay:n.preferred_time_of_day,isNewPatient:n.is_new_patient,phones:n.patient.phones,hidePhone:(0,T.qm)(n),insuranceName:n.insurance_name,groupNumber:n.group_number,planNumber:n.plan_number,gender:n.gender,isGenderCollected:n.gender_collected,reason:n.reason,isTelemedicine:n.is_telemedicine,email:n.patient.email})}),(0,E.jsx)("div",{className:"w-30/100 py-6 border-r border-l border-white-3.0 xl:px-6 px-4",children:(0,E.jsx)(xe,{color:n.color,startTime:n.start_time,appointmentRequestId:n.id,chair:n.chair,provider:n.provider,service:n.service,endTime:n.end_time,patient:n.patient,potentialPatients:n.potential_patients,chairs:a,services:i,providers:c})}),(0,E.jsxs)("div",{className:"w-35/100 xl:px-6 px-4 py-6",children:[n.chair&&(0,E.jsx)(K,{startTime:n.start_time,endTime:n.end_time,chairId:n.chair.id,patientName:x,providerId:(null===(t=n.provider)||void 0===t?void 0:t.id)||null,hasProviderConflict:m,hasChairConflict:h,handleSetProviderConflict:N,handleSetChairConflict:O}),!n.chair&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"flex flex-row",children:(0,E.jsx)("h3",{className:"text-xl",children:b.appointmentDay})}),(0,E.jsx)("p",{className:"self-center mt-4",children:b.appointmentDayError})]})]})]})]})};Ae.propTypes={appointmentRequest:O().object.isRequired,chairs:O().array.isRequired,services:O().array.isRequired,providers:O().array.isRequired};const we=(0,r.memo)(Ae);function Ee(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return Pe(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Pe(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Pe(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,Pe(d,"constructor",l),Pe(l,"constructor",c),c.displayName="GeneratorFunction",Pe(l,a,"GeneratorFunction"),Pe(d),Pe(d,a,"Generator"),Pe(d,r,function(){return this}),Pe(d,"toString",function(){return"[object Generator]"}),(Ee=function(){return{w:i,m:p}})()}function Pe(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Pe=function(e,t,n,r){function i(t,n){Pe(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Pe(e,t,n,r)}var Se=w.ki.defaultSelectStyleWithError,Re=(0,w.n8)(15,6,18),Ce=function(e){return 1===e?(0,E.jsx)(d.RoundDotLoading,{variant:"secondary"}):2===e?(0,E.jsx)("i",{className:"text-secondary-1.0 icon-check_icon text-xl"}):null},Ie=function(e){var t,n=e.appointmentRequest,a=e.providers,i=(0,g.Ay)().setAppointmentRequestNewValue,c=(0,o.Z2)(function(e){return e.scheduling.accountSettings.appointmentRequestDuration.value||30}),d=(0,o.Z2)(function(e){return e.scheduling}).schedulingLinkSettings,p=d.is_new_patient_enabled,m=d.is_insurance_enabled,h=d.is_date_of_birth_enabled,x=d.is_email_enabled,b=(0,o.F7)().account,j=(null===(t=b.company_industry)||void 0===t?void 0:t.name)===s.hX.HEALTHCARE,N=(0,r.useState)(0),O=(0,u.A)(N,2),_=O[0],A=O[1],P=(0,r.useState)(0),S=(0,u.A)(P,2),R=S[0],C=S[1],I=(0,ve.F)(y.A),D=(0,w.zj)(n.start_time,b.timezone),q=(0,w.eM)(n.start_time,b.timezone),k=!n.start_time,L=$()(n.created_at).format(s.g1),M=n.patient,G=M.phones,B=M.email,U=n.provider,z=G.length>0?G[0].number:null,H=n.date_of_birth?$()(n.date_of_birth,"YYYY-MM-DD").format(s.g1):I.noDateOfBirth,V=(0,T.Ay)(n.gender,n.gender_collected,I),Q=Boolean(V),Y=n.group_number||I.none,Z=n.plan_number||I.none,J=n.insurance_name||I.none,W=n.is_new_patient?I.yes:I.no,K=n.is_telemedicine?I.yes:I.no,X=B||I.none,ne=I.newPatient,re=function(){var e=(0,l.A)(Ee().m(function e(t){var r,a,o,l,u;return Ee().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n.start_time){e.n=1;break}return f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE),e.a(2);case 1:if(r="start_time",a="end_time",o=(0,w.S1)({startTime:n.start_time,optionValue:t.value,durationMins:c,timezone:b.timezone})){e.n=2;break}return(0,te.A)({action:"change-time",appointmentRequestId:n.id,timezone:b.timezone,optionValue:t.value}),e.a(2);case 2:return l=o.startTime,u=o.endTime,e.p=3,A(1),e.n=4,(0,v.bI)(n.id,l,u);case 4:i(n.id,r,l),i(n.id,a,u),A(2),setTimeout(function(){A(0)},1500),e.n=6;break;case 5:e.p=5,e.v,A(0),f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 6:return e.a(2)}},e,null,[[3,5]])}));return function(t){return e.apply(this,arguments)}}(),ie=function(){var e=(0,l.A)(Ee().m(function e(t){var r,a,o,c,l;return Ee().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t&&n.start_time){e.n=1;break}return f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE),e.a(2);case 1:if(r="start_time",a="end_time",o=(0,w.Fx)({startTime:n.start_time,endTime:n.end_time,pickedDate:t,timezone:b.timezone})){e.n=2;break}return(0,te.A)({action:"change-date",appointmentRequestId:n.id,timezone:b.timezone}),e.a(2);case 2:return c=o.startTime,l=o.endTime,e.p=3,e.n=4,(0,v.bI)(n.id,c,l);case 4:i(n.id,r,c),i(n.id,a,l),f.y8.success(s.OG.UPDATE_APPOINTMENT_SUCCESS),e.n=6;break;case 5:e.p=5,e.v,f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 6:return e.a(2)}},e,null,[[3,5]])}));return function(t){return e.apply(this,arguments)}}(),se=function(){var e=(0,l.A)(Ee().m(function e(t,r){var a,o,c;return Ee().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=r.name,o=t.id,c=t,e.p=1,C(1),e.n=2,(0,v.E_)(n.id,a,o);case 2:i(n.id,a,c),C(2),f.y8.success(s.OG.UPDATE_APPOINTMENT_SUCCESS),e.n=4;break;case 3:e.p=3,e.v,C(0),f.y8.error(s.OG.UPDATE_APPOINTMENT_FAILURE);case 4:return e.a(2)}},e,null,[[1,3]])}
2));return function(t,n){return e.apply(this,arguments)}}();return(0,E.jsxs)("div",{className:"mt-10 rounded border border-white-3.0",id:n.id,children:[(0,E.jsx)(F,{appointmentRequest:n}),(0,E.jsxs)("div",{className:"flex px-6 pb-6",children:[(0,E.jsxs)("div",{className:"flex flex-wrap w-3/4",children:[(0,E.jsxs)("div",{className:"xl:w-1/4 flex-col w-1/3 mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.appointmentDate,":"]}),(0,E.jsx)("div",{id:"sensitive-info",className:"-mx-2",children:(0,E.jsx)(ae,{appointmentRequestId:n.id,calendarDay:q,setAppointmentRequestDate:ie,disabled:k})})]}),h?(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.dateOfBirth,":"]}),(0,E.jsx)("p",{children:H})]}):null,Q?(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.gender,":"]}),(0,E.jsx)("p",{children:V})]}):null,p?(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[ne,":"]}),(0,E.jsx)("p",{children:W})]}):null,x?(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.email,":"]}),(0,E.jsx)("p",{children:X})]}):null,(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.appointmentTime,":"]}),(0,E.jsx)("div",{id:"sensitive-info",children:(0,E.jsx)(ee.Ay,{value:Re.find(function(e){return e.value===D})||null,options:Re,isDisabled:k,components:{IndicatorSeparator:function(){return Ce(_)}},styles:Se(!D&&!k),placeholder:I.selectHour,getOptionValue:function(e){return e.value},getOptionLabel:function(e){return e.value},onChange:re,className:"w-3/4"})}),D?null:(0,E.jsxs)("div",{className:"flex mt-1 ml-1",children:[(0,E.jsx)("i",{className:"my-auto text-red-1.0 icon-alert_icon mr-1"}),(0,E.jsx)("p",{className:"small my-auto font-semibold",children:I.noTime})]})]}),(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.phone,":"]}),(0,E.jsx)("span",{children:(0,T.qm)(n)&&z?(0,E.jsx)(f.$7,{phoneNumber:z,hiddenLabel:I.phoneHiddenUntilAccepted}):z})]}),(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.requestedDate,":"]}),(0,E.jsx)("p",{id:"sensitive-info",children:L})]}),b.has_telemedicine&&(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.telemedicine,":"]}),(0,E.jsx)("p",{children:K})]}),(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.providers,":"]}),(0,E.jsx)(ee.Ay,{value:U,options:a,components:{IndicatorSeparator:function(){return Ce(R)}},getOptionValue:function(e){return e.id},getOptionLabel:function(e){return e.display_name||e.calendar_name},isSearchable:!1,styles:Se(!U),placeholder:I.selectProvider,onChange:se,name:"provider",className:"w-3/4"})]}),m&&j?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.insurance,":"]}),(0,E.jsx)("p",{className:"break-words",children:J})]}),(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.insuranceNumber,":"]}),(0,E.jsx)("p",{className:"break-words",children:Z})]}),(0,E.jsxs)("div",{className:"xl:w-1/4 w-1/3 mt-8",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.insuranceGroup,":"]}),(0,E.jsx)("p",{className:"break-words",children:Y})]})]}):null]}),(0,E.jsxs)("div",{className:"w-1/4 mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[I.appointmentReason,":"]}),(0,E.jsx)("p",{id:"sensitive-info",className:"break-words",children:n.reason})]})]})]})};Ie.propTypes={appointmentRequest:O().object.isRequired,providers:O().array.isRequired};const De=(0,r.memo)(Ie);function qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?qe(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Le={hasProviderConflict:!1,hasChairConflict:!1},Me=function(e){var t,n,a=e.appointmentRequest,i=e.chairs,c=e.services,l=e.providers,d=(0,o.F7)().account,p=(null===(t=d.company_industry)||void 0===t?void 0:t.name)===s.hX.HEALTHCARE,m=(0,o.Z2)(function(e){return e.scheduling}).schedulingLinkSettings,h=(0,r.useState)(Le),x=(0,u.A)(h,2),v=x[0],b=x[1],g=v.hasProviderConflict,j=v.hasChairConflict,N=m.is_new_patient_enabled,O=m.is_insurance_enabled,_=m.is_date_of_birth_enabled,A=m.is_email_enabled,w=i.filter(function(e){return e.scheduling_enabled}),P=(0,ve.F)(y.A),S=(0,T.Ay)(a.gender,a.gender_collected,P),R=Boolean(S),C="".concat(a.first_name," ").concat(a.last_name),I=a.patient.phones.length>0?a.patient.phones[0].number:null,D=Boolean(I)&&(0,T.qm)(a),q=a.date_of_birth?G.c9.fromISO(a.date_of_birth).toLocaleString(G.c9.DATE_MED):P.noDateOfBirth,k=a.is_new_patient?P.yes:P.no,L=a.insurance_name||P.none,M=a.is_telemedicine?P.yes:P.no,B=a.patient.email||P.none,U=P.newPatient,z=w.length>0&&(!a.chair||!a.chair.scheduling_enabled||j),H=(0,r.useCallback)(function(e){b(function(t){return ke(ke({},t),{},{hasProviderConflict:e})})},[]),V=(0,r.useCallback)(function(e){b(function(t){return ke(ke({},t),{},{hasChairConflict:e})})},[]);return(0,E.jsxs)("div",{className:"mt-10 rounded border border-white-3.0",id:a.id,children:[(0,E.jsx)(F,{appointmentRequest:a,isAppointmentRequestUnacceptable:z}),(0,E.jsxs)("div",{className:"xl:px-6 flex px-4",children:[(0,E.jsxs)("div",{className:"w-35/100 xl:pr-6 py-6 pr-4",children:[(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.phone,":"]}),(0,E.jsx)("span",{children:D?(0,E.jsx)(f.$7,{phoneNumber:I,hiddenLabel:P.phoneHiddenUntilAccepted}):I})]}),_?(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.dateOfBirth,":"]}),(0,E.jsx)("p",{children:q})]}):null]}),(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[R?(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.gender,":"]}),(0,E.jsx)("p",{children:S})]}):null,N?(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[U,":"]}),(0,E.jsx)("p",{children:k})]}):null]}),(0,E.jsxs)("div",{className:"flex justify-between pb-8",children:[O&&p?(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.insurance,":"]}),(0,E.jsx)("p",{children:L})]}):null,d.has_telemedicine&&(0,E.jsxs)("div",{className:"flex-col w-1/3",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.telemedicine,":"]}),(0,E.jsx)("p",{children:M})]})]}),A?(0,E.jsx)("div",{className:"flex pb-8",children:(0,E.jsxs)("div",{className:"flex-col w-1/2",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.email,":"]}),(0,E.jsx)("p",{children:B})]})}):null,(0,E.jsx)("div",{className:"border-t border-white-3.0",children:(0,E.jsxs)("div",{className:"flex-col mt-6",children:[(0,E.jsxs)("p",{className:"small font-bold text-gray-1.0 mb-1",children:[P.appointmentReason,":"]}),(0,E.jsx)("p",{children:a.reason})]})})]}),(0,E.jsx)("div",{className:"w-30/100 py-6 border-r border-l border-white-3.0 xl:px-6 px-4",children:(0,E.jsx)(xe,{startTime:a.start_time,appointmentRequestId:a.id,chair:a.chair,provider:a.provider,endTime:a.end_time,patient:a.patient,isStandaloneScheduling:!0,chairs:i,services:c,providers:l})}),(0,E.jsxs)("div",{className:"w-35/100 xl:px-6 px-4 py-6",children:[a.chair&&(0,E.jsx)(K,{startTime:a.start_time,endTime:a.end_time,chairId:a.chair.id,patientName:C,providerId:null===(n=a.provider)||void 0===n?void 0:n.id,hasProviderConflict:g,hasChairConflict:j,handleSetProviderConflict:H,handleSetChairConflict:V}),!a.chair&&(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("div",{className:"flex flex-row",children:(0,E.jsx)("h3",{className:"text-xl",children:P.appointmentDay})}),(0,E.jsx)("p",{className:"self-center mt-4",children:P.appointmentDayErrorStandalone})]})]})]})]})};Me.propTypes={appointmentRequest:O().object.isRequired,chairs:O().array.isRequired,services:O().array.isRequired,providers:O().array.isRequired};const Fe=(0,r.memo)(Me);function Ge(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return Be(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Be(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,Be(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,Be(d,"constructor",l),Be(l,"constructor",c),c.displayName="GeneratorFunction",Be(l,a,"GeneratorFunction"),Be(d),Be(d,a,"Generator"),Be(d,r,function(){return this}),Be(d,"toString",function(){return"[object Generator]"}),(Ge=function(){return{w:i,m:p}})()}function Be(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Be=function(e,t,n,r){function i(t,n){Be(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Be(e,t,n,r)}var Ue=h.A,ze="-created_at";const He=function(){var e=(0,a.W6)(),t=(0,a.zy)().hash,n=(0,r.useState)(!1),c=(0,u.A)(n,2),h=c[0],j=c[1],N=(0,r.useState)(!0),O=(0,u.A)(N,2),T=O[0],_=O[1],A=(0,r.useState)(!1),w=(0,u.A)(A,2),P=w[0],S=w[1],R=(0,r.useState)([]),C=(0,u.A)(R,2),I=C[0],D=C[1],q=(0,r.useState)([]),k=(0,u.A)(q,2),L=k[0],M=k[1],F=(0,r.useState)([]),G=(0,u.A)(F,2),B=G[0],U=G[1],z=(0,o.F7)().isStandalone,H=(0,o.Ff)(y.A),V=(0,o.Z2)(function(e){var t=e.scheduling;return{appointmentRequests:t.appointmentRequests,counters:t.counters,hasNextPage:t.hasNextPage,shouldFetchMore:t.shouldFetchMore}}),Q=V.appointmentRequests,Y=V.counters,Z=V.hasNextPage,J=V.shouldFetchMore,W=(0,o.hb)(),K=(0,g.Ay)(),X=K.setAppointmentRequests,$=K.setAppointmentRequestsNextPage,ee=K.setAppointmentRequestCounters,te=K.setAdditionalAppointmentRequest,ne=K.updateAppointmentRequest,re=K.setSchedulingLinkSettings,ae=(0,p.Ay)(Ue,{share:!0,filter:function(e){return W(e,[s.mB.APPOINTMENT_REQUEST_UPDATE])}}).lastJsonMessage,ie=I.filter(function(e){return e.scheduling_enabled}),se=z&&ie.length>0,oe=Y.pending,ce=function(){e.push("".concat(s.o2,"/scheduling/").concat(b.gR.APPOINTMENT_REQUEST_HISTORY))},le=function(){var e=(0,l.A)(Ge().m(function e(){var t,n,r,a;return Ge().w(function(e){for(;;)switch(e.p=e.n){case 0:return S(!0),e.p=1,e.n=2,(0,v.bR)({status:b.X3.join(","),ordering:ze,offset:Q.length});case 2:t=e.v,n=t.data,r=n.results,a=n.count,$({results:r,count:a}),e.n=4;break;case 3:e.p=3,e.v,j(!0);case 4:return e.p=4,S(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}();if((0,r.useEffect)(function(){var e=function(){var e=(0,l.A)(Ge().m(function e(){var t,n,r,a,i,s,o;return Ge().w(function(e){for(;;)switch(e.p=e.n){case 0:return _(!0),e.p=1,e.n=2,Promise.all([(0,v.bR)({status:b.X3.join(","),ordering:ze}),(0,v.RN)(),(0,m.to)(),(0,m.jg)(),(0,m.v2)()]);case 2:t=e.v,n=(0,u.A)(t,5),r=n[0].data,a=n[1].data,i=n[2].data,s=n[3].data,o=n[4].data,X(r),ee(a),D(i),M(s),U(o),e.n=4;break;case 3:e.p=3,e.v,j(!0);case 4:return e.p=4,_(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(){return e.apply(this,arguments)}}();e()},[X,ee]),(0,r.useEffect)(function(){var e=function(){var e=(0,l.A)(Ge().m(function e(){var t;return Ge().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,x._O)();case 1:t=e.v,re(t);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();e()},[re]),(0,r.useEffect)(function(){if(J){var e=!1,t=function(){var t=(0,l.A)(Ge().m(function t(){var n,r,a,i;return Ge().w(function(t){for(;;)switch(t.p=t.n){case 0:return S(!0),t.p=1,t.n=2,(0,v.bR)({status:b.X3.join(","),ordering:ze,offset:Q.length});case 2:if(n=t.v,r=n.data,a=r.results,i=r.count,!e){t.n=3;break}return t.a(2);case 3:te({appointmentRequest:a[0],count:i}),t.n=5;break;case 4:t.p=4,t.v,e||j(!0);case 5:e||S(!1);case 6:return t.a(2)}},t,null,[[1,4]])}));return function(){return t.apply(this,arguments)}}();return t(),function(){e=!0}}},[J,Q,te]),(0,r.useEffect)(function(){if(ae){var e=ae.appointment_request,t=ae.is_created;ne(e,t)}},[ae,ne]),(0,r.useEffect)(function(){var e=t.slice(1);Q.find(function(t){return t.id===e})&&setTimeout(function(){i.XG.scrollTo(e,{containerId:"appointmentRequestContainer",smooth:!0,offset:-16}
2)},1e3)},[t,Q]),h)return(0,E.jsx)(f.M,{});if(T)return(0,E.jsx)(d.DotBricksLoading,{});if(0===Q.length)return(0,E.jsxs)("div",{className:"flex flex-col flex-grow overflow-y-auto",children:[(0,E.jsx)("i",{className:"icon-waves text-10xl text-secondary-1.0 -mt-16 ml-auto"}),(0,E.jsxs)("div",{className:"flex flex-col justify-center flex-grow text-center",children:[(0,E.jsx)("div",{className:"mb-16 text-3xl",children:H.noAppointmentLeft}),(0,E.jsx)("div",{className:"mb-24 text-lg",children:H.noAppointmentLeftSubt}),(0,E.jsxs)("div",{className:"flex mx-auto",children:[(0,E.jsx)(f.dZ,{to:"/overview",title:H.returnToHome}),(0,E.jsx)(d.Button,{className:"ml-5",onClick:ce,variant:"primary",text:H.seeHistory})]})]})]});var ue=we;return z&&(ue=se?Fe:De),(0,E.jsxs)("div",{className:"xl:px-6 px-4 py-12",children:[(0,E.jsxs)("div",{className:"flex",children:[(0,E.jsx)("h2",{className:"ml-6",children:H.requests}),(0,E.jsxs)("p",{className:"ml-2 mt-auto text-gray-1.0 font-bold",children:[oe," ",oe>1?H.pendingRequests:H.pendingRequest]}),(0,E.jsx)("div",{className:"my-auto ml-auto",children:(0,E.jsx)("p",{className:"text-primary-3.0 border-b border-primary-3.0 cursor-pointer",onClick:ce,children:H.seeHistory})})]}),Q.map(function(e){return(0,E.jsx)(ue,{appointmentRequest:e,chairs:I,services:L,providers:B},e.id)}),Z&&(0,E.jsx)("div",{className:"flex flex-col items-center w-full",children:P?(0,E.jsx)(d.RoundDotLoading,{className:"mt-2"}):(0,E.jsx)(d.Button,{size:"small",text:H.loadMore,onClick:le})})]})};var Ve=n(64890),Qe=n(32885);function Ye(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ze(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ye(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Je=[s.W1.BOT,s.W1.OFFICE_AT_CALENDAR],We=function(e){var t=e.loading,n=e.columns,a=e.data,i=e.fetchData,c=(0,o.F7)(),l=c.account,p=c.isHealthcare,m=null==l?void 0:l.timezone,h=(0,o.Ff)(y.A),x=(0,g.Ay)().setSortBy,v=(0,o.Z2)(function(e){return e.scheduling}),j=(v.appointmentRequestHistoryView,v.pageCount),N=v.pageIndex,O=v.sortBy,_=p?h.noPatient:h.noClient,P=(0,Qe.useTable)({columns:n,data:a,initialState:{pageSize:s.Hn,pageIndex:N,sortBy:O},autoResetPage:!1,autoResetSortBy:!1,manualPagination:!0,manualSortBy:!0,pageCount:j,useControlledState:function(e){return(0,r.useMemo)(function(){return Ze(Ze({},e),{},{pageIndex:N,sortBy:O})},[e,O])}},Qe.useSortBy,Qe.usePagination),S=P.getTableProps,R=P.getTableBodyProps,I=P.headerGroups,D=P.page,q=P.prepareRow;(0,r.useEffect)(function(){i({pageIndex:N,sortBy:O})},[i,O,N]);var k=function(e){var t=e.patient,n=e.hidePhone;if(!t)return(0,E.jsx)("div",{className:"flex flex-col p-2",children:(0,E.jsx)("p",{className:"font-semibold",children:_})});var r=null;t.phones.length>0&&(r=(0,u.A)(t.phones,1)[0]);var a="".concat(t.first_name," ").concat(t.last_name),i=h.noPhone;if(n&&r)i=(0,E.jsx)(f.$7,{phoneNumber:r.number,hiddenLabel:h.phoneHiddenUntilAccepted});else if(r){var o=(0,d.getFormattedPhoneNumber)(r.number),c=r.phone_type===s.YP.MOBILE?h.phoneTypeMobile:h.phoneTypeLandline;i="".concat(o," (").concat(c,")")}return(0,E.jsxs)("div",{className:"flex flex-col p-2",children:[(0,E.jsx)("p",{id:"sensitive-info",className:"font-semibold",children:a}),(0,E.jsx)("span",{className:"whitespace-nowrap text-gray-1.0 font-semibold",children:i})]})},L=function(e){var t=e.startTime,n=e.preferredWeekdays,r=e.preferredTimeOfDay;if(!t){var a=(0,be.A)(null!=n?n:[],r,h);return(0,E.jsx)("div",{className:"flex flex-col p-2",children:(0,E.jsx)("p",{className:"whitespace-nowrap font-medium",children:a||h.noDateAssigned})})}return(0,E.jsxs)("div",{className:"flex flex-col p-2",children:[(0,E.jsx)("p",{className:"whitespace-nowrap font-medium",children:(0,w.ut)(t,m,s.YB)}),(0,E.jsx)("p",{className:"whitespace-nowrap text-gray-1.0",children:(0,w.ut)(t,m,s.G$)})]})},M=function(e){var t=e.reason;return(0,E.jsx)("p",{className:"p-2",children:t})},F=function(e){var t=e.createdAt;return(0,E.jsx)("div",{id:"sensitive-info",className:"whitespace-nowrap p-2",children:(0,w.ut)(t,m,s.YB)})},G=function(e){var t=e.status;return(0,E.jsx)("div",{className:"flex justify-center px-1",children:(0,E.jsx)(C,{status:t,size:"small"})})},B=function(e){var t=e.dateOfBirth;return(0,E.jsx)("div",{id:"sensitive-info",className:"whitespace-nowrap p-2",children:$()(t,"YYYY-MM-DD").format(s.YB)})},U=function(e){var t=e.gender,n=e.genderCollected,r=(0,T.Ay)(t,n,h);return(0,E.jsx)("div",{id:"sensitive-info",className:"p-2",children:r})},z=function(e){var t=e.insuranceName;return t||(t=h.noInsurance),(0,E.jsx)("div",{className:"whitespace-nowrap p-2",children:t})},H=function(e){var t=e.isTelemedicine?h.yes:h.no;return(0,E.jsx)("div",{className:"p-2",children:t})},V=function(e){var t=e.updatedBy,n=e.acceptedBy,r=e.rejectedBy,a=e.status,i=h.bot,o=null;return a===b.Bp.ACCEPTED&&(o=n),a===b.Bp.REJECTED&&(o=r),a===b.Bp.REMOVED&&(o=s.W1.OFFICE_AT_BRAINHI),o===s.W1.OFFICE_AT_BRAINHI&&(i=h.officeAtBrainHi),o===s.W1.OFFICE_AT_CALENDAR&&(i=h.officeAtCalendar),o===s.W1.BRAINHI_AGENT&&(i=h.brainHiAgent),(0,E.jsx)(f.m_,{message:i,children:(0,E.jsxs)("div",{className:"flex-col px-2",children:[(0,E.jsx)("p",{id:"sensitive-info",className:"font-semibold",children:Je.includes(o)?h.bot:null==t?void 0:t.username}),(0,E.jsxs)("p",{className:"whitespace-nowrap text-gray-1.0 font-semibold",children:[null==t?void 0:t.first_name," ",null==t?void 0:t.last_name]})]})})},Q=(0,E.jsx)("tr",{children:(0,E.jsx)("td",{className:"text-base text-gray-3.0 py-16 text-center",colSpan:n.length,children:h.noAppointmentsHistory})});return t?(0,E.jsx)("div",{className:"mt-60",children:(0,E.jsx)(d.DotBricksLoading,{})}):(0,E.jsx)("div",{className:"mb-14 flex flex-grow h-full overflow-auto",children:(0,E.jsxs)("table",Ze(Ze({},S()),{},{className:"max-w-7xl flex-grow w-full table-auto",children:[(0,E.jsx)("thead",{children:I.map(function(e){return(0,E.jsx)("tr",Ze(Ze({},e.getHeaderGroupProps()),{},{className:"text-gray-3.0 normal-case py-2",children:e.headers.map(function(e){return(0,E.jsx)("th",Ze(Ze({},e.getHeaderProps(e.getSortByToggleProps())),{},{onClick:function(){return e.disableSortBy?null:x(e.id)},className:"bg-white-0.0 top-0 px-2 py-4 border-b border-white-3.0 text-left",id:"hoverable-header",children:(0,E.jsxs)("span",{className:A()("flex w-full",[b.P9.STATUS_CELL].includes(e.id)&&"justify-center"),children:[(0,E.jsx)("span",{className:"whitespace-nowrap mr-3",children:e.render("Header")}),!e.disableSortBy&&e.isSorted&&(0,E.jsx)("span",{className:A()("my-auto",e.isSortedDesc?"icon-chevron_down_icon":"icon-chevron_up_icon")}),!e.disableSortBy&&!e.isSorted&&(0,E.jsx)("span",{className:"icon-funel_icon my-auto opacity-0",id:"funel-icon"})]})}))})}))})}),(0,E.jsx)("tbody",Ze(Ze({},R()),{},{children:D.length?D.map(function(e,t){return q(e),(0,E.jsx)("tr",Ze(Ze({},e.getRowProps()),{},{className:A()("h-14",t%2==0&&"bg-white-2.0"),children:e.cells.map(function(t){return function(e,t){var n,r,a=t.column.id;switch(a){case b.P9.CLIENT_CELL:n=e.values.clientCell,r=k;break;case b.P9.REQUESTED_DATE_CELL:n=e.values.requestedDateCell,r=L;break;case b.P9.REASON_CELL:n=e.values.reasonCell,r=M;break;case b.P9.REQUESTED_AT_CELL:n=e.values.requestedAtCell,r=F;break;case b.P9.STATUS_CELL:n=e.values.statusCell,r=G;break;case b.P9.DOB_CELL:n=e.values.dateOfBirthCell,r=B;break;case b.P9.GENDER_CELL:n=e.values.genderCell,r=U;break;case b.P9.INSURANCE_CELL:n=e.values.insuranceCell,r=z;break;case b.P9.TELEMEDICINE_CELL:n=e.values.telemedicineCell,r=H;break;case b.P9.UPDATED_BY:n=e.values.updatedBy,r=V;break;default:return(0,E.jsx)("td",{},e.id)}return(0,E.jsx)("td",Ze(Ze({},t.getCellProps()),{},{className:a===b.P9.REASON_CELL?"min-w-40 w-1/3":void 0,children:r(n)}))}(e,t)})}))}):Q}))]}))})};We.propTypes={loading:O().bool.isRequired,columns:O().array.isRequired,data:O().array.isRequired,fetchData:O().func.isRequired};const Ke=We;function Xe(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return $e(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");
2if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):($e(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,$e(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,$e(d,"constructor",l),$e(l,"constructor",c),c.displayName="GeneratorFunction",$e(l,a,"GeneratorFunction"),$e(d),$e(d,a,"Generator"),$e(d,r,function(){return this}),$e(d,"toString",function(){return"[object Generator]"}),(Xe=function(){return{w:i,m:p}})()}function $e(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}$e=function(e,t,n,r){function i(t,n){$e(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},$e(e,t,n,r)}const et=function(){var e=(0,r.useState)(!1),t=(0,u.A)(e,2),n=t[0],i=t[1],c=(0,r.useState)(!1),d=(0,u.A)(c,2),p=d[0],m=d[1],h=(0,o.IT)().status,j=(0,o.F7)(),N=j.account,O=j.isHealthcare,T=j.isStandalone,_=(0,o.Ff)(y.A),A=(0,o.Ff)(y.x),P=(0,a.W6)(),S=(0,g.Ay)(),R=S.setAppointmentHistoryPage,C=S.setAppointmentHistoryView,I=S.setPageIndex,D=S.setSchedulingLinkSettings,q=(0,o.Z2)(function(e){return e.scheduling}),k=q.appointmentRequestHistory,L=q.appointmentRequestHistoryView,M=q.appointmentRequestHistoryCount,F=q.pageCount,G=q.pageIndex,B=q.schedulingLinkSettings;(0,r.useEffect)(function(){void 0===L&&(h&&b.qw.includes(h.toUpperCase())?C(b.DF[h.toUpperCase()]):C(b.DF.ALL))},[h,L,C]),(0,r.useEffect)(function(){var e=function(){var e=(0,l.A)(Xe().m(function e(){var t;return Xe().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,(0,x._O)();case 1:t=e.v,D(t);case 2:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();e()},[D]);var U=F-1>G,z=G>0,H=N.has_telemedicine,V=(0,r.useMemo)(function(){return(0,Ve.cN)(k)},[k]),Q=(0,r.useMemo)(function(){return(0,Ve.K4)(k)},[k]),Y=(0,r.useMemo)(function(){return(0,Ve.GH)(_,O,T,H,B,Q)},[_,O,T,H,B,Q]),Z=(0,r.useCallback)(function(){var e=(0,l.A)(Xe().m(function e(t){var n,r,a,s,o;return Xe().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.pageIndex,r=t.sortBy,void 0!==L){e.n=1;break}return e.a(2);case 1:return e.p=1,i(!0),e.n=2,(0,v.jC)(L,n,r);case 2:a=e.v,s=a.data,R(s),e.n=4;break;case 3:e.p=3,o=e.v,(0,w.Hm)(o)||m(!0);case 4:return e.p=4,i(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])}));return function(t){return e.apply(this,arguments)}}(),[L,R,i]);return p?(0,E.jsx)(f.M,{}):(0,E.jsx)("div",{className:"relative bg-white-0.0 h-screen max-h-full overflow-y-hidden",children:(0,E.jsxs)("div",{className:"flex flex-col h-full",children:[(0,E.jsxs)("div",{className:"flex px-12 pt-12",children:[(0,E.jsx)("h2",{children:_.appointmentRequestHistory}),(0,E.jsx)("p",{className:"text-primary-3.0 border-b border-primary-3.0 cursor-pointer my-auto ml-auto",onClick:function(){P.push("".concat(s.o2,"/scheduling/").concat(b.gR.PENDING_APPOINTMENT_REQUESTS))},children:_.seeRequest})]}),(0,E.jsx)(f.dJ,{loading:n,tabs:b.DF,handleSetFilterTab:function(e){return function(){P.push("".concat(s.o2,"/scheduling/").concat(b.gR.APPOINTMENT_REQUEST_HISTORY,"?status=").concat(b.Jz[e])),C(e)}},selectedTab:L||b.DF.ALL,count:M,languageMessages:{tabs:A}}),(0,E.jsx)("div",{className:"bg-white-0.0 overflow-scroll pt-8 px-8",children:(0,E.jsx)(Ke,{loading:n,columns:Y,data:V,fetchData:Z})}),(0,E.jsx)("div",{className:"absolute bottom-0 left-0 right-0",children:(0,E.jsx)(f.C0,{pageCount:F,pageIndex:G,gotoPage:function(e){G!==e&&(i(!0),I(e))},canNextPage:U,canPreviousPage:z})})]})})};var tt=n(97286),nt=n(4),rt=n(82704),at=n(73451),it=n(67919);function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?st(Object(n),!0).forEach(function(t){(0,j.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var ct={createdAfter:"",createdBefore:""};var lt=n(36397),ut=n(90600),dt=n(87985),pt=function(e){var t=e.languageMessages,n=e.filters,r=e.dateRange,a=e.searchInput,i=e.isSearchPending,s=void 0!==i&&i,o=e.activeCount,c=e.serviceOptions,l=void 0===c?[]:c,u=e.reasonOptions,d=void 0===u?[]:u,p=e.insuranceOptions,f=void 0===p?[]:p,m=e.providerOptions,h=void 0===m?[]:m,x=e.showInsuranceFilter,v=void 0!==x&&x,b=e.showReasonFilter,y=void 0!==b&&b,g=e.onSearchChange,j=e.onSearchClear,N=e.onToggleListFilter,O=e.onDateRangeChange,T=e.onToggleHasDocuments,_=e.onClearFilters,A=n.hasDocuments,w=r.createdAfter,P=r.createdBefore,S=Boolean(n.createdAfter||n.createdBefore),R=[{id:it.H3.PORTAL,label:t.filterOriginPortal},{id:it.H3.REGULAR,label:t.filterOriginRegular}];return(0,E.jsxs)(dt.aL,{searchTitle:t.filterSearchTitle,searchValue:a,onSearchChange:g,onSearchClear:j,searchPlaceholder:t.filterSearchPlaceholder,searchAriaLabel:t.filterSearchPlaceholder,isSearching:s,clearSearchLabel:t.filterClearSearch,filtersLabel:t.filtersLabel,expandAriaLabel:t.filtersExpand,collapseAriaLabel:t.filtersCollapse,filtersAction:o>0&&(0,E.jsx)("button",{type:"button",onClick:_,className:"text-brand-primary hover:underline shrink-0 text-xs font-medium",children:t.filtersClearAll}),children:[(0,E.jsx)(dt.QZ,{label:t.filterOriginLabel,options:R,selectedIds:n.origins,onToggle:function(e){return N("origins",e)},sortAlphabetical:!1}),(0,E.jsx)(dt.QZ,{label:t.filterRequestedAtLabel,selectedIds:S?["created-at-range"]:[],children:(0,E.jsxs)("div",{className:"flex flex-col gap-3 px-2 pb-1.5",children:[(0,E.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,E.jsx)(ut.J,{htmlFor:"appointment-request-filter-date-from",className:"text-action-secondary-light-1 text-[10px] font-medium uppercase",children:t.filterDateFrom}),(0,E.jsx)(lt.p,{id:"appointment-request-filter-date-from",type:"date",className:"h-8 text-xs",value:w,onChange:function(e){return O("createdAfter",e.target.value)}})]}),(0,E.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,E.jsx)(ut.J,{htmlFor:"appointment-request-filter-date-to",className:"text-action-secondary-light-1 text-[10px] font-medium uppercase",children:t.filterDateTo}),(0,E.jsx)(lt.p,{id:"appointment-request-filter-date-to",type:"date",className:"h-8 text-xs",value:P,onChange:function(e){return O("createdBefore",e.target.value)}})]})]})}),y&&(0,E.jsx)(dt.QZ,{label:t.filterReasonLabel,options:d,selectedIds:n.reasonIds,onToggle:function(e){return N("reasonIds",e)},emptyLabel:t.filtersNoOptions}),(0,E.jsx)(dt.QZ,{label:t.filterServiceLabel,options:l,selectedIds:n.serviceIds,onToggle:function(e){return N("serviceIds",e)},emptyLabel:t.filtersNoOptions}),v&&(0,E.jsx)(dt.QZ,{label:t.filterInsuranceLabel,options:f,selectedIds:n.insuranceNames,onToggle:function(e){return N("insuranceNames",e)},emptyLabel:t.filtersNoOptions}),(0,E.jsx)(dt.QZ,{label:t.filterPreferredProviderLabel,options:h,selectedIds:n.preferredProviderIds,onToggle:function(e){return N("preferredProviderIds",e)},emptyLabel:t.filtersNoOptions}),(0,E.jsx)(dt.QZ,{label:t.filterDocumentsLabel,selectedIds:A?["has-documents"]:[],children:(0,E.jsx)(dt.gf,{label:t.filterHasDocuments,checked:A,onChange:T})})]})},ft=O().shape({id:O().string.isRequired,label:O().string.isRequired});pt.propTypes={languageMessages:O().object.isRequired,filters:O().shape({createdAfter:O().string.isRequired,createdBefore:O().string.isRequired,serviceIds:O().arrayOf(O().string).isRequired,reasonIds:O().arrayOf(O().string).isRequired,insuranceNames:O().arrayOf(O().string).isRequired,preferredProviderIds:O().arrayOf(O().string).isRequired,origins:O().arrayOf(O().string).isRequired,hasDocuments:O().bool.isRequired}).isRequired,dateRange:O().shape({createdAfter:O().string.isRequired,createdBefore:O().string.isRequired}
2).isRequired,searchInput:O().string.isRequired,isSearchPending:O().bool,activeCount:O().number.isRequired,serviceOptions:O().arrayOf(ft),reasonOptions:O().arrayOf(ft),insuranceOptions:O().arrayOf(ft),providerOptions:O().arrayOf(ft),showInsuranceFilter:O().bool,showReasonFilter:O().bool,onSearchChange:O().func.isRequired,onSearchClear:O().func.isRequired,onToggleListFilter:O().func.isRequired,onDateRangeChange:O().func.isRequired,onToggleHasDocuments:O().func.isRequired,onClearFilters:O().func.isRequired};const mt=pt;var ht=function(e){var t=e.tabId,n=e.openTabId,r=e.label,a=e.countAccessKey,i=e.counters,s=e.onClick,o=e.icon;return(0,E.jsx)(d.SegmentedTab,{tabId:t,openTabId:n,label:r,count:i[a],onClick:function(){s(t)},icon:o})};ht.propTypes={tabId:O().string.isRequired,openTabId:O().string.isRequired,label:O().string.isRequired,countAccessKey:O().string.isRequired,counters:O().object.isRequired,onClick:O().func.isRequired,icon:O().string.isRequired};const xt=ht;var vt=n(10269),bt=n(12420);function yt(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function i(n,r,a,i){var c=r&&r.prototype instanceof o?r:o,l=Object.create(c.prototype);return gt(l,"_invoke",function(n,r,a){var i,o,c,l=0,u=a||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,o=0,c=e,p.n=n,s}};function f(n,r){for(o=n,c=r,t=0;!d&&l&&!a&&t<u.length;t++){var a,i=u[t],f=p.p,m=i[2];n>3?(a=m===r)&&(c=i[(o=i[4])?5:(o=3,3)],i[4]=i[5]=e):i[0]<=f&&((a=n<2&&f<i[1])?(o=0,p.v=r,p.n=i[1]):f<m&&(a=n<3||i[0]>r||r>m)&&(i[4]=n,i[5]=r,p.n=m,o=0))}if(a||n>1)return s;throw d=!0,r}return function(a,u,m){if(l>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,m),o=u,c=m;(t=o<2?e:c)||!d;){i||(o?o<3?(o>1&&(p.n=-1),f(o,c)):p.n=c:p.v=c);try{if(l=2,i){if(o||(a="next"),t=i[a]){if(!(t=t.call(i,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,o<2&&(o=0)}else 1===o&&(t=i.return)&&t.call(i),o<2&&(c=TypeError("The iterator does not provide a '"+a+"' method"),o=1);i=e}else if((t=(d=p.n<0)?c:n.call(r,p))!==s)break}catch(t){i=e,o=1,c=t}finally{l=1}}return{value:t,done:d}}}(n,a,i),!0),l}var s={};function o(){}function c(){}function l(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(gt(t={},r,function(){return this}),t),d=l.prototype=o.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,gt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return c.prototype=l,gt(d,"constructor",l),gt(l,"constructor",c),c.displayName="GeneratorFunction",gt(l,a,"GeneratorFunction"),gt(d),gt(d,a,"Generator"),gt(d,r,function(){return this}),gt(d,"toString",function(){return"[object Generator]"}),(yt=function(){return{w:i,m:p}})()}function gt(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}gt=function(e,t,n,r){function i(t,n){gt(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},gt(e,t,n,r)}var jt=h.A;const Nt=function(){var e,t,n=(0,a.W6)(),c=(0,a.zy)().hash.slice(1),h=(0,o.F7)(),N=h.account,O=h.connectedUser,T=h.language,_=h.isHealthcare,w=(0,o.Ff)(y.A),P=(0,o.IT)().status,S=(0,g.Ay)(),R=S.setAppointmentRequestCounters,C=S.setServiceAvailability,I=S.setProviderTimeOff,D=S.setProviderAvailability,q=S.setOfficeAvailability,k=(0,o.hb)(),L=(0,p.Ay)(jt,{share:!0,filter:function(e){return k(e,[s.mB.APPOINTMENT_REQUEST_ACCEPTED,s.mB.APPOINTMENT_REQUEST_ACCEPTED_NAIVELY,s.mB.APPOINTMENT_REQUEST_REJECTED,s.mB.APPOINTMENT_REQUEST_REJECTED_NAIVELY,s.mB.APPOINTMENT_REQUEST_MARKED_IN_PROGRESS,s.mB.APPOINTMENT_REQUEST_REMOVED,s.mB.APPOINTMENT_REQUEST_CREATED,s.mB.APPOINTMENT_REQUEST_UPDATE])}}).lastJsonMessage,M=(0,o.Z2)(function(e){return e.scheduling}),F=M.appointmentRequests,G=M.counters,B=M.hasNextPage,U=M.shouldFetchMore,z=(0,r.useState)(!1),H=(0,u.A)(z,2),V=H[0],Q=H[1],Y=(0,r.useState)(!0),Z=(0,u.A)(Y,2),J=Z[0],W=Z[1],K=(0,r.useState)(!1),X=(0,u.A)(K,2),$=X[0],ee=X[1],te=(0,r.useState)(null),ne=(0,u.A)(te,2),re=ne[0],ae=ne[1],ie=(0,r.useState)([]),se=(0,u.A)(ie,2),oe=se[0],ce=se[1],le=(0,r.useState)([]),ue=(0,u.A)(le,2),de=ue[0],pe=ue[1],fe=(0,r.useState)([]),me=(0,u.A)(fe,2),he=me[0],xe=me[1],ve=(0,r.useState)([]),be=(0,u.A)(ve,2),ye=be[0],ge=be[1],je=(0,r.useState)([]),Ne=(0,u.A)(je,2),Oe=Ne[0],Te=Ne[1],_e=(0,tt.I)((0,at.r9)()).data,Ae=void 0===_e?[]:_e,we=(0,r.useState)(b.UT.ASCENDING),Ee=(0,u.A)(we,2),Pe=Ee[0],Se=Ee[1],Re=(0,r.useState)(b.UT.ASCENDING),Ce=(0,u.A)(Re,2),Ie=Ce[0],De=Ce[1],qe=(0,r.useState)(b.UT.DESCENDING),ke=(0,u.A)(qe,2),Le=ke[0],Me=ke[1],Fe=(0,g.Ay)(),Ge=Fe.setAppointmentRequests,Be=Fe.setParsedAccountTemplates,Ue=Fe.setAppointmentRequestsNextPage,ze=Fe.setAdditionalAppointmentRequest,He=Fe.processArchivedAppointmentRequestWebsocket,Qe=Fe.processInProgressAppointmentRequestWebsocket,Ye=Fe.processCreatedAppointmentRequestWebsocket,Ze=Fe.reconcileAppointmentRequestSyncStatus,Je=Boolean(null===(e=N.waffles)||void 0===e?void 0:e.has_citasmedicas_settings),We=(0,r.useMemo)(function(){return[_?null:"insuranceNames",Je?null:"reasonIds"].filter(
2Boolean)},[_,Je]),Ke=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.accountId,n=e.userId,a=e.hiddenFilterKeys,i=void 0===a?[]:a,s=(0,r.useState)(it.KT),o=(0,u.A)(s,2),c=o[0],l=o[1],d=(0,r.useState)(""),p=(0,u.A)(d,2),f=p[0],m=p[1],h=(0,r.useState)(ct),x=(0,u.A)(h,2),v=x[0],b=x[1],y=(0,r.useState)(!1),g=(0,u.A)(y,2),N=g[0],O=g[1];(0,r.useEffect)(function(){var e,r,a;if(t&&n){var i=(0,it.lQ)(t,n);l(null!=i?i:it.KT),m(null!==(e=null==i?void 0:i.search)&&void 0!==e?e:""),b({createdAfter:null!==(r=null==i?void 0:i.createdAfter)&&void 0!==r?r:"",createdBefore:null!==(a=null==i?void 0:i.createdBefore)&&void 0!==a?a:""}),O(!0)}else O(!0)},[t,n]),(0,r.useEffect)(function(){N&&(0,it.eN)(t,n,c)},[N,t,n,c]),(0,r.useEffect)(function(){if(f!==c.search){var e=setTimeout(function(){return l(function(e){return ot(ot({},e),{},{search:f})})},400);return function(){return clearTimeout(e)}}},[f,c.search]),(0,r.useEffect)(function(){var e=v.createdAfter,t=v.createdBefore;if(e!==c.createdAfter||t!==c.createdBefore){var n=setTimeout(function(){return l(function(n){return ot(ot({},n),{},{createdAfter:e,createdBefore:t})})},700);return function(){return clearTimeout(n)}}},[v,c.createdAfter,c.createdBefore]);var T=(0,r.useCallback)(function(e,t){l(function(n){return ot(ot({},n),{},(0,j.A)({},e,(0,it.wn)(n[e],t)))})},[]),_=(0,r.useCallback)(function(e,t){b(function(n){return ot(ot({},n),{},(0,j.A)({},e,t))})},[]),A=(0,r.useCallback)(function(){l(function(e){return ot(ot({},e),{},{hasDocuments:!e.hasDocuments})})},[]),w=(0,r.useCallback)(function(){m(""),b(ct),l(it.KT)},[]),E=(0,r.useCallback)(function(){return m("")},[]),P=(0,r.useMemo)(function(){return(0,it.iX)(c,i)},[c,i.join(",")]),S=(0,r.useMemo)(function(){return(0,it.kk)(P)},[P]),R=(0,r.useMemo)(function(){return(0,it.TG)(P)},[P]),C=f!==c.search;return{filters:c,dateRange:v,searchInput:f,isSearchPending:C,isHydrated:N,queryString:S,activeCount:R,setSearchInput:m,clearSearch:E,toggleListFilter:T,setDateRange:_,toggleHasDocuments:A,clearFilters:w}}({accountId:null==N?void 0:N.id,userId:null==O?void 0:O.id,hiddenFilterKeys:We}),Xe=Ke.filters,$e=Ke.dateRange,et=Ke.searchInput,st=Ke.isSearchPending,lt=Ke.isHydrated,ut=Ke.queryString,dt=Ke.activeCount,pt=Ke.setSearchInput,ft=Ke.clearSearch,ht=Ke.toggleListFilter,gt=Ke.setDateRange,Nt=Ke.toggleHasDocuments,Ot=Ke.clearFilters,Tt=(0,r.useMemo)(function(){return(0,it.KM)(he.filter(function(e){return!e.disabled}),{getId:function(e){return e.id},getLabel:d.getServiceDisplayName})},[he]),_t=(0,r.useMemo)(function(){return(0,it.KM)(ye.filter(function(e){return e.scheduling_enabled}),{getId:function(e){return e.id},getLabel:d.getProviderDisplayName})},[ye]),At=(0,r.useMemo)(function(){return(0,it.KM)(Ae,{getId:function(e){return e.name},getLabel:function(e){return e.name}})},[Ae]),wt=(0,r.useMemo)(function(){return(0,it.KM)(Oe,{getId:function(e){return(0,it.ny)(e.kind,e.value)},getLabel:function(e){return e.label}})},[Oe]),Et=0===F.length||J,Pt=(0,rt.S)(),St=null===(t=N.waffles)||void 0===t?void 0:t.has_scheduling_new_visualization_enabled,Rt=(0,Ve.n)({openTabId:re,pendingOrdering:Pe,inProgressOrdering:Ie,archivedOrdering:Le}),Ct=function(){var e=(0,l.A)(yt().m(function e(){var t,n,r,a,i,s,o,c,l,u,d,p,f;return yt().w(function(e){for(;;)switch(e.p=e.n){case 0:ee(!0),e.p=1,f=re,e.n=f===b.J5.PENDING?2:f===b.J5.ARCHIVED?4:f===b.J5.IN_PROGRESS?6:8;break;case 2:return e.n=3,(0,v.bR)({status:b.X3.join(","),ordering:"".concat(Pe,"created_at"),filters:ut,offset:F.length});case 3:return t=e.v,n=t.data,r=n.results,a=n.count,Ue({results:r,count:a}),e.a(3,9);case 4:return e.n=5,(0,v.bR)({status:b.kp.join(","),ordering:"".concat(Le,"updated_at"),filters:ut,offset:F.length});case 5:return i=e.v,s=i.data,o=s.results,c=s.count,Ue({results:o,count:c}),e.a(3,9);case 6:return e.n=7,(0,v.bR)({status:b.Bp.IN_PROGRESS,ordering:"".concat(Ie,"created_at"),filters:ut,offset:F.length});case 7:return l=e.v,u=l.data,d=u.results,p=u.count,Ue({results:d,count:p}),e.a(3,9);case 8:return e.a(3,9);case 9:e.n=11;break;case 10:e.p=10,e.v,Q(!0);case 11:return e.p=11,ee(!1),e.f(11);case 12:return e.a(2)}},e,null,[[1,10,11,12]])}));return function(){return e.apply(this,arguments)}}(),It=function(e){ae(e),n.replace("".concat(s.o2,"/scheduling?status=").concat(b.dB[e]))};(0,r.useEffect)(function(){F.find(function(e){return e.id===c})&&setTimeout(function(){i.XG.scrollTo(c,{containerId:"appointmentRequestContainer",smooth:!0,offset:-16}
2)},1e3)},[c,F]);var Dt=(0,r.useRef)({key:"",count:0});if((0,r.useEffect)(function(){if(c&&!J&&!$&&B&&!F.some(function(e){return e.id===c})){var e="".concat(re,":").concat(Pe,":").concat(Ie,":").concat(Le,":").concat(ut,":").concat(c);Dt.current.key!==e&&(Dt.current={key:e,count:0}),Dt.current.count>=5||(Dt.current.count+=1,Ct())}},[c,F,B,J,$,re,Pe,Ie,Le,ut]),(0,r.useEffect)(function(){P in b.bi?ae(b.bi[P]):ae(b.J5.PENDING)},[P]),(0,r.useEffect)(function(){var e=function(){var e=(0,l.A)(yt().m(function e(){var t,n,r,a,i,s,o,c,l,d,p,f,h,y;return yt().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,Promise.all([(0,m.to)(),(0,v.RN)(),(0,v.R6)(b.Z4,T),(0,v.BK)(b.Z4,T),(0,x.c_)(),(0,m.Cj)(),(0,m.jg)(),(0,m.v2)(),(0,x.GF)(),(0,x.yh)()]);case 1:t=e.v,n=(0,u.A)(t,10),r=n[0].data,a=n[1].data,i=n[2].data,s=n[3].data,o=n[4].availability,c=n[5].data,l=n[6].data,d=n[7].data,p=n[8],f=p.vacations,h=p.availability,y=n[9],ce(r),R(a),C(o),Be({accountTemplates:s,messageTemplates:i,account:N}),pe(c),xe(l),ge(d),I(f),D(h),q(y||[]),e.n=3;break;case 2:e.p=2,e.v,Q(!0);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();e()},[R,Be,N,T,C,I,D,q]),(0,r.useEffect)(function(){if(Je){var e=function(){var e=(0,l.A)(yt().m(function e(){var t,n;return yt().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,t=Te,e.n=1,(0,nt.iE)(T);case 1:n=e.v,t(n),e.n=3;break;case 2:e.p=2,e.v,Te([]);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}();e()}},[Je,T]),(0,r.useEffect)(function(){if(lt){var e=!1,t=function(){var t=(0,l.A)(yt().m(function t(){var n,r,a,i,s,o,c,l,u,d,p,f,m;return yt().w(function(t){for(;;)switch(t.p=t.n){case 0:W(!0),t.p=1,m=re,t.n=m===b.J5.PENDING?2:m===b.J5.ARCHIVED?5:m===b.J5.IN_PROGRESS?8:11;break;case 2:return t.n=3,(0,v.bR)({status:b.X3.join(","),ordering:"".concat(Pe,"created_at"),filters:ut});case 3:if(n=t.v,r=n.data,a=r.results,i=r.count,!e){t.n=4;break}return t.a(2);case 4:return Ge({results:a,count:i}),t.a(3,12);case 5:return t.n=6,(0,v.bR)({status:b.kp.join(","),ordering:"".concat(Le,"updated_at"),filters:ut});case 6:if(s=t.v,o=s.data,c=o.results,l=o.count,!e){t.n=7;break}return t.a(2);case 7:return Ge({results:c,count:l}),t.a(3,12);case 8:return t.n=9,(0,v.bR)({status:b.Bp.IN_PROGRESS,ordering:"".concat(Ie,"created_at"),filters:ut});case 9:if(u=t.v,d=u.data,p=d.results,f=d.count,!e){t.n=10;break}return t.a(2);case 10:return Ge({results:p,count:f}),t.a(3,12);case 11:return t.a(3,12);case 12:t.n=14;break;case 13:t.p=13,t.v,e||Q(!0);case 14:e||W(!1);case 15:return t.a(2)}},t,null,[[1,13]])}));return function(){return t.apply(this,arguments)}}();return t(),function(){e=!0}}},[re,Ge,Pe,Ie,Le,ut,lt]),(0,r.useEffect)(function(){if(lt){var e=!1,t=function(){var t=(0,l.A)(yt().m(function t(){var n,r,a,i,s,o,c,l,u,d,p;return yt().w(function(t){for(;;)switch(t.p=t.n){case 0:ee(!0),t.p=1,p=re,t.n=p===b.J5.PENDING?2:p===b.J5.IN_PROGRESS?5:8;break;case 2:return t.n=3,(0,v.bR)({status:b.X3.join(","),ordering:"".concat(Pe,"created_at"),filters:ut,offset:F.length});case 3:if(n=t.v,r=n.data,a=r.results,i=r.count,s=a[a.length-1],!e){t.n=4;break}return t.a(2);case 4:return ze({appointmentRequest:s,count:i}),t.a(3,9);case 5:return t.n=6,(0,v.bR)({status:b.Bp.IN_PROGRESS,ordering:"".concat(Ie,"created_at"),filters:ut,offset:F.length});case 6:if(o=t.v,c=o.data,l=c.results,u=c.count,d=l[l.length-1],!e){t.n=7;break}return t.a(2);case 7:return ze({appointmentRequest:d,count:u}),t.a(3,9);case 8:return t.a(3,9);case 9:t.n=11;break;case 10:t.p=10,t.v,e||Q(!0);case 11:e||ee(!1);case 12:return t.a(2)}},t,null,[[1,10]])}));return function(){return t.apply(this,arguments)}}();return U&&t(),function(){e=!0}}},[U,F,re,Ue,ze,Pe,Ie,ut,lt]),(0,r.useEffect)(function(){b.DG.has(null==L?void 0:L.type)&&O.id!==(null==L?void 0:L.user_id)&&He({appointmentRequest:L.appointment_request,openTabId:re,originalStatus:L.original_status,ordering:Le})},[L,O,He]),(0,r.useEffect)(function(){(null==L?void 0:L.type)===s.mB.APPOINTMENT_REQUEST_MARKED_IN_PROGRESS&&O.id!==(null==L?void 0:L.user_id
2)&&Qe({appointmentRequest:L.appointment_request,openTabId:re,ordering:Ie})},[L,O,Qe]),(0,r.useEffect)(function(){(null==L?void 0:L.type)===s.mB.APPOINTMENT_REQUEST_CREATED&&Ye({appointmentRequest:L.appointment_request,openTabId:re,ordering:Pe})},[L,Ye]),(0,r.useEffect)(function(){(null==L?void 0:L.type)===s.mB.APPOINTMENT_REQUEST_UPDATE&&Ze(L.appointment_request)},[L,Ze]),V)return(0,E.jsx)(f.M,{});if(null===re)return(0,E.jsx)(d.DotBricksLoading,{});var qt=Pt.map(function(e){var t=e.tabId,n=e.icon,r=e.label,a=e.countAccessKey;return(0,E.jsx)(xt,{tabId:t,label:r,icon:n,countAccessKey:a,counters:G,openTabId:re,onClick:It},"appointment-request-list-navigation-tab-".concat(t))}),kt=(0,E.jsx)(d.Tabs,{defaultActiveKey:re,onTabClick:It,showOnlyNavigationsLinks:!0,orientation:"top",variant:"w-11/12 md:w-full",children:Pt.map(function(e){var t=e.tabId,n=e.icon,r=e.label,a=e.countAccessKey,i=re===t;return(0,E.jsx)(d.TabPanel,{label:(0,E.jsxs)("div",{className:"flex items-center",children:[(0,E.jsx)(d.Icon,{size:16,name:n,className:"group-hover:text-brand-primary mr-2"}),r,(0,E.jsx)(d.Badge,{text:G[a],className:A()(i?"bg-brand-primary border-brand-primary":"border-action-secondary group-hover:border-brand-primary","ml-2 border h-4 transition ease-in-out duration-200 px-1 bc-rounded items-center group-hover:bg-brand-primary"),textClassName:A()("group-hover:text-brand-primary-light-6 bc-text-sm",i?"text-action-secondary-light-6":"text-action-secondary")})]}),ariaLabel:r,children:t},t)})});return(0,E.jsxs)("div",{className:"flex flex-row h-screen",children:[(0,E.jsx)(mt,{languageMessages:w,filters:Xe,dateRange:$e,searchInput:et,isSearchPending:st,activeCount:dt,serviceOptions:Tt,reasonOptions:wt,insuranceOptions:At,showInsuranceFilter:_,providerOptions:_t,showReasonFilter:Je,onSearchChange:pt,onSearchClear:ft,onToggleListFilter:ht,onDateRangeChange:gt,onToggleHasDocuments:Nt,onClearFilters:Ot}),(0,E.jsxs)(i.Hg,{name:"container",id:"appointmentRequestContainer",className:"bg-brand-primary-light-6 flex flex-col flex-1 h-screen min-w-0 overflow-y-scroll",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between gap-4 px-4 mt-6 mb-2",children:[(0,E.jsx)("h2",{className:"text-brand-primary text-lg font-semibold",children:w.appointmentRequestListTitle}),(0,E.jsx)(bt.A,{calendarType:N.calendar_type})]}),(0,E.jsxs)("div",{className:"relative flex flex-row",children:[St?kt:qt,(0,E.jsx)("div",{className:"border-brand-primary-light-5 flex-grow border-b-2"}),(0,E.jsx)("div",{className:"absolute right-0 flex h-full mr-4",children:(0,E.jsx)("button",{className:"hover:bg-action-secondary-light-4 p-2 my-auto transition-colors rounded-full",type:"button",onClick:function(){switch(re){case b.J5.PENDING:Se(b.GW[Pe]);break;case b.J5.ARCHIVED:Me(b.GW[Le]);break;case b.J5.IN_PROGRESS:De(b.GW[Ie])}},children:(0,E.jsx)(d.Icon,{name:Rt,className:"text-action-secondary"})})})]}),(0,E.jsxs)("div",{className:A()("w-full px-4 py-4",Et&&"my-auto"),children:[J&&(0,E.jsx)("div",{className:"flex flex-col items-center justify-center",children:(0,E.jsx)(d.DotBricksLoading,{})}),!J&&(F.length>0?(0,E.jsxs)(E.Fragment,{children:[F.map(function(e){return(0,E.jsx)(vt.A,{appointmentRequest:e,chairs:oe,taggableUsers:de,services:he,providers:ye},e.id)}),B&&(0,E.jsx)("div",{className:"flex flex-col items-center w-full",children:$?(0,E.jsx)(d.RoundDotLoading,{className:"mt-2"}):(0,E.jsx)(d.Button,{size:"small",text:w.loadMore,onClick:Ct})})]}):(0,E.jsxs)("div",{className:"flex flex-col items-center justify-center py-2",children:[(0,E.jsx)(d.LaraAvatar,{variant:"happy"}),(0,E.jsx)("div",{className:"mb-2 text-3xl",children:dt>0?w.filteredEmptyTitle:w.emptyAppointmentRequestList}),(0,E.jsx)("div",{className:"text-lg text-center",children:dt>0?w.filteredEmptySubtitle:w.emptyAppointmentRequestListSubtitle})]}))]})]})]})},Ot=function(){var e=(0,g.Ay)(),t=e.clearState,n=e.setAccountLevelSettings,l=(0,a.W5)("".concat(s.o2,"/scheduling")).url,u=(0,o.F7)().account;return(0,r.useEffect)(function(){return function(){t()}},[t]),(0,r.useEffect)(function(){u&&n(u)},[u,n]),(0,c.qD)(u.waffles)?(0,E.jsx)(Nt,{}):(0,E.jsx)(i.Hg,{name:"container",id:"appointmentRequestContainer",className:"view-width flex flex-col flex-grow overflow-y-scroll",children:(0,E.jsxs)(a.dO,{children:[(0,E.jsx)(a.qh,{exact:!0,path:"".concat(l,"/").concat(b.gR.PENDING_APPOINTMENT_REQUESTS),children:(0,E.jsx)(He,{})}),(0,E.jsx)(a.qh,{path:"".concat(l,"/").concat(b.gR.APPOINTMENT_REQUEST_HISTORY),children:(0,E.jsx)(et,{})}),(0,E.jsx)(a.qh,{path:"*",render:function(){return(0,E.jsx)(a.rd,{to:"".concat(l,"/").concat(b.gR.PENDING_APPOINTMENT_REQUESTS)})}})]})})}},33337:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(94188),a=n(82238),i=n(70551);function s(e,t){(0,i.A)(2,arguments);var n=(0,r.A)(t);return(0,a.default)(e,-n)}}
2,82238:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(94188),a=n(92998),i=n(70551);function s(e,t){(0,i.A)(2,arguments);var n=7*(0,r.A)(t);return(0,a.default)(e,n)}},92998:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(94188),a=n(10123),i=n(70551);function s(e,t){(0,i.A)(2,arguments);var n=(0,a.default)(e),s=(0,r.A)(t);return isNaN(s)?new Date(NaN):s?(n.setDate(n.getDate()+s),n):n}}}]);//# sourceMappingURL=611.819928aa.chunk.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.