1"use strict";(self.webpackChunkhost=self.webpackChunkhost||[]).push([[2791,2322,7285,5393,8865,1451,6280],{42791:(e,t,r)=>{r.r(t),r.d(t,{CustomerSurveyRatingBanner:()=>g,CustomerSurveyRatingDrawer:()=>j,CustomerSurveyRatingModal:()=>y});var n=r(77285),o=r(59251),s=r(11871),i=r(99296),a=r(73659),l=r(52322);const c=()=>(0,l.jsxs)(s.Flex,{mt:"58px",mb:"58px",direction:"column",alignItems:"center",children:[(0,l.jsx)(a.ConfirmIcon,{w:"48px",h:"48px",color:"$fg.system.success"}),(0,l.jsx)(a.Heading,{my:"8px",size:"h2",color:"$fg.primary",children:"Thanks for submitting"})]}),d=({handleRetrySubmitRating:e})=>(0,l.jsxs)(s.Flex,{mt:"40px",mb:"24px",direction:"column",alignItems:"center",children:[(0,l.jsx)(a.ErrorIcon,{w:"48px",h:"48px",color:"$fg.system.error_default"}),(0,l.jsx)(a.Heading,{my:"8px",size:"h2",color:"$fg.primary",children:"Unable to save score"}),(0,l.jsx)(a.Text,{textStyle:"body-02-regular",color:"$fg.secondary",mb:"20px",children:"Please try again or come back later"}),(0,l.jsx)(a.Button,{onClick:e,variant:"ghost",w:"40px",h:"40px",children:"Retry"})]}),u="Have your say",x="Based on your experience, how likely are you to recommend Allica Bank's online banking to other businesses?",m="modalDismissedEvent",p=e=>`survey-modal-${e}`,h=({onRatingClick:e,isPaginated:t=!1,placement:r="modal"})=>{const[o,i]=(0,n.useState)(!1),c=(0,s.useToken)("colors","$fg.interactive.default"),d=(0,s.useBreakpointValue)({base:!0,sm:t},{ssr:!1}),u=()=>i((e=>!e)),x=d?5:10,m=d?o?1:6:1;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(s.Flex,{mb:"8px",justifyContent:"space-between",gap:"12px",children:[d&&!o&&(0,l.jsx)(a.ChevronLeftIcon,{"data-testid":"prev-votes-btn",tabIndex:0,cursor:"pointer",h:"40px",onClick:u}),Array.from({length:x},((t,n)=>{const o=m+n;return(0,l.jsx)(a.Button,{p:0,onClick:()=>e(o),variant:"secondary",w:"100%",h:"40px",_hover:{textColor:"white",bgColor:"$fg.interactive.default"},textColor:"$fg.primary","data-heapid":`rate-button-${o}-${r}`,boxShadow:`inset 0px 0px 0px 2px ${c}`,children:o},n)})),d&&o&&(0,l.jsx)(a.ChevronRightIcon,{"data-testid":"next-votes-btn",tabIndex:0,cursor:"pointer",h:"40px",onClick:u})]}),d&&(0,l.jsxs)(s.Flex,{justifyContent:"space-between",children:[(0,l.jsx)(a.Text,{color:"$fg.tertiary",children:"1"}),(0,l.jsx)(a.Text,{color:"$fg.tertiary",children:"10"})]}),(0,l.jsxs)(s.Flex,{justifyContent:"space-between",children:[(0,l.jsx)(a.Text,{color:"$fg.tertiary",children:"Not likely"}),(0,l.jsx)(a.Text,{color:"$fg.tertiary",children:"Extremely likely"})]})]})},g=({surveyId:e})=>{const t=p(e),r=(e=>`survey-banner-${e}`)(e),g="true"===localStorage.getItem(t),y="true"===localStorage.getItem(r),[j,f]=(0,n.useState)(g&&!y),b=(0,n.useRef)(null),{mutate:v,isPending:S,isSuccess:w,isError:C,variables:I}=(0,o.useSubmitSurveyRating)({onSuccess:()=>{b.current=window.setTimeout((()=>{f(!1),localStorage.removeItem(t)}),3e3)}});return(0,n.useEffect)((()=>{const e=()=>{f(!0)};return window.addEventListener(m,e),()=>{null!==b.current&&clearTimeout(b.current),window.removeEventListener(m,e)}}),[]),j&&(0,l.jsx)(a.Tile,{pos:"relative",children:(0,l.jsxs)(a.TileBody,{children:[(0,l.jsx)(s.CloseButton,{pos:"absolute",top:"12px",right:"12px",onClick:()=>{localStorage.setItem(r,"true"),f(!1)},size:"xl"}),S&&(0,l.jsx)(s.Flex,{flexGrow:"auto",alignItems:"center",alignContent:"center",children:(0,l.jsx)(s.Box,{m:"8rem auto",children:(0,l.jsx)(i.Spinner,{})})}),w&&(0,l.jsx)(c,{}),C&&(0,l.jsx)(d,{handleRetrySubmitRating:()=>{void 0!==I&&v(I)}}),!C&&!w&&!S&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Heading,{mb:"16px",as:"h3",size:"h3",color:"$fg.primary",children:u}),(0,l.jsx)(a.Text,{textStyle:"body-02-medium",color:"$fg.primary",mb:"20px",children:x}),(0,l.jsx)(h,{onRatingClick:t=>{v({rating:t,surveyId:e})},placement:"banner",isPaginated:!0})]})]})})},y=({surveyId:e})=>{const t=p(e),r="true"===localStorage.getItem(t),{onClose:g,isOpen:y}=(0,s.useDisclosure)({defaultIsOpen:!r}),j=(0,n.useRef)(null),{mutate:f,isPending:b,isSuccess:v,isError:S,variables:w}=(0,o.useSubmitSurveyRating)({onSuccess:()=>{j.current=window.setTimeout((()=>{g(),localStorage.removeItem(t)}),3e3)}}),C=()=>{v||(localStorage.setItem(t,"true"),dispatchEvent(new Event(m))),g()};(0,n.useEffect)((()=>()=>{null!==j.current&&clearTimeout(j.current)}),[]);return(0,l.jsxs)(s.Modal,{isOpen:y,onClose:C,size:{base:"full",md:"5xl"},children:[(0,l.jsx)(s.ModalOverlay,{}),(0,l.jsxs)(s.ModalContent,{alignSelf:"center","data-testid":"customer-survey-rating-modal",children:[(0,l.jsx)(s.ModalHeader,{children:(0,l.jsx)(s.ModalCloseButton,{"data-heapid":"modal-dismiss-x-button"})}),(0,l.jsxs)(s.ModalBody,{children:[b&&(0,l.jsx)(s.Flex,{alignItems:"center",alignContent:"center",children:(0,l.jsx)(s.Box,{m:"10.5rem auto",children:(0,l.jsx)(i.Spinner,{})})}),v&&(0,l.jsx)(c,{}),S&&(0,l.jsx)(d,{handleRetrySubmitRating:()=>{void 0!==w&&f(w)}}),!S&&!v&&!b&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Heading,{mb:"24px",as:"h2",size:"h2",color:"$fg.primary",children:u}),(0,l.jsx)(a.Text,{textStyle:"body-02-medium",color:"$fg.primary",mb:"20px",children:x}),(0,l.jsx)(h,{onRatingClick:t=>{f({rating:t,surveyId:e})},placement:"modal"})]})]}),!b&&(0,l.jsx)(s.ModalFooter,{children:(0,l.jsx)(s.ButtonGroup,{children:(0,l.jsx)(a.Button,{onClick:C,variant:"ghost","data-heapid":"modal-dismiss-close-button",children:"Close"})})})]})]})},j=({surveyId:e})=>
1{const t=p(e),r="true"===localStorage.getItem(t),[g,y]=(0,n.useState)(r),j=(0,n.useRef)(null),{isOpen:f,onOpen:b,onClose:v}=(0,s.useDisclosure)(),{mutate:S,isPending:w,isSuccess:C,isError:I,variables:R}=(0,o.useSubmitSurveyRating)({onSuccess:()=>{j.current=window.setTimeout((()=>{y(!1),localStorage.removeItem("test")}),3e3)}});(0,n.useEffect)((()=>{const e=()=>{y(!0)};return window.addEventListener(m,e),()=>{null!==j.current&&clearTimeout(j.current),window.removeEventListener(m,e)}}),[]);return g&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.Box,{children:(0,l.jsx)(a.Button,{position:"fixed",bottom:"180px",left:{base:"-36px",sm:"-28px"},colorScheme:"teal",transform:"rotate(90deg)",bgColor:"$bg.secondary",color:"$fg.interactive.default",boxShadow:"elevation-l-top",_hover:{textColor:"white",bgColor:"$fg.interactive.default"},onClick:b,"data-heapid":"drawer-open-button",borderRadius:"4px 4px 0 0",zIndex:"1",h:{base:"40px",sm:"auto"},children:"Feedback"})}),(0,l.jsxs)(s.Drawer,{isFullHeight:!1,size:{base:"full",md:"xl"},placement:"left",isOpen:f,onClose:v,autoFocus:!1,children:[(0,l.jsx)(s.DrawerOverlay,{}),(0,l.jsxs)(s.DrawerContent,{borderRadius:"0 4px 4px 0",top:"auto !important",bottom:{md:"100px !important"},p:"24px","data-testid":"customer-survey-rating-drawer",children:[(0,l.jsxs)(s.DrawerBody,{p:"0",children:[w&&(0,l.jsx)(s.Flex,{alignItems:"center",alignContent:"center",children:(0,l.jsx)(s.Box,{m:"6.5rem auto",children:(0,l.jsx)(i.Spinner,{})})}),C&&(0,l.jsx)(c,{}),I&&(0,l.jsx)(d,{handleRetrySubmitRating:()=>{void 0!==R&&S(R)}}),!I&&!C&&!w&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(a.Heading,{mb:"16px",as:"h3",size:"h3",color:"$fg.primary",children:u}),(0,l.jsx)(a.Text,{textStyle:"body-02-medium",color:"$fg.primary",mb:"20px",children:x}),(0,l.jsx)(h,{onRatingClick:t=>{S({rating:t,surveyId:e})}})]})]}),(0,l.jsx)(s.DrawerCloseButton,{"data-heapid":"drawer-close-x-button"})]})]})]})}},11837:(e,t,r)=>{var n=r(77285),o=Symbol.for("react.element"),s=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,a=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,s={},c=null,d=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(d=t.ref),t)i.call(t,n)&&!l.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===s[n]&&(s[n]=t[n]);return{$$typeof:o,type:e,key:c,ref:d,props:s,_owner:a.current}}t.Fragment=s,t.jsx=c,t.jsxs=c},52322:(e,t,r)=>{e.exports=r(11837)}}]);
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.