{"version":3,"names":["dynamic","createMemo","omit","composeRefs","userRef","mergeRootProps","resolveClassStyle","usePopoverRootContext","usePopoverPositionerContext","PopoverArrow","props","root","positioner","state","open","side","align","uncentered","arrowUncentered","setArrowRef","el","arrowRef","current","internal","style","arrowStyles","data-open","undefined","data-closed","data-side","data-align","data-uncentered","userClassStyle","userProps","merged","Tag","as"],"sources":["popover-arrow.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 { usePopoverRootContext } from \"../popover-root-context\";\nimport {\n\ttype PopoverAlign,\n\ttype PopoverSide,\n\tusePopoverPositionerContext,\n} from \"../positioner/popover-positioner-context\";\n\nexport interface PopoverArrowState {\n\topen: boolean;\n\tside: PopoverSide;\n\talign: PopoverAlign;\n\tuncentered: boolean;\n}\n\nexport interface PopoverArrowProps\n\textends BaseUIComponentProps<\"div\", PopoverArrowState> {\n\t/**\n\t * Tag/component to render. Defaults to `\"div\"`. Replaces the\n\t * pre-spike `render` prop (axis G).\n\t */\n\tas?: ValidComponent;\n}\n\n/**\n * Displays an arrow positioned against the popover anchor. Renders a `<div>`.\n */\nexport function PopoverArrow(props: PopoverArrowProps): JSX.Element {\n\tconst root = usePopoverRootContext();\n\tconst positioner = usePopoverPositionerContext();\n\n\tconst state = createMemo<PopoverArrowState>(() => ({\n\t\topen: root.open(),\n\t\tside: positioner.side(),\n\t\talign: positioner.align(),\n\t\tuncentered: positioner.arrowUncentered(),\n\t}));\n\n\tconst setArrowRef = (el: HTMLElement | null): void => {\n\t\tpositioner.arrowRef.current = el;\n\t};\n\n\tconst internal = {\n\t\t\"aria-hidden\": \"true\",\n\t\tget style() {\n\t\t\treturn positioner.arrowStyles();\n\t\t},\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-side\"() {\n\t\t\treturn state().side;\n\t\t},\n\t\tget \"data-align\"() {\n\t\t\treturn state().align;\n\t\t},\n\t\tget \"data-uncentered\"() {\n\t\t\treturn state().uncentered ? \"\" : undefined;\n\t\t},\n\t};\n\n\tconst userClassStyle = resolveClassStyle(props, () => state());\n\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(setArrowRef, 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;AAEvE,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAGCC,2BAA2B,QACrB,0CAA0C;AAkBjD;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAACC,KAAwB,EAAe;EACnE,MAAMC,IAAI,GAAGJ,qBAAqB,CAAC,CAAC;EACpC,MAAMK,UAAU,GAAGJ,2BAA2B,CAAC,CAAC;EAEhD,MAAMK,KAAK,GAAGZ,UAAU,CAAoB,OAAO;IAClDa,IAAI,EAAEH,IAAI,CAACG,IAAI,CAAC,CAAC;IACjBC,IAAI,EAAEH,UAAU,CAACG,IAAI,CAAC,CAAC;IACvBC,KAAK,EAAEJ,UAAU,CAACI,KAAK,CAAC,CAAC;IACzBC,UAAU,EAAEL,UAAU,CAACM,eAAe,CA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