{
  "version": 3,
  "sources": ["../src/register-legacy-widget-variations.js"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { subscribe, select, dispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\nexport default function registerLegacyWidgetVariations( settings ) {\n\tconst unsubscribe = subscribe( () => {\n\t\tconst hiddenIds =\n\t\t\tsettings?.widgetTypesToHideFromLegacyWidgetBlock ?? [];\n\t\tconst widgetTypes = select( coreStore )\n\t\t\t.getWidgetTypes( { per_page: -1 } )\n\t\t\t?.filter( ( widgetType ) => ! hiddenIds.includes( widgetType.id ) );\n\t\tif ( widgetTypes ) {\n\t\t\tunsubscribe();\n\t\t\tdispatch( blocksStore ).addBlockVariations(\n\t\t\t\t'core/legacy-widget',\n\t\t\t\twidgetTypes.map( ( widgetType ) => ( {\n\t\t\t\t\tname: widgetType.id,\n\t\t\t\t\ttitle: widgetType.name,\n\t\t\t\t\tdescription: widgetType.description,\n\t\t\t\t\tattributes: widgetType.is_multi\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tidBase: widgetType.id,\n\t\t\t\t\t\t\t\tinstance: {},\n\t\t\t\t\t\t  }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tid: widgetType.id,\n\t\t\t\t\t\t  },\n\t\t\t\t} ) )\n\t\t\t);\n\t\t}\n\t} );\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAA4C;AAC5C,uBAAmC;AACnC,oBAAqC;AAEtB,SAAR,+BAAiD,UAAW;AAClE,QAAM,kBAAc,uBAAW,MAAM;AACpC,UAAM,YACL,UAAU,0CAA0C,CAAC;AACtD,UAAM,kBAAc,oBAAQ,iBAAAA,KAAU,EACpC,eAAgB,EAAE,UAAU,GAAG,CAAE,GAChC,OAAQ,CAAE,eAAgB,CAAE,UAAU,SAAU,WAAW,EAAG,CAAE;AACnE,QAAK,aAAc;AAClB,kBAAY;AACZ,gCAAU,cAAAC,KAAY,EAAE;AAAA,QACvB;AAAA,QACA,YAAY,IAAK,CAAE,gBAAkB;AAAA,UACpC,MAAM,WAAW;AAAA,UACjB,OAAO,WAAW;AAAA,UAClB,aAAa,WAAW;AAAA,UACxB,YAAY,WAAW,WACpB;AAAA,YACA,QAAQ,WAAW;AAAA,YACnB,UAAU,CAAC;AAAA,UACX,IACA;AAAA,YACA,IAAI,WAAW;AAAA,UACf;AAAA,QACJ,EAAI;AAAA,MACL;AAAA,IACD;AAAA,EACD,CAAE;AACH;",
  "names": ["coreStore", "blocksStore"]
}
