// Ported verbatim from `@base-ui/react`'s
// `slider/thumb/prehydrationScript.min.ts`. Inlined inert JS string that runs
// BEFORE Solid hydration to set each thumb's `--position` CSS var (and the
// indicator's `--start-position` / `--end-position` / `--relative-size`) from
// the SSR'd `value`/`min`/`max` + measured geometry — avoiding a flash at the
// wrong position before the client measurement effects run.
//
// Emitted only server-side, gated on `inset && isHydrating &&
// renderBeforeHydration && isLastThumb` (see `slider-thumb.tsx`). The script
// reads `document.currentScript.parentElement` (the last thumb) so it must be
// rendered as a child of that thumb's element.
//
// Keep this byte-for-byte in sync with the React source; regenerate there via
// `pnpm inline-scripts` and re-copy if the React template changes.
// The `${...}` sequences are real backtick-template interpolations INSIDE the
// inlined script body (kept verbatim from React's minified output), not stray
// placeholders in this outer single-quoted string — suppress the false positive.
export const sliderPrehydrationScript =
// biome-ignore lint/suspicious/noTemplateCurlyInString: verbatim minified script body
'!function(){const t=document.currentScript?.parentElement;if(!t)return;const e=t.closest("[data-quoin-slider-control]");if(!e)return;const r=e.querySelector("[data-quoin-slider-indicator]"),i=e.getBoundingClientRect(),n="vertical"===e.getAttribute("data-orientation")?"height":"width",o=e.querySelectorAll(\'input[type="range"]\'),l=o.length>1,s=o.length-1;let a=null,u=null;for(let t=0;t<o.length;t+=1){const e=o[t],y=parseFloat(e.getAttribute("value")??"");if(Number.isNaN(y))return;const c=e.parentElement;if(!c)return;const p=parseFloat(e.getAttribute("max")??"100"),g=parseFloat(e.getAttribute("min")??"0"),b=c?.getBoundingClientRect(),d=i[n]-b[n],m=100*(y-g)/(p-g),v=(b[n]/2+d*m/100)/i[n]*100;c.style.setProperty("--position",`${v}%`),Number.isFinite(v)&&(c.style.removeProperty("visibility"),r&&(0===t?(a=v,r.style.setProperty("--start-position",`${v}%`),l||r.style.removeProperty("visibility")):t===s&&(u=v-(a??0),r.style.setProperty("--end-position",`${v}%`),r.style.setProperty("--relative-size",`${u}%`),r.style.removeProperty("visibility"))))}}();';
//# sourceMappingURL=prehydration-script.jsx.map
