PageSourceSearch

https://www.celebrateally.com/_next/static/chunks/60688-5d4f03113f30b8c0.js

js celebrateally.com collected 2026-10-08 08:29:35 UTC 29,537 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[60688],{60688:function(e,t,n){n.d(t,{pX:function(){return Q},Uz:function(){return $.U},GG:function(){return se}});var s=n(57437),r=n(2265),a=n(21001),o=n(42163);const i="Chat with Ally",l="AI help assistant",c="New chat";function u(e){let{titleId:t,onClose:n,onReset:r,busy:a=!1}=e;return(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2 border-b border-rose-100 bg-white px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex min-w-0 items-center gap-2.5",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"flex h-9 w-9 flex-none items-center justify-center rounded-full bg-rose-100 text-rose-600",children:"\ud83d\udcac"}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{id:t,className:"truncate text-sm font-semibold text-slate-900",children:i}),(0,s.jsxs)("p",{className:"mt-0.5 flex items-center gap-1 truncate text-xs text-slate-500",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"h-1.5 w-1.5 flex-none rounded-full bg-emerald-500"}),l]})]})]}),(0,s.jsxs)("div",{className:"flex flex-none items-center gap-1",children:[r&&(0,s.jsx)("button",{type:"button",onClick:r,disabled:a,"aria-label":"End this chat and start a new one","data-testid":"assistant-reset",className:"rounded-full px-2 py-1 text-xs font-medium text-rose-600 transition hover:bg-rose-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400 disabled:cursor-not-allowed disabled:opacity-40",children:c}),(0,s.jsx)("button",{type:"button",onClick:n,"aria-label":"Close help","data-testid":"assistant-close",className:"rounded-full p-1 text-slate-400 hover:bg-rose-50 hover:text-rose-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",children:(0,s.jsx)("span",{"aria-hidden":"true",children:"\u2715"})})]})]})}var d=n(54887);const f='a[href],button:not([disabled]),textarea:not([disabled]),input:not([disabled]),select:not([disabled]),[tabindex]:not([tabindex="-1"])';function m(e){let{open:t,onClose:n,id:a,labelledBy:o,children:i}=e;const[l,c]=(0,r.useState)(!1),u=(0,r.useRef)(null),m=(0,r.useRef)(null);(0,r.useEffect)((()=>c(!0)),[]),(0,r.useEffect)((()=>{var e;if(t)return m.current=document.activeElement instanceof HTMLElement?document.activeElement:null,null===(e=u.current)||void 0===e||e.focus(),()=>{var e,t;null===(t=m.current)||void 0===t||null===(e=t.focus)||void 0===e||e.call(t)}}),[t]),(0,r.useEffect)((()=>{var e;if(!t)return;if("function"!==typeof window.matchMedia)return;const n=window.matchMedia("(max-width: 767px)"),s=[document.documentElement,document.body];let r=[];const a=()=>{n.matches&&0===r.length?(r=s.filter((e=>"hidden"!==e.style.overflow)),r.forEach((e=>{e.style.overflow="hidden"}))):!n.matches&&r.length>0&&o()},o=()=>{r.forEach((e=>{"hidden"===e.style.overflow&&(e.style.overflow="")})),r=[]};return a(),null===(e=n.addEventListener)||void 0===e||e.call(n,"change",a),()=>{var e;null===(e=n.removeEventListener)||void 0===e||e.call(n,"change",a),o()}}),[t]);const b=(0,r.useCallback)((e=>{if("Escape"===e.key)return e.stopPropagation(),void n();if("Tab"!==e.key)return;const t=u.current;if(!t)return;const s=Array.from(t.querySelectorAll(f)).filter((e=>null!==e.offsetParent||e===document.activeElement));if(0===s.length)return e.preventDefault(),void t.focus();const r=s[0],a=s[s.length-1],o=document.activeElement;!e.shiftKey||o!==r&&o!==t?e.shiftKey||o!==a||(e.preventDefault(),r.focus()):(e.preventDefault(),a.focus())}),[n]);return l&&t?(0,d.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-[102]","data-testid":"assistant-shell",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-slate-900/40 md:hidden",onClick:n,"data-testid":"assistant-backdrop","aria-hidden":"true"}),(0,s.jsx)("div",{className:"absolute inset-0 hidden md:block md:pointer-events-none","aria-hidden":"true"}),(0,s.jsx)("div",{id:a,ref:u,role:"dialog","aria-modal":"true","aria-labelledby":o,tabIndex:-1,onKeyDown:b,className:"absolute inset-x-0 bottom-0 flex max-h-[85vh] flex-col overflow-hidden overscroll-contain rounded-t-2xl bg-white shadow-2xl outline-none pb-[env(safe-area-inset-bottom)] md:inset-x-auto md:bottom-4 md:right-4 md:h-[560px] md:max-h-[calc(100vh-4rem)] md:w-[380px] md:rounded-2xl md:pb-0",children:i})]}),document.body):null}const b="<<<END_OF_RESULT>>>";function h(e){if(e.startsWith("/"))return e;try{const t=new URL(e);return"https:"===t.protocol||"http:"===t.protocol?e:null}catch(t){return null}}function p(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){if("object"!==typeof n||null===n)continue;const e=n;if("string"!==typeof e.label)continue;const s=e.label;switch(e.type){case"link":"string"===typeof e.href&&t.push({type:"link",label:s,href:e.href});break;case"reply":"string"===typeof e.sends&&t.push({type:"reply",label:s,sends:e.sends,..."row"===e.display||"pill"===e.display?{display:e.display}:{},..."string"===typeof e.sublabel?{sublabel:e.sublabel}:{}});break;case"escalate":t.push({type:"escalate",label:s});break;case"verify_email":t.push({type:"verify_email",label:s,..."string"===typeof e.email?{email:e.email}:{}})}}return t}function x(e){if("object"!==typeof e||null===e)return null;const t=e;if("string"!==typeof t.text)return null;const n=function(e){if("object"!==typeof e||null===e)return;const t=e;if("number"!==typeof t.pageNumber)return;const n="string"===typeof t.imageUrl?h(t.imageUrl):null;return{pageNumber:t.pageNumber,..."string"===typeof t.text?{text:t.text}:{},...n?{imageUrl:n}:{}}}(t.pagePreview);return{text:t.text,actions:p(t.actions),feedback:!0===t.feedback,conversationId:"string"===typeof t.conversationId?t.conversationId:"",...n?{pagePreview:n}:{}}}const g="inline-flex items-center gap-1 rounded-full border border-rose-300 bg-white px-3 py-1.5 text-sm font-medium text-rose-700 transition hover:border-rose-400 hover:bg-rose-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",y="flex w-full items-center gap-2 rounded-xl border border-rose-200 bg-white px-3 py-2 text-left transition hover:border-rose-300 hover:bg-rose-50/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400";function v(e){let{actions:t,onReply:n,onEscalate:r,onVerifyEmail:a}=e;if(0===t.length)return null;const o=e=>"reply"===e.type&&"row"===e.display,i=t.filter(o),l=t.filter((e=>!o(e)));return(0,s.jsxs)("div",{className:"mt-2 flex flex-col gap-2","data-testid":"assistant-actions",children:[i.length>0&&(0,s.jsx)("div",{className:"flex flex-col gap-1.5",children:i.map(((e,t)=>"reply"===e.type?(0,s.jsxs)("button",{type:"button",className:y,onClick:()=>n(e.sends),children:[(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"block truncate text-sm font-medium text-slate-900",children:e.label}),e.sublabel&&(0,s.jsx)("span",{className:"mt-0.5 block truncate text-xs text-slate-500",children:e.sublabel})]}),(0,s.jsx)("span",{"aria-hidden":"true",className:"flex-none text-rose-300",children:"\u203a"})]},"row-".concat(t)):null))}),l.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:l.map(((e,t)=>{switch(e.type){case"link":{const n=h(e.href);return n?(0,s.jsx)("a",{href:n,className:g,target:n.startsWith("/")?void 0:"_blank",rel:n.startsWith("/")?void 0:"noreferrer noopener",children:e.label},t):null}case"reply":return(0,s.jsx)("button",{type:"button",className:g,onClick:()=>n(e.sends),children:e.label},t);case"escalate":return(0,s.jsx)("button",{type:"button",className:g,onClick:r,children:e.label},t);case"verify_email":return(0,s.jsx)("button",{type:"button",className:g,onClick:()=>a(e.email),children:e.label},t);default:return null}}))})]})}function w(e){let{preview:t}=e;const n=t.imageUrl?h(t.imageUrl):null;return(0,s.jsxs)("div",{className:"mt-2 flex gap-3 rounded-2xl border border-rose-100 bg-white p-3","data-testid":"assistant-page-preview",children:[n&&(0,s.jsx)("img",{src:n,alt:"Page ".concat(t.pageNumber),className:"h-20 w-16 flex-none rounded-lg object-cover"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"text-xs font-medium text-slate-500",children:["Page ",t.pageNumber]}),t.text&&(0,s.jsx)("p",{className:"mt-0.5 line-clamp-3 text-sm text-slate-800",children:t.text})]})]})}var j=n(46485);function k(e){let{onVote:t,onReason:n,onEscalate:a}=e;const[o,i]=(0,r.useState)(null),[l,c]=(0,r.useState)(!1);return"up"===o?(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-500","data-testid":"assistant-feedback-thanks",children:j.Vo}):"down"===o?l?(0,s.jsx)("p",{className:"mt-2 text-xs text-slate-500","data-testid":"assistant-feedback-thanks",children:j.Vo}):(0,s.jsxs)("div",{className:"mt-2","data-testid":"assistant-feedback-reasons",children:[(0,s.jsx)("p",{className:"text-xs text-slate-500",children:"What went wrong?"}),(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:j.JB.map((e=>(0,s.jsx)("button",{type:"button",className:"rounded-full border border-rose-200 px-2.5 py-1 text-xs text-rose-700 hover:bg-rose-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",onClick:()=>{n(e.id),c(!0),e.escalates&&a()},children:e.label},e.id)))})]}):(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2","data-testid":"assistant-feedback",children:[(0,s.jsx)("span",{className:"text-xs text-slate-500",children:j.AO}),(0,s.jsx)("button",{type:"button","aria-label":"This was helpful",className:"rounded px-1 text-base leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",onClick:()=>{i("up"),t("up")},children:"\ud83d\udc4d"}),(0,s.jsx)("button",{type:"button","aria-label":"This was not helpful",className:"rounded px-1 text-base leading-none focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",onClick:()=>i("down"),children:"\ud83d\udc4e"})]})}function N(){return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1","data-testid":"assistant-typing",children:[(0,s.jsx)("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-slate-400 [animation-delay:-0.3s]"}),(0,s.jsx)("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-slate-400 [animation-delay:-0.15s]"}),(0,s.jsx)("span",{className:"h-1.5 w-1.5 animate-bounce rounded-full bg-slate-400"})]})}function C(e){let{messages:t,status:n,onSend:a,onEscalate:o,onVerifyEmail:i,onFeedback:l,onClose:c,onReset:d,titleId:f}=e;const[m,b]=(0,r.useState)(""),h=(0,r.useRef)(null);return(0,r.useEffect)((()=>{const e=h.current;e&&(e.scrollTop=e.scrollHeight)}),[t]),(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":"assistant-chat-panel",children:[(0,s.jsx)(u,{titleId:f,onClose:c,onReset:d,busy:"streaming"===n}),(0,s.jsx)("div",{ref:h,className:"min-h-0 flex-1 space-y-3 overflow-y-auto overscroll-contain bg-rose-50/30 px-4 py-3",role:"log","aria-live":"polite","aria-relevant":"additions text","data-testid":"assistant-log",children:t.map((e=>{if("user"===e.role)return(0,s.jsx)("div",{className:"flex justify-end",children:(0,s.jsx)("p",{className:"max-w-[85%] rounded-2xl rounded-br-sm bg-rose-100 px-3 py-2 text-sm text-rose-900",children:e.text})},e.id);const t=e.streaming&&0===e.text.length;return(0,s.jsxs)("div",{"data-testid":"assistant-message",className:"flex items-end gap-2",children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"flex h-7 w-7 flex-none items-center justify-center rounded-full bg-rose-100 text-sm text-rose-600",children:"\ud83d\udcac"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:e.isError?"max-w-[90%] rounded-2xl rounded-bl-sm bg-amber-50 px-3 py-2 text-sm text-amber-900":"max-w-[90%] rounded-2xl rounded-bl-sm border border-rose-100 bg-white px-3 py-2 text-sm text-slate-900",role:e.isError?"alert":t?"status":void 0,"aria-label":t?"Ally is typing":void 0,"data-testid":e.isError?"assistant-error":void 0,children:[(0,s.jsx)("span",{className:"whitespace-pre-wrap",children:e.text}),t&&(0,s.jsx)(N,{})]}),!e.streaming&&e.pagePreview&&(0,s.jsx)(w,{preview:e.pagePreview}),!e.streaming&&(0,s.jsx)(v,{actions:e.actions,onReply:a,onEscalate:o,onVerifyEmail:i}),!e.streaming&&e.feedback&&(0,s.jsx)(k,{onVote:t=>l(e.id,t),onReason:t=>l(e.id,"down",t),onEscalate:o})]})]},e.id)}))}),(0,s.jsxs)("form",{className:"border-t border-rose-100 bg-white px-4 py-3",onSubmit:e=>{e.preventDefault();const t=m.trim();t&&"streaming"!==n&&(b(""),a(t))},children:[(0,s.jsx)("label",{htmlFor:"assistant-chat-input",className:"sr-only",children:"Message the assistant"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{id:"assistant-chat-input",type:"text",value:m,onChange:e=>b(e.target.value),placeholder:"Type your message\u2026",className:"min-w-0 flex-1 rounded-full border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:border-rose-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400"}),(0,s.jsx)("button",{type:"submit",disabled:0===m.trim().length||"streaming"===n,"aria-label":"Send",className:"flex h-9 w-9 flex-none items-center justify-center rounded-full bg-rose-600 text-white transition hover:bg-rose-700 disabled:opacity-40 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",children:(0,s.jsx)("span",{"aria-hidden":"true",children:"\u27a4"})})]})]})]})}var I=n(94508);const E="Need help?";var P=(0,r.forwardRef)((function(e,t){let{variant:n,onOpen:r,isOpen:o,controlsId:i,className:l,compact:c=!1}=e;const u=(0,a.Z)((e=>e.isQuizOverlayOpen)),d="fab"===n&&(u||c);return(0,s.jsxs)("button",{ref:t,type:"button",onClick:r,"aria-haspopup":"dialog","aria-expanded":o,"aria-controls":i,"aria-label":d?E:void 0,"data-testid":"assistant-launcher",className:(0,I.cn)("items-center gap-1.5 rounded-full border border-rose-200 bg-white text-rose-500 transition hover:border-rose-300 hover:text-rose-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400 focus-visible:ring-offset-2","pill"===n&&"inline-flex px-3 py-1.5 text-sm font-medium","fab"===n&&["fixed right-4 z-[101] inline-flex h-12 shadow-md",d?"w-12 justify-center rounded-full":"justify-center px-4 text-sm font-semibold"],l),style:"fab"===n?{bottom:d?"calc(1rem + env(safe-area-inset-bottom))":"calc(1rem + env(safe-area-inset-bottom) + var(--ca-sticky-cta-height, 0px))"}:void 0,children:[(0,s.jsx)("span",{"aria-hidden":"true",className:(0,I.cn)("flex flex-none items-center justify-center rounded-full border border-rose-400 leading-none","pill"===n?"h-4 w-4 text-[10px]":"h-5 w-5 text-xs"),children:"?"}),!d&&(0,s.jsx)("span",{children:E})]})})),S=n(19967),R=n(85497),_=n(39289),A=n(16546),O=n(25893),T=n(23167),U=n(43767),Z=n(73910);const M={illustration:{Icon:S.Z,bg:"bg-orange-100",fg:"text-orange-600"},broken:{Icon:R.Z,bg:"bg-sky-100",fg:"text-sky-600"},shipping:{Icon:_.Z,bg:"bg-blue-100",fg:"text-blue-600"},pricing:{Icon:A.Z,bg:"bg-emerald-100",fg:"text-emerald-600"},order:{Icon:O.Z,bg:"bg-violet-100",fg:"text-violet-600"},question:{Icon:T.Z,bg:"bg-purple-100",fg:"text-purple-600"}},q={Icon:U.Z,bg:"bg-slate-100",fg:"text-slate-500"};function F(e){let{onSeed:t,titleId:n}=e;const[a,o]=(0,r.useState)(null),[i,l]=(0,r.useState)(""),c=a?a.options:j.Nl;return(0,s.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-white","data-testid":"assistant-topic-sheet",children:[(0,s.jsx)("div",{className:"px-4 pt-4",children:a?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{type:"button",className:"mb-2 text-sm text-slate-500 hover:text-rose-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",onClick:()=>o(null),children:"\u2190 Back"}),(0,s.jsx)("h2",{id:n,className:"text-base font-semibold text-slate-900",children:a.question})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{id:n,className:"text-base font-semibold text-slate-900",children:j.tZ}),(0,s.jsx)("p",{className:"mt-0.5 text-sm text-slate-500",children:j.YU})]})}),(0,s.jsx)("ul",{className:"mt-3 min-h-0 flex-1 space-y-1.5 overflow-y-auto px-4",children:c.map((e=>{const{Icon:n,bg:r,fg:a}=function(e){var t;return null!==(t=M[e.id])&&void 0!==t?t:q}(e);return(0,s.jsx)("li",{children:(0,s.jsxs)("button",{type:"button",className:"flex w-full items-center gap-3 rounded-xl border border-slate-200 px-3 py-2.5 text-left text-sm text-slate-800 transition hover:border-rose-200 hover:bg-rose-50/60 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",onClick
1:()=>{(0,j.BF)(e)?o(e):t(e.seeds,e.id)},children:[(0,s.jsx)("span",{"aria-hidden":"true",className:"flex h-8 w-8 flex-none items-center justify-center rounded-full ".concat(r," ").concat(a),children:(0,s.jsx)(n,{className:"h-4 w-4"})}),(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate",children:e.label}),(0,s.jsx)(Z.Z,{"aria-hidden":"true",className:"h-4 w-4 flex-none text-slate-300"})]})},e.id)}))}),(0,s.jsx)("div",{className:"border-t border-slate-100 px-4 py-3",children:(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();const n=i.trim();n&&(l(""),t(n))},children:[(0,s.jsx)("label",{htmlFor:"assistant-topic-freetext",className:"sr-only",children:j.Kh}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("input",{id:"assistant-topic-freetext",type:"text",value:i,onChange:e=>l(e.target.value),placeholder:j.Kh,className:"min-w-0 flex-1 rounded-full border border-slate-300 px-3 py-2 text-sm text-slate-900 placeholder:text-slate-400 focus:border-rose-300 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400"}),(0,s.jsx)("button",{type:"submit",disabled:0===i.trim().length,"aria-label":"Send",className:"flex h-9 w-9 flex-none items-center justify-center rounded-full bg-rose-600 text-white transition hover:bg-rose-700 disabled:opacity-40 focus:outline-none focus-visible:ring-2 focus-visible:ring-rose-400",children:(0,s.jsx)("span",{"aria-hidden":"true",children:"\u27a4"})})]})]})})]})}var D=n(25127),W=n(30211);const B="assistant-chat";function H(){const e=new URL("generate","https://qdrv3x6zprsltmub6bephypixu0qismr.lambda-url.us-east-1.on.aws");return e.searchParams.set("type",B),e.toString()}const L={"no-answer":"didnt_answer","didnt-work":"instructions_didnt_work","still-need-help":"still_need_help",confusing:"answer_was_confusing",other:"other"};function V(e,t){var n;const s=null!==(n=e.anonId)&&void 0!==n?n:(0,D.L7)();var r;const a=null!==(r=e.url)&&void 0!==r?r:window.location.pathname+window.location.search;return{surface:e.surface,...e.bookType?{bookType:e.bookType}:{},...e.productId?{productId:e.productId}:{},...s?{anonId:s}:{},..."number"===typeof e.pageNumber?{pageNumber:e.pageNumber}:{},..."number"===typeof e.totalPages?{totalPages:e.totalPages}:{},...e.theme?{theme:e.theme}:{},...e.illustrationStyle?{illustrationStyle:e.illustrationStyle}:{},...a?{url:a}:{},...t?{topicId:t}:{},...e.currentPage?{currentPage:{pageNumber:e.currentPage.pageNumber,...e.currentPage.text?{text:e.currentPage.text}:{},...e.currentPage.imageUrl&&(o=e.currentPage.imageUrl,o.startsWith("/")||/^https?:\/\//i.test(o))?{imageUrl:e.currentPage.imageUrl}:{}}}:{}};var o}function z(e){if(429===e.statusCode||"rate_limit_exceeded"===e.reason){const t=e.retryAfter,n="number"===typeof t&&t>0?" Please try again in about ".concat(Math.max(1,Math.ceil(t/60))," minute").concat(1===Math.ceil(t/60)?"":"s","."):" Please try again in a few minutes.";return"You've sent a lot of messages in a short time.".concat(n)}return"stream_interrupted"===e.reason||"stream_truncated"===e.reason?"The connection dropped before I finished. Please send that again.":"Something went wrong on our side. Please try again, or email us at ".concat(W.Xy," if it keeps happening.")}let K=0;function J(e){return K+=1,"".concat(e,"-").concat(K)}function X(e){let{context:t,getAuthHeaders:n}=e;const[s,a]=(0,r.useState)([]),[o,i]=(0,r.useState)("idle"),[l,c]=(0,r.useState)(null),u=(0,r.useRef)(null),d=(0,r.useRef)(!1),f=(0,r.useRef)(null),m=(0,r.useRef)(!1),h=(0,r.useCallback)((()=>{a([]),i("idle"),c(null),u.current=null,f.current=null,m.current=!1}),[]);return{messages:s,status:o,conversationId:l,send:(0,r.useCallback)((async(e,s)=>{const r=e.trim();if(!r||d.current)return;d.current=!0,!m.current&&(null===s||void 0===s?void 0:s.topicId)&&(f.current=s.topicId),m.current=!0;const o=J("a");a((e=>[...e,{id:J("u"),role:"user",text:r,actions:[],feedback:!1},{id:o,role:"assistant",text:"",actions:[],feedback:!1,streaming:!0}])),i("streaming");const l=e=>a((t=>t.map((t=>t.id===o?{...t,...e}:t))));try{const e={"Content-Type":"application/json"};n&&Object.assign(e,await n());const s=await fetch(H(),{method:"POST",headers:e,body:JSON.stringify({message:r,context:V(t,f.current),...u.current?{conversationId:u.current}:{}})});await async function(e,t){if(!e.body)return void t.onError({statusCode:e.status||502,reason:"empty_body",message:""});const n=e.body.getReader(),s=new TextDecoder;let r,a="",o="",i=!1;try{for(;;){const{done:e,value:r}=await n.read();if(e)break;const l=s.decode(r,{stream:!0});if(i){o+=l;continue}a+=l;const c=a.indexOf(b);if(-1!==c){const e=a.slice(0,c);e&&t.onText(e),o=a.slice(c+b.length),a="",i=!0;continue}const u=Math.max(0,a.length-(b.length-1));u>0&&(t.onText(a.slice(0,u)),a=a.slice(u))}}catch(u){return void t.onError({statusCode:0,reason:"stream_interrupted",message:""})}if(!i)return a&&t.onText(a),void t.onError({statusCode:0,reason:"stream_truncated",message:""});try{r=JSON.parse(o.trim())}catch(u){return void t.onError({statusCode:0,reason:"bad_trailer",message:""})}const l=function(e){if("object"!==typeof e||null===e)return null;const t=e.response;if("object"!==typeof t||null===t)return null;const n=t;return!1!==n.success?null:{statusCode:"number"===typeof n.statusCode?n.statusCode:500,reason:"string"===typeof n.reason?n.reason:"unknown_error",message:"string"===typeof n.message?n.message:"",..."number"===typeof n.retryAfter?{retryAfter:n.retryAfter}:{}}}(r);if(l)return void t.onError(l);const c=x(r);c?t.onReply(c):t.onError({statusCode:0,reason:"bad_trailer",message:""})}(s,{onText:e=>a((t=>t.map((t=>t.id===o?{...t,text:t.text+e}:t)))),onReply:e=>{e.conversationId&&(u.current=e.conversationId,c(e.conversationId)),l({...e.text?{text:e.text}:{},actions:e.actions,feedback:e.feedback,pagePreview:e.pagePreview,streaming:!1}),i("idle")},onError:e=>{l({text:z(e),actions:[],feedback:!1,streaming:!1,isError:!0}),i("error")}})}catch(h){l({text:z({statusCode:0,reason:"stream_interrupted",message:""}),actions:[],feedback:!1,streaming:!1,isError:!0}),i("error")}finally{d.current=!1}}),[t,n]),sendFeedback:(0,r.useCallback)((async(e,s)=>{const r=s?L[s]:void 0;try{const s={"Content-Type":"application/json"};n&&Object.assign(s,await n()),await fetch(H(),{method:"POST",headers:s,body:JSON.stringify({feedback:{rating:e,..."down"===e&&r?{reason:r}:{}},context:V(t,f.current),...u.current?{conversationId:u.current}:{}})})}catch(a){}}),[t,n]),reset:h}}const G=6e5,Y="I'd like to talk to someone from your team.";
1function Q(e){let{context:t,variant:n,launcherClassName:i,compactLauncher:l,onFeedback:c}=e;const[d,f]=(0,r.useState)(!1),b=(0,r.useRef)(null),h=(0,r.useId)(),p="assistant-panel-".concat(h),x="assistant-title-".concat(h),g="assistant-topics-".concat(h),y=(0,o.ZP)((e=>e.getAuthHeaders)),v=(0,o.ZP)((e=>e.auth)),w=(0,a.Z)((e=>e.showAuthModal)),j=(0,a.Z)((e=>Boolean(e.authModal||e.messageModal))),k=(0,a.Z)((e=>e.helpLauncherHideCount>0)),{messages:N,status:I,conversationId:E,send:S,sendFeedback:R,reset:_}=X({context:t,getAuthHeaders:y}),A=(0,r.useCallback)((()=>{T.current=null,f(!1)}),[]),O=(0,r.useRef)(null),T=(0,r.useRef)(null),U=(0,r.useCallback)((e=>{O.current=e,T.current=null,S(e)}),[S]),Z=(0,r.useCallback)(((e,t)=>{O.current=e,T.current=null,S(e,t?{topicId:t}:void 0)}),[S]),M=(0,r.useCallback)((()=>{T.current=null,O.current=null,_()}),[_]),q=(0,r.useCallback)(((e,t,n)=>{R(t,n),null===c||void 0===c||c({conversationId:E,messageId:e,vote:t,reasonId:n})}),[E,c,R]),D=(0,r.useCallback)((e=>{if(v){const e=O.current;return void(e&&U(e))}const t=O.current;T.current=t?{text:t,at:Date.now()}:null,f(!1),w("identify",{email:e,intent:"login"})}),[v,U,w]);(0,r.useEffect)((()=>{if(!v||!T.current||"idle"!==I)return;const{text:e,at:t}=T.current;T.current=null,Date.now()-t>G||(f(!0),U(e))}),[v,I,U]);const W=N.length>0;return(0,s.jsxs)(s.Fragment,{children:[!j&&!k&&(0,s.jsx)(P,{ref:b,variant:null!==n&&void 0!==n?n:(B=t.surface,"marketing"===B?"fab":"pill"),isOpen:d,controlsId:p,className:i,compact:l,onOpen:()=>f(!0)}),(0,s.jsx)(m,{open:d,onClose:A,id:p,labelledBy:x,children:W?(0,s.jsx)(C,{messages:N,status:I,onSend:U,onEscalate:()=>U(Y),onVerifyEmail:D,onFeedback:q,onClose:A,onReset:M,titleId:x}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u,{titleId:x,onClose:A}),(0,s.jsx)(F,{titleId:g,onSeed:Z})]})})]});var B}var $=n(34716);const ee=new Map,te="--ca-sticky-cta-height";function ne(){if("undefined"===typeof document)return;const e=Math.max(0,...ee.values()),t=document.documentElement;e>0?t.style.setProperty(te,"".concat(Math.round(e),"px")):t.style.removeProperty(te)}function se(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,a.Z)((e=>e.isQuizOverlayOpen));var n;const s=null!==(n=e.active)&&void 0!==n?n:t,o=(0,r.useRef)(Symbol("sticky-cta")),i=(0,r.useRef)(null),l=(0,r.useRef)(null),c=(0,r.useCallback)((()=>{const e=i.current;e&&s?ee.set(o.current,e.offsetHeight):ee.delete(o.current),ne()}),[s]),u=(0,r.useCallback)((e=>{var t;if(i.current=e,null===(t=l.current)||void 0===t||t.disconnect(),l.current=null,e&&"undefined"!==typeof ResizeObserver){const t=new ResizeObserver((()=>c()));t.observe(e),l.current=t}c()}),[c]);return(0,r.useEffect)((()=>{c();const e=o.current;return()=>{ee.delete(e),ne()}}),[c]),u}n(19416)},46485:function(e,t,n){function s(e){return"options"in e}n.d(t,{AO:function(){return d},BF:function(){return s},JB:function(){return u},Kh:function(){return o},Km:function(){return l},Nl:function(){return i},Vo:function(){return f},YU:function(){return a},mP:function(){return c},tZ:function(){return r}});const r="Hi! How can we help?",a="Choose a topic below or type your question.",o="Ask us anything\u2026",i=[{id:"illustration",label:"My illustration doesn't look right",question:"What's not quite right?",options:[{id:"illustration-likeness",label:"Child doesn't look like the photo",seeds:"The child in my illustration doesn't look like the photo I uploaded, and editing it hasn't fixed it."},{id:"illustration-colors",label:"Wrong hair / eye color",seeds:"The hair or eye color in my illustration is wrong and I haven't been able to correct it."},{id:"illustration-family",label:"Parent or family member looks wrong",seeds:"A parent or family member in my illustration looks wrong, and regenerating it hasn't helped."},{id:"illustration-style",label:"Illustration style isn't right",seeds:"The illustration style isn't what I wanted."},{id:"illustration-missing",label:"Something is missing",seeds:"Something is missing from my illustration."},{id:"illustration-other",label:"Other",seeds:"Something else about my illustration doesn't look right and I haven't been able to fix it."}]},{id:"broken",label:"Something isn't working",question:"What isn't working?",options:[{id:"broken-upload",label:"Photo upload isn't working",seeds:"Photo upload isn't working for me."},{id:"broken-preview",label:"Preview isn't generating",seeds:"My preview isn't generating."},{id:"broken-page",label:"Page won't load",seeds:"The page won't load."},{id:"broken-edit",label:"Edit/regenerate isn't working",seeds:"Editing or regenerating isn't working."},{id:"broken-checkout",label:"Checkout isn't working",seeds:"Checkout isn't working."},{id:"broken-other",label:"Other",seeds:"Something else isn't working."}]},{id:"shipping",label:"Shipping & delivery",seeds:"I have a question about shipping and delivery."},{id:"pricing",label:"Pricing & payment",seeds:"I have a question about pricing and payment."},{id:"order",label:"My existing order",seeds:"I have a question about my existing order."},{id:"question",label:"Something else",seeds:"I need help with something else."}],l=i.flatMap((e=>s(e)?e.options.map((e=>e.id)):[e.id]));function c(e){for(const t of i){if(!s(t)){if(t.id===e)return t.label;continue}
1const n=t.options.find((t=>t.id===e));if(n)return"Other"===n.label?"".concat(t.label," \u203a Other"):n.label}}const u=[{id:"no-answer",label:"Didn't answer my question"},{id:"didnt-work",label:"Instructions didn't work"},{id:"still-need-help",label:"I still need help",escalates:!0},{id:"confusing",label:"Answer was confusing"},{id:"other",label:"Other"}],d="Was this helpful?",f="Thanks!"},34716:function(e,t,n){n.d(t,{U:function(){return a}});var s=n(2265),r=n(94335);function a(e){const t=(0,r.Z)((e=>e.setAssistantContext)),n=(0,r.Z)((e=>e.clearAssistantContext));(0,s.useEffect)((()=>{if(e)return t(e),()=>n()}),[e,t,n])}},30211:function(e,t,n){n.d(t,{$9:function(){return l},IW:function(){return u},Oj:function(){return o},Ow:function(){return i},Pp:function(){return c},Xy:function(){return s},_A:function(){return a},lX:function(){return d},wl:function(){return r},x8:function(){return f}});const s="[email protected]",r="within 1 business day",a="4\u20135 business days",o="8\u201312 business days",i="the United States, Canada, the United Kingdom, Australia, and India",l="".concat(7," days"),c=["US","CA","GB","AU","IN"],u="".concat(30," days"),d="".concat(30," days"),f="".concat(30," days")},94335:function(e,t,n){var s=n(3011);const r={surface:"marketing"},a=(0,s.U)()((e=>({context:r,setAssistantContext:t=>e({context:t}),clearAssistantContext:()=>e({context:r})})));t.Z=a}}]);

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.