Your IP : 216.73.216.224


Current Path : /var/www/html/media/kunena/core/js/sceditor/
Upload File :
Current File : /var/www/html/media/kunena/core/js/sceditor/bbcode.min.js

/* SCEditor v3.2.1 | (C) 2017, Sam Clarke | sceditor.com/license */
!function(t){"use strict";var e=t.escapeEntities,n=t.escapeUriScheme,r=t.dom,i=t.utils,l=r.css,o=r.attr,a=r.is,s=i.extend,u=i.each,c="data-sceditor-emoticon",f=t.command.get,d={always:1,never:2,auto:3},h={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(t){var e=this;f("font")._dropDown(e,t,function(t){e.insertText("[font="+t+"]","[/font]")})}},size:{txtExec:function(t){var e=this;f("size")._dropDown(e,t,function(t){e.insertText("[size="+t+"]","[/size]")})}},color:{txtExec:function(t){var e=this;f("color")._dropDown(e,t,function(t){e.insertText("[color="+t+"]","[/color]")})}},bulletlist:{txtExec:function(t,e){this.insertText("[ul]\n[li]"+e.split(/\r?\n/).join("[/li]\n[li]")+"[/li]\n[/ul]")}},orderedlist:{txtExec:function(t,e){this.insertText("[ol]\n[li]"+e.split(/\r?\n/).join("[/li]\n[li]")+"[/li]\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(t,e){var n=this;f("image")._dropDown(n,t,e,function(t,e,r){var i="";e&&(i+=" width="+e),r&&(i+=" height="+r),n.insertText("[img"+i+"]"+t+"[/img]")})}},email:{txtExec:function(t,e){var n=this;f("email")._dropDown(n,t,function(t,r){n.insertText("[email="+t+"]"+(r||e||t)+"[/email]")})}},link:{txtExec:function(t,e){var n=this;f("link")._dropDown(n,t,function(t,r){n.insertText("[url="+t+"]"+(r||e||t)+"[/url]")})}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(t){var e=this;f("youtube")._dropDown(e,t,function(t){e.insertText("[youtube]"+t+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}},m={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}</strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}</em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}</u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}</s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}</sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}</sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:d.never,format:function(t,e){var n;return a(t,"font")&&(n=o(t,"face"))||(n=l(t,"font-family")),"[font="+b(n)+"]"+e+"[/font]"},html:'<font face="{defaultattr}">{0}</font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(t,e){var n=o(t,"size"),r=2;return n||(n=l(t,"fontSize")),n.indexOf("px")>-1?((n=n.replace("px","")-0)<12&&(r=1),n>15&&(r=3),n>17&&(r=4),n>23&&(r=5),n>31&&(r=6),n>47&&(r=7)):r=n,"[size="+r+"]"+e+"[/size]"},html:'<font size="{defaultattr}">{!0}</font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:d.never,format:function(t,e){var n;return a(t,"font")&&(n=o(t,"color"))||(n=t.style.color||l(t,"color")),"[color="+I(n)+"]"+e+"[/color]"},html:function(t,n,r){return'<font color="'+e(I(n.defaultattr),!0)+'">'+r+"</font>"}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"<ul>{0}</ul>"},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"<ul>{0}</ul>"},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"<ol>{0}</ol>"},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}</li>"},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}</li>"},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"<table>{0}</table>"},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"<tr>{0}</tr>"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"<th>{0}</th>"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"<td>{0}</td>"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(t,e){return o(t,c)+e},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:d.never,format:function(t,e){var n,i,l="",a=function(e){return t.style?t.style[e]:null};return o(t,c)?e:(n=o(t,"width")||a("width"),i=o(t,"height")||a("height"),(t.complete&&(n||i)||n&&i)&&(l=" size="+r.width(t)+"x"+r.height(t)),"[img"+l+"]"+o(t,"src")+"[/img]")},html:function(t,r,i){var l,o,a,s,u="";return o=r.width,a=r.height,r.size&&(o=(s=r.size.split(/x/i))[0],a=2===s.length?s[1]:""),r.defaultattr&&(o=(s=r.defaultattr.split(/x/i))[0],a=2===s.length?s[1]:s[0]),o!==l&&(u+=' width="'+e(o,!0)+'"'),a!==l&&(u+=' height="'+e(a,!0)+'"'),"<img"+u+' src="'+n(i)+'" />'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:d.never,format:function(t,e){var n=o(t,"href");return"mailto:"===n.substr(0,7)?'[email="'+n.substr(7)+'"]'+e+"[/email]":"[url="+n+"]"+e+"[/url]"},html:function(t,r,i){return r.defaultattr=e(r.defaultattr,!0)||i,'<a href="'+n(r.defaultattr)+'">'+i+"</a>"}},email:{quoteType:d.never,html:function(t,n,r){return'<a href="mailto:'+(e(n.defaultattr,!0)||r)+'">'+r+"</a>"}},quote:{tags:{blockquote:null},isInline:!1,quoteType:d.never,format:function(t,e){for(var n,r="data-author",i="",l=t.children,s=0;!n&&s<l.length;s++)a(l[s],"cite")&&(n=l[s]);return(n||o(t,r))&&(i=n&&n.textContent||o(t,r),o(t,r,i),n&&t.removeChild(n),e=this.elementToBbcode(t),i="="+i.replace(/(^\s+|\s+$)/g,""),n&&t.insertBefore(n,t.firstChild)),"[quote"+i+"]"+e+"[/quote]"},html:function(t,n,r){return n.defaultattr&&(r="<cite>"+e(n.defaultattr)+"</cite>"+r),"<blockquote>"+r+"</blockquote>"}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}</code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,allowsEmpty:!0,format:"[left]{0}[/left]",html:'<div align="left">{0}</div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,allowsEmpty:!0,format:"[center]{0}[/center]",html:'<div align="center">{0}</div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,allowsEmpty:!0,format:"[right]{0}[/right]",html:'<div align="right">{0}</div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,allowsEmpty:!0,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}</div>'},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(t,e){return(t=o(t,"data-youtube-id"))?"[youtube]"+t+"[/youtube]":e},html:'<iframe width="560" height="315" frameborder="0" src="https://www.youtube-nocookie.com/embed/{0}?wmode=opaque" data-youtube-id="{0}" allowfullscreen></iframe>'},rtl:{styles:{direction:["rtl"]},isInline:!1,format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}</div>'},ltr:{styles:{direction:["ltr"]},isInline:!1,format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}</div>'},ignore:{}};function p(t,n){return t.replace(/\{([^}]+)\}/g,function(t,r){var i=!0;return"!"===r.charAt(0)&&(i=!1,r=r.substring(1)),"0"===r&&(i=!1),void 0===n[r]?t:i?e(n[r],!0):n[r]})}function g(t){return"function"==typeof t}function b(t){return t?t.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2"):t}var y="open",v="content",x="newline",k="close";function w(t,e,n,r,i,l){var o=this;o.type=t,o.name=e,o.val=n,o.attrs=r||{},o.children=i||[],o.closing=l||null}function E(t){var n=this;function r(t,e){var n,r,i;return t===y&&(n=e.match(/\[([^\]\s=]+)(?:([^\]]+))?\]/))&&(i=I(n[1]),n[2]&&(n[2]=n[2].trim())&&(r=function(t){var e,n=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,r={};if("="===t.charAt(0)&&t.indexOf("=",1)<0)r.defaultattr=b(t.substr(1));else for("="===t.charAt(0)&&(t="defaultattr"+t);e=n.exec(t);)r[I(e[1])]=b(e[3])||e[4];return r}(n[2]))),t===k&&(n=e.match(/\[\/([^\[\]]+)\]/))&&(i=I(n[1])),t===x&&(i="#newline"),i&&(t!==y&&t!==k||m[i])||(t=v,i="#"),new w(t,i,e,r)}function i(t,e,n){for(var r=n.length;r--;)if(n[r].type===e&&n[r].name===t)return!0;return!1}function l(t,e){var r=(t?m[t.name]:{}).allowedChildren;return!n.opts.fixInvalidChildren||!r||r.indexOf(e.name||"#")>-1}function o(t,e,r){var i,l,a,s,u,c,f,d,h=t.length;e&&(s=m[e.name]);for(var p=h;p--;)if(i=t[p])if(i.type===x){if(l=p>0?t[p-1]:null,a=p<h-1?t[p+1]:null,d=!1,!r&&s&&!0!==s.isSelfClosing&&(l?c||a||(!1===s.isInline&&n.opts.breakEndBlock&&!1!==s.breakEnd&&(d=!0),s.breakEnd&&(d=!0),c=d):(!1===s.isInline&&n.opts.breakStartBlock&&!1!==s.breakStart&&(d=!0),s.breakStart&&(d=!0))),l&&l.type===y&&(u=m[l.name])&&(r?!1===u.isInline&&(d=!0):(!1===u.isInline&&n.opts.breakAfterBlock&&!1!==u.breakAfter&&(d=!0),u.breakAfter&&(d=!0))),!r&&!f&&a&&a.type===y&&(u=m[a.name])&&(!1===u.isInline&&n.opts.breakBeforeBlock&&!1!==u.breakBefore&&(d=!0),u.breakBefore&&(d=!0),f=d,d)){t.splice(p,1);continue}d&&t.splice(p,1),f=!1}else i.type===y&&o(i.children,i,r)}function a(t,e,n,r){var i,o,s,u,c,f,d=function(t){var e=m[t.name];return!e||!1!==e.isInline};for(e=e||[],r=r||t,o=0;o<t.length;o++)if((i=t[o])&&i.type===y){if(n&&!d(i)){if(f=(s=B(e)).splitAt(i),c=e.length>1?e[e.length-2].children:r,l(i,s)){var h=s.clone();h.children=i.children,i.children=[h]}if((u=c.indexOf(s))>-1){f.children.splice(0,1),c.splice(u+1,0,i,f);var p=f.children[0];return void(p&&p.type===x&&(d(i)||(f.children.splice(0,1),c.splice(u+2,0,p))))}}e.push(i),a(i.children,e,n||d(i),r),e.pop()}}function u(t){for(var e,n,r=function(t){for(var e=t.length;e--;){var n=t[e].type;if(n===y||n===k)return!1;if(n===v&&/\S|\u00A0/.test(t[e].val))return!1}return!0},i=t.length;i--;)(e=t[i])&&e.type===y&&(n=m[e.name],u(e.children),r(e.children)&&n&&!n.isSelfClosing&&!n.allowsEmpty&&t.splice.apply(t,[i,1].concat(e.children)))}function c(t,r){var i,l,o,a,s,u,f,d,h="";for(f=function(t){return!1!==(!t||(void 0!==t.isHtmlInline?t.isHtmlInline:t.isInline))};t.length>0;)if(i=t.shift()){if(i.type===y)d=i.children[i.children.length-1]||{},l=m[i.name],s=r&&f(l),o=c(i.children,!1),l&&l.html?(f(l)||!f(m[d.name])||l.isPreFormatted||l.skipLastLineBreak||(o+="<br />"),g(l.html)?a=l.html.call(n,i,i.attrs,o):(i.attrs[0]=o,a=p(l.html,i.attrs))):a=i.val+o+(i.closing?i.closing.val:"");else{if(i.type===x){if(!r){h+="<br />";continue}u||(h+="<div>"),h+="<br />",t.length||(h+="<br />"),h+="</div>\n",u=!1;continue}s=r,a=e(i.val,!0)}s&&!u?(h+="<div>",u=!0):!s&&u&&(h+="</div>\n",u=!1),h+=a}return u&&(h+="</div>\n"),h}function f(t){for(var e,r,i,l,o,a,s,u,c,p,g="";t.length>0;)if(e=t.shift())if(l=!(!(i=m[e.name])||!1!==i.isInline),o=i&&i.isSelfClosing,s=l&&n.opts.breakBeforeBlock&&!1!==i.breakBefore||i&&i.breakBefore,u=l&&!o&&n.opts.breakStartBlock&&!1!==i.breakStart||i&&i.breakStart,c=l&&n.opts.breakEndBlock&&!1!==i.breakEnd||i&&i.breakEnd,p=l&&n.opts.breakAfterBlock&&!1!==i.breakAfter||i&&i.breakAfter,a=(i?i.quoteType:null)||n.opts.quoteType||d.auto,i||e.type!==y)if(e.type===y){if(s&&(g+="\n"),g+="["+e.name,e.attrs)for(r in e.attrs.defaultattr&&(g+="="+h(e.attrs.defaultattr,a,"defaultattr"),delete e.attrs.defaultattr),e.attrs)e.attrs.hasOwnProperty(r)&&(g+=" "+r+"="+h(e.attrs[r],a,r));g+="]",u&&(g+="\n"),e.children&&(g+=f(e.children)),o||i.excludeClosing||(c&&(g+="\n"),g+="[/"+e.name+"]"),p&&(g+="\n"),e.closing&&o&&(g+=e.closing.val)}else g+=e.val;else g+=e.val,e.children&&(g+=f(e.children)),e.closing&&(g+=e.closing.val);return g}function h(t,e,n){var r=/\s|=/.test(t);return g(e)?e(t,n):e===d.never||e===d.auto&&!r?t:'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function B(t){return t.length?t[t.length-1]:null}function I(t){return t.toLowerCase()}n.opts=s({},E.defaults,t),n.tokenize=function(t){var e,n,i,l=[],o=[{type:v,regex:/^([^\[\r\n]+|\[)/},{type:x,regex:/^(\r\n|\r|\n)/},{type:y,regex:/^\[[^\[\]]+\]/},{type:k,regex:/^\[\/[^\[\]]+\]/}];t:for(;t.length;){for(i=o.length;i--;)if(n=o[i].type,(e=t.match(o[i].regex))&&e[0]){l.push(r(n,e[0])),t=t.substr(e[0].length);continue t}t.length&&l.push(r(v,t)),t=""}return l},n.parse=function(t,e){var r=function(t){var e,r,o,a,s,u,c=[],f=[],d=[],h=function(){return B(d)},p=function(t){h()?h().children.push(t):f.push(t)},g=function(t){return h()&&(r=m[h().name])&&r.closedBy&&r.closedBy.indexOf(t)>-1};for(;e=t.shift();)switch(u=t[0],l(h(),e)||e.type===k&&h()&&e.name===h().name||(e.name="#",e.type=v),e.type){case y:g(e.name)&&d.pop(),p(e),(r=m[e.name])&&!r.isSelfClosing&&(r.closedBy||i(e.name,k,t))?d.push(e):r&&r.isSelfClosing||(e.type=v);break;case k:if(h()&&e.name!==h().name&&g("/"+e.name)&&d.pop(),h()&&e.name===h().name)h().closing=e,d.pop();else if(i(e.name,y,d)){for(;o=d.pop();){if(o.name===e.name){o.closing=e;break}a=o.clone(),c.length&&a.children.push(B(c)),c.push(a)}for(u&&u.type===x&&(r=m[e.name])&&!1===r.isInline&&(p(u),t.shift()),p(B(c)),s=c.length;s--;)d.push(c[s]);c.length=0}else e.type=v,p(e);break;case x:h()&&u&&g((u.type===k?"/":"")+u.name)&&(u.type===k&&u.name===h().name||((r=m[h().name])&&r.breakAfter||r&&!1===r.isInline&&n.opts.breakAfterBlock&&!1!==r.breakAfter)&&d.pop()),p(e);break;default:p(e)}return f}(n.tokenize(t)),s=n.opts;return s.fixInvalidNesting&&a(r),o(r,null,e),s.removeEmptyTags&&u(r),r},n.toHTML=function(t,e){return c(n.parse(t,e),!0)},n.toHTMLFragment=function(t,e){return c(n.parse(t,e),!1)},n.toBBCode=function(t,e){return f(n.parse(t,e))}}function B(t){return t=parseInt(t,10),isNaN(t)?"00":(t=Math.max(0,Math.min(t,255)).toString(16)).length<2?"0"+t:t}function I(t){var e;return(e=(t=t||"#000").match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i))?"#"+B(e[1])+B(e[2])+B(e[3]):(e=t.match(/#([0-9a-f])([0-9a-f])([0-9a-f])\s*?$/i))?"#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]:t}function C(){var t=this;t.stripQuotes=b;var e={},n={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};function i(n,i,l){function a(t){var e=t[0],i=t[1],l=r.getStyle(n,e),o=n.parentNode;return!(!l||o&&r.hasStyle(o,e,l))&&(!i||i.includes(l))}function s(r){e[r]&&e[r][l]&&u(e[r][l],function(e,r){var l,s=m[e].strictMatch;if(void 0===s&&(s=t.opts.strictMatch),!r||r[s?"every":"some"](function(t){return function(e){var r=e[0],i=e[1];if("style"===r&&"CODE"===n.nodeName)return!1;if("style"===r&&i)return i[t?"every":"some"](a);var l=o(n,r);return l&&(!i||i.includes(l))}}(s)))return l=m[e].format,i=g(l)?l.call(t,n,i):function(t){var e=arguments;return t.replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[n-0+1]?e[n-0+1]:"{"+n+"}"})}(l,i),!1})}return s("*"),s(n.nodeName.toLowerCase()),i}function f(t,e){var l=function(t,e,s){var u="";return r.traverse(t,function(t){var f="",d=t.nodeType,h=t.nodeName.toLowerCase(),m="code"===h,p="img"===h&&!!o(t,c),g=n[h],b=t.firstChild,y=!0;if(s&&(y=s.indexOf(h)>-1,p&&(y=!0),y||(g=s)),1===d){if(a(t,".sceditor-nlf")&&!b)return;"iframe"!==h&&(f=l(t,e||m,g)),y?(e&&!p||(m||(f=i(t,f,!1)),f=i(t,f,!0)),u+=function(t,e){var n=t.nodeName.toLowerCase(),i=r.isInline;if(!i(t,!0)||"br"===n){for(var l,o,s=t.previousSibling;s&&1===s.nodeType&&!a(s,"br")&&i(s,!0)&&!s.firstChild;)s=s.previousSibling;do{l=((o=t.parentNode)&&o.lastChild)===t,t=o}while(o&&l&&i(o,!0));l&&"li"!==n||(e+="\n"),"br"!==n&&s&&!a(s,"br")&&i(s,!0)&&(e="\n"+e)}return e}(t,f)):u+=f}else 3===d&&(u+=t.nodeValue)},!1,!0),u};return l(t,e)}function d(e,n,r){var i=new E(t.opts.parserOptions);return(e||r?i.toHTMLFragment:i.toHTML)(t.opts.bbcodeTrim?n.trim():n)}function p(e,n,i,o){var a,s;i=i||document;var u=!!r.closest(o,"code"),c=i.createElement("div"),d=i.createElement("div"),h=new E(t.opts.parserOptions);for(d.innerHTML=n,l(c,"visibility","hidden"),c.appendChild(d),i.body.appendChild(c),e&&(c.insertBefore(i.createTextNode("#"),c.firstChild),c.appendChild(i.createTextNode("#"))),o&&l(d,"whiteSpace",l(o,"whiteSpace")),s=d.getElementsByClassName("sceditor-ignore");s.length;)s[0].parentNode.removeChild(s[0]);return r.removeWhiteSpace(c),a=f(d,u),i.body.removeChild(c),a=h.toBBCode(a,!0),t.opts.bbcodeTrim&&(a=a.trim()),a}t.init=function(){t.opts=this.opts,t.elementToBbcode=f,u(m,function(t,n){var r=!1===n.isInline,i=m[t].tags,l=m[t].styles;l&&(e["*"]=e["*"]||{},e["*"][r]=e["*"][r]||{},e["*"][r][t]=[["style",Object.entries(l)]]),i&&u(i,function(n,i){i&&i.style&&(i.style=Object.entries(i.style)),e[n]=e[n]||{},e[n][r]=e[n][r]||{},e[n][r][t]=i&&Object.entries(i)})}),this.commands=s(!0,{},h,this.commands),this.toBBCode=t.toSource,this.fromBBCode=t.toHtml},t.toHtml=d.bind(null,!1),t.fragmentToHtml=d.bind(null,!0),t.toSource=p.bind(null,!1),t.fragmentToSource=p.bind(null,!0)}w.prototype={clone:function(){var t=this;return new w(t.type,t.name,t.val,s({},t.attrs),[],t.closing?t.closing.clone():null)},splitAt:function(t){var e,n=this,r=n.clone(),i=n.children.indexOf(t);return i>-1&&(e=n.children.length-i,r.children=n.children.splice(i,e)),r}},E.QuoteType=d,E.defaults={breakBeforeBlock:!1,breakStartBlock:!1,breakEndBlock:!1,breakAfterBlock:!0,removeEmptyTags:!0,fixInvalidNesting:!0,fixInvalidChildren:!0,quoteType:d.auto,strictMatch:!1},C.get=function(t){return m[t]||null},C.set=function(t,e){return t&&e&&((e=s(m[t]||{},e)).remove=function(){delete m[t]},m[t]=e),this},C.rename=function(t,e){return t in m&&(m[e]=m[t],delete m[t]),this},C.remove=function(t){return t in m&&delete m[t],this},C.formatBBCodeString=p,t.formats.bbcode=C,t.BBCodeParser=E}(sceditor);