if("undefined"!=typeof wp&&void 0!==wp.blocks)for(const e in page_generator_pro_gutenberg_block_formatters)pageGeneratorProGutenbergRegisterBlockFormatter(page_generator_pro_gutenberg_block_formatters[e]);function pageGeneratorProGutenbergRegisterBlockFormatter(e){!function(t,o,n,r){const{BlockControls:a}=t,{registerFormatType:c,getTextContent:i,slice:g}=o,{createElement:l}=n,{ToolbarGroup:_,ToolbarButton:s}=r;let p="dashicons-tablet";void 0!==e.gutenberg_icon&&(p=e.gutenberg_icon.search("svg")>=0?n.RawHTML({children:e.gutenberg_icon}):e.gutenberg_icon),c("page-generator-pro/"+e.name,{title:e.title,tagName:e.tag,className:e.name,edit(t){const n=i(g(t.value));return l(a,{},l(_,{},l(s,{key:"page_generator_pro_"+e.name+"_toolbar_button",icon:p,title:e.title,onClick(){window[e.click](e,t,n,o)}})))}})}(window.wp.blockEditor,window.wp.richText,window.wp.element,window.wp.components)}window.pageGeneratorProGutenbergBlockFormatterGenerateSpintax=function(e,t,o,n){const{insert:r,create:a}=n;wpzinc_modal_open("Generating..."),jQuery.post(ajaxurl,{action:"page_generator_pro_tinymce_spintax_generate",nonce:e.nonce,content:o},function(e){return e.success?(wpzinc_modal_show_success_and_exit("Done!"),t.onChange(r(t.value,a({html:e.data.replace(/(<([^>]+)>)/gi,"")})))):wpzinc_modal_show_error_message(e.data)})},window.pageGeneratorProGutenbergBlockFormatterResearch=function(e){pageGeneratorProQuickTagsLoadModal(e,"gutenberg")};