PageSourceSearch

https://veronicabeard.com/cdn/shop/t/1989/assets/size-guide-table.js?v=48111009847546063261790009942

js veronicabeard.com collected 2026-09-24 18:00:17 UTC 25,409 bytes, 2 lines download raw bytes

1import{parseCSV}from"@theme/utilities";function getSizeGuideData(){if(typeof document>"u")return null;var el=document.getElementById("sg-size-guide-data");if(!el||!el.textContent)return null;try{return JSON.parse(el.textContent)}catch{return null}}function getMeasurementTooltips(){var data=getSizeGuideData();if(!data||!data.measurementTooltips)return{};var tooltips={},mt=data.measurementTooltips;return(mt.measurements||[]).forEach(function(p){tooltips[p.key]=p.value}),tooltips}export function inchesToCm(inches){return(inches*2.54).toFixed(1)}export function cmToInches(cm){return(cm/2.54).toFixed(1)}(function(){function escapeAttr(s){return String(s).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function getSizeGuideRoot(scope){if(scope instanceof Element&&scope.matches("dialog, [data-size-guide]"))return scope;if(scope instanceof Element){var parentRoot=scope.closest("dialog, [data-size-guide]");if(parentRoot)return parentRoot}var activeRoot=document.querySelector('dialog#sizeGuide[open], dialog.size-guide-dialog[open], [data-size-guide="page"]');return activeRoot||document}function getCountryCode(scope){var root=getSizeGuideRoot(scope),fromRoot=root instanceof Element?(root.getAttribute("data-country-code")||"").trim():"",fromShopify=window.Shopify&&window.Shopify.country||"";return(fromShopify||fromRoot||"US").toUpperCase()}function normalizeCountryHeader(header){var text=String(header||"").trim().toUpperCase();if(!text)return"";var token=text.match(/\b([A-Z]{2})\b/);if(token&&token[1])return token[1];var leading=text.match(/^([A-Z]{2})/);return leading&&leading[1]?leading[1]:text.replace(/[^A-Z]/g,"")}function getCountryAliases(countryCode){var code=String(countryCode||"").toUpperCase();return code==="GB"||code==="UK"?["GB","UK"]:[code]}function headerMatchesCountry(header,countryCode){for(var text=String(header||"").toUpperCase(),aliases=getCountryAliases(countryCode),i=0;i<aliases.length;i++){var alias=aliases[i];if(alias){var pattern=new RegExp("(^|[^A-Z])"+alias+"([^A-Z]|$)");if(pattern.test(text))return!0}}return!1}function getUsHeaderType(header){var text=String(header||"").trim().toUpperCase();return text.indexOf("US SIZE")!==-1?"us_size":text.indexOf("US ALPHA")!==-1?"us_alpha":""}function getPriorityColumnIndex(headers,countryCode){var target=(countryCode||"US").toUpperCase(),idx=headers.findIndex(function(h){return headerMatchesCountry(h,target)});return idx!==-1?idx:target!=="US"?headers.findIndex(function(h){return headerMatchesCountry(h,"US")}):-1}function buildConversionColumnOrder(headers,countryCode){var usSizeIdx=headers.findIndex(function(h){return getUsHeaderType(h)==="us_size"}),usAlphaIdx=headers.findIndex(function(h){return getUsHeaderType(h)==="us_alpha"}),geoIdx=getPriorityColumnIndex(headers,countryCode),order=[];function pushIdx(idx){idx<0||order.indexOf(idx)===-1&&order.push(idx)}pushIdx(usSizeIdx),pushIdx(usAlphaIdx),pushIdx(geoIdx);for(var i=0;i<headers.length;i++)pushIdx(i);return{order,geoIndex:geoIdx}}
1function renderSizeGuideTable(csvData,activeProductTypes,scope){var table=scope?scope.querySelector("#sizeGuideTable"):document.getElementById("sizeGuideTable");if(!(!table||!csvData)){var root=table.closest("dialog, [data-size-guide]"),showSizePrefix=root?root.getAttribute("data-show-size-prefix")!=="false":!0,data=parseCSV(csvData);if(data.length!==0){var firstRow=data[0];if(firstRow){for(var numCols=firstRow.length,numRows=data.length,transposed=[],c=0;c<numCols;c++){for(var newRow=[],r=0;r<numRows;r++)newRow.push(data[r]?.[c]??"");transposed.push(newRow)}for(var shouldSplitFirstColumn=!1,i=1;i<transposed.length;i++){var val=transposed[i]?.[0]??"";if(val.indexOf(",")!==-1){shouldSplitFirstColumn=!0;break}}table.setAttribute("data-size-columns",shouldSplitFirstColumn?"2":"1");var html="<thead><tr>",headers=transposed[0];if(headers){var firstHeader=headers[0]||"",displayHeader=firstHeader.toLowerCase()==="us size"?"Size":firstHeader;shouldSplitFirstColumn?html+='<th scope="col" colspan="2">'+displayHeader+"</th>":html+='<th scope="col">'+displayHeader+"</th>";for(var tooltips=getMeasurementTooltips(),h=1;h<headers.length;h++){var columnName=(headers[h]||"").trim(),columnKey=columnName.toLowerCase().trim(),tooltipData=tooltips[columnKey],hasTooltip=tooltipData&&(tooltipData.measurement_guide||tooltipData.measurement_copy);hasTooltip&&tooltipData.product_types&&tooltipData.product_types.length>0&&activeProductTypes&&activeProductTypes.length>0&&(hasTooltip=tooltipData.product_types.some(function(pt){return activeProductTypes.indexOf(pt)!==-1})),html+='<th scope="col">'+columnName,hasTooltip&&(html+=' <button type="button" class="sg-th-tooltip-trigger" data-sg-tooltip-key="'+escapeAttr(columnKey)+'" aria-label="More info about '+escapeAttr(columnName)+'"></button>'),html+="</th>"}html+="</tr></thead><tbody>";for(var rowIdx=1;rowIdx<transposed.length;rowIdx++){html+="<tr>";for(var rowCells=transposed[rowIdx],colCount=rowCells?rowCells.length:0,colIdx=0;colIdx<colCount;colIdx++){var value=rowCells&&rowCells[colIdx]||"";if(colIdx===0)if(shouldSplitFirstColumn){var sizeParts=value.split(",").map(function(s){return s.trim()}),numericSize=sizeParts[0]||"",letterSize=sizeParts[1]||"";html+='<th scope="row">'+(showSizePrefix?'<span class="size-prefix">US </span>':"")+numericSize+"</th>",html+="<td>"+letterSize+"</td>"}else html+='<th scope="row">'+(showSizePrefix?'<span class="size-prefix">US </span>':"")+value+"</th>";else html+="<td>"+value+"</td>"}html+="</tr>"}html+="</tbody>",table.innerHTML=html,initMeasurementTooltips(table)}}}}}function initMeasurementTooltips(tableEl){var wrapper=tableEl.closest(".sg-table-wrapper"),tooltip=wrapper?wrapper.querySelector("#sgMeasurementTooltip"):null,imageWrap=wrapper?wrapper.querySelector("#sgTooltipImageWrap"):null,tooltipImage=wrapper?wrapper.querySelector("#sgTooltipImage"):null,tooltipContent=wrapper?wrapper.querySelector("#sgTooltipContent"):null,tooltipClose=wrapper?wrapper.querySelector("#sgTooltipClose"):null;if(!wrapper||!tooltip||!tooltipContent||wrapper.hasAttribute("data-sg-tooltip-bound"))return;wrapper.setAttribute("data-sg-tooltip-bound","true");var w=wrapper,t=tooltip,tc=tooltipContent,tooltips=getMeasurementTooltips(),hoverTimeout=null;function showTooltip(trigger){var key=trigger.getAttribute("data-sg-tooltip-key"),data=key?tooltips[key]:null;if(data){data.measurement_guide&&tooltipImage&&imageWrap?(tooltipImage.src=data.measurement_guide,tooltipImage.alt=trigger.getAttribute("aria-label")||"",imageWrap.style.display="block"):imageWrap&&(imageWrap.style.display="none"),tc.innerHTML=data.measurement_copy||"";var tw=204,triggerRect=trigger.getBoundingClientRect(),wrapperRect=w.getBoundingClientRect(),left=triggerRect.left-wrapperRect.left-tw/2+triggerRect.width/2,top=triggerRect.bottom-wrapperRect.top+8,maxLeft=wrapperRect.width-tw-10;left<10?left=10:left>maxLeft&&(left=maxLeft),t.style.left=left+"px",t.style.top=top+"px",t.classList.add("active"),t.setAttribute("aria-hidden","false")}}function hideTooltip(){t.classList.remove("active"),t.setAttribute("aria-hidden","true")}function isDesktop(){return typeof window<"u"&&window.innerWidth>=1080}tooltipClose&&tooltipClose.addEventListener("click",function(e){e.stopPropagation(),hideTooltip()}),w.addEventListener("click",function(e){var target=e.target instanceof Element?e.target:null,trigger=target&&target.closest(".sg-th-tooltip-trigger");trigger&&(e.preventDefault(),t.classList.contains("active")?hideTooltip():showTooltip(trigger))}),w.addEventListener("mouseover",function(e){if(isDesktop()){var target=e.target instanceof Element?e.target:null,trigger=target&&target.closest(".sg-th-tooltip-trigger");trigger&&(hoverTimeout&&clearTimeout(hoverTimeout),hoverTimeout=null,showTooltip(trigger))}}),w.addEventListener("mouseout",function(e){if(isDesktop()){var ev=e,related=ev.relatedTarget instanceof Node?ev.relatedTarget:null;related&&(w.contains(related)||t.contains(related))||(hoverTimeout=setTimeout(function(){var triggerHover=w.querySelector(".sg-th-tooltip-trigger:hover"),tooltipHover=t.matches&&t.matches(":hover");!triggerHover&&!tooltipHover&&hideTooltip(),hoverTimeout=null},150))}}),document.addEventListener("click",function(e){var target=e.target instanceof Node?e.target:null;target&&!w.contains(target)&&!t.contains(target)&&t.classList.contains("active")&&hideTooltip()})}function getSizeGuideSizeColumnCount(table){var raw=table.getAttribute("data-size-columns");if(raw!=null&&raw!==""){var parsed=parseInt(raw,10);if(Number.isFinite(parsed)&&parsed>=1)return Math.min(parsed,4)}var headRow=table.tHead&&table.tHead.rows[0];if(!headRow||headRow.cells.length===0)return 1;var idx=0,firstTh=headRow.cells[0];firstTh&&firstTh.getAttribute("data-sg-injected-country-column")==="true"&&(idx=1);var sizeHeader=headRow.cells[idx];return sizeHeader&&sizeHeader.colSpan>=2?2:1}function convertTableUnits(scope){var tableEl=scope?scope.querySelector("#sizeGuideTable"):document.getElementById("sizeGuideTable");if(tableEl){var table=tableEl,win2=window,isMetric=!!win2.sizeGuideIsMetric,tbody=table.tBodies[0];if(tbody)for(var sizeColCount=getSizeGuideSizeColumnCount(table),rows=tbody.rows,r=0;r<rows.length;r++){var row=rows[r];if(row){for(var cells=row.cells,c=0;c<cells.length;){var lead=cells[c];if(!lead)break;if(lead.getAttribute("data-sg-conversion-size")==="true"){c+=1;continue}break}var startMeasurement=c+sizeColCount;for(c=startMeasurement;c<cells.length;c++){var cell=cells[c];if(cell){var text=cell.textContent||"",original=cell.getAttribute("data-original-value");original==null&&(cell.setAttribute("data-original-value",text),original=text),isMetric?cell.textContent=original.replace(/(\d+\.?\d*)/g,function(match){var num=parseFloat(match);return Number.isNaN(num)?match:inchesToCm(num)}):cell.textContent=original}}}}}}window.convertTableUnits=convertTableUnits;function renderConversionTable(csvData,scope){var root=getSizeGuideRoot(scope),table=root.querySelector("#conversionTable");if(!(!table||!csvData)){var data=parseCSV(csvData);if(data.length!==0){var firstRow=data[0];if(!(!firstRow||firstRow.length===0)){var secondCell=String(firstRow[1]||"").trim(),isColumnFirst=/\d/.test(secondCell),headers=[],bodyRows=[];if(isColumnFirst){for(var cfNumRows=data.length,cfNumCols=firstRow.length,cfR=0;cfR<cfNumRows;cfR++){var cfHeaderRow=data[cfR];headers.push(String(cfHeaderRow&&cfHeaderRow[0]||"").trim())}for(var cfC=1;cfC<cfNumCols;cfC++){for(var row=[],cfRi=0;cfRi<cfNumRows;cfRi++){var cfBodyRow=data[cfRi];row.push(String(cfBodyRow&&cfBodyRow[cfC]||"").trim())}bodyRows.push(row)}}else{headers=firstRow.map(function(h2){return String(h2||"").trim()});for(var rfR=1;rfR<data.length;rfR++){var rfRow=data[rfR];rfRow&&bodyRows.push(rfRow.map(function(cell){return String(cell||"").trim()}))}}var countryCode=getCountryCode(root),columnOrderData=buildConversionColumnOrder(headers,countryCode),orderedIndices=columnOrderData.order,orderedGeoSourceIdx=columnOrderData.geoIndex;headers=orderedIndices.map(function(idx){return headers[idx]||""}),bodyRows=bodyRows.map(function(row2){return orderedIndices.map(function(idx){return row2&&row2[idx]||""})}),table.setAttribute("data-conversion-source-index",String(Math.max(0,orderedIndices.indexOf(orderedGeoSourceIdx))));for(var html="<thead><tr>",h=0;h<headers.length;
1h++)html+='<th scope="col">'+headers[h]+"</th>";html+="</tr></thead><tbody>";for(var r=0;r<bodyRows.length;r++){var rowCells=bodyRows[r];if(rowCells){html+="<tr>";for(var c=0;c<rowCells.length;c++)c===0?html+='<th scope="row">'+rowCells[c]+"</th>":html+="<td>"+rowCells[c]+"</td>";html+="</tr>"}}html+="</tbody>",table.innerHTML=html}}}}function syncMeasurementsFirstColumnFromConversion(scope){var root=getSizeGuideRoot(scope),measurementsTableEl=root.querySelector("#sizeGuideTable"),conversionTableEl=root.querySelector("#conversionTable");if(!(measurementsTableEl instanceof HTMLTableElement)||!(conversionTableEl instanceof HTMLTableElement))return;var measurementsTable=measurementsTableEl,conversionTable=conversionTableEl;function ensureFirstCellIsRowHeader(row){var firstCell=row.cells[0];if(!firstCell||firstCell.tagName==="TH"){firstCell&&firstCell.tagName==="TH"&&firstCell.setAttribute("scope","row");return}for(var headerCell=document.createElement("th"),attrs=Array.from(firstCell.attributes),i=0;i<attrs.length;i++){var attr=attrs[i];attr&&headerCell.setAttribute(attr.name,attr.value)}for(headerCell.setAttribute("scope","row");firstCell.firstChild;)headerCell.appendChild(firstCell.firstChild);firstCell.replaceWith(headerCell)}function demoteFirstRowHeaderToDataCell(row){var firstCell=row.cells[0];if(!(!firstCell||firstCell.tagName!=="TH"||firstCell.getAttribute("scope")!=="row")){for(var dataCell=document.createElement("td"),attrs=Array.from(firstCell.attributes),i=0;i<attrs.length;i++){var attr=attrs[i];!attr||attr.name==="scope"||dataCell.setAttribute(attr.name,attr.value)}for(;firstCell.firstChild;)dataCell.appendChild(firstCell.firstChild);firstCell.replaceWith(dataCell)}}function removeInjectedMeasurementCountryColumn(){var headerRow=measurementsTable.tHead&&measurementsTable.tHead.rows[0];if(headerRow&&headerRow.cells[0]){var firstHeaderCell=headerRow.cells[0];firstHeaderCell&&firstHeaderCell.getAttribute("data-sg-injected-country-column")==="true"&&firstHeaderCell.remove()}var body=measurementsTable.tBodies[0];if(body)for(var rowIdx2=0;rowIdx2<body.rows.length;rowIdx2++){var row=body.rows[rowIdx2];if(!(!row||!row.cells[0])){var firstCell=row.cells[0];firstCell&&firstCell.getAttribute("data-sg-injected-country-column")==="true"&&(firstCell.remove(),ensureFirstCellIsRowHeader(row))}}}if(getCountryCode(root)==="US"){removeInjectedMeasurementCountryColumn();return}var hasConversionRows=conversionTable.tBodies&&conversionTable.tBodies[0]&&conversionTable.tBodies[0].rows&&conversionTable.tBodies[0].rows.length>0;if(!hasConversionRows){var conversionContent=root.querySelector("#conversion-content"),csvData=conversionContent?conversionContent.getAttribute("data-conversion-csv"):null;csvData&&renderConversionTable(csvData,root)}var measureBody=measurementsTable.tBodies[0],conversionBody=conversionTable.tBodies[0];if(!(!measureBody||!conversionBody)){removeInjectedMeasurementCountryColumn();var sourceIndex=parseInt(conversionTable.getAttribute("data-conversion-source-index")||"0",10);(!Number.isFinite(sourceIndex)||sourceIndex<0)&&(sourceIndex=0);var measureHeaderRow=measurementsTable.tHead&&measurementsTable.tHead.rows[0],conversionHeaderRow=conversionTable.tHead&&conversionTable.tHead.rows[0];if(measureHeaderRow&&conversionHeaderRow&&sourceIndex<conversionHeaderRow.cells.length){var sourceHeaderCell=conversionHeaderRow.cells[sourceIndex];if(sourceHeaderCell){var insertedHeaderCell=document.createElement("th");insertedHeaderCell.setAttribute("data-sg-injected-country-column","true"),insertedHeaderCell.setAttribute("scope","col"),insertedHeaderCell.textContent=sourceHeaderCell.textContent||"",measureHeaderRow.firstChild?measureHeaderRow.insertBefore(insertedHeaderCell,measureHeaderRow.firstChild):measureHeaderRow.appendChild(insertedHeaderCell)}}for(var rowCount=Math.min(measureBody.rows.length,conversionBody.rows.length),rowIdx=0;rowIdx<rowCount;rowIdx++){var measureRow=measureBody.rows[rowIdx],conversionRow=conversionBody.rows[rowIdx];if(!(!measureRow||!conversionRow)&&!(conversionRow.cells.length<=sourceIndex)){var sourceCell=conversionRow.cells[sourceIndex];if(sourceCell){demoteFirstRowHeaderToDataCell(measureRow);var insertedCell=document.createElement("th");insertedCell.setAttribute("data-sg-injected-country-column","true"),insertedCell.setAttribute("data-sg-conversion-size","true"),insertedCell.setAttribute("scope","row"),insertedCell.textContent=sourceCell.textContent||"",measureRow.firstChild?measureRow.insertBefore(insertedCell,measureRow.firstChild):measureRow.appendChild(insertedCell)}}}}}function showConversionContent(scope){var root=getSizeGuideRoot(scope),conversionContent=root.querySelector("#conversion-content"),measurementsContent=root.querySelector("#measurements-content"),controls=root.querySelector(".sg-measurement-control
1s");conversionContent&&conversionContent.classList.add("active"),measurementsContent&&measurementsContent.classList.remove("active"),controls&&controls.classList.add("sg-measurement-controls--hidden");var csv=conversionContent?conversionContent.getAttribute("data-conversion-csv"):null;csv&&renderConversionTable(csv,root)}function showMeasurementsContent(scope){var root=getSizeGuideRoot(scope),conversionContent=root.querySelector("#conversion-content"),measurementsContent=root.querySelector("#measurements-content"),controls=root.querySelector(".sg-measurement-controls");conversionContent&&conversionContent.classList.remove("active"),measurementsContent&&measurementsContent.classList.add("active"),controls&&controls.classList.remove("sg-measurement-controls--hidden"),syncMeasurementsFirstColumnFromConversion(root)}var chartTabs=document.querySelectorAll(".size-chart-section [data-chart-tab]");chartTabs.forEach(function(tab){tab.addEventListener("click",function(){var root=getSizeGuideRoot(this),target=this.getAttribute("data-chart-tab");root.querySelectorAll(".size-chart-section [data-chart-tab]").forEach(function(t){var isActive=t.getAttribute("data-chart-tab")===target;t.classList.toggle("active",isActive),t.setAttribute("aria-selected",isActive?"true":"false")}),target==="conversion"?showConversionContent(root):showMeasurementsContent(root)})});var initialMeasureContent=null;function updateHowToMeasureSection(selectElement){var root=selectElement.closest("dialog, [data-size-guide]"),wrapper=root?root.querySelector(".sg-how-to-measure-content-wrapper"):null;if(wrapper){initialMeasureContent===null&&(initialMeasureContent=wrapper.innerHTML);var selected=selectElement.options[selectElement.selectedIndex],guideId=selected?selected.value:null,howToMeasureId=selected?selected.getAttribute("data-how-to-measure-id"):null,data=getSizeGuideData(),entry=null;if(data&&data.sizeGuideMeasure&&guideId&&data.sizeGuideMeasure[guideId]&&(entry=data.sizeGuideMeasure[guideId]),!entry&&data&&data.howToMeasure&&howToMeasureId&&data.howToMeasure[howToMeasureId]&&(entry=data.howToMeasure[howToMeasureId]),!entry&&data?.howToMeasure?.default&&(entry=data.howToMeasure.default),entry&&(entry.image||entry.contentHtml)){var parts=[];if(entry.image){var imgSrc=String(entry.image).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),titleAttr="",imageAlt="";entry.imageAlt&&String(entry.imageAlt).trim()!==""?(imageAlt=String(entry.imageAlt).trim(),titleAttr=' title="'+escapeAttr(imageAlt)+'"'):data&&data.howToMeasureHeading&&String(data.howToMeasureHeading).trim()!==""?imageAlt=String(data.howToMeasureHeading).trim():imageAlt="How to measure illustration",parts.push('<img class="sg-how-to-measure-image" src="'+imgSrc+'" alt="'+escapeAttr(imageAlt)+'"'+titleAttr+' width="600" height="440" loading="lazy">')}parts.push('<div class="sg-how-to-measure-text">'),data&&data.howToMeasureHeading!==""&&parts.push('<h3 class="sg-how-to-measure-heading sg-how-to-measure-heading--inline h2">'+data.howToMeasureHeading+"</h3>"),data&&data.howToMeasureSubheading!==""&&parts.push('<p class="sg-how-to-measure-subheading sg-how-to-measure-subheading--inline">'+data.howToMeasureSubheading+"</p>"),entry.contentHtml&&parts.push('<div class="sg-how-to-measure-content">'+entry.contentHtml+"</div>"),parts.push("</div>"),wrapper.innerHTML=parts.join("")}else initialMeasureContent!==null&&(wrapper.innerHTML=initialMeasureContent)}}function updateConversionContent(selectElement){var root=selectElement.closest("dialog, [data-size-guide]"),conversionContent=root?root.querySelector("#conversion-content"):null;if(conversionContent){var selected=selectElement.options[selectElement.selectedIndex],guideCsv=selected?selected.getAttribute("data-conversion-csv"):null,fallbackCsv=conversionContent.getAttribute("data-conversion-csv-fallback"),csv=guideCsv&&guideCsv.trim()!==""?guideCsv:fallbackCsv;conversionContent.setAttribute("data-conversion-csv",csv||""),conversionContent.classList.contains("active")&&csv&&renderConversionTable(csv,root),syncMeasurementsFirstColumnFromConversion(root||document)}}function updateFaqSection(selectElement){const root=selectElement.closest("dialog, [data-size-guide]");if(!root)return;const container=root.querySelector("#sg-guide-faqs");if(!container)return;const selected=selectElement.options[selectElement.selectedIndex],guideId=selected?selected.value:null,data=getSizeGuideData(),faqs=data&&data.guideFaqs&&guideId?data.guideFaqs[guideId]:null;container.innerHTML="";const heading=!!root.getAttribute("data-size-guide")?root.querySelector("#sg-faqs-heading"):null;if(!faqs||faqs.length===0){heading&&heading.setAttribute("hidden","");return}heading&&heading.removeAttribute("hidden");const iconTemplate=root.querySelector("#sg-faq-icons"),iconContent=iconTemplate?iconTemplate.content||iconTemplate:null,caretSvg=iconContent?iconContent.querySelector(".icon-caret"):null,plusSvg=iconContent?iconContent.querySelector(".icon-plus"):null,minusSvg=iconContent?iconContent.querySelector(".icon-minus"):null;for(let i=0;i<faqs.length;i++){const faq=faqs[i];if(!faq.heading)continue;const accordion=document.createElement("accordion-custom"),details=document.createElement("details");details.className="details";const summary=document.createElement("summary");summary.className="details__header";const headingSpan=document.createElement("h3");headingSpan.className="details__heading",headingSpan.textContent=faq.heading,summary.appendChild(headingSpan),caretSvg&&summary.appendChild(caretSvg.cloneNode(!0)),plusSvg&&summary.appendChild(plusSvg.cloneNode(!0)),minusSvg&&summary.appendChild(minusSvg.cloneNode(!0)),details.appendChild(summary);const content=document.createElement("div");content.className="details-content",content.innerHTML=faq.copy||"",details.appendChild(content),accordion.appendChild(details),container.appendChild(accordion)}}var HIDE_UNIT_TOGGLE_GUIDES=["dickeys","shoes"];function updateUnitToggleVisibility(selectEl,scope){var root=scope instanceof Element?scope:document,unitToggle=root.querySelector(".sg-unit-toggle");if(unitToggle){var selected=selectEl.options[selectEl.selectedIndex],title=selected?selected.textContent.trim().toLowerCase():"",shouldHide=HIDE_UNIT_TOGGLE_GUIDES.indexOf(title)!==-1;shouldHide?unitToggle.setAttribute("hidden",""):unitToggle.removeAttribute("hidden")}}function updateSizeGuideFromSelect(scope){var s=scope||document;if(!(s instanceof Element&&s.getAttribute("data-size-guide")==="page")){var sel=s.querySelector("#sizeGuideSelector"),table=s.querySelector("#sizeGuideTable");if(!(!sel||!table)){var selectEl=sel,selected=selectEl.options[selectEl.selectedIndex],csvData=selected?selected.getAttribute("data-table"):null,productTypesStr=selected&&selected.getAttribute("data-product-types")||"",activeProductTypes=productTypesStr?productTypesStr.split(",").map(function(s2){return s2.trim()}):[];
1renderSizeGuideTable(csvData,activeProductTypes,scope),updateHowToMeasureSection(selectEl),updateConversionContent(selectEl),updateFaqSection(selectEl),updateUnitToggleVisibility(selectEl,scope),window.sizeGuideIsMetric&&convertTableUnits(scope),syncMeasurementsFirstColumnFromConversion(scope)}}}if(typeof window<"u"){var win=window;win.sizeGuideOnDialogOpen=function(){var dialog=document.querySelector("dialog#sizeGuide[open], dialog.size-guide-dialog[open]"),scope=dialog||document,selEl=scope.querySelector("#sizeGuideSelector"),sel=selEl instanceof HTMLSelectElement?selEl:null,productType=dialog?(dialog.getAttribute("data-product-type")||"").trim():"";if(sel&&productType&&sel.options.length)for(var i=0;i<sel.options.length;i++){var opt=sel.options[i];if(opt){var types=(opt.getAttribute("data-product-types")||"").split(",").map(function(s){return s.trim()});if(types.indexOf(productType)!==-1){sel.selectedIndex=i;break}}}updateSizeGuideFromSelect(scope)}}document.addEventListener("change",function(e){var el=e.target instanceof HTMLElement?e.target:null;if(el&&el.id==="sizeGuideSelector"){var scope=el.closest("dialog, [data-size-guide]")||document;if(updateSizeGuideFromSelect(scope),scope instanceof Element&&scope.getAttribute("data-size-guide")==="page"){var selectEl=el,selectedOpt=selectEl.options[selectEl.selectedIndex],pageUrl=selectedOpt?selectedOpt.getAttribute("data-page-url"):null;if(pageUrl&&pageUrl!==window.location.pathname){window.location.href=pageUrl;return}}}}),window.addEventListener("popstate",function(){var page=document.querySelector('[data-size-guide="page"]');if(page){var sel=page.querySelector("#sizeGuideSelector");if(sel instanceof HTMLSelectElement)for(var currentPath=window.location.pathname,i=0;i<sel.options.length;i++){var opt=sel.options[i];if(opt&&opt.getAttribute("data-page-url")===currentPath){sel.selectedIndex=i,updateSizeGuideFromSelect(page);return}}}});function initAllSizeGuides(){document.querySelectorAll("dialog#sizeGuide, [data-size-guide]").forEach(function(root){root.querySelector("#sizeGuideSelector")&&updateSizeGuideFromSelect(root)})}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initAllSizeGuides):initAllSizeGuides()})();
2//# sourceMappingURL=/cdn/shop/t/1989/assets/size-guide-table.js.map?v=48111009847546063261790009942

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.