/*! * froala_editor v4.2.2 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2024 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(o){"use strict";o=o&&o.hasOwnProperty("default")?o["default"]:o,Object.assign(o.DEFAULTS,{listAdvancedTypes:!0}),o.PLUGINS.lists=function(m){var g=m.$;function p(e){return'')}function f(e){return'')}function c(e,t){!function c(e,t){for(var n=[],a=0;a").concat(i.html(),""))}}(e,t);var n,a=m.html.defaultTag(),r=null;e.length&&(n="rtl"==m.opts.direction||"rtl"==g(e[0]).css("direction")?"margin-right":"margin-left");for(var o=0;o'):"<".concat(t,">"),s="");for(i-=r;0"),s+=s,i-=m.opts.indentMargin;a&&e[o].tagName.toLowerCase()==a?g(e[o]).replaceWith("".concat(l,"").concat(g(e[o]).html(),"").concat(s)):g(e[o]).wrap("".concat(l,"
  • ").concat(s))}m.clean.lists()}function d(e){var t,n;for(t=e.length-1;0<=t;t--)for(n=t-1;0<=n;n--){if(g(e[n]).find(e[t]).length||e[n]==e[t]){e.splice(t,1);break}if(g(e[n]).contains(e[t])){e.splice(n,1);break}}var a=[];for(t=0;t")),r.append(p("LI")),r.prepend(f("LI"))}r.after(p(o.tagName)),"LI"==o.parentNode.tagName&&(o=o.parentNode.parentNode),a.indexOf(o)<0&&a.push(o)}for(t=0;t<\/span>/g,"")).replace(/<\/span>/g,"<$1>"),c.replaceWith(m.node.openTagString(c.get(0))+d+m.node.closeTagString(c.get(0)))}m.$el.find("li:empty").remove(),m.$el.find("ul:empty, ol:empty").remove(),m.clean.lists(),m.$el.find("ul:empty, ol:empty").remove(),m.html.wrap()}function e(e){if("indent"==e||"outdent"==e){var t=!1,n=m.selection.blocks(),a=[],r=n[0].previousSibling||n[0].parentElement;if("outdent"==e){if("UL"!=n[0].parentNode.tagName&&"UL"!=r.parentNode.tagName&&"OL"!=r.parentNode.tagName&&"LI"!=r.parentNode.tagName)return;if(!n[0].previousSibling&&"none"==r.parentNode.style.listStyleType)return void function i(e){for(m.selection.save();0 ul, > ol").last().get(0);if(a){var r=g(document.createElement("li"));if(a.childNodes.length)for(var o=a.childNodes[0].attributes,i=0;i ul, > ol").last().get(0);if(d)g(d).append(g(e[t]));else{var p=g("<".concat(e[t].parentNode.tagName,">"));g(n).append(p),p.append(g(e[t]))}}}}m.clean.lists(),m.selection.restore()}(a):function s(e){m.selection.save(),d(e),m.selection.restore()}(a))}}return{_init:function t(){m.events.on("commands.after",e),m.events.on("keydown",function(e){if(e.which==o.KEYCODE.TAB){for(var t=m.selection.blocks(),n=[],a=0;a