{"version":3,"file":"Picker.mjs","names":[],"sources":["../../../../src/plugins/Emojis/Picker.tsx"],"sourcesContent":["import { useEffect, useRef } from 'react';\nimport { Picker as EmojiMartPicker } from 'emoji-mart';\n\n/**\n * Untyped [properties](https://github.com/missive/emoji-mart/tree/v5.5.2#options--props) forwarded\n * to the emoji-mart `Picker` custom element.\n */\nexport type PickerProps = Record<string, unknown>;\n\n// React wrapper around the emoji-mart `Picker` custom element. Taken and adjusted from\n// @emoji-mart/react (MIT, Copyright (c) Missive):\n// https://github.com/missive/emoji-mart/blob/16978d04a766eec6455e2e8bb21cd8dc0b3c7436/packages/emoji-mart-react/react.tsx\n//\n// Vendored rather than depended upon because @emoji-mart/react does not declare React 19 in its\n// peer dependencies, which forces consumers into `package.json` overrides.\nexport const Picker = (props: PickerProps) => {\n  const ref = useRef<HTMLDivElement | null>(null);\n  const instance = useRef<EmojiMartPicker | null>(null);\n  if (instance.current) {\n    instance.current.update(props);\n  }\n\n  useEffect(() => {\n    instance.current = new EmojiMartPicker({ ...props, ref });\n    return () => {\n      instance.current = null;\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n\n  return <div ref={ref} />;\n};\n"],"mappings":";;;;AAeA,IAAa,YAAU,UAAuB;CAC5C,MAAM,MAAM,OAA8B,IAAI;CAC9C,MAAM,WAAW,OAA+B,IAAI;CACpD,IAAI,SAAS,SACX,SAAS,QAAQ,OAAO,KAAK;CAG/B,gBAAgB;EACd,SAAS,UAAU,IAAI,OAAgB;GAAE,GAAG;GAAO;EAAI,CAAC;EACxD,aAAa;GACX,SAAS,UAAU;EACrB;CAEF,GAAG,CAAC,CAAC;CAEL,OAAO,oBAAC,OAAD,EAAU,IAAM,CAAA;AACzB"}