${set.type === 'range' ? (() => {
const rangeMin = Math.ceil(Number(set.min));
const rangeMax = Math.ceil(Number(set.max));
const clampToRange = n => Math.min(Math.max(n, rangeMin), rangeMax);
const applied = (window.collection?.filters?.applied?.[set.key] || [])[0];
const bounds = String(applied ?? '').match(/^(-?[\d.]+)-(-?[\d.]+)$/);
const readBound = (raw, fallback) => Number.isFinite(Number(raw)) ? clampToRange(Math.round(Number(raw))) : fallback;
const lo = bounds ? readBound(bounds[1], rangeMin) : rangeMin;
const hi = bounds ? readBound(bounds[2], rangeMax) : rangeMax;
const span = (rangeMax - rangeMin) || 1;
const rate = Shopify.currency.rate || 1;
const cf = new Intl.NumberFormat(Shopify.locale, { style: 'currency', currency: Shopify.currency.active, maximumFractionDigits: 0 });
const sym = cf.formatToParts(0).find(part => part.type === 'currency')?.value || '';
const gf = new Intl.NumberFormat(Shopify.locale, { maximumFractionDigits: 0 });
const disp = n => gf.format(Math.round(Number(n) * rate));
const bound = n => Math.round(Number(n) * rate);
return `
`;
})() : set.type === 'swatch' ? `
${(set.options || []).filter(option => {
if (!option.depth) return true;
const applied = window.collection?.filters?.applied || {};
const selfApplied = (applied[option.filterKey || set.key] || []).includes(option.value);
const parentValue = option.value.includes(';') ? option.value.split(';').slice(0, -1).join(';') : '';
const parentChecked = Object.values(applied).some(vals => (vals || []).includes(parentValue));
return parentChecked || selfApplied;
}).map(option => `
`).join('')}
` : `
${(set.options || []).filter(option => {
if (!option.depth) return true;
const applied = window.collection?.filters?.applied || {};
const selfApplied = (applied[option.filterKey || set.key] || []).includes(option.value);
const parentValue = option.value.includes(';') ? option.value.split(';').slice(0, -1).join(';') : '';
const parentChecked = Object.values(applied).some(vals => (vals || []).includes(parentValue));
return parentChecked || selfApplied;
}).map(option => `
`).join('')}
`}