{
  "version": 3,
  "sources": ["../../src/plugins/PluginIcon.tsx", "../../src/plugins/PluginIcon.styles.ts"],
  "sourcesContent": ["import { assertNever } from \"@framerjs/shared\"\nimport { cx } from \"@linaria/core\"\nimport { type PropsWithChildren, useState } from \"react\"\nimport * as styles from \"./PluginIcon.styles.ts\"\nimport fallbackIcon from \"./icons/FallbackPlugin.png\"\n\ntype Size = \"normal\" | \"small\"\n\ninterface PluginIconProps {\n\tsize?: Size\n\thideInnerShadow?: boolean\n}\n\nfunction getStyleForVariant(variant: Size) {\n\tswitch (variant) {\n\t\tcase \"normal\":\n\t\t\treturn styles.sizeNormal\n\t\tcase \"small\":\n\t\t\treturn styles.sizeSmall\n\t\tdefault:\n\t\t\treturn assertNever(variant)\n\t}\n}\n\nexport function IconWithInnerShadow({\n\tchildren,\n\tsize: variant = \"normal\",\n\thideInnerShadow = false,\n}: PropsWithChildren<PluginIconProps>) {\n\tconst variantStyle = getStyleForVariant(variant)\n\n\treturn <div className={cx(variantStyle, styles.iconBox, !hideInnerShadow && styles.withInnerShadow)}>{children}</div>\n}\n\n/*\n * A component for displaying plugin icons with customizable styles.\n * Automatically falls back to a default icon if the provided source fails to load.\n * Note: For consistent rendering, this component should be wrapped in a parent element\n * with a fixed size, as the icon will scale to fit the container\n * */\nexport function PluginIcon({ src, size = \"normal\", hideInnerShadow = false }: PluginIconProps & { src: string }) {\n\tconst [hasError, setHasError] = useState(false)\n\n\t// Icons can be loaded from external URLs for now\n\t// If it fails to load we fall back with another one\n\tconst imageSrc = hasError ? fallbackIcon : src\n\n\treturn (\n\t\t<IconWithInnerShadow size={size} hideInnerShadow={hideInnerShadow}>\n\t\t\t<img src={imageSrc} alt=\"\" className={styles.icon} onError={() => setHasError(true)} decoding=\"async\" />\n\t\t</IconWithInnerShadow>\n\t)\n}\n", "import \"PluginIcon.styles_1ls1nws.wyw.css\"; export const sizeNormal = \"sizeNormal_skpcnyb\";\nexport const sizeSmall = \"sizeSmall_s1phy8ed\";\nexport const iconBox = \"iconBox_i2tutv\";\nexport const withInnerShadow = \"withInnerShadow_waavojl\";\nexport const icon = \"icon_iiqkbwf\";"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;AAEA,mBAAiD;;;ACFE,IAAM,aAAa;AAC/D,IAAM,YAAY;AAClB,IAAM,UAAU;AAChB,IAAM,kBAAkB;AACxB,IAAM,OAAO;;;AD2BZ;AAlBR,SAAS,mBAAmB,SAAe;AAC1C,UAAQ,SAAS;AAAA,IAChB,KAAK;AACJ,aAAc;AAAA,IACf,KAAK;AACJ,aAAc;AAAA,IACf;AACC,aAAO,YAAY,OAAO;AAAA,EAC5B;AACD;AAEO,SAAS,oBAAoB;AAAA,EACnC;AAAA,EACA,MAAM,UAAU;AAAA,EAChB,kBAAkB;AACnB,GAAuC;AACtC,QAAM,eAAe,mBAAmB,OAAO;AAE/C,SAAO,4CAAC,SAAI,WAAW,WAAG,cAAqB,SAAS,CAAC,mBAA0B,eAAe,GAAI,UAAS;AAChH;AAQO,SAAS,WAAW,EAAE,KAAK,OAAO,UAAU,kBAAkB,MAAM,GAAsC;AAChH,QAAM,CAAC,UAAU,WAAW,QAAI,uBAAS,KAAK;AAI9C,QAAM,WAAW,WAAW,yBAAe;AAE3C,SACC,4CAAC,uBAAoB,MAAY,iBAChC,sDAAC,SAAI,KAAK,UAAU,KAAI,IAAG,WAAkB,MAAM,SAAS,MAAM,YAAY,IAAI,GAAG,UAAS,SAAQ,GACvG;AAEF;",
  "names": []
}
