{"version":3,"file":"embed-placeholder.mjs","names":["WCInputControl"],"sources":["../../src/embed/embed-placeholder.jsx"],"sourcesContent":["import { __, _x } from '@wordpress/i18n';\nimport {\n\tButton,\n\tPlaceholder,\n\t__experimentalInputControl as WCInputControl,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { Link, Stack } from '@wordpress/ui';\n\nexport default function EmbedPlaceholder( {\n\ticon,\n\tlabel,\n\tvalue,\n\tonSubmit,\n\tonChange,\n\tcannotEmbed,\n\tfallback,\n\ttryAgain,\n} ) {\n\treturn (\n\t\t<Placeholder\n\t\t\ticon={ <BlockIcon icon={ icon } showColors /> }\n\t\t\tlabel={ label }\n\t\t\tclassName=\"wp-block-embed\"\n\t\t\tinstructions={ __(\n\t\t\t\t'Paste a link to the content you want to display on your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<form onSubmit={ onSubmit }>\n\t\t\t\t<WCInputControl\n\t\t\t\t\ttype=\"url\"\n\t\t\t\t\tvalue={ value || '' }\n\t\t\t\t\tclassName=\"wp-block-embed__placeholder-input\"\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\tplaceholder={ __( 'Enter URL to embed here…' ) }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t<Button __next40pxDefaultSize variant=\"primary\" type=\"submit\">\n\t\t\t\t\t{ _x( 'Embed', 'button label' ) }\n\t\t\t\t</Button>\n\t\t\t</form>\n\t\t\t<div className=\"wp-block-embed__learn-more\">\n\t\t\t\t<Link\n\t\t\t\t\topenInNewTab\n\t\t\t\t\thref={ __(\n\t\t\t\t\t\t'https://wordpress.org/documentation/article/embeds/'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Learn more about embeds' ) }\n\t\t\t\t</Link>\n\t\t\t</div>\n\t\t\t{ cannotEmbed && (\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"column\"\n\t\t\t\t\tgap=\"md\"\n\t\t\t\t\tclassName=\"components-placeholder__error\"\n\t\t\t\t>\n\t\t\t\t\t<div className=\"components-placeholder__instructions\">\n\t\t\t\t\t\t{ __( 'Sorry, this content could not be embedded.' ) }\n\t\t\t\t\t</div>\n\t\t\t\t\t<Stack direction=\"row\" gap=\"md\" justify=\"flex-start\">\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ tryAgain }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ _x( 'Try again', 'button label' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t{ fallback && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ fallback }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ _x( 'Convert to link', 'button label' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t) }\n\t\t</Placeholder>\n\t);\n}\n"],"mappings":";;;;;;AASA,SAAwB,iBAAkB,EACzC,MACA,OACA,OACA,UACA,UACA,aACA,UACA,YACG;CACH,OACC,qBAAC,aAAD;EACC,MAAO,oBAAC,WAAD;GAAkB;GAAO,YAAA;EAAY,CAAA;EACpC;EACR,WAAU;EACV,cAAe,GACd,+DACD;EAND,UAAA;GAQC,qBAAC,QAAD;IAAiB;IAAjB,UAAA,CACC,oBAACA,4BAAD;KACC,MAAK;KACL,OAAQ,SAAS;KACjB,WAAU;KACF;KACR,qBAAA;KACA,aAAc,GAAI,0BAA2B;KAClC;IACX,CAAA,GACD,oBAAC,QAAD;KAAQ,uBAAA;KAAsB,SAAQ;KAAU,MAAK;KAClD,UAAA,GAAI,SAAS,cAAe;IACvB,CAAA,CACH;;GACN,oBAAC,OAAD;IAAK,WAAU;IACd,UAAA,oBAAC,MAAD;KACC,cAAA;KACA,MAAO,GACN,qDACD;KAEE,UAAA,GAAI,yBAA0B;IAC3B,CAAA;GACF,CAAA;GACH,eACD,qBAAC,OAAD;IACC,WAAU;IACV,KAAI;IACJ,WAAU;IAHX,UAAA,CAKC,oBAAC,OAAD;KAAK,WAAU;KACZ,UAAA,GAAI,4CAA6C;IAC/C,CAAA,GACL,qBAAC,OAAD;KAAO,WAAU;KAAM,KAAI;KAAK,SAAQ;KAAxC,UAAA,CACC,oBAAC,QAAD;MACC,uBAAA;MACA,SAAQ;MACR,SAAU;MAER,UAAA,GAAI,aAAa,cAAe;KAC3B,CAAA,GACN,YACD,oBAAC,QAAD;MACC,uBAAA;MACA,SAAQ;MACR,SAAU;MAER,UAAA,GAAI,mBAAmB,cAAe;KACjC,CAAA,CAEH;IACD,CAAA,CAAA;;EAEI;;AAEf"}