Build 574548stable
Module 612479
3,055 characters · in d83998dbf0482889.jsDependencies
Source Raw
function(e,n,t){t.d(n,{A:()=>F});var i=t(627968),a=t(64700),l=t(503698),r=t.n(l),s=t(735438),c=t.n(s),d=t(66455),o=t(935462),u=t(534514),h=t(834730),g=t(452027),m=t(260598),p=t(150934),x=t(825484),R=t(821609),A=t(964486),O=t(475743),j=t(235986),E=t(915089),b=t(124480),k=t(174459),N=t(975571),v=t(930932),f=t(321563),C=t(670455),L=t(652215),M=t(375708),S=t(519560);function F(e){let{modalType:n,header:t,body:l,problemTitle:s,problems:F,transitionState:y,ratingOptions:D,ratingEmojiKind:P,ratingTextLabels:T,freeformNeededProblems:B=[],otherKey:G,hideDontShowAgainCheckbox:_,startRating:I=null,hideHelpDeskLink:q=!1,onSubmit:w,onClose:$,impression:z,freeformDescription:H}=e,K=(0,O.A)(F),[U,Z]=a.useState(!1),[Q,V]=a.useState(I),[X,J]=a.useState(null),[W,Y]=a.useState(c().shuffle(F)),[ee,en]=a.useState(""),et=(0,E.GV)(),ei=(0,d.A)(Q),ea=(0,d.A)(U),el=(0,d.A)(X),er=(0,d.A)(w),es=(0,d.A)(ee),ec=null;return null==Q?ec="RATING":Q!==C.P0.GOOD&&null==X?ec="PROBLEM":null!=X&&B.includes(X.value)&&(ec="FREEFORM"),a.useEffect(()=>{c().isEqual(K,F)||Y((0,v.ed)(F,G))},[F,K,G]),(0,A.Ay)(()=>(k.default.track(L.HAw.OPEN_MODAL,{type:n,source:"Feedback Modal"}),()=>{er.current({rating:ei.current,problem:el.current,dontShowAgain:ea.current,feedback:es.current})})),(0,i.jsxs)(o.EO,{"data-migration-pending":!0,impression:z,transitionState:y,className:S.CR,"aria-labelledby":et,parentComponent:"FeedbackModal",children:[(0,i.jsxs)(o.rQ,{"data-migration-pending":!0,separator:!1,className:S.N1,children:[(0,i.jsx)(u.D,{id:et,variant:"heading-xl/extrabold",color:"none",children:t}),(0,i.jsx)(h.E,{variant:"text-md/normal",color:"none",className:S.sB,children:l})]}),("RATING"===ec||"PROBLEM"===ec&&null==T)&&(0,i.jsx)("div",{className:r()(S.OS,S.Ko),children:(0,i.jsx)(f.A,{ratingOptions:D,emojiKind:P,textLabels:T,selectedRating:Q,onChangeRating:function(e){V(e),e===C.P0.GOOD&&$()}})}),"PROBLEM"===ec&&(0,i.jsx)(o.$m,{"data-migration-pending":!0,children:(0,i.jsx)(g.D,{label:s,children:(0,i.jsx)(b.A,{options:W,onClick:function(e){J(e),B.includes(e.value)||$()},hideCaret:e=>{let{value:n}=e;return!B.includes(n)}})})}),"FREEFORM"===ec&&(0,i.jsx)(o.$m,{"data-migration-pending":!0,className:S.__invalid_content,children:(0,i.jsx)(m.f,{label:H?.(X)??M.intl.string(M.t.h95hcn),helperText:q?void 0:M.intl.format(M.t.ybi2tD,{helpdeskURL:N.A.getSubmitRequestURL()}),value:ee,maxLength:C.u0,onChange:en})}),"RATING"===ec&&!_&&(0,i.jsx)(o.jl,{"data-migration-pending":!0,className:S.qr,direction:j.A.Direction.HORIZONTAL,children:(0,i.jsx)(p.S,{checked:U,onChange:()=>Z(!U),label:M.intl.string(M.t["5E9SB9"]),labelType:"secondary"})}),("FREEFORM"===ec||"PROBLEM"===ec&&null!=T)&&(0,i.jsx)(o.jl,{"data-migration-pending":!0,className:S.qr,direction:j.A.Direction.HORIZONTAL,children:(0,i.jsxs)(x.e,{direction:"horizontal-reverse",children:[(0,i.jsx)(R.$,{variant:"secondary",size:"sm",text:M.intl.string(M.t["13/7kX"]),onClick:()=>{"FREEFORM"===ec?(J(null),en("")):V(null)}}),(0,i.jsx)(R.$,{variant:"primary",size:"sm",text:M.intl.string(M.t.geKm7t),onClick:$})]})})]})}}