a?"down":bt_bb_mouse.xn?"right":"inside";return o},window.bt_bb_event=function(t){window.bt_bb_action=t,bt_bb_dispatch(".bt_bb_item_list","bt_bb_event")},window.bt_bb_resize_dialog=function(e){if(t(window).innerHeight()<800)var i=Math.round(.5*t(window).innerHeight());else i=Math.round(.65*t(window).innerHeight());t("#bt_bb_dialog .bt_bb_dialog_content").css("max-height",i),t("#bt_bb_dialog").css("width",Math.round(.5*t(window).width())+"px");var b=t("#bt_bb_dialog").width();t("#bt_bb_dialog").css({transform:"translateX("+Math.round(.5*-b)+"px)"})},window.bt_bb_resize_front_end_preview=function(){var e=t("#bt_bb_front_end_preview").data("width");e?t("#bt_bb_front_end_preview").css("width",e):t("#bt_bb_front_end_preview").css("width",Math.round(.9*t(window).width())+"px"),t("#bt_bb_front_end_preview").css("height",Math.round(.8*t(window).innerHeight())),e?parseFloat(e):t("#bt_bb_front_end_preview").width(),t("#bt_bb_front_end_preview").height()},t(window).resize((function(){window.bt_bb_resize_dialog(),window.bt_bb_resize_front_end_preview()}))},831:()=>{var t,e,i,b;window.bt_bb={},window.bt_bb.cache={},window.bt_bb.min_width=200,window.bt_bb.padding=10,window.bt_bb_state=[],window.bt_bb_state_pointer=-1,window.bt_bb_state_current=null,window.bt_bb_dirty=!1,t=jQuery,e=BTReact.createClass({render:function(){var i="",a="bt_bb_wrap",n="bt_bb_item";if(void 0!==this.props.data.has_alert&&(n+=" bt_bb_item_alert"),void 0!==this.props.data.extra_class&&(n=n+" "+this.props.data.extra_class),void 0!==this.props.data.attr&&"true"===(g=JSON.parse(this.props.data.attr)).bt_bb_toggled&&(n+=" bt_bb_toggled"),void 0!==window.bt_bb_map[this.props.data.base]&&(void 0!==window.bt_bb_map[this.props.data.base].container&&"horizontal"==window.bt_bb_map[this.props.data.base].container&&(i="bt_bb_horizontal"),void 0!==window.bt_bb_map[this.props.data.base].highlight&&!0===window.bt_bb_map[this.props.data.base].highlight&&(n+=" bt_bb_item_highlight"),void 0!==window.bt_bb_map[this.props.data.base].icon&&(n=n+" bt_bb_icon "+window.bt_bb_map[this.props.data.base].icon),void 0!==window.bt_bb_map[this.props.data.base].width_param&&void 0!==this.props.data.attr)){var o=(g=JSON.parse(this.props.data.attr))[window.bt_bb_map[this.props.data.base].width_param];void 0!==o&&(o=o.split("/"),a=a+" bt_bb_is_width bt_bb_width bt_bb_width"+(o=Math.round(12*o[0]/o[1])))}var _=this.props.data.key,r=this.props.data.base,s=this.props.data.children.map((function(t,i){return void 0===t.key&&(t.key="bt_bb_"+bt_bb_get_key()),BTReact.createElement(e,{key:t.key,data:t,p_key:_,p_base:r})}));if(this.props.data.p_key=this.props.p_key,this.props.data.p_base=this.props.p_base,window.bt_bb_state_current){var d=window.bt_bb_get_obj_by_id(window.bt_bb_state_current,_),l={};void 0!==d.attr&&(l=window.attr_to_obj(d.attr))}if("_content"==this.props.data.base)return this.props.data.content.includes("")?BTReact.createElement("div",{className:a},BTReact.createElement("div",{className:n,"data-base":this.props.data.base},BTReact.createElement("div",{className:"bt_bb_toolbar"},"]...[",BTReact.createElement(b,{has_params:"true"})),BTReact.createElement("div",{className:"bt_bb_content",dangerouslySetInnerHTML:{__html:this.props.data.content}}))):BTReact.createElement("div",{className:a},BTReact.createElement("div",{className:n,"data-base":this.props.data.base},BTReact.createElement("div",{className:"bt_bb_toolbar"},"]...[",BTReact.createElement(b,{has_params:"true"})),BTReact.createElement("div",{className:"bt_bb_content",dangerouslySetInnerHTML:{__html:window.switchEditors.wpautop(this.props.data.content)}})));var c=void 0!==window.bt_bb_map[this.props.data.base]&&void 0!==window.bt_bb_map[this.props.data.base].params&&window.bt_bb_map[this.props.data.base].params.length>0?"true":"false",p="";if("true"==c)for(var w=bt_bb_get_param(this.props.data.base,"params"),u=!1,h="",m=0;m/g,">")),"attach_image"==w[m].type&&!u){h=this.props.data.key;var k=bt_bb_special_char_decode(v),x=localStorage.getItem("bt_bb_cache_"+k);null!==x&&(void 0===window.bt_bb.cache[k]&&(window.bt_bb.cache[k]={}),window.bt_bb.cache[k].url=x),""==k?t("."+h+">.bt_bb_toolbar").css("background-image",""):void 0!==window.bt_bb.cache[k]?setTimeout((function(){t("."+h+">.bt_bb_toolbar").css("background-image","url("+window.bt_bb.cache[k].url+")")}),100):t(window).load((function(){wp.media.ajax({data:{action:"get-attachment",id:k}}).done((function(e,i,b){if(void 0!==e.sizes){var a="";void 0!==e.sizes.thumbnail?a=e.sizes.thumbnail.url:void 0!==e.sizes.full&&e.sizes.full.width<=300&&e.sizes.full.height<=300&&(a=e.sizes.full.url),""!=a?(t("."+h+">.bt_bb_toolbar").css("background-image","url("+a+")"),window.bt_bb.cache[e.id]={},window.bt_bb.cache[e.id].url=a,localStorage.setItem("bt_bb_cache_"+e.id,a)):localStorage.removeItem("bt_bb_cache_"+e.id)}}))})),v="",u=!0}if("iconpicker"==w[m].type)if("string"==typeof v&&""!=v){var S=bt_bb_special_char_decode(v);v=''}else v="";else if("colorpicker"==w[m].type)v=''+bt_bb_special_char_decode(v)+"";else if("textarea_object"==w[m].type)try{v=window.bt_bb_b64DecodeUnicode(v)}catch(t){}else void 0!==window["bt_bb_cf_"+w[m].type+"_param_value_preview"]&&(v=bt_bb_special_char_decode(window["bt_bb_cf_"+w[m].type+"_param_value_preview"](v)));"string"==typeof v&&(v=v.includes("%$%")?v.split("%$%")[0]:v.split(",;,")[0]),void 0!==w[m].preview_strong?v=''+v+"":(l&&!l.hasOwnProperty("bb_version")&&"responsive"==f&&v.includes("hidden_lg")&&(v+=" hidden_xl"),v=''+v+""),p+=v}var E=void 0!==window.bt_bb_map[this.props.data.base]&&1==window.bt_bb_map[this.props.data.base].toggle?"true":"false",C=this.props.data.base;if(void 0!==window.bt_bb_map[this.props.data.base]&&void 0!==window.bt_bb_map[this.props.data.base].name&&"1"!=window.bt_bb_settings.tag_as_name&&(C=window.bt_bb_map[this.props.data.base].name),p=''+C+""+p,u&&(n=n+" bt_bb_image_preview "+h),void 0!==window.bt_bb_map[this.props.data.base]&&void 0!==window.bt_bb_map[this.props.data.base].container){var O=window.bt_bb_map[this.props.data.base].container;return BTReact.createElement("div",{className:a},BTReact.createElement("div",{className:n,"data-base":this.props.data.base,"data-container":O},BTReact.createElement("div",{className:"bt_bb_toolbar"},BTReact.createElement("span",{className:"bt_bb_preview",dangerouslySetInnerHTML:{__html:p}}),BTReact.createElement(b,{container:O,mapped:"true",has_params:c,toggle:E})),BTReact.createElement("div",{className:i},s)))}var D=window.bt_bb_map[this.props.data.base],N="bt_bb_toolbar",T="true";return null!=D&&!1!==D.is_mapped||(T="false",window.bt_bb_map[this.props.data.base]={},window.bt_bb_map[this.props.data.base].is_mapped=!1,window.bt_bb_map[this.props.data.base].show_settings_on_create=!1,window.bt_bb_map[this.props.data.base].base=this.props.data.base,window.bt_bb_map[this.props.data.base].description=this.props.data.base,window.bt_bb_map[this.props.data.base].name=this.props.data.base,window.bt_bb_map[this.props.data.base].params=[],N="bt_bb_toolbar bt_bb_alert"),BTReact.createElement("div",{className:a},BTReact.createElement("div",{className:n,"data-base":this.props.data.base},BTReact.createElement("div",{className:N},""!=p?BTReact.createElement("span",{className:"bt_bb_preview",dangerouslySetInnerHTML:{__html:p}}):"",BTReact.createElement(b,{has_params:c,toggle:E,mapped:T})),BTReact.createElement("div",{className:i},s)))}}),i=BTReact.createClass({getInitialState:function(){return{data:this.props.data}},render:function(){var t=this.state.data.children.map((function(t,i){return BTReact.createElement(e,{key:t.key,data:t})}));return BTReact.createElement("div",{className:"bt_bb_item_list"},t)},componentDidMount:function(){this.getDOMNode().addEventListener("bt_bb_event",this.handle),window.bt_bb_state_current=this.state.data},componentDidUpdate:function(){var e=0;t(".bt_bb_item_list > .bt_bb_wrap").each((function(){e++;var i=t(this).find(".bt_bb_preview_name").first().data("title");void 0===i&&(i=t(this).find(".bt_bb_preview_name").first().html(),t(this).find(".bt_bb_preview_name").first().data("title",i)),t(this).find(".bt_bb_preview_name").first().html(''+e+""+i)}))},componentWillUnmount:function(){this.getDOMNode().removeEventListener("bt_bb_event",this.handle)},handle:function(e){if(void 0===window.bt_bb_alo[window.bt_bb_action]?window.bt_bb_alo[window.bt_bb_action]=1:window.bt_bb_alo[window.bt_bb_action]++,window.bt_bb_callback_action=null,"move_up"==window.bt_bb_action){var i=bt_bb_get_obj_copy_by_id(this.state.data,window.bt_bb_from);bt_bb_insert_before(this.state.data,window.bt_bb_to,i),window.bt_bb_ctrl||bt_bb_delete_obj(this.state.data,window.bt_bb_from)}else if("move_down"==window.bt_bb_action)i=bt_bb_get_obj_copy_by_id(this.state.data,window.bt_bb_from),bt_bb_insert_after(this.state.data,window.bt_bb_to,i),window.bt_bb_ctrl||bt_bb_delete_obj(this.state.data,window.bt_bb_from);else if("move_inside"==window.bt_bb_action)bt_bb_insert_inside(this.state.data,window.bt_bb_to,bt_bb_get_obj_copy_by_id(this.state.data,window.bt_bb_from))&&(window.bt_bb_ctrl||bt_bb_delete_obj(this.state.data,window.bt_bb_from));else if("delete"==window.bt_bb_action)bt_bb_delete_obj(this.state.data,window.bt_bb_from);else if("add_root"==window.bt_bb_action||"add_root_from_dialog"==window.bt_bb_action){if("add_root"==window.bt_bb_action){if(void 0!==(a=bt_bb_add_root(this.state.data))&&void 0!==window.bt_bb_map[a[1]].auto_add){var b={};b.title=window.bt_bb_map[a[1]].auto_add,b.base=window.bt_bb_map[a[1]].auto_add,b.key=bt_bb_get_key(),b.children=[],bt_bb_insert_inside(this.state.data,a[0],b)}}else var a=bt_bb_add_root(this.state.data,window.bt_bb_base);void 0!==a&&!1!==bt_bb_get_param(a[1],"show_settings_on_create")&&(window.bt_bb_from=a[0],window.bt_bb_callback_action="edit")}else if("add"==window.bt_bb_action||"add_from_dialog"==window.bt_bb_action){if(void 0!==(a="add"==window.bt_bb_action?bt_bb_add(this.state.data):bt_bb_add(this.state.data,window.bt_bb_base))&&!1!==bt_bb_get_param(a[1],"show_settings_on_create"))window.bt_bb_from=a[0],window.bt_bb_callback_action="edit";else if(void 0!==a&&!0!==bt_bb_get_param(a[1],"show_settings_on_create")){var n,o=bt_bb_get_param(a[1],"accept"),_=0;for(n in o)o.hasOwnProperty(n)&&_++;void 0!==o&&!0===o._content&&1==_&&(window.bt_bb_from=a[0],window.bt_bb_base=a[1],window.bt_bb_callback_action="add")}}else if("add_horizontal"==window.bt_bb_action)window.bt_bb_custom_elements||!window.bt_bb_responsive_override_layout?bt_bb_add_horizontal_classic(this.state.data):bt_bb_add_horizontal(this.state.data);else if("edit"==window.bt_bb_action)bt_bb_edit(this.state.data,window.bt_bb_from);else if("clone"==window.bt_bb_action)bt_bb_clone(this.state.data,window.bt_bb_from);else if("update_state"==window.bt_bb_action)this.replaceState({data:window.bt_bb_state_current},window.bt_bb_state_callback);else if("copy"==window.bt_bb_action)bt_bb_copy(this.state.data,window.bt_bb_from),t(".bt_bb_cb_items").addClass("bt_bb_cb_items_flash").delay(500).queue((function(e){t(this).removeClass("bt_bb_cb_items_flash"),e()}));else if("copy_plus"==window.bt_bb_action)bt_bb_copy_plus(this.state.data,window.bt_bb_from),t(".bt_bb_cb_items").addClass("bt_bb_cb_items_flash").delay(500).queue((function(e){t(this).removeClass("bt_bb_cb_items_flash"),e()}));else if("paste"==window.bt_bb_action)bt_bb_paste(this.state.data,window.bt_bb_from);else if("paste_before"==window.bt_bb_action)bt_bb_paste(this.state.data,window.bt_bb_from,!0);else if("toggle_on"==window.bt_bb_action){var r={};void 0!==(s=bt_bb_get_obj_by_id(window.bt_bb_state_current,window.bt_bb_from)).attr&&"[]"!==s.attr&&(r=attr_to_obj(s.attr)),r.bt_bb_toggled="true",s.attr=JSON.stringify(r)}else if("toggle_off"==window.bt_bb_action){var s;r={},void 0!==(s=bt_bb_get_obj_by_id(window.bt_bb_state_current,window.bt_bb_from)).attr&&"[]"!==s.attr&&(r=attr_to_obj(s.attr)),r.bt_bb_toggled="false",s.attr=JSON.stringify(r)}null!=window.bt_bb_action&&"edit"!=window.bt_bb_action&&"copy"!=window.bt_bb_action&&"copy_plus"!=window.bt_bb_action&&(bt_bb_resize_h(this.state.data),"update_state"!=window.bt_bb_action&&(bt_bb_push_state(this.state.data),this.replaceState({data:this.state.data},window.bt_bb_state_callback)),this.state.data.children.length>=0&&"update_wp_editor"==window.bt_bb_action&&bt_bb_parse_data(this.state.data),"refresh_on_ready"!=window.bt_bb_action&&"update_wp_editor"!=window.bt_bb_action&&(window.bt_bb_dirty=!0),bt_bb_item_mousedown(),bt_bb_toolbar())}}),b=BTReact.createClass({render:function(){var t=window.bt_bb_text.add;return"horizontal"==this.props.container&&(t=window.bt_bb_text.edit_layout),BTReact.createElement("div",{className:"bt_bb_toolbar_tools"},"true"==this.props.toggle?BTReact.createElement("i",{className:"bt_bb_toggle",title:window.bt_bb_text.toggle}):"","vertical"==this.props.container?BTReact.createElement("i",{className:"bt_bb_add",title:t}):"","horizontal"==this.props.container?BTReact.createElement("i",{className:"bt_bb_add bt_bb_edit_layout",title:t}):"","true"==this.props.has_params?BTReact.createElement("i",{className:"bt_bb_edit",title:window.bt_bb_text.edit}):"",BTReact.createElement("i",{className:"bt_bb_clone",title:window.bt_bb_text.clone}),"true"==this.props.mapped?BTReact.createElement("i",{className:"bt_bb_copy",title:window.bt_bb_text.copy}):"","true"==this.props.mapped?BTReact.createElement("i",{className:"bt_bb_copy_plus",title:window.bt_bb_text.copy_plus}):"","true"==this.props.mapped?BTReact.createElement("i",{className:"bt_bb_paste",title:window.bt_bb_text.paste}):"",BTReact.createElement("i",{className:"bt_bb_delete",title:window.bt_bb_text.delete}))}}),window.bt_bb_resize_h=function(t){window.bt_bb_custom_elements||!window.bt_bb_responsive_override_layout?window.bt_bb_resize_h_helper_classic(t):window.bt_bb_resize_h_helper(t)},window.bt_bb_get_obj_copy_by_id=function(t,e){var i=bt_bb_get_obj_by_id(t,e),b=JSON.parse(JSON.stringify(i));return null!=b&&(b=bt_bb_set_new_keys(b)),b},window.bt_bb_set_new_keys=function(t){t.key=bt_bb_get_key();for(var e=0;e1&&window.bt_bb_dialog.show("add_root")},window.bt_bb_add=function(e,i){var b=[];if(void 0!==i?b.push(i):(t.each(window.bt_bb_map,(function(t,e){var i;void 0!==window.bt_bb_map[window.bt_bb_base].accept&&(i=window.bt_bb_map[window.bt_bb_base].accept[e.base]),(!0===i||!0===window.bt_bb_map[window.bt_bb_base].accept_all&&!1!==i||void 0!==window.bt_bb_map[e.base].as_child&&-1!=window.bt_bb_map[e.base].as_child.only.indexOf(window.bt_bb_base))&&(void 0===window.bt_bb_map[e.base].as_child||void 0!==window.bt_bb_map[e.base].as_child&&-1!=window.bt_bb_map[e.base].as_child.only.indexOf(window.bt_bb_base))&&b.push(e.base)})),void 0!==window.bt_bb_map[window.bt_bb_base].accept&&!0===window.bt_bb_map[window.bt_bb_base].accept._content&&(b=[]).push("_content")),1==b.length){var a={};a.title=b[0],a.base=b[0],"_content"==a.base&&(a.content=""),a.key=bt_bb_get_key(),a.children=[];var n={};return void 0!==window.bt_bb_map[a.base]&&void 0!==window.bt_bb_map[a.base].params&&t.each(window.bt_bb_map[a.base].params,(function(t,e){e.hasOwnProperty("value")&&"string"==typeof e.value?"textarea_object"==e.type?n[e.param_name]=e.value:n[e.param_name]=bt_bb_special_char_encode(e.value):e.hasOwnProperty("value")&&e.hasOwnProperty("default")&&(n[e.param_name]=e.default)})),a.attr=JSON.stringify(n),bt_bb_insert_inside(e,window.bt_bb_from,a),[a.key,a.base]}b.length>1&&window.bt_bb_dialog.show("add")},window.bt_bb_edit=function(t,e){for(var i=0;i1)for(var i=2;i<=window.bt_bb_cb_items;i++)localStorage.removeItem("bt_bb_cb_"+i);t=bt_bb_get_obj_by_id(t,e),localStorage.setItem("bt_bb_cb_1",JSON.stringify(t)),bt_bb_set_number_items(1)},window.bt_bb_copy_plus=function(t,e){var i=bt_bb_get_obj_by_id(t,e);if(0==window.bt_bb_cb_items)localStorage.setItem("bt_bb_cb_1",JSON.stringify(i)),bt_bb_set_number_items(1);else{var b=JSON.parse(localStorage.getItem("bt_bb_cb_1")),a=!1;void 0!==i.p_base?a=bt_bb_allowed(b.base,i.p_base):void 0!==window.bt_bb_map[i.base].root&&void 0!==window.bt_bb_map[b.base].root&&(a=!0),a?(window.bt_bb_cb_items++,localStorage.setItem("bt_bb_cb_"+window.bt_bb_cb_items,JSON.stringify(i)),bt_bb_set_number_items(window.bt_bb_cb_items)):alert(window.bt_bb_text.not_allowed)}},window.bt_bb_paste=function(t,e,i){if(window.bt_bb_cb_items>0){var b=bt_bb_get_obj_by_id(t,e),a=JSON.parse(localStorage.getItem("bt_bb_cb_1"));if(void 0!==window.bt_bb_map[b.base].root&&void 0!==window.bt_bb_map[a.base].root)for(var n=window.bt_bb_cb_items;n>=1;n--)a=JSON.parse(localStorage.getItem("bt_bb_cb_"+n)),a=bt_bb_set_new_keys(a),i?bt_bb_insert_before(t,e,a):bt_bb_insert_after(t,e,a);else if(bt_bb_allowed(a.base,b.p_base))if(i)for(n=1;n<=window.bt_bb_cb_items;n++)a=JSON.parse(localStorage.getItem("bt_bb_cb_"+n)),a=bt_bb_set_new_keys(a),bt_bb_insert_before(t,e,a);else for(n=window.bt_bb_cb_items;n>=1;n--)a=JSON.parse(localStorage.getItem("bt_bb_cb_"+n)),a=bt_bb_set_new_keys(a),bt_bb_insert_after(t,e,a);else if(bt_bb_allowed(a.base,b.base))for(n=1;n<=window.bt_bb_cb_items;n++)a=JSON.parse(localStorage.getItem("bt_bb_cb_"+n)),a=bt_bb_set_new_keys(a),bt_bb_insert_inside(t,e,a);else alert(window.bt_bb_text.not_allowed)}},window.bt_bb_paste_main_toolbar=function(){var t=JSON.parse(localStorage.getItem("bt_bb_cb_1"));if(void 0!==window.bt_bb_map[t.base].root){for(var e=1;e<=window.bt_bb_cb_items;e++)t=JSON.parse(localStorage.getItem("bt_bb_cb_"+e)),t=bt_bb_set_new_keys(t),window.bt_bb_state_current.children.push(t);bt_bb_event("refresh")}else alert(window.bt_bb_text.not_allowed)},window.bt_bb_refresh_cb_items=function(){var t=localStorage.getItem("bt_bb_cb_items");window.bt_bb_set_number_items(null===t?0:t)},window.bt_bb_dialog={},window.bt_bb_dialog.show=function(e){t("#bt_bb_front_end_preview").hide(),window.bt_bb_dialog.is_showing=!0;var i="";if("add_root"==e){var b=window.bt_bb_text.add_element,a=[];t.each(window.bt_bb_map,(function(t,e){1==e.root&&a.push({base:e.base,name:e.name,description:e.description,icon:e.icon})})),a.sort((function(t,e){return t.name.toLowerCase().localeCompare(e.name.toLowerCase())})),t.each(a,(function(t,e){i+='',n+='',n+="
",t("#bt_bb_dialog .bt_bb_dialog_header_tools").append(n);var o,_,r=document.createDocumentFragment();t.each(a,(function(t,e){g=bt_bb_create_dom_element("div",[["class","bt_bb_dialog_item bt_bb_dialog_add_element"+(void 0!==e.icon?" bt_bb_icon "+e.icon:"")],["data-base",e.base]]),o=bt_bb_create_dom_element("b",[]),_=document.createTextNode(e.name),o.appendChild(_),g.appendChild(o),v=bt_bb_create_dom_element("i",[]),_=document.createTextNode(e.description),v.appendChild(_),g.appendChild(v),r.appendChild(g)})),t("#bt_bb_dialog .bt_bb_dialog_content")[0].appendChild(r),t(".bt_bb_dialog_add_element").click((function(e){window.bt_bb_base=t(this).data("base"),window.bt_bb_dialog.hide(),bt_bb_event("add_from_dialog")})),t(".bt_bb_filter").keyup((function(e){var i=t(this).val();t(".bt_bb_dialog_item").not(".bt_bb_add_filter_container").each((function(){var e=t(this).html().replace(/(<([^>]+)>)/gi,"");new RegExp(i,"i").test(e)?t(this).show():t(this).hide()}))}))}else if("add_horizontal"==e)b=window.bt_bb_text.edit_layout,window.bt_bb_custom_elements||!window.bt_bb_responsive_override_layout?window.bt_bb_edit_layout_classic():window.bt_bb_edit_layout();else if("edit_content"==e){t(document).trigger("bt_bb_edit_content"),b=window.bt_bb_text.edit_content,t("#bt_bb_dialog").addClass("bt_bb_dialog_tinymce_container"),t(".bt_bb_dialog_tinymce").show();var s,d=bt_bb_get_obj_by_id(window.bt_bb_state_current,window.bt_bb_from),l=bt_bb_get_obj_by_id(window.bt_bb_state_current,d.p_key),c={};void 0!==l.attr&&(c=attr_to_obj(l.attr)),window.bt_bb.editing_base=l.base,t(".bt_bb_dialog_button").unbind("click"),t(".bt_bb_dialog_button").click((function(){window.switchEditors.go("bt_bb_tinymce","tmce");var e=bt_bb_get_obj_by_id(window.bt_bb_state_current,window.bt_bb_from);e.content=tinyMCE.get("bt_bb_tinymce").getContent(),e.content.startsWith("[")&&e.content.endsWith("]
")&&(e.content=e.content.substring(3),e.content=e.content.substring(0,e.content.length-4));var i={};i.keywords=t(".bt_bb_ai_keywords").val(),i.tone=t(".bt_bb_ai_tone").val(),i.mode=t(".bt_bb_ai_mode").val(),i.language=t(".bt_bb_ai_language").val(),i.length=t(".bt_bb_ai_length_container input").val(),c.ai_prompt_helper=window.bt_bb_b64EncodeUnicode(JSON.stringify(i)),l.attr=JSON.stringify(c),window.bt_bb_action="refresh",bt_bb_dispatch(".bt_bb_item_list","bt_bb_event"),window.bt_bb_dialog.hide()})),t("#bt_bb_dialog").css("visibility","visible"),t("#bt_bb_dialog .mce-i-resize").show(),s=void 0!==c.ai_prompt_helper?window.bt_bb_dialog_param.ai_prompt({attr_value:c.ai_prompt_helper}):window.bt_bb_dialog_param.ai_prompt({}),t(".bt_bb_dialog_content").append(s)}else if("edit"==e){t(document).trigger("bt_bb_edit_element"),b=window.bt_bb_text.edit,d=bt_bb_get_obj_by_id(window.bt_bb_state_current,window.bt_bb_from);var p={};if(void 0!==d.attr&&"[]"!=d.attr&&(p=attr_to_obj(d.attr)),void 0!==window.bt_bb_map[d.base]){window.bt_bb.editing_base=d.base,b=b+" "+window.bt_bb_map[d.base].name,t("#bt_bb_dialog").removeClass(),t("#bt_bb_dialog").addClass("bt_bb_dialog "+d.base);var w=window.bt_bb_map[d.base].params;if(void 0!==w){r=document.createDocumentFragment();var u=new Array,h="",m="";window.bt_bb.param_groups=[];for(var v=0;v0&&t(".bt_bb_dialog_item").hide(),t.each(window.bt_bb.param_groups,(function(e,i){var b="bt_bb_group_tab";0==e&&(b="bt_bb_group_tab bt_bb_group_tab_active",t(".bt_bb_group_"+window.bt_bb_b64EncodeUnicode(i).replace(/[=+\/]/g,"")).removeAttr("style")),t(".bt_bb_dialog_header_tools").append(''+i+"")})),t("#bt_bb_dialog .bt_bb_group_tab").click((function(e){var i=t(this).html();t(".bt_bb_dialog_item").hide(),t(".bt_bb_group_"+window.bt_bb_b64EncodeUnicode(i).replace(/[=+\/]/g,"")).removeAttr("style"),t(".bt_bb_group_tab").removeClass("bt_bb_group_tab_active"),t(this).addClass("bt_bb_group_tab_active"),window.bt_bb_resize_dialog()})),t("#bt_bb_dialog").append(''),t("#bt_bb_dialog .bt_bb_dialog_button").click((function(e){t("#bt_bb_dialog .bt_bb_dialog_item").each((function(){var e=t(this).data("param_name"),i=t(this).data("type"),b=window.bt_bb_get_edit_item_value(e,i,t(this));void 0!==b&&(p[e]=b)}));for(var i=JSON.parse(t("#bt_bb_dialog").data("hidden")),b=0;b',i+='',i+="",t("#bt_bb_dialog .bt_bb_dialog_content").html(i),t("#bt_bb_dialog").append(''),t("#bt_bb_dialog .bt_bb_button_export").click((function(e){if(window.bt_bb_cb_items>0){for(var i="[",b=1;b<=window.bt_bb_cb_items;b++)i+='{"bt_bb_cb":"'+window.bt_bb_b64EncodeUnicode(encodeURIComponent(localStorage.getItem("bt_bb_cb_"+b)))+'"},';i=i.substring(0,i.length-1),i+="]",t(".bt_bb_impex_input").val(window.bt_bb_b64EncodeUnicode(encodeURIComponent(i))),t(".bt_bb_impex_input").select()}})),t("#bt_bb_dialog .bt_bb_button_import").click((function(e){t(".bt_bb_impex_input").val()&&bt_bb_cb_import(t(".bt_bb_impex_input").val())}));else if("sc_mapper"==e){b=window.bt_bb_text.sc_mapper,t("#bt_bb_dialog").addClass("bt_bb_dialog_sc_mapper_container"),n="",n+='',n+='',n+="
",t("#bt_bb_dialog .bt_bb_dialog_header_tools").append(n);var x=function(t){var e=t;return void 0!==window.bt_bb_map_primary[t]&&(e+=" / p"),void 0!==window.bt_bb_map_secondary[t]&&(e+=" / s"),e};for(r=document.createDocumentFragment(),g=bt_bb_create_dom_element("div",[["id","bt_bb_sc_mapper_accordion"]]),v=0;v'+x(window.bt_bb.all_sc[v])+"";var S=bt_bb_create_dom_element("div",[["data-base",window.bt_bb.all_sc[v]]])}else{var E;(E=bt_bb_create_dom_element("h3",[["class","bt_bb_sc_mapper_item bt_bb_sc_mapper_unmapped"]])).innerHTML=''+window.bt_bb.all_sc[v]+"",S=bt_bb_create_dom_element("div",[["data-base",window.bt_bb.all_sc[v]]])}g.appendChild(E),g.appendChild(S)}r.appendChild(g),t("#bt_bb_dialog .bt_bb_dialog_content")[0].appendChild(r),t(".bt_bb_filter").keyup((function(e){var i=t(this).val();t("#bt_bb_sc_mapper_accordion > div").removeClass("bt_bb_map_item_active"),t("#bt_bb_sc_mapper_accordion > h3").removeClass("bt_bb_map_header_active"),t("#bt_bb_sc_mapper_accordion > h3 > i").removeClass("fa-chevron-up").addClass("fa-chevron-down"),t(".bt_bb_sc_mapper_item").each((function(){var e=t(this).html().replace(/(<([^>]+)>)/gi,"");new RegExp(i,"i").test(e)?t(this).show():t(this).hide()}))})),t(".bt_bb_sc_map").keydown((function(e){if(9===e.keyCode){e.preventDefault();var i=this.selectionStart,b=this.selectionEnd,a=t(this);a.val(a.val().substring(0,i)+"\t"+a.val().substring(b)),this.selectionStart=this.selectionEnd=i+1,t(this).parent().find(".bt_bb_save_mapping_button").prop("disabled",!1)}})),t("#bt_bb_sc_mapper_accordion h3").click((function(e){var i=t(this).next();if(i.hasClass("bt_bb_map_item_active"))i[0].innerHTML="",i.removeClass("bt_bb_map_item_active"),t(this).removeClass("bt_bb_map_header_active"),t(this).find("i").removeClass("fa-chevron-up").addClass("fa-chevron-down");else{var b='