export default function(a,e,p){let t={},n={alteredThemeData:null,init(){n.setup(),n.initAllCustomEntitiesSettings(),n.bindEvents()},setup(){t.$builder=p("#wpforms-builder"),n.updateEntityDataAjaxDebounced=_.debounce(n.updateEntityDataAjax,200)},bindEvents(){t.$builder.on("click",".wpforms-pdf-custom-entity-rename",n.clickRename).on("click",".wpforms-pdf-custom-entity-delete",n.clickDelete).on("click",".wpforms-pdf-custom-entity-name-save",n.clickRenameSaveButton).on("click",".wpforms-pdf-custom-entity-name-cancel",n.clickRenameCancelButton).on("wpformsSaved",n.wpformsSaved).on("wpformsPDFReflectorElementUpdate",n.reflectorElementUpdate).on("wpformsSettingsBlockAdded wpformsSettingsBlockCloned",n.pdfAdded).on("input",".wpforms-field-pdf-custom-entity-name-field input",n.entityNameChanged).on("change",".wpforms-pdf-template-category select",n.toggleCustomEntityVisibility).on("change",".wpforms-pdf-template-style select",n.toggleCustomEntityVisibility).on("change",".wpforms-pdf-theme-selector select",n.toggleCustomEntityVisibility)},pdfAdded(e,t){"pdf"===t.data("block-type")&&n.initAllCustomEntitiesSettings(t)},initAllCustomEntitiesSettings(e){(e=e?.length?e:t.$builder).find(".wpforms-pdf-custom-entity-settings").each(function(){n.initCustomEntitySettings(p(this))})},initCustomEntitySettings(e){var t,a;e?.length&&(t=e.data("entity"),a=e.prev(".wpforms-panel-field-select").find("select").val(),t=("theme"===t?n.getThemeData(a):n.getTemplateData(a))?.isCustom??!1,a=e.find(".wpforms-field-pdf-custom-entity-name-field"),e.toggleClass("wpforms-hidden",!t),a.addClass("wpforms-hidden"))},getCurrentTemplateSlug(e){return p(`#wpforms-panel-field-pdfs-${e}-template_style`).val()},getCurrentThemeSlug(e){return p(`#wpforms-panel-field-pdfs-${e}-theme`).val()},getTemplateData(e){return WPFormsPDFBuilder.templates.getTemplateData(e)},getThemeData(e){return WPFormsPDFBuilder.appearance.getThemeData(e)},toggleCustomEntityVisibility(e,t){var a=(t=t??p(this)).closest(".wpforms-panel-field").nextAll(".wpforms-pdf-custom-entity-settings"),l=a.data("entity"),t=t.val(),l=("theme"===l?n.getThemeData(t):n.getTemplateData(t))?.isCustom??!1;a.toggleClass("wpforms-hidden",!l)},entityNameChanged(){var e=p(this);e.closest(".wpforms-field-pdf-custom-entity-name-field").find(".wpforms-pdf-custom-entity-name-save").toggleClass("wpforms-disabled",!e.val())},clickRename(e){var t=p(this).closest(".wpforms-pdf-custom-entity-settings"),a=t.prevAll(".wpforms-pdf-template-style, .wpforms-pdf-theme-selector").find("select"),t=t.find(".wpforms-field-pdf-custom-entity-name-field"),a=a.find("option:selected").text();t.removeClass("wpforms-hidden").find("input").val(a),e.preventDefault()},clickDelete(e){var t=p(this).closest(".wpforms-pdf-custom-entity-settings"),a=t.prevAll(".wpforms-pdf-template-style, .wpforms-pdf-theme-selector").find("select"),t=t.data("entity");n.openEntityDeleteModal(a,t),e.preventDefault()},clickRenameSaveButton(e){var t=p(this),a=t.closest(".wpforms-pdf-custom-entity-settings"),t=t.closest(".wpforms-field-pdf-custom-entity-name-field"),l=t.find("input"),s=a.prevAll(".wpforms-pdf-template-style, .wpforms-pdf-theme-selector").find("select"),a=a.data("entity"),l=l.val(),o=s.val();let m={};s.find("option:selected").text(l),"theme"===a&&(n.updateThemeSelectorItem(o,l),wpformsPDF.customThemes[o].title=l,m=n.getThemeData(o)),"template"===a&&(wpformsPDF.customTemplates[o].title=l,m=n.getTemplateData(o)),n.updateEntityData(m,a),t.addClass("wpforms-hidden"),e.preventDefault()},clickRenameCancelButton(e){p(this).closest(".wpforms-field-pdf-custom-entity-name-field").addClass("wpforms-hidden"),e.preventDefault()},reflectorElementUpdate(e,t){var a,l;"triggered"!==t.context&&(a=n.getCurrentTemplateSlug(t.pdfId),a=n.getTemplateData(a),l=n.getThemeData(t.themeSlug),a)&&l&&(n.detectThemeAlternate(t,l,a)?n.processThemeAlternate(a,t.themeSlug,l,t.themeColorKey,t):n.detectTemplateAlternate(t,a)&&n.processTemplateAlternate(a,t))},detectThemeAlternate(e,t,a){return!(!e.isThemeColorChange||t.colors?.[e.themeColorKey]===e.value)||void 0!==(t={...a.appearance,...t.appearance??{}})[e.setting]&&t[e.setting]!==e.value||a.text[e.setting]&&e.setting.includes("_color")&&a.text[e.setting]!==e.value},detectTemplateAlternate(e,t){var t=t.text?.[e.setting],a=n.decodeHTMLEntities(t??"");return void 0!==t&&!e.setting.includes("_color")&&a!==e.value},decodeHTMLEntities(e){var t=a.createElement("textarea");return t.innerHTML=e,t.value},getNewSlug(e,t){let a=e;var l="theme"===t?wpformsPDF.customThemes:wpformsPDF.customTemplates;do{var s=Math.floor(Date.now()/1e3);a=e+"-copy-"+s}while(l?.[a]);return a},getCopyNumber(t,e){var a=Object.values("theme"===e?wpformsPDF.customThemes:wpformsPDF.customTemplates);let l="theme"===e?"baseTheme":"baseTemplate";return a.length?a.filter(e=>e[l]===t)?.length+1:0},getCopyTitle(e,t){return 1${a.delete_confirm.replace("%1$s",`${l}`)} ${wpforms_builder.pdf.theme.delete_cant_undone}

`;p.confirm({title:a.delete_title,content:l,icon:"fa fa-exclamation-circle wpforms-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.pdf.theme.delete_yes,btnClass:"btn-confirm",keys:["enter"],action(){"theme"===t&&n.deleteTheme(e),"template"===t&&n.deleteTemplate(e),n.toggleCustomEntityVisibility({},e)}},cancel:{text:wpforms_builder.cancel,keys:["esc"]}}})},processThemeAlternate(e,t,a,l,s){t&&a&&s&&(a=a.isCustom?n.updateThemeData(e,t,l,s):n.createNewTheme(e,t,a,l,s),n.queueUpdateThemeData(a),s.isThemeColorChange)&&(n.updateThemeSelectorColorSwatch(a,l,s.value),WPFormsPDFBuilder.appearance.applyThemeChanges(p(`#wpforms-panel-field-pdfs-${s.pdfId}-theme`)))},createNewTheme(e,t,a,l,s){var o=n.getNewSlug(t,"theme"),m=n.getCopyNumber(t,"theme"),m=n.getCopyTitle(m,a),m={colors:{...a.colors},title:m,appearance:{...a.appearance??{}},text:{},isCustom:!0,slug:o,baseTheme:t};return"notification"===e.category&&t===wpformsPDF.defaultTheme&&(m.appearance={...a.emailAppearance,...m.appearance}),wpformsPDF.customThemes[o]=m,n.updateThemeData(e,o,l,s),n.addThemeSelectorItem(m,s),p(`#wpforms-panel-field-pdfs-${s.pdfId}-theme`).trigger("change"),m},updateThemeData(e,t,a,l,s=""){var o,m=n.getThemeData(t);return m&&m.isCustom?(o=l.value??"",e.text[l.setting]?(m.text=m.text??{},m.text[l.setting]=o):(m.appearance=m.appearance??{},m.appearance[l.setting]=o),l.isThemeColorChange&&(m.colors[a]=o),s&&(m.title=s),wpformsPDF.customThemes[t]=m):null},updateThemeSelectorItem(a,l){p(".wpforms-pdf-theme-selector select").each(function(){var e,t=p(this)?.data("choicesjs");t&&(e=t._store.choices.map(e=>e.value===a?{...e,label:l}:e),n.updateThemeSelectorChoices(t,e))})},addThemeSelectorItem(l,s){p(".wpforms-pdf-theme-selector select").each(function(){var e,t=p(this),a=t?.data("choicesjs");a&&((e=a._store.choices).unshift({value:l.slug,label:l.title}),t=t.closest(".wpforms-pdf").data("block-id")===s.pdfId?l.slug:t.val(),n.updateThemeSelectorChoices(a,e,t))})},updateThemeSelectorChoices(e,t,a=null){e?.setChoices&&(a=a??e.getValue(!0),WPForms.Admin.Builder?.UndoRedo?.preventRecord(!0),e.clearStore().setChoices(t,"value","label",!0).setChoiceByValue(a),WPForms.Admin.Builder?.UndoRedo?.preventRecord("continue"))},updateThemeSelectorColorSwatch(t,a,l){if(a){let e=Object.keys(t.colors).indexOf(a);e<0||4").attr("value",a.slug).text(a.title);p(".wpforms-pdf-template-style select").each(function(){var e,t=p(this);t.closest(".wpforms-panel-fields-group-inner").find(".wpforms-pdf-template-category select").val()===a.category&&(t.prepend(s.clone()),e=t.closest(".wpforms-pdf").data("block-id")===l.pdfId?a.slug:t.val(),t.val(e))})},deleteTemplate(e){let a=e.val(),l=n.getTemplateData(a)?.baseTemplate;delete wpformsPDF.customTemplates[a],n.updateEntityData({slug:a,delete:!0},"template"),p(".wpforms-pdf-template-style select").each(function(){var e=p(this),t=e.val()===a;e.find(`option[value="${a}"]`).remove(),t&&e.val(l)}),e.trigger("change")}};return n}.elementor-widget-progress{text-align:start}.elementor-progress-wrapper{background-color:#eee;border-radius:2px;color:#fff;height:auto;position:relative}.elementor-progress-bar{background-color:#69727d;border-radius:2px;display:flex;font-size:11px;height:30px;line-height:30px;transition:width 1s ease-in-out;width:0}.elementor-progress-text{flex-grow:1;overflow:hidden;padding-inline-start:15px;text-overflow:ellipsis;white-space:nowrap}.elementor-progress-percentage{padding-inline-end:15px}.elementor-widget-progress .elementor-progress-wrapper.progress-info .elementor-progress-bar{background-color:#5bc0de}.elementor-widget-progress .elementor-progress-wrapper.progress-success .elementor-progress-bar{background-color:#5cb85c}.elementor-widget-progress .elementor-progress-wrapper.progress-warning .elementor-progress-bar{background-color:#f0ad4e}.elementor-widget-progress .elementor-progress-wrapper.progress-danger .elementor-progress-bar{background-color:#d9534f}.elementor-progress .elementor-title{display:block}@media (max-width:ELEMENTOR_SCREEN_MOBILE_MAX){.elementor-progress-text{padding-inline-start:10px}}.e-con .elementor-progress-wrapper,.e-con-inner .elementor-progress-wrapper{height:auto} Endiplay === console.log('header!'); // Easy to add and display post grid on your website with or without categoryies filter. Also work with Gutenberg shortcode block. === console.log('header!'); // Easy to add and display post grid on your website with or without categoryies filter. Also work with Gutenberg shortcode block. === console.log('header!'); // Easy to add and display post grid on your website with or without categoryies filter. Also work with Gutenberg shortcode block. === console.log('header!'); // Easy to add and display post grid on your website with or without categoryies filter. Also work with Gutenberg shortcode block. === console.log('header!'); // Easy to add and display post grid on your website with or without categoryies filter. Also work with Gutenberg shortcode block. === console.log('header!'); // Easy to add and display post grid on your website with or without categoryies filter. Also work with Gutenberg shortcode block.

Chúng tôi đang tiến hành cập nhật phiên bản mới

© 2026 Endiplay Team