1(function(){"use strict";var DATA=[],selectedA=null,selectedB=null,dataLoaded=!1,modal,backdrop,inner,closeBtn,spinner;function init(){modal=document.getElementById("bt-sg-modal"),backdrop=document.getElementById("bt-sg-backdrop"),inner=document.getElementById("bt-sg-inner"),closeBtn=document.getElementById("bt-sg-close"),spinner=document.getElementById("bt-sg-spinner"),modal&&(document.addEventListener("click",function(e){var btn=e.target.closest("[data-spec-guide-trigger]");if(btn){var style=btn.getAttribute("data-style")||"";openGuide(style)}}),closeBtn.addEventListener("click",closeGuide),backdrop.addEventListener("click",closeGuide),document.addEventListener("keydown",function(e){e.key==="Escape"&&closeGuide()}),setupPanel("a"),setupPanel("b"),document.getElementById("bt-sg-change-a").addEventListener("click",function(){clearPanel("a")}),document.getElementById("bt-sg-change-b").addEventListener("click",function(){clearPanel("b")}))}function styleCandidatesFromPage(){for(var path=window.location.pathname,match=path.match(/\/products\/([^/?]+)/),handle=match?match[1]:path.split("?")[0],parts=handle.split("-"),cands=[],i=0;i<parts.length;i++){var seg=parts[i];/\d/.test(seg)&&/^[a-z]{0,4}\d{2,6}[a-z]{0,4}$/i.test(seg)&&(i>0&&/[a-z]?\d/i.test(parts[i-1])&&/^\d+$/.test(seg)&&cands.push((parts[i-1]+"-"+seg).toUpperCase()),cands.push(seg.toUpperCase()))}cands=cands.filter(function(v,idx,a){return a.indexOf(v)===idx});var fallbacks=[];return cands.forEach(function(c){if(/\d[A-Z]$/.test(c)){var base=c.slice(0,-1);cands.indexOf(base)===-1&&fallbacks.indexOf(base)===-1&&fallbacks.push(base)}}),cands.forEach(function(c){var m=c.match(/^[A-Z](\d.*)$/);if(m){var b=m[1];cands.indexOf(b)===-1&&fallbacks.indexOf(b)===-1&&fallbacks.push(b)}}),cands.concat(fallbacks)}function detectStyleFromPage(){var c=styleCandidatesFromPage();return c.length?c[0]:""}function openGuide(preloadStyle){modal.classList.add("is-open"),document.body.style.overflow="hidden";var preloadCandidates=(preloadStyle?[preloadStyle]:[]).concat(styleCandidatesFromPage());dataLoaded?selectedA||preloadFirst(preloadCandidates,"a"):(showSpinner(),loadData(function(){hideSpinner(),selectedA||preloadFirst(preloadCandidates,"a")})),window.btProductHandlesReady||document.addEventListener("btHandlesReady",function onReady(){document.removeEventListener("btHandlesReady",onReady),selectedA&&selectedB&&renderComparison()})}function closeGuide(){modal.classList.remove("is-open"),document.body.style.overflow=""}function loadData(cb){var links=document.querySelectorAll('link[href*="bt-spec-guide-v9.css"]'),base="/cdn/shop/t/";links.length&&(base=links[0].getAttribute("href").replace(/bt-spec-guide[^/]*$/,""));var specLoaded=!1,mapLoaded=!1;function checkDone(){specLoaded&&mapLoaded&&(dataLoaded=!0,cb&&cb())}fetch(base+"bt-spec-guide-data-v12.json").then(function(r){return r.json()}).then(function(d){DATA=d,specLoaded=!0,checkDone()}).catch(function(){specLoaded=!0,checkDone()}),fetch(base+"bt-product-style-map.json").then(function(r){return r.json()}).then(function(d){window.btStyleMap=d,mapLoaded=!0,checkDone()}).catch(function(){mapLoaded=!0,checkDone()})}function brandToken(brand){return(brand||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function handleMatchesBrand(brand){var h=window.location.pathname.toLowerCase(),tok=brandToken(brand);if(!tok)return!1;if(h.indexOf(tok)!==-1)return!0;var first=tok.split("-")[0];return first.length>=4&&h.indexOf(first)!==-1}function normBrand(s){return String(s||"").toLowerCase().replace(/&/g,"").replace(/\band\b/g,"").replace(/[^a-z0-9]/g,"")}function vendorAgrees(brand){var vendor=window.btPageVendor;if(!vendor||!brand)return!0;var v=normBrand(vendor),b=normBrand(brand);return!v||!b?!0:v===b||v.indexOf(b)===0||b.indexOf(v)===0}function preloadFirst(candidates,panel){if(!(!candidates||!candidates.length))for(var i=0;i<candidates.length;i++){for(var cand=candidates[i],styleLC=cand.toLowerCase(),matches=[],j=0;j<DATA.length;j++)DATA[j].style.toLowerCase()===styleLC&&matches.push(DATA[j]);if(matches.length){var strict=/^\d/.test(cand)&&candidates.some(function(o){return o!==cand&&/^[A-Za-z]$/.test(o.charAt(0))&&o.slice(1)===cand});if(strict){for(var sp=null,s2=0;s2<matches.length;s2++)if(handleMatchesBrand(matches[s2].brand)){sp=matches[s2];break}if(sp){selectProduct(sp,panel);return}else continue}var pick=matches[0];if(matches.length>1){for(var k=0;k<matches.length;k++)if(handleMatchesBrand(matches[k].brand)){pick=matches[k];break}}if(!(!vendorAgrees(pick.brand)&&!handleMatchesBrand(pick.brand))){selectProduct(pick,panel);return}}}}function preload(style,panel){for(var styleLC=style.toLowerCase(),i=0;i<DATA.length;i++)if(DATA[i].style.toLowerCase()===styleLC){selectProduct(DATA[i],panel);break}}function cleanTitle(title){return title=title.replace(/®/g,"").replace(/™/g,"").replace(/©/g,"").replace(/&/g,"&").replace(/"/g,'"'),title.replace(/[®â¢]/g,"").replace(/\s*[-ââ]\s*/g," - ").replace(/\s{2,}/g," ").replace(/\.\s*$/,"").trim()}var SEARCH_LIMIT=100;function isDiscontinued(p){return(p.title||"").trim().toLowerCase().indexOf("discontinued")===0}function styleKey(style){var s=(style||"").toUpperCase(),m=s.match(/^([A-Z]*)(\d+)([A-Z]*)$/);return m?{num:parseInt(m[2],10),pre:m[1].length,suf:m[3].length,raw:s}:{num:1/0,pre:s.length,suf:0,raw:s}}function search(query){if(!query||query.trim().length<2)return{items:[],total:0};for(var raw=query.toLowerCase().trim(),tokens=raw.split(/\s+/).filter(
1Boolean),matches=[],i=0;i<DATA.length;i++){var p=DATA[i];if(!isDiscontinued(p)){for(var styleLC=(p.style||"").toLowerCase(),hay=styleLC+" "+(p.brand||"").toLowerCase()+" "+(p.title||"").toLowerCase()+" "+(p.category||"").toLowerCase(),allMatch=!0,t=0;t<tokens.length;t++)if(hay.indexOf(tokens[t])===-1){allMatch=!1;break}if(allMatch){var tier=styleLC===raw?0:styleLC.indexOf(raw)===0?1:2;matches.push({p:p,tier:tier,k:styleKey(p.style)})}}}matches.sort(function(a,b){return a.tier!==b.tier?a.tier-b.tier:a.k.num!==b.k.num?a.k.num-b.k.num:a.k.pre!==b.k.pre?a.k.pre-b.k.pre:a.k.suf!==b.k.suf?a.k.suf-b.k.suf:a.k.raw<b.k.raw?-1:a.k.raw>b.k.raw?1:0});var ranked=matches.map(function(m){return m.p});return{items:ranked.slice(0,SEARCH_LIMIT),total:ranked.length}}function renderDropdown(result,el){var items=result.items||[],total=result.total||0;if(!items.length)el.innerHTML='<div class="bt-sg-no-results">No results \u2014 try a style number, brand, or product name</div>';else{var rows=items.map(function(p){return'<div class="bt-sg-dropdown-item" data-style="'+esc(p.style)+'"><div class="bt-sg-item-brand">'+esc(p.brand)+'</div><div class="bt-sg-item-title">'+esc(cleanTitle(p.title))+'</div><div class="bt-sg-item-meta">'+esc(p.style)+" \xB7 "+esc(p.available_sizes||"")+"</div></div>"}).join(""),count=total>items.length?"Showing "+items.length+" of "+total+" \u2014 keep typing to narrow":total+(total===1?" result":" results");el.innerHTML=rows+'<div class="bt-sg-drop-count">'+count+"</div>"}el.classList.add("is-open"),fitDropdownHeight(el)}function fitDropdownHeight(el){var dialog=el.closest(".bt-sg-dialog")||document.getElementById("bt-sg-inner");if(dialog){var elTop=el.getBoundingClientRect().top,dialogBottom=dialog.getBoundingClientRect().bottom,room=dialogBottom-elTop-16,h=Math.max(240,Math.min(room,480));el.style.maxHeight=h+"px",el.style.overflowY="auto"}}function setupPanel(panel){var input=document.getElementById("bt-sg-search-"+panel),dropdown=document.getElementById("bt-sg-dropdown-"+panel),clearBtn=document.getElementById("bt-sg-clear-"+panel);input&&(input.addEventListener("input",function(){var q=this.value.trim();clearBtn.style.display=q?"block":"none",q.length>=2?renderDropdown(search(q),dropdown):dropdown.classList.remove("is-open")}),input.addEventListener("focus",function(){this.value.trim().length>=2&&dropdown.classList.add("is-open")}),clearBtn.addEventListener("click",function(){input.value="",clearBtn.style.display="none",dropdown.classList.remove("is-open")}),dropdown.addEventListener("click",function(e){var item=e.target.closest(".bt-sg-dropdown-item");if(item){for(var style=item.getAttribute("data-style"),i=0;i<DATA.length;i++)if(DATA[i].style===style){selectProduct(DATA[i],panel),dropdown.classList.remove("is-open"),input.value=DATA[i].brand+" "+DATA[i].style;break}}}),document.addEventListener("click",function(e){!input.contains(e.target)&&!dropdown.contains(e.target)&&dropdown.classList.remove("is-open")}))}function selectProduct(product,panel){panel==="a"?selectedA=product:selectedB=product,document.getElementById("bt-sg-panel-"+panel).classList.add("has-product"),renderCard(product,panel),renderComparison()}function clearPanel(panel){panel==="a"?selectedA=null:selectedB=null,document.getElementById("bt-sg-panel-"+panel).classList.remove("has-product"),document.getElementById("bt-sg-card-"+panel).classList.remove("is-visible"),document.getElementById("bt-sg-search-"+panel).value="",document.getElementById("bt-sg-clear-"+panel).style.display="none",renderComparison()}function renderMeasurements(product,panel,size){var m=product.measurements,container=document.getElementById("bt-sg-card-"+panel+"-meas");if(container){if(!m||Object.keys(m).length===0){container.innerHTML='<div class="bt-sg-meas-section bt-sg-meas-section--none"><p class="bt-sg-no-meas">No measurements available</p></div>';return}var sizes=Object.keys(m);(!size||!m[size])&&(size=sizes[0]);var dims=m[size],btnHtml=sizes.map(function(s){return'<button class="bt-sg-sz-btn'+(s===size?" bt-sg-sz-active":"")+'" data-sz="'+esc(s)+'">'+esc(s)+"</button>"}).join(""),rowHtml=Object.keys(dims).map(function(dim){return'<tr><td class="bt-sg-meas-dim">'+esc(dim)+'</td><td class="bt-sg-meas-val">'+esc(dims[dim])+'"</td></tr>'}).join("");container.innerHTML='<div class="bt-sg-meas-section"><div class="bt-sg-meas-label">
1Measurements (inches)</div><div class="bt-sg-sz-row" id="bt-sg-sz-row-'+panel+'">'+btnHtml+'</div><table class="bt-sg-meas-table"><thead><tr><th>Dimension</th><th>Value</th></tr></thead><tbody>'+rowHtml+"</tbody></table></div>",document.getElementById("bt-sg-sz-row-"+panel).addEventListener("click",function(e){var btn=e.target.closest(".bt-sg-sz-btn");btn&&renderMeasurements(product,panel,btn.getAttribute("data-sz"))})}}function renderCard(product,panel){document.getElementById("bt-sg-card-"+panel+"-name").textContent=cleanTitle(product.title),document.getElementById("bt-sg-card-"+panel+"-meta").textContent=product.brand+" \xB7 "+product.style;var sizesVal=product.available_sizes||(product.sizes||[]).join(", "),specDefs=[{l:"Weight",v:product.weight},{l:"Fabric",v:product.blend},{l:"Category",v:product.category},{l:"Sizes",v:sizesVal},{l:"Style #",v:product.style}],specRows=specDefs.filter(function(s){return s.v}).map(function(s){return'<tr><td class="bt-sg-card-spec-l">'+s.l+'</td><td class="bt-sg-card-spec-v">'+esc(s.v)+"</td></tr>"}).join(""),specsEl=document.getElementById("bt-sg-card-"+panel+"-specs");specsEl&&(specsEl.innerHTML='<div class="bt-sg-card-spec-label">Specifications</div><table class="bt-sg-card-spec-table"><tbody>'+specRows+"</tbody></table>");var pillsEl=document.getElementById("bt-sg-card-"+panel+"-pills");pillsEl&&(pillsEl.innerHTML=""),renderMeasurements(product,panel,null),document.getElementById("bt-sg-card-"+panel).classList.add("is-visible")}function productUrl(style){var styleLC=style.toLowerCase(),currentHandle=window.location.pathname.replace("/products/","").split("?")[0];if(currentHandle.toLowerCase().split("-").indexOf(styleLC)!==-1)return window.location.pathname;var map=window.btStyleMap||{};if(map[style.toUpperCase()])return map[style.toUpperCase()];for(var handles=window.btProductHandles||[],i=0;i<handles.length;i++)if(handles[i].handle.toLowerCase()===styleLC)return handles[i].url;for(var i=0;i<handles.length;i++)if(handles[i].handle.toLowerCase().endsWith("-"+styleLC))return handles[i].url;for(var i=0;i<handles.length;i++)if(handles[i].handle.toLowerCase().split("-").indexOf(styleLC)!==-1)return handles[i].url;return null}function renderComparison(){var area=document.getElementById("bt-sg-compare");if(!selectedA||!selectedB){area.classList.remove("is-visible");return}area.classList.add("is-visible"),document.getElementById("bt-sg-spec-grid").innerHTML=[selectedA,selectedB].map(function(p){var shopUrl=productUrl(p.style),shopBtn=window.btProductHandlesReady?shopUrl?'<a href="'+shopUrl+'" class="bt-sg-shop-btn" target="_blank">Shop '+esc(p.style)+"</a>":'<span class="bt-sg-shop-btn not-found inert" aria-hidden="true"></span>':'<span class="bt-sg-shop-btn not-found">Loading\u2026</span>';return'<div class="bt-sg-spec-card bt-sg-spec-card--compact"><div class="bt-sg-spec-card-brand">'+esc(p.brand)+'</div><div class="bt-sg-spec-card-name">'+esc(cleanTitle(p.title))+"</div>"+shopBtn+"</div>"}).join("");var sizesA=selectedA.sizes||[],sizesB=selectedB.sizes||[],shared=sizesA.filter(function(s){return sizesB.indexOf(s)!==-1});document.getElementById("bt-sg-size-tbody").innerHTML=[{product:selectedA,sizes:sizesA},{product:selectedB,sizes:sizesB}].map(function(row){return"<tr><td>"+esc(row.product.brand)+" "+esc(row.product.style)+'<br><span style="font-size:11px;color:#bbb;font-weight:400">'+esc(cleanTitle(row.product.title))+"</span></td><td>"+row.sizes.map(function(s){return'<span class="bt-sg-size-chip'+(shared.indexOf(s)!==-1?" shared":"")+'">'+esc(s)+"</span>"}).join("")+"</td></tr>"}).join(""),document.getElementById("bt-sg-size-note").textContent=shared.length?"Green = sizes available in both blanks ("+shared.join(", ")+")":"No overlapping sizes between these two blanks."}function showSpinner(){spinner&&spinner.classList.add("is-visible")}function hideSpinner(){spinner&&spinner.classList.remove("is-visible")}function esc(str){return String(str).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}window.btSpecGuide={open:openGuide},document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})(); 2//# sourceMappingURL=/cdn/shop/t/191/assets/bt-spec-guide-v20.js.map?v=87138848614985849581786998290
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.