/*! * froala_editor v4.0.13 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2022 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(l){"use strict";l=l&&l.hasOwnProperty("default")?l["default"]:l,Object.assign(l.DEFAULTS,{listAdvancedTypes:!0}),l.PLUGINS.lists=function(m){var g=m.$;function d(e){return'')}function f(e){return'')}function o(e,t){!function c(e,t){for(var a=[],n=0;n").concat(i.html(),""))}}(e,t);var a,n=m.html.defaultTag(),r=null;e.length&&(a="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;n&&e[o].tagName.toLowerCase()==n?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 c(e){var t,a;for(t=e.length-1;0<=t;t--)for(a=t-1;0<=a;a--){if(g(e[a]).find(e[t]).length||e[a]==e[t]){e.splice(t,1);break}if(g(e[a]).contains(e[t])){e.splice(a,1);break}}var n=[];for(t=0;t")),r.append(d("LI")),r.prepend(f("LI"))}r.after(d(o.tagName)),"LI"==o.parentNode.tagName&&(o=o.parentNode.parentNode),n.indexOf(o)<0&&n.push(o)}for(t=0;t<\/span>/g,"")).replace(/<\/span>/g,"<$1>"),c.replaceWith(m.node.openTagString(c.get(0))+p+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,a=m.selection.blocks(),n=[],r=a[0].previousSibling||a[0].parentElement;if("outdent"==e){if("UL"!=a[0].parentNode.tagName&&"UL"!=r.parentNode.tagName&&"OL"!=r.parentNode.tagName&&"LI"!=r.parentNode.tagName)return;if(!a[0].previousSibling&&"none"==r.parentNode.style.listStyleType)return void function i(e){for(m.selection.save();0 ul, > ol").last().get(0);if(n){var r=g(document.createElement("li"));if(n.childNodes.length)for(var o=n.childNodes[0].attributes,i=0;i ul, > ol").last().get(0);if(p)g(p).append(g(e[t]));else{var d=g("<".concat(e[t].parentNode.tagName,">"));g(a).append(d),d.append(g(e[t]))}}}}m.clean.lists(),m.selection.restore()}(n):function s(e){m.selection.save(),c(e),m.selection.restore()}(n))}}return{_init:function t(){m.events.on("commands.after",e),m.events.on("keydown",function(e){if(e.which==l.KEYCODE.TAB){for(var t=m.selection.blocks(),a=[],n=0;n