{"version":3,"names":["dynamic","createMemo","omit","composeRefs","userRef","mergeRootProps","resolveClassStyle","useSelectRootContext","SelectBackdrop","props","root","state","open","anchorHidden","transitionStatus","internal","role","hidden","mounted","style","data-open","undefined","data-closed","data-anchor-hidden","data-starting-style","data-ending-style","userClassStyle","userProps","merged","Tag","as"],"sources":["select-backdrop.tsx"],"sourcesContent":["import type { JSX, ValidComponent } from \"@solidjs/web\";\nimport { dynamic } from \"@solidjs/web\";\nimport { createMemo, omit } from \"solid-js\";\nimport { composeRefs, userRef } from \"../../internals/compose-refs\";\nimport { mergeRootProps } from \"../../internals/merge-root-props\";\nimport { resolveClassStyle } from \"../../internals/resolve-class-style\";\nimport type { BaseUIComponentProps } from \"../../internals/types\";\nimport type { TransitionStatus } from \"../../internals/use-transition-status/use-transition-status\";\nimport { useSelectRootContext } from \"../select-root-context\";\n\nexport interface SelectBackdropState {\n\topen: boolean;\n\tanchorHidden: boolean;\n\ttransitionStatus: TransitionStatus;\n}\n\nexport interface SelectBackdropProps\n\textends BaseUIComponentProps<\"div\", SelectBackdropState> {\n\tas?: ValidComponent;\n}\n\n/**\n * `<Select.Backdrop>` — an overlay rendered beneath the popup.\n */\nexport function SelectBackdrop(props: SelectBackdropProps): JSX.Element {\n\tconst root = useSelectRootContext();\n\n\tconst state = createMemo<SelectBackdropState>(() => ({\n\t\topen: root.open(),\n\t\tanchorHidden: false,\n\t\ttransitionStatus: root.transitionStatus(),\n\t}));\n\n\tconst internal = {\n\t\trole: \"presentation\" as const,\n\t\tget hidden() {\n\t\t\treturn !root.mounted();\n\t\t},\n\t\tstyle: {\n\t\t\t\"user-select\": \"none\",\n\t\t\t\"-webkit-user-select\": \"none\",\n\t\t} as JSX.CSSProperties,\n\t\t// popupWithTransitionStateMapping projection.\n\t\tget \"data-open\"() {\n\t\t\treturn state().open ? \"\" : undefined;\n\t\t},\n\t\tget \"data-closed\"() {\n\t\t\treturn state().open ? undefined : \"\";\n\t\t},\n\t\tget \"data-anchor-hidden\"() {\n\t\t\treturn state().anchorHidden ? \"\" : undefined;\n\t\t},\n\t\tget \"data-starting-style\"() {\n\t\t\treturn state().transitionStatus === \"starting\" ? \"\" : undefined;\n\t\t},\n\t\tget \"data-ending-style\"() {\n\t\t\treturn state().transitionStatus === \"ending\" ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\tconst userProps = omit(props, \"as\", \"class\", \"style\", \"attrs\");\n\n\tlet merged: Record<string, unknown> = mergeRootProps(\n\t\tinternal,\n\t\tuserClassStyle,\n\t);\n\tmerged = mergeRootProps(merged, userProps);\n\n\tconst Tag = dynamic(() => props.as ?? \"div\");\n\treturn <Tag {...merged} ref={composeRefs(userRef(props))} />;\n}\n"],"mappings":"AACA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,UAAU,EAAEC,IAAI,QAAQ,UAAU;AAC3C,SAASC,WAAW,EAAEC,OAAO,QAAQ,8BAA8B;AACnE,SAASC,cAAc,QAAQ,kCAAkC;AACjE,SAASC,iBAAiB,QAAQ,qCAAqC;AAGvE,SAASC,oBAAoB,QAAQ,wBAAwB;AAa7D;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,KAA0B,EAAe;EACvE,MAAMC,IAAI,GAAGH,oBAAoB,CAAC,CAAC;EAEnC,MAAMI,KAAK,GAAGV,UAAU,CAAsB,OAAO;IACpDW,IAAI,EAAEF,IAAI,CAACE,IAAI,CAAC,CAAC;IACjBC,YAAY,EAAE,KAAK;IACnBC,gBAAgB,EAAEJ,IAAI,CAACI,gBAAgB,CAAC;EACzC,CAAC,CAAC,CAAC;EAEH,MAAMC,QAAQ,GAAG;IAChBC,IAAI,EAAE,cAAuB;IAC7B,IAAIC,MAAMA,CAAA,EAAG;MACZ,OAAO,CAACP,IAAI,CAACQ,OAAO,CAAC,CAAC;IACvB,CAAC;IACDC,KAAK,EAAE;MACN,aAAa,EAAE,MAAM;MACrB,qBAAqB,EAAE;IACxB,CAAsB;IACtB;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