1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3320],{3644:(e,t,a)=>{a.d(t,{N:()=>i});var r=a(37876);a(14232);var s=a(38422);let i=e=>{let{isOpen:t,onClose:a,title:i,content:l,disclaimer:o,imageUrl:n,imageAlt:c,steps:u}=e;return(0,r.jsx)(s.Modal,{isOpen:t,onClose:a,title:i,titleType:"h4",contentLabel:i,className:"support-help-modal","aria-describedby":"help-modal-description",children:(0,r.jsxs)("div",{className:"support-help-modal__container",id:"help-modal-description",children:[(0,r.jsxs)("div",{className:"support-help-modal__text",children:[(0,r.jsx)(s.Text,{tag:"p",type:"p2",richText:l}),o&&(0,r.jsx)(s.Text,{tag:"p",type:"p2",className:"support-help-modal__disclaimer",children:o}),u&&u.length>0&&(0,r.jsx)("ol",{className:"support-help-modal__steps",children:u.map(e=>(0,r.jsx)("li",{children:(0,r.jsx)(s.Text,{tag:"span",type:"p2-bold",children:e.label})},e.label))})]}),n&&(0,r.jsx)("div",{className:"support-help-modal__image-col",children:(0,r.jsx)(s.Image,{className:"support-help-modal__image",src:n,alt:c||"",enableFallback:!0})})]})})}},11446:(e,t,a)=>{a.d(t,{v:()=>r});function r(e){return e<1024?"".concat(e," B"):e<1048576?"".concat((e/1024).toFixed(1)," KB"):"".concat((e/1048576).toFixed(1)," MB")}},36468:(e,t,a)=>{a.d(t,{p:()=>p});let r=new Set(["p","br","b","i","em","strong","ul","ol","li","h2","h3","h4","h5","h6","a","span","div","blockquote","pre","code","hr","table","thead","tbody","tfoot","tr","th","td","figure","figcaption","img","table","thead","tbody","tfoot","tr","th","td","caption"]),s=new Set(["iframe","video","source"]),i={h1:"h2"},l={a:new Set(["href","target","rel"]),img:new Set(["src","alt","title","width","height"]),th:new Set(["colspan","rowspan","scope"]),td:new Set(["colspan","rowspan"]),iframe:new Set(["src","title","width","height","allow","allowfullscreen"]),video:new Set(["src","poster","width","height","controls","preload"]),source:new Set(["src","type"])},o=new Set(["http:","https:","mailto:","tel:"]),n=new Set(["script","style","object","embed","form","input","button","textarea","select","option","svg","math","canvas"]),c=new Set(["www.youtube.com","youtube.com","www.youtube-nocookie.com","youtube-nocookie.com","player.vimeo.com"]),u={sandbox:"allow-scripts allow-same-origin allow-presentation",referrerpolicy:"strict-origin-when-cross-origin",loading:"lazy"},d=new Set(["img","video","source"]);function p(e){var t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"";let p=new DOMParser().parseFromString(e,"text/html");return!function e(t,a,p){for(let g of Array.from(t.childNodes)){if(g.nodeType!==Node.ELEMENT_NODE){g.hasChildNodes()&&e(g,a,p);continue}let y=g,v=y.tagName.toLowerCase(),x=i[v];x&&(y=function(e,t,a){let r=a.createElement(t);for(let t of Array.from(e.attributes))r.setAttribute(t.name,t.value);for(;e.firstChild;)r.appendChild(e.firstChild);return e.replaceWith(r),r}(y,x,a),v=x);let _=(h=y,m=v,b=p,s.has(m)?b&&("iframe"!==m||function(e){if(!e)return!1;try{let t=new URL(e.trim());return"https:"===t.protocol&&c.has(t.host)}catch(e){return!1}}(h.getAttribute("src")))?"keep":"drop":r.has(m)?"keep":n.has(m)?"drop":"unwrap");if("drop"===_){y.remove();continue}if("unwrap"===_){e(y,a,p);for(var h,m,b,f=y;f.firstChild;)t.insertBefore(f.firstChild,f);f.remove();continue}!function(e,t,a){var r;let s=null!=(r=l[t])?r:new Set;for(let r of Array.from(e.attributes)){let i=r.name.toLowerCase();if(i.startsWith("on")||!s.has(i)){e.removeAttribute(r.name);continue}!function(e,t,a,r,s){("a"===a&&"href"===r||d.has(a)&&"src"===r)&&!function(e,t){let a=e.trim();if(!a)return!1;if(a.startsWith("#")||a.startsWith("/")||a.startsWith("./")||a.startsWith("../"))return!0;let r=t.createElement("a");return r.href=a,!!(r.protocol&&o.has(r.protocol))}(t.value,s)&&e.removeAttribute(t.name)}(e,r,t,i,a)}if("a"===t&&e.hasAttribute("target")){let t=new Set((e.getAttribute("rel")||"").split(/\s+/).filter(Boolean));t.add("noopener"),t.add("noreferrer"),e.setAttribute("rel",Array.from(t).join(" "))}"iframe"===t&&Object.entries(u).forEach(t=>{let[a,r]=t;return e.setAttribute(a,r)}),"video"===t&&e.setAttribute("controls","")}(y,v,a),e(y,a,p)}}(p.body,p,null!=(t=a.allowVideoEmbeds)&&t),p.body.innerHTML}},52098:(e,t,a)=>{a.d(t,{W:()=>i});var r=a(37876);a(14232);var s=a(38422);let i=e=>{let{message:t,className:a,id:i}=e;return t?(0,r.jsx)(s.Text,{type:"p2",tag:"p",className:a,id:i,role:"alert",children:t}):null}},70094:(e,t,a)=>{a.d(t,{q:()=>i});var r=a(14232),s=a(40581);function i(e,t){let{brand:a,country:i,locale:l,currentLocale:o}=e,n=!!t,[c,u]=(0,r.useState)(null!=t?t:null),[d,p]=(0,r.useState)(!n&&!!(a&&i)),[h,m]=(0,r.useState)(!1);return(0,r.useEffect)(()=>
1{if(n)return;if(!a||!i)return void p(!1);let e=!1;return p(!0),m(!1),(0,s.II)({brand:a,country:i,locale:l,currentLocale:o}).then(t=>{e||u(null!=t?t:null)}).catch(()=>{e||m(!0)}).finally(()=>{e||p(!1)}),()=>{e=!0}},[a,i,o,n,l]),{response:c,isLoading:d,hasFetchError:h}}},73320:(e,t,a)=>{a.r(t),a.d(t,{CaseCreation:()=>ez});var r=a(37876),s=a(14232),i=a(89099),l=a(7135),o=a(81796),n=a(38422),c=a(59874),u=a(10552),d=a(1002),p=a(33882),h=a(22322),m=a(51098),b=a(68425),f=a(12903),g=a(95068),y=a(15039),v=a.n(y);let x="inquiry-type",_="complaint-code",C="sub-complaint",N="sub-sub-complaint",j="vital-signs",S="select-order",T=e=>{let{state:t}=e,{t:a}=(0,l.Bd)(),y=(0,i.useRouter)(),{globalConfig:T}=(0,c.h5)(),{aemLocale:w="",locale:k="",brand:I=""}=T,{trackEvent:q}=(0,h.b)(),{isAuthenticated:E}=(0,o.WB)(),D=(0,s.useMemo)(()=>(w||k).replace("-","_"),[w,k]);(0,s.useEffect)(()=>{null!==t.screen&&q({action:"triage_screen_viewed",label:t.screen})},[t.screen,q]);let[P,M]=(0,s.useState)([]),[F,A]=(0,s.useState)(!1),[B,L]=(0,s.useState)(!1),[O,R]=(0,s.use
1State)([]),[V,z]=(0,s.useState)(!1),[W,U]=(0,s.useState)(!1),[G,K]=(0,s.useState)([]),[H,Y]=(0,s.useState)(!1),{pushQuery:Q,replaceQuery:J}=function(){let e=(0,i.useRouter)(),t=(0,s.useCallback)((t,a)=>{let r={};Object.entries(e.query).forEach(e=>{let[t,a]=e;void 0!==a&&(r[t]=a)}),Object.entries(t).forEach(e=>{let[t,a]=e;void 0===a?delete r[t]:r[t]=a}),("replace"===a?e.replace:e.push)({pathname:e.pathname,query:r},void 0,{shallow:!0})},[e]),a=(0,s.useCallback)(e=>t(e,"push"),[t]),r=(0,s.useCallback)(e=>t(e,"replace"),[t]);return(0,s.useMemo)(()=>({pushQuery:a,replaceQuery:r}),[a,r])}();(0,s.useEffect)(()=>{if(t.screen!==x)return;let e=!1;return A(!0),L(!1),(0,u.TB)(D,I).then(t=>{e||((null==t?void 0:t.Success)&&t.InquiryTypes?M(t.InquiryTypes):L(!0))}).catch(()=>{e||L(!0)}).finally(()=>{e||A(!1)}),()=>{e=!0}},[t.screen,D,I]);let X=!!(t.inquiryType&&null!==t.screen&&t.screen!==x),Z=(0,s.useCallback)(e=>{if(t.screen!==_)return;if(0===e.length)return void J({screen:void 0});if(1!==e.length)return;let a=e[0];if(a.subcomplaintcodes.length>0)return void J({screen:C,complaintCode:a.complaintcode});J({screen:j,complaintCode:a.complaintcode,subComplaintCode:"",subSubComplaintCode:""})},[t.screen,J]);(0,s.useEffect)(()=>{if(!X)return;let e=!1;return z(!0),U(!1),R([]),(0,u.en)({inquiryType:t.inquiryType,locale:D,brand:I}).then(t=>{var a;if(e)return;let r=null!=(a=null==t?void 0:t.complaintcodes)?a:[];R(r),Z(r)}).catch(()=>{e||U(!0)}).finally(()=>{e||z(!1)}),()=>{e=!0}},[X,t.inquiryType,D,I]);let $=(0,s.useMemo)(()=>O.find(e=>e.complaintcode===t.complaintCode),[O,t.complaintCode]),ee=(0,s.useMemo)(()=>{var e;if(!t.subComplaintCode||!$)return"";let a=$.subcomplaintcodes.find(e=>e.subcomplaintcode===t.subComplaintCode);return null!=(e=null==a?void 0:a.label)?e:t.subComplaintCode},[$,t.subComplaintCode]),et=[t.inquiryTypeLabel||t.inquiryType,null==$?void 0:$.label,ee,t.subSubComplaintCode].filter(e=>!!e),ea=[null==$?void 0:$.label,ee,t.subSubComplaintCode].filter(Boolean).join(" > ")||void 0,er=(0,g.Hw)(t.inquiryType,E,t.orderNumber)?S:void 0;(0,s.useEffect)(()=>{if(t.screen!==j)return;let e=!1;return Y(!0),K([]),(0,u.DK)({parentcode:"",complaintcode:t.complaintCode,subcomplaintcode:t.subComplaintCode}).then(t=>{var a;if(e)return;let r=null!=(a=null==t?void 0:t.questions)?a:[];if(0===r.length||(null==t?void 0:t.recordCount)===0)return void J({screen:er,vs:"",complaintPath:ea});K(r)}).catch(()=>{e||J({screen:er,vs:"",complaintPath:ea})}).finally(()=>{e||Y(!1)}),()=>{e=!0}},[t.screen,t.complaintCode,t.subComplaintCode,er]);let es=(0,s.useCallback)(e=>{if(q({action:"triage_selection",label:x,value:e.Value}),"Product Troubleshooting"===e.Value)return void y.push((0,b.g2)("/support/categories",y.locale));Q({screen:_,inquiryType:e.Value,inquiryTypeLabel:e.Label})},[Q,q,y]),ei=(0,s.useCallback)(e=>{let t=O.find(t=>t.complaintcode===e);t&&(q({action:"triage_selection",label:_,value:e}),t.subcomplaintcodes.length>0?Q({screen:C,complaintCode:e}):Q({screen:j,complaintCode:e,subComplaintCode:"",subSubComplaintCode:""}))},[O,Q,q]),el=(0,s.useCallback)(e=>{var t;if(!$)return;q({action:"triage_selection",label:C,value:e});let a=$.subcomplaintcodes.find(t=>t.subcomplaintcode===e);(null==a||null==(t=a.subsubcomplaintcodes)?void 0:t.length)?Q({screen:N,subComplaintCode:e}):Q({screen:j,subComplaintCode:e,subSubComplaintCode:""})},[$,Q,q]),eo=(0,s.useCallback)(e=>{q({action:"triage_selection",label:N,value:e}),Q({screen:j,subSubComplaintCode:e})},[Q,q]),en=(0,s.useCallback)(e=>{q({action:"vital_signs_completed",label:j,value:String(e.length)}),Q({screen:er,vs:function(e){if(0===e.length)return"";try{return window.btoa(JSON.stringify(e))}catch(e){return""}}(e)||void 0,complaintPath:ea})},[Q,er,ea,q]),ec=(0,s.useCallback)(e=>{q({action:"triage_selection",label:S,value:e}),J({screen:void 0,orderNumber:e,complaintPath:ea})},[J,q,ea]),eu=(0,s.useCallback)(()=>{q({action:"triage_selection",label:S,value:"manual"}),J({screen:void 0,orderNumber:void 0,complaintPath:ea})},[J,q,ea]),ed=(0,s.useCallback)(()=>{Q({screen:x,inquiryType:void 0,inquiryTypeLabel:void 0,complaintCode:void 0,subComplaintCode:void 0,subSubComplaintCode:void 0})},[Q]),ep=(0,s.useCallback)(()=>{Q({screen:_,subComplaintCode:"",subSubComplaintCode:""})},[Q]),eh=(0,s.useCallback)(()=>{Q({screen:C,subSubComplaintCode:""})},[Q]),em=(0,s.useMemo)(()=>[{label:a("sh-triage-breadcrumb-back","Support"),href:(0,b.g2)("/support",y.locale)},{label:a("sh-triage-breadcrumb-current","Create case"),href:(0,b.g2)("/support/create-case",y.locale)},{label:a("sh-triage-breadcrumb-triage","Tell us about your issue")}],[a,y.locale]),eb=(0,m.dU)(t.screen);return(0,r.jsxs)("div",{className:"support-hub-case-triage","data-testid":"support-hub-case-triage",children:[(0,r.jsx)(d.DQ,{items:em,testId:"support-hub-case-triage-breadcrumbs"}),(0,r.jsx)(d.zY,{title:a("sh-triage-banner-title","Create a Support Case"),subtitle:a("sh-triage-banner-subtitle","Select the type of support you need"),centered:!0,testId:"support-hub-case-triage-banner"}),(0,r.jsx)(n.Grid,{className:"mt-10",children:(0,r.jsx)(n.Row,{children:(0,r.jsxs)(n.Col,{xs:12,lg:8,lgOffset:2,children:[(0,r.jsx)(p.i,{returnPath:y.asPath,className:"mt-20 mb-20",description:a("sh-triage-login-prompt-description","Sign in to speed up your support request with your saved details.")}),et.length>0&&(0,r.jsx)(d.cE,{className:v()("mb-20",{"mt-20":E}),levels:et,testId:"support-hub-case-triage-selected-category"}),(0,r.jsxs)("div",{className:"support-hub-programmatic-focus-target mt-40",ref:eb,tabIndex:-1,"data-testid":"support-hub-case-triage-active-screen",children:[t.screen===x&&(0,r.jsx)(f.Sp,{options:P,onSelect:es,isLoading:F,hasError:B}),t.screen===_&&(0,r.jsxs)("div",{"data-testid":"support-hub-case-triage-complaint-code",children:[W&&(0,r.jsx)(d.W5,{message:a("sh-triage-complaint-code-error","Failed to load options. Please try again."),testId:"triage-complaint-code-error"}),(0,r.jsx)(f.lI,{codes:O,onSelect:ei,isLoading:V,heading:a("sh-triage-complaint-code-title","What's the issue?"),className:"support-hub-case-triage__section",gridClassName:"support-hub-case-triage__pill-grid",cellClassName:"support-hub-case-triage__pill-cell"}),(0,r.jsx)(n.ButtonV2,{variant:"primary",fill:"borderless",size:"sm",icon:{iconName:"arrow-left",iconPrefix:"fak"},alignIcon:"left",text:a("sh-triage-back","Back"),onClick:ed,className:"mt-20","data-testid":"support-hub-case-triage-back"})]}),(t.screen===C||t.screen===N)&&$&&(0,r.jsx)(f.Gu,{selectedComplaint:$,selectedSubComplaint:t.subComplaintCode,onSelectSubComplaint:el,onSelectSubSubComplaint:eo,onBackToCategories:ep,onBackToSubComplaints:eh,showHierarchy:!1}),t.screen===j&&H&&(0,r.jsx)(d.Gu,{message:a("sh-triage-vital-signs-loading","Loading questionsâ¦"),testId:"support-hub-case-triage-vital-loading"}),t.screen===j&&!H&&G.length>0&&(0,r.jsx)(f.L_,{questions:G,onSubmit:en,isLoading:!1}),t.screen===S&&(0,r.jsx)(f.Df,{onSelectOrder:ec,onManualEntry:eu})]})]})})})]})},w=new Set(["Website Issue","Website and Account Inquiry","Website & Account","General Inquiry","Feedback"]),
1k="Product Troubleshooting",I=new Set(["troubleshoot-fail","troubleshoot-unavailable","order-issue","default"]),q="product",E="case-details",D="your-details",P="terms",M="inquiry-type",F="complaint",A="order";function B(e){var t;return"string"==typeof e?e:Array.isArray(e)&&null!=(t=e.at(0))?t:""}let L={"troubleshoot-fail":{prefilled:[F,"vital-signs",q],loggedInCollects:[q,E],loggedOutCollects:[D,q,E,P],inquiryType:k},"troubleshoot-unavailable":{prefilled:[F,q],loggedInCollects:[q,E],loggedOutCollects:[D,q,E,P],inquiryType:k},"order-issue":{prefilled:[M],loggedInCollects:[E],loggedOutCollects:[D,A,E,P],inquiryType:"Order Issue"},default:{prefilled:[M],loggedInCollects:[E],loggedOutCollects:[D,E,P],inquiryType:""}};function O(e,t){var a;let r=function(e){let t=e.toLowerCase();return I.has(t)?t:"default"}(B(e.source)),s=L[r],i=function(e,t){let a=B(e.inquiryType).trim(),r=B(e.inquiry).trim();return a||r||t}(e,s.inquiryType),l=function(e,t){if(!(0,g.eS)(t)||e.includes(A))return e;let a=e.indexOf(E);return -1===a?[...e,A]:[...e.slice(0,a),A,...e.slice(a)]}((a=t?s.loggedInCollects:s.loggedOutCollects,w.has(i)?a.filter(e=>e!==q):a),i);return{source:r,prefilled:new Set(s.prefilled),needsToCollect:l,inquiryType:i}}var R=a(77502),V=a(51476),z=a(10808);let W={TROUBLESHOOTING:{description:!0,fileUpload:!0},ORDER_ISSUE:{description:!0,fileUpload:!0},GENERAL_INQUIRY:{description:!0,fileUpload:!0},WEBSITE_ISSUE:{description:!0,fileUpload:!1},PROMOTION:{description:!0,fileUpload:!0},FEEDBACK:{description:!0,fileUpload:!1},OTHER:{description:!0,fileUpload:!0}},U={description:!0,fileUpload:!0},G=()=>{let{trackEvent:e}=(0,m.bs)();return{trackPageView:(0,s.useCallback)(t=>{t&&e({action:"".concat(t,"_viewed")})},[e]),trackAction:(0,s.useCallback)((t,a)=>{e({action:t,...a?{label:JSON.stringify(a)}:{}})},[e])}};var K=a(25671),H=a(11446),Y=a(52098),Q=a(92332),J=a(96434),X=a(99742);async function Z(e,t,a){try{let r=await (0,J.b)(e),s=await (0,u.vX)({Title:e.name,PathOnClient:e.name,VersionData:r,ContentLocation:"S",FirstPublishLocationId:t,NetworkId:X.env.NEXT_PUBLIC_SF_NETWORK_ID||""});if(s.success)return{success:!0,attachmentId:s.id};return{success:!1,errorMessage:a}}catch(e){return{success:!1,errorMessage:(0,V.V)(e)||a}}}function $(){let e=new Uint32Array(2);return crypto.getRandomValues(e),Date.now().toString(36)+Array.from(e,e=>e.toString(36)).join("")}function ee(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}let et="sh-cc-upload-failed",ea="Upload failed. Please try again.",er="sh-cc-add-attachments",es="Add attachments",ei="sh-cc-file-upload-error",el=e=>{let{readOnly:t=!1,hideHeader:a=!1,onAfterUpload:i}=e,{t:o}=(0,l.Bd)(),{attachments:c,addAttachment:d,updateAttachment:p}=(0,z.u0)(),{caseId:h,caseNumber:m}=(0,z.uP)(),{trackAction:b}=G(),{sfUserId:f}=(0,Q.x)(),g=(0,s.useCallback)(async e=>{let t=!1;for(let a of e){let e=$();b("attachment_upload_started",{fileExtension:ee(a.name),fileSize:a.size,fileType:a.type}),d({id:e,fileName:a.name,fileSize:a.size,fileType:a.type,status:"uploading"});let r=o(et,ea),s=await Z(a,f,r);s.success&&s.attachmentId?(p({id:e,status:"uploaded",attachmentId:s.attachmentId}),b("attachment_upload_succeeded",{fileExtension:ee(a.name),fileSize:a.size,attachmentId:s.attachmentId}),m&&h&&(await (0,u.Gm)(h,{AttachmentIds:[s.attachmentId]}).catch(e=>{K.A.clientError("Failed to link attachment to case",e)}),t=!0)):(p({id:e,status:"error",errorMessage:s.errorMessage}),b("attachment_upload_failed",{fileExtension:ee(a.name),fileSize:a.size,errorMessage:s.errorMessage}))}t&&(null==i||i())},[d,p,f,o,m,h,i,b]);if(t)return 0===c.length?null:(0,r.jsxs)("div",{className:"support-hub-file-upload-section","data-testid":"support-hub-file-upload-section",children:[!a&&(0,r.jsx)(n.Text,{type:"h6",tag:"h2",children:o(er,es)}),(0,r.jsx)("ul",{className:"support-hub-file-upload-section__file-list","aria-label":o(er,es),children:c.map(e=>(0,r.jsxs)("li",{className:"support-hub-file-upload-section__file-item",children:[(0,r.jsx)(n.Text,{type:"p2",tag:"span",children:e.fileName}),(0,r.jsx)(n.Text,{type:"p3",tag:"span",className:"support-hub-file-upload-section__file-size",children:(0,H.v)(e.fileSize)})]},e.id))})]});let y=c.filter(e=>"error"===e.status),v=y.length>0,x=o(er,es);return(0,r.jsxs)("div",{className:"support-hub-file-upload-section","data-testid":"support-hub-file-upload-section",children:[!a&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(n.Text,{type:"h6",tag:"h2",children:x})}),(0,r.jsxs)("fieldset",{className:"support-hub-file-upload-section__field","aria-describedby":v?ei:void 0,children:[(0,r.jsx)("legend",{className:a?"xps__label":"support-hub-file-upload-section__sr-only",children:(0,r.jsx)(n.Text,{tag:"span",type:"p3",children:x})}),(0,r.jsx)(n.FileUpload,{dataFromFileProp:g,maxSize:6291456,multiple:!0,maxFiles:10,fileTypesMessage:o("sh-cc-file-type-not-supported","File type not supported. Please upload JPG, PNG, or PDF."),maxFileSizeMessage:o("sh-cc-file-too-large",{defaultValue:"File exceeds {{maxMb}} MB limit.",maxMb:6}),uploadButtonLabel:o("sh-cc-choose-files","Choose files"),maxFilesMsg:o("sh-cc-max-files-reached","Maximum number of files reached.")}),(0,r.jsx)(n.Text,{type:"p3",tag:"p",className:"support-hub-file-upload-section__hint",children:o("sh-cc-attachments-subtitle","Sharing images can help us diagnose the issue faster.")}),y.map((e,t)=>(0,r.jsx)(Y.W,{id:0===t?ei:void 0,message:e.errorMessage||o(et,ea),className:"support-hub-file-upload-section__error"},e.id))]})]})},eo="sh-cc-issue-description-error",en=e=>{let{mode:t="edit",configOverride:a,hideActions:i=!1,disableTracking:o=!1,showOrderNumber:c=!1,onContinue:u,descriptionError:d}=e,{t:p}=(0,l.Bd)(),{subject:h,description:m,attachments:b,orderNumber:f,setDescription:g,setOrder
1Number:y}=(0,z.u0)(),{flowType:v}=(0,z.cj)(),{trackPageView:x,trackAction:_}=G();(0,s.useEffect)(()=>{o||x("generic_form")},[]);let C=a||(v?W[v]:U)||U,N=c?{...C,orderNumber:!0}:C,j=N.descriptionMaxLength||255,[S,T]=(0,s.useState)(!1),w=(0,s.useCallback)(e=>{y(e.target.value)},[y]),k=(0,s.useCallback)(e=>{g(e.target.value)},[g]),I="review"===t,q=b.some(e=>"uploading"===e.status),E=I&&!S,D=!I||S,P=(0,s.useCallback)(()=>{_("form_completed",{hasSubject:!!h,hasDescription:!!m.trim(),descriptionLength:m.trim().length,attachmentCount:b.filter(e=>"uploaded"===e.status).length,hasOrderNumber:!!f}),null==u||u()},[_,h,m,b,f,u]);return(0,r.jsxs)("div",{"data-testid":"support-hub-generic-form",className:"support-hub-generic-form",children:[N.orderNumber&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"support-hub-generic-form__section",children:(0,r.jsx)(n.TextField,{"data-testid":"support-hub-generic-form__order-number",name:"orderNumber",id:"sh-cc-order-number",label:p("sh-cc-order-number-optional","Order Number (optional)"),placeholder:p("sh-cc-order-number-placeholder","12345678"),value:f,onChange:w,variant:"lg"})}),N.description&&(0,r.jsx)(n.Separator,{})]}),N.description&&(0,r.jsxs)("div",{className:"support-hub-generic-form__section",children:[(0,r.jsx)(n.Text,{tag:"label",type:"p3",htmlFor:"sh-cc-issue-description",className:"xps__label",children:p("sh-cc-issue-description","Issue Description")}),E&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Text,{type:"p2",tag:"p",children:m||p("sh-cc-no-description","No description provided")}),(0,r.jsx)(n.ButtonV2,{"data-testid":"support-hub-generic-form__edit-description",className:"support-hub-generic-form__edit-toggle",variant:"primary",fill:"borderless",underLineOnHover:!0,size:"sm",text:p("sh-cc-edit","Edit"),onClick:()=>T(!0)})]}),D&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"xps__text-field support-hub-generic-form__textarea-wrapper",children:[(0,r.jsx)("textarea",{"data-testid":"support-hub-generic-form__description",name:"description",id:"sh-cc-issue-description",className:"xps__input xps__input--lg support-hub-generic-form__textarea".concat(d?" xps__input--error":""),value:m,onChange:k,maxLength:j,placeholder:p("sh-cc-description-placeholder","Please provide as much detail as possible about your issue"),"aria-label":p("sh-cc-issue-description","Issue Description"),"aria-invalid":!!d||void 0,"aria-describedby":d?eo:void 0,"aria-required":!0,required:!0}),(0,r.jsx)(n.Text,{type:"p3",tag:"span",className:"support-hub-generic-form__char-count",children:"".concat(m.length,"/").concat(j)}),d&&(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-generic-form__error",id:eo,"aria-live":"polite","data-testid":"support-hub-generic-form__description-error",children:d})]}),I&&(0,r.jsx)(n.ButtonV2,{"data-testid":"support-hub-generic-form__done-description",className:"support-hub-generic-form__edit-toggle",variant:"primary",fill:"borderless",size:"sm",text:p("sh-cc-done","Done"),onClick:()=>T(!1)})]})]}),N.fileUpload&&(0,r.jsx)("div",{className:"support-hub-generic-form__section",children:(0,r.jsx)(el,{readOnly:I,hideHeader:!0})}),"edit"===t&&!i&&(0,r.jsx)("div",{className:"support-hub-generic-form__actions",children:(0,r.jsx)(n.ButtonV2,{"data-testid":"support-hub-generic-form__next-btn",variant:"primary",shape:"pill",fill:"filled",text:p("sh-cc-continue","Continue"),onClick:P,disabled:q})})]})};var ec=a(47830),eu=a(90819);let ed="sh-cc-phone-error",ep=e=>{var t,a,o;let{errors:c}=e,{t:u}=(0,l.Bd)(),d=(0,i.useRouter)(),{yourDetails:p,setYourDetails:h}=(0,z.u0)(),m=(0,b.J6)(d.locale),[f,g]=(0,s.useState)(m),[y,v]=(0,s.useState)(!1),x=(0,s.useCallback)(e=>t=>{h({[e]:t.target.value})},[h]),_=(0,s.useCallback)((e,t)=>{t&&g(t),h({phone:e})},[h]),C=y&&p.phone&&!(0,eu.FY)(p.phone,f).isValid?u("sh-cc-phone-invalid","Please enter a valid phone number"):"";return(0,r.jsxs)("section",{className:"support-hub-case-creation__section","data-testid":"support-hub-case-creation-your-details",children:[(0,r.jsx)(n.Text,{tag:"h2",type:"h6",className:"support-hub-case-creation__section-title",children:u("sh-cc-personal-heading","Your Details")}),(0,r.jsxs)("div",{className:"support-hub-case-creation__row support-hub-case-creation__row--two-col",children:[(0,r.jsx)(n.TextField,{id:"sh-cc-first-name",label:u("sh-cc-first-name","First Name *"),placeholder:u("sh-cc-first-name-placeholder","Enter your first name"),value:p.firstName,onChange:x("firstName"),showError:!!(null==c?void 0:c.firstName),errorText:null!=(t=null==c?void 0:c.firstName)?t:"",required:!0,"data-testid":"support-hub-case-creation-first-name"}),(0,r.jsx)(n.TextField,{id:"sh-cc-last-name",label:u("sh-cc-last-name","Last Name *"),placeholder:u("sh-cc-last-name-placeholder","Enter your last name"),value:p.lastName,onChange:x("lastName"),showError:!!(null==c?void 0:c.lastName),errorText:null!=(a=null==c?void 0:c.lastName)?a:"",required:!0,"data-testid":"support-hub-case-creation-last-name"})]}),(0,r.jsxs)("div",{className:"support-hub-case-creation__row support-hub-case-creation__row--two-col",children:[(0,r.jsx)(n.TextField,{id:"sh-cc-email",type:"email",label:u("sh-cc-email","Email Address *"),placeholder:u("sh-cc-email-placeholder","Enter your email address"),value:p.email,onChange:x("email"),showError:!!(null==c?void 0:c.email),errorText:null!=(o=null==c?void 0:c.email)?o:"",required:!0,"data-testid":"support-hub-case-creation-email"}),(0,r.jsxs)("div",{className:"support-hub-case-creation__field",children:[(0,r.jsxs)("div",{className:"xps__text-field",children:[(0,r.jsx)(n.Text,{tag:"label",type:"p3",htmlFor:"sh-cc-phone",className:"xps__label",children:u("sh-cc-phone","Phone Number")}),(0,r.jsx)("div",{className:"xps__input-wrapper",children:(0,r.jsx)(ec.L,{id:"sh-cc-phone",className:"xps__input xps__input--lg",defaultCountry:m,value:p.phone,onNumberChanged:_,onBlur:()=>v(!0),placeholder:u("sh-cc-phone-placeholder","Enter your phone number"),"aria-invalid":!!C,"aria-describedby":C?ed:void 0,"data-testid":"support-hub-case-creation-phone"})}),C&&(0,r.jsx)(n.Alert,{id:ed,type:"error",message:C,inline:!0,className:"xps__helper-text"})]}),(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-case-creation__hint",children:u("sh-cc-phone-hint","Provide if you would prefer an agent to call you back.")})]})]})]})};var eh=a(38698),em=a(40581),eb=a(3644);let ef=e=>{let{id:t,value:a,onChange:i,label:o,placeholder:c,expectedItemNumber:u,isSerialNumberTracked:d=!1,onValidationResult:p,className:h,"data-testid":m}=e,{t:b}
1=(0,l.Bd)(),[f,g]=(0,s.useState)(!1),[y,x]=(0,s.useState)(null),_=(0,s.useCallback)(e=>{i(e.target.value),y&&x(null),null==p||p("unvalidated")},[i,y,p]),C=(0,s.useCallback)(async()=>{let e=a.trim();if(!e){null==p||p("unvalidated");return}try{let t=await (0,em.KX)({serial:e,lookup:!!u});if(!t.valid){x(d?b("serial-number-invalid-tracked","This doesn't appear to be a valid serial number. Please check and try again."):b("serial-number-invalid-untracked","This serial number format doesn't look quite right. Please check and try again.")),null==p||p("invalid");return}u&&!t.serial_records.some(e=>e.ItemID===u)&&x(b("serial-number-no-match","This serial number does not match your selected appliance.")),null==p||p("valid")}catch(e){x(b("serial-number-validation-error","Unable to validate your serial number. Please try again.")),null==p||p("unvalidated")}},[a,u,d,p,b]),N=[{label:b("product-model-number","Model number")},{label:b("serial-number","Serial number")},{label:b("batch-code","Batch code")}];return(0,r.jsxs)("div",{className:v()("serial-number-field",h),children:[(0,r.jsx)(n.TextField,{id:t,label:null!=o?o:b("serial-number","Serial number"),placeholder:null!=c?c:b("serial-number-placeholder","e.g. 123456789ABCD"),value:a,onChange:_,onBlur:C,showError:!!y,errorText:null!=y?y:"","data-testid":m}),(0,r.jsx)(n.ButtonV2,{type:"button",variant:"primary",fill:"borderless",size:"sm",text:b("need-help-finding-serial","Need help finding your serial number?"),onClick:()=>g(!0),ariaLabel:b("serial-number-help-aria","Get help finding your serial number"),className:"serial-number-field__help-link","data-testid":m?"".concat(m,"-help-link"):void 0}),(0,r.jsx)(eb.N,{isOpen:f,onClose:()=>g(!1),title:b("where-is-my-serial-number","Where is my serial number located?"),content:b("rating-label-description","Find the rating label which is typically located on the back or bottom of our appliances. The label will be a sticker or a box of information molded into the product itself. If you have a coffee or espresso product, the rating label may be under or behind the removable water tank or catch tray."),disclaimer:b("rating-label-disclaimer",'Example only. The placement of the "product model number" & "batch code" may differ slightly on your product.'),imageUrl:"/images/support/serial-label-diagram.png",imageAlt:b("rating-label-image-alt","Appliance rating label showing model number, serial number, and batch code"),steps:N})]})},eg="support-hub-case-creation-variant-error",ey="sh-cc-upload-failed",ev="Upload failed. Please try again.",ex=e=>{var t,a,i,o,d,p;let{errors:h,variantsData:m}=e,{t:b}=(0,l.Bd)(),{productDetails:f,setProductDetails:g,attachments:y,addAttachment:v,updateAttachment:x,removeAttachment:_}=(0,z.u0)(),{globalConfig:C}=(0,c.h5)(),{brand:N="",sfCountryCode:j="",aemLocale:S="",locale:T=""}=C,{trackAction:w}=G(),{sfUserId:k}=(0,Q.x)(),[I,q]=(0,s.useState)(null),{options:E,isLoading:D}=function(e){let{brand:t,country:a,locale:r,currentLocale:i}
1=e,[l,o]=(0,s.useState)([]),[n,c]=(0,s.useState)(!1),[d,p]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(!t||!a||!r)return void o([]);let e=!1;return c(!0),p(!1),(0,u.cP)({brand:t,country:a,locale:r,currentLocale:i}).then(t=>{e||o(Array.isArray(t)?t:[])}).catch(()=>{e||(p(!0),o([]))}).finally(()=>{e||c(!1)}),()=>{e=!0}},[t,a,r,i]),{options:(0,s.useMemo)(()=>l.map(e=>({value:e,label:e})),[l]),isLoading:n,hasError:d}}({brand:N,country:j,locale:S,currentLocale:T}),P=(0,s.useMemo)(()=>(function(){let e=new Date,t=e.getFullYear(),a="".concat(e.getMonth()+1).padStart(2,"0"),r="".concat(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(r)})(),[]),M=(0,s.useMemo)(()=>{var e;return null!=(e=y.find(e=>e.id===I))?e:null},[y,I]),F=(0,s.useMemo)(()=>{var e;return null!=(e=null==m?void 0:m.variants)?e:[]},[null==m?void 0:m.variants]),A=null!=(t=null==m?void 0:m.selectedVariant)?t:null,B=null==m?void 0:m.selectVariant,L=null!=(a=null==m?void 0:m.isLoading)&&a,O=(0,s.useMemo)(()=>(0,eh.FD)(F)||[],[F]),R=(0,s.useMemo)(()=>{if(!A)return -1;let e=F.findIndex(e=>e.Ax_Item_Number===A.Ax_Item_Number);return e>=0?e:-1},[A,F]),V=(0,s.useCallback)(e=>{let t=F[e];t&&B&&B(t)},[F,B]),W=(0,s.useCallback)(e=>{g({serialNumber:e})},[g]),U=(0,s.useCallback)(e=>{g({serialNumberValidity:e})},[g]),K=(0,s.useCallback)(e=>{g({condition:e.target.value})},[g]),H=(0,s.useCallback)(e=>{g({purchaseDate:e.target.value})},[g]),J=(0,s.useCallback)(e=>{g({placeOfPurchase:e.target.value})},[g]),X=(0,s.useCallback)(async e=>{let t=null==e?void 0:e[0];if(!t){I&&_(I),q(null),g({proofOfPurchaseAttachmentId:null});return}let a=$();q(a),w("proof_of_purchase_upload_started",{fileExtension:ee(t.name),fileSize:t.size,fileType:t.type}),v({id:a,fileName:t.name,fileSize:t.size,fileType:t.type,status:"uploading"});let r=b(ey,ev),s=await Z(t,k,r);s.success&&s.attachmentId?(x({id:a,status:"uploaded",attachmentId:s.attachmentId}),g({proofOfPurchaseAttachmentId:s.attachmentId}),w("proof_of_purchase_upload_succeeded",{fileExtension:ee(t.name),fileSize:t.size,attachmentId:s.attachmentId})):(x({id:a,status:"error",errorMessage:s.errorMessage}),g({proofOfPurchaseAttachmentId:null}),w("proof_of_purchase_upload_failed",{fileExtension:ee(t.name),fileSize:t.size,errorMessage:s.errorMessage}))},[v,x,_,I,g,k,b,w]),et=null!=(i=null==m?void 0:m.hasNewVariants)&&i,ea=null!=(o=null==m?void 0:m.hasRemanufacturedVariants)&&o,er=(0,s.useMemo)(()=>[...et?["NEW"]:[],...ea?["Remanufactured"]:[]],[et,ea]),es=1===er.length?er.at(0):void 0;(0,s.useEffect)(()=>{!L&&es&&f.condition!==es&&g({condition:es})},[L,es,f.condition,g]);let ei=(0,s.useMemo)(()=>[{value:"",label:b("sh-cc-condition-placeholder","Select conditionâ¦")},...et?[{value:"NEW",label:b("sh-cc-condition-new","New")}]:[],...ea?[{value:"Remanufactured",label:b("sh-cc-condition-remanufactured","Refurbished")}]:[]],[b,et,ea]),el=(0,s.useMemo)(()=>[{value:"",label:b("sh-cc-place-of-purchase-placeholder","Select place of purchaseâ¦")},...E],[E,b]),eo=er.length>1&&!L,en=F.length>1&&!L,ec=(0,r.jsxs)("fieldset",{className:"support-hub-case-creation__field","data-testid":"support-hub-case-creation-variant-selector","aria-describedby":(null==h?void 0:h.variant)?eg:void 0,children:[(0,r.jsx)("legend",{className:"xps__label",children:(0,r.jsx)(n.Text,{tag:"span",type:"p3",children:b("sh-cc-color-label","Color *")})}),A&&(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-case-creation__field-value","data-testid":"support-hub-case-creation-variant-selected",children:A.ColorTranslation}),(0,r.jsx)("div",{className:"support-hub-case-creation__swatches",children:(0,r.jsx)(n.SwatchPicker,{colors:O,defaultIndex:R,onClick:V,swatchClickable:!0})}),(null==h?void 0:h.variant)&&(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-case-creation__field-error",id:eg,"aria-live":"polite","data-testid":eg,children:h.variant})]}),eu=(0,r.jsx)(n.Dropdown,{id:"sh-cc-condition",label:b("sh-cc-condition","New or Refurbished *"),value:f.condition,onChange:K,options:ei,errorText:null!=(d=null==h?void 0:h.condition)?d:"",required:!0,"data-testid":"support-hub-case-creation-condition"});return(0,r.jsxs)("section",{className:"support-hub-case-creation__section","data-testid":"support-hub-case-creation-product-details",children:[(0,r.jsx)(n.Text,{tag:"h2",type:"h6",className:"support-hub-case-creation__section-title",children:b("sh-cc-product-details-heading","Product Details")}),(0,r.jsx)("div",{className:"support-hub-case-creation__row",children:(0,r.jsx)(ef,{id:"sh-cc-serial",label:b("sh-cc-serial","Serial Number"),placeholder:b("sh-cc-serial-placeholder","e.g., BES920XL12345678"),value:f.serialNumber,onChange:W,expectedItemNumber:null==A?void 0:A.Ax_Item_Number,isSerialNumberTracked:null!=(p=null==m?void 0:m.isSerialNumberTracked)&&p,onValidationResult:U,"data-testid":"support-hub-case-creation-serial"})}),(eo||en)&&(0,r.jsxs)("div",{className:"support-hub-case-creation__row support-hub-case-creation__row--two-col",children:[eo&&eu,en&&ec]}),(0,r.jsxs)("div",{className:"support-hub-case-creation__row support-hub-case-creation__row--two-col",children:[(0,r.jsx)(n.TextField,{id:"sh-cc-purchase-date",type:"date",label:b("sh-cc-purchase-date","Purchase Date"),value:f.purchaseDate,onChange:H,max:P,"data-testid":"support-hub-case-creation-purchase-date"}),(0,r.jsx)(n.Dropdown,{id:"sh-cc-place-of-purchase",label:b("sh-cc-place-of-purchase","Place of Purchase"),value:f.placeOfPurchase,onChange:J,options:el,disabled:D,"data-testid":"support-hub-case-creation-place-of-purchase"})]}),(0,r.jsxs)("div",{className:"support-hub-case-creation__row","data-testid":"support-hub-case-creation-proof-of-purchase",children:[(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-case-creation__hint",children:b("sh-cc-proof-of-purchase-hint","Upload a re
1ceipt or invoice (optional). JPG, PNG or PDF.")}),(0,r.jsx)(n.FileUpload,{dataFromFileProp:X,maxSize:6291456,maxFiles:1,fileTypesMessage:b("sh-cc-file-type-not-supported","File type not supported. Please upload JPG, PNG, or PDF."),maxFileSizeMessage:b("sh-cc-file-too-large",{defaultValue:"File exceeds {{maxMb}} MB limit.",maxMb:6}),uploadButtonLabel:b("sh-cc-choose-files","Choose files"),maxFilesMsg:b("sh-cc-max-files-reached","Maximum number of files reached.")}),M&&"error"!==M.status&&(0,r.jsx)(n.Text,{tag:"p",type:"p3","data-testid":"support-hub-case-creation-proof-of-purchase-name",children:"uploading"===M.status?b("sh-cc-uploading",{defaultValue:"Uploading {{fileName}}â¦",fileName:M.fileName}):M.fileName}),(null==M?void 0:M.status)==="error"&&(0,r.jsx)(Y.W,{message:M.errorMessage||b(ey,ev),className:"support-hub-case-creation__proof-of-purchase-error"})]})]})},e_=[{value:"Product Troubleshooting",label:"Product Troubleshooting"},{value:"Order Issue",label:"Order Issue"},{value:"General Inquiry",label:"General Inquiry"},{value:"Website & Account",label:"Website & Account"},{value:"Promotion",label:"Promotion"},{value:"Feedback",label:"Feedback"},{value:"Other",label:"Other"}],eC=e=>{let{options:t,error:a}=e,{t:i}=(0,l.Bd)(),{inquiryType:o,setInquiryType:c}=(0,z.u0)(),u=(0,s.useMemo)(()=>{let e=null!=t?t:e_;return[{value:"",label:i("sh-cc-inquiry-type-placeholder","Select inquiry typeâ¦")},...e]},[t,i]),d=(0,s.useCallback)(e=>{let t=e.target.value;c(""===t?null:t)},[c]);return(0,r.jsxs)("section",{className:"support-hub-case-creation__section","data-testid":"support-hub-case-creation-inquiry-type-section",children:[(0,r.jsx)(n.Text,{tag:"h2",type:"h6",className:"support-hub-case-creation__section-title",children:i("sh-cc-inquiry-type-heading","Inquiry Type")}),(0,r.jsx)(n.Dropdown,{id:"sh-cc-inquiry-type",label:i("sh-cc-inquiry-type","Inquiry Type *"),value:null!=o?o:"",onChange:d,options:u,errorText:null!=a?a:"",required:!0,"data-testid":"support-hub-case-creation-inquiry-type"})]})},eN=e=>{let{error:t}=e,{t:a}=(0,l.Bd)(),{orderNumber:i,setOrderNumber:o}=(0,z.u0)(),c=(0,s.useCallback)(e=>{o(e.target.value)},[o]);return(0,r.jsxs)("section",{className:"support-hub-case-creation__section","data-testid":"support-hub-case-creation-order-details",children:[(0,r.jsx)(n.Text,{tag:"h2",type:"h6",className:"support-hub-case-creation__section-title",children:a("sh-cc-order-details-heading","Order Details")}),(0,r.jsxs)("div",{className:"support-hub-case-creation__row",children:[(0,r.jsx)(n.TextField,{id:"sh-cc-order-number",label:a("sh-cc-order-number","Order Number *"),placeholder:a("sh-cc-order-number-placeholder","12345678"),value:i,onChange:c,showError:!!t,errorText:null!=t?t:"",required:!0,"data-testid":"support-hub-case-creation-order-number"}),(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-case-creation__hint",children:a("sh-cc-order-number-hint","Find this on your order confirmation email. The order number must match the email you provide above.")})]})]})};var ej=a(36468);let eS="sh-cc-terms-error",eT=e=>{let{error:t}=e,{t:a}=(0,l.Bd)(),{termsAccepted:i,setTermsAccepted:o}=(0,z.u0)(),c=(0,s.useCallback)(e=>{o(e.target.checked)},[o]),u=(0,s.useMemo)(()=>(0,ej.p)(a("sh-cc-legal-confirm",'I confirm the information I provided is accurate and I accept the <a href="/en-us/legal/terms-of-use-and-sale" target="_blank">Terms of Use & Sale</a> and acknowledge that I have read the <a href="/en-us/legal/privacy-notice" target="_blank">Privacy Notice</a>.')),[a]);return(0,r.jsxs)("section",{className:"support-hub-case-creation__section","data-testid":"support-hub-case-creation-terms-section",children:[(0,r.jsx)(n.CheckBox,{id:"sh-cc-terms",checked:i,onChange:c,richText:u,required:!0,"aria-required":!0,"aria-invalid":!!t||void 0,"aria-describedby":t?eS:void 0,"data-testid":"support-hub-case-creation-terms"}),t&&(0,r.jsx)(n.Text,{tag:"p",type:"p3",className:"support-hub-case-creation__field-error",id:eS,"aria-live":"polite","data-testid":"support-hub-case-creation-terms-error",children:t})]})},ew=e=>{let{config:t,inquiryOptions:a,errors:s,variantsData:i,registerSectionRef:o}=e,{t:c}=(0,l.Bd)(),u=e=>t.needsToCollect.includes(e);return(0,r.jsxs)(r.Fragment,{children:[u("order")&&(0,r.jsx)("div",{className:"support-hub-programmatic-focus-target",ref:null==o?void 0:o("order"),tabIndex:-1,
1children:(0,r.jsx)(eN,{error:null==s?void 0:s.order})}),u("your-details")&&(0,r.jsx)("div",{className:"support-hub-programmatic-focus-target",ref:null==o?void 0:o("your-details"),tabIndex:-1,children:(0,r.jsx)(ep,{errors:null==s?void 0:s.yourDetails})}),u("inquiry-type")&&(0,r.jsx)("div",{className:"support-hub-programmatic-focus-target",ref:null==o?void 0:o("inquiry-type"),tabIndex:-1,children:(0,r.jsx)(eC,{options:a,error:null==s?void 0:s.inquiry})}),u("product")&&(0,r.jsx)("div",{className:"support-hub-programmatic-focus-target",ref:null==o?void 0:o("product"),tabIndex:-1,children:(0,r.jsx)(ex,{errors:null==s?void 0:s.product,variantsData:i})}),u("case-details")&&(0,r.jsxs)("section",{ref:null==o?void 0:o("case-details"),tabIndex:-1,className:"support-hub-case-creation__section support-hub-programmatic-focus-target","data-testid":"support-hub-case-creation-case-details",children:[(0,r.jsx)(n.Text,{tag:"h2",type:"h6",className:"support-hub-case-creation__section-title",children:c("sh-cc-case-details-heading","Case details")}),(0,r.jsx)(en,{mode:"edit",hideActions:!0,disableTracking:!0,descriptionError:null==s?void 0:s.description})]}),u("terms")&&(0,r.jsx)("div",{className:"support-hub-programmatic-focus-target",ref:null==o?void 0:o("terms"),tabIndex:-1,children:(0,r.jsx)(eT,{error:null==s?void 0:s.terms})})]})},ek=e=>{let{createdCase:t,productName:a,serialNumber:o,isAuthenticated:c}=e,{t:u}=(0,l.Bd)(),d=(0,i.useRouter)();return(0,s.useEffect)(()=>{window.scrollTo({top:0})},[]),(0,r.jsx)("div",{className:"support-hub-case-creation","data-testid":"support-hub-case-creation-success",children:(0,r.jsx)("div",{className:"support-hub-case-creation__content",children:(0,r.jsxs)("div",{className:"support-hub-case-creation__success",children:[(0,r.jsx)(n.Text,{tag:"h1",type:"h3",className:"support-hub-case-creation__title",children:u("sh-cc-success-title","Support Case Created")}),(0,r.jsx)(n.Text,{tag:"p",type:"p1",className:"support-hub-case-creation__subtitle",children:u("sh-cc-success-subtitle","Your case has been submitted successfully. Our support team will review it and get back to you soon.")}),(0,r.jsxs)("dl",{className:"support-hub-case-creation__case-summary","aria-label":u("sh-cc-case-details","Case Details"),children:[(0,r.jsxs)("div",{className:"support-hub-case-creation__case-row",children:[(0,r.jsx)("dt",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2",children:u("sh-cc-case-number","Case Number")})}),(0,r.jsx)("dd",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2-bold",children:t.CaseNumber})})]}),a&&(0,r.jsxs)("div",{className:"support-hub-case-creation__case-row",children:[(0,r.jsx)("dt",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2",children:u("sh-cc-product","Product")})}),(0,r.jsx)("dd",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2-bold",children:a})})]}),o&&(0,r.jsxs)("div",{className:"support-hub-case-creation__case-row",children:[(0,r.jsx)("dt",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2",children:u("sh-cc-serial-number","Serial Number")})}),(0,r.jsx)("dd",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2-bold",children:o})})]}),(0,r.jsxs)("div",{className:"support-hub-case-creation__case-row",children:[(0,r.jsx)("dt",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2",children:u("sh-cc-expected-response","Expected Response")})}),(0,r.jsx)("dd",{children:(0,r.jsx)(n.Text,{tag:"span",type:"p2-bold",children:u("sh-cc-response-eta","Within 2 business days")})})]})]}),(0,r.jsxs)("div",{className:"support-hub-case-creation__success-actions",children:[(0,r.jsx)(n.ButtonV2,{variant:"primary",fill:"filled",size:"lg",shape:"pill",text:u("sh-cc-return-home","Return to Support Home"),onClick:()=>d.push("/support"),"data-testid":"support-hub-case-creation-return-home"}),c&&(0,r.jsx)(n.ButtonV2,{variant:"primary",fill:"outlined",size:"lg",shape:"pill",text:u("sh-cc-view-cases","View My Cases"),href:(0,b.g2)("/my-account/support/cases",d.locale),"data-testid":"support-hub-case-creation-view-cases"})]})]})})})},eI="order",eq="your-details",eE="inquiry-type",eD="product",eP="case-details",eM="terms",eF=[eI,eq,eE,eD,eP,eM];function eA(e){var t;return"string"==typeof e?e:Array.isArray(e)&&null!=(t=e.at(0))?t:""}var eB=a(70094);function eL(e,t){if(!e||!t)return null;for(let r of e){var a;let e=null==(a=r.ParentProducts)?void 0:a.find(e=>e.WebParentCode===t);if(e)return e}return null}async function eO(e){let{isAuthenticated:t,payload:a,complaintCode:r,source:s,hasSerialNumber:i,fallbackError:l,trackEvent:o,submission:n,setCreatedCase:c}=e;try{let e=t?u.bx:R.E,d=await e(a);if(!d.Success){o({action:"case_submit_failed",error:Error(d.ErrorMessage||l),complaintCode:r,source:s}),n.setSubmissionError(d.ErrorMessage||l);return}o({action:"case_submitted",caseId:d.CaseId,caseNumber:d.CaseNumber,complaintCode:r,source:s,hasSerialNumber:i}),n.setCaseId({caseId:d.CaseId,caseNumber:d.CaseNumber}),c(d)}catch(t){let e=(0,V.V)(t);o({action:"case_submit_failed",error:t instanceof Error?t:Error(e||l),complaintCode:r,source:s}),n.setSubmissionError(e||l)}finally{n.setSubmitting(!1)}}let eR={"troubleshoot-fail":{titleKey:"sh-cc-banner-title",titleDefault:"Thanks for giving our troubleshooting a go",subtitleKey:"sh-cc-banner-subtitle",subt
1itleDefault:"This issue might need some help from our experts. Let's get this case submitted to get you connected with our support team."},"troubleshoot-unavailable":{titleKey:"sh-cc-banner-title-unavailable",titleDefault:"Let's get you connected with our support team",subtitleKey:"sh-cc-banner-subtitle-unavailable",subtitleDefault:"We don't have troubleshooting steps for this issue yet, so an expert will need to take a closer look. Submit the details below and we'll be in touch."},"order-issue":{titleKey:"sh-cc-banner-title-order-issue",titleDefault:"Let's sort out your order issue",subtitleKey:"sh-cc-banner-subtitle-order-issue",subtitleDefault:"Share a few details about your order below and our support team will get back to you as soon as possible."},default:{titleKey:"sh-cc-banner-title-default",titleDefault:"We're here to help",subtitleKey:"sh-cc-banner-subtitle-default",subtitleDefault:"Fill out the details below and our support team will get back to you as soon as possible."}},eV=()=>{let{t:e}=(0,l.Bd)(),t=(0,i.useRouter)(),{isAuthenticated:a}=(0,o.WB)(),{globalConfig:u}=(0,c.h5)(),{brand:m="",sfCountryCode:f="",aemLocale:y="",locale:v=""}=u,x=(0,s.useMemo)(()=>O(t.query,a),[t.query,a]),_=(0,s.useMemo)(()=>(function(e){let t=(eA(e.complaintPath)||"").split(">").map(e=>e.trim()).filter(Boolean);return{sku:eA(e.sku)||eA(e.webParentCode),variantSku:eA(e.variantSku),productName:eA(e.productName),category:eA(e.category),complaintPath:t,inquiryType:eA(e.inquiryType),inquiryTypeLabel:eA(e.inquiryTypeLabel),complaintCode:eA(e.complaintCode),subComplaintCode:eA(e.subComplaintCode),subSubComplaintCode:eA(e.subSubComplaintCode),searchQuery:eA(e.q).trim()}})(t.query),[t.query]),C=(0,s.useMemo)(()=>[_.inquiryTypeLabel||_.inquiryType,..._.complaintPath].filter(Boolean),[_.inquiryTypeLabel,_.inquiryType,_.complaintPath]),N=(0,z.u0)(),j=(0,z.uP)(),{selectedVariant:S}=(0,z.ZE)(),{trackEvent:T}=(0,h.b)();(0,s.useEffect)(()=>{let e=eA(t.query.orderNumber);
1e&&e!==N.orderNumber&&N.setOrderNumber(e)},[t.query.orderNumber]);let w=(0,s.useRef)(!1);(0,s.useEffect)(()=>{!w.current&&(!_.searchQuery||N.description.trim()||(w.current=!0,N.setDescription(_.searchQuery)))},[_.searchQuery]);let k=function(e){var t,a,r,i;let{parentSku:l,variantSku:o,condition:n,brand:c,country:u,locale:d,currentLocale:p}=e,{selectedVariant:h,selectVariant:m}=(0,z.ZE)(),{response:b,isLoading:f,hasFetchError:g}=(0,eB.q)({brand:c,country:u,locale:d,currentLocale:p},null),y=(0,s.useMemo)(()=>eL(null==b?void 0:b.Products,l),[b,l]),v=(0,s.useMemo)(()=>eL(null==b?void 0:b.RMProducts,l),[b,l]),x=null!=y?y:v,_=(0,s.useMemo)(()=>{var e;return null!=(e=null==y?void 0:y.Variants)?e:[]},[y]),C=(0,s.useMemo)(()=>{var e;return null!=(e=null==v?void 0:v.Variants)?e:[]},[v]),N=(0,s.useMemo)(()=>[..._,...C],[_,C]),j=(0,s.useMemo)(()=>"NEW"===n?_:"Remanufactured"===n?C:[],[n,_,C]);return(0,s.useEffect)(()=>{if(!o||h)return;let e=(n?j:N).find(e=>e.Ax_Item_Number===o);e&&m(e)},[o,n,j,N,h,m]),(0,s.useEffect)(()=>{if(!h){if(1===N.length)return void m(N[0]);n&&1===j.length&&m(j[0])}},[N,j,n,h,m]),(0,s.useEffect)(()=>{if(!h)return;let e=n?j:N;0!==e.length&&(e.some(e=>e.Ax_Item_Number===h.Ax_Item_Number)||m(null))},[j,N,n,h,m]),{variants:j,selectedVariant:h,selectVariant:m,productName:null!=(a=null==x?void 0:x.WebName)?a:"",productImageUrl:null!=(r=null==(t=N.at(0))?void 0:t.ProductImageUrl)?r:null,isLoading:f,hasError:g,hasNewVariants:_.length>0,hasRemanufacturedVariants:C.length>0,isSerialNumberTracked:null!=(i=null==h?void 0:h.IsSerialNumberTracked)?i:N.some(e=>e.IsSerialNumberTracked)}}({parentSku:_.sku,variantSku:_.variantSku,condition:N.productDetails.condition,brand:m,country:f,locale:y,currentLocale:v}),I=k.variants.length>1&&!k.isLoading,q=k.hasNewVariants&&k.hasRemanufacturedVariants&&!k.isLoading,[E,D]=(0,s.useState)(null),[P,M]=(0,s.use
1State)(!1),F=(0,s.useRef)({}),A=(0,s.useCallback)(e=>t=>{F.current[e]=t},[]),{validity:B,errors:L}=(0,s.useMemo)(()=>(function(e){let{form:t,t:a,variantPickerVisible:r,conditionFieldVisible:s,hasSelectedVariant:i,isSerialTracked:l}=e,{yourDetails:o,productDetails:n,inquiryType:c,orderNumber:u,description:d,termsAccepted:p}=t,h=a("sh-cc-validation-required","This field is required."),m=l&&"invalid"===n.serialNumberValidity,b={yourDetails:{firstName:o.firstName.trim()?void 0:h,lastName:o.lastName.trim()?void 0:h,email:o.email.trim()?void 0:h},product:{variant:r&&!i?a("sh-cc-validation-color","Please select a color."):void 0,condition:s&&!n.condition?h:void 0},inquiry:c?void 0:h,order:u.trim()?void 0:h,description:d.trim()?void 0:h,terms:p?void 0:a("sh-cc-validation-terms","You must accept the Terms & Conditions to continue.")};return{validity:{yourDetails:!b.yourDetails.firstName&&!b.yourDetails.lastName&&!b.yourDetails.email,product:!b.product.variant&&!b.product.condition&&!m,inquiry:!b.inquiry,order:!b.order,caseDetails:!b.description,terms:!b.terms},errors:b}})({form:N,t:e,variantPickerVisible:I,conditionFieldVisible:q,hasSelectedVariant:!!S,isSerialTracked:k.isSerialNumberTracked}),[N,e,I,q,S,k.isSerialNumberTracked]),R=(0,s.useMemo)(()=>{let e=x.needsToCollect;return[["your-details",B.yourDetails],["product",B.product],["inquiry-type",B.inquiry],["order",B.order],["case-details",B.caseDetails],["terms",B.terms]].every(t=>{let[a,r]=t;return!e.includes(a)||r})},[x.needsToCollect,B]),V=(0,s.useMemo)(()=>{if(!P)return{yourDetails:{},product:{}};let e=x.needsToCollect;return{yourDetails:e.includes("your-details")?L.yourDetails:{},product:e.includes("product")?L.product:{},inquiry:e.includes("inquiry-type")?L.inquiry:void 0,order:e.includes("order")?L.order:void 0,description:e.includes("case-details")?L.description:void 0,terms:e.includes("terms")?L.terms:void 0}},[P,L,x.needsToCollect]),W=(0,s.useCallback)(async()=>{if(j.isSubmitting)return;if(!R){M(!0),function(e,t,a){var r;let[s]=function(e,t){let a={[eq]:!!(e.yourDetails.firstName||e.yourDetails.lastName||e.yourDetails.email),[eD]:!!(e.product.variant||e.product.condition),[eE]:!!e.inquiry,[eI]:!!e.order,[eP]:!!e.description,[eM]:!!e.terms,complaint:!1,"vital-signs":!1};return eF.filter(e=>t.includes(e)&&a[e])}(e,t);null==(r=a[s])||r.focus()}(L,x.needsToCollect,F.current);return}j.setSubmissionError(null),j.setSubmitting(!0);let t=(y||v).replace("-","_"),r=_.inquiryType||x.inquiryType||N.inquiryType||"",s=_.complaintCode||N.complaintCode,i=_.subComplaintCode||N.subComplaintCode,l=_.subSubComplaintCode||N.subSubComplaintCode,o=N.attachments.filter(e=>"uploaded"===e.status&&e.attachmentId).map(e=>e.attachmentId),n=function(e){var t,a,r,s,i,l,o,n,c,u,d,p,h,m,b,f,y,v,x,_,C,N,j,S,T;let w=null!=(a=e.complaintLabels)?a:[],k=(null!=(r=e.productName)?r:"").trim(),I={serialNumber:(null!=(n=null==(i=e.productDetails)?void 0:i.serialNumber)?n:"").trim(),purchaseDate:(null!=(c=null==(l=e.productDetails)?void 0:l.purchaseDate)?c:"").trim(),storeName:(null!=(u=null==(o=e.productDetails)?void 0:o.placeOfPurchase)?u:"").trim(),batchCode:(null!=(d=e.batchCode)?d:"").trim(),assetId:(null!=(p=e.assetId)?p:"").trim(),orderNumber:(null!=(h=e.orderNumber)?h:"").trim(),complaintCode:(null!=(m=e.complaintCode)?m:"").trim(),subComplaintCode:(null!=(b=e.subComplaintCode)?b:"").trim(),subSubComplaintCode:(null!=(f=e.subSubComplaintCode)?f:"").trim(),vitalSigns:null!=(y=e.vitalSigns)?y:[],attachmentIds:null!=(v=e.attachmentIds)?v:[],...(_=e.yourDetails,C=null!=(x=e.isAnonymous)&&x,{email:(null!=(N=null==_?void 0:_.email)?N:"").trim(),firstName:(null!=(j=null==_?void 0:_.firstName)?j:"").trim(),lastName:(null!=(S=null==_?void 0:_.lastName)?S:"").trim(),phone:(null!=(T=null==_?void 0:_.phone)?T:"").trim(),isAnonymous:C})},q=(null==(t=e.selectedVariant)?void 0:t.Ax_Item_Number)||e.itemNumber;return{Origin:"Web",SubOrigin:"supportHub",isTroubleshootingComplete:null!=(s=e.isTroubleshootingComplete)&&s,Brand:e.brand,ItemNumber:q,Locale:e.apiLocale,InquiryType:e.inquiryType,Subject:function(e,t,a,r){let s=(null!=e?e:"").trim();if(s)return s;let i=t.at(-1);return i||a||((0,g.eS)(r)?"Order Issue":"Support Request")}(e.subject,w,k,e.inquiryType),Description:e.description.trim(),Region:e.sfCountryCode,...function(e){var t,a,r,s,i;let l={};return(t=e.serialNumber)&&(l.SerialNumber=t),(a=e.batchCode)&&(l.BatchCode=a),(r=e.assetId)&&(l.AssetId=r),(s=e.purchaseDate)&&(l.PurchaseDate=s),(i=e.storeName)&&(l.StoreName=i),l}(I),...function(e){var t,a,r,s;let i={};return(t=e.complaintCode)&&(i.ComplaintCode=t),(a=e.subComplaintCode)&&(i.SubComplaintCode=a),(r=e.subSubComplaintCode)&&(i.SubSubComplaintCode=r),(s=e.orderNumber)&&(i.OrderNumber=s),e.vitalSigns.length>0&&(i.VitalSigns=e.vitalSigns),e.attachmentIds.length>0&&(i.AttachmentIds=e.attachmentIds),i}(I),...function(e){var t,a,r,s;if(!e.isAnonymous)return{};let i={};return(t=e.email)&&(i.Email=t),(a=e.firstName)&&(i.FirstName=a),(r=e.lastName)&&(i.LastName=r),(s=e.phone)&&(i.PhoneNumber=s),i}(I)}}({brand:m,apiLocale:t,sfCountryCode:f,isTroubleshootingComplete:"troubleshoot-fail"===x.source,itemNumber:_.variantSku||_.sku,inquiryType:r,subject:N.subject,description:N.description,productName:_.productName,complaintLabels:_.complaintPath,productDetails:N.productDetails,complaintCode:s,subComplaintCode:i,subSubComplaintCode:l,vitalSigns:N.vitalSigns,orderNumber:N.orderNumber,attachmentIds:o,yourDetails:N.yourDetails,isAnonymous:!a,selectedVariant:S}),c=e("sh-cc-submit-error","Failed to create support case. Please try again.");await eO({isAuthenticated:a,payload:n,complaintCode:s,source:x.source,hasSerialNumber:!!N.productDetails.serialNumber,fallbackError:c,trackEvent:T,submission:j,setCreatedCase:D})},[R,j,y,v,m,f,_,x,N,e,a,S,L,T]);if(E)return(0,r.jsx)(ek,{createdCase:E,productName:_.productName,serialNumber:N.productDetails.serialNumber,isAuthenticated:a});let U=eR[x.source];return(0,r.jsxs)("div",{className:"support-hub-case-creation","data-testid":"support-hub-case-creation",children:[(0,r.jsx)(n.Loader,{isLoading:j.isSubmitting}),(0,r.jsx)(d.DQ,{items:[{label:e("sh-categories-breadcrumb-back","Support"),href:(0,b.g2)("/support",t.locale)},{label:e("sh-cc-breadcrumb-current","Create case")}],testId:"support-hub-case-creation-breadcrumbs"}),(0,r.jsx)(d.zY,{title:e(U.titleKey,U.titleDefault),subtitle:e(U.subtitleKey,U.subtitleDefault),centered:!0,testId:"support-hub-case-creation-banner"}),(0,r.jsx)(n.Grid,{className:"mt-30 mb-50",children:(0,r.jsx)(n.Row,{children:(0,r.jsx)(n.Col,{xs:12,lg:8,lgOffset:2,children:(0,r.jsxs)("div",{className:"support-hub-case-creation__content",children:[(0,r.jsx)(p.i,{returnPath:t.asPath,className:"support-hub-case-creation__login-prompt",description:e("sh-cc-login-prompt-description","Sign in to speed up your support request with your saved details.")}),C.length>0&&(0,r.jsx)(d.cE,{levels:C,testId:"support-hub-case-creation-context"}),(0,r.jsx)(ew,{config:x,errors:V,variantsData:k,registerSectionRef:A}),j.error&&(0,r.jsx)(d.W5,{message:j.error,testId:"support-hub-case-creation-error"}),(0,r.jsxs)("div",{className:"support-hub-case-creation__actions",children:[(0,r.jsx)(n.ButtonV2,{variant:"primary",fill:"outlined",size:"lg",shape:"pill",text:e("sh-cc-back","Back"),onClick:()=>t.back(),"data-testid":"support-hub-case-creation-back"}),(0,r.jsx)(n.ButtonV2,{variant:"primary",fill:"filled",size:"lg",shape:"pill",text:j.isSubmitting?e("sh-cc-submitting","Submittingâ¦"):e("sh-cc-submit","Create Support Case"),onClick:W,disabled:j.isSubmitting,"data-testid":"support-hub-case-creation-submit"})]})]})})})})]})},ez=e=>{let{t}=(0,l.Bd)(),a=(0,i.useRouter)(),{isAuthenticated:n}=(0,o.WB)(),{trackEvent:c}=(0,h.b)(),u=(0,s.useMemo)(()=>O(a.query,n),[a.query,n]),p=(0,s.useMemo)(()=>(0,g.uw)(a.query),[a.query]);return((0,s.useEffect)(()=>
1{if(a.isReady)c({action:"create_case_entry_viewed",source:u.source,prefilled:Array.from(u.prefilled)}),null===p.screen&&"default"===u.source&&((0,g.ME)(p)||a.replace({pathname:a.pathname,query:{...a.query,screen:"inquiry-type"}},void 0,{shallow:!0}))},[a.isReady,u.source]),a.isReady)?null!==p.screen?(0,r.jsx)(T,{state:p}):(0,r.jsx)(eV,{...e}):(0,r.jsx)("div",{className:"support-hub-case-creation","data-testid":"support-hub-case-creation-loading",children:(0,r.jsx)(d.Gu,{message:t("sh-cc-hydrating","Loadingâ¦"),testId:"support-hub-case-creation-hydrating",rows:8})})}},92332:(e,t,a)=>{a.d(t,{x:()=>l});var r=a(14232),s=a(81796),i=a(33428);function l(){let{isAuthenticated:e,isLoading:t}=(0,s.WB)(),[a,l]=(0,r.useState)(""),[o,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{if(t||!e)return;let a=!1;return n(!0),(0,i.vF)().then(e=>{var t,r,s,i;a||(l(e.success&&null!=(i=null==(s=e.data)||null==(r=s.records)||null==(t=r[0])?void 0:t.Id)?i:""),n(!1))}),()=>{a=!0}},[t,e]),{sfUserId:a,isLoading:o}}},96434:(e,t,a)=>{a.d(t,{b:()=>r});function r(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=()=>{t(r.result.split(",")[1])},r.onerror=()=>a(Error("Failed to read file")),r.readAsDataURL(e)})}}}]);
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.