{"version":3,"file":"main.js","sources":["../source/js/legacy/_parsleyValidators.js","../source/js/legacy/body-shape-calculator.js","../source/js/legacy/form--ask-a-stylist-cta.js","../source/js/legacy/form--ask-a-stylist.js","../source/js/legacy/form--file-input.js","../source/js/legacy/links--open-new-window.js","../source/js/legacy/nav--mobile.js","../source/js/legacy/search.js","../source/js/legacy/sf--ig.js","../source/js/legacy/share-this.js","../node_modules/vue/dist/vue.esm.browser.js","../source/js/data/ui.js","../source/js/legacy/utilities.js","../source/js/legacy/waypoint.js","../source/js/legacy/zfacebook.js","../../../mu-plugins/flickerbox-themes/js/cta.js","../../../mu-plugins/flickerbox-themes/js/event-tracking.js","../node_modules/vue-js-modal/dist/index.js","../source/js/components/blog-content.vue","../node_modules/vue-runtime-helpers/dist/normalize-component.mjs","../source/js/components/gallery.vue","../node_modules/vue-runtime-helpers/dist/inject-style/browser.mjs","../source/js/components/page-header.vue","../node_modules/vue-carousel/dist/vue-carousel.min.js","../source/js/components/pdp-carousel.vue","../source/js/main.js"],"sourcesContent":[";(function($) {\n\n\twindow.Parsley.addValidator('fileIsImage', {\n\t\tvalidateString: function(_value, param, parsleyInstance) {\n\t\t\n\t\t\tif (!window.FormData) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tvar files = parsleyInstance.$element[0].files;\n\t\t\tvar types = ['image/jpeg', 'image/pjpeg', 'image/png', 'image/jpg', 'image/gif', 'image/tiff'];\n\t\t\t\n\t\t\treturn types.indexOf(files[0].type) != -1;\n\t\t\t\n\t\t},\n\t\trequirementType: 'integer',\n\t\tmessages: {\n\t\t\ten: 'Only an image can be uploaded.'\n\t\t}\n\t});\n\t\n\twindow.Parsley.addValidator('maxFileSize', {\n\t\tvalidateString: function(_value, maxSize, parsleyInstance) {\n\t\t\n\t\t\tif (!window.FormData) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t\n\t\t\tvar files = parsleyInstance.$element[0].files;\n\t\t\treturn files.length != 1 || files[0].size <= maxSize * 1024 * 1024;\n\t\t\t\n\t\t},\n\t\trequirementType: 'integer',\n\t\tmessages: {\n\t\t\ten: 'This file should not be larger than %s Mb.'\n\t\t}\n\t});\n\t\n})(jQuery);","(function ($) {\n\tfunction provide_results() {\n\t\tvar result = \"\",\n\t\t\tshoulders = $(\"#input_step_1\").val(),\n\t\t\tbust = $(\"#input_step_2\").val(),\n\t\t\twaist = $(\"#input_step_3\").val(),\n\t\t\thips = $(\"#input_step_4\").val();\n\n\t\tvar shoulders_hips = Math.round((shoulders / hips) * 100) / 100,\n\t\t\tbust_hips = Math.round((bust / hips) * 100) / 100,\n\t\t\twaist_shoulders = Math.round((waist / shoulders) * 100) / 100,\n\t\t\twaist_bust = Math.round((waist / bust) * 100) / 100,\n\t\t\tmax_shoulder_bust_hip =\n\t\t\t\tMath.round(Math.max(shoulders, bust, hips) * 0.95 * 100) / 100,\n\t\t\thips_shoulders = Math.round((hips / shoulders) * 100) / 100,\n\t\t\thips_bust = Math.round((hips / bust) * 100) / 100,\n\t\t\twaist_hips = Math.round((waist / hips) * 100) / 100,\n\t\t\twaist_shoulders = Math.round((waist / shoulders) * 100) / 100,\n\t\t\tshoulder_hips_diff =\n\t\t\t\tMath.round(\n\t\t\t\t\t((Math.max(shoulders, hips) - Math.min(shoulders, hips)) /\n\t\t\t\t\t\tMath.max(shoulders, hips)) *\n\t\t\t\t\t\t100\n\t\t\t\t) / 100;\n\n\t\t// Hourglass (Curvy)\n\t\tconst is_hourglass =\n\t\t\t(waist_shoulders <= 0.75 || waist_bust <= 0.75) &&\n\t\t\twaist_hips <= 0.75 &&\n\t\t\tshoulder_hips_diff <= 0.05;\n\n\t\t// Oval (Round)\n\t\tconst is_oval = waist_shoulders >= 1.05 && waist_hips >= 1.05;\n\n\t\t// Rectangle (Athletic)\n\t\tconst is_rectangle =\n\t\t\t(waist_shoulders >= 0.75 || waist_bust >= 0.75) &&\n\t\t\tshoulders >= max_shoulder_bust_hip &&\n\t\t\tbust >= max_shoulder_bust_hip &&\n\t\t\thips >= max_shoulder_bust_hip;\n\n\t\t// Triangle (Pear)\n\t\tconst is_triangle = hips_shoulders >= 1.05 || hips_shoulders >= 1.05;\n\n\t\t// Heart (Apple)\n\t\tconst is_heart = shoulders_hips >= 1.05 || bust_hips >= 1.05;\n\n\t\tif (is_hourglass) {\n\t\t\tresult = \"hourglass\";\n\t\t} else if (is_oval) {\n\t\t\tresult = \"oval\";\n\t\t} else if (is_rectangle) {\n\t\t\tresult = \"rectangle\";\n\t\t} else if (is_triangle) {\n\t\t\tresult = \"triangle\";\n\t\t} else if (is_heart) {\n\t\t\tresult = \"heart\";\n\t\t} else {\n\t\t\tresult = \"other\";\n\t\t}\n\n\t\t$('[data-result=\"' + result + '\"]').addClass(\"is-active\");\n\t}\n\n\tfunction process_step(step) {\n\t\tvar max_step = $(\".calculator-controls-form-label.step\").length;\n\n\t\t$(\".calculator-controls-form-label\").each(function () {\n\t\t\t$(this).removeClass(\"is-active\");\n\t\t});\n\n\t\t$(\".calculator-display img\").each(function () {\n\t\t\t$(this).removeClass(\"is-active\");\n\t\t});\n\n\t\t$(\".calculator\").attr(\"data-step\", step);\n\t\t$(\".calculator-controls-header-step\").html(step);\n\t\t$('.calculator-controls-form-label[data-step=\"' + step + '\"]').addClass(\n\t\t\t\"is-active\"\n\t\t);\n\t\t$(\n\t\t\t'.calculator-controls-form-label[data-step=\"' + step + '\"] input'\n\t\t).focus();\n\t\t$('.calculator-display img[data-step=\"' + step + '\"]').addClass(\n\t\t\t\"is-active\"\n\t\t);\n\n\t\tif (step > max_step) {\n\t\t\tprovide_results();\n\t\t}\n\t}\n\n\tfunction get_started() {\n\t\t$(\".calculator-welcome\").hide();\n\t\t$(\".calculator-display\").show();\n\t\t$(\".calculator-controls\").show();\n\n\t\tprocess_step(1);\n\t}\n\n\t$(function () {\n\t\t// Switch measurement\n\t\t$(\".ui-toggle-label\").on(\"click\", function (event) {\n\t\t\tevent.stopPropagation();\n\n\t\t\tsetTimeout(\n\t\t\t\tfunction (input) {\n\t\t\t\t\tvar label = \"INCHES\";\n\t\t\t\t\tif (input.prop(\"checked\")) {\n\t\t\t\t\t\tlabel = \"CM\";\n\t\t\t\t\t}\n\t\t\t\t\t$(\".calculator-controls-form-measurement\").each(\n\t\t\t\t\t\tfunction () {\n\t\t\t\t\t\t\t$(this).html(label);\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\t300,\n\t\t\t\t$(this).siblings(\".ui-toggle-checkbox\")\n\t\t\t);\n\t\t});\n\n\t\t$(\".calculator-welcome-button-start\").on(\"click\", function (event) {\n\t\t\tevent.preventDefault();\n\t\t\tget_started();\n\t\t});\n\n\t\t// Start over\n\t\t$(\".calculator-controls-buttons-redo\").on(\"click\", function (event) {\n\t\t\tevent.preventDefault();\n\n\t\t\tdocument.getElementById(\"calculator_form\").reset();\n\t\t\tprocess_step(1);\n\t\t});\n\n\t\t// Back 1 step\n\t\t$(\".calculator-controls-buttons-back\").on(\"click\", function (event) {\n\t\t\tevent.preventDefault();\n\t\t\tprocess_step(\n\t\t\t\tparseInt($(this).closest(\".calculator\").attr(\"data-step\")) - 1\n\t\t\t);\n\t\t});\n\n\t\t// Forward 1 step\n\t\t$(\".calculator-controls-buttons-next\").on(\"click\", function (event) {\n\t\t\tevent.preventDefault();\n\n\t\t\tvar wrapper = $(this)\n\t\t\t\t.closest(\".calculator-controls-form\")\n\t\t\t\t.find(\n\t\t\t\t\t\".calculator-controls-form-label.is-active .calculator-controls-form-label-input\"\n\t\t\t\t);\n\t\t\tvar input = wrapper.children(\"input\");\n\t\t\twrapper.removeClass(\"error\");\n\n\t\t\tif (parseFloat(input.val()) != input.val()) {\n\t\t\t\twrapper.addClass(\"error\");\n\t\t\t\tinput.focus();\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tprocess_step(\n\t\t\t\tparseInt($(this).closest(\".calculator\").attr(\"data-step\")) + 1\n\t\t\t);\n\t\t});\n\t});\n})(jQuery);\n",";(function($) {\n\n\tvar formIsDisabled = false;\n\tvar $form = $('#form_ask_a_stylist_cta');\n\n\tvar disableForm = function() {\n\n\t\tformIsDisabled = true;\n\n\t\t$('input[type=text], input[type=email], input[type=file], textarea, button, .wrap--fancy-file-input', $form)\n\t\t\t.attr('disabled', 'disabled')\n\n\t\t$('button', $form)\n\t\t\t.addClass('button--loading');\n\n\t};\n\n\tvar enableForm = function() {\n\n\t\tformIsDisabled = false;\n\n\t\t$('input[type=text], input[type=email], input[type=file], textarea, button, .wrap--fancy-file-input', $form)\n\t\t\t.removeAttr('disabled', 'disabled')\n\n\t\t$('button', $form)\n\t\t\t.removeClass('button--loading');\n\n\t};\n\n\tvar onError = function(jqXHR, textStatus, errorThrown) {\n\n\t\t$('[data-display-on-error]', $form).show();\n\t\tenableForm();\n\n\t};\n\n\tvar onSuccess = function(data) {\n\n\t\t$('[data-display-on-success]', $form).show();\n\t\t$('[data-hide-on-success]', $form).hide();\n\t\t$(document.body).append('');\n\n\t};\n\n\tvar postToApi = function(e) {\n\n\n\t\te.validationResult = false;\n\n\t\tvar data = new FormData();\n\n\t\tdata.append('message',\t$('[name=message]', $form).val());\n\t\tdata.append('photo',\t$('[name=photo]', $form)[0].files[0]);\n\t\tdata.append('name',\t\t$('[name=name]', $form).val());\n\t\tdata.append('email',\t$('[name=email]', $form).val());\n\n\t\t$.ajax({\n\t\t\turl:\t\t\tSF_BASE_API_URL + '/stitchfix/v1/ask-a-stylist',\n\t\t\ttype:\t\t\t'POST',\n\t\t\tdata:\t\t\tdata,\n\t\t\tcontentType:\tfalse,\n\t\t\tcache:\t\t\tfalse,\n\t\t\tprocessData:\tfalse,\n\t\t\tsuccess:\t\tonSuccess,\n\t\t\terror:\t\t\tonError\n\t\t});\n\n\t\t$('[data-display-on-error]', $form).hide();\n\t\tdisableForm();\n\n\t};\n\n\tvar resetForm = function(e) {\n\n\t\te.preventDefault();\n\t\tenableForm();\n\n\t\t$('[data-display-on-error]', $form).hide();\n\t\t$('[data-display-on-success]', $form).hide();\n\t\t$('[data-hide-on-success]', $form).show();\n\n\t\t$form[0].reset();\n\n\t};\n\n\tif ($form.length)\n\t{\n\t\t$form.parsley().on('form:success', postToApi);\n\t\t$('[data-reset-on-click]', $form).on('click', resetForm);\n\t}\n\n})(jQuery);\n",";(function($) {\n\n\tvar formIsDisabled = false;\n\tvar $form = $('#form_ask_a_stylist');\n\n\tvar disableForm = function() {\n\n\t\tformIsDisabled = true;\n\n\t\t$('input[type=text], input[type=email], input[type=file], textarea, button, .wrap--fancy-file-input', $form)\n\t\t\t.attr('disabled', 'disabled')\n\n\t\t$('button', $form)\n\t\t\t.addClass('button--loading');\n\n\t};\n\n\tvar enableForm = function() {\n\n\t\tformIsDisabled = false;\n\n\t\t$('input[type=text], input[type=email], input[type=file], textarea, button, .wrap--fancy-file-input', $form)\n\t\t\t.removeAttr('disabled', 'disabled')\n\n\t\t$('button', $form)\n\t\t\t.removeClass('button--loading');\n\n\t};\n\n\tvar onError = function(jqXHR, textStatus, errorThrown) {\n\n\t\t$('[data-display-on-error]', $form).show();\n\t\tenableForm();\n\n\t};\n\n\tvar onSuccess = function(data) {\n\n\t\t$('[data-display-on-success]', $form).show();\n\t\t$('[data-hide-on-success]', $form).hide();\n\t\t$(document.body).append('');\n\n\t};\n\n\tvar postToApi = function(e) {\n\t\te.validationResult = false;\n\n\t\tvar data = new FormData();\n\n\t\tdata.append('message',\t$('[name=message]', $form).val());\n\t\tdata.append('photo',\t$('[name=photo]', $form)[0].files[0]);\n\t\tdata.append('name',\t\t$('[name=name]', $form).val());\n\t\tdata.append('email',\t$('[name=email]', $form).val());\n\t\tdata.append('recaptcha',$('[name=recaptcha-field]', $form).val());\n\n\t\t$.ajax({\n\t\t\turl:\t\t\tSF_BASE_API_URL + '/stitchfix/v1/ask-a-stylist',\n\t\t\ttype:\t\t\t'POST',\n\t\t\tdata:\t\t\tdata,\n\t\t\tcontentType:\tfalse,\n\t\t\tcache:\t\t\tfalse,\n\t\t\tprocessData:\tfalse,\n\t\t\tsuccess:\t\tonSuccess,\n\t\t\terror:\t\t\tonError\n\t\t});\n\n\t\t$('[data-display-on-error]', $form).hide();\n\t\tdisableForm();\n\n\t};\n\n\tvar resetForm = function(e) {\n\n\t\te.preventDefault();\n\t\tenableForm();\n\n\t\tif(grecaptcha) {\n\t\t\tgrecaptcha.reset()\n\t\t}\n\n\t\t$('[data-display-on-error]', $form).hide();\n\t\t$('[data-display-on-success]', $form).hide();\n\t\t$('[data-hide-on-success]', $form).show();\n\n\t\t$form[0].reset();\n\n\t};\n\n\tif ($form.length)\n\t{\n\t\t$form.parsley().on('form:success', postToApi);\n\t\t$('[data-reset-on-click]', $form).on('click', resetForm);\n\t}\n\n})(jQuery);\n","(function($) {\n\n\t$(function() {\n\n\t\tlet $inputs = $('input[type=file][data-fancy-file-input]');\n\n\t\tif ($inputs.length)\n\t\t{\n\t\t\t$inputs.on('focus', function() {\n\n\t\t\t\t$(this)\n\t\t\t\t\t.parent()\n\t\t\t\t\t.addClass('focus');\n\n\t\t\t});\n\n\t\t\t$inputs.on('blur', function() {\n\n\t\t\t\t$(this)\n\t\t\t\t\t.parent()\n\t\t\t\t\t.removeClass('focus');\n\n\t\t\t});\n\n\t\t\t$inputs.on('change', function() {\n\n\t\t\t\t$(this)\n\t\t\t\t\t.siblings('label')\n\t\t\t\t\t.removeClass('placeholder')\n\t\t\t\t\t.text($(this)[0].files[0].name);\n\n\t\t\t});\n\n\t\t\t$inputs.each(function() {\n\n\t\t\t\t$(this)\n\t\t\t\t\t.wrap(\n\t\t\t\t\t\t$('
')\n\t\t\t\t\t\t\t.addClass('wrap--fancy-file-input')\n\t\t\t\t\t)\n\t\t\t\t\t.parent()\n\t\t\t\t\t.append(\n\t\t\t\t\t\t$('