1export default function cupFairy(stylesLink){const HIGH_CERVIX_PRODUCT_HANDLE="high-cervix-menstrual-cup-usa-fda-version-ring-classic-nupsi",SPORT_PRODUCT_MAP={"Standard Medium":{"Ball Handle":"meluna-menstrual-cup-ball-firm","Ring Handle":"meluna-menstrual-cup-ring-firm","Stem Handle":"meluna-menstrual-cup-stem-firm"},"Standard Large":{"Ball Handle":"meluna-menstrual-cup-ball-firm","Ring Handle":"meluna-menstrual-cup-ring-firm","Stem Handle":"meluna-menstrual-cup-stem-firm"},"Standard XL":{"Ball Handle":"meluna-menstrual-cup-ball-firm","Ring Handle":"meluna-menstrual-cup-ring-firm","Stem Handle":"meluna-menstrual-cup-stem-firm"},"Shorty Medium":{"Ball Handle":"period-cup-shorty-ball-firm","Ring Handle":"period-cup-ring-firm-low-cervix","Stem Handle":"period-cup-shorty-firm-stem"},"Shorty Large":{"Ball Handle":"period-cup-shorty-ball-firm","Ring Handle":"period-cup-ring-firm-low-cervix","Stem Handle":"period-cup-shorty-firm-stem"},"Shorty XL":{"Ball Handle":"period-cup-shorty-ball-firm","Ring Handle":"period-cup-ring-firm-low-cervix","Stem Handle":"period-cup-shorty-firm-stem"}},ACTIVITY_QUESTION_COPY={text:"Was the leaking related to physical activity?",description:"Please be as accurate as possible."},HIGH_CERVIX_QUESTION_COPY={text:"How did your previous cup fit or perform otherwise?",description:"Let's fine-tune the fit."},quizLog=(...args)=>{},quizWarn=(...args)=>{},quizError=(...args)=>{};quizLog("Quiz initialized",{highCervixProduct:HIGH_CERVIX_PRODUCT_HANDLE,sportProductMap:SPORT_PRODUCT_MAP});const quiz=[{id:"questionOne",text:"Have you ever had a Menstrual Cup before?",description:"Let's see what we already know!",fieldNo:26,options:[{text:"No, this will be my very first cup!",route:"questionFour"},{text:"Yes, a smaller size, like Diva 1 or Saalt Small, often labeled \u201Cbefore childbirth.\u201D",route:"questionEight"},{text:"Yes, a larger size, like Diva 2 or Saalt Regular, often labeled \u201Cafter childbirth.\u201D",route:"questionTwo"},{text:"Yes, but it was a different cup style or a smaller size, like teen or mini.",route:"redirect"}]},{id:"questionTwo",text:"What did you not like about your previous cup?",description:"Let's see what we can do better this time!",fieldNo:28,options:[{text:"The previous cup was too long (uncomfortable at vaginal entrance)",route:"questionThree"},{text:"The previous cup was too wide and uncomfortable",route:"questionFive"},{text:"The previous cup leaked but was otherwise comfortable",route:"questionSix"}]},{id:"questionThree",text:"We got a cup for that! How was the diameter for you?",description:"The shorty is a great cup for low cervix when others are too long.",fieldNo:30,options:[{text:"The diameter of the cup felt fine and sealed well",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL"},{text:"The diameter of the cup was insufficient and leaked!",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL"},{text:"The diameter of the cup felt too wide",route:"questionSevenV2",query:"?size=large-shorty",size:"Shorty Large"}]},{id:"questionFour",text:"Yay! So excited you are taking the plunge! What can you tell me about yourself?",description:"Classic is a great firmness for new users. It's easy to fold and remove. Let's keep that in mind, okay?",fieldNo:28,options:[{text:"I am a teen and had no vaginal births",route:"questionTen"},{text:"I am an adult and no vaginal births",route:"questionNineV1"},{text:"I had one vaginal birth",route:"questionNineV2"},{text:"I had multiple vaginal births",route:"questionNineV3"}]},{id:"questionFive",text:"Was the cup size just too wide or also too long?",description:"Let's get it right this time!",fieldNo:30,options:[{text:"It was just too wide! Length fit fine",route:"questionSevenV1",query:"?size=large",size:"Standard Large"},{text:"It was also too long!",route:"questionSevenV2",query:"?size=large-shorty",size:"Shorty Large"}]},{id:"questionSix",text:"Other than the cup size leaking, was the fit okay?",description:"We want you to be comfortable!",fieldNo:30,options:[{text:"Yes no complaints. Not too long. Not too wide. Just leaks!",route:"questionActivityXL",query:"?size=xl",size:"Standard XL"},{text:"The cup leaked and also felt too long",route:"questionActivityShortyXL",query:"?size=xl-shorty",size:"Shorty XL"}]},{id:"questionEight",text:"What did you not like about your previous cup?",description:"Let's figure this out and do better!",fieldNo:28,options:[{text:"It was too long. I could feel it at my vaginal entrance. Width was fine",route:"questionSevenV2",query:"?size=large-shorty",size:"Shorty Large"},{text:"It was too short. I could never reach it",route:"questionHighCervix"},{text:"It was too wide and I could feel a lot of pressure.",route:"questionSevenV1",query:"?size=medium",size:"Standard Medium"},{text:"It was both too wide and too long",route:"questionSevenV2",query:"?size=medium-shorty",size:"Shorty Medium"},{text:"It leaked. Dimensions felt fine though!",route:"questionActivityLarge",query:"?size=large",size:"Standard Large"},{text:"Something else",route:"redirect",query:"",size:""}]},{id:"questionNineV1",text:"Do you think you have a low cervix?",description:"Most people can choose the first option. Choose the second option if you know your cervix sits low, or if a previous cup felt too long, poked out, or sat uncomfortably close to the vaginal opening.",fieldNo:30,options:[{text:"No, or I\u2019m not sure",route:"questionSevenV1",query:"?size=medium",size:"Standard Medium"},{text:"Yes, I think my cervix sits low",route:"questionSevenV2",query:"?size=large-shorty",size:"Shorty Large"}]},{id:"questionNineV2",text:"Do you think you have a low cervix?",description:"Most people can choose the first option. Choose the second option if you know your cervix sits low, or if a previous cup felt too long, poked out, or sat uncomfortably close to the vaginal opening.",fieldNo:30,options:[{text:"No, or I\u2019m not sure",route:"questionSevenV1",query:"?size=large",size:"Standard Large"},{text:"Yes, I think my cervix sits low",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL"}]},{id:"questionNineV3",text:"Do you think you have a low cervix?",description:"Most people can choose the first option. Choose the second option if you know your cervix sits low, or if a previous cup felt too long, poked out, or sat uncomfortably close to the vaginal opening.",fieldNo:30,options:[{text:"No, or I\u2019m not sure",route:"questionSevenV1",query:"?size=xl",size:"Standard XL"},{text:"Yes, I think my cervix sits low",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL"}]},{id:"questionTen",text:"Have you ever been sexually active?",description:"Your answers are not recorded. We simply factor them in to give you a more accurate result",fieldNo:30,options:[{text:"Yes I am/have!",route:"questionSevenV1",query:"?size=medium",size:"Standard Medium"},{text:"No I have not ever",route:"questionSevenV1",query:"?size=small",size:"Standard Small"}]},{id:"questionHighCervix",text:HIGH_CERVIX_QUESTION_COPY.text,description:HIGH_CERVIX_QUESTION_COPY.description,fieldNo:30,options:[{text:"It was too wide",route:"highCervixResult",query:"?size=medium",size:"High Cervix Medium",firmness:"Classic",handle:"High Cervix Handle",resultType:"high-cervix"},{text:"It was just right",route:"highCervixResult",query:"?size=medium",size:"High Cervix Medium",firmness:"Classic",handle:"High Cervix Handle",resultType:"high-cervix"},{text:"It leaked",route:"highCervixResult",query:"?size=large",size:"High Cervix Large",firmness:"Classic",handle:"High Cervix Handle",resultType:"high-cervix"}]},{id:"questionActivityXL",text:ACTIVITY_QUESTION_COPY.text,description:ACTIVITY_QUESTION_COPY.description,fieldNo:30,options:[{text:"Mostly during exercise or activities that strongly engage my core muscles",route:"questionSevenV1",query:"?size=xl",size:"Standard XL",firmness:"Sport"},{text:"It leaked during normal daily activities too",route:"questionSevenV1",query:"?size=xl",size:"Standard XL",firmness:"Classic"},{text:"I'm not sure",route:"questionSevenV1",query:"?size=xl",size:"Standard XL",firmness:"Classic"}]},{id:"questionActivityShortyXL",text:ACTIVITY_QUESTION_COPY.text,description:ACTIVITY_QUESTION_COPY.description,fieldNo:30,options:[{text:"Mostly during exercise or activities that strongly engage my core muscles",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL",firmness:"Sport"},{text:"It leaked during normal daily activities too",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL",firmness:"Classic"},{text:"I'm not sure",route:"questionSevenV2",query:"?size=xl-shorty",size:"Shorty XL",firmness:"Classic"}]},{id:"questionActivityLarge",text:ACTIVITY_QUESTION_COPY.text,description:ACTIVITY_QUESTION_COPY.description,fieldNo:30,options:[{text:"Mostly during exercise or activities that strongly engage my core muscles",route:"questionSevenV1",query:"?size=large",size:"Standard Large",firmness:"Sport"},{text:"It leaked during normal daily activities too",route:"questionSevenV1",query:"?size=large",size:"Standard Large",firmness:"Classic"},{text:"I'm not sure",route:"questionSevenV1",query:"?size=large",size:"Standard Large",firmness:"Classic"}]},{id:"questionSevenV1",text:"Let's talk about handles!",description:"Your handle gives you something to reach for during removal. Choose what sounds most comfortable to you.",fieldNo:32,options:[{text:"The smaller the better. I\u2019d rather barely notice it\u2019s there!",route:"meluna-menstrual-cup-fda-usa-ball",handle:"Ball Handle"},{text:"I want an easy-to-grip handle that\u2019s easy to find!",route:"meluna-menstrual-cup-ring-classic",handle:"Ring Handle"},{text:"I\u2019m not sure yet, or I like having a handle I can adjust by trimming it shorter.",route:"meluna-menstrual-cup-stem-classic",handle:"Stem Handle"}]},{id:"questionSevenV2",text:"Let's talk about handles!",description:"Your handle gives you something to reach for during removal. Choose what sounds most comfortable to you.",fieldNo:32,options:[{text:"The smaller the better. I\u2019d rather barely notice it\u2019s there!",route:"menstrual-cup-ball-low-cervix",handle:"Ball Handle"},{text:"I want an easy-to-grip handle that\u2019s easy to find!",route:"menstrual-cup-ring-low-cervix",handle:"Ring Handle"},{text:"I\u2019m not sure yet, or I like having a handle I can adjust by trimming it shorter.",route:"menstrual-cup-stem-shorty",handle:"Stem Handle"}]}];let quizHTML='<div class="form-container"><form>';const userPath=["questionOne"];let selectedOption=[];quiz.forEach((question,index)=>{quizHTML+=` 2 <fieldset 3 class="form-field quiz-field" 4 ${index===0?"":'style="display: none;"'} 5 data-${question.id} 6 > 7 <legend class="question-title">${question.text}</legend> 8 <p class="question-info">${question.description}</p> 9 <ul class="options-list"> 10 `,question.options.forEach((option,optionIndex)=>{quizHTML+=` 11 <li class="option"> 12 <div> 13 <input 14 data-question-pointer="${option.route}" 15 data-query="${option.hasOwnProperty("query")?option.query:""}" 16 data-size="${option.hasOwnProperty("size")?option.size:""}" 17 data-handle="${option.hasOwnProperty("handle")?option.handle:""}" 18 data-firmness="${option.hasOwnProperty("firmness")?option.firmness:""}" 19 data-result-type="${option.hasOwnProperty("resultType")?option.resultType:""}" 20 data-quiz-option 21 class="form-radio quiz-radio" 22 type="radio" 23 id="${question.id}-option-${optionIndex}" 24 name="quiz_${question.id}" 25 value="${question.text}:${option.text}" 26 data-field-api-id=${question.fieldNo} 27 > 28 </div> 29 30 <div> 31 <label 32 class="form-label quiz-label" 33 for="${question.id}-option-${optionIndex}" 34 >
35 <span class="option-text">${option.text}</span> 36 </label> 37 </div> 38 </li> 39 `}),quizHTML+="</ul></fieldset>"}),quizHTML+=` 40 <button 41 class="previous-btn btn" 42 type="button" 43 data-previous 44 style="display: none;" 45 > 46 Previous 47 </button> 48 </form></div> 49 `,document.getElementById("quiz-container").innerHTML+=quizHTML;function storeRecommendationFromOption(target){const sizeQuery=target.getAttribute("data-query")||"",cupSize=target.getAttribute("data-size")||"",handle=target.getAttribute("data-handle")||"",firmness=target.hasAttribute("data-firmness")?target.getAttribute("data-firmness")||sessionStorage.getItem("firmness")||"Classic":sessionStorage.getItem("firmness")||"Classic",resultType=target.hasAttribute("data-result-type")?target.getAttribute("data-result-type")||sessionStorage.getItem("resultType")||"standard":sessionStorage.getItem("resultType")||"standard";sizeQuery&&sessionStorage.setItem("sizeQuery",sizeQuery),cupSize&&sessionStorage.setItem("cupSize",cupSize),handle&&sessionStorage.setItem("handle",handle),sessionStorage.setItem("firmness",firmness),sessionStorage.setItem("resultType",resultType),quizLog("Recommendation state updated",{sizeQuery,cupSize,handle,firmness,resultType})}function getRecommendationState(){return{sizeQuery:sessionStorage.getItem("sizeQuery")||"",cupSize:sessionStorage.getItem("cupSize")||"",handle:sessionStorage.getItem("handle")||"",firmness:sessionStorage.getItem("firmness")||"Classic",resultType:sessionStorage.getItem("resultType")||"standard"}}function getResultExplanation(firmness,handle){const base="Based on your answers, this combination gives you the cup size and length that best match your needs.",firmnessText=firmness==="Sport"?"Sport firmness provides extra resistance to compression to help maintain its seal and prevent compression-related leaks.":"Classic firmness is comfortable and flexible, so it\u2019s easy to fold and remove, with enough spring to help the cup open easily.",handleText={"Ring Handle":"The Ring handle provides an easy-to-grip removal option.","Ball Handle":"The Ball handle is our smallest, least noticeable handle for a comfortable, low-profile fit.","Stem Handle":"The Stem handle can be left long for extra reach or trimmed to your preferred length.","High Cervix Handle":"Your previous cup was difficult to reach, so we recommend our High Cervix Handle. The added length makes the cup easier to reach and remove. You can trim the extension to your preferred length, or remove it completely to use the standard Ring Handle."}[handle]||"The selected handle was chosen based on your answers.";return`${base} ${firmnessText} ${handleText}`}function renderWhyRecommended(){const state=getRecommendationState(),resultHeading=document.querySelector(".quiz-result-info-about");if(!resultHeading){quizWarn('Could not find ".quiz-result-info-about".');return}let explanation=document.querySelector("[data-quiz-why-recommended]");explanation||(explanation=document.createElement("div"),explanation.setAttribute("data-quiz-why-recommended",""),explanation.className="quiz-why-recommended page-width page-width--narrow",resultHeading.insertAdjacentElement("afterend",explanation));const explanationText=getResultExplanation(state.firmness,state.handle);explanation.innerHTML=` 50 <div class="quiz-why-recommended-inner"> 51 <h3>Why we recommended this cup</h3> 52 <p>${explanationText}</p> 53 </div> 54 `,quizLog("Rendered recommendation explanation",state)}function applyRecommendationDisplay(){const state=getRecommendationState(),resultHeading=document?.querySelector(".quiz-result-info-about")?.querySelector(".h2");if(!resultHeading){quizWarn("Could not find result heading.");return}state.resultType==="high-cervix"?resultHeading.innerHTML=`${state.cupSize} Classic with ${state.handle}`:resultHeading.innerHTML=`${state.cupSize} ${state.firmness} with ${state.handle}`,renderWhyRecommended(),quizLog("Result display updated",state)}function resolveProductHandle(dataPointer){const state=getRecommendationState();if(state.resultType==="high-cervix")return sessionStorage.setItem("firmness","Classic"),sessionStorage.setItem("handle","High Cervix Handle"),quizLog("Priority 1 - High Cervix",{product:HIGH_CERVIX_PRODUCT_HANDLE,size:state.cupSize,firmness:"Classic",handle:"High Cervix Handle"}),HIGH_CERVIX_PRODUCT_HANDLE;if(state.firmness==="Sport"){const sizeMapping=SPORT_PRODUCT_MAP[state.cupSize];if(!sizeMapping)return quizError("Sport size mapping is not configured.",{size:state.cupSize,handle:state.handle}),null;const sportProduct=sizeMapping[state.handle];return sportProduct?(quizLog("Priority 2 - Sport",{size:state.cupSize,handle:state.handle,firmness:"Sport",product:sportProduct}),sportProduct):(quizError("Sport product mapping is not configured for this size/handle combination.",{size:state.cupSize,handle:state.handle,availableHandles:Object.keys(sizeMapping)}),null)}
54return quizLog("Priority 3 - Existing Classic",{product:dataPointer,state}),dataPointer}document.body.addEventListener("click",function(event){const target=event.target;if(target.getAttribute("data-quiz-option")===null)return;const dataPointer=target.getAttribute("data-question-pointer");if(storeRecommendationFromOption(target),quizLog("Quiz option selected",{option:target.value,nextRoute:dataPointer,state:getRecommendationState()}),dataPointer.toString().indexOf("question")>-1)showNextQuestion(target);else if(dataPointer.toString()==="redirect")document.querySelector("[data-quiz-results]").innerHTML=` 55 <div class="quiz-results"> 56 <h2 data-template-msg> 57 Your previous cup doesn\u2019t quite match 58 our standard size comparisons. Tell us 59 a little more about it and we\u2019ll help 60 you choose your MeLuna. 61 </h2> 62 63 <div class="quiz-results-action"> 64 <a 65 href="https://melunausa.wufoo.com/forms/x1xcf8sx1pom1g7/" 66 target="_blank" 67 class="button btn" 68 > 69 HELP ME CHOOSE 70 </a> 71 72 <button 73 class="button btn btn-secondary" 74 data-retake-quiz 75 > 76 Retake Quiz 77 </button> 78 </div> 79 </div> 80 `,document.querySelector(".form-container").style.display="none",scrollToResults();else{const formContainer=document.querySelector(".form-container");formContainer&&(formContainer.style.display="none"),hideQuizDefaultSections();const resolvedProductHandle=resolveProductHandle(dataPointer);if(!resolvedProductHandle){quizError("Could not resolve product for quiz result.",getRecommendationState());return}sessionStorage.setItem("resolvedProductHandle",resolvedProductHandle),applyRecommendationDisplay(),showResultSections(),showProduct(resolvedProductHandle,sessionStorage.getItem("sizeQuery"))}});function scrollToResults(){requestAnimationFrame(()=>{const target=document.querySelector('[data-category="quiz-result-section"]')||document.querySelector("[data-quiz-results]");if(!target)return;const headerWrapper=document.querySelector(".header-wrapper"),headerHeight=headerWrapper?headerWrapper.offsetHeight:0,top=target.getBoundingClientRect().top+window.scrollY-headerHeight;window.scrollTo({top,behavior:"smooth"})})}function showResultSections(){quizLog("Showing result sections",getRecommendationState()),document.querySelectorAll('[data-category="quiz-result-section"]').forEach(section=>section.classList.remove("hide"))}function hideQuizDefaultSections(){document.querySelectorAll('[data-category="quiz-section"]').forEach(section=>{const shopifySection=section.closest(".shopify-section");shopifySection&&shopifySection.classList.add("hide")})}function showProduct(handle,query){const sections=Array.from(document.querySelectorAll(".featured-product-section"));if(!sections.length){quizError("No featured product sections found.");return}const productSection=sections.find(section=>section.dataset.productHandle===handle);if(!productSection){quizError("Product section not found.",{handle,availableHandles:sections.map(section=>section.dataset.productHandle),state:getRecommendationState()});return}const productURL=productSection.dataset.productUrl,variantField=productSection.querySelector(".variant-id-data");quizLog("Showing product",{handle,productURL,query,state:getRecommendationState()}),productSection.classList.remove("hide"),window.dispatchEvent(new Event("resize")),switchProductVariant(productSection,query),variantField&&variantField.addEventListener("change",event=>{includeNewsletterForm(event.target.value,productURL)}),scrollToResults()}function switchProductVariant(section,query){if(!query){quizWarn("No variant query supplied.");return}const variant=query.replace("?size=","").toLowerCase(),variantsList=Array.from(section.querySelectorAll(".block-variant-picker input")),matchVariant=variantsList.find(item=>item.value.toLowerCase().replace(" ","-")===variant);if(!matchVariant){quizError("Variant not found.",{variant,query,availableVariants:variantsList.map(item=>item.value),state:getRecommendationState()});return}quizLog("Selecting product variant",{variant,value:matchVariant.value}),matchVariant.click()}function putStringWithResult(){applyRecommendationDisplay()}
80const getProduct=(id,query)=>{fetch(window.Shopify.routes.root+"products/"+id+".js").then(response=>response.json()).then(product=>{const productVariants=product.variants;let fields="";const html='<div class="quiz-results"><h2 data-template-msg>'+`Based on the info given your perfect match could be: <div class="result-highlight">${sessionStorage.getItem("cupSize")} ${sessionStorage.getItem("firmness")||"Classic"} with ${sessionStorage.getItem("handle")}</div>`+'</h2><div data-wufoo-form></div><span class="or"></span><div class="btn-action"><a href="'+product.url+'" data-product-link class="button btn">take me directly to my result</a><button class="btn" data-retake-quiz>Retake Quiz</button></div></div>';document.querySelector("[data-quiz-results]").innerHTML=html;const suggestionText=`Based on the info given your perfect match could be: ${sessionStorage.getItem("cupSize")} ${sessionStorage.getItem("firmness")||"Classic"} with ${sessionStorage.getItem("handle")}`,linkHref=product.url;let isFound=!1;productVariants.forEac
80h(variant=>{if(isFound)return;const q=query.replace("?size=","");let variantOption=variant.options;variantOption=variantOption.map(option=>option.toLowerCase().replace(" ","-")),variantOption.includes(q)&&(isFound=!0,document.querySelector("[data-product-link]").setAttribute("href",linkHref+"?variant="+variant.id))}),isFound||document.querySelector("[data-product-link]").setAttribute("href",linkHref+query),selectedOption[34]="field34="+suggestionText,fields=selectedOption.filter(el=>el!=null).join("&"),fields=fields.replaceAll("?","");let url=linkHref+query;url=url.replace("https://",""),url=url.replace("http://",""),fields+="&field40="+escape(url),document.querySelector("[data-wufoo-form]").innerHTML='<iframe id="wufoo-quiz-form" height="560" allowTransparency="true" frameborder="0" scrolling="no" style="width:100%;border:none;" src="https://melunausa.wufoo.com/embed/m61rftk00j750v/def/'+fields+'"> <a href="https://melunausa.wufoo.com/forms/m61rftk00j750v/">Fill out my Wufoo form!</a></iframe>',clearQuizSession()}).catch(error=>{quizError("Legacy getProduct() failed.",error)})};function includeNewsletterForm(query,productLink){const formContainer=document.querySelector(".newsletter-wufoo-form-container");if(!formContainer)return;const state=getRecommendationState(),suggestionText=`Based on the info given your perfect match could be: ${state.cupSize} ${state.firmness} with ${state.handle}`,linkHref=productLink;let fields="";selectedOption[34]="field34="+suggestionText,fields=selectedOption.filter(el=>el!=null).join("&"),fields=fields.replaceAll("?","");let url=linkHref+`?variant=${query}`;url=url.replace("https://",""),url=url.replace("http://",""),fields+="&field40="+encodeURIComponent(url);const iframeSrc=`https://melunausa.wufoo.com/embed/m61rftk00j750v/def/${fields}`;formContainer.innerHTML=`<iframe 81 name="wufoo-quiz-form" 82 id="wufoo-quiz-form" 83 height="560" 84 allowTransparency="true" 85 frameborder="0" 86 scrolling="no" 87 style="width:100%;border:none;" 88 src="${iframeSrc}" 89 > 90 <a href="https://melunausa.wufoo.com/forms/m61rftk00j750v/"> 91 Fill out my Wufoo form! 92 </a> 93 </iframe>`,clearQuizSession(),quizLog("Quiz session cleared after newsletter form creation.")}function clearQuizSession(){sessionStorage.removeItem("sizeQuery"),sessionStorage.removeItem("cupSize"),sessionStorage.removeItem("handle"),sessionStorage.removeItem("firmness"),sessionStorage.removeItem("resultType"),sessionStorage.removeItem("resolvedProductHandle")}const showNextQuestion=selectedOption2=>{const nextQuestion=selectedOption2.getAttribute("data-question-pointer"),currentQuestion=selectedOption2.closest("fieldset")?.dataset;quizLog("Navigating to next question",{currentQuestion,nextQuestion,state:getRecommendationState()}),selectedOption2.closest("fieldset").style.display="none";const nextQuestionElement=document.querySelector(`[data-${nextQuestion}]`);if(!nextQuestionElement){quizError("Next question was not found.",{nextQuestion});return}if(nextQuestionElement.style.display="block",userPath.push(nextQuestion),userPath.length===2){const previousButton=document.querySelector("[data-previous]");previousButton&&(previousButton.style.display="block")}},showPrevQuestion=event=>{const lastQuestion=userPath.pop(),lastQuestionElement=document.querySelector(`[data-${lastQuestion}]`);lastQuestionElement&&(lastQuestionElement.style.display="none");const previousQuestion=userPath[userPath.length-1],previousQuestionElement=document.querySelector(`[data-${previousQuestion}]`);if(previousQuestionElement&&(previousQuestionElement.style.display="block"),quizLog("Previous question selected",{lastQuestion,previousQuestion,path:userPath,state:getRecommendationState()}),userPath.length===1){const previousButton=document.querySelector("[data-previous]");previousButton&&(previousButton.style.display="none")}};document.body.addEventListener("click",function(event){event.target.matches("[data-previous]")&&showPrevQuestion(event)}),document.body.addEventListener("click",function(event){event.target.matches("[data-retake-quiz]")&&(clearQuizSession(),window.location.reload(),event.preventDefault())}),document.addEventListener("click",function(event){if(!event.target.classList.contains("quiz-radio"))return;let value=event.target.value.split(":");
93const questionFieldId=parseInt(event.target.dataset.fieldApiId),questionField="Field"+questionFieldId+"="+value[0],answerFieldId=questionFieldId+1,answerField="Field"+answerFieldId+"="+value[1];selectedOption[questionFieldId]=questionField,selectedOption[answerFieldId]=answerField,quizLog("Wufoo answer captured",{questionFieldId,questionField,answerField})})} 94//# sourceMappingURL=/cdn/shop/t/73/assets/quiz.js.map?v=163104096322238605911787945566
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.