"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const element_1=require("@wordpress/element"),components_1=require("@wordpress/components"),i18n_1=require("@wordpress/i18n"),tracks_1=require("@woocommerce/tracks"),data_1=require("@wordpress/data"),core_data_1=require("@wordpress/core-data"),blocks_1=require("@wordpress/blocks"),product_editor_ui_1=require("../../../../store/product-editor-ui"),edit_1=require("../edit");function FullEditorToolbarButton({label:e=(0,i18n_1.__)("Edit Product description","woocommerce"),text:r=(0,i18n_1.__)("Full editor","woocommerce")}){const{openModalEditor:o,setModalEditorBlocks:t}=(0,data_1.dispatch)(product_editor_ui_1.store),[d]=(0,core_data_1.useEntityProp)("postType","product","description");return(0,element_1.createElement)(components_1.ToolbarButton,{label:e,onClick:()=>{let e=(0,blocks_1.parse)(d);const r=(0,edit_1.getContentFromFreeform)(e);r&&(e=(0,blocks_1.rawHandler)({HTML:r})),t(e),(0,tracks_1.recordEvent)("product_add_description_click"),o()}},r)}exports.default=FullEditorToolbarButton;