{"version":3,"names":["sliderPrehydrationScript"],"sources":["prehydration-script.ts"],"sourcesContent":["// Ported verbatim from `@base-ui/react`'s\n// `slider/thumb/prehydrationScript.min.ts`. Inlined inert JS string that runs\n// BEFORE Solid hydration to set each thumb's `--position` CSS var (and the\n// indicator's `--start-position` / `--end-position` / `--relative-size`) from\n// the SSR'd `value`/`min`/`max` + measured geometry — avoiding a flash at the\n// wrong position before the client measurement effects run.\n//\n// Emitted only server-side, gated on `inset && isHydrating &&\n// renderBeforeHydration && isLastThumb` (see `slider-thumb.tsx`). The script\n// reads `document.currentScript.parentElement` (the last thumb) so it must be\n// rendered as a child of that thumb's element.\n//\n// Keep this byte-for-byte in sync with the React source; regenerate there via\n// `pnpm inline-scripts` and re-copy if the React template changes.\n// The `${...}` sequences are real backtick-template interpolations INSIDE the\n// inlined script body (kept verbatim from React's minified output), not stray\n// placeholders in this outer single-quoted string — suppress the false positive.\nexport const sliderPrehydrationScript =\n\t// biome-ignore lint/suspicious/noTemplateCurlyInString: verbatim minified script body\n\t'!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\"))))}}();';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,wBAAwB;AACpC;AACA,qiCAAqiC","ignoreList":[]}