PageSourceSearch

https://artisticases.com/cdn/shop/t/36/assets/ac-cart-options.js?v=13312165958004982991790219884

js artisticases.com collected 2026-10-09 04:04:25 UTC 3,537 bytes, 2 lines download raw bytes

1(function(){var ROW=".ac-cd-prop, .ac-ct-prop";function labelOf(row){var dt=row.querySelector("dt");return dt?dt.textContent.replace(/:\s*$/,"").trim():""}function origDd(row){return row.querySelector("dd:not(.ac-prop-shown)")}function split(text){var i=text.lastIndexOf(" | ");return i<0?{value:text.trim(),price:""}:{value:text.slice(0,i).trim(),price:text.slice(i+3).trim()}}function clean(value){return value.replace(/\s*\(recommended\)\s*/i," ").replace(/\s+-\s+MagSafe$/i," MagSafe").replace(/\s+/g," ").trim()}function addPrices(a,b){var re=/\d[\d.,\s]*/,ma=a.match(re),mb=b.match(re);if(!ma||!mb)return"";var decimals=/[.,]\d{2}\s*$/.test(ma[0])?2:0,mark=decimals?ma[0].trim().slice(-3,-2):".",toNum=function(s){var digits=s.replace(/\D/g,"");return parseInt(digits,10)/Math.pow(10,/[.,]\d{2}\s*$/.test(s)?2:0)},sum=(toNum(ma[0])+toNum(mb[0])).toFixed(decimals).replace(".",mark);return a.replace(ma[0].trim(),sum)}function lineSurcharge(row,sample){var li=row.closest("[data-ac-cl-price]"),cents=li?parseInt(li.getAttribute("data-ac-cl-price"),10):NaN;if(!sample||isNaN(cents))return"";var cur=window.Shopify&&window.Shopify.currency,rate=cur&&cur.rate&&li.getAttribute("data-ac-cl-currency")!==cur.active?parseFloat(cur.rate):1,m=sample.match(/\d[\d.,\s]*/);if(!m)return"";var decimals=/[.,]\d{2}\s*$/.test(m[0])?2:0,mark=decimals?m[0].trim().slice(-3,-2):".";return sample.replace(m[0].trim(),(cents/100*rate).toFixed(decimals).replace(".",mark))}function show(row,text){var orig=origDd(row);if(orig){var shown=row.querySelector("dd.ac-prop-shown");if(text===orig.textContent.trim()){shown&&shown.remove(),orig.classList.contains("ac-prop-orig")&&orig.classList.remove("ac-prop-orig");return}shown||(shown=document.createElement("dd"),shown.className="ac-prop-shown",orig.insertAdjacentElement("afterend",shown)),shown.textContent!==text&&(shown.textContent=text),orig.classList.contains("ac-prop-orig")||orig.classList.add("ac-prop-orig")}}function tidyList(list){var rows=Array.prototype.filter.call(list.children,function(el){return el.matches(ROW)}),byLabel={};rows.forEach(function(row){byLabel[labelOf(row).toLowerCase()]=row});var caseRow=byLabel["case type"],msRow=byLabel["magsafe upgrade"]||byLabel["magesafe upgrade"];if(msRow&&!msRow.classList.contains("ac-prop-hidden")&&msRow.classList.add("ac-prop-hidden"),caseRow&&origDd(caseRow)){var c=split(origDd(caseRow).textContent),ms=msRow&&origDd(msRow)?split(origDd(msRow).textContent):null,text;if(ms&&/yes/i.test(ms.value)){var total=c.price&&ms.price?addPrices(c.price,ms.price):c.price||ms.price;text="Tough MagSafe"+(total?" | "+total:"")}else/^tough\s*-?\s*magsafe$/i.test(clean(c.value))?text="Tough MagSafe"+(lineSurcharge(caseRow,c.price)?" | "+lineSurcharge(caseRow,c.price):c.price?" | "+c.price:""):text=clean(c.value)+(c.price?" | "+c.price:"");show(caseRow,text)}var finishRow=byLabel["print finish"];if(finishRow&&origDd(finishRow)){var f=split(origDd(finishRow).textContent);show(finishRow,clean(f.value)+(f.price?" | "+f.price:""))}}function tidyAll(){var lists=[];document.querySelectorAll(ROW).forEach(function(row){row.parentElement&&lists.indexOf(row.parentElement)<0&&lists.push(row.parentElement)}),lists.forEach(tidyList)}var timer=null;function schedule(){window.clearTimeout(timer),timer=window.setTimeout(tidyAll,40)}new MutationObserver(schedule).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0}),schedule()})();
2//# sourceMappingURL=/cdn/shop/t/36/assets/ac-cart-options.js.map?v=13312165958004982991790219884

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.