1import{x as e,r as t,u as n,j as o}from"./vendor.mIPXQGLM.js";import{be as r,b1 as s,a,b2 as i,b3 as d,b8 as l,F as p,c,b4 as m,b7 as g,bb as u,b6 as b,b5 as x}from"./index.bundle.js";import{m as h,b6 as j}from"./@constants.BGUlkrYt.js";import{G as f}from"./GreenArrowButton.BCRc4ptt.js";import{O as v,S as y}from"./Option.DkTX82aO.js";import{O as A}from"./OptionVariant2.CVuxUEem.js";import{S as w}from"./QuestionButton.styles.CbmcgbW6.js";import{u as I}from"./@i18n.CG4_sUzZ.js";import"./@amplitude.yMGOHWCQ.js";import"./@xstate.CEsnlirg.js";import"./@firebase.Bkc6--w4.js";import"./@lottie.KPmlgv_O.js";import"./@react-router.hFdD-ZA2.js";import"./@lodash.D8yALn-Z.js";import"./@rudderstack.DVYreKjc.js";import"./right-white-arrow.jrmExGPe.js";import"./questions-check-off.BPJvZ_sw.js";import"./questions-check-on.B3DCfWRm.js";const k={Wrapper2:e.div` 2 ${i}; 3 ${d}; 4 padding-top: 107px; 5 6 @media ${l} { 7 padding-top: 115px; 8 } 9 `,Content3:e.div` 10 ${a}; 11 height: 100%; 12 padding-top: 24px; 13 padding-bottom: 120px; 14 `,Title2:e.h2` 15 ${s}; 16 margin-bottom: 16px; 17 `,Subtitle:e.h4` 18 ${r}; 19 font-size: 15px; 20 margin-bottom: 16px; 21 `,StickyBlockWrapper:e.div` 22 position: fixed; 23 z-index: 1; 24 bottom: 0; 25 padding-bottom: 16px; 26 padding-top: 8px; 27 width: 100%; 28 left: 0; 29 right: 0; 30 margin-left: auto; 31 margin-right: auto; 32 display: flex; 33 flex-direction: column; 34 align-items: center; 35 justify-content: center; 36 border: none; 37 background-color: ${h.WHITE}; 38 39 &[data-is-virtual-keypad-active='true'] { 40 position: relative; 41 } 42 `,TextButton:e.button` 43 display: block; 44 cursor: pointer; 45 border: none; 46 outline: none; 47 text-decoration: none; 48 text-align: center; 49 font-size: 14px; 50 margin-top: 16px; 51 font-weight: 700; 52 line-height: 27px; 53 text-decoration-line: underline; 54 color: ${h.BROWNISH_GRAY}; 55 background-color: transparent; 56 `},N=[{translationKey:j.BARKING,savedAnswer:"barking"},{translationKey:j.LEASH_POOLING,savedAnswer:"leash_pulling"},{translationKey:j.SEPARATION_ANXIETY,savedAnswer:"separation_anxiety"},{translationKey:j.CHEWING,savedAnswer:"chewing"},{translationKey:j.AGGRESSION,savedAnswer:"aggression"},{translationKey:j.BITING,savedAnswer:"biting"},{translationKey:j.HOUSE_SOILING,savedAnswer:"house_soiling"},{translationKey:j.DIGGING,savedAnswer:"digging"},{translationKey:j.FOOD_STEALING,savedAnswer:"food_stealing"},{translationKey:j.CONTROL,savedAnswer:"excessive_energy"}],O=()=>{const{t:e}=I(),{onNextStep:r}=t.useContext(p),{currentPageId:s,currentPageNumber:a}=c(n(e=>({currentPageId:e.currentPageId,currentPageNumber:e.currentPageNumber}))),i=m();g();const d=t.useMemo(()=>u(i,s),[i,s]),[l,h]=t.useState([]),j=t.useCallback((e=!1)=>{s&&a&&(b({question:"Which behavioral issues would you like to solve?",answers:e?"none":l,pageName:s,pageNumber:a,answersToStore:e?[]:l}),x({dog_problem:e?"none":l}),r())},[l,s,a,r]),O=t.useMemo(()=>({...s&&{name:s},type:v.CHECKBOX,onChange:(e,t)=>
56{if(t){const t=[...l,e].sort((e,t)=>N.findIndex(t=>t.savedAnswer===e)-N.findIndex(e=>e.savedAnswer===t));h(t)}else{const t=l.filter(t=>t!==e);h(t)}}}),[l,s]);return t.useEffect(()=>{h(d)},[d]),o.jsx(k.Wrapper2,{children:o.jsxs(k.Content3,{children:[o.jsx(k.Title2,{children:e`onboarding.behavior.question2`}),o.jsxs(k.Subtitle,{children:[e`onboarding.common.chooseAllThatApply`,":"]}),o.jsx(y.OptionsContainer6,{children:N.map(({translationKey:n,savedAnswer:r})=>t.createElement(A,{...O,value:r,key:r,checked:Array.isArray(l)&&l.includes(r)},o.jsx(w.Wrapper2,{"data-has-check-icon":!0,children:e(`onboarding.behavior.${n}`)})))}),o.jsxs(k.StickyBlockWrapper,{children:[o.jsx(f,{isButtonDisabled:!l.length,onClick:()=>j()}),o.jsx(k.TextButton,{onClick:()=>j(!0),children:e`onboarding.common.noneOfTheAbove`})]})]})})};export{O as BehaviorQuestion};
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.