Ext.ux.form.TinyMCETextArea=Ext.extend(Ext.form.TextArea,{wysiwygIntialized:!1,intializationInProgress:!1,lastHeight:null,lastFrameHeight:null,noWysiwyg:!1,tinyMCEConfig:{},editor:void 0,disableEditor:!1,editorOwnerWindow:void 0,constructor:function(b){b=b||{};Ext.applyIf(b,{hideMode:"offsets"});Ext.applyIf(b.tinyMCEConfig,{hideMode:"offsets",mode:"exact",resize:!1});Ext.ux.form.TinyMCETextArea.superclass.constructor.call(this,b)},getEditorOwnerWindow:function(){if(Ext.isDefined(this.editorOwnerWindow))return this.editorOwnerWindow;
var b=Ext.getDom(this.getInputId());return this.editorOwnerWindow=b?b.ownerDocument.defaultView:void 0},afterRender:function(){var b=this;Ext.ux.form.TinyMCETextArea.superclass.afterRender.call(this,arguments);this.initEditor();b.on("blur",function(d,h,l){d=document.getElementById(b.getInputId());b.wysiwygIntialized?(h=b.getEditor())&&h.isHidden()&&(d&&(b.positionBeforeBlur={start:d.selectionStart,end:d.selectionEnd}),h.load()):d&&(b.positionBeforeBlur={start:d.selectionStart,end:d.selectionEnd})},
b);b.on("resize",function(d,h,l,v,t,u){b.syncEditorHeight(l)},b)},syncEditorHeight:function(b){this.lastHeight=b;if(this.wysiwygIntialized&&this.rendered){var d=this.getEditorOwnerWindow().tinymce.get(this.getInputId());if(d&&d.iframeElement&&!d.isHidden()){d=Ext.get(d.iframeElement);var h=d.up(".mce-edit-area");h=h.up(".mce-container-body");var l=h.down(".mce-toolbar-grp");l&&(b-=l.getHeight());(l=h.down(".mce-menubar"))&&(b-=l.getHeight());(h=h.down(".mce-statusbar"))&&(b-=h.getHeight());this.lastFrameHeight=
b-3;d.setHeight(b-3)}}},withEd:function(b){var d=this,h=this.getEditor();if(h)if(h.initialized)h.initialized&&(d.editor=h,b.call(d));else this.on("initialized",function(){d.withEd(b)},d)},getInputId:function(){return this.inputId||(this.inputId=this.id)},isDisabled:function(){return this.disabled},insertAtCursor:function(b){var d=this.getEditor();d.execCommand("mceInsertContent",!1,b);d.undoManager.clear()},selectBySelector:function(b){var d=this.getEditor();if(b=d.getDoc().querySelector(b)){if(Ext.isGecko){var h=
d.selection.dom,l=h.createRng();h=h.nodeIndex(b.firstChild);l.setStart(b.firstChild,h);b.firstChild!==b.lastChild?l.setEnd(b.lastChild,h+(b.childElementCount-1)):l.setEnd(b.lastChild,b.lastChild.childNodes.length);d.selection.setRng(l)}else d.execCommand("mceSelectNode",!1,b);return!0}return!1},initEditor:function(){var b=this;if(!(b.noWysiwyg||b.intializationInProgress||b.wysiwygIntialized)){b.intializationInProgress=!0;b.tinyMCEConfig.selector="textarea#"+b.getInputId();b.tinyMCEConfig.height=b.lastFrameHeight?
b.lastFrameHeight:30;var d=null;b.tinyMCEConfig.setup&&(d=b.tinyMCEConfig.setup);b.tinyMCEConfig.setup=function(h){Ext.isDefined(b.editor)||(b.editor=h);var l=b.getEditorOwnerWindow(),v=l.tinymce.DOM.loadCSS,t=[];l.tinymce.DOM.loadCSS=function(u){u||="";Ext.each(u.split(","),function(p){if(!Ext.isEmpty(p)){t.push(p);var r=l.document.createElement("link");l.document.head.appendChild(r);r.addEventListener("load",function(){t.splice(t.indexOf(p),1);l.document.head.removeChild(r);b.fireEvent("stylesheetloaded",
p)});r.addEventListener("error",function(){t.splice(t.indexOf(p),1);b.fireEvent("stylesheetloaded",p)});r.setAttribute("rel","stylesheet");r.setAttribute("type","text/css");r.setAttribute("href",p)}});return v.apply(this,arguments)};h.on("init",function(u){function p(){if(0<t.length)b.on("stylesheetloaded",function(){p()},this);else b.syncEditorHeight(b.lastHeight||b.height)}l.tinymce.DOM.loadCSS=v;b.wysiwygIntialized=!0;b.intializationInProgress=!1;(b.disableEditor||b.isDisabled())&&b.disable();
b.fireEvent("initialized",b,h,{});(b.lastHeight||b.height)&&p()});d&&d(h)};b.getEditorOwnerWindow().tinymce.init(b.tinyMCEConfig);b.intializationInProgress=!1;b.wysiwygIntialized=!0}},getEditor:function(){var b=this.getEditorOwnerWindow();return b?b.tinymce.get(this.getInputId()):void 0},removeEditor:function(){if(this.intializationInProgress||!this.wysiwygIntialized)return this;var b=this.getEditor();b&&(b.save(),b.destroy(!1));this.wysiwygIntialized=!1;return this},setValue:function(b){var d=this;
if(d.wysiwygIntialized&&this.value!==b&&(this.value=b,this.rendered)){var h=d.getEditor();if(h)d.setContent(h,b);else d.getEditorOwnerWindow().tinymce.EditorManager.on("AddEditor",function(){d.withEd(function(){var l=d.getEditor();l.isDirty()||d.setContent(l,b)})},this)}return this.value},setContent:function(b,d){b.setContent(null===d||void 0===d?"":d,{format:"raw"});b.startContent=b.getContent({format:"raw"})},getValue:function(b){if(b=this.getEditor()){if(!this.rendered||!b.initialized)return Ext.value(this.value,
"");b=b.getContent();if(b===this.emptyText||void 0===b)b="";return b}},getRawValue:function(){var b=this.getEditor();if(b){if(!this.rendered||!b.initialized)return Ext.value(this.value,"");b=b.getContent({format:"raw"});b===this.emptyText&&(b="");return b}},initValue:function(){if(this.rendered)if(void 0!==this.value)this.setValue(this.value);else{var b=this.getEl().value;b&&this.setValue(b)}else Ext.ux.TinyMCE.superclass.initValue.call(this)},focus:function(b,d){var h=this;if(h.isDisabled())return h;
if(d)return isNaN(d)&&(d=10),setTimeout(function(){h.focus.call(h,b,!1)},d),h;if(!h.wysiwygIntialized)return Ext.ux.form.TinyMCETextArea.superclass.focus.call(this,arguments);var l=h.getEditor();if(l&&!l.isHidden()&&l.initialized)Ext.ux.form.TinyMCETextArea.superclass.focus.call(this,arguments),l.focus();else return this.withEd(function(){l.focus()}),Ext.ux.form.TinyMCETextArea.superclass.focus.call(this,arguments);return h},enable:function(){var b=Ext.ux.form.TinyMCETextArea.superclass.enable.call(this,
arguments);if(!b)return b;if(b=this.getEditor())b.theme.panel.find("*").disabled(!1),this.getEditorBody().setAttribute("contenteditable",!0);return this},disable:function(b){var d=this,h=Ext.ux.form.TinyMCETextArea.superclass.disable.call(this,arguments);if(!h)return h;d.withEd(function(){d.getEditor().theme.panel.find("*").disabled(!0);this.getEditorBody().setAttribute("contenteditable",!1)});return d},hide:function(){var b=this;Ext.ux.form.TinyMCETextArea.superclass.hide.call(this,arguments);var d=
b.getEditor();d&&d.iframeElement?d.hide():b.withEd(function(){b.getEditor().hide()});return b},show:function(){Ext.ux.form.TinyMCETextArea.superclass.show.call(this,arguments);var b=this.getEditor();b&&b.show();return this}});Ext.reg("zarafa.tinymcetextarea",Ext.ux.form.TinyMCETextArea);
(function(b){"object"===typeof exports&&"undefined"!==typeof module?module.exports=b():"function"===typeof define&&define.amd?define([],b):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Tokenizr=b()})(function(){return function(){function b(d,h,l){function v(p,r){if(!h[p]){if(!d[p]){var x="function"==typeof require&&require;if(!r&&x)return x(p,!0);if(t)return t(p,!0);r=Error("Cannot find module '"+p+"'");throw r.code="MODULE_NOT_FOUND",
r;}r=h[p]={exports:{}};d[p][0].call(r.exports,function(y){return v(d[p][1][y]||y)},r,r.exports,b,d,h,l)}return h[p].exports}for(var t="function"==typeof require&&require,u=0;u<l.length;u++)v(l[u]);return v}return b}()({1:[function(b,d,h){function l(k){"@babel/helpers - typeof";return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},l(k)}function v(k,
a){if("function"!==typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(a&&a.prototype,{constructor:{value:k,writable:!0,configurable:!0}});Object.defineProperty(k,"prototype",{writable:!1});a&&x(k,a)}function t(k){var a=r();return function(){var c=y(k);if(a){var e=y(this).constructor;c=Reflect.construct(c,arguments,e)}else c=c.apply(this,arguments);if(!c||"object"!==l(c)&&"function"!==typeof c){if(void 0!==c)throw new TypeError("Derived constructors may only return object or undefined");
if(void 0===this)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");c=this}return c}}function u(k){var a="function"===typeof Map?new Map:void 0;u=function(c){function e(){return p(c,arguments,y(this).constructor)}if(null===c||-1===Function.toString.call(c).indexOf("[native code]"))return c;if("function"!==typeof c)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof a){if(a.has(c))return a.get(c);a.set(c,e)}e.prototype=
Object.create(c.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}});return x(e,c)};return u(k)}function p(k,a,c){p=r()?Reflect.construct.bind():function(e,f,g){var m=[null];m.push.apply(m,f);e=new (Function.bind.apply(e,m));g&&x(e,g.prototype);return e};return p.apply(null,arguments)}function r(){if("undefined"===typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,
[],function(){})),!0}catch(k){return!1}}function x(k,a){x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,e){c.__proto__=e;return c};return x(k,a)}function y(k){y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)};return y(k)}function z(k,a){if(!(k instanceof a))throw new TypeError("Cannot call a class as a function");}function E(k,a){for(var c=0;c<a.length;c++){var e=a[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in
e&&(e.writable=!0);Object.defineProperty(k,e.key,e)}}function A(k,a,c){a&&E(k.prototype,a);c&&E(k,c);Object.defineProperty(k,"prototype",{writable:!1});return k}var F=function(k,a){var c=k.length,e=a-20;0>e&&(e=0);var f=a+20;f>c&&(f=c);var g=function(q){return q.charCodeAt(0).toString(16).toUpperCase()},m=function(q,n,B){return q.substr(n,B).replace(/\\/g,"\\\\").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,
function(w){return"\\x0"+g(w)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(w){return"\\x"+g(w)}).replace(/[\u0100-\u0FFF]/g,function(w){return"\\u0"+g(w)}).replace(/[\u1000-\uFFFF]/g,function(w){return"\\u"+g(w)})};return{prologTrunc:0<e,prologText:m(k,e,a-e),tokenText:m(k,a,1),epilogText:m(k,a+1,f-(a+1)),epilogTrunc:f<c}},C=function(){function k(a,c,e){var f=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,g=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,m=5<arguments.length&&void 0!==
arguments[5]?arguments[5]:0;z(this,k);this.type=a;this.value=c;this.text=e;this.pos=f;this.line=g;this.column=m}A(k,[{key:"toString",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:function(c,e){return e};return"".concat(a("type",this.type)," ")+"(value: ".concat(a("value",JSON.stringify(this.value)),", ")+"text: ".concat(a("text",JSON.stringify(this.text)),", ")+"pos: ".concat(a("pos",this.pos),", ")+"line: ".concat(a("line",this.line),", ")+"column: ".concat(a("column",
this.column),")")}},{key:"isA",value:function(a,c){return a!==this.type||2===arguments.length&&c!==this.value?!1:!0}}]);return k}(),D=function(k){function a(e,f,g,m,q){z(this,a);var n=c.call(this,e);n.name="ParsingError";n.message=e;n.pos=f;n.line=g;n.column=m;n.input=q;return n}v(a,k);var c=t(a);A(a,[{key:"toString",value:function(){for(var e=F(this.input,this.pos),f="line ".concat(this.line," (column ").concat(this.column,"): "),g="",m=0;m<f.length+e.prologText.length;m++)g+=" ";return"Parsing Error: "+
this.message+"\n"+f+e.prologText+e.tokenText+e.epilogText+"\n"+g+"^"}}]);return a}(u(Error)),G=function(){function k(a){z(this,k);this._tokenizr=a;this._data={};this._ignore=this._reject=this._repeat=!1;this._match=null}A(k,[{key:"data",value:function(a,c){var e=this._data[a];2===arguments.length&&(this._data[a]=c);return e}},{key:"info",value:function(){return{line:this._tokenizr._line,column:this._tokenizr._column,pos:this._tokenizr._pos,len:this._match[0].length}}},{key:"push",value:function(){var a;
(a=this._tokenizr).push.apply(a,arguments);return this}},{key:"pop",value:function(){var a;return(a=this._tokenizr).pop.apply(a,arguments)}},{key:"state",value:function(){var a;if(0<arguments.length){var c;(c=this._tokenizr).state.apply(c,arguments);return this}return(a=this._tokenizr).state.apply(a,arguments)}},{key:"tag",value:function(){var a;(a=this._tokenizr).tag.apply(a,arguments);return this}},{key:"tagged",value:function(){var a;return(a=this._tokenizr).tagged.apply(a,arguments)}},{key:"untag",
value:function(){var a;(a=this._tokenizr).untag.apply(a,arguments);return this}},{key:"repeat",value:function(){this._tokenizr._log("    REPEAT");this._repeat=!0;return this}},{key:"reject",value:function(){this._tokenizr._log("    REJECT");this._reject=!0;return this}},{key:"ignore",value:function(){this._tokenizr._log("    IGNORE");this._ignore=!0;return this}},{key:"accept",value:function(a,c){2>arguments.length&&(c=this._match[0]);this._tokenizr._log("    ACCEPT: type: ".concat(a,", value: ")+
"".concat(JSON.stringify(c)," (").concat(l(c),'), text: "').concat(this._match[0],'"'));this._tokenizr._pending.push(new C(a,c,this._match[0],this._tokenizr._pos,this._tokenizr._line,this._tokenizr._column));return this}},{key:"stop",value:function(){this._tokenizr._stopped=!0;return this}}]);return k}();b=function(){function k(){z(this,k);this._finish=this._after=this._before=null;this._rules=[];this._debug=!1;this.reset()}A(k,[{key:"reset",value:function(){this._input="";this._len=0;this._eof=!1;
this._pos=0;this._column=this._line=1;this._state=["default"];this._tag={};this._transaction=[];this._pending=[];this._stopped=!1;this._ctx=new G(this);return this}},{key:"error",value:function(a){return new D(a,this._pos,this._line,this._column,this._input)}},{key:"debug",value:function(a){this._debug=a;return this}},{key:"_log",value:function(a){this._debug&&console.log("tokenizr: ".concat(a))}},{key:"input",value:function(a){if("string"!==typeof a)throw Error('parameter "input" not a String');
this.reset();this._input=a;this._len=a.length;return this}},{key:"push",value:function(a){if(1!==arguments.length)throw Error("invalid number of arguments");if("string"!==typeof a)throw Error('parameter "state" not a String');this._log("    STATE (PUSH): "+"old: <".concat(this._state[this._state.length-1],">, ")+"new: <".concat(a,">"));this._state.push(a);return this}},{key:"pop",value:function(){if(0!==arguments.length)throw Error("invalid number of arguments");if(2>this._state.length)throw Error("no more custom states to pop");
this._log("    STATE (POP): "+"old: <".concat(this._state[this._state.length-1],">, ")+"new: <".concat(this._state[this._state.length-2],">"));return this._state.pop()}},{key:"state",value:function(a){if(1===arguments.length){if("string"!==typeof a)throw Error('parameter "state" not a String');this._log("    STATE (SET): "+"old: <".concat(this._state[this._state.length-1],">, ")+"new: <".concat(a,">"));this._state[this._state.length-1]=a;return this}if(0===arguments.length)return this._state[this._state.length-
1];throw Error("invalid number of arguments");}},{key:"tag",value:function(a){if(1!==arguments.length)throw Error("invalid number of arguments");if("string"!==typeof a)throw Error('parameter "tag" not a String');this._log("    TAG (ADD): ".concat(a));this._tag[a]=!0;return this}},{key:"tagged",value:function(a){if(1!==arguments.length)throw Error("invalid number of arguments");if("string"!==typeof a)throw Error('parameter "tag" not a String');return!0===this._tag[a]}},{key:"untag",value:function(a){if(1!==
arguments.length)throw Error("invalid number of arguments");if("string"!==typeof a)throw Error('parameter "tag" not a String');this._log("    TAG (DEL): ".concat(a));delete this._tag[a];return this}},{key:"before",value:function(a){this._before=a;return this}},{key:"after",value:function(a){this._after=a;return this}},{key:"finish",value:function(a){this._finish=a;return this}},{key:"rule",value:function(a,c,e){var f=3<arguments.length&&void 0!==arguments[3]?arguments[3]:"unknown";if(2===arguments.length&&
"function"===typeof c){var g=[a,c];c=g[0];e=g[1];a="*"}else 3===arguments.length&&"function"===typeof c&&(f=[a,c,e],c=f[0],e=f[1],f=f[2],a="*");if("string"!==typeof a)throw Error('parameter "state" not a String');if(!("object"===l(c)&&c instanceof RegExp))throw Error('parameter "pattern" not a RegExp');if("function"!==typeof e)throw Error('parameter "action" not a Function');if("string"!==typeof f)throw Error('parameter "name" not a String');a=a.split(/\s*,\s*/g).map(function(m){var q=m.split(/\s+/g);
m=q.filter(function(n){return null===n.match(/^#/)});q=q.filter(function(n){return null!==n.match(/^#/)}).map(function(n){return n.replace(/^#/,"")});if(1!==m.length)throw Error("exactly one state required");return{state:m[0],tags:q}});g="g";try{"boolean"===typeof RegExp("","y").sticky&&(g="y")}catch(m){}"boolean"===typeof c.multiline&&c.multiline&&(g+="m");"boolean"===typeof c.dotAll&&c.dotAll&&(g+="s");"boolean"===typeof c.ignoreCase&&c.ignoreCase&&(g+="i");"boolean"===typeof c.unicode&&c.unicode&&
(g+="u");c=new RegExp(c.source,g);this._log("rule: configure rule (state: ".concat(a,", pattern: ").concat(c.source,")"));this._rules.push({state:a,pattern:c,action:e,name:f});return this}},{key:"_progress",value:function(a,c){for(var e=this._line,f=this._column,g=this._input,m=a;m<c;m++){var q=g.charAt(m);"\r"===q?this._column=1:"\n"===q?(this._line++,this._column=1):"\t"===q?this._column+=8-this._column%8:this._column++}this._log("    PROGRESS: characters: ".concat(c-a,", ")+"from: <line ".concat(e,
", column ").concat(f,">, ")+"to: <line ".concat(this._line,", column ").concat(this._column,">"))}},{key:"_tokenize",value:function(){var a=this,c=function(){a._eof||(null!==a._finish&&a._finish.call(a._ctx,a._ctx),a._eof=!0,a._pending.push(new C("EOF","","",a._pos,a._line,a._column)))};if(this._stopped||this._pos>=this._len)c();else{for(var e=!0;e;){e=!1;if(this._debug){var f=F(this._input,this._pos),g=Object.keys(this._tag).map(function(n){return"#".concat(n)}).join(" ");this._log("INPUT: state: <".concat(this._state[this._state.length-
1],">, tags: <").concat(g,">, text: ")+(f.prologTrunc?"...":'"')+"".concat(f.prologText,"<").concat(f.tokenText,">").concat(f.epilogText)+(f.epilogTrunc?"...":'"')+", at: <line ".concat(this._line,", column ").concat(this._column,">"))}for(f=0;f<this._rules.length;f++){this._debug&&(g=this._rules[f].state.map(function(n){var B=n.state;0<n.tags.length&&(B+=" "+n.tags.map(function(w){return"#".concat(w)}).join(" "));return B}).join(", "),this._log("  RULE: state(s): <".concat(g,">, ")+"pattern: ".concat(this._rules[f].pattern.source)));
g=!1;var m=this._rules[f].state.map(function(n){return n.state}),q=m.indexOf("*");0>q&&(q=m.indexOf(this._state[this._state.length-1]));0<=q&&(g=!0,m=this._rules[f].state[q].tags,m=m.filter(function(n){return!a._tag[n]}),0<m.length&&(g=!1));if(g&&(this._rules[f].pattern.lastIndex=this._pos,g=this._rules[f].pattern.exec(this._input),this._rules[f].pattern.lastIndex=this._pos,null!==(g=this._rules[f].pattern.exec(this._input))&&g.index===this._pos&&(this._debug&&this._log("    MATCHED: "+JSON.stringify(g)),
this._ctx._match=g,this._ctx._repeat=!1,this._ctx._reject=!1,this._ctx._ignore=!1,null!==this._before&&this._before.call(this._ctx,this._ctx,g,this._rules[f]),this._rules[f].action.call(this._ctx,this._ctx,g),null!==this._after&&this._after.call(this._ctx,this._ctx,g,this._rules[f]),!this._ctx._reject)))if(this._ctx._repeat){e=!0;break}else if(this._ctx._ignore){this._progress(this._pos,this._rules[f].pattern.lastIndex);this._pos=this._rules[f].pattern.lastIndex;if(this._pos>=this._len){c();return}e=
!0;break}else{if(0<this._pending.length){this._progress(this._pos,this._rules[f].pattern.lastIndex);this._pos=this._rules[f].pattern.lastIndex;this._pos>=this._len&&c();return}throw Error('action of pattern "'+this._rules[f].pattern.source+'" neither rejected nor accepted any token(s)');}}}throw this.error("token not recognized");}}},{key:"token",value:function(){0===this._pending.length&&this._tokenize();if(0<this._pending.length){var a=this._pending.shift();0<this._transaction.length&&this._transaction[0].push(a);
this._log("TOKEN: ".concat(a.toString()));return a}return null}},{key:"tokens",value:function(){for(var a=[],c;null!==(c=this.token());)a.push(c);return a}},{key:"peek",value:function(a){"undefined"===typeof a&&(a=0);for(var c=0;c<this._pending.length+a;c++)this._tokenize();if(a>=this._pending.length)throw Error("not enough tokens available for peek operation");this._log("PEEK: ".concat(this._pending[a].toString()));return this._pending[a]}},{key:"skip",value:function(a){"undefined"===typeof a&&(a=
1);for(var c=0;c<this._pending.length+a;c++)this._tokenize();if(a>this._pending.length)throw Error("not enough tokens available for skip operation");for(;0<a--;)this.token();return this}},{key:"consume",value:function(a,c){for(var e=this,f=0;f<this._pending.length+1;f++)this._tokenize();if(0===this._pending.length)throw Error("not enough tokens available for consume operation");var g=this.token();this._log("CONSUME: ".concat(g.toString()));f=function(){throw new D("expected: <type: ".concat(a,", value: ").concat(JSON.stringify(c),
" (").concat(l(c),")>, ")+"found: <type: ".concat(g.type,", value: ").concat(JSON.stringify(g.value)," (").concat(l(g.value),")>"),g.pos,g.line,g.column,e._input);};2!==arguments.length||g.isA(a,c)?g.isA(a)||f("*","any"):f(JSON.stringify(c),l(c));return g}},{key:"begin",value:function(){this._log("BEGIN: level ".concat(this._transaction.length));this._transaction.unshift([]);return this}},{key:"depth",value:function(){if(0===this._transaction.length)throw Error("cannot determine depth -- no active transaction");
return this._transaction[0].length}},{key:"commit",value:function(){if(0===this._transaction.length)throw Error("cannot commit transaction -- no active transaction");var a=this._transaction.shift();0<this._transaction.length&&(this._transaction[0]=this._transaction[0].concat(a));this._log("COMMIT: level ".concat(this._transaction.length));return this}},{key:"rollback",value:function(){if(0===this._transaction.length)throw Error("cannot rollback transaction -- no active transaction");this._pending=
this._transaction.shift().concat(this._pending);this._log("ROLLBACK: level ".concat(this._transaction.length));return this}},{key:"alternatives",value:function(){for(var a=null,c=[],e=arguments.length,f=Array(e),g=0;g<e;g++)f[g]=arguments[g];for(e=0;e<f.length;e++)try{this.begin();a=f[e].call(this);this.commit();break}catch(m){this._log("EXCEPTION: ".concat(m.toString())),c.push({ex:m,depth:this.depth()}),this.rollback()}if(null===a&&0<c.length)throw c=c.sort(function(m,q){return m.depth-q.depth}),
c[0].ex;return a}}]);return k}();b.Token=C;b.ParsingError=D;b.ActionContext=G;d.exports=b},{}]},{},[1])(1)});//# sourceMappingURL=ux-thirdparty.js.map
