summaryrefslogtreecommitdiff
path: root/static-files/journal/wymeditor/jquery.wymeditor.min.js
diff options
context:
space:
mode:
Diffstat (limited to 'static-files/journal/wymeditor/jquery.wymeditor.min.js')
-rw-r--r--static-files/journal/wymeditor/jquery.wymeditor.min.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/static-files/journal/wymeditor/jquery.wymeditor.min.js b/static-files/journal/wymeditor/jquery.wymeditor.min.js
new file mode 100644
index 0000000..c5cf86b
--- /dev/null
+++ b/static-files/journal/wymeditor/jquery.wymeditor.min.js
@@ -0,0 +1,18 @@
+/*!
+WYMeditor - v1.1.1
+
+Home page: http://wymeditor.github.io/wymeditor/
+
+Copyright (c) 2015 Jean-Francois Hovinne;
+Licensed (MIT OR GPL-2.0)
+*/
+
+if(function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";function b(a){void 0===a&&(a=window.navigator.userAgent),a=a.toLowerCase();var b=/(edge)\/([\w.]+)/.exec(a)||/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(ipod)/.exec(a)||/(iphone)/.exec(a)||/(kindle)/.exec(a)||/(silk)/.exec(a)||/(android)/.exec(a)||/(windows phone)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/.exec(a)||/(playbook)/.exec(a)||/(bb)/.exec(a)||/(blackberry)/.exec(a)||[],d={},e={browser:b[5]||b[3]||b[1]||"",version:b[2]||b[4]||"0",versionNumber:b[4]||b[2]||"0",platform:c[0]||""};if(e.browser&&(d[e.browser]=!0,d.version=e.version,d.versionNumber=parseInt(e.versionNumber,10)),e.platform&&(d[e.platform]=!0),(d.android||d.bb||d.blackberry||d.ipad||d.iphone||d.ipod||d.kindle||d.playbook||d.silk||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv||d.edge){var f="msie";e.browser=f,d[f]=!0}if(d.safari&&d.blackberry){var g="blackberry";e.browser=g,d[g]=!0}if(d.safari&&d.playbook){var h="playbook";e.browser=h,d[h]=!0}if(d.bb){var i="blackberry";e.browser=i,d[i]=!0}if(d.opr){var j="opera";e.browser=j,d[j]=!0}if(d.safari&&d.android){var k="android";e.browser=k,d[k]=!0}if(d.safari&&d.kindle){var l="kindle";e.browser=l,d[l]=!0}if(d.safari&&d.silk){var m="silk";e.browser=m,d[m]=!0}return d.name=e.browser,d.platform=e.platform,d}return window.jQBrowser=b(window.navigator.userAgent),window.jQBrowser.uaMatch=b,a&&(a.browser=window.jQBrowser),window.jQBrowser}),"undefined"==typeof WYMeditor)var WYMeditor={};!function(){if("undefined"==typeof window.console&&"undefined"==typeof console){var a,b=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"],c=function(){};for(WYMeditor.console={},a=0;a<b.length;a+=1)WYMeditor.console[b[a]]=c}else"undefined"!=typeof console?WYMeditor.console=console:window.console.firebug?WYMeditor.console=window.console:window.console&&(WYMeditor.console=window.console)}(),jQuery.extend(WYMeditor,{A:"a",ALT:"alt",BLOCKQUOTE:"blockquote",BODY:"body",CLASS:"class",CLASSES:"{Wym_Classes}",CLASSES_ITEMS:"{Wym_Classes_Items}",CLASS_NAME:"{Wym_Class_Name}",CLASS_TITLE:"{Wym_Class_Title}",CONTAINERS:"{Wym_Containers}",CONTAINERS_ITEMS:"{Wym_Containers_Items}",CONTAINER_CLASS:"{Wym_Container_Class}",CONTAINER_NAME:"{Wym_Container_Name}",CONTAINER_TITLE:"{Wym_Containers_Title}",DIRECTION:"{Wym_Direction}",DIV:"div",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HREF:"href",HTML:"{Wym_Html}",IFRAME:"{Wym_Iframe}",IFRAME_BASE_PATH:"{Wym_Iframe_Base_Path}",IFRAME_DEFAULT:"iframe/default/",IMG:"img",INSERT_HTML:"InsertHTML",INSTANCES:[],JQUERY_PATH:"{Wym_Jquery_Path}",LI:"li",LOGO:"{Wym_Logo}",NAME:"name",NBSP:" ",NEWLINE:"\n",OL:"ol",P:"p",PRE:"pre",REL:"rel",SKINS:[],SRC:"src",STATUS:"{Wym_Status}",STRING:"string",STRINGS:[],TABLE:"table",TD:"td",TH:"th",TITLE:"title",TOOLS:"{Wym_Tools}",TOOLS_ITEMS:"{Wym_Tools_Items}",TOOL_CLASS:"{Wym_Tool_Class}",TOOL_NAME:"{Wym_Tool_Name}",TOOL_TITLE:"{Wym_Tool_Title}",TR:"tr",UL:"ul",VERSION:"1.1.1",WYM_INDEX:"wym_index",WYM_PATH:"{Wym_Wym_Path}",EXEC_COMMANDS:{BOLD:"Bold",ITALIC:"Italic",SUPERSCRIPT:"Superscript",SUBSCRIPT:"Subscript",CREATE_LINK:"CreateLink",UNLINK:"Unlink",FORMAT_BLOCK:"FormatBlock",INSERT_IMAGE:"InsertImage",UNDO:"Undo",REDO:"Redo",INSERT_LINEBREAK:"InsertLineBreak",INSERT_ORDEREDLIST:"InsertOrderedList",INSERT_UNORDEREDLIST:"InsertUnorderedList",INDENT:"Indent",OUTDENT:"Outdent",TOGGLE_HTML:"ToggleHtml"},ROOT_CONTAINERS:["blockquote","div","h1","h2","h3","h4","h5","h6","p","pre"],FORBIDDEN_ROOT_CONTAINERS:["a","b","em","i","span","strong","sub","sup"],BLOCKS:["address","blockquote","dd","div","dl","dt","fieldset","form","h1","h2","h3","h4","h5","h6","hr","li","noscript","ol","p","pre","table","tbody","td","tfoot","th","thead","tr","ul"],BLOCKING_ELEMENTS:["blockquote","pre","table"],NON_CONTAINING_ELEMENTS:["br","col","hr","img"],NO_CARET_ELEMENTS:["blockquote","br","col","colgroup","dl","hr","img","ol","table","tbody","tfoot","thead","tr","ul"],INLINE_ELEMENTS:["a","abbr","acronym","b","bdo","big","br","button","cite","code","dfn","em","i","img","input","kbd","label","map","object","q","samp","script","select","small","span","strong","sub","sup","textarea","tt","var"],NON_BLOCKING_ELEMENTS:["div","h1","h2","h3","h4","h5","h6","p"],LIST_TYPE_ELEMENTS:["ol","ul"],HEADING_ELEMENTS:["h1","h2","h3","h4","h5","h6"],POTENTIAL_LIST_ELEMENTS:["blockquote","div","h1","h2","h3","h4","h5","h6","p","pre","td"],POTENTIAL_TABLE_INSERT_ELEMENTS:["blockquote","div","h1","h2","h3","h4","h5","h6","li","p","pre"],INLINE_TABLE_INSERTION_ELEMENTS:["li"],SELECTABLE_TABLE_ELEMENTS:["caption","td","th"],BLOCKING_ELEMENT_SPACER_CLASS:"wym-blocking-element-spacer",EDITOR_ONLY_CLASS:"wym-editor-only",RESIZE_HANDLE_CLASS:"wym-resize-handle",CLASSES_REMOVED_BY_PARSER:["apple-style-span"],KEY_CODE:{B:66,BACKSPACE:8,COMMAND:224,CTRL:17,CURSOR:[37,38,39,40],DELETE:46,DOWN:40,END:35,ENTER:13,HOME:36,I:73,LEFT:37,R:82,RIGHT:39,TAB:9,UP:38},POTENTIAL_BLOCK_ELEMENT_CREATION_KEYS:[8,13,37,38,39,40,46],EVENTS:{postBlockMaybeCreated:"wym-postBlockMaybeCreated",postIframeInitialization:"wym-postIframeInitialization",postModification:"wym-postModification",postUndo:"wym-postUndo",postRedo:"wym-postRedo"},NODE_TYPE:{ELEMENT:1,ATTRIBUTE:2,TEXT:3},editor:function(a,b){if(jQuery.getWymeditorByTextarea(a[0]))throw"It seems that this textarea already belongs to a WYMeditor instance.";var c=this;c._index=WYMeditor.INSTANCES.push(c)-1,c.element=a,c._options=b,c._options.wymPath=c._options.wymPath||WYMeditor._computeWymPath(),c._options.basePath=c._options.basePath||WYMeditor._computeBasePath(c._options.wymPath),c._options.iframeBasePath=c._options.iframeBasePath||c._options.basePath+WYMeditor.IFRAME_DEFAULT,c._init()},EXTERNAL_MODULES:{}}),jQuery.fn.wymeditor=function(a){var b=this;return a=jQuery.extend({html:"",basePath:!1,wymPath:!1,iframeBasePath:!1,jQueryPath:!1,skin:"default",lang:"en",direction:"ltr",customCommands:[],structureRules:{defaultRootContainer:"p"},boxHtml:String()+"<div class='wym_box'><div class='wym_area_top'>"+WYMeditor.TOOLS+"</div><div class='wym_area_left'></div><div class='wym_area_right'>"+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"</div><div class='wym_area_main'>"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"</div><div class='wym_area_bottom'>"+WYMeditor.LOGO+"</div></div>",logoHtml:String()+'<a class="wym_wymeditor_link" href="http://www.wymeditor.org/">WYMeditor</a>',iframeHtml:String()+'<div class="wym_iframe wym_section"><iframe src="'+WYMeditor.IFRAME_BASE_PATH+'wymiframe.html"></iframe></div>',toolsHtml:String()+'<div class="wym_tools wym_section"><h2>{Tools}</h2><ul>'+WYMeditor.TOOLS_ITEMS+"</ul></div>",toolsItemHtml:String()+'<li class="'+WYMeditor.TOOL_CLASS+'"><a href="#" name="'+WYMeditor.TOOL_NAME+'" title="'+WYMeditor.TOOL_TITLE+'">'+WYMeditor.TOOL_TITLE+"</a></li>",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link wym_opens_dialog"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image wym_opens_dialog"},{name:"InsertTable",title:"Table",css:"wym_tools_table wym_opens_dialog"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste wym_opens_dialog"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview wym_opens_dialog"}],containersHtml:String()+'<div class="wym_containers wym_section"><h2>{Containers}</h2><ul>'+WYMeditor.CONTAINERS_ITEMS+"</ul></div>",containersItemHtml:String()+'<li class="'+WYMeditor.CONTAINER_CLASS+'"><a href="#" name="'+WYMeditor.CONTAINER_NAME+'">'+WYMeditor.CONTAINER_TITLE+"</a></li>",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:String()+'<div class="wym_classes wym_section"><h2>{Classes}</h2><ul>'+WYMeditor.CLASSES_ITEMS+"</ul></div>",classesItemHtml:String()+'<li class="wym_classes_'+WYMeditor.CLASS_NAME+'"><a href="#" name="'+WYMeditor.CLASS_NAME+'">'+WYMeditor.CLASS_TITLE+"</a></li>",classesItems:[],statusHtml:String()+'<div class="wym_status wym_section"><h2>{Status}</h2></div>',htmlHtml:String()+'<div class="wym_html wym_section"><h2>{Source_Code}</h2><textarea class="wym_html_val"></textarea></div>',boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",updateSelector:".wymupdate",updateEvent:"click",stringDelimiterLeft:"{",stringDelimiterRight:"}",preInit:null,preBind:null,postInit:null},a),a=jQuery.extend(WYMeditor.DEFAULT_DIALOG_OPTIONS,a),b.each(function(){var b=this;b._wym=new WYMeditor.editor(jQuery(b),a)})},jQuery.extend({wymeditors:function(a){return WYMeditor.INSTANCES[a]}}),jQuery.extend({getWymeditorByTextarea:function(a){var b;if(!a||!a.tagName||"textarea"!==a.tagName.toLowerCase())throw"jQuery.getWymeditorByTextarea requires a textarea element.";for(b=0;b<WYMeditor.INSTANCES.length;b++)if(a===WYMeditor.INSTANCES[b].element[0])return WYMeditor.INSTANCES[b];return!1}}),jQuery.extend({copyPropsFromObjectToObject:function(a,b,c){var d,e,f,g={};for(d=0;d<c.length;d++)e=c[d],f=a[e],g[e]=f;jQuery.extend(b,g)}}),WYMeditor.isInternetExplorerPre11=function(){return jQuery.browser.msie&&jQuery.browser.versionNumber<11?!0:!1},WYMeditor.isInternetExplorer11OrNewer=function(){return jQuery.browser.msie&&jQuery.browser.versionNumber>=11?!0:!1},WYMeditor._computeWymPath=function(){var a=jQuery(jQuery.grep(jQuery("script"),function(a){return a.src?a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/)||a.src.match(/\/core\.js(\?.*)?$/):null}));return a.length>0?a.attr("src"):(WYMeditor.console.warn("Error determining wymPath. No base WYMeditor file located."),WYMeditor.console.warn("Assuming wymPath to be the current URL"),WYMeditor.console.warn("Please pass a correct wymPath option"),"")},WYMeditor._computeBasePath=function(a){var b=a.lastIndexOf("/");return a.substr(0,b+1)},jQuery.fn.isPhantomNode=function(){var a=this;return a[0].nodeType===WYMeditor.NODE_TYPE.TEXT?!/[^\t\n\r ]/.test(a[0].data):!1},jQuery.fn.nextContentsUntil=function(a,b){var c,d=this,e=[],f=d.get(0);if(a=a?a:"",b=b?b:"",!f)return jQuery();for(f=f.nextSibling;f&&!jQuery(f).is(a);)e.push(f),f=f.nextSibling;return c=jQuery(e),b?c.filter(b):c},jQuery.fn.nextAllContents=function(){var a=this;return jQuery(a).nextContentsUntil("","")},jQuery.fn.prevContentsUntil=function(a,b){var c,d=this,e=[],f=d.get(0);if(a=a?a:"",b=b?b:"",!f)return jQuery();for(f=f.previousSibling;f&&!jQuery(f).is(a);)e.push(f),f=f.previousSibling;return c=jQuery(e),b?c.filter(b):c},jQuery.fn.prevAllContents=function(){var a=this;return jQuery(a).prevContentsUntil("","")},WYMeditor.isPhantomNode=function(a){return a.nodeType===WYMeditor.NODE_TYPE.TEXT?!/[^\t\n\r ]/.test(a.data):!1},WYMeditor.isPhantomString=function(a){return!/[^\t\n\r ]/.test(a)},jQuery.fn.addBack=jQuery.fn.addBack?jQuery.fn.addBack:jQuery.fn.andSelf,jQuery.fn.parentsOrSelf=function(a){var b=this;return a?b.parents().addBack().filter(a):b.parents().addBack()},WYMeditor.Helper={replaceAllInStr:function(a,b,c){var d=new RegExp(b,"g");return a.replace(d,c)},insertAt:function(a,b,c){return a.substr(0,c)+b+a.substring(c)},trim:function(a){return a.replace(/^(\s*)|(\s*)$/gm,"")},arrayContains:function(a,b){var c;for(c=0;c<a.length;c+=1)if(a[c]===b)return!0;return!1},indexOf:function(a,b){var c,d=-1;for(c=0;c<a.length;c+=1)if(a[c]===b){d=c;break}return d},_getFromArrayByName:function(a,b){var c,d;for(c=0;c<a.length;c+=1)if(d=a[c],d.name===b)return d;return null},getAllEventTypes:function(a){var b=[];for(var c in a)0===c.indexOf("on")&&"onmousemove"!==c&&b.push(c.slice(2));return b.join(" ")}},WYMeditor._getWymClassForBrowser=function(){switch(jQuery.browser.name){case"msie":return WYMeditor.isInternetExplorerPre11()?WYMeditor.WymClassTridentPre7:WYMeditor.isInternetExplorer11OrNewer()?WYMeditor.WymClassTrident7:!1;case"mozilla":return WYMeditor.WymClassGecko;case"chrome":return WYMeditor.WymClassBlink;case"safari":return WYMeditor.WymClassSafari}return jQuery.browser.webkit?WYMeditor.WymClassWebKit:(WYMeditor.console.warn("WYMeditor could not instantiate: this browser is not supported"),!1)},WYMeditor.editor.prototype._openPopupWindow=function(a){var b,c=this,d=c._options.basePath;return b=window.open(jQuery.browser.msie?d+"popup.html":"","wymPopupWindow",a)},WYMeditor.editor.prototype.dialog=function(a,b,c){var d,e,f,g,h,i,j,k,l=this,m=WYMeditor.DIALOGS,n=l._options;if(jQuery.isPlainObject(a)?e=a:"string"==typeof a&&m.hasOwnProperty(a)&&(WYMeditor.console.warn("DEPRECATION WARNING: `dialog` method received a string dialog name. Please provide a dialog object instead."),e=m[a]),jQuery.isPlainObject(e)!==!0&&"string"!=typeof c)throw"`dialog` method: No dialog provided";if(e&&(e.hasOwnProperty("title")!==!0||e.hasOwnProperty("shouldOpen")!==!0||e.hasOwnProperty("getBodyHtml")!==!0))throw"Expected the dialog object to contain at least `title`, `shouldOpen` and `getbodyHtml`";if(e&&e.shouldOpen.call(l)!==!0)return!1;if(f=b?b:e&&e.getWindowFeatures?e.getWindowFeatures.call(l):n.dialogFeatures?n.dialogFeatures:["menubar=no","titlebar=no","toolbar=no","resizable=no","width=560","height=300","top=0","left=0"].join(","),g=l._openPopupWindow(f),"object"!=typeof g||g.window!==g)return WYMeditor.console.warn("Could not create a dialog window"),!1;for(g.focus(),i=n.dialogHtml||String()+'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html dir="'+WYMeditor.DIRECTION+'"><head><title>'+WYMeditor.DIALOG_TITLE+"</title></head>"+WYMeditor.DIALOG_BODY+"</html>",h=[{placeholder:WYMeditor.DIRECTION,replacement:n.direction},{placeholder:WYMeditor.DIALOG_TITLE,replacement:e?l._encloseString(e.title):"Dialog"},{placeholder:WYMeditor.DIALOG_BODY,replacement:c||e.getBodyHtml.call(l)}],d=0;d<h.length;d++)i=WYMeditor.Helper.replaceAllInStr(i,h[d].placeholder,h[d].replacement);return i=l.replaceStrings(i),j=g.document,j.write(i),e&&e.getBodyClass&&jQuery(j.body).addClass(e.getBodyClass.call(l)),j.close(),k=l.selectedContainer(),g.onbeforeunload=function(){l.focusOnDocument()},jQuery.isFunction(n.preInitDialog)&&n.preInitDialog(l,g),e&&e.initialize&&e.initialize.call(l,g),e&&e.submitHandler&&jQuery("form",j).submit(function(){e.submitHandler.call(l,g)}),jQuery(n.cancelSelector,j).click(function(){g.close()}),jQuery.isFunction(n.postInitDialog)&&n.postInitDialog(l,g),g},WYMeditor.DIALOGS={CreateLink:{title:"Link",shouldOpen:function(){var a,b=this;return b.hasSelection()!==!0?!1:(a=b.selectedContainer(),a===!1?!1:b.selection().isCollapsed&&"a"!==a.tagName.toLowerCase()?!1:!0)},getBodyHtml:function(){var a=this;return a._options.dialogLinkHtml||String()+'<form><fieldset><input type="hidden" class="wym_dialog_type" value="'+WYMeditor.DIALOG_LINK+'" /><legend>{Link}</legend><div class="row"><label>{URL}</label><input type="text" class="wym_href" value="" size="40" autofocus="autofocus" /></div><div class="row"><label>{Title}</label><input type="text" class="wym_title" value="" size="40" /></div><div class="row"><label>{Relationship}</label><input type="text" class="wym_rel" value="" size="40" /></div><div class="row row-indent"><input class="wym_submit" type="submit" value="{Submit}" /><input class="wym_cancel" type="button" value="{Cancel}" /></div></fieldset></form>'},getBodyClass:function(){var a=this;return a._options.dialogSelectorLink||"wym_dialog_link"},initialize:function(a){var b,c,d,e,f,g,h=this,i=a.document,j=h._options,k=h.selectedContainer();k&&(b=jQuery(j.hrefSelector,i),c=jQuery(j.titleSelector,i),d=jQuery(j.relSelector,i),e=jQuery(k).attr(WYMeditor.HREF),f=jQuery(k).attr(WYMeditor.TITLE),g=jQuery(k).attr(WYMeditor.REL),b.val(e),c.val(f),d.val(g))},submitHandler:function(a){var b=this,c=b._options,d=jQuery(c.hrefSelector,a.document).val(),e=jQuery(c.titleSelector,a.document).val(),f=jQuery(c.relSelector,a.document).val();b.link({href:d,title:e,rel:f}),a.close()}},InsertImage:{title:"Image",shouldOpen:function(){var a=this,b=a.getSelectedImage();return b&&b.tagName&&"img"===b.tagName.toLowerCase()?!0:a.hasSelection()},getBodyHtml:function(){var a=this;return a._options.dialogImageHtml||String()+'<form><fieldset><input type="hidden" class="wym_dialog_type" value="'+WYMeditor.DIALOG_IMAGE+'" /><legend>{Image}</legend><div class="row"><label>{URL}</label><input type="text" class="wym_src" value="" size="40" autofocus="autofocus" /></div><div class="row"><label>{Alternative_Text}</label><input type="text" class="wym_alt" value="" size="40" /></div><div class="row"><label>{Title}</label><input type="text" class="wym_title" value="" size="40" /></div><div class="row row-indent"><input class="wym_submit" type="submit" value="{Submit}" /><input class="wym_cancel" type="button" value="{Cancel}" /></div></fieldset></form>'},getBodyClass:function(){var a=this;return a._options.dialogImageSelector||"wym_dialog_image"},initialize:function(a){var b,c,d,e,f,g,h=this,i=a.document,j=h._options,k=h.getSelectedImage();k&&(b=jQuery(j.srcSelector,i),c=jQuery(j.titleSelector,i),d=jQuery(j.altSelector,i),e=jQuery(k).attr(WYMeditor.SRC),f=jQuery(k).attr(WYMeditor.TITLE),g=jQuery(k).attr(WYMeditor.ALT),b.val(e),c.val(f),d.val(g))},submitHandler:function(a){var b,c=this,d=c._options,e=c.getSelectedImage();b={src:jQuery(d.srcSelector,a.document).val(),title:jQuery(d.titleSelector,a.document).val(),alt:jQuery(d.altSelector,a.document).val()},c.focusOnDocument(),e?(c._updateImageAttrs(e,b),c.registerModification()):c.insertImage(b),a.close()}},InsertTable:{title:"Table",shouldOpen:function(){var a=this;return a.hasSelection()!==!0||a.selection().isCollapsed!==!0?!1:!0},getBodyHtml:function(){var a=this;return a._options.dialogTableHtml||String()+'<form><fieldset><input type="hidden" class="wym_dialog_type" value="'+WYMeditor.DIALOG_TABLE+'" /><legend>{Table}</legend><div class="row"><label>{Caption}</label><input type="text" class="wym_caption" value="" size="40" /></div><div class="row"><label>{Summary}</label><input type="text" class="wym_summary" value="" size="40" /></div><div class="row"><label>{Number_Of_Rows}</label><input type="text" class="wym_rows" value="3" size="3" /></div><div class="row"><label>{Number_Of_Cols}</label><input type="text" class="wym_cols" value="2" size="3" /></div><div class="row row-indent"><input class="wym_submit" type="submit" value="{Submit}" /><input class="wym_cancel" type="button" value="{Cancel}" /></div></fieldset></form>'},getBodyClass:function(){var a=this;return a._options.dialogTableSelector||"wym_dialog_table"},submitHandler:function(a){var b=this,c=b._options,d=a.document,e=jQuery(c.rowsSelector,d).val(),f=jQuery(c.colsSelector,d).val(),g=jQuery(c.captionSelector,d).val(),h=jQuery(c.summarySelector,d).val();b.insertTable(e,f,g,h),a.close()}},Paste:{title:"Paste_From_Word",shouldOpen:function(){var a=this;return a.hasSelection()},getBodyHtml:function(){var a=this;return a._options.dialogPasteHtml||String()+'<form><input type="hidden" class="wym_dialog_type" value="'+WYMeditor.DIALOG_PASTE+'" /><fieldset><legend>{Paste_From_Word}</legend><div class="row"><textarea class="wym_text" rows="10" cols="50" autofocus="autofocus"></textarea></div><div class="row"><input class="wym_submit" type="submit" value="{Submit}" /><input class="wym_cancel" type="button" value="{Cancel}" /></div></fieldset></form>'},getBodyClass:function(){var a=this;return a._options.dialogPasteSelector||"wym_dialog_paste"},submitHandler:function(a){var b,c=this;b=jQuery(c._options.textSelector,a.document).val(),c.paste(b),a.close()}},Preview:{title:"Preview",shouldOpen:function(){return!0},getBodyHtml:function(){var a=this;return a._options.dialogPreviewHtml||a.html()},getWindowFeatures:function(){return["menubar=no","titlebar=no","toolbar=no","resizable=no","width=560","height=300","top=0","left=0","scrollbars=yes"].join(",")},getBodyClass:function(){var a=this;return a._options.dialogPreviewSelector||"wym_dialog_preview"}}},WYMeditor.DIALOG_TITLE="{Wym_Dialog_Title}",WYMeditor.DIALOG_BODY="{Wym_Dialog_Body}",WYMeditor.DIALOG_BUTTON_SELECTOR=".wym_opens_dialog a",WYMeditor.DEFAULT_DIALOG_OPTIONS={hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",relSelector:".wym_rel",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:"form",cancelSelector:".wym_cancel",previewSelector:"",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview"},WYMeditor.editor.prototype._init=function(){var wym=this,WymClass,browserInstance,SaxListener,prop,h,iframeHtml,boxHtml,aTools,sTools,oTool,sTool,i,aClasses,sClasses,oClass,sClass,aContainers,sContainers,sContainer,oContainer;if(WymClass=WYMeditor._getWymClassForBrowser()){browserInstance=new WymClass(wym),jQuery.isFunction(wym._options.preInit)&&wym._options.preInit(wym),wym.parser=null,wym.helper=null,SaxListener=new WYMeditor.XhtmlSaxListener,wym.parser=new WYMeditor.XhtmlParser(SaxListener),wym.helper=new WYMeditor.XmlHelper;for(prop in browserInstance)wym[prop]=browserInstance[prop];for(wym._box=jQuery(wym.element).hide().after(wym._options.boxHtml).next().addClass("wym_box_"+wym._index),jQuery.isFunction(jQuery.fn.data)&&(jQuery.data(wym._box.get(0),WYMeditor.WYM_INDEX,wym._index),jQuery.data(wym.element.get(0),WYMeditor.WYM_INDEX,wym._index)),h=WYMeditor.Helper,iframeHtml=wym._options.iframeHtml,iframeHtml=h.replaceAllInStr(iframeHtml,WYMeditor.IFRAME_BASE_PATH,wym._options.iframeBasePath),boxHtml=jQuery(wym._box).html(),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.LOGO,wym._options.logoHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.TOOLS,wym._options.toolsHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.CONTAINERS,wym._options.containersHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.CLASSES,wym._options.classesHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.HTML,wym._options.htmlHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.IFRAME,iframeHtml),boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.STATUS,wym._options.statusHtml),aTools=eval(wym._options.toolsItems),sTools="",i=0;i<aTools.length;i+=1)oTool=aTools[i],sTool="",oTool.name&&oTool.title&&(sTool=wym._options.toolsItemHtml),sTool=h.replaceAllInStr(sTool,WYMeditor.TOOL_NAME,oTool.name),sTool=h.replaceAllInStr(sTool,WYMeditor.TOOL_TITLE,wym._options.stringDelimiterLeft+oTool.title+wym._options.stringDelimiterRight),sTool=h.replaceAllInStr(sTool,WYMeditor.TOOL_CLASS,oTool.css),sTools+=sTool;for(boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.TOOLS_ITEMS,sTools),aClasses=eval(wym._options.classesItems),sClasses="",i=0;i<aClasses.length;i+=1)oClass=aClasses[i],sClass="",oClass.name&&oClass.title&&(sClass=wym._options.classesItemHtml),sClass=h.replaceAllInStr(sClass,WYMeditor.CLASS_NAME,oClass.name),sClass=h.replaceAllInStr(sClass,WYMeditor.CLASS_TITLE,oClass.title),sClasses+=sClass;for(boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.CLASSES_ITEMS,sClasses),aContainers=eval(wym._options.containersItems),sContainers="",i=0;i<aContainers.length;i+=1)oContainer=aContainers[i],sContainer="",oContainer.name&&oContainer.title&&(sContainer=wym._options.containersItemHtml),sContainer=h.replaceAllInStr(sContainer,WYMeditor.CONTAINER_NAME,oContainer.name),sContainer=h.replaceAllInStr(sContainer,WYMeditor.CONTAINER_TITLE,wym._options.stringDelimiterLeft+oContainer.title+wym._options.stringDelimiterRight),sContainer=h.replaceAllInStr(sContainer,WYMeditor.CONTAINER_CLASS,oContainer.css),sContainers+=sContainer;boxHtml=h.replaceAllInStr(boxHtml,WYMeditor.CONTAINERS_ITEMS,sContainers),boxHtml=wym.replaceStrings(boxHtml),jQuery(wym._box).html(boxHtml),jQuery(wym._box).find(wym._options.htmlSelector).hide(),wym.documentStructureManager=new WYMeditor.DocumentStructureManager(wym,wym._options.structureRules.defaultRootContainer),wym.iframeInitialized=!1,wym._iframe=jQuery(wym._box).find("iframe")[0],jQuery(wym._iframe).load(function(){wym._onEditorIframeLoad(wym)}),wym.element.attr("data-wym-initialized","yes"),wym._initSkin()}},WYMeditor.editor.prototype._assignWymDoc=function(){var a=this;a._doc=a._iframe.contentDocument},WYMeditor.editor.prototype._isDesignModeOn=function(){var a=this;return"string"==typeof a._doc.designMode&&"on"===a._doc.designMode.toLowerCase()?!0:!1},WYMeditor.editor.prototype._onEditorIframeLoad=function(a){a._assignWymDoc(),a._enableDesignModeOnDocument(),a._afterDesignModeOn()},WYMeditor.editor.prototype.get$Buttons=function(){var a,b,c=this;return a=[c._options.toolSelector,c._options.containerSelector,c._options.classSelector].join(", "),b=jQuery(c._box).find(a)},WYMeditor.editor.prototype.focusOnDocument=function(){var a=this,b=a._iframe.contentWindow;b.focus()},WYMeditor.editor.prototype.registerModification=function(a){var b=this;b.undoRedo._add(),a||b.nativeEditRegistration.edited.reset(),jQuery(b.element).trigger(WYMeditor.EVENTS.postModification)},WYMeditor.editor.prototype._bindFocusOnDocumentToButtons=function(){var a=this,b=a.get$Buttons();b=b.parent().not(".wym_opens_dialog").children("a"),b.click(function(){a.focusOnDocument()})},WYMeditor.editor.prototype._uiQuirks=function(){},WYMeditor.editor.prototype._afterDesignModeOn=function(){var a=this;a.iframeInitialized!==!0&&(a._assignWymDoc(),a.$body().addClass("wym_iframe combokeys"),a._doc.title=a._index,jQuery("html",a._doc).attr("dir",a._options.direction),a.keyboard=new WYMeditor.Keyboard(a),a.keyboard._attachDefaultKeyboardShortcuts(),a._docEventQuirks(),a._initializeDocumentContent(),jQuery.isFunction(a._options.preBind)&&a._options.preBind(a),a._bindUIEvents(),a.iframeInitialized=!0,jQuery.isFunction(a._options.postInit)&&a._options.postInit(a),a._bindFocusOnDocumentToButtons(),a._uiQuirks(),a._listen(),a.undoRedo=new WYMeditor.UndoRedo(a),a.nativeEditRegistration=new WYMeditor.NativeEditRegistration(a),a.ih=new WYMeditor.ImageHandler(a),jQuery(a.element).trigger(WYMeditor.EVENTS.postIframeInitialization,a))},WYMeditor.editor.prototype._initializeDocumentContent=function(){var a=this;a._options.html?a.html(a._options.html):a.html(a.element[0].value)},WYMeditor.editor.prototype._docEventQuirks=function(){},WYMeditor.editor.prototype._bindUIEvents=function(){var wym=this,$toolbarButtons=jQuery(wym._box).find(wym._options.toolSelector),dialogButtonSelector=WYMeditor.DIALOG_BUTTON_SELECTOR,$html_val;$toolbarButtons.not(dialogButtonSelector).click(function(){var a=this;return wym.exec(jQuery(a).attr(WYMeditor.NAME)),!1}),$toolbarButtons.filter(dialogButtonSelector).click(function(){var a=this,b=jQuery(a).attr(WYMeditor.NAME),c=WYMeditor.DIALOGS[b];return wym.dialog(c),!1}),jQuery(wym._box).find(wym._options.containerSelector).click(function(){var a=this;return wym.setRootContainer(jQuery(a).attr(WYMeditor.NAME)),!1}),$html_val=jQuery(wym._box).find(wym._options.htmlValSelector),$html_val.keyup(function(){var a=this;wym.$body().html(jQuery(a).val())}),$html_val.focus(function(){var a=this;jQuery(a).toggleClass("hasfocus")}),$html_val.blur(function(){var a=this;jQuery(a).toggleClass("hasfocus")}),jQuery(wym._box).find(wym._options.classSelector).click(function(){var classButton=this,aClasses=eval(wym._options.classesItems),sName=jQuery(classButton).attr(WYMeditor.NAME),oClass=WYMeditor.Helper._getFromArrayByName(aClasses,sName),jqexpr;return oClass&&(jqexpr=oClass.expr,wym.toggleClass(sName,jqexpr)),!1}),jQuery(wym._options.updateSelector).bind(wym._options.updateEvent,function(){wym.update()}),wym.$body().bind("focus",function(){wym._isDesignModeOn()!==!0&&wym._enableDesignModeOnDocument()})},WYMeditor.editor.prototype._enableDesignModeOnDocument=function(){var a=this;if(a._isDesignModeOn())throw"Expected `designMode` to be off.";try{a._doc.designMode="On"}catch(b){}"function"==typeof a._designModeQuirks&&a._designModeQuirks()},WYMeditor.editor.prototype.get$WymBox=function(){var a=this;return a._box},WYMeditor.editor.prototype.vanish=function(){var a,b=this,c=WYMeditor.INSTANCES;for(b._box.remove(),b.element.removeAttr("data-wym-initialized").attr("data-wym-vanished","").show(),c.splice(b._index,1),a=0;a<c.length;a++)c[a]._index=a},WYMeditor.editor.prototype._exec=function(a,b){var c,d=this;if("string"!=typeof a)throw"`_exec` expected a String `cmd`";if(b&&"string"!=typeof b)throw"`_exec` expected a String `param`";return d.selectedContainer()===d.body()&&a!==WYMeditor.EXEC_COMMANDS.INSERT_IMAGE&&a!==WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK?!1:(d._doc.execCommand(a,!1,b),c=jQuery(d.selectedContainer()).filter("span").not("[id]"),0===c.length?!0:((""===c.attr("class")&&"font-weight: normal;"===c.attr("style")||"apple-style-span"===c.attr("class").toLowerCase())&&c.contents().unwrap(),!0))},WYMeditor.editor.prototype.rawHtml=function(a){var b=this;return"string"!=typeof a?b.$body().html():(b.$body().html(a),void b.update())},WYMeditor.editor.prototype.html=function(a){var b=this;return"string"!=typeof a?b.parser.parse(b.rawHtml()):(b.rawHtml(b.parser.parse(a)),void b.prepareDocForEditing())},WYMeditor.editor.prototype.exec=function(a){var b,c=this;switch(a){case WYMeditor.EXEC_COMMANDS.TOGGLE_HTML:c.update(),c.toggleHtml();break;case WYMeditor.EXEC_COMMANDS.INSERT_ORDEREDLIST:c._insertOrderedList();break;case WYMeditor.EXEC_COMMANDS.INSERT_UNORDEREDLIST:c._insertUnorderedList();break;case WYMeditor.EXEC_COMMANDS.INDENT:c.indent();break;case WYMeditor.EXEC_COMMANDS.OUTDENT:c.outdent();break;case WYMeditor.EXEC_COMMANDS.UNDO:c.undoRedo.undo();break;case WYMeditor.EXEC_COMMANDS.REDO:c.undoRedo.redo();break;default:b=!1,jQuery.each(c._options.customCommands,function(){var d=this;return a===d.name?(b=!0,d.run.apply(c),!1):void 0}),b||c._exec(a)===!0&&c.registerModification()}},WYMeditor.editor.prototype.selection=function(){
+var a,b=this,c=b._iframe;return window.rangy&&!rangy.initialized&&rangy.init(),a=rangy.getIframeSelection(c)},WYMeditor.editor.prototype.nodeAfterSel=function(){var a=this,b=a.selection();if(b.anchorNode.tagName&&-1===jQuery.inArray(b.anchorNode.tagName.toLowerCase(),WYMeditor.NON_CONTAINING_ELEMENTS)){if(0===b.anchorNode.childNodes.length)return;return b.anchorNode.childNodes[b.anchorOffset]}if(b.focusNode.nodeType===WYMeditor.NODE_TYPE.TEXT&&b.focusNode.data.length===b.focusOffset){if(!b.focusNode.nextSibling)return;return b.focusNode.nextSibling}return b.focusNode},WYMeditor.editor.prototype.get$CommonParent=function(a,b){if("object"!=typeof a||"number"!=typeof a.nodeType||"object"!=typeof b||"number"!=typeof b.nodeType)throw"`one` and `two` must be DOM nodes.";if(a.nodeType===WYMeditor.NODE_TYPE.TEXT&&(a=a.parentNode),b.nodeType===WYMeditor.NODE_TYPE.TEXT&&(b=b.parentNode),a===b)return jQuery(a);var c,d=jQuery(a),e=jQuery(b);if(c=d.parents().addBack().has(e).last(),0===c.length)throw"Couldn't find common parent. This shouldn't happen.";return c},WYMeditor.editor.prototype.selectedContainer=function(){var a,b,c,d,e=this;return e.hasSelection()!==!0?!1:(a=e.selection(),b=jQuery(a.anchorNode),c=jQuery(a.focusNode),b[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&(b=b.parent()),c[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&(c=c.parent()),b[0]===c[0]?b[0]:(d=b.has(c),0===d.length&&(d=c.has(b)),0===d.length?!1:d[0]))},WYMeditor.editor.prototype.selected=function(){var a=this;return WYMeditor.console.warn("The function WYMeditor.editor.selected() is deprecated. Use WYMeditor.editor.selectedContainer"),a.selectedContainer()},WYMeditor.editor.prototype.isBlockNode=function(a){return a.tagName&&jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.BLOCKS)>-1?!0:!1},WYMeditor.editor.prototype.isInlineNode=function(a){return a.nodeType===WYMeditor.NODE_TYPE.TEXT||jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.INLINE_ELEMENTS)>-1?!0:!1},WYMeditor.editor.prototype.isListNode=function(a){return a.tagName&&jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.LIST_TYPE_ELEMENTS)>-1?!0:!1},WYMeditor.editor.prototype.unwrapIfMeaninglessSpan=function(a){var b,c=jQuery(a),d=0,e=["_wym_visited","length","ie8_length"];if(!a||"undefined"==typeof a.tagName||"span"!==a.tagName.toLowerCase())return!1;for(;d<a.attributes.length;){if(b=a.attributes[d].nodeName,-1===jQuery.inArray(b,e))return!1;d++}return c.before(c.contents()),c.remove(),!0},WYMeditor.editor.prototype.getRootContainer=function(){var a=this;return jQuery(a.selectedContainer()).parentsOrSelf().not("html, body, blockquote").last()[0]},WYMeditor.editor.prototype.setRootContainer=function(a){var b,c,d,e,f,g,h,i=this,j=null;if(a.toLowerCase()===WYMeditor.TH){switch(j=i.selectedContainer(),j.tagName.toLowerCase()){case WYMeditor.TD:case WYMeditor.TH:break;default:b=[WYMeditor.TD,WYMeditor.TH],j=i.findUp(i.selectedContainer(),b)}null!==j&&(a=WYMeditor.TD,j.tagName.toLowerCase()===WYMeditor.TD&&(a=WYMeditor.TH),i.restoreSelectionAfterManipulation(function(){return i.switchTo(j,a,!1),!0}),i.update(),i.registerModification())}else if(b=[WYMeditor.P,WYMeditor.DIV,WYMeditor.H1,WYMeditor.H2,WYMeditor.H3,WYMeditor.H4,WYMeditor.H5,WYMeditor.H6,WYMeditor.PRE,WYMeditor.BLOCKQUOTE],j=i.findUp(i.selectedContainer(),b)){if(a.toLowerCase()===WYMeditor.BLOCKQUOTE)if(d=i.findUp(i.selectedContainer(),WYMeditor.BLOCKQUOTE),null===d)c=i._doc.createElement(a),j.parentNode.insertBefore(c,j),c.appendChild(j),i.setCaretIn(c.firstChild);else{for(e=d.childNodes,f=e.length,f>0&&(g=e.item(0)),h=0;f>h;h+=1)d.parentNode.insertBefore(e.item(0),d);d.parentNode.removeChild(d),g&&i.setCaretIn(g)}else i.restoreSelectionAfterManipulation(function(){return i.switchTo(j,a,!1),!0});i.update(),i.registerModification()}return!1},WYMeditor.editor.prototype.isForbiddenRootContainer=function(a){return jQuery.inArray(a.toLowerCase(),WYMeditor.FORBIDDEN_ROOT_CONTAINERS)>-1},WYMeditor.editor.prototype.keyCanCreateBlockElement=function(a){return jQuery.inArray(a,WYMeditor.POTENTIAL_BLOCK_ELEMENT_CREATION_KEYS)>-1},WYMeditor.editor.prototype.toggleClass=function(a,b){var c,d=this;c=jQuery(d.getSelectedImage()),1!==c.length&&(c=jQuery(d.selectedContainer()).parentsOrSelf(b).last()),c.toggleClass(a),c.attr(WYMeditor.CLASS)||c.removeAttr(d._class),d.registerModification()},WYMeditor.editor.prototype.getSelectedImage=function(){var a,b,c=this;return c.hasSelection()!==!0?!1:c.selection().isCollapsed!==!1?!1:(a=c._getSelectedNodes(),1!==a.length?!1:(b=a[0],b.tagName&&"img"===b.tagName.toLowerCase()?b:!1))},WYMeditor.editor.prototype.findUp=function(a,b){if("undefined"==typeof a||null===a)return null;"#text"===a.nodeName&&(a=a.parentNode);var c,d,e=a.tagName.toLowerCase();if(typeof b===WYMeditor.STRING)for(;e!==b&&e!==WYMeditor.BODY;)a=a.parentNode,e=a.tagName.toLowerCase();else for(c=!1;!c&&e!==WYMeditor.BODY;){for(d=0;d<b.length;d+=1)if(e===b[d]){c=!0;break}if(!c){if(a=a.parentNode,null===a)return null;e=a.tagName.toLowerCase()}}return e===WYMeditor.BODY?null:a},WYMeditor.editor.prototype.switchTo=function(a,b,c){var d,e,f=this,g=jQuery(a),h=a.attributes;if(!a.tagName)throw"This must be an element.";if("img"===a.tagName.toLowerCase())throw"Will not change the type of an 'img' element.";if(d=f._doc.createElement(b),jQuery(d).append(a.childNodes),g.replaceWith(d),!c)for(e=0;e<h.length;++e)d.setAttribute(h.item(e).nodeName,h.item(e).value);return d},WYMeditor.editor.prototype.replaceStrings=function(a){var b,c=this;if(!WYMeditor.STRINGS[c._options.lang])return WYMeditor.console.error("WYMeditor: language '"+c._options.lang+"' not found."),WYMeditor.console.error("Unable to perform i10n."),a;for(b in WYMeditor.STRINGS[c._options.lang])WYMeditor.STRINGS[c._options.lang].hasOwnProperty(b)&&(a=WYMeditor.Helper.replaceAllInStr(a,c._options.stringDelimiterLeft+b+c._options.stringDelimiterRight,WYMeditor.STRINGS[c._options.lang][b]));return a},WYMeditor.editor.prototype._encloseString=function(a){var b=this;return b._options.stringDelimiterLeft+a+b._options.stringDelimiterRight},WYMeditor.editor.prototype.getCurrentState=function(){var a,b=this,c={},d=b._iframe.contentWindow;return b.hasSelection()&&(a=b.selection()),a&&a.anchorNode===b.body()&&0===a.anchorOffset&&a.isCollapsed&&(a=!1),a&&(c.savedSelection=rangy.saveSelection(d)),c.html=b.rawHtml(),c.savedSelection&&(rangy.restoreSelection(c.savedSelection),c.savedSelection.restored=!1,delete c.savedSelection.win,delete c.savedSelection.doc),c},WYMeditor.editor.prototype.hasSelection=function(){var a=this;return rangy.isSelectionValid(a._iframe.contentWindow)!==!0?!1:0===a.selection().rangeCount?!1:!0},WYMeditor.editor.prototype._setSingleSelectionRange=function(a){var b,c=this;b=c.selection(),b.setSingleRange(a)},WYMeditor.editor.prototype.status=function(a){var b=this;jQuery(b._box).find(b._options.statusSelector).html(a)},WYMeditor.editor.prototype.update=function(){var a,b=this;a=b.html(),jQuery(b.element).val(a),jQuery(b._box).find(b._options.htmlValSelector).not(".hasfocus").val(a)},WYMeditor.editor.prototype.prepareDocForEditing=function(){var a,b=this;b._spaceBlockingElements(),b._fixDoubleBr(),a=b.$body(),0===a.children().length&&b.$body().append("<br />"),jQuery(b.element).trigger(WYMeditor.EVENTS.postBlockMaybeCreated,b)},WYMeditor.editor.prototype._spaceBlockingElements=function(){var a,b,c,d,e,f,g=this,h=WYMeditor.DocumentStructureManager.CONTAINERS_BLOCKING_NAVIGATION.join(", "),i=g.$body(),j=i.children();a=jQuery.browser.mozilla?'<br class="'+WYMeditor.BLOCKING_ELEMENT_SPACER_CLASS+" "+WYMeditor.EDITOR_ONLY_CLASS+'" _moz_editor_bogus_node="TRUE" _moz_dirty=""/>':'<br class="'+WYMeditor.BLOCKING_ELEMENT_SPACER_CLASS+" "+WYMeditor.EDITOR_ONLY_CLASS+'"/>',j.length>0&&(b=jQuery(j[0]),c=jQuery(j[j.length-1]),b.is(h)&&b.before(a),c.is(h)&&c.after(a)),d=g._getBlockSepSelector(),i.find(d).before(a),e=g._getBlockInListSepSelector(),f=i.find(e),f.each(function(){var b=this,c=jQuery(b);c.next(h).length||c.next("br").length||c.after(a)})},WYMeditor.editor.prototype._getBlockSepSelector=function(){var a,b=this,c=[],d=WYMeditor.DocumentStructureManager.CONTAINERS_BLOCKING_NAVIGATION;return"undefined"!=typeof b._blockSpacersSel?b._blockSpacersSel:(a=jQuery.grep(b.documentStructureManager.structureRules.validRootContainers,function(a){return-1===jQuery.inArray(a,d)}),jQuery.each(d,function(a,b){jQuery.each(d,function(a,d){c.push(b+" + "+d)})}),jQuery.each(d,function(b,d){jQuery.each(a,function(a,b){c.push(d+" + "+b),c.push(b+" + "+d)})}),b._blockSpacersSel=c.join(", "),b._blockSpacersSel)},WYMeditor.editor.prototype._getBlockInListSepSelector=function(){var a=this,b=[];return"undefined"!=typeof a._blockInListSpacersSel?a._blockInListSpacersSel:(jQuery.each(WYMeditor.LIST_TYPE_ELEMENTS,function(a,c){jQuery.each(WYMeditor.BLOCKING_ELEMENTS,function(a,d){b.push(c+" "+d)})}),a._blockInListSpacersSel=b.join(", "),a._blockInListSpacersSel)},WYMeditor.editor.prototype._fixDoubleBr=function(){var a,b=this,c=b.$body();c.children("br + br").filter(":not(pre br)").remove(),c.find("p + br").next("p").prev("br").remove(),a=c.find("p + br").slice(-1),a.length>0&&0===a.next().length&&a.remove()},WYMeditor.editor.prototype.link=function(a){var b,c,d,e=this;if(jQuery.isPlainObject(a)!==!0)throw"Expected a plain object.";a.hasOwnProperty("href")===!0&&"string"==typeof a.href&&0!==a.href.length&&(b=jQuery(e.selectedContainer()),b.is("a")?d=b:(c=e.uniqueStamp(),e._exec(WYMeditor.EXEC_COMMANDS.CREATE_LINK,c),d=jQuery("a[href="+c+"]",e.body())),0!==d.length&&(d.attr(a),e.registerModification()))},WYMeditor.editor.prototype.insertImage=function(a){var b,c,d=this;if(jQuery.isPlainObject(a)!==!0)throw"Expected a plain object.";a.hasOwnProperty("src")===!0&&"string"==typeof a.src&&0!==a.src.length&&(b=d.uniqueStamp(),d._exec(WYMeditor.EXEC_COMMANDS.INSERT_IMAGE,b),c=jQuery("img[src="+b+"]",d.body()),0!==c.length&&(c.attr(a),d.$body().find(".Apple-style-span").children().unwrap(),d.registerModification()))},WYMeditor.editor.prototype._updateImageAttrs=function(a,b){var c=jQuery(a);b.src!==c.attr("src")&&(c.data("DimensionsRatio",null),c.removeAttr("height").removeAttr("width")),c.attr(b)},WYMeditor.editor.prototype.toggleHtml=function(){var a=this;jQuery(a._box).find(a._options.htmlSelector).toggle()},WYMeditor.editor.prototype.uniqueStamp=function(){var a=new Date;return"wym"+a.getTime()},WYMeditor.editor.prototype._handleMultilineBlockContainerPaste=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p;for(f=jQuery(o),h="p",b.is("li")&&(h="li"),c.splitBoundaries(),o=a.findUp(c.startContainer,["p","h1","h2","h3","h4","h5","h6","li"]),p=o.tagName,i=[],j=[],jQuery(o).contents().each(function(a,b){k=c.compareNode(b),k===c.NODE_BEFORE||k===c.NODE_BEFORE_AND_AFTER&&c.startOffset===c.startContainer.length?i.push(b):j.push(b)}),e=0;e<i.length;e++)jQuery(i[e]).remove();for(e=0;e<j.length;e++)jQuery(j[e]).remove();for(i.length>0&&jQuery(o).prepend(i),j.length>0&&(l=jQuery("<"+p+"></"+p+">",a._doc),l.insertAfter(jQuery(o)),l.append(j)),m=d.splice(0,1)[0],n=m.split(WYMeditor.NEWLINE).join("<br />"),jQuery(o).html(jQuery(o).html()+n),f=jQuery(o),e=0;e<d.length;e++)g="<"+h+">"+d[e].split(WYMeditor.NEWLINE).join("<br />")+"</"+h+">",f=jQuery(g,a._doc).insertAfter(f)},WYMeditor.editor.prototype.paste=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.selectedContainer(),l=jQuery(k),m="",n=!1,o=j.selection(),p=o.getRangeAt(0);if(p.collapse(!0),b=a.split(new RegExp(WYMeditor.NEWLINE+"{2,}","g")),1===b.length&&(n=!0),"undefined"==typeof k||k&&k.tagName.toLowerCase()===WYMeditor.BODY)if(n)f=jQuery("<p>"+b[0]+"</p>",j._doc).appendTo(j._doc.body);else for(e="p",g=b.length-1;g>=0;g-=1)for(m="<"+e+">"+b[g].split(WYMeditor.NEWLINE).join("<br />")+"</"+e+">",i=jQuery(m,j._doc),c=i.length-1;c>=0;c--)p.insertNode(i[c]);else if(n||l.is("pre"))h=j._doc.createTextNode(a),p.insertNode(h);else if(l.is("p,h1,h2,h3,h4,h5,h6,li"))j._handleMultilineBlockContainerPaste(j,l,p,b);else for(d=a.split(WYMeditor.NEWLINE),g=d.length-1;g>=0;g-=1)h=j._doc.createTextNode(d[g]),p.insertNode(h),g>0&&p.insertNode(jQuery("<br />",j._doc).get(0));j.registerModification()},WYMeditor.editor.prototype.insert=function(a){var b,c,d=this,e=d.hasSelection()?d.selection():!1;e&&(b=e.getRangeAt(0),c=b.createContextualFragment(a),b.deleteContents(),b.insertNode(c))},WYMeditor.editor.prototype.canSetCaretBefore=function(a){var b=this;if(a.nodeType===WYMeditor.NODE_TYPE.TEXT)return!0;if(a.tagName&&"br"===a.tagName.toLowerCase()){if(!a.previousSibling)return!0;if(a.previousSibling.tagName&&"br"===a.previousSibling.tagName.toLowerCase())return!0;if(b.isBlockNode(a.previousSibling))return!0;if(a.previousSibling.nodeType===WYMeditor.NODE_TYPE.TEXT)return!0}return!1},WYMeditor.editor.prototype.setCaretBefore=function(a){var b=this,c=rangy.createRange(b._doc),d=b.selection();if(!b.canSetCaretBefore(a))throw"Can't set caret before this node.";c.selectNode(a),c.collapse(!0),d.setSingleRange(c)},WYMeditor.editor.prototype.canSetCaretIn=function(a){var b=this;if(a.nodeType===WYMeditor.NODE_TYPE.TEXT||a.tagName&&jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.NO_CARET_ELEMENTS)>-1)return!1;if(b.isInlineNode(a)){if(0===a.childNodes.length)return!1;WYMeditor.console.warn("Can set a non-collapsed selection. Rangy issue #209.")}return!0},WYMeditor.editor.prototype.setCaretIn=function(a){var b=this,c=rangy.createRange(b._doc),d=b.selection();if(!b.canSetCaretIn(a))throw"The element must be able to contain other elements. Perhaps you would like to use `setCaretBefore`, instead.";c.selectNodeContents(a),b.isInlineNode(a)?WYMeditor.console.warn("Can't set a collapsed selection. Setting a non-collapsed selection, instead. Rangy issue #209."):c.collapse(!0),d.setSingleRange(c)},WYMeditor.editor.prototype._splitListItemContents=function(a){var b,c,d,e=!1,f={itemContents:[],sublistContents:[]};for(b=a.contents(),c=0;c<b.length;c++)d=b.get(c),e||jQuery(d).is("ol,ul")?(e=!0,f.sublistContents.push(d)):f.itemContents.push(d);return f},WYMeditor.editor.prototype._joinAdjacentLists=function(a,b){var c;"undefined"!=typeof a&&"undefined"!=typeof b&&a.nextSibling===b&&a.tagName.toLowerCase()===b.tagName.toLowerCase()&&(c=jQuery(b).contents(),c.unwrap(),c.detach(),jQuery(a).append(c))},WYMeditor.editor.prototype._indentSingleItem=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n=this;b=jQuery(a),c=b.parent()[0].tagName.toLowerCase(),f=n._splitListItemContents(b),h=jQuery(f.sublistContents),g=jQuery(f.itemContents),i=b.prev().filter("li"),0===i.length&&(d='<li class="spacer_li"></li>',b.before(d),i=b.prev()),j=i.contents().last().filter("ol,ul"),j.length>0?(j.append(b),h.detach(),i.append(h),k=h.first(),n._joinAdjacentLists(j.get(0),k.get(0))):(h.length>0?(h.detach(),i.append(h),j=h.first()):(e="<"+c+"></"+c+">",i.append(e),j=i.contents().last()),j.prepend(b)),b.next().is(".spacer_li")&&(l=b.next(".spacer_li"),m=l.contents(),m.detach(),b.append(m),l.remove())},WYMeditor.editor.prototype._outdentSingleItem=function(a){var b,c,d,e,f,g,h,i,j,k,l,m=this;if(b=jQuery(a),c=b.parent()[0].tagName.toLowerCase(),b.parent().parent().is("ol,ul,li")){if(b.parent().parent().is("li")||(WYMeditor.console.log("Attempting to fix invalid list nesting before outdenting."),m._fixInvalidListNesting(a)),e=m._splitListItemContents(b),g=jQuery(e.sublistContents),f=jQuery(e.itemContents),h=b.parent().parent("li"),0===h.length)return void WYMeditor.console.error("Invalid list. No parentLi found, so aborting outdent");i=b.parent(),j=b.nextAllContents(),k=i.nextAllContents(),b.detach(),h.after(b),g.length>0&&(d="<"+c+'><li class="spacer_li"></li></'+c+">",b.append(d),l=b.children().last(),g.detach(),l.children("li").append(g)),j.length>0&&("undefined"==typeof l&&(d="<"+c+"></"+c+">",b.append(d),l=b.children().last()),j.detach(),l.append(j)),k.length>0&&(k.detach(),b.contents().length>0&&b.contents().last()[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&k[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&b.append("<br />"),b.append(k)),0===i.contents().length&&i.remove(),0===h.contents().length&&h.remove()}},WYMeditor.editor.prototype._fixInvalidListNesting=function(a,b){var c,d,e=this,f=a;if("undefined"==typeof b&&(b=!1),!f)return b;for(;f.parentNode&&(c=f.parentNode,c.nodeType===WYMeditor.NODE_TYPE.ELEMENT)&&(d=c.tagName.toLowerCase(),"ol"===d||"ul"===d||"li"===d);)f=c;return jQuery(f).is("li")?(WYMeditor.console.log("Correcting orphaned root li before correcting invalid list nesting."),e._correctOrphanedListItem(f),e._fixInvalidListNesting(f,!0)):jQuery(f).is("ol,ul")?e._fixInvalidlyNestedList(f,b):(WYMeditor.console.error("Can't correct invalid list nesting. No root list found"),b)},WYMeditor.editor.prototype._isPOrDivAfterEnterInEmptyNestedLi=function(a){if(jQuery.inArray(a.tagName.toLowerCase(),WYMeditor.DocumentStructureManager.VALID_DEFAULT_ROOT_CONTAINERS)>-1&&"li"===a.parentNode.tagName.toLowerCase())switch(a.childNodes.length){case 0:return!0;case 1:if(a.childNodes[0].tagName&&"br"===a.childNodes[0].tagName.toLowerCase())return!0;if(a.childNodes[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&a.childNodes[0].data===WYMeditor.NBSP)return!0}return!1},WYMeditor.editor.prototype._isSpilledListAfterEnterInEmptyLi=function(a){var b=this;return"li"===a.tagName.toLowerCase()&&a.previousSibling&&b.isListNode(a.previousSibling)&&a.previousSibling.previousSibling&&"li"===a.previousSibling.previousSibling.tagName.toLowerCase()&&b.isListNode(a.parentNode)?!0:!1},WYMeditor.editor.prototype._handlePotentialEnterInEmptyNestedLi=function(a,b){if(a!==WYMeditor.KEY_CODE.ENTER)return null;var c=this;c._isPOrDivAfterEnterInEmptyNestedLi(b)?c._replaceNodeWithBrAndSetCaret(b):c._isSpilledListAfterEnterInEmptyLi(b)&&(c._appendSiblingsUntilNextLiToPreviousLi(b),c._replaceNodeWithBrAndSetCaret(b))},WYMeditor.editor.prototype._replaceNodeWithBrAndSetCaret=function(a){var b=this,c=jQuery(a);(a.previousSibling&&!a.previousSibling.tagName||"br"!==a.previousSibling.tagName.toLowerCase()&&b.isInlineNode(a.previousSibling))&&c.before("<br />"),c.before("<br />"),b.setCaretBefore(a.previousSibling),c.remove()},WYMeditor.editor.prototype._appendSiblingsUntilNextLiToPreviousLi=function(a){var b,c=jQuery(a),d=c.parent().contents(),e=c.prevAll("li").first(),f=c.nextAll("li").first(),g=e.index()+1;b=1===f.length?d.slice(g,f.index()):d.slice(g),e.append(b)},WYMeditor.editor.prototype._correctOrphanedListItem=function(a){var b,c,d,e,f=jQuery();b=jQuery(a).prevContentsUntil(":not(li)"),c=jQuery(a).nextContentsUntil(":not(li)"),f=f.add(b),f=f.add(a),f=f.add(c),e=f[0].previousSibling,e&&jQuery(e).is("ol,ul")?d=e:(f.before("<ol></ol>"),d=f.prev()[0]),jQuery(d).append(f)},WYMeditor.editor.prototype._fixInvalidlyNestedList=function(a,b){var c,d,e,f,g,h,i=a,j=a,k=!1,l='<li class="spacer_li"></li>';for("undefined"!=typeof b&&(k=b);j;)if(j._wym_visited){if(j._wym_visited=!1,j===i)break;j=j.previousSibling?j.previousSibling:j.parentNode}else{if(j!==i&&!jQuery(j).is("li"))for(e=j;e.parentNode&&(e=e.parentNode,!jQuery(e).is("li"))&&e.nodeType===WYMeditor.NODE_TYPE.ELEMENT;)if(d=e.tagName.toLowerCase(),"ol"===d||"ul"===d){for(WYMeditor.console.log("Fixing orphaned list content"),k=!0,f=[j],c=j,g=null;c.previousSibling;){if(c=c.previousSibling,jQuery(c).is("li")){g=c;break}f.push(c)}f.reverse(),g||1!==f.length||jQuery(j.nextSibling).is("li")&&(g=j.nextSibling),g||(jQuery(f[0]).before(l),g=jQuery(f[0]).prev()[0]),h=jQuery(g).contents().last(),1===h.length&&h[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&f[0].nodeType===WYMeditor.NODE_TYPE.TEXT&&jQuery(g).append("<br />"),jQuery(g).append(jQuery(f));break}j.lastChild?(j._wym_visited=!0,j=j.lastChild):j=j.previousSibling?j.previousSibling:j.parentNode}return k},WYMeditor.editor.prototype._getCommonParentList=function(a,b){var c,d,e,f=!0;return a=jQuery(a).filter("li"),0===a.length?null:(c=a[0],d=jQuery(c).parents("ol,ul"),d=b?d.first():d.last(),0===d.length?null:(e=d[0],jQuery(a).each(function(a,c){d=jQuery(c).parents("ol,ul"),d=b?d.first():d.last(),(0===d.length||d[0]!==e)&&(f=!1)}),f?e:null))},WYMeditor.editor.prototype.deselect=function(){var a=this;a.selection().removeAllRanges(),a.body().blur()},WYMeditor.editor.prototype._getSelectedNodes=function(){var a,b=this,c=b.selection();return b.hasSelection()!==!0?!1:a=c.getAllRanges().reduce(function(a,b){return a.concat(b.getNodes())},[])},WYMeditor.editor.prototype._getSelectedListItems=function(a){var b,c,d,e=this;return a.isCollapsed?(b=jQuery(e.selectedContainer()),b.closest("li, table").is("table")?[]:b.closest("li")):(c=jQuery(e._getSelectedNodes()),0===c.closest("li, table").filter("li").length?[]:(d=c.not("li, ol, ul").add(c.find(".rangySelectionBoundary")).add(c.filter(function(){return e.nodeType===WYMeditor.NODE_TYPE.TEXT})).closest("li").add(c.filter("li:empty")).not(c.filter("table").find("li")),jQuery.unique(d.get())))},WYMeditor.editor.prototype._selectionOnlyInList=function(a){var b,c,d,e=this;for(d=0;d<a.rangeCount;++d){if(b=e.findUp(a.getRangeAt(d).startContainer,["li"]),c=e.findUp(a.getRangeAt(d).endContainer,["li"]),!b||!c)return!1;if(!e._getCommonParentList([b,c],!1))return!1}return!0},WYMeditor.editor.prototype.indent=function(){var a,b,c,d=this,e=d.selection();return b=function(){var a=d.selection(),b=d.get$CommonParent(a.anchorNode,a.focusNode)[0],c=d.findUp(b,["ol","ul","li"]);return d._fixInvalidListNesting(c)},d.restoreSelectionAfterManipulation(b)?(d.registerModification(),!0):(e=d.selection(),d._selectionOnlyInList(e)?(a=d._getSelectedListItems(e),0===a.length?!1:(b=function(){var b=!1;for(c=0;c<a.length;c++)d._indentSingleItem(a[c]),b=!0;return b},d.restoreSelectionAfterManipulation(b)&&d.registerModification())):!1)},WYMeditor.editor.prototype.outdent=function(){var a,b,c,d=this,e=d.selection();return b=function(){var a=d.selection(),b=d.get$CommonParent(a.anchorNode,a.focusNode)[0],c=d.findUp(b,["ol","ul","li"]);return d._fixInvalidListNesting(c)},d.restoreSelectionAfterManipulation(b)?(d.registerModification(),!0):(e=d.selection(),d._selectionOnlyInList(e)?(a=d._getSelectedListItems(e),0===a.length?!1:(b=function(){var b=!1;for(c=0;c<a.length;c++)d._outdentSingleItem(a[c]),b=!0;return b},d.restoreSelectionAfterManipulation(b)&&d.registerModification())):!1)},WYMeditor.editor.prototype.restoreSelectionAfterManipulation=function(a){var b=this,c=rangy.saveSelection(rangy.dom.getIframeWindow(b._iframe)),d=!0;try{d=a(),d?rangy.restoreSelection(c):rangy.removeMarkers(c)}catch(e){WYMeditor.console.error("Error during manipulation"),WYMeditor.console.error(e),rangy.removeMarkers(c)}return d},WYMeditor.editor.prototype._insertOrderedList=function(){var a,b=this;return a=function(){var a=jQuery(b._getSelectedNodes()).parents().addBack().filter("ol, ul, li").last()[0];return a=a||b.selectedContainer(),b._fixInvalidListNesting(a)},b.restoreSelectionAfterManipulation(a)?(b.registerModification(),!0):(a=function(){return b.insertList("ol")},b.restoreSelectionAfterManipulation(a)&&b.registerModification())},WYMeditor.editor.prototype._insertUnorderedList=function(){var a,b=this;return a=function(){var a=jQuery(b._getSelectedNodes()).parents().addBack().filter("ol, ul, li").last()[0];return a=a||b.selectedContainer(),b._fixInvalidListNesting(a)},b.restoreSelectionAfterManipulation(a)?(b.registerModification(),!0):(a=function(){return b.insertList("ul")},b.restoreSelectionAfterManipulation(a)&&b.registerModification())},WYMeditor.editor.prototype.insertList=function(a){var b,c,d,e,f,g=this,h=g.selection();if(b=g._getSelectedListItems(h),b.length>0){if(c=jQuery(b),d=c.parent(":not("+a+")"),!(d.length>0))return g._removeItemsFromList(c),!0;if(e=g._getCommonParentList(b,!0))return g.changeListType(e,a),!0}return f=g.findUp(g.selectedContainer(),WYMeditor.POTENTIAL_LIST_ELEMENTS),f?(g.convertToList(f,a),!0):!1},WYMeditor.editor.prototype.changeListType=function(a,b){var c=this;return c.switchTo(a,b)},WYMeditor.editor.prototype.convertToList=function(a,b){var c,d,e=this,f=jQuery(a);return c="<"+b+"><li></li></"+b+">",e.findUp(a,WYMeditor.ROOT_CONTAINERS)===a?(f.wrapInner(c),d=f.children(),d.unwrap(),d.get(0)):(f.wrapInner(c),d=f.children(),d.get(0))},WYMeditor.editor.prototype._removeItemsFromList=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.documentStructureManager.structureRules.defaultRootContainer;for(c=0;c<a.length;c++){for(b=a.eq(c),b=1===b.parent().parent("li, th, td").length?jQuery(j.switchTo(b[0],"span",!1)):jQuery(j.switchTo(b[0],k,!1)),1===b.parent().children().length?(b.parent().before(b),b.next().remove()):b[0]===b.parent().children().first()[0]?b.parent().before(b):b[0]!==b.parent().children().first()[0]&&b[0]!==b.parent().children().last()[0]?(b.parent().before("<"+b.parent()[0].tagName+"/>"),jQuery(b.prevAll().toArray().reverse()).appendTo(b.parent().prev()),b.parent().before(b)):b[0]===b.parent().children().last()[0]&&b.parent().after(b),d=0;d<b.contents().length;d++)if(e=b.contents()[d],j.isBlockNode(e)&&"rangySelectionBoundary"!==e.className&&"br"!==e.tagName.toLowerCase()){if(f=b.contents().slice(d),b[0].tagName.toLowerCase()===k)for(g=0;g<f.length;g++)h=f.eq(g),h[0].nodeType===WYMeditor.NODE_TYPE.TEXT?h.wrap("<"+k+" />"):h[0].tagName&&!j.isBlockNode(h[0])&&"br"!==h[0].tagName.toLowerCase()&&j.switchTo(f[g],k,!1);b.after(b.contents().slice(d));break}j.$body().children("br").remove(),"span"===b[0].tagName.toLowerCase()&&(0===b.contents(":not(.rangySelectionBoundary)").length||b.contents(":not(.rangySelectionBoundary)").length===b.contents("br").length?(b.before(b.contents(".rangySelectionBoundary")),b.remove()):((b[0].previousSibling&&b[0].previousSibling.nodeType===WYMeditor.NODE_TYPE.TEXT||b.prevAll(":not(.rangySelectionBoundary)").length>0&&j.isBlockNode(b.prevAll(":not(.rangySelectionBoundary)")[0])===!1)&&b.before("<br />"),(b[0].nextSibling&&b[0].nextSibling.nodeType===WYMeditor.NODE_TYPE.TEXT||b.nextAll(":not(.rangySelectionBoundary)").length>0&&j.isBlockNode(b.nextAll(":not(.rangySelectionBoundary)")[0])===!1)&&b.after("<br />"),i=b[0].attributes,j.unwrapIfMeaninglessSpan(b[0])))}j.prepareDocForEditing()},WYMeditor.editor.prototype.insertTable=function(a,b,c,d){if(!(0>=a||0>=b)){var e,f,g,h,i,j=this,k=j._doc.createElement(WYMeditor.TABLE),l=null;for(e=k.createCaption(),e.innerHTML=c,f=0;a>f;f+=1)for(l=k.insertRow(f),g=0;b>g;g+=1)l.insertCell(g);if(""!==d&&jQuery(k).attr("summary",d),h=jQuery(j.findUp(j.selectedContainer(),WYMeditor.POTENTIAL_TABLE_INSERT_ELEMENTS)).get(0),h&&h.parentNode)if(jQuery.inArray(h.nodeName.toLowerCase(),WYMeditor.INLINE_TABLE_INSERTION_ELEMENTS)>-1){if(i=j.selection().focusNode,jQuery.inArray(i.nodeName.toLowerCase(),WYMeditor.SELECTABLE_TABLE_ELEMENTS)>-1||jQuery.inArray(i.parentNode.nodeName.toLowerCase(),WYMeditor.SELECTABLE_TABLE_ELEMENTS)>-1)for(;i.nodeName.toLowerCase()!==WYMeditor.TABLE;)i=i.parentNode;i.nodeName.toLowerCase()===WYMeditor.LI?jQuery(i).append(k):jQuery(i).after(k)}else jQuery(h).after(k);else j.$body().append(k);return j._afterInsertTable(k),j.prepareDocForEditing(),j.registerModification(),k}},WYMeditor.editor.prototype._afterInsertTable=function(){},WYMeditor.editor.prototype._listen=function(){var a=this;jQuery(a._doc).bind("paste",function(){a._handlePasteEvent()})},WYMeditor.editor.prototype._handlePasteEvent=function(){var a=this;window.setTimeout(function(){jQuery(a.element).trigger(WYMeditor.EVENTS.postBlockMaybeCreated,a)},20)},WYMeditor.editor.prototype._selectSingleNode=function(a){var b,c,d=this;if(!a)throw"Expected a node";b=d.selection(),c=rangy.createRangyRange(),c.selectNode(a),b.setSingleRange(c)},WYMeditor.editor.prototype._initSkin=function(){var a=this;jQuery(a._box).addClass("wym_skin_"+a._options.skin),"undefined"!=typeof WYMeditor.SKINS[a._options.skin]?"function"==typeof WYMeditor.SKINS[a._options.skin].init&&WYMeditor.SKINS[a._options.skin].init(a):WYMeditor.console.warn("Chosen skin _"+a.options.skin+"_ not found.")},WYMeditor.editor.prototype.body=function(){var a,b=this;if(!b._doc.body)throw"The document seems to have no body element.";if(a=b._doc.body,!a.tagName||"body"!==a.tagName.toLowerCase())throw"The document's body doesn't seem to be a `body` element.";return a},WYMeditor.editor.prototype.$body=function(){var a,b=this;return a=b.body(),jQuery(a)},WYMeditor.editor.prototype.doesElementContainSelection=function(a){var b,c,d,e,f,g,h=this;if(h.hasSelection()!==!0)return!1;if(b=jQuery(a),h.selection().isCollapsed===!0)return c=h.selectedContainer(),a===c?!0:b.has(c).length>0?!0:!1;for(d=jQuery(h._getSelectedNodes()),e=0;e<d.length;e++)for(f=d.eq(e).parents(),g=0;g<f.length;g++)if(f[g]===a)return!0;return!1},WYMeditor.DocumentStructureManager=function(a,b){var c=this;c._wym=a,c.structureRules=WYMeditor.DocumentStructureManager.DEFAULTS,c.setDefaultRootContainer(b)},jQuery.extend(WYMeditor.DocumentStructureManager,{VALID_DEFAULT_ROOT_CONTAINERS:["p","div"],DEFAULT_ROOT_CONTAINER_TITLES:{p:"Paragraph",div:"Division"},CONTAINERS_BLOCKING_NAVIGATION:["table","blockquote","pre"],DEFAULTS:{defaultRootContainer:"p",notValidRootContainers:["div"],validRootContainers:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote","table","ol","ul"],convertIfRootContainers:["div"],validListConversionTargetContainers:["p","div","h1","h2","h3","h4","h5","h6","pre","blockquote","td","th"],wrapContentsInList:["td","th"]}}),WYMeditor.DocumentStructureManager.prototype.setDefaultRootContainer=function(a){var b,c,d,e=this;if(e.structureRules.defaultRootContainer!==a){if(d=WYMeditor.DocumentStructureManager,b=d.VALID_DEFAULT_ROOT_CONTAINERS,c=jQuery.inArray(a,b),-1===c)throw new Error("a defaultRootContainer of '"+a+"' is not supported");e.structureRules.defaultRootContainer=a,e.structureRules.notValidRootContainers=WYMeditor.DocumentStructureManager.VALID_DEFAULT_ROOT_CONTAINERS,e.structureRules.notValidRootContainers.splice(c,1),e._adjustDefaultRootContainerUI()}},WYMeditor.DocumentStructureManager.prototype._adjustDefaultRootContainerUI=function(){var a,b,c,d,e,f,g,h,i=this,j=i._wym,k=i.structureRules.defaultRootContainer;for(a=jQuery(j._box).find(j._options.containersSelector).find("li"),e=!0,g=0;g<a.length;++g)b=a.eq(g).find("a"),d=b.attr("name").toLowerCase(),jQuery.inArray(d,i.structureRules.notValidRootContainers)>-1&&a.eq(g).remove(),d===k&&(e=!1);e&&(f=j._options.containersItemHtml,f=WYMeditor.Helper.replaceAllInStr(f,WYMeditor.CONTAINER_NAME,k.toUpperCase()),h=WYMeditor.DocumentStructureManager,f=WYMeditor.Helper.replaceAllInStr(f,WYMeditor.CONTAINER_TITLE,h.DEFAULT_ROOT_CONTAINER_TITLES[k]),f=WYMeditor.Helper.replaceAllInStr(f,WYMeditor.CONTAINER_CLASS,"wym_containers_"+k),c=jQuery(f),a=jQuery(j._box).find(j._options.containersSelector).find("li"),a.eq(0).before(c),c.find("a").click(function(){var a=this;return j.setRootContainer(jQuery(a).attr(WYMeditor.NAME)),!1}))},WYMeditor.ImageHandler=function(a){var b=this;return b._wym=a,b._$resizeHandle=b._createResizeHandle(),b._$currentImageMarker=null,b._$currentImg=null,b._resizingNow=!1,b._imgDragDropAllowed=WYMeditor.ImageHandler._isImgDragDropAllowed(),b._addEventListeners(),b},WYMeditor.ImageHandler._isImgDragDropAllowed=function(){var a=jQuery.browser;return a.msie&&a.versionNumber<=9?!1:!0},WYMeditor.ImageHandler._RESIZE_HANDLE_HR_HTML=jQuery("<hr>").addClass(WYMeditor.EDITOR_ONLY_CLASS).css({margin:0,padding:0}).attr("outerHTML"),WYMeditor.ImageHandler._RESIZE_HANDLE_INNER_HTML=["drag this to resize","click on image to select"].join(WYMeditor.ImageHandler._RESIZE_HANDLE_HR_HTML),WYMeditor.ImageHandler._IMAGE_HIGHLIGHT_COLOR="yellow",WYMeditor.ImageHandler.prototype._createResizeHandle=function(){var a=jQuery("<div/>");return a.attr("contentEditable","false"),a.html(WYMeditor.ImageHandler._RESIZE_HANDLE_INNER_HTML),a.addClass(WYMeditor.RESIZE_HANDLE_CLASS).addClass(WYMeditor.EDITOR_ONLY_CLASS),a.css({margin:"0",padding:"0",cursor:"row-resize","text-align":"center",position:"absolute","background-color":WYMeditor.ImageHandler._IMAGE_HIGHLIGHT_COLOR,"background-image":"none","min-width":"13em",width:"100%"}),a},WYMeditor.ImageHandler.prototype._getCurrentImageMarker=function(){
+var a=this;return a._$currentImageMarker&&a._$currentImageMarker.length||(a._$currentImageMarker=a._createCurrentImageMarker()),a._$currentImageMarker},WYMeditor.ImageHandler._IMAGE_MARKER_CLASS="wym-image-marker",WYMeditor.ImageHandler.prototype._createCurrentImageMarker=function(){return jQuery("<div/>").addClass(WYMeditor.EDITOR_ONLY_CLASS).addClass(WYMeditor.ImageHandler._IMAGE_MARKER_CLASS).hide()},WYMeditor.ImageHandler.prototype._addEventListeners=function(){var a=this,b=jQuery(a._wym._doc);b.delegate("img","mouseover",a._onImgMouseover.bind(a)),b.delegate("img","click",a._onImgClick.bind(a)),b.delegate("."+WYMeditor.RESIZE_HANDLE_CLASS,"mousedown",a._onResizeHandleMousedown.bind(a)),b.delegate("img","mousedown",a._onImgMousedown.bind(a)),b.delegate("img","dragstart",a._onImgDragstart.bind(a)),b.bind("mousemove",a._onMousemove.bind(a)),b.bind("mouseup",a._onMouseup.bind(a)),a._edited=new WYMeditor.EXTERNAL_MODULES.Edited(b[0],function(){},a._onAnyNativeEdit.bind(a)),b.delegate("."+WYMeditor.RESIZE_HANDLE_CLASS,"click dblclick",a._onResizeHandleClickDblclick.bind(a))},WYMeditor.ImageHandler.prototype._onImgMouseover=function(a){var b=this,c=jQuery(a.target);!c.data("cE disabled")&&jQuery.browser.msie&&(c.attr("contentEditable","false"),c.data("cE disabled",!0)),b._setImgCursor(c)},WYMeditor.ImageHandler.prototype._setImgCursor=function(a){var b=this;return b._wym.getSelectedImage()!==a[0]?void a.css("cursor","pointer"):void(b._imgDragDropAllowed?a.css("cursor","move"):a.css("cursor","default"))},WYMeditor.ImageHandler.prototype._onImgClick=function(a){var b=this;return b._selectImage(a.target),b._indicateOnResizeHandleThatImageIsSelected(),!1},WYMeditor.ImageHandler.prototype._selectImage=function(a){var b=this,c=jQuery(a);jQuery.browser.msie&&8===jQuery.browser.versionNumber?setTimeout(function(){b._wym._selectSingleNode(a)},0):b._wym._selectSingleNode(a),b._setImgCursor(c)},WYMeditor.ImageHandler.prototype._indicateOnResizeHandleThatImageIsSelected=function(){var a=this,b="image is selected";a._imgDragDropAllowed&&(b=[b,"drag image to move it"].join(WYMeditor.ImageHandler._RESIZE_HANDLE_HR_HTML)),a._$resizeHandle.css("font-weight","bold").html(b),setTimeout(function(){a._$resizeHandle.css("font-weight","normal").html(WYMeditor.ImageHandler._RESIZE_HANDLE_INNER_HTML)},1e3)},WYMeditor.ImageHandler.prototype._placeResizeHandleOnImg=function(a){var b=this,c="0.8em",d=jQuery(a);b._$currentImg=d,b._getCurrentImageMarker().insertAfter(d),d.css({"background-color":WYMeditor.ImageHandler._IMAGE_HIGHLIGHT_COLOR,"padding-top":c,"padding-right":c,"padding-bottom":"0","padding-left":c,"margin-top":"-"+c,"margin-right":"-"+c,"margin-bottom":"0","margin-left":"-"+c}),b._$resizeHandle.prependTo(b._wym.$body()),b._correctResizeHandleOffsetAndWidth(),b._$resizeHandle.show()},WYMeditor.ImageHandler.prototype._correctResizeHandleOffsetAndWidth=function(){var a=this;a._$resizeHandle.css("max-width",a._$currentImg.outerWidth());var b=a._$currentImg.offset();a._$resizeHandle.css("left",b.left);var c=b.top+a._$currentImg.outerHeight();jQuery.browser.msie&&c--,a._$resizeHandle.css("top",c)},WYMeditor.ImageHandler.prototype._onResizeHandleMousedown=function(a){var b=this;return b._resizingNow||b._startResize(a.clientY),!1},WYMeditor.ImageHandler.prototype._startResize=function(a){var b=this;b._startMouseY=a,b._$currentImg.data("StartHeight",b._$currentImg.height()),b._resizingNow=!0},WYMeditor.ImageHandler.prototype._onMousemove=function(a){var b=this;if(a.target.tagName){if(b._resizingNow)return b._resizeImage(a.clientY),!1;if("img"===a.target.tagName.toLowerCase()&&!b._isResizeHandleAttached())return b._placeResizeHandleOnImg(a.target),!1;if(b._isResizeHandleAttached())return(jQuery(a.target).hasClass(WYMeditor.EDITOR_ONLY_CLASS)||b._isCurrentImg(a.target))&&b._isCurrentImgAtMarker()?void 0:void b._detachResizeHandle()}},WYMeditor.ImageHandler.prototype._isCurrentImgAtMarker=function(){var a=this,b=a._$currentImageMarker;if(!b.length)return!1;var c=a._$currentImg,d=b.prev("img");return c.length&&d.length&&d[0]===c[0]?!0:!1},WYMeditor.ImageHandler.prototype._isResizeHandle=function(a){return jQuery(a).hasClass(WYMeditor.RESIZE_HANDLE_CLASS)},WYMeditor.ImageHandler.prototype._isCurrentImg=function(a){var b=this;return a===b._$currentImg[0]},WYMeditor.ImageHandler.prototype._resizeImage=function(a){var b=this,c=b._$currentImg,d=c.data("DimensionsRatio");if(!d){var e=c.height(),f=c.width();d=f/e,c.data("DimensionsRatio",d)}var g=c.data("StartHeight"),h=g-b._startMouseY+a;h=h>0?h:0;var i=h*d;c.attr("height",h),c.attr("width",i),b._correctResizeHandleOffsetAndWidth()},WYMeditor.ImageHandler.prototype._onMouseup=function(){var a=this;a._resizingNow&&a._stopResize()},WYMeditor.ImageHandler.prototype._stopResize=function(){var a=this;a._resizingNow=!1,a._startMouseY=null,a._wym.registerModification()},WYMeditor.ImageHandler.prototype._onImgMousedown=function(a){var b=this;return jQuery.browser.msie&&11===jQuery.browser.versionNumber&&b._selectImage(a.target),b._imgDragDropAllowed},WYMeditor.ImageHandler.prototype._onAnyNativeEdit=function(){var a=this;setTimeout(a._handlePossibleModification.bind(a),0)},WYMeditor.ImageHandler.prototype._handlePossibleModification=function(){var a=this;if(a._isResizeHandleAttached())return a._isCurrentImgAtMarker()?void a._correctResizeHandleOffsetAndWidth():void a._detachResizeHandle()},WYMeditor.ImageHandler.prototype._isResizeHandleAttached=function(){var a=this,b=a._getResizeHandle();return b&&"none"!==b.css("display")},WYMeditor.ImageHandler.prototype._getResizeHandle=function(){var a=this,b=a._wym.$body().find("."+WYMeditor.RESIZE_HANDLE_CLASS);return b.length?b:!1},WYMeditor.ImageHandler.prototype._detachResizeHandle=function(){var a=this;a._$currentImageMarker.detach(),a._$currentImg.height()>=16&&a._$currentImg.width()>=16&&a._$currentImg.css({padding:0,margin:0}),a._$currentImg=null,a._$resizeHandle.hide()},WYMeditor.ImageHandler.prototype._onImgDragstart=function(){var a=this;a._detachResizeHandle()},WYMeditor.ImageHandler.prototype._onResizeHandleClickDblclick=function(){var a=this;return jQuery.browser.msie&&11===jQuery.browser.versionNumber&&a._wym.deselect(),!1},WYMeditor.ImageHandler.prototype._isAnImgSelected=function(a){function b(b){var d=c._wym.getSelectedImage()?"***YES***":"";b=b?b+" ":"",WYMeditor.console.log(b+a+" "+d)}var c=this;a=a.toUpperCase(),b("sync"),setTimeout(function(){b("async")},0)},WYMeditor.ImageHandler._onAllEvents=function(a){var b=this;b._isAnImgSelected([a.type,a.target.tagName,jQuery(a.target).attr("className")].join(" "))},WYMeditor.WymClassGecko=function(a){var b=this;b._wym=a,b._class="class"},WYMeditor.WymClassGecko.CELL_PLACEHOLDER='<br _moz_dirty="" />',WYMeditor.WymClassGecko.NEEDS_CELL_FIX=1===parseInt(jQuery.browser.version,10)&&jQuery.browser.version>="1.9.1"&&jQuery.browser.version<"2.0",WYMeditor.WymClassGecko.prototype._docEventQuirks=function(){var a=this,b=jQuery(a._doc);b.keyup(a._keyup.bind(a)),b.focus(function(){a.undoRedo._onBodyFocus()}),b.click(a._click.bind(a))},WYMeditor.WymClassGecko.prototype._keyup=function(a){var b,c,d,e,f,g=this;d=g.documentStructureManager.structureRules.notValidRootContainers,c=g.documentStructureManager.structureRules.defaultRootContainer,b=null,g.keyCanCreateBlockElement(a.which)||a.which===WYMeditor.KEY_CODE.CTRL||a.which===WYMeditor.KEY_CODE.COMMAND||a.metaKey||a.ctrlKey||(b=g.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),g.isForbiddenRootContainer(e)&&(e=f),(e===WYMeditor.BODY||jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY)&&(g._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),g.prepareDocForEditing())),g.keyCanCreateBlockElement(a.which)&&(b=g.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&g._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),g._handlePotentialEnterInEmptyNestedLi(a.which,b),g.prepareDocForEditing())},WYMeditor.WymClassGecko.prototype._click=function(){var a,b=this,c=b.selectedContainer();WYMeditor.WymClassGecko.NEEDS_CELL_FIX===!0&&c&&c.tagName.toLowerCase()===WYMeditor.TR&&jQuery(WYMeditor.TD,b._doc.body).append(WYMeditor.WymClassGecko.CELL_PLACEHOLDER),c&&c.tagName.toLowerCase()===WYMeditor.BODY&&(a=b.selection(),a.isCollapsed===!0&&b._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,WYMeditor.P))},WYMeditor.WymClassGecko.prototype._designModeQuirks=function(){var a=this;try{a._doc.execCommand("styleWithCSS","",!1),a._doc.execCommand("enableObjectResizing",!1,!1),a._doc.execCommand("enableInlineTableEditing",!1,!1)}catch(b){}},WYMeditor.WymClassGecko.prototype._afterInsertTable=function(a){WYMeditor.WymClassGecko.NEEDS_CELL_FIX===!0&&jQuery(a).find("td").each(function(a,b){jQuery(b).append(WYMeditor.WymClassGecko.CELL_PLACEHOLDER)})},WYMeditor.WymClassWebKit=function(a){var b=this;b._wym=a,b._class="class"},WYMeditor.WymClassWebKit.prototype._docEventQuirks=function(){var a=this;jQuery(a._doc).bind("keyup",function(b){a._keyup(b)}),a.keyboard.combokeys.bind("shift+enter",function(){return a._exec(WYMeditor.EXEC_COMMANDS.INSERT_LINEBREAK),!1}),a.$body().bind("focus",function(){a.undoRedo._onBodyFocus()})},WYMeditor.WymClassWebKit.prototype._inListBreakoutDiv=function(a){var b=this,c=jQuery(b.getRootContainer());return a===WYMeditor.KEY_CODE.ENTER&&c.is("div")&&"div"!==b.documentStructureManager.defaultRootContainer&&1===c.prev("ol, ul").length?!0:!1},WYMeditor.WymClassWebKit.prototype._isLiInLiAfterEnter=function(a){var b,c,d,e,f=this,g=f.nodeAfterSel();return a!==WYMeditor.KEY_CODE.ENTER?!1:g&&(b=g.parentNode)?"string"!=typeof b.tagName?!1:"li"!==b.tagName.toLowerCase()?!1:(c=g.previousSibling)?"string"!=typeof c.tagName?!1:"li"!==c.tagName.toLowerCase()?!1:1!==c.childNodes.length?!1:(d=c.childNodes[0])?"string"!=typeof d.tagName?!1:"br"!==d.tagName.toLowerCase()?!1:(e=c.previousSibling,e?"string"!=typeof e.tagName?!1:-1===jQuery.inArray(e.tagName.toLowerCase(),["ol","ul"])?!1:!0:!1):!1:!1:!1},WYMeditor.WymClassWebKit.prototype._fixLiInLiAfterEnter=function(){var a=this,b=a.nodeAfterSel(),c=jQuery(b.previousSibling),d=c.parent("li"),e=d.contents().index(c),f=d.contents().slice(e+1);c.remove(),d.after("<li><br /></li>"),d.next().append(f),a.setCaretBefore(d.next("li").children().first("br")[0])},WYMeditor.WymClassWebKit.prototype._keyup=function(a){var b,c,d,e,f,g,h=this;if(d=h.documentStructureManager.structureRules.notValidRootContainers,c=h.documentStructureManager.structureRules.defaultRootContainer,jQuery.browser.version<534.1&&a.which===WYMeditor.KEY_CODE.ENTER&&a.shiftKey&&h._exec("InsertLineBreak"),h.keyCanCreateBlockElement(a.which)||a.which===WYMeditor.KEY_CODE.CTRL||a.which===WYMeditor.KEY_CODE.COMMAND||a.metaKey||a.ctrlKey||(b=h.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),h.isForbiddenRootContainer(e)&&(e=f),(e===WYMeditor.BODY||jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY)&&(h._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),h.prepareDocForEditing())),h.keyCanCreateBlockElement(a.which)){if(b=h.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&(h._exec(WYMeditor.EXEC_COMMANDS.FORMAT_BLOCK,c),b=h.selectedContainer()),h._isLiInLiAfterEnter(a.which,b))return h._fixLiInLiAfterEnter(),void(b=h.selectedContainer());h._handlePotentialEnterInEmptyNestedLi(a.which,b),h._inListBreakoutDiv(a.which)&&(g=h.switchTo(h.getRootContainer(),c),h.setCaretIn(g)),h.prepareDocForEditing()}},WYMeditor.WymClassBlink=function(a){var b=this;b._wym=a},jQuery.extend(WYMeditor.WymClassBlink.prototype,WYMeditor.WymClassWebKit.prototype),WYMeditor.WymClassSafari=function(a){var b=this;b._wym=a},jQuery.extend(WYMeditor.WymClassSafari.prototype,WYMeditor.WymClassWebKit.prototype),WYMeditor.WymClassTridentPre7=function(a){var b=this;b._wym=a,b._class="className"},WYMeditor.WymClassTridentPre7.prototype._onEditorIframeLoad=function(a){a._assignWymDoc(),a._isDesignModeOn()===!1?a._doc.designMode="On":a._afterDesignModeOn()},WYMeditor.WymClassTridentPre7.prototype._assignWymDoc=function(){var a=this;a._doc=a._iframe.contentWindow.document},WYMeditor.WymClassTridentPre7.prototype._docEventQuirks=function(){var a=this;a._doc.onbeforedeactivate=function(){a._saveCaret()},jQuery(a._doc).bind("keyup",function(b){a._keyup(b)}),a._doc.onkeyup=function(){a._saveCaret()},a._doc.onclick=function(){a._saveCaret()},a.$body().bind("focus",function(){a.undoRedo._onBodyFocus()}),a._doc.body.onbeforepaste=function(){a._iframe.contentWindow.event.returnValue=!1},a._doc.body.onpaste=function(){a._iframe.contentWindow.event.returnValue=!1,a.paste(window.clipboardData.getData("Text"))},a.$body().bind("dragend",function(b){b.target.tagName.toLowerCase()===WYMeditor.IMG&&a.deselect()}),a._doc.oncontrolselect=function(){return!1}},WYMeditor.WymClassTridentPre7.prototype._setButtonsUnselectable=function(){var a=this,b=a.get$Buttons();b.attr("unselectable","on")},WYMeditor.WymClassTridentPre7.prototype._uiQuirks=function(){var a=this;8===jQuery.browser.versionNumber&&a._setButtonsUnselectable()},WYMeditor.WymClassTridentPre7.prototype._saveCaret=function(){var a=this,b=a._doc.selection;"None"!==b.type&&(a._doc.caretPos=b.createRange())},WYMeditor.WymClassTridentPre7.prototype._wrapWithContainer=function(a,b){var c,d,e,f=this;c=jQuery(a).wrap("<"+b+" />"),d=f.selection(),e=rangy.createRange(f._doc),e.selectNodeContents(c[0]),e.collapse(),d.setSingleRange(e)},WYMeditor.WymClassTridentPre7.prototype._keyup=function(a){var b,c,d,e,f,g,h=this,i=!1;d=h.documentStructureManager.structureRules.notValidRootContainers,c=h.documentStructureManager.structureRules.defaultRootContainer,h.keyCanCreateBlockElement(a.which)||a.which===WYMeditor.KEY_CODE.CTRL||a.which===WYMeditor.KEY_CODE.COMMAND||a.metaKey||a.ctrlKey||(b=h.selectedContainer(),g=h.selection().focusNode,null!==b&&(e=b.tagName.toLowerCase()),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),h.isForbiddenRootContainer(e)&&(e=f,i=!0),e===WYMeditor.BODY&&"#text"===g.nodeName&&(i&&(g=g.parentNode),h._wrapWithContainer(g,c),h.prepareDocForEditing()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&(h.switchTo(b,c),h.prepareDocForEditing())),h.keyCanCreateBlockElement(a.which)&&(b=h.selectedContainer(),e=b.tagName.toLowerCase(),b.parentNode&&(f=b.parentNode.tagName.toLowerCase()),jQuery.inArray(e,d)>-1&&f===WYMeditor.BODY&&h.switchTo(b,c),h._handlePotentialEnterInEmptyNestedLi(a.which,b),a.which!==WYMeditor.KEY_CODE.BACKSPACE||8!==jQuery.browser.versionNumber||!b.parentNode||"ul"!==f&&"ol"!==f||h._fixInvalidListNesting(b),h.prepareDocForEditing())},WYMeditor.WymClassTrident7=function(a){var b=this;b._wym=a,b._class="class"},jQuery.extend(WYMeditor.WymClassTrident7.prototype,WYMeditor.WymClassGecko.prototype),jQuery.copyPropsFromObjectToObject(WYMeditor.WymClassTridentPre7.prototype,WYMeditor.WymClassTrident7.prototype,["_exec","_keyup","_wrapWithContainer"]),WYMeditor.WymClassTrident7.prototype.rawHtml=function(a){var b=this;return"string"!=typeof a?b.$body().html():(b._doc.designMode="off",b.$body().html(a),b._isDesignModeOn()!==!0&&b._enableDesignModeOnDocument(),!1)},WYMeditor.WymClassTrident7.prototype._docEventQuirks=function(){var a=this;jQuery(a._doc).bind("keyup",function(b){a._keyup(b)}),a.$body().bind("dragend",function(b){b.target.tagName.toLowerCase()===WYMeditor.IMG&&a.deselect()}),a.$body().bind("focus",function(){a.undoRedo._onBodyFocus()})},function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.foo=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";var d=a("lodash"),e=a("udc"),f=a("xtend");b.exports=function(a,b){var c=this;if(c.options=f({limit:null},b),c.notObjError=new Error("requires a plain object"),!a||!d.isPlainObject(a))throw c.notObjError;c.current=e(a),c.changesets={backward:[],forward:[]}};var g=b.exports.prototype;g.add=a("./prototype/add"),g.get=a("./prototype/get"),g.lengthBackward=a("./prototype/length-backward"),g.lengthForward=a("./prototype/length-forward"),g.backward=a("./prototype/backward"),g.forward=a("./prototype/forward"),g.move=a("./prototype/move"),g.forgetAllInDirection=a("./prototype/forget-all-in-direction"),g.forgetAllBackward=a("./prototype/forget-all-backward"),g.forgetAllForward=a("./prototype/forget-all-forward")},{"./prototype/add":2,"./prototype/backward":3,"./prototype/forget-all-backward":4,"./prototype/forget-all-forward":5,"./prototype/forget-all-in-direction":6,"./prototype/forward":7,"./prototype/get":8,"./prototype/length-backward":9,"./prototype/length-forward":10,"./prototype/move":11,lodash:14,udc:15,xtend:16}],2:[function(a,b,c){"use strict";var d=a("lodash"),e=a("changeset"),f=a("udc");b.exports=function(a){var b=this;if(!a||!d.isPlainObject(a))throw b.notObjError;b.lengthBackward()===b.options.limit&&b.changesets.backward.shift(),b.changesets.backward.push(e(a,b.current)),b.current=f(a),b.changesets.forward=[]}},{changeset:12,lodash:14,udc:15}],3:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.move("backward")}},{}],4:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.forgetAllInDirection("backward")}},{}],5:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.forgetAllInDirection("forward")}},{}],6:[function(a,b,c){var d=function(a){var b=this,c=b.changesets;if(!c.hasOwnProperty(a))throw new Error("there is no such direction");c[a]=[]};b.exports=d},{}],7:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.move("forward")}},{}],8:[function(a,b,c){"use strict";var d=a("udc");b.exports=function(){var a=this;return d(a.current)}},{udc:15}],9:[function(a,b,c){"use strict";b.exports=function(){var a=this;return a.changesets.backward.length}},{}],10:[function(a,b,c){"use strict";b.exports=function(){var a=this;return a.changesets.forward.length}},{}],11:[function(a,b,c){"use strict";var d=a("changeset"),e=d.apply,f=a("lodash").without,g=function(a){var b=this;if(!a||!b.changesets.hasOwnProperty(a))throw new Error("Invalid direction");var c=Object.getOwnPropertyNames(b.changesets),g=f(c,a)[0],h=b.changesets[a],i=b.changesets[g];if(0===h.length)throw new Error("There's no going "+a);var j=e(h.pop(),b.current);i.push(d(j,b.current)),b.current=j};b.exports=g},{changeset:12,lodash:14}],12:[function(a,b,c){function d(a,b){var c=[];return c=c.concat(f([],a,b)),i=[],c}function e(a){return"put"===a.type&&void 0===a.value&&(a.type="del",delete a.value),a}function f(a,b,c){var d=[];if(null===b||null===c||"object"!=typeof b||h.contains(i,b))b!==c&&d.push(e({type:"put",key:a,value:c}));else{i.push(b);var g=Object.keys(b),j=Object.keys(c),k=h.intersection(g,j);k.forEach(function(e){var g=f(a.concat(e),b[e],c[e]);d=d.concat(g)});var l=h.difference(g,j);l.forEach(function(b){d.push({type:"del",key:a.concat(b)})});var m=h.difference(j,g);m.forEach(function(b){d.push(e({type:"put",key:a.concat(b),value:c[b]}))})}return d}function g(b,c,d){var e,f;return d?e=c:(f=a("udc"),e=f(c)),b.forEach(function(a){var b,c,d;switch(a.type){case"put":b=e,c=a.key,d=c.length,d?c.forEach(function(c,e){c in b||(b[c]={}),d-1>e?b=b[c]:b[c]=a.value}):e=a.value;break;case"del":b=e,c=a.key,d=c.length,d?c.forEach(function(a,c){a in b||(b[a]={}),d-1>c?b=b[a]:delete b[a]}):e=null}}),e}var h=a("underscore");b.exports=d;var i=[];b.exports.apply=g},{udc:15,underscore:13}],13:[function(a,b,c){(function(){var a=this,d=a._,e={},f=Array.prototype,g=Object.prototype,h=Function.prototype,i=f.push,j=f.slice,k=f.concat,l=g.toString,m=g.hasOwnProperty,n=f.forEach,o=f.map,p=f.reduce,q=f.reduceRight,r=f.filter,s=f.every,t=f.some,u=f.indexOf,v=f.lastIndexOf,w=Array.isArray,x=Object.keys,y=h.bind,z=function(a){return a instanceof z?a:this instanceof z?void(this._wrapped=a):new z(a)};"undefined"!=typeof c?("undefined"!=typeof b&&b.exports&&(c=b.exports=z),c._=z):a._=z,z.VERSION="1.4.4";var A=z.each=z.forEach=function(a,b,c){if(null!=a)if(n&&a.forEach===n)a.forEach(b,c);else if(a.length===+a.length){for(var d=0,f=a.length;f>d;d++)if(b.call(c,a[d],d,a)===e)return}else for(var g in a)if(z.has(a,g)&&b.call(c,a[g],g,a)===e)return};z.map=z.collect=function(a,b,c){var d=[];return null==a?d:o&&a.map===o?a.map(b,c):(A(a,function(a,e,f){d[d.length]=b.call(c,a,e,f)}),d)};var B="Reduce of empty array with no initial value";z.reduce=z.foldl=z.inject=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),p&&a.reduce===p)return d&&(b=z.bind(b,d)),e?a.reduce(b,c):a.reduce(b);if(A(a,function(a,f,g){e?c=b.call(d,c,a,f,g):(c=a,e=!0)}),!e)throw new TypeError(B);return c},z.reduceRight=z.foldr=function(a,b,c,d){var e=arguments.length>2;if(null==a&&(a=[]),q&&a.reduceRight===q)return d&&(b=z.bind(b,d)),e?a.reduceRight(b,c):a.reduceRight(b);var f=a.length;if(f!==+f){var g=z.keys(a);f=g.length}if(A(a,function(h,i,j){i=g?g[--f]:--f,e?c=b.call(d,c,a[i],i,j):(c=a[i],e=!0)}),!e)throw new TypeError(B);return c},z.find=z.detect=function(a,b,c){var d;return C(a,function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},z.filter=z.select=function(a,b,c){var d=[];return null==a?d:r&&a.filter===r?a.filter(b,c):(A(a,function(a,e,f){b.call(c,a,e,f)&&(d[d.length]=a)}),d)},z.reject=function(a,b,c){return z.filter(a,function(a,d,e){return!b.call(c,a,d,e)},c)},z.every=z.all=function(a,b,c){b||(b=z.identity);var d=!0;return null==a?d:s&&a.every===s?a.every(b,c):(A(a,function(a,f,g){return(d=d&&b.call(c,a,f,g))?void 0:e}),!!d)};var C=z.some=z.any=function(a,b,c){b||(b=z.identity);var d=!1;return null==a?d:t&&a.some===t?a.some(b,c):(A(a,function(a,f,g){return d||(d=b.call(c,a,f,g))?e:void 0}),!!d)};z.contains=z.include=function(a,b){return null==a?!1:u&&a.indexOf===u?-1!=a.indexOf(b):C(a,function(a){return a===b})},z.invoke=function(a,b){var c=j.call(arguments,2),d=z.isFunction(b);return z.map(a,function(a){return(d?b:a[b]).apply(a,c)})},z.pluck=function(a,b){return z.map(a,function(a){return a[b]})},z.where=function(a,b,c){return z.isEmpty(b)?c?null:[]:z[c?"find":"filter"](a,function(a){for(var c in b)if(b[c]!==a[c])return!1;return!0})},z.findWhere=function(a,b){return z.where(a,b,!0)},z.max=function(a,b,c){if(!b&&z.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.max.apply(Math,a);if(!b&&z.isEmpty(a))return-(1/0);var d={computed:-(1/0),value:-(1/0)};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g>=d.computed&&(d={value:a,computed:g})}),d.value},z.min=function(a,b,c){if(!b&&z.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&z.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return A(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;g<d.computed&&(d={value:a,computed:g})}),d.value},z.shuffle=function(a){var b,c=0,d=[];return A(a,function(a){b=z.random(c++),d[c-1]=d[b],d[b]=a}),d};var D=function(a){return z.isFunction(a)?a:function(b){return b[a]}};z.sortBy=function(a,b,c){var d=D(b);return z.pluck(z.map(a,function(a,b,e){return{value:a,index:b,criteria:d.call(c,a,b,e)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index<b.index?-1:1}),"value")};var E=function(a,b,c,d){var e={},f=D(b||z.identity);return A(a,function(b,g){var h=f.call(c,b,g,a);d(e,h,b)}),e};z.groupBy=function(a,b,c){return E(a,b,c,function(a,b,c){(z.has(a,b)?a[b]:a[b]=[]).push(c)})},z.countBy=function(a,b,c){return E(a,b,c,function(a,b){z.has(a,b)||(a[b]=0),a[b]++})},z.sortedIndex=function(a,b,c,d){c=null==c?z.identity:D(c);for(var e=c.call(d,b),f=0,g=a.length;g>f;){var h=f+g>>>1;c.call(d,a[h])<e?f=h+1:g=h}return f},z.toArray=function(a){return a?z.isArray(a)?j.call(a):a.length===+a.length?z.map(a,z.identity):z.values(a):[]},z.size=function(a){return null==a?0:a.length===+a.length?a.length:z.keys(a).length},z.first=z.head=z.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:j.call(a,0,b)},z.initial=function(a,b,c){return j.call(a,0,a.length-(null==b||c?1:b))},z.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:j.call(a,Math.max(a.length-b,0))},z.rest=z.tail=z.drop=function(a,b,c){return j.call(a,null==b||c?1:b)},z.compact=function(a){return z.filter(a,z.identity)};var F=function(a,b,c){return A(a,function(a){z.isArray(a)?b?i.apply(c,a):F(a,b,c):c.push(a)}),c};z.flatten=function(a,b){return F(a,b,[])},z.without=function(a){return z.difference(a,j.call(arguments,1))},z.uniq=z.unique=function(a,b,c,d){z.isFunction(b)&&(d=c,c=b,b=!1);var e=c?z.map(a,c,d):a,f=[],g=[];return A(e,function(c,d){(b?d&&g[g.length-1]===c:z.contains(g,c))||(g.push(c),f.push(a[d]))}),f},z.union=function(){return z.uniq(k.apply(f,arguments))},z.intersection=function(a){var b=j.call(arguments,1);return z.filter(z.uniq(a),function(a){return z.every(b,function(b){return z.indexOf(b,a)>=0})})},z.difference=function(a){var b=k.apply(f,j.call(arguments,1));return z.filter(a,function(a){return!z.contains(b,a)})},z.zip=function(){for(var a=j.call(arguments),b=z.max(z.pluck(a,"length")),c=new Array(b),d=0;b>d;d++)c[d]=z.pluck(a,""+d);return c},z.object=function(a,b){if(null==a)return{};for(var c={},d=0,e=a.length;e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},z.indexOf=function(a,b,c){if(null==a)return-1;var d=0,e=a.length;if(c){if("number"!=typeof c)return d=z.sortedIndex(a,b),a[d]===b?d:-1;d=0>c?Math.max(0,e+c):c}if(u&&a.indexOf===u)return a.indexOf(b,c);for(;e>d;d++)if(a[d]===b)return d;return-1},z.lastIndexOf=function(a,b,c){if(null==a)return-1;var d=null!=c;if(v&&a.lastIndexOf===v)return d?a.lastIndexOf(b,c):a.lastIndexOf(b);for(var e=d?c:a.length;e--;)if(a[e]===b)return e;return-1},z.range=function(a,b,c){arguments.length<=1&&(b=a||0,a=0),c=arguments[2]||1;for(var d=Math.max(Math.ceil((b-a)/c),0),e=0,f=new Array(d);d>e;)f[e++]=a,a+=c;return f},z.bind=function(a,b){if(a.bind===y&&y)return y.apply(a,j.call(arguments,1));var c=j.call(arguments,2);return function(){return a.apply(b,c.concat(j.call(arguments)))}},z.partial=function(a){var b=j.call(arguments,1);return function(){return a.apply(this,b.concat(j.call(arguments)))}},z.bindAll=function(a){var b=j.call(arguments,1);return 0===b.length&&(b=z.functions(a)),A(b,function(b){a[b]=z.bind(a[b],a)}),a},z.memoize=function(a,b){var c={};return b||(b=z.identity),function(){var d=b.apply(this,arguments);return z.has(c,d)?c[d]:c[d]=a.apply(this,arguments)}},z.delay=function(a,b){var c=j.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},z.defer=function(a){return z.delay.apply(z,[a,1].concat(j.call(arguments,1)))},z.throttle=function(a,b){var c,d,e,f,g=0,h=function(){g=new Date,e=null,f=a.apply(c,d)};return function(){var i=new Date,j=b-(i-g);return c=this,d=arguments,0>=j?(clearTimeout(e),e=null,g=i,f=a.apply(c,d)):e||(e=setTimeout(h,j)),f}},z.debounce=function(a,b,c){var d,e;return function(){var f=this,g=arguments,h=function(){d=null,c||(e=a.apply(f,g))},i=c&&!d;return clearTimeout(d),d=setTimeout(h,b),i&&(e=a.apply(f,g)),e}},z.once=function(a){var b,c=!1;return function(){return c?b:(c=!0,b=a.apply(this,arguments),a=null,b)}},z.wrap=function(a,b){return function(){var c=[a];return i.apply(c,arguments),b.apply(this,c)}},z.compose=function(){var a=arguments;return function(){for(var b=arguments,c=a.length-1;c>=0;c--)b=[a[c].apply(this,b)];return b[0]}},z.after=function(a,b){return 0>=a?b():function(){return--a<1?b.apply(this,arguments):void 0}},z.keys=x||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var b=[];for(var c in a)z.has(a,c)&&(b[b.length]=c);return b},z.values=function(a){var b=[];for(var c in a)z.has(a,c)&&b.push(a[c]);return b},z.pairs=function(a){var b=[];for(var c in a)z.has(a,c)&&b.push([c,a[c]]);return b},z.invert=function(a){var b={};for(var c in a)z.has(a,c)&&(b[a[c]]=c);return b},z.functions=z.methods=function(a){var b=[];for(var c in a)z.isFunction(a[c])&&b.push(c);return b.sort()},z.extend=function(a){return A(j.call(arguments,1),function(b){if(b)for(var c in b)a[c]=b[c]}),a},z.pick=function(a){var b={},c=k.apply(f,j.call(arguments,1));return A(c,function(c){c in a&&(b[c]=a[c])}),b},z.omit=function(a){var b={},c=k.apply(f,j.call(arguments,1));for(var d in a)z.contains(c,d)||(b[d]=a[d]);return b},z.defaults=function(a){return A(j.call(arguments,1),function(b){if(b)for(var c in b)null==a[c]&&(a[c]=b[c])}),a},z.clone=function(a){return z.isObject(a)?z.isArray(a)?a.slice():z.extend({},a):a},z.tap=function(a,b){return b(a),a};var G=function(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;if(null==a||null==b)return a===b;a instanceof z&&(a=a._wrapped),b instanceof z&&(b=b._wrapped);var e=l.call(a);if(e!=l.call(b))return!1;switch(e){case"[object String]":return a==String(b);case"[object Number]":return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case"[object Date]":case"[object Boolean]":return+a==+b;case"[object RegExp]":return a.source==b.source&&a.global==b.global&&a.multiline==b.multiline&&a.ignoreCase==b.ignoreCase}if("object"!=typeof a||"object"!=typeof b)return!1;for(var f=c.length;f--;)if(c[f]==a)return d[f]==b;c.push(a),d.push(b);var g=0,h=!0;if("[object Array]"==e){if(g=a.length,h=g==b.length)for(;g--&&(h=G(a[g],b[g],c,d)););}else{var i=a.constructor,j=b.constructor;if(i!==j&&!(z.isFunction(i)&&i instanceof i&&z.isFunction(j)&&j instanceof j))return!1;for(var k in a)if(z.has(a,k)&&(g++,!(h=z.has(b,k)&&G(a[k],b[k],c,d))))break;if(h){for(k in b)if(z.has(b,k)&&!g--)break;h=!g}}return c.pop(),d.pop(),h};z.isEqual=function(a,b){return G(a,b,[],[])},z.isEmpty=function(a){if(null==a)return!0;if(z.isArray(a)||z.isString(a))return 0===a.length;for(var b in a)if(z.has(a,b))return!1;return!0},z.isElement=function(a){return!(!a||1!==a.nodeType)},z.isArray=w||function(a){return"[object Array]"==l.call(a)},z.isObject=function(a){return a===Object(a)},A(["Arguments","Function","String","Number","Date","RegExp"],function(a){z["is"+a]=function(b){return l.call(b)=="[object "+a+"]"}}),z.isArguments(arguments)||(z.isArguments=function(a){return!(!a||!z.has(a,"callee"))}),"function"!=typeof/./&&(z.isFunction=function(a){return"function"==typeof a}),z.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},z.isNaN=function(a){return z.isNumber(a)&&a!=+a},z.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"==l.call(a)},z.isNull=function(a){return null===a},z.isUndefined=function(a){return void 0===a},z.has=function(a,b){return m.call(a,b)},z.noConflict=function(){return a._=d,this},z.identity=function(a){return a},z.times=function(a,b,c){for(var d=Array(a),e=0;a>e;e++)d[e]=b.call(c,e);return d},z.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))};var H={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};H.unescape=z.invert(H.escape);var I={escape:new RegExp("["+z.keys(H.escape).join("")+"]","g"),unescape:new RegExp("("+z.keys(H.unescape).join("|")+")","g")};z.each(["escape","unescape"],function(a){z[a]=function(b){return null==b?"":(""+b).replace(I[a],function(b){return H[a][b]})}}),z.result=function(a,b){if(null==a)return null;var c=a[b];return z.isFunction(c)?c.call(a):c},z.mixin=function(a){A(z.functions(a),function(b){var c=z[b]=a[b];z.prototype[b]=function(){var a=[this._wrapped];return i.apply(a,arguments),N.call(this,c.apply(z,a))}})};var J=0;z.uniqueId=function(a){var b=++J+"";return a?a+b:b},z.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,L={
+"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},M=/\\|'|\r|\n|\t|\u2028|\u2029/g;z.template=function(a,b,c){var d;c=z.defaults({},c,z.templateSettings);var e=new RegExp([(c.escape||K).source,(c.interpolate||K).source,(c.evaluate||K).source].join("|")+"|$","g"),f=0,g="__p+='";a.replace(e,function(b,c,d,e,h){return g+=a.slice(f,h).replace(M,function(a){return"\\"+L[a]}),c&&(g+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'"),d&&(g+="'+\n((__t=("+d+"))==null?'':__t)+\n'"),e&&(g+="';\n"+e+"\n__p+='"),f=h+b.length,b}),g+="';\n",c.variable||(g="with(obj||{}){\n"+g+"}\n"),g="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+g+"return __p;\n";try{d=new Function(c.variable||"obj","_",g)}catch(h){throw h.source=g,h}if(b)return d(b,z);var i=function(a){return d.call(this,a,z)};return i.source="function("+(c.variable||"obj")+"){\n"+g+"}",i},z.chain=function(a){return z(a).chain()};var N=function(a){return this._chain?z(a).chain():a};z.mixin(z),A(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=f[a];z.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!=a&&"splice"!=a||0!==c.length||delete c[0],N.call(this,c)}}),A(["concat","join","slice"],function(a){var b=f[a];z.prototype[a]=function(){return N.call(this,b.apply(this._wrapped,arguments))}}),z.extend(z.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],14:[function(b,c,d){(function(b){(function(){function e(a,b,c){for(var d=(c||0)-1,e=a?a.length:0;++d<e;)if(a[d]===b)return d;return-1}function f(a,b){var c=typeof b;if(a=a.cache,"boolean"==c||null==b)return a[b]?0:-1;"number"!=c&&"string"!=c&&(c="object");var d="number"==c?b:v+b;return a=(a=a[c])&&a[d],"object"==c?a&&e(a,b)>-1?0:-1:a?0:-1}function g(a){var b=this.cache,c=typeof a;if("boolean"==c||null==a)b[a]=!0;else{"number"!=c&&"string"!=c&&(c="object");var d="number"==c?a:v+a,e=b[c]||(b[c]={});"object"==c?(e[d]||(e[d]=[])).push(a):e[d]=!0}}function h(a){return a.charCodeAt(0)}function i(a,b){for(var c=a.criteria,d=b.criteria,e=-1,f=c.length;++e<f;){var g=c[e],h=d[e];if(g!==h){if(g>h||"undefined"==typeof g)return 1;if(h>g||"undefined"==typeof h)return-1}}return a.index-b.index}function j(a){var b=-1,c=a.length,d=a[0],e=a[c/2|0],f=a[c-1];if(d&&"object"==typeof d&&e&&"object"==typeof e&&f&&"object"==typeof f)return!1;var h=m();h["false"]=h["null"]=h["true"]=h.undefined=!1;var i=m();for(i.array=a,i.cache=h,i.push=g;++b<c;)i.push(a[b]);return i}function k(a){return"\\"+Z[a]}function l(){return s.pop()||[]}function m(){return t.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function n(a){a.length=0,s.length<x&&s.push(a)}function o(a){var b=a.cache;b&&o(b),a.array=a.cache=a.criteria=a.object=a.number=a.string=a.value=null,t.length<x&&t.push(a)}function p(a,b,c){b||(b=0),"undefined"==typeof c&&(c=a?a.length:0);for(var d=-1,e=c-b||0,f=Array(0>e?0:e);++d<e;)f[d]=a[b+d];return f}function q(a){function b(a){return a&&"object"==typeof a&&!Zc(a)&&Hc.call(a,"__wrapped__")?a:new c(a)}function c(a,b){this.__chain__=!!b,this.__wrapped__=a}function d(a){function b(){if(d){var a=p(d);Ic.apply(a,arguments)}if(this instanceof b){var f=s(c.prototype),g=c.apply(f,a||arguments);return Ea(g)?g:f}return c.apply(e,a||arguments)}var c=a[0],d=a[2],e=a[4];return Yc(b,a),b}function g(a,b,c,d,e){if(c){var f=c(a);if("undefined"!=typeof f)return f}var h=Ea(a);if(!h)return a;var i=Ac.call(a);if(!V[i])return a;var j=Wc[i];switch(i){case O:case P:return new j(+a);case R:case U:return new j(a);case T:return f=j(a.source,D.exec(a)),f.lastIndex=a.lastIndex,f}var k=Zc(a);if(b){var m=!d;d||(d=l()),e||(e=l());for(var o=d.length;o--;)if(d[o]==a)return e[o];f=k?j(a.length):{}}else f=k?p(a):ed({},a);return k&&(Hc.call(a,"index")&&(f.index=a.index),Hc.call(a,"input")&&(f.input=a.input)),b?(d.push(a),e.push(f),(k?Ya:hd)(a,function(a,h){f[h]=g(a,b,c,d,e)}),m&&(n(d),n(e)),f):f}function s(a,b){return Ea(a)?Nc(a):{}}function t(a,b,c){if("function"!=typeof a)return Zb;if("undefined"==typeof b||!("prototype"in a))return a;var d=a.__bindData__;if("undefined"==typeof d&&(Xc.funcNames&&(d=!a.name),d=d||!Xc.funcDecomp,!d)){var e=Fc.call(a);Xc.funcNames||(d=!E.test(e)),d||(d=I.test(e),Yc(a,d))}if(d===!1||d!==!0&&1&d[1])return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return Ib(a,b)}function x(a){function b(){var a=i?g:this;if(e){var n=p(e);Ic.apply(n,arguments)}if((f||k)&&(n||(n=p(arguments)),f&&Ic.apply(n,f),k&&n.length<h))return d|=16,x([c,l?d:-4&d,n,null,g,h]);if(n||(n=arguments),j&&(c=a[m]),this instanceof b){a=s(c.prototype);var o=c.apply(a,n);return Ea(o)?o:a}return c.apply(a,n)}var c=a[0],d=a[1],e=a[2],f=a[3],g=a[4],h=a[5],i=1&d,j=2&d,k=4&d,l=8&d,m=c;return Yc(b,a),b}function Z(a,b){var c=-1,d=ia(),g=a?a.length:0,h=g>=w&&d===e,i=[];if(h){var k=j(b);k?(d=f,b=k):h=!1}for(;++c<g;){var l=a[c];d(b,l)<0&&i.push(l)}return h&&o(b),i}function _(a,b,c,d){for(var e=(d||0)-1,f=a?a.length:0,g=[];++e<f;){var h=a[e];if(h&&"object"==typeof h&&"number"==typeof h.length&&(Zc(h)||ma(h))){b||(h=_(h,b,c));var i=-1,j=h.length,k=g.length;for(g.length+=j;++i<j;)g[k++]=h[i]}else c||g.push(h)}return g}function aa(a,b,c,d,e,f){if(c){var g=c(a,b);if("undefined"!=typeof g)return!!g}if(a===b)return 0!==a||1/a==1/b;var h=typeof a,i=typeof b;if(!(a!==a||a&&Y[h]||b&&Y[i]))return!1;if(null==a||null==b)return a===b;var j=Ac.call(a),k=Ac.call(b);if(j==M&&(j=S),k==M&&(k=S),j!=k)return!1;switch(j){case O:case P:return+a==+b;case R:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case T:case U:return a==vc(b)}var m=j==N;if(!m){var o=Hc.call(a,"__wrapped__"),p=Hc.call(b,"__wrapped__");if(o||p)return aa(o?a.__wrapped__:a,p?b.__wrapped__:b,c,d,e,f);if(j!=S)return!1;var q=a.constructor,r=b.constructor;if(q!=r&&!(Da(q)&&q instanceof q&&Da(r)&&r instanceof r)&&"constructor"in a&&"constructor"in b)return!1}var s=!e;e||(e=l()),f||(f=l());for(var t=e.length;t--;)if(e[t]==a)return f[t]==b;var u=0;if(g=!0,e.push(a),f.push(b),m){if(t=a.length,u=b.length,g=u==t,g||d)for(;u--;){var v=t,w=b[u];if(d)for(;v--&&!(g=aa(a[v],w,c,d,e,f)););else if(!(g=aa(a[u],w,c,d,e,f)))break}}else gd(b,function(b,h,i){return Hc.call(i,h)?(u++,g=Hc.call(a,h)&&aa(a[h],b,c,d,e,f)):void 0}),g&&!d&&gd(a,function(a,b,c){return Hc.call(c,b)?g=--u>-1:void 0});return e.pop(),f.pop(),s&&(n(e),n(f)),g}function ba(a,b,c,d,e){(Zc(b)?Ya:hd)(b,function(b,f){var g,h,i=b,j=a[f];if(b&&((h=Zc(b))||id(b))){for(var k=d.length;k--;)if(g=d[k]==b){j=e[k];break}if(!g){var l;c&&(i=c(j,b),(l="undefined"!=typeof i)&&(j=i)),l||(j=h?Zc(j)?j:[]:id(j)?j:{}),d.push(b),e.push(j),l||ba(j,b,c,d,e)}}else c&&(i=c(j,b),"undefined"==typeof i&&(i=b)),"undefined"!=typeof i&&(j=i);a[f]=j})}function ca(a,b){return a+Ec(Vc()*(b-a+1))}function ea(a,b,c){var d=-1,g=ia(),h=a?a.length:0,i=[],k=!b&&h>=w&&g===e,m=c||k?l():i;if(k){var p=j(m);g=f,m=p}for(;++d<h;){var q=a[d],r=c?c(q,d,a):q;(b?!d||m[m.length-1]!==r:g(m,r)<0)&&((c||k)&&m.push(r),i.push(q))}return k?(n(m.array),o(m)):c&&n(m),i}function fa(a){return function(c,d,e){var f={};d=b.createCallback(d,e,3);var g=-1,h=c?c.length:0;if("number"==typeof h)for(;++g<h;){var i=c[g];a(f,i,d(i,g,c),c)}else hd(c,function(b,c,e){a(f,b,d(b,c,e),e)});return f}}function ga(a,b,c,e,f,g){var h=1&b,i=2&b,j=4&b,k=16&b,l=32&b;if(!i&&!Da(a))throw new wc;k&&!c.length&&(b&=-17,k=c=!1),l&&!e.length&&(b&=-33,l=e=!1);var m=a&&a.__bindData__;if(m&&m!==!0)return m=p(m),m[2]&&(m[2]=p(m[2])),m[3]&&(m[3]=p(m[3])),!h||1&m[1]||(m[4]=f),!h&&1&m[1]&&(b|=8),!j||4&m[1]||(m[5]=g),k&&Ic.apply(m[2]||(m[2]=[]),c),l&&Lc.apply(m[3]||(m[3]=[]),e),m[1]|=b,ga.apply(null,m);var n=1==b||17===b?d:x;return n([a,b,c,e,f,g])}function ha(a){return ad[a]}function ia(){var a=(a=b.indexOf)===rb?e:a;return a}function ja(a){return"function"==typeof a&&Bc.test(a)}function ka(a){var b,c;return a&&Ac.call(a)==S&&(b=a.constructor,!Da(b)||b instanceof b)?(gd(a,function(a,b){c=b}),"undefined"==typeof c||Hc.call(a,c)):!1}function la(a){return bd[a]}function ma(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ac.call(a)==M||!1}function na(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c=b,b=!1),g(a,b,"function"==typeof c&&t(c,d,1))}function oa(a,b,c){return g(a,!0,"function"==typeof b&&t(b,c,1))}function pa(a,b){var c=s(a);return b?ed(c,b):c}function qa(a,c,d){var e;return c=b.createCallback(c,d,3),hd(a,function(a,b,d){return c(a,b,d)?(e=b,!1):void 0}),e}function ra(a,c,d){var e;return c=b.createCallback(c,d,3),ta(a,function(a,b,d){return c(a,b,d)?(e=b,!1):void 0}),e}function sa(a,b,c){var d=[];gd(a,function(a,b){d.push(b,a)});var e=d.length;for(b=t(b,c,3);e--&&b(d[e--],d[e],a)!==!1;);return a}function ta(a,b,c){var d=_c(a),e=d.length;for(b=t(b,c,3);e--;){var f=d[e];if(b(a[f],f,a)===!1)break}return a}function ua(a){var b=[];return gd(a,function(a,c){Da(a)&&b.push(c)}),b.sort()}function va(a,b){return a?Hc.call(a,b):!1}function wa(a){for(var b=-1,c=_c(a),d=c.length,e={};++b<d;){var f=c[b];e[a[f]]=f}return e}function xa(a){return a===!0||a===!1||a&&"object"==typeof a&&Ac.call(a)==O||!1}function ya(a){return a&&"object"==typeof a&&Ac.call(a)==P||!1}function za(a){return a&&1===a.nodeType||!1}function Aa(a){var b=!0;if(!a)return b;var c=Ac.call(a),d=a.length;return c==N||c==U||c==M||c==S&&"number"==typeof d&&Da(a.splice)?!d:(hd(a,function(){return b=!1}),b)}function Ba(a,b,c,d){return aa(a,b,"function"==typeof c&&t(c,d,2))}function Ca(a){return Pc(a)&&!Qc(parseFloat(a))}function Da(a){return"function"==typeof a}function Ea(a){return!(!a||!Y[typeof a])}function Fa(a){return Ha(a)&&a!=+a}function Ga(a){return null===a}function Ha(a){return"number"==typeof a||a&&"object"==typeof a&&Ac.call(a)==R||!1}function Ia(a){return a&&"object"==typeof a&&Ac.call(a)==T||!1}function Ja(a){return"string"==typeof a||a&&"object"==typeof a&&Ac.call(a)==U||!1}function Ka(a){return"undefined"==typeof a}function La(a,c,d){var e={};return c=b.createCallback(c,d,3),hd(a,function(a,b,d){e[b]=c(a,b,d)}),e}function Ma(a){var b=arguments,c=2;if(!Ea(a))return a;if("number"!=typeof b[2]&&(c=b.length),c>3&&"function"==typeof b[c-2])var d=t(b[--c-1],b[c--],2);else c>2&&"function"==typeof b[c-1]&&(d=b[--c]);for(var e=p(arguments,1,c),f=-1,g=l(),h=l();++f<c;)ba(a,e[f],d,g,h);return n(g),n(h),a}function Na(a,c,d){var e={};if("function"!=typeof c){var f=[];gd(a,function(a,b){f.push(b)}),f=Z(f,_(arguments,!0,!1,1));for(var g=-1,h=f.length;++g<h;){var i=f[g];e[i]=a[i]}}else c=b.createCallback(c,d,3),gd(a,function(a,b,d){c(a,b,d)||(e[b]=a)});return e}function Oa(a){for(var b=-1,c=_c(a),d=c.length,e=nc(d);++b<d;){var f=c[b];e[b]=[f,a[f]]}return e}function Pa(a,c,d){var e={};if("function"!=typeof c)for(var f=-1,g=_(arguments,!0,!1,1),h=Ea(a)?g.length:0;++f<h;){var i=g[f];i in a&&(e[i]=a[i])}else c=b.createCallback(c,d,3),gd(a,function(a,b,d){c(a,b,d)&&(e[b]=a)});return e}function Qa(a,c,d,e){var f=Zc(a);if(null==d)if(f)d=[];else{var g=a&&a.constructor,h=g&&g.prototype;d=s(h)}return c&&(c=b.createCallback(c,e,4),(f?Ya:hd)(a,function(a,b,e){return c(d,a,b,e)})),d}function Ra(a){for(var b=-1,c=_c(a),d=c.length,e=nc(d);++b<d;)e[b]=a[c[b]];return e}function Sa(a){for(var b=arguments,c=-1,d=_(b,!0,!1,1),e=b[2]&&b[2][b[1]]===a?1:d.length,f=nc(e);++c<e;)f[c]=a[d[c]];return f}function Ta(a,b,c){var d=-1,e=ia(),f=a?a.length:0,g=!1;return c=(0>c?Sc(0,f+c):c)||0,Zc(a)?g=e(a,b,c)>-1:"number"==typeof f?g=(Ja(a)?a.indexOf(b,c):e(a,b,c))>-1:hd(a,function(a){return++d>=c?!(g=a===b):void 0}),g}function Ua(a,c,d){var e=!0;c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g&&(e=!!c(a[f],f,a)););else hd(a,function(a,b,d){return e=!!c(a,b,d)});return e}function Va(a,c,d){var e=[];c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g;){var h=a[f];c(h,f,a)&&e.push(h)}else hd(a,function(a,b,d){c(a,b,d)&&e.push(a)});return e}function Wa(a,c,d){c=b.createCallback(c,d,3);var e=-1,f=a?a.length:0;if("number"!=typeof f){var g;return hd(a,function(a,b,d){return c(a,b,d)?(g=a,!1):void 0}),g}for(;++e<f;){var h=a[e];if(c(h,e,a))return h}}function Xa(a,c,d){var e;return c=b.createCallback(c,d,3),Za(a,function(a,b,d){return c(a,b,d)?(e=a,!1):void 0}),e}function Ya(a,b,c){var d=-1,e=a?a.length:0;if(b=b&&"undefined"==typeof c?b:t(b,c,3),"number"==typeof e)for(;++d<e&&b(a[d],d,a)!==!1;);else hd(a,b);return a}function Za(a,b,c){var d=a?a.length:0;if(b=b&&"undefined"==typeof c?b:t(b,c,3),"number"==typeof d)for(;d--&&b(a[d],d,a)!==!1;);else{var e=_c(a);d=e.length,hd(a,function(a,c,f){return c=e?e[--d]:--d,b(f[c],c,f)})}return a}function $a(a,b){var c=p(arguments,2),d=-1,e="function"==typeof b,f=a?a.length:0,g=nc("number"==typeof f?f:0);return Ya(a,function(a){g[++d]=(e?b:a[b]).apply(a,c)}),g}function _a(a,c,d){var e=-1,f=a?a.length:0;if(c=b.createCallback(c,d,3),"number"==typeof f)for(var g=nc(f);++e<f;)g[e]=c(a[e],e,a);else g=[],hd(a,function(a,b,d){g[++e]=c(a,b,d)});return g}function ab(a,c,d){var e=-(1/0),f=e;if("function"!=typeof c&&d&&d[c]===a&&(c=null),null==c&&Zc(a))for(var g=-1,i=a.length;++g<i;){var j=a[g];j>f&&(f=j)}else c=null==c&&Ja(a)?h:b.createCallback(c,d,3),Ya(a,function(a,b,d){var g=c(a,b,d);g>e&&(e=g,f=a)});return f}function bb(a,c,d){var e=1/0,f=e;if("function"!=typeof c&&d&&d[c]===a&&(c=null),null==c&&Zc(a))for(var g=-1,i=a.length;++g<i;){var j=a[g];f>j&&(f=j)}else c=null==c&&Ja(a)?h:b.createCallback(c,d,3),Ya(a,function(a,b,d){var g=c(a,b,d);e>g&&(e=g,f=a)});return f}function cb(a,c,d,e){if(!a)return d;var f=arguments.length<3;c=b.createCallback(c,e,4);var g=-1,h=a.length;if("number"==typeof h)for(f&&(d=a[++g]);++g<h;)d=c(d,a[g],g,a);else hd(a,function(a,b,e){d=f?(f=!1,a):c(d,a,b,e)});return d}function db(a,c,d,e){var f=arguments.length<3;return c=b.createCallback(c,e,4),Za(a,function(a,b,e){d=f?(f=!1,a):c(d,a,b,e)}),d}function eb(a,c,d){return c=b.createCallback(c,d,3),Va(a,function(a,b,d){return!c(a,b,d)})}function fb(a,b,c){if(a&&"number"!=typeof a.length&&(a=Ra(a)),null==b||c)return a?a[ca(0,a.length-1)]:r;var d=gb(a);return d.length=Tc(Sc(0,b),d.length),d}function gb(a){var b=-1,c=a?a.length:0,d=nc("number"==typeof c?c:0);return Ya(a,function(a){var c=ca(0,++b);d[b]=d[c],d[c]=a}),d}function hb(a){var b=a?a.length:0;return"number"==typeof b?b:_c(a).length}function ib(a,c,d){var e;c=b.createCallback(c,d,3);var f=-1,g=a?a.length:0;if("number"==typeof g)for(;++f<g&&!(e=c(a[f],f,a)););else hd(a,function(a,b,d){return!(e=c(a,b,d))});return!!e}function jb(a,c,d){var e=-1,f=Zc(c),g=a?a.length:0,h=nc("number"==typeof g?g:0);for(f||(c=b.createCallback(c,d,3)),Ya(a,function(a,b,d){var g=h[++e]=m();f?g.criteria=_a(c,function(b){return a[b]}):(g.criteria=l())[0]=c(a,b,d),g.index=e,g.value=a}),g=h.length,h.sort(i);g--;){var j=h[g];h[g]=j.value,f||n(j.criteria),o(j)}return h}function kb(a){return a&&"number"==typeof a.length?p(a):Ra(a)}function lb(a){for(var b=-1,c=a?a.length:0,d=[];++b<c;){var e=a[b];e&&d.push(e)}return d}function mb(a){return Z(a,_(arguments,!0,!0,1))}function nb(a,c,d){var e=-1,f=a?a.length:0;for(c=b.createCallback(c,d,3);++e<f;)if(c(a[e],e,a))return e;return-1}function ob(a,c,d){var e=a?a.length:0;for(c=b.createCallback(c,d,3);e--;)if(c(a[e],e,a))return e;return-1}function pb(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=-1;for(c=b.createCallback(c,d,3);++g<f&&c(a[g],g,a);)e++}else if(e=c,null==e||d)return a?a[0]:r;return p(a,0,Tc(Sc(0,e),f))}function qb(a,b,c,d){return"boolean"!=typeof b&&null!=b&&(d=c,c="function"!=typeof b&&d&&d[b]===a?null:b,b=!1),null!=c&&(a=_a(a,c,d)),_(a,b)}function rb(a,b,c){if("number"==typeof c){var d=a?a.length:0;c=0>c?Sc(0,d+c):c||0}else if(c){var f=Ab(a,b);return a[f]===b?f:-1}return e(a,b,c)}function sb(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=f;for(c=b.createCallback(c,d,3);g--&&c(a[g],g,a);)e++}else e=null==c||d?1:c||e;return p(a,0,Tc(Sc(0,f-e),f))}function tb(){for(var a=[],b=-1,c=arguments.length,d=l(),g=ia(),h=g===e,i=l();++b<c;){var k=arguments[b];(Zc(k)||ma(k))&&(a.push(k),d.push(h&&k.length>=w&&j(b?a[b]:i)))}var m=a[0],p=-1,q=m?m.length:0,r=[];a:for(;++p<q;){var s=d[0];if(k=m[p],(s?f(s,k):g(i,k))<0){for(b=c,(s||i).push(k);--b;)if(s=d[b],(s?f(s,k):g(a[b],k))<0)continue a;r.push(k)}}for(;c--;)s=d[c],s&&o(s);return n(d),n(i),r}function ub(a,c,d){var e=0,f=a?a.length:0;if("number"!=typeof c&&null!=c){var g=f;for(c=b.createCallback(c,d,3);g--&&c(a[g],g,a);)e++}else if(e=c,null==e||d)return a?a[f-1]:r;return p(a,Sc(0,f-e))}function vb(a,b,c){var d=a?a.length:0;for("number"==typeof c&&(d=(0>c?Sc(0,d+c):Tc(c,d-1))+1);d--;)if(a[d]===b)return d;return-1}function wb(a){for(var b=arguments,c=0,d=b.length,e=a?a.length:0;++c<d;)for(var f=-1,g=b[c];++f<e;)a[f]===g&&(Kc.call(a,f--,1),e--);return a}function xb(a,b,c){a=+a||0,c="number"==typeof c?c:+c||1,null==b&&(b=a,a=0);for(var d=-1,e=Sc(0,Cc((b-a)/(c||1))),f=nc(e);++d<e;)f[d]=a,a+=c;return f}function yb(a,c,d){var e=-1,f=a?a.length:0,g=[];for(c=b.createCallback(c,d,3);++e<f;){var h=a[e];c(h,e,a)&&(g.push(h),Kc.call(a,e--,1),f--)}return g}function zb(a,c,d){if("number"!=typeof c&&null!=c){var e=0,f=-1,g=a?a.length:0;for(c=b.createCallback(c,d,3);++f<g&&c(a[f],f,a);)e++}else e=null==c||d?1:Sc(0,c);return p(a,e)}function Ab(a,c,d,e){var f=0,g=a?a.length:f;for(d=d?b.createCallback(d,e,1):Zb,c=d(c);g>f;){var h=f+g>>>1;d(a[h])<c?f=h+1:g=h}return f}function Bb(){return ea(_(arguments,!0,!0))}function Cb(a,c,d,e){return"boolean"!=typeof c&&null!=c&&(e=d,d="function"!=typeof c&&e&&e[c]===a?null:c,c=!1),null!=d&&(d=b.createCallback(d,e,3)),ea(a,c,d)}function Db(a){return Z(a,p(arguments,1))}function Eb(){for(var a=-1,b=arguments.length;++a<b;){var c=arguments[a];if(Zc(c)||ma(c))var d=d?ea(Z(d,c).concat(Z(c,d))):c}return d||[]}function Fb(){for(var a=arguments.length>1?arguments:arguments[0],b=-1,c=a?ab(md(a,"length")):0,d=nc(0>c?0:c);++b<c;)d[b]=md(a,b);return d}function Gb(a,b){var c=-1,d=a?a.length:0,e={};for(b||!d||Zc(a[0])||(b=[]);++c<d;){var f=a[c];b?e[f]=b[c]:f&&(e[f[0]]=f[1])}return e}function Hb(a,b){if(!Da(b))throw new wc;return function(){return--a<1?b.apply(this,arguments):void 0}}function Ib(a,b){return arguments.length>2?ga(a,17,p(arguments,2),null,b):ga(a,1,null,null,b)}function Jb(a){for(var b=arguments.length>1?_(arguments,!0,!1,1):ua(a),c=-1,d=b.length;++c<d;){var e=b[c];a[e]=ga(a[e],1,null,null,a)}return a}function Kb(a,b){return arguments.length>2?ga(b,19,p(arguments,2),null,a):ga(b,3,null,null,a)}function Lb(){for(var a=arguments,b=a.length;b--;)if(!Da(a[b]))throw new wc;return function(){for(var b=arguments,c=a.length;c--;)b=[a[c].apply(this,b)];return b[0]}}function Mb(a,b){return b="number"==typeof b?b:+b||a.length,ga(a,4,null,null,null,b)}function Nb(a,b,c){var d,e,f,g,h,i,j,k=0,l=!1,m=!0;if(!Da(a))throw new wc;if(b=Sc(0,b)||0,c===!0){var n=!0;m=!1}else Ea(c)&&(n=c.leading,l="maxWait"in c&&(Sc(b,c.maxWait)||0),m="trailing"in c?c.trailing:m);var o=function(){var c=b-(od()-g);if(0>=c){e&&Dc(e);var l=j;e=i=j=r,l&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))}else i=Jc(o,c)},p=function(){i&&Dc(i),e=i=j=r,(m||l!==b)&&(k=od(),f=a.apply(h,d),i||e||(d=h=null))};return function(){if(d=arguments,g=od(),h=this,j=m&&(i||!n),l===!1)var c=n&&!i;else{e||n||(k=g);var q=l-(g-k),r=0>=q;r?(e&&(e=Dc(e)),k=g,f=a.apply(h,d)):e||(e=Jc(p,q))}return r&&i?i=Dc(i):i||b===l||(i=Jc(o,b)),c&&(r=!0,f=a.apply(h,d)),!r||i||e||(d=h=null),f}}function Ob(a){if(!Da(a))throw new wc;var b=p(arguments,1);return Jc(function(){a.apply(r,b)},1)}function Pb(a,b){if(!Da(a))throw new wc;var c=p(arguments,2);return Jc(function(){a.apply(r,c)},b)}function Qb(a,b){if(!Da(a))throw new wc;var c=function(){var d=c.cache,e=b?b.apply(this,arguments):v+arguments[0];return Hc.call(d,e)?d[e]:d[e]=a.apply(this,arguments)};return c.cache={},c}function Rb(a){var b,c;if(!Da(a))throw new wc;return function(){return b?c:(b=!0,c=a.apply(this,arguments),a=null,c)}}function Sb(a){return ga(a,16,p(arguments,1))}function Tb(a){return ga(a,32,null,p(arguments,1))}function Ub(a,b,c){var d=!0,e=!0;if(!Da(a))throw new wc;return c===!1?d=!1:Ea(c)&&(d="leading"in c?c.leading:d,e="trailing"in c?c.trailing:e),W.leading=d,W.maxWait=b,W.trailing=e,Nb(a,b,W)}function Vb(a,b){return ga(b,16,[a])}function Wb(a){return function(){return a}}function Xb(a,b,c){var d=typeof a;if(null==a||"function"==d)return t(a,b,c);if("object"!=d)return bc(a);var e=_c(a),f=e[0],g=a[f];return 1!=e.length||g!==g||Ea(g)?function(b){for(var c=e.length,d=!1;c--&&(d=aa(b[e[c]],a[e[c]],null,!0)););return d}:function(a){var b=a[f];return g===b&&(0!==g||1/g==1/b)}}function Yb(a){return null==a?"":vc(a).replace(dd,ha)}function Zb(a){return a}function $b(a,d,e){var f=!0,g=d&&ua(d);d&&(e||g.length)||(null==e&&(e=d),h=c,d=a,a=b,g=ua(d)),e===!1?f=!1:Ea(e)&&"chain"in e&&(f=e.chain);var h=a,i=Da(h);Ya(g,function(b){var c=a[b]=d[b];i&&(h.prototype[b]=function(){var b=this.__chain__,d=this.__wrapped__,e=[d];Ic.apply(e,arguments);var g=c.apply(a,e);if(f||b){if(d===g&&Ea(g))return this;g=new h(g),g.__chain__=b}return g})})}function _b(){return a._=zc,this}function ac(){}function bc(a){return function(b){return b[a]}}function cc(a,b,c){var d=null==a,e=null==b;if(null==c&&("boolean"==typeof a&&e?(c=a,a=1):e||"boolean"!=typeof b||(c=b,e=!0)),d&&e&&(b=1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=Vc();return Tc(a+f*(b-a+parseFloat("1e-"+((f+"").length-1))),b)}return ca(a,b)}function dc(a,b){if(a){var c=a[b];return Da(c)?a[b]():c}}function ec(a,c,d){var e=b.templateSettings;a=vc(a||""),d=fd({},d,e);var f,g=fd({},d.imports,e.imports),h=_c(g),i=Ra(g),j=0,l=d.interpolate||H,m="__p += '",n=uc((d.escape||H).source+"|"+l.source+"|"+(l===F?C:H).source+"|"+(d.evaluate||H).source+"|$","g");a.replace(n,function(b,c,d,e,g,h){return d||(d=e),m+=a.slice(j,h).replace(J,k),c&&(m+="' +\n__e("+c+") +\n'"),g&&(f=!0,m+="';\n"+g+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),j=h+b.length,b}),m+="';\n";var o=d.variable,p=o;p||(o="obj",m="with ("+o+") {\n"+m+"\n}\n"),m=(f?m.replace(z,""):m).replace(A,"$1").replace(B,"$1;"),m="function("+o+") {\n"+(p?"":o+" || ("+o+" = {});\n")+"var __t, __p = '', __e = _.escape"+(f?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var q="\n/*\n//# sourceURL="+(d.sourceURL||"/lodash/template/source["+L++ +"]")+"\n*/";try{var s=qc(h,"return "+m+q).apply(r,i)}catch(t){throw t.source=m,t}return c?s(c):(s.source=m,s)}function fc(a,b,c){a=(a=+a)>-1?a:0;var d=-1,e=nc(a);for(b=t(b,c,1);++d<a;)e[d]=b(d);return e}function gc(a){return null==a?"":vc(a).replace(cd,la)}function hc(a){var b=++u;return vc(null==a?"":a)+b}function ic(a){return a=new c(a),a.__chain__=!0,a}function jc(a,b){return b(a),a}function kc(){return this.__chain__=!0,this}function lc(){return vc(this.__wrapped__)}function mc(){return this.__wrapped__}a=a?da.defaults($.Object(),a,da.pick($,K)):$;var nc=a.Array,oc=a.Boolean,pc=a.Date,qc=a.Function,rc=a.Math,sc=a.Number,tc=a.Object,uc=a.RegExp,vc=a.String,wc=a.TypeError,xc=[],yc=tc.prototype,zc=a._,Ac=yc.toString,Bc=uc("^"+vc(Ac).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Cc=rc.ceil,Dc=a.clearTimeout,Ec=rc.floor,Fc=qc.prototype.toString,Gc=ja(Gc=tc.getPrototypeOf)&&Gc,Hc=yc.hasOwnProperty,Ic=xc.push,Jc=a.setTimeout,Kc=xc.splice,Lc=xc.unshift,Mc=function(){try{var a={},b=ja(b=tc.defineProperty)&&b,c=b(a,a,a)&&b}catch(d){}return c}(),Nc=ja(Nc=tc.create)&&Nc,Oc=ja(Oc=nc.isArray)&&Oc,Pc=a.isFinite,Qc=a.isNaN,Rc=ja(Rc=tc.keys)&&Rc,Sc=rc.max,Tc=rc.min,Uc=a.parseInt,Vc=rc.random,Wc={};Wc[N]=nc,Wc[O]=oc,Wc[P]=pc,Wc[Q]=qc,Wc[S]=tc,Wc[R]=sc,Wc[T]=uc,Wc[U]=vc,c.prototype=b.prototype;var Xc=b.support={};Xc.funcDecomp=!ja(a.WinRTError)&&I.test(q),Xc.funcNames="string"==typeof qc.name,b.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:F,variable:"",imports:{_:b}},Nc||(s=function(){function b(){}return function(c){if(Ea(c)){b.prototype=c;var d=new b;b.prototype=null}return d||a.Object()}}());var Yc=Mc?function(a,b){X.value=b,Mc(a,"__bindData__",X),X.value=null}:ac,Zc=Oc||function(a){return a&&"object"==typeof a&&"number"==typeof a.length&&Ac.call(a)==N||!1},$c=function(a){var b,c=a,d=[];if(!c)return d;if(!Y[typeof a])return d;for(b in c)Hc.call(c,b)&&d.push(b);return d},_c=Rc?function(a){return Ea(a)?Rc(a):[]}:$c,ad={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},bd=wa(ad),cd=uc("("+_c(bd).join("|")+")","g"),dd=uc("["+_c(ad).join("")+"]","g"),ed=function(a,b,c){var d,e=a,f=e;if(!e)return f;var g=arguments,h=0,i="number"==typeof c?2:g.length;if(i>3&&"function"==typeof g[i-2])var j=t(g[--i-1],g[i--],2);else i>2&&"function"==typeof g[i-1]&&(j=g[--i]);for(;++h<i;)if(e=g[h],e&&Y[typeof e])for(var k=-1,l=Y[typeof e]&&_c(e),m=l?l.length:0;++k<m;)d=l[k],f[d]=j?j(f[d],e[d]):e[d];return f},fd=function(a,b,c){var d,e=a,f=e;if(!e)return f;for(var g=arguments,h=0,i="number"==typeof c?2:g.length;++h<i;)if(e=g[h],e&&Y[typeof e])for(var j=-1,k=Y[typeof e]&&_c(e),l=k?k.length:0;++j<l;)d=k[j],"undefined"==typeof f[d]&&(f[d]=e[d]);return f},gd=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!Y[typeof e])return f;b=b&&"undefined"==typeof c?b:t(b,c,3);for(d in e)if(b(e[d],d,a)===!1)return f;return f},hd=function(a,b,c){var d,e=a,f=e;if(!e)return f;if(!Y[typeof e])return f;b=b&&"undefined"==typeof c?b:t(b,c,3);for(var g=-1,h=Y[typeof e]&&_c(e),i=h?h.length:0;++g<i;)if(d=h[g],b(e[d],d,a)===!1)return f;return f},id=Gc?function(a){if(!a||Ac.call(a)!=S)return!1;var b=a.valueOf,c=ja(b)&&(c=Gc(b))&&Gc(c);return c?a==c||Gc(a)==c:ka(a)}:ka,jd=fa(function(a,b,c){Hc.call(a,c)?a[c]++:a[c]=1}),kd=fa(function(a,b,c){(Hc.call(a,c)?a[c]:a[c]=[]).push(b)}),ld=fa(function(a,b,c){a[c]=b}),md=_a,nd=Va,od=ja(od=pc.now)&&od||function(){return(new pc).getTime()},pd=8==Uc(y+"08")?Uc:function(a,b){return Uc(Ja(a)?a.replace(G,""):a,b||0)};return b.after=Hb,b.assign=ed,b.at=Sa,b.bind=Ib,b.bindAll=Jb,b.bindKey=Kb,b.chain=ic,b.compact=lb,b.compose=Lb,b.constant=Wb,b.countBy=jd,b.create=pa,b.createCallback=Xb,b.curry=Mb,b.debounce=Nb,b.defaults=fd,b.defer=Ob,b.delay=Pb,b.difference=mb,b.filter=Va,b.flatten=qb,b.forEach=Ya,b.forEachRight=Za,b.forIn=gd,b.forInRight=sa,b.forOwn=hd,b.forOwnRight=ta,b.functions=ua,b.groupBy=kd,b.indexBy=ld,b.initial=sb,b.intersection=tb,b.invert=wa,b.invoke=$a,b.keys=_c,b.map=_a,b.mapValues=La,b.max=ab,b.memoize=Qb,b.merge=Ma,b.min=bb,b.omit=Na,b.once=Rb,b.pairs=Oa,b.partial=Sb,b.partialRight=Tb,b.pick=Pa,b.pluck=md,b.property=bc,b.pull=wb,b.range=xb,b.reject=eb,b.remove=yb,b.rest=zb,b.shuffle=gb,b.sortBy=jb,b.tap=jc,b.throttle=Ub,b.times=fc,b.toArray=kb,b.transform=Qa,b.union=Bb,b.uniq=Cb,b.values=Ra,b.where=nd,b.without=Db,b.wrap=Vb,b.xor=Eb,b.zip=Fb,b.zipObject=Gb,b.collect=_a,b.drop=zb,b.each=Ya,b.eachRight=Za,b.extend=ed,b.methods=ua,b.object=Gb,b.select=Va,b.tail=zb,b.unique=Cb,b.unzip=Fb,$b(b),b.clone=na,b.cloneDeep=oa,b.contains=Ta,b.escape=Yb,b.every=Ua,b.find=Wa,b.findIndex=nb,b.findKey=qa,b.findLast=Xa,b.findLastIndex=ob,b.findLastKey=ra,b.has=va,b.identity=Zb,b.indexOf=rb,b.isArguments=ma,b.isArray=Zc,b.isBoolean=xa,b.isDate=ya,b.isElement=za,b.isEmpty=Aa,b.isEqual=Ba,b.isFinite=Ca,b.isFunction=Da,b.isNaN=Fa,b.isNull=Ga,b.isNumber=Ha,b.isObject=Ea,b.isPlainObject=id,b.isRegExp=Ia,b.isString=Ja,b.isUndefined=Ka,b.lastIndexOf=vb,b.mixin=$b,b.noConflict=_b,b.noop=ac,b.now=od,b.parseInt=pd,b.random=cc,b.reduce=cb,b.reduceRight=db,b.result=dc,b.runInContext=q,b.size=hb,b.some=ib,b.sortedIndex=Ab,b.template=ec,b.unescape=gc,b.uniqueId=hc,b.all=Ua,b.any=ib,b.detect=Wa,b.findWhere=Wa,b.foldl=cb,b.foldr=db,b.include=Ta,b.inject=cb,$b(function(){var a={};return hd(b,function(c,d){b.prototype[d]||(a[d]=c)}),a}(),!1),b.first=pb,b.last=ub,b.sample=fb,b.take=pb,b.head=pb,hd(b,function(a,d){var e="sample"!==d;b.prototype[d]||(b.prototype[d]=function(b,d){var f=this.__chain__,g=a(this.__wrapped__,b,d);return f||null!=b&&(!d||e&&"function"==typeof b)?new c(g,f):g})}),b.VERSION="2.4.2",b.prototype.chain=kc,b.prototype.toString=lc,b.prototype.value=mc,b.prototype.valueOf=mc,Ya(["join","pop","shift"],function(a){var d=xc[a];b.prototype[a]=function(){var a=this.__chain__,b=d.apply(this.__wrapped__,arguments);return a?new c(b,a):b}}),Ya(["push","reverse","sort","unshift"],function(a){var c=xc[a];b.prototype[a]=function(){return c.apply(this.__wrapped__,arguments),this}}),Ya(["concat","slice","splice"],function(a){var d=xc[a];b.prototype[a]=function(){return new c(d.apply(this.__wrapped__,arguments),this.__chain__)}}),b}var r,s=[],t=[],u=0,v=+new Date+"",w=75,x=40,y=" \f \ufeff\n\r\u2028\u2029 ᠎              ",z=/\b__p \+= '';/g,A=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,C=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,D=/\w*$/,E=/^\s*function[ \n\r\t]+\w/,F=/<%=([\s\S]+?)%>/g,G=RegExp("^["+y+"]*0+(?=.$)"),H=/($^)/,I=/\bthis\b/,J=/['\n\r\t\u2028\u2029\\]/g,K=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],L=0,M="[object Arguments]",N="[object Array]",O="[object Boolean]",P="[object Date]",Q="[object Function]",R="[object Number]",S="[object Object]",T="[object RegExp]",U="[object String]",V={};V[Q]=!1,V[M]=V[N]=V[O]=V[P]=V[R]=V[S]=V[T]=V[U]=!0;var W={leading:!1,maxWait:0,trailing:!1},X={configurable:!1,enumerable:!1,value:null,writable:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=Y[typeof window]&&window||this,_=Y[typeof d]&&d&&!d.nodeType&&d,aa=Y[typeof c]&&c&&!c.nodeType&&c,ba=aa&&aa.exports===_&&_,ca=Y[typeof b]&&b;!ca||ca.global!==ca&&ca.window!==ca||($=ca);var da=q();"function"==typeof a&&"object"==typeof a.amd&&a.amd?($._=da,a(function(){return da})):_&&aa?ba?(aa.exports=da)._=da:_._=da:$._=da}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(b,c,d){!function(b,e){"use strict";"object"==typeof d?c.exports=e():"function"==typeof a&&a.amd?a(e):b.UltraDeepClone=e()}(this,function(){function a(a){return"[object "+a+"]"}function b(a){for(var b=[],c=1;a>=c;c++)b.push("arg"+c);return b}function c(a){var c=b(a.length),d="return false || function ";return d+=a.name+"(",d+=c.join(", ")+") {\n",d+="return fn.apply(this, arguments);\n",d+="};",Function("fn",d)(a)}function d(a){return function(b,c,d){c.push(b);var e=a(b);return d.push(e),e}}function e(a){return a}function f(a){return new RegExp(a)}function g(a){return new Date(a.getTime())}function h(a){return c(a)}function i(a){return Object.create(Object.getPrototypeOf(a))}function j(a){return[]}function k(a){var b=a.length;return new a.constructor(b)}function l(a,b){return function(c,d,e){var f=this;return Object.getOwnPropertyNames(c).filter(function(a){return!b||-1===b.indexOf(a)}).reduce(function(a,b){var g=d.indexOf(c[b]);return-1===g?a[b]=f(c[b]):a[b]=e[g],a},a(c,d,e))}}var m=["caller","arguments"],n=["BYTES_PER_ELEMENT","get","set","slice","subarray","buffer","length","byteOffset","byteLength"],o=d(e),p=l(d(k),n),q={};return q[a("RegExp")]=d(f),q[a("Date")]=d(g),q[a("Function")]=l(d(h),m),q[a("Object")]=l(d(i)),q[a("Array")]=l(d(j)),["Null","Undefined","Number","String","Boolean"].map(a).forEach(function(a){q[a]=o}),["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].map(a).forEach(function(a){q[a]=p}),function(a){function b(a){var e=Object.prototype.toString.call(a);return q[e].call(b,a,c,d)}var c=[],d=[];return b(a)}})},{}],16:[function(a,b,c){function d(){for(var a={},b=0;b<arguments.length;b++){var c=arguments[b];for(var d in c)c.hasOwnProperty(d)&&(a[d]=c[d])}return a}b.exports=d},{}],17:[function(a,b,c){
+WYMeditor.EXTERNAL_MODULES.ObjectHistory=a("object-history")},{"object-history":1}]},{},[17])(17)}),function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.foo=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";b.exports=function(a){var b=this,c=b.constructor;return b.callbacks={},b.directMap={},b.sequenceLevels={},b.resetTimer,b.ignoreNextKeyup=!1,b.ignoreNextKeypress=!1,b.nextExpectedAction=!1,b.element=a,b.addEvents(),c.instances.push(b),b},b.exports.prototype.bind=a("./prototype/bind"),b.exports.prototype.bindMultiple=a("./prototype/bindMultiple"),b.exports.prototype.unbind=a("./prototype/unbind"),b.exports.prototype.trigger=a("./prototype/trigger"),b.exports.prototype.reset=a("./prototype/reset.js"),b.exports.prototype.stopCallback=a("./prototype/stopCallback"),b.exports.prototype.handleKey=a("./prototype/handleKey"),b.exports.prototype.addEvents=a("./prototype/addEvents"),b.exports.prototype.bindSingle=a("./prototype/bindSingle"),b.exports.prototype.getKeyInfo=a("./prototype/getKeyInfo"),b.exports.prototype.pickBestAction=a("./prototype/pickBestAction"),b.exports.prototype.getReverseMap=a("./prototype/getReverseMap"),b.exports.prototype.getMatches=a("./prototype/getMatches"),b.exports.prototype.resetSequences=a("./prototype/resetSequences"),b.exports.prototype.fireCallback=a("./prototype/fireCallback"),b.exports.prototype.bindSequence=a("./prototype/bindSequence"),b.exports.prototype.resetSequenceTimer=a("./prototype/resetSequenceTimer"),b.exports.prototype.detach=a("./prototype/detach"),b.exports.instances=[],b.exports.reset=a("./reset"),b.exports.REVERSE_MAP=null},{"./prototype/addEvents":2,"./prototype/bind":3,"./prototype/bindMultiple":4,"./prototype/bindSequence":5,"./prototype/bindSingle":6,"./prototype/detach":7,"./prototype/fireCallback":8,"./prototype/getKeyInfo":9,"./prototype/getMatches":10,"./prototype/getReverseMap":11,"./prototype/handleKey":12,"./prototype/pickBestAction":15,"./prototype/reset.js":16,"./prototype/resetSequenceTimer":17,"./prototype/resetSequences":18,"./prototype/stopCallback":19,"./prototype/trigger":20,"./prototype/unbind":21,"./reset":22}],2:[function(a,b,c){"use strict";b.exports=function(){var b=this,c=a("dom-event"),d=b.element;b.eventHandler=a("./handleKeyEvent").bind(b),c(d,"keypress",b.eventHandler),c(d,"keydown",b.eventHandler),c(d,"keyup",b.eventHandler)}},{"./handleKeyEvent":13,"dom-event":33}],3:[function(a,b,c){"use strict";b.exports=function(a,b,c){var d=this;return a=a instanceof Array?a:[a],d.bindMultiple(a,b,c),d}},{}],4:[function(a,b,c){"use strict";b.exports=function(a,b,c){for(var d=this,e=0;e<a.length;++e)d.bindSingle(a[e],b,c)}},{}],5:[function(a,b,c){"use strict";b.exports=function(b,c,d,e){function f(a){return function(){h.nextExpectedAction=a,++h.sequenceLevels[b],h.resetSequenceTimer()}}function g(c){var f;h.fireCallback(d,c,b),"keyup"!==e&&(f=a("../../helpers/characterFromEvent"),h.ignoreNextKeyup=f(c)),setTimeout(function(){h.resetSequences()},10)}var h=this;h.sequenceLevels[b]=0;for(var i=0;i<c.length;++i){var j=i+1===c.length,k=j?g:f(e||h.getKeyInfo(c[i+1]).action);h.bindSingle(c[i],k,e,b,i)}}},{"../../helpers/characterFromEvent":23}],6:[function(a,b,c){"use strict";b.exports=function(a,b,c,d,e){var f=this;f.directMap[a+":"+c]=b,a=a.replace(/\s+/g," ");var g,h=a.split(" ");return h.length>1?void f.bindSequence(a,h,b,c):(g=f.getKeyInfo(a,c),f.callbacks[g.key]=f.callbacks[g.key]||[],f.getMatches(g.key,g.modifiers,{type:g.action},d,a,e),void f.callbacks[g.key][d?"unshift":"push"]({callback:b,modifiers:g.modifiers,action:g.action,seq:d,level:e,combo:a}))}},{}],7:[function(a,b,c){var d=a("dom-event").off;b.exports=function(){var a=this,b=a.element;d(b,"keypress",a.eventHandler),d(b,"keydown",a.eventHandler),d(b,"keyup",a.eventHandler)}},{"dom-event":33}],8:[function(a,b,c){"use strict";b.exports=function(b,c,d,e){var f,g,h=this;h.stopCallback(c,c.target||c.srcElement,d,e)||b(c,d)===!1&&(f=a("../../helpers/preventDefault"),f(c),(g=a("../../helpers/stopPropagation"))(c))}},{"../../helpers/preventDefault":27,"../../helpers/stopPropagation":32}],9:[function(a,b,c){"use strict";b.exports=function(b,c){var d,e,f,g,h,i,j,k=this,l=[];for(d=a("../../helpers/keysFromString"),e=d(b),h=a("../../helpers/special-aliases"),i=a("../../helpers/shift-map"),j=a("../../helpers/isModifier"),g=0;g<e.length;++g)f=e[g],h[f]&&(f=h[f]),c&&"keypress"!==c&&i[f]&&(f=i[f],l.push("shift")),j(f)&&l.push(f);return c=k.pickBestAction(f,l,c),{key:f,modifiers:l,action:c}}},{"../../helpers/isModifier":25,"../../helpers/keysFromString":26,"../../helpers/shift-map":28,"../../helpers/special-aliases":29}],10:[function(a,b,c){"use strict";b.exports=function(b,c,d,e,f,g){var h,i,j,k,l=this,m=[],n=d.type;if("keypress"===n){var o=l.callbacks["any-character"]||[];o.forEach(function(a){m.push(a)})}if(!l.callbacks[b])return m;for(j=a("../../helpers/isModifier"),"keyup"===n&&j(b)&&(c=[b]),h=0;h<l.callbacks[b].length;++h)if(i=l.callbacks[b][h],(e||!i.seq||l.sequenceLevels[i.seq]===i.level)&&n===i.action&&(k=a("./modifiersMatch"),"keypress"===n&&!d.metaKey&&!d.ctrlKey||k(c,i.modifiers))){var p=!e&&i.combo===f,q=e&&i.seq===e&&i.level===g;(p||q)&&l.callbacks[b].splice(h,1),m.push(i)}return m}},{"../../helpers/isModifier":25,"./modifiersMatch":14}],11:[function(a,b,c){"use strict";b.exports=function(){var b,c=this,d=c.constructor;if(!d.REVERSE_MAP){d.REVERSE_MAP={},b=a("../../helpers/special-keys-map");for(var e in b)e>95&&112>e||b.hasOwnProperty(e)&&(d.REVERSE_MAP[b[e]]=e)}return d.REVERSE_MAP}},{"../../helpers/special-keys-map":31}],12:[function(a,b,c){"use strict";b.exports=function(b,c,d){var e,f,g,h,i=this,j={},k=0,l=!1;for(e=i.getMatches(b,c,d),f=0;f<e.length;++f)e[f].seq&&(k=Math.max(k,e[f].level));for(f=0;f<e.length;++f)if(e[f].seq){if(e[f].level!==k)continue;l=!0,j[e[f].seq]=1,i.fireCallback(e[f].callback,d,e[f].combo,e[f].seq)}else l||i.fireCallback(e[f].callback,d,e[f].combo);h="keypress"===d.type&&i.ignoreNextKeypress,g=a("../../helpers/isModifier"),d.type!==i.nextExpectedAction||g(b)||h||i.resetSequences(j),i.ignoreNextKeypress=l&&"keydown"===d.type}},{"../../helpers/isModifier":25}],13:[function(a,b,c){"use strict";b.exports=function(b){var c,d,e=this;"number"!=typeof b.which&&(b.which=b.keyCode),c=a("../../helpers/characterFromEvent");var f=c(b);if(f){if("keyup"===b.type&&e.ignoreNextKeyup===f)return void(e.ignoreNextKeyup=!1);d=a("../../helpers/eventModifiers"),e.handleKey(f,d(b),b)}}},{"../../helpers/characterFromEvent":23,"../../helpers/eventModifiers":24}],14:[function(a,b,c){"use strict";b.exports=function(a,b){return a.sort().join(",")===b.sort().join(",")}},{}],15:[function(a,b,c){"use strict";b.exports=function(a,b,c){var d=this;return c||(c=d.getReverseMap()[a]?"keydown":"keypress"),"keypress"===c&&b.length&&(c="keydown"),c}},{}],16:[function(a,b,c){"use strict";b.exports=function(){var a=this;return a.callbacks={},a.directMap={},this}},{}],17:[function(a,b,c){"use strict";b.exports=function(){var a=this;clearTimeout(a.resetTimer),a.resetTimer=setTimeout(function(){a.resetSequences()},1e3)}},{}],18:[function(a,b,c){"use strict";b.exports=function(a){var b=this;a=a||{};var c,d=!1;for(c in b.sequenceLevels)a[c]?d=!0:b.sequenceLevels[c]=0;d||(b.nextExpectedAction=!1)}},{}],19:[function(a,b,c){"use strict";b.exports=function(a,b){if((" "+b.className+" ").indexOf(" combokeys ")>-1)return!1;var c=b.tagName.toLowerCase();return"input"===c||"select"===c||"textarea"===c||b.isContentEditable}},{}],20:[function(a,b,c){"use strict";b.exports=function(a,b){var c=this;return c.directMap[a+":"+b]&&c.directMap[a+":"+b]({},a),this}},{}],21:[function(a,b,c){"use strict";b.exports=function(a,b){var c=this;return c.bind(a,function(){},b)}},{}],22:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.instances.forEach(function(a){a.reset()})}},{}],23:[function(a,b,c){"use strict";b.exports=function(b){var c,d;if(c=a("./special-keys-map"),d=a("./special-characters-map"),"keypress"===b.type){var e=String.fromCharCode(b.which);return b.shiftKey||(e=e.toLowerCase()),e}return c[b.which]?c[b.which]:d[b.which]?d[b.which]:String.fromCharCode(b.which).toLowerCase()}},{"./special-characters-map":30,"./special-keys-map":31}],24:[function(a,b,c){"use strict";b.exports=function(a){var b=[];return a.shiftKey&&b.push("shift"),a.altKey&&b.push("alt"),a.ctrlKey&&b.push("ctrl"),a.metaKey&&b.push("meta"),b}},{}],25:[function(a,b,c){"use strict";b.exports=function(a){return"shift"===a||"ctrl"===a||"alt"===a||"meta"===a}},{}],26:[function(a,b,c){"use strict";b.exports=function(a){return"+"===a?["+"]:a.split("+")}},{}],27:[function(a,b,c){"use strict";b.exports=function(a){return a.preventDefault?void a.preventDefault():void(a.returnValue=!1)}},{}],28:[function(a,b,c){"use strict";b.exports={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"}},{}],29:[function(a,b,c){"use strict";b.exports={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"}},{}],30:[function(a,b,c){"use strict";b.exports={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}},{}],31:[function(a,b,c){"use strict";b.exports={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",187:"plus",189:"minus",224:"meta"};for(var d=1;20>d;++d)b.exports[111+d]="f"+d;for(d=0;9>=d;++d)b.exports[d+96]=d},{}],32:[function(a,b,c){"use strict";b.exports=function(a){return a.stopPropagation?void a.stopPropagation():void(a.cancelBubble=!0)}},{}],33:[function(a,b,c){function d(a,b,c,d){return!a.addEventListener&&(b="on"+b),(a.addEventListener||a.attachEvent).call(a,b,c,d),c}function e(a,b,c,d){return!a.removeEventListener&&(b="on"+b),(a.removeEventListener||a.detachEvent).call(a,b,c,d),c}b.exports=d,b.exports.on=d,b.exports.off=e},{}],34:[function(a,b,c){WYMeditor.EXTERNAL_MODULES.Combokeys=a("combokeys")},{combokeys:1}]},{},[34])(34)}),function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.foo=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b,c){"use strict";b.exports=function(a,b,c){var d=this;if("function"!=typeof b)throw new Error("Expected a function");return d.element=a,d.onSensible=b,d.onAny=c,d.listen(),d},b.exports.prototype.listen=a("./prototype/listen"),b.exports.prototype.discern=a("./prototype/discern"),b.exports.prototype.reset=a("./prototype/reset"),b.exports.prototype.detach=a("./prototype/detach"),b.exports.prototype.callbackSensible=a("./prototype/callback-sensible"),b.exports.prototype.callbackAny=a("./prototype/callback-any")},{"./prototype/callback-any":2,"./prototype/callback-sensible":3,"./prototype/detach":4,"./prototype/discern":5,"./prototype/listen":6,"./prototype/reset":7}],2:[function(a,b,c){"use strict";b.exports=function(){var a=this;(a.onAny||function(){}).call(a)}},{}],3:[function(a,b,c){"use strict";b.exports=function(){var a=this;a.onSensible()}},{}],4:[function(a,b,c){"use strict";var d=a("dom-events").off,e=a("../../text-altering-event-types");b.exports=function(){var a=this;e.forEach(function(b){d(a.element,b,a.listener)})}},{"../../text-altering-event-types":8,"dom-events":11}],5:[function(a,b,c){"use strict";var d=a("../../textEditType");b.exports=function(a){var b=this,c=d(a);c&&(b.callbackAny(),b.previousEditType=b.lastEditType,b.lastEditType=c,b.previousEditType&&(b.lastEditType!==b.previousEditType||"paste"===b.lastEditType||"drop"===b.lastEditType)&&b.callbackSensible())}},{"../../textEditType":9}],6:[function(a,b,c){"use strict";var d,e;d=a("add-event-handler"),e=a("../../text-altering-event-types"),b.exports=function(){var a=this;a.listener=function(b){a.discern(b)},e.forEach(function(b){d(a.element,b,a.listener)})}},{"../../text-altering-event-types":8,"add-event-handler":10}],7:[function(a,b,c){"use strict";b.exports=function(){var a=this;delete a.lastEditType}},{}],8:[function(a,b,c){"use strict";b.exports=["keydown","paste","drop"]},{}],9:[function(a,b,c){"use strict";var d=["backspace"],e=["del","delete"],f=["altKey","ctrlKey","metaKey"],g=a("keycode");b.exports=function(a){if("keydown"===a.type){var b;if(f.forEach(function(c){a[c]&&(b=!0)}),b)return!1;var c=g(a);return d.indexOf(c)>-1?"backwardsRemoval":e.indexOf(c)>-1?"forwardRemoval":"space"===c?c:"enter"===c?c:"characterAddition"}if("paste"===a.type)return a.type;if("drop"===a.type)return a.type;throw new Error("Shouldn't get this far")}},{keycode:15}],10:[function(a,b,c){"use strict";b.exports=function(a,b,c){if(a.addEventListener)return a.addEventListener(b,c,!1);if(a.attachEvent)return a.attachEvent("on"+b,c);throw"No event handler adding interface found"}},{}],11:[function(a,b,c){var d=a("synthetic-dom-events"),e=function(a,b,c,d){return a.addEventListener(b,c,d||!1)},f=function(a,b,c,d){return a.removeEventListener(b,c,d||!1)},g=function(a,b,c,d){function g(e){f(a,b,g,d),c(e)}e(a,b,g,d)},h=function(a,b,c){var e=d(b,c);a.dispatchEvent(e)};document.addEventListener||(e=function(a,b,c){return a.attachEvent("on"+b,c)}),document.removeEventListener||(f=function(a,b,c){return a.detachEvent("on"+b,c)}),document.dispatchEvent||(h=function(a,b,c){var e=d(b,c);return a.fireEvent("on"+e.type,e)}),b.exports={on:e,off:f,once:g,emit:h}},{"synthetic-dom-events":12}],12:[function(a,b,c){function d(a,b){return(a.ctrlKey!=(b.ctrlKey||!1)||a.altKey!=(b.altKey||!1)||a.shiftKey!=(b.shiftKey||!1)||a.metaKey!=(b.metaKey||!1)||a.keyCode!=(b.keyCode||0)||a.charCode!=(b.charCode||0))&&(a=document.createEvent("Event"),a.initEvent(b.type,b.bubbles,b.cancelable),a.ctrlKey=b.ctrlKey||!1,a.altKey=b.altKey||!1,a.shiftKey=b.shiftKey||!1,a.metaKey=b.metaKey||!1,a.keyCode=b.keyCode||0,a.charCode=b.charCode||0),a}var e=(window,document||{}),f=(e.documentElement||{},!0);try{e.createEvent("KeyEvents")}catch(g){f=!1}var h=function(a,b){b=b||{};var c=l(a),g=c;"KeyboardEvent"===c&&f&&(c="KeyEvents",g="KeyEvent");var h=e.createEvent(c),i="init"+g,k="function"==typeof h[i]?i:"initEvent",m=j[k],n=[],o={};b.type=a;for(var p=0;p<m.length;++p){var q=m[p],r=b[q];void 0===r&&(r=h[q]),o[q]=!0,n.push(r)}h[k].apply(h,n),"KeyboardEvent"===c&&(h=d(h,b));for(var q in b)o[q]||(h[q]=b[q]);return h},i=function(a,b){b=b||{};var c=e.createEventObject();c.type=a;for(var d in b)void 0!==b[d]&&(c[d]=b[d]);return c};b.exports=e.createEvent?h:i;var j=a("./init.json"),k=a("./types.json"),l=function(){var a={};for(var b in k)for(var c=k[b],d=0;d<c.length;d++)a[c[d]]=b;return function(b){return a[b]||"Event"}}()},{"./init.json":13,"./types.json":14}],13:[function(a,b,c){b.exports={initEvent:["type","bubbles","cancelable"],initUIEvent:["type","bubbles","cancelable","view","detail"],initMouseEvent:["type","bubbles","cancelable","view","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget"],initMutationEvent:["type","bubbles","cancelable","relatedNode","prevValue","newValue","attrName","attrChange"],initKeyboardEvent:["type","bubbles","cancelable","view","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode"],initKeyEvent:["type","bubbles","cancelable","view","ctrlKey","altKey","shiftKey","metaKey","keyCode","charCode"]}},{}],14:[function(a,b,c){b.exports={MouseEvent:["click","mousedown","mouseup","mouseover","mousemove","mouseout"],KeyboardEvent:["keydown","keyup","keypress"],MutationEvent:["DOMSubtreeModified","DOMNodeInserted","DOMNodeRemoved","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","DOMAttrModified","DOMCharacterDataModified"],HTMLEvents:["load","unload","abort","error","select","change","submit","reset","focus","blur","resize","scroll"],UIEvent:["DOMFocusIn","DOMFocusOut","DOMActivate"]}},{}],15:[function(a,b,c){c=b.exports=function(a){if(a&&"object"==typeof a){var b=a.which||a.keyCode||a.charCode;b&&(a=b)}if("number"==typeof a)return g[a];var c=String(a),f=d[c.toLowerCase()];if(f)return f;var f=e[c.toLowerCase()];return f?f:1===c.length?c.charCodeAt(0):void 0};var d=c.code=c.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,"delete":46,command:91,"right click":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},e=c.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,"break":19,caps:20,"return":13,escape:27,spc:32,pgup:33,pgdn:33,ins:45,del:46,cmd:91};for(f=97;123>f;f++)d[String.fromCharCode(f)]=f-32;for(var f=48;58>f;f++)d[f-48]=f;for(f=1;13>f;f++)d["f"+f]=f+111;for(f=0;10>f;f++)d["numpad "+f]=f+96;var g=c.names=c.title={};for(f in d)g[d[f]]=f;for(var h in e)d[h]=e[h]},{}],16:[function(a,b,c){WYMeditor.EXTERNAL_MODULES.Edited=a("edited")},{edited:1}]},{},[16])(16)}),WYMeditor.UndoRedo=function(a){var b=this;b.wym=a,a.keyboard.combokeys.bind("mod+z",function(){return a.undoRedo.undo(),!1}),a.keyboard.combokeys.bind(["shift+meta+z","mod+y"],function(){return a.undoRedo.redo(),!1})},WYMeditor.UndoRedo.prototype._onBodyFocus=function(){var a=this,b=a.wym;a.history||setTimeout(function(){a._instantiateHistory(b.getCurrentState())},0)},WYMeditor.UndoRedo.prototype._add=function(){var a=this,b=a.wym;a.history&&(a.history.add(b.getCurrentState()),a.hasUnregisteredModification=!1)},WYMeditor.UndoRedo.prototype._do=function(a){var b,c,d=this,e=d.wym,f=d.history;if(d.history){if(a===WYMeditor.UndoRedo.UN){if(0===f.lengthBackward())return;d.hasUnregisteredModification&&d._add(),f.backward(),c="postUndo"}else{if(a!==WYMeditor.UndoRedo.RE)throw"Single parameter must be either `'un'` or `'re'` (there are constants for those).";if(0===f.lengthForward())return;f.forward(),c="postRedo"}b=f.get(),e.rawHtml(b.html),b.savedSelection&&(b.savedSelection.win=e._iframe.contentWindow,b.savedSelection.doc=e._doc,rangy.restoreSelection(b.savedSelection)),jQuery(e.element).trigger(WYMeditor.EVENTS[c])}},WYMeditor.UndoRedo.UN="un",WYMeditor.UndoRedo.RE="re",WYMeditor.UndoRedo.prototype.redo=function(){var a=this;a._do(WYMeditor.UndoRedo.RE)},WYMeditor.UndoRedo.prototype.undo=function(){var a=this;a._do(WYMeditor.UndoRedo.UN)},WYMeditor.UndoRedo.prototype.reset=function(){var a=this,b=a.wym;a._instantiateHistory(b.getCurrentState()),a.hasUnregisteredModification=null},WYMeditor.UndoRedo.prototype._instantiateHistory=function(a){var b=this;b.history=new WYMeditor.EXTERNAL_MODULES.ObjectHistory(a,{limit:100})},WYMeditor.Keyboard=function(a){var b=this;return b._wym=a,b.combokeys=new WYMeditor.EXTERNAL_MODULES.Combokeys(a._doc),b},WYMeditor.Keyboard.DEFAULT_KEYBOARD_SHORTCUTS=[{combo:"mod+b",cb:function(){var a=this;return a.exec(WYMeditor.EXEC_COMMANDS.BOLD),!1}},{combo:"mod+i",cb:function(){var a=this;return a.exec(WYMeditor.EXEC_COMMANDS.ITALIC),!1}},{combo:"mod+k",cb:function(){var a=this;return a.dialog(WYMeditor.DIALOGS.CreateLink),!1}},{combo:"tab",cb:function(){return!1}}],WYMeditor.Keyboard.prototype._attachDefaultKeyboardShortcuts=function(){var a,b,c=this,d=c._wym,e=c.constructor.DEFAULT_KEYBOARD_SHORTCUTS;for(b=0;b<e.length;b++)a=e[b],c.combokeys.bind(a.combo,function(a){return function(){return a.call(d)}}(a.cb))},WYMeditor.NativeEditRegistration=function(a){var b=this;b.wym=a,b.edited=new WYMeditor.EXTERNAL_MODULES.Edited(a._doc.body,b._onSensibleNativeEdit.bind(b),b._onAnyNativeEdit.bind(b))},WYMeditor.NativeEditRegistration.prototype._onSensibleNativeEdit=function(){var a=this;a.wym.registerModification(!0)},WYMeditor.NativeEditRegistration.prototype._onAnyNativeEdit=function(){var a=this,b=a.wym.undoRedo;b.history&&b.history.forgetAllForward(),b.hasUnregisteredModification=!0},WYMeditor.LEXER_ENTER=1,WYMeditor.LEXER_MATCHED=2,WYMeditor.LEXER_UNMATCHED=3,WYMeditor.LEXER_EXIT=4,WYMeditor.LEXER_SPECIAL=5,WYMeditor.Lexer=function(a,b,c){return b=b||"accept",this._case=c||!1,this._regexes={},this._parser=a,this._mode=new WYMeditor.StateStack(b),this._mode_handlers={},this._mode_handlers[b]=b,this},WYMeditor.Lexer.prototype.addPattern=function(a,b){b=b||"accept","undefined"==typeof this._regexes[b]&&(this._regexes[b]=new WYMeditor.ParallelRegex(this._case)),this._regexes[b].addPattern(a),"undefined"==typeof this._mode_handlers[b]&&(this._mode_handlers[b]=b)},WYMeditor.Lexer.prototype.addEntryPattern=function(a,b,c){"undefined"==typeof this._regexes[b]&&(this._regexes[b]=new WYMeditor.ParallelRegex(this._case)),this._regexes[b].addPattern(a,c),"undefined"==typeof this._mode_handlers[c]&&(this._mode_handlers[c]=c)},WYMeditor.Lexer.prototype.addExitPattern=function(a,b){"undefined"==typeof this._regexes[b]&&(this._regexes[b]=new WYMeditor.ParallelRegex(this._case)),this._regexes[b].addPattern(a,"__exit"),"undefined"==typeof this._mode_handlers[b]&&(this._mode_handlers[b]=b)},WYMeditor.Lexer.prototype.addSpecialPattern=function(a,b,c){"undefined"==typeof this._regexes[b]&&(this._regexes[b]=new WYMeditor.ParallelRegex(this._case)),this._regexes[b].addPattern(a,"_"+c),"undefined"==typeof this._mode_handlers[c]&&(this._mode_handlers[c]=c)},WYMeditor.Lexer.prototype.mapHandler=function(a,b){this._mode_handlers[a]=b},WYMeditor.Lexer.prototype.parse=function(a){if("undefined"==typeof this._parser)return!1;for(var b,c=a.length;"object"==typeof(b=this._reduce(a));){a=b[0];var d=b[1],e=b[2],f=b[3];if(!this._dispatchTokens(d,e,f))return!1;if(""===a)return!0;if(a.length==c)return!1;c=a.length}return b?this._invokeParser(a,WYMeditor.LEXER_UNMATCHED):!1},WYMeditor.Lexer.prototype._dispatchTokens=function(a,b,c){return c=c||!1,this._invokeParser(a,WYMeditor.LEXER_UNMATCHED)?"boolean"==typeof c?this._invokeParser(b,WYMeditor.LEXER_MATCHED):this._isModeEnd(c)?this._invokeParser(b,WYMeditor.LEXER_EXIT)?this._mode.leave():!1:this._isSpecialMode(c)?(this._mode.enter(this._decodeSpecial(c)),this._invokeParser(b,WYMeditor.LEXER_SPECIAL)?this._mode.leave():!1):(this._mode.enter(c),this._invokeParser(b,WYMeditor.LEXER_ENTER)):!1},WYMeditor.Lexer.prototype._isModeEnd=function(a){return"__exit"===a},WYMeditor.Lexer.prototype._isSpecialMode=function(a){return"_"==a.substring(0,1)},WYMeditor.Lexer.prototype._decodeSpecial=function(a){return a.substring(1)},WYMeditor.Lexer.prototype._invokeParser=function(a,b){if(""===a)return!0;var c=this._mode.getCurrent(),d=this._mode_handlers[c],e=this._parser[d](a,b);return e},WYMeditor.Lexer.prototype._reduce=function(a){var b=this._regexes[this._mode.getCurrent()].match(a),c=b[1],d=b[0];if(d){var e=a.indexOf(c),f=a.substr(0,e);return a=a.substring(e+c.length),[a,f,c,d]}return!0},WYMeditor.ParallelRegex=function(a){return this._case=a,this._patterns=[],this._labels=[],this._regex=null,this},WYMeditor.ParallelRegex.prototype.addPattern=function(a,b){b=b||!0;var c=this._patterns.length;this._patterns[c]=a,this._labels[c]=b,this._regex=null},WYMeditor.ParallelRegex.prototype.match=function(a){if(0===this._patterns.length)return[!1,""];var b=a.match(this._getCompoundedRegex());if(!b)return[!1,""];for(var c=b[0],d=1;d<b.length;d++)if(b[d])return[this._labels[d-1],c];return[!0,b[0]]},WYMeditor.ParallelRegex.prototype._getCompoundedRegex=function(){if(null===this._regex){for(var a=0,b=this._patterns.length;b>a;a++)this._patterns[a]="("+this._untokenizeRegex(this._tokenizeRegex(this._patterns[a]).replace(/([\/\(\)])/g,"\\$1"))+")";this._regex=new RegExp(this._patterns.join("|"),this._getPerlMatchingFlags())}return this._regex},WYMeditor.ParallelRegex.prototype._tokenizeRegex=function(a){return a.replace(/\(\?(i|m|s|x|U)\)/,"~~~~~~Tk1$1~~~~~~").replace(/\(\?(\-[i|m|s|x|U])\)/,"~~~~~~Tk2$1~~~~~~").replace(/\(\?\=(.*)\)/,"~~~~~~Tk3$1~~~~~~").replace(/\(\?\!(.*)\)/,"~~~~~~Tk4$1~~~~~~").replace(/\(\?\<\=(.*)\)/,"~~~~~~Tk5$1~~~~~~").replace(/\(\?\<\!(.*)\)/,"~~~~~~Tk6$1~~~~~~").replace(/\(\?\:(.*)\)/,"~~~~~~Tk7$1~~~~~~")},WYMeditor.ParallelRegex.prototype._untokenizeRegex=function(a){return a.replace(/~~~~~~Tk1(.{1})~~~~~~/,"(?$1)").replace(/~~~~~~Tk2(.{2})~~~~~~/,"(?$1)").replace(/~~~~~~Tk3(.*)~~~~~~/,"(?=$1)").replace(/~~~~~~Tk4(.*)~~~~~~/,"(?!$1)").replace(/~~~~~~Tk5(.*)~~~~~~/,"(?<=$1)").replace(/~~~~~~Tk6(.*)~~~~~~/,"(?<!$1)").replace(/~~~~~~Tk7(.*)~~~~~~/,"(?:$1)")},WYMeditor.ParallelRegex.prototype._getPerlMatchingFlags=function(){return this._case?"m":"mi"},WYMeditor.StateStack=function(a){return this._stack=[a],this},WYMeditor.StateStack.prototype.getCurrent=function(){return this._stack[this._stack.length-1]},WYMeditor.StateStack.prototype.enter=function(a){this._stack.push(a)},WYMeditor.StateStack.prototype.leave=function(){return 1==this._stack.length?!1:(this._stack.pop(),!0)},WYMeditor.XhtmlLexer=function(a){return jQuery.extend(this,new WYMeditor.Lexer(a,"Text")),this.mapHandler("Text","Text"),this.addTokens(),this.init(),this},WYMeditor.XhtmlLexer.prototype.init=function(){},WYMeditor.XhtmlLexer.prototype.addTokens=function(){this.addCommentTokens("Text"),this.addScriptTokens("Text"),this.addCssTokens("Text"),this.addTagTokens("Text")},WYMeditor.XhtmlLexer.prototype.addCommentTokens=function(a){this.addEntryPattern("<!--",a,"Comment"),this.addExitPattern("-->","Comment")},WYMeditor.XhtmlLexer.prototype.addScriptTokens=function(a){this.addEntryPattern("<script",a,"Script"),this.addExitPattern("</script>","Script")},WYMeditor.XhtmlLexer.prototype.addCssTokens=function(a){this.addEntryPattern("<style",a,"Css"),this.addExitPattern("</style>","Css")},WYMeditor.XhtmlLexer.prototype.addTagTokens=function(a){this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*/>",a,"SelfClosingTag"),this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*>",a,"OpeningTag"),this.addEntryPattern("<[a-z0-9:-]+[\\/ \\>]+",a,"OpeningTag"),this.addInTagDeclarationTokens("OpeningTag"),this.addSpecialPattern("</\\s*[a-z0-9:-]+\\s*>",a,"ClosingTag")},WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens=function(a){this.addSpecialPattern("\\s+",a,"Ignore"),this.addAttributeTokens(a),this.addExitPattern("/>",a),this.addExitPattern(">",a)},WYMeditor.XhtmlLexer.prototype.addAttributeTokens=function(a){this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?==)\\s*",a,"TagAttributes"),this.addEntryPattern('=\\s*"',a,"DoubleQuotedAttribute"),this.addPattern('\\\\"',"DoubleQuotedAttribute"),this.addExitPattern('"',"DoubleQuotedAttribute"),this.addEntryPattern("=\\s*'",a,"SingleQuotedAttribute"),this.addPattern("\\\\'","SingleQuotedAttribute"),this.addExitPattern("'","SingleQuotedAttribute"),this.addSpecialPattern("=\\s*[^>\\s]*",a,"UnquotedAttribute")},WYMeditor.XhtmlParser=function(a,b){return b=b||"Text",this._Lexer=new WYMeditor.XhtmlLexer(this),this._Listener=a,this._mode=b,this._matches=[],this._last_match="",this._current_match="",this},WYMeditor.XhtmlParser.prototype.parse=function(a){return this._Lexer.parse(this.beforeParsing(a)),this.afterParsing(this._Listener.getResult())},WYMeditor.XhtmlParser.prototype.beforeParsing=function(a){return(a.match(/class="MsoNormal"/)||a.match(/ns = "urn:schemas-microsoft-com/))&&this._Listener.avoidStylingTagsAndAttributes(),this._Listener.beforeParsing(a)},WYMeditor.XhtmlParser.prototype.afterParsing=function(a){return this._Listener._avoiding_tags_implicitly&&this._Listener.allowStylingTagsAndAttributes(),this._Listener.afterParsing(a)},WYMeditor.XhtmlParser.prototype.Ignore=function(a,b){return!0},WYMeditor.XhtmlParser.prototype.Text=function(a){return this._Listener.addContent(a),!0},WYMeditor.XhtmlParser.prototype.Comment=function(a,b){return this._addNonTagBlock(a,b,"addComment")},WYMeditor.XhtmlParser.prototype.Script=function(a,b){return this._addNonTagBlock(a,b,"addScript")},WYMeditor.XhtmlParser.prototype.Css=function(a,b){return this._addNonTagBlock(a,b,"addCss")},WYMeditor.XhtmlParser.prototype._addNonTagBlock=function(a,b,c){switch(b){case WYMeditor.LEXER_ENTER:this._non_tag=a;break;case WYMeditor.LEXER_UNMATCHED:this._non_tag+=a;break;case WYMeditor.LEXER_EXIT:switch(c){case"addComment":this._Listener.addComment(this._non_tag+a);break;case"addScript":this._Listener.addScript(this._non_tag+a);break;case"addCss":this._Listener.addCss(this._non_tag+a)}}return!0},WYMeditor.XhtmlParser.prototype.SelfClosingTag=function(a,b){this.OpeningTag(a,b),this.normalizeTag(a);return this.ClosingTag(a,b)},WYMeditor.XhtmlParser.prototype.OpeningTag=function(a,b){switch(b){case WYMeditor.LEXER_ENTER:this._tag=this.normalizeTag(a),this._tag_attributes={};break;case WYMeditor.LEXER_SPECIAL:this._callOpenTagListener(this.normalizeTag(a));break;case WYMeditor.LEXER_EXIT:this._callOpenTagListener(this._tag,this._tag_attributes)}return!0},WYMeditor.XhtmlParser.prototype.ClosingTag=function(a,b){return this._callCloseTagListener(this.normalizeTag(a)),!0},WYMeditor.XhtmlParser.prototype._callOpenTagListener=function(a,b){b=b||{},this.autoCloseUnclosedBeforeNewOpening(a),this._Listener.isBlockTag(a)?(this._Listener._tag_stack.push(a),this._Listener.fixNestingBeforeOpeningBlockTag(a,b),this._Listener.openBlockTag(a,b),this._increaseOpenTagCounter(a)):this._Listener.isInlineTag(a)?this._Listener.inlineTag(a,b):(this._Listener.openUnknownTag(a,b),this._increaseOpenTagCounter(a)),this._Listener.last_tag=a,this._Listener.last_tag_opened=!0,this._Listener.last_tag_attributes=b},WYMeditor.XhtmlParser.prototype._callCloseTagListener=function(a){if(this._decreaseOpenTagCounter(a)){if(this.autoCloseUnclosedBeforeTagClosing(a),this._Listener.isBlockTag(a)){var b=this._Listener._tag_stack.pop();if(b===!1)return;if(b!==a){if(this._Listener._extraBlockClosingTags)return this._Listener._tag_stack.push(b),void this._Listener.removedExtraBlockClosingTag();a=b}this._Listener.closeBlockTag(a)}}else this._Listener.isInlineTag(a)||this._Listener.closeUnopenedTag(a);this._Listener.last_tag=a,this._Listener.last_tag_opened=!1},WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter=function(a){this._Listener._open_tags[a]=this._Listener._open_tags[a]||0,this._Listener._open_tags[a]++},WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter=function(a){return this._Listener._open_tags[a]?(this._Listener._open_tags[a]--,0===this._Listener._open_tags[a]&&(this._Listener._open_tags[a]=void 0),!0):!1},WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening=function(a){this._autoCloseUnclosed(a,!1)},WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing=function(a){this._autoCloseUnclosed(a,!0)},WYMeditor.XhtmlParser.prototype._autoCloseUnclosed=function(a,b){if(b=b||!1,this._Listener._open_tags)for(var c in this._Listener._open_tags)this._Listener.shouldCloseTagAutomatically(c,a,b)&&this._callCloseTagListener(c,!0);
+},WYMeditor.XhtmlParser.prototype.getTagReplacements=function(){return this._Listener.getTagReplacements()},WYMeditor.XhtmlParser.prototype.normalizeTag=function(a){a=a.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,"").toLowerCase();var b=this._Listener.getTagReplacements();return b[a]?b[a]:a},WYMeditor.XhtmlParser.prototype.TagAttributes=function(a,b){return WYMeditor.LEXER_SPECIAL==b&&(this._current_attribute=a),!0},WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute=function(a,b){return WYMeditor.LEXER_UNMATCHED==b&&(this._tag_attributes[this._current_attribute]=a),!0},WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute=function(a,b){return WYMeditor.LEXER_UNMATCHED==b&&(this._tag_attributes[this._current_attribute]=a),!0},WYMeditor.XhtmlParser.prototype.UnquotedAttribute=function(a,b){return this._tag_attributes[this._current_attribute]=a.replace(/^=/,""),!0},WYMeditor.XhtmlSaxListener=function(){return this.output="",this.helper=new WYMeditor.XmlHelper,this._open_tags={},this.validator=WYMeditor.XhtmlValidator,this._tag_stack=[],this.avoided_tags=[],this._insert_before_closing=[],this._insert_after_closing=[],this._last_node_was_text=!1,this._consecutive_brs=0,this._lastAddedOpenTag="",this._insideLI=!1,this.tagsToUnwrapInLists=WYMeditor.DocumentStructureManager.VALID_DEFAULT_ROOT_CONTAINERS,this._rootInlineTagsToRemove=["br"],this._extraBlockClosingTags=0,this._insideTagToRemove=!1,this._addSpacerBeforeElementInLI=!1,this._insideTagToRemove=!1,this._lastTagRemoved=!1,this._extraLIClosingTags=0,this._removedTagStackIndex=0,this.entities={"&nbsp;":"&#160;","&iexcl;":"&#161;","&cent;":"&#162;","&pound;":"&#163;","&curren;":"&#164;","&yen;":"&#165;","&brvbar;":"&#166;","&sect;":"&#167;","&uml;":"&#168;","&copy;":"&#169;","&ordf;":"&#170;","&laquo;":"&#171;","&not;":"&#172;","&shy;":"&#173;","&reg;":"&#174;","&macr;":"&#175;","&deg;":"&#176;","&plusmn;":"&#177;","&sup2;":"&#178;","&sup3;":"&#179;","&acute;":"&#180;","&micro;":"&#181;","&para;":"&#182;","&middot;":"&#183;","&cedil;":"&#184;","&sup1;":"&#185;","&ordm;":"&#186;","&raquo;":"&#187;","&frac14;":"&#188;","&frac12;":"&#189;","&frac34;":"&#190;","&iquest;":"&#191;","&Agrave;":"&#192;","&Aacute;":"&#193;","&Acirc;":"&#194;","&Atilde;":"&#195;","&Auml;":"&#196;","&Aring;":"&#197;","&AElig;":"&#198;","&Ccedil;":"&#199;","&Egrave;":"&#200;","&Eacute;":"&#201;","&Ecirc;":"&#202;","&Euml;":"&#203;","&Igrave;":"&#204;","&Iacute;":"&#205;","&Icirc;":"&#206;","&Iuml;":"&#207;","&ETH;":"&#208;","&Ntilde;":"&#209;","&Ograve;":"&#210;","&Oacute;":"&#211;","&Ocirc;":"&#212;","&Otilde;":"&#213;","&Ouml;":"&#214;","&times;":"&#215;","&Oslash;":"&#216;","&Ugrave;":"&#217;","&Uacute;":"&#218;","&Ucirc;":"&#219;","&Uuml;":"&#220;","&Yacute;":"&#221;","&THORN;":"&#222;","&szlig;":"&#223;","&agrave;":"&#224;","&aacute;":"&#225;","&acirc;":"&#226;","&atilde;":"&#227;","&auml;":"&#228;","&aring;":"&#229;","&aelig;":"&#230;","&ccedil;":"&#231;","&egrave;":"&#232;","&eacute;":"&#233;","&ecirc;":"&#234;","&euml;":"&#235;","&igrave;":"&#236;","&iacute;":"&#237;","&icirc;":"&#238;","&iuml;":"&#239;","&eth;":"&#240;","&ntilde;":"&#241;","&ograve;":"&#242;","&oacute;":"&#243;","&ocirc;":"&#244;","&otilde;":"&#245;","&ouml;":"&#246;","&divide;":"&#247;","&oslash;":"&#248;","&ugrave;":"&#249;","&uacute;":"&#250;","&ucirc;":"&#251;","&uuml;":"&#252;","&yacute;":"&#253;","&thorn;":"&#254;","&yuml;":"&#255;","&OElig;":"&#338;","&oelig;":"&#339;","&Scaron;":"&#352;","&scaron;":"&#353;","&Yuml;":"&#376;","&fnof;":"&#402;","&circ;":"&#710;","&tilde;":"&#732;","&Alpha;":"&#913;","&Beta;":"&#914;","&Gamma;":"&#915;","&Delta;":"&#916;","&Epsilon;":"&#917;","&Zeta;":"&#918;","&Eta;":"&#919;","&Theta;":"&#920;","&Iota;":"&#921;","&Kappa;":"&#922;","&Lambda;":"&#923;","&Mu;":"&#924;","&Nu;":"&#925;","&Xi;":"&#926;","&Omicron;":"&#927;","&Pi;":"&#928;","&Rho;":"&#929;","&Sigma;":"&#931;","&Tau;":"&#932;","&Upsilon;":"&#933;","&Phi;":"&#934;","&Chi;":"&#935;","&Psi;":"&#936;","&Omega;":"&#937;","&alpha;":"&#945;","&beta;":"&#946;","&gamma;":"&#947;","&delta;":"&#948;","&epsilon;":"&#949;","&zeta;":"&#950;","&eta;":"&#951;","&theta;":"&#952;","&iota;":"&#953;","&kappa;":"&#954;","&lambda;":"&#955;","&mu;":"&#956;","&nu;":"&#957;","&xi;":"&#958;","&omicron;":"&#959;","&pi;":"&#960;","&rho;":"&#961;","&sigmaf;":"&#962;","&sigma;":"&#963;","&tau;":"&#964;","&upsilon;":"&#965;","&phi;":"&#966;","&chi;":"&#967;","&psi;":"&#968;","&omega;":"&#969;","&thetasym;":"&#977;","&upsih;":"&#978;","&piv;":"&#982;","&ensp;":"&#8194;","&emsp;":"&#8195;","&thinsp;":"&#8201;","&zwnj;":"&#8204;","&zwj;":"&#8205;","&lrm;":"&#8206;","&rlm;":"&#8207;","&ndash;":"&#8211;","&mdash;":"&#8212;","&lsquo;":"&#8216;","&rsquo;":"&#8217;","&sbquo;":"&#8218;","&ldquo;":"&#8220;","&rdquo;":"&#8221;","&bdquo;":"&#8222;","&dagger;":"&#8224;","&Dagger;":"&#8225;","&bull;":"&#8226;","&hellip;":"&#8230;","&permil;":"&#8240;","&prime;":"&#8242;","&Prime;":"&#8243;","&lsaquo;":"&#8249;","&rsaquo;":"&#8250;","&oline;":"&#8254;","&frasl;":"&#8260;","&euro;":"&#8364;","&image;":"&#8465;","&weierp;":"&#8472;","&real;":"&#8476;","&trade;":"&#8482;","&alefsym;":"&#8501;","&larr;":"&#8592;","&uarr;":"&#8593;","&rarr;":"&#8594;","&darr;":"&#8595;","&harr;":"&#8596;","&crarr;":"&#8629;","&lArr;":"&#8656;","&uArr;":"&#8657;","&rArr;":"&#8658;","&dArr;":"&#8659;","&hArr;":"&#8660;","&forall;":"&#8704;","&part;":"&#8706;","&exist;":"&#8707;","&empty;":"&#8709;","&nabla;":"&#8711;","&isin;":"&#8712;","&notin;":"&#8713;","&ni;":"&#8715;","&prod;":"&#8719;","&sum;":"&#8721;","&minus;":"&#8722;","&lowast;":"&#8727;","&radic;":"&#8730;","&prop;":"&#8733;","&infin;":"&#8734;","&ang;":"&#8736;","&and;":"&#8743;","&or;":"&#8744;","&cap;":"&#8745;","&cup;":"&#8746;","&int;":"&#8747;","&there4;":"&#8756;","&sim;":"&#8764;","&cong;":"&#8773;","&asymp;":"&#8776;","&ne;":"&#8800;","&equiv;":"&#8801;","&le;":"&#8804;","&ge;":"&#8805;","&sub;":"&#8834;","&sup;":"&#8835;","&nsub;":"&#8836;","&sube;":"&#8838;","&supe;":"&#8839;","&oplus;":"&#8853;","&otimes;":"&#8855;","&perp;":"&#8869;","&sdot;":"&#8901;","&lceil;":"&#8968;","&rceil;":"&#8969;","&lfloor;":"&#8970;","&rfloor;":"&#8971;","&lang;":"&#9001;","&rang;":"&#9002;","&loz;":"&#9674;","&spades;":"&#9824;","&clubs;":"&#9827;","&hearts;":"&#9829;","&diams;":"&#9830;"},this.block_tags=["a","abbr","acronym","address","area","b","base","bdo","big","blockquote","body","button","caption","cite","code","colgroup","dd","del","div","dfn","dl","dt","em","fieldset","form","head","h1","h2","h3","h4","h5","h6","html","i","iframe","ins","kbd","label","legend","li","map","noscript","object","ol","optgroup","option","p","param","pre","q","samp","script","select","small","span","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","ul","var","extends"],this.inline_tags=["br","col","hr","img","input"],this},WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically=function(a,b,c){if("td"!=a&&"option"!=a)return!1;var d=this._open_tags[a];if(!d)return!1;if("td"==a){var e=this._open_tags.tr||0;if(!c&&"td"===b&&d>=e)return!0;if(c&&"tr"==b&&d>e)return!0}else if("option"==a&&(c&&"select"==b||!c&&"option"==b))return!0;return!1},WYMeditor.XhtmlSaxListener.prototype.beforeParsing=function(a){return this.output="",this._insert_before_closing=[],this._insert_after_closing=[],this._open_tags={},this._tag_stack=[],this._last_node_was_text=!1,this._lastTagRemoved=!1,this._insideTagToRemove=!1,this.last_tag=null,a},WYMeditor.XhtmlSaxListener.prototype.afterParsing=function(a){return a=this.replaceNamedEntities(a),a=this.joinRepeatedEntities(a),a=this.removeEmptyTags(a),a=this.removeBrInPre(a)},WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities=function(a){for(var b in this.entities)a=a.replace(new RegExp(b,"g"),this.entities[b]);return a},WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities=function(a){var b="em|strong|sub|sup|acronym|pre|del|address";return a.replace(new RegExp("</("+b+")><\\1>",""),"").replace(new RegExp("(s*<("+b+")>s*){2}(.*)(s*</\\2>s*){2}",""),"<$2>$3<$2>")},WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags=function(a){return a.replace(new RegExp("<("+this.block_tags.join("|").replace(/\|td/,"").replace(/\|th/,"")+")>(<br />|&#160;|&nbsp;|\\s)*</\\1>","g"),"")},WYMeditor.XhtmlSaxListener.prototype.removeBrInPre=function(a){var b=a.match(new RegExp("<pre[^>]*>(.*?)</pre>","gmi"));if(b)for(var c=0;c<b.length;c++)a=a.replace(b[c],b[c].replace(new RegExp("<br />","g"),String.fromCharCode(13,10)));return a},WYMeditor.XhtmlSaxListener.prototype.getResult=function(){return this.output},WYMeditor.XhtmlSaxListener.prototype.getTagReplacements=function(){return{b:"strong",i:"em"}},WYMeditor.XhtmlSaxListener.prototype.getTagForStyle=function(a){return/sub/.test(a)?"sub":/super/.test(a)?"sup":/bold/.test(a)?"strong":/italic/.test(a)?"em":!1},WYMeditor.XhtmlSaxListener.prototype.addContent=function(a){this.last_tag&&"li"==this.last_tag&&(a=a.replace(/(\r|\n|\r\n)+$/g,""),a=a.replace(/(\r|\n|\r\n)+/g," ")),a.replace(/^\s+|\s+$/g,"").length>0&&(this._last_node_was_text=!0,this._addSpacerBeforeElementInLI&&(this.output+="<br />",this._addSpacerBeforeElementInLI=!1)),this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addComment=function(a){this.remove_comments||this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addScript=function(a){this.remove_scripts||this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addCss=function(a){this.remove_embeded_styles||this._insideTagToRemove||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.openBlockTag=function(a,b){var c=this._last_node_was_text;if(this._last_node_was_text=!1,!this._insideTagToRemove){if(this._shouldRemoveTag(a,b))return this._insideTagToRemove=!0,void(this._removedTagStackIndex=this._tag_stack.length-1);if(this._insideLI&&jQuery.inArray(a,this.tagsToUnwrapInLists)>-1)return("li"!==this._lastAddedOpenTag||c)&&(this.output+="<br />",this._addSpacerBeforeElementInLI=!1),this._tag_stack.pop(),void this._extraBlockClosingTags++;if(this._addSpacerBeforeElementInLI&&"li"!==a&&-1===jQuery.inArray(a,WYMeditor.LIST_TYPE_ELEMENTS)&&(this.output+="<br />",this._addSpacerBeforeElementInLI=!1),b=this.validator.getValidTagAttributes(a,b),b=this.removeUnwantedClasses(b),"span"===a&&b.style){var d=this.getTagForStyle(b.style);d&&(a=d,this._tag_stack.pop(),this._tag_stack.push(a),b.style="")}"li"===a&&(this._insideLI=!0,this._addSpacerBeforeElementInLI=!1),this.output+=this.helper.tag(a,b,!0),this._lastAddedOpenTag=a,this._lastTagRemoved=!1}},WYMeditor.XhtmlSaxListener.prototype.inlineTag=function(a,b){this._insideTagToRemove||this._shouldRemoveTag(a,b)||(this._last_node_was_text=!1,b=this.validator.getValidTagAttributes(a,b),b=this.removeUnwantedClasses(b),this.output+=this.helper.tag(a,b),this._lastTagRemoved=!1)},WYMeditor.XhtmlSaxListener.prototype.openUnknownTag=function(a,b){},WYMeditor.XhtmlSaxListener.prototype.closeBlockTag=function(a){return this._last_node_was_text=!1,this._insideTagToRemove?(this._tag_stack.length===this._removedTagStackIndex&&(this._insideTagToRemove=!1),void(this._lastTagRemoved=!0)):("li"===a&&(this._insideLI=!1,this._addSpacerBeforeElementInLI=!1),jQuery.inArray(a,WYMeditor.LIST_TYPE_ELEMENTS)>-1&&(this._insideLI=!1),void(this.output=this.output+this._getClosingTagContent("before",a)+"</"+a+">"+this._getClosingTagContent("after",a)))},WYMeditor.XhtmlSaxListener.prototype.removedExtraBlockClosingTag=function(){this._extraBlockClosingTags--,this._addSpacerBeforeElementInLI=!0,this._last_node_was_text=!1},WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag=function(a){},WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag=function(a){this._last_node_was_text=!1,this._insideTagToRemove||("li"===a&&this._extraLIClosingTags?this._extraLIClosingTags--:this.output+="</"+a+">")},WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes=function(){this.avoided_tags=["div","span"],this.validator.skiped_attributes=["style"],this.validator.skiped_attribute_values=["MsoNormal","main1"],this._avoiding_tags_implicitly=!0},WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes=function(){this.avoided_tags=[],this.validator.skiped_attributes=[],this.validator.skiped_attribute_values=[],this._avoiding_tags_implicitly=!1},WYMeditor.XhtmlSaxListener.prototype.isBlockTag=function(a){return!WYMeditor.Helper.arrayContains(this.avoided_tags,a)&&WYMeditor.Helper.arrayContains(this.block_tags,a)},WYMeditor.XhtmlSaxListener.prototype.isInlineTag=function(a){return!WYMeditor.Helper.arrayContains(this.avoided_tags,a)&&WYMeditor.Helper.arrayContains(this.inline_tags,a)},WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag=function(a,b){this._insertContentWhenClosingTag("after",a,b)},WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag=function(a,b){this._insertContentWhenClosingTag("before",a,b)},WYMeditor.XhtmlSaxListener.prototype.removeUnwantedClasses=function(a){var b,c;if(!a["class"])return a;for(c=0;c<WYMeditor.CLASSES_REMOVED_BY_PARSER.length;++c)b=new RegExp("(^|\\s)"+WYMeditor.CLASSES_REMOVED_BY_PARSER[c]+"($|\\s)","gi"),a["class"]=a["class"].replace(b,"$1");return a["class"]=a["class"].replace(/\s$/,""),a},WYMeditor.XhtmlSaxListener.prototype.fixNestingBeforeOpeningBlockTag=function(a,b){if(this._last_node_was_text||"ul"!=a&&"ol"!=a||!this.last_tag||this.last_tag_opened||"li"!=this.last_tag)if("ul"!=a&&"ol"!=a||!this.last_tag||!this.last_tag_opened||"ul"!=this.last_tag&&"ol"!=this.last_tag){if("li"==a&&this._tag_stack.length>=2){var c=this._tag_stack[this._tag_stack.length-2];"li"!=c||this._shouldRemoveTag(a,b)||(this._open_tags.li-=1,0===this._open_tags.li&&(this._open_tags.li=void 0),this._tag_stack.splice(this._tag_stack.length-2,1),this._last_node_was_text=!1,this._insideTagToRemove?this._tag_stack.length-1===this._removedTagStackIndex&&(this._insideTagToRemove=!1,this._lastTagRemoved=!0,this._extraLIClosingTags++):this.output+="</li>")}}else this._shouldRemoveTag(a,b)||(this.output+=this.helper.tag("li",{},!0),this.insertContentAfterClosingTag(a,"</li>")),this._last_node_was_text=!1;else this._lastTagRemoved?(this._insideTagToRemove=!0,this._removedTagStackIndex=this._tag_stack.length-1):this._shouldRemoveTag(a,b)||(this.output=this.output.replace(/<\/li>\s*$/,""),this.insertContentAfterClosingTag(a,"</li>"))},WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag=function(a,b,c){this["_insert_"+a+"_closing"]||(this["_insert_"+a+"_closing"]=[]),this["_insert_"+a+"_closing"][b]||(this["_insert_"+a+"_closing"][b]=[]),this["_insert_"+a+"_closing"][b].push(c)},WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent=function(a,b){return this["_insert_"+a+"_closing"]&&this["_insert_"+a+"_closing"][b]&&this["_insert_"+a+"_closing"][b].length>0?this["_insert_"+a+"_closing"][b].pop():""},WYMeditor.XhtmlSaxListener.prototype._shouldRemoveTag=function(a,b){return this._isEditorOnlyTag(a,b)?!0:this._isRootInlineTagToRemove(a,b,this._tag_stack)?!0:this._isThirdConsecutiveBrWithNoAttributes(a,b)?!0:!1},WYMeditor.XhtmlSaxListener.prototype._isEditorOnlyTag=function(a,b){var c;return b["class"]?(c=b["class"].split(" "),WYMeditor.Helper.arrayContains(c,WYMeditor.EDITOR_ONLY_CLASS)?!0:!1):!1},WYMeditor.XhtmlSaxListener.prototype._isRootInlineTagToRemove=function(a,b,c){return this.isInlineTag(a)?c.length>0?!1:WYMeditor.Helper.arrayContains(this._rootInlineTagsToRemove,a)?!0:!1:!1},WYMeditor.XhtmlSaxListener.prototype._isThirdConsecutiveBrWithNoAttributes=function(a,b){var c;if("br"!==a)return this._consecutive_brs=0,!1;if(0!==this._consecutive_brs&&this._last_node_was_text)return this._consecutive_brs=0,!1;for(c in b)if(b.hasOwnProperty(c))return this._consecutive_brs=0,!1;return this._consecutive_brs++,this._consecutive_brs>2?!0:!1},WYMeditor.XhtmlValidator={_attributes:{core:{except:["base","head","html","meta","param","script","style","title"],attributes:["class","id","title","accesskey","tabindex","/^data-.*/"]},styleAttr:{except:["img"],attributes:["style"]},language:{except:["base","br","hr","iframe","param","script"],attributes:{dir:["ltr","rtl"],0:"lang",1:"xml:lang"}},keyboard:{attributes:{accesskey:/^(\w){1}$/,tabindex:/^(\d)+$/}}},_events:{window:{only:["body"],attributes:["onload","onunload"]},form:{only:["form","input","textarea","select","a","label","button"],attributes:["onchange","onsubmit","onreset","onselect","onblur","onfocus"]},keyboard:{except:["base","bdo","br","frame","frameset","head","html","iframe","meta","param","script","style","title"],attributes:["onkeydown","onkeypress","onkeyup"]},mouse:{except:["base","bdo","br","head","html","meta","param","script","style","title"],attributes:["onclick","ondblclick","onmousedown","onmousemove","onmouseover","onmouseout","onmouseup"]}},_tags:{a:{attributes:{0:"charset",1:"coords",2:"href",3:"hreflang",4:"name",5:"rel",6:"rev",shape:/^(rect|rectangle|circ|circle|poly|polygon)$/,7:"type"}},0:"abbr",1:"acronym",2:"address",area:{attributes:{0:"alt",1:"coords",2:"href",nohref:/^(true|false)$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/},required:["alt"]},3:"b",base:{attributes:["href"],required:["href"]},bdo:{attributes:{dir:/^(ltr|rtl)$/},required:["dir"]},4:"big",blockquote:{attributes:["cite"]},5:"body",6:"br",button:{attributes:{disabled:/^(disabled)$/,type:/^(button|reset|submit)$/,0:"value"},inside:"form"},7:"caption",8:"cite",9:"code",col:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,2:"width"},inside:"colgroup"},colgroup:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,2:"width"}},10:"dd",del:{attributes:{0:"cite",datetime:/^([0-9]){8}/}},11:"div",12:"dfn",13:"dl",14:"dt",15:"em",fieldset:{inside:"form"},form:{attributes:{0:"action",1:"accept",2:"accept-charset",3:"enctype",method:/^(get|post)$/},required:["action"]},head:{attributes:["profile"]},16:"h1",17:"h2",18:"h3",19:"h4",20:"h5",21:"h6",22:"hr",html:{attributes:["xmlns"]},23:"i",img:{attributes:["alt","src","height","ismap","longdesc","usemap","width"],required:["alt","src"]},input:{attributes:{0:"accept",1:"alt",checked:/^(checked)$/,disabled:/^(disabled)$/,maxlength:/^(\d)+$/,2:"name",readonly:/^(readonly)$/,size:/^(\d)+$/,3:"src",type:/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/,4:"value"},inside:"form"},ins:{attributes:{0:"cite",datetime:/^([0-9]){8}/}},24:"kbd",label:{attributes:["for"],inside:"form"},25:"legend",26:"li",link:{attributes:{0:"charset",1:"href",2:"hreflang",media:/^(all|braille|print|projection|screen|speech|,|;| )+$/i,rel:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,rev:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,3:"type"},inside:"head"},map:{attributes:["id","name"],required:["id"]},meta:{attributes:{0:"content","http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i,1:"name",2:"scheme"},required:["content"]},27:"noscript",object:{attributes:["archive","classid","codebase","codetype","data","declare","height","name","standby","type","usemap","width"]},28:"ol",optgroup:{attributes:{0:"label",disabled:/^(disabled)$/},required:["label"]},option:{attributes:{0:"label",disabled:/^(disabled)$/,selected:/^(selected)$/,1:"value"},inside:"select"},29:"p",param:{attributes:{0:"type",valuetype:/^(data|ref|object)$/,1:"valuetype",2:"value"},required:["name"]},30:"pre",q:{attributes:["cite"]},31:"samp",script:{attributes:{type:/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/,0:"charset",defer:/^(defer)$/,1:"src"},required:["type"]},select:{attributes:{disabled:/^(disabled)$/,multiple:/^(multiple)$/,0:"name",1:"size"},inside:"form"},32:"small",33:"span",34:"strong",style:{attributes:{0:"type",media:/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/},required:["type"]},35:"sub",36:"sup",table:{attributes:{0:"border",1:"cellpadding",2:"cellspacing",frame:/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/,rules:/^(none|groups|rows|cols|all)$/,3:"summary",4:"width"}},tbody:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},td:{attributes:{0:"abbr",align:/^(left|right|center|justify|char)$/,1:"axis",2:"char",3:"charoff",colspan:/^(\d)+$/,4:"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},textarea:{attributes:["cols","rows","disabled","name","readonly"],required:["cols","rows"],inside:"form"},tfoot:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom)$/,2:"baseline"}},th:{attributes:{0:"abbr",align:/^(left|right|center|justify|char)$/,1:"axis",2:"char",3:"charoff",colspan:/^(\d)+$/,4:"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},thead:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},37:"title",tr:{attributes:{align:/^(right|left|center|justify|char)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},38:"tt",39:"ul",40:"var"},skiped_attributes:[],skiped_attribute_values:[],getValidTagAttributes:function(a,b){var c={},d=this.getPossibleTagAttributes(a);for(var e in b){var f=b[e];e=e.toLowerCase();var g=WYMeditor.Helper;g.arrayContains(this.skiped_attributes,e)||g.arrayContains(this.skiped_attribute_values,f)||("function"!=typeof f&&g.arrayContains(d,e)?this.doesAttributeNeedsValidation(a,e)?this.validateAttribute(a,e,f)&&(c[e]=f):c[e]=f:jQuery.each(d,function(){this.match(/\/(.*)\//)&&(regex=new RegExp(this.match(/\/(.*)\//)[1]),regex.test(e)&&(c[e]=f))}))}return c},getUniqueAttributesAndEventsForTag:function(a){var b=[];if(this._tags[a]&&this._tags[a].attributes)for(var c in this._tags[a].attributes)b.push(parseInt(c,10)==c?this._tags[a].attributes[c]:c);return b},getDefaultAttributesAndEventsForTags:function(){var a=[];for(var b in this._events)a.push(this._events[b]);for(b in this._attributes)a.push(this._attributes[b]);return a},isValidTag:function(a){if(this._tags[a])return!0;for(var b in this._tags)if(this._tags[b]==a)return!0;return!1},getDefaultAttributesAndEventsForTag:function(a){var b=[];if(this.isValidTag(a)){var c=this.getDefaultAttributesAndEventsForTags();for(var d in c){var e=c[d];if("object"==typeof e){var f=WYMeditor.Helper;if(e.except&&f.arrayContains(e.except,a)||e.only&&!f.arrayContains(e.only,a))continue;var g=e.attributes?e.attributes:e.events;for(var h in g)b.push("string"!=typeof g[h]?h:g[h])}}}return b},doesAttributeNeedsValidation:function(a,b){return this._tags[a]&&(this._tags[a].attributes&&this._tags[a].attributes[b]||this._tags[a].required&&WYMeditor.Helper.arrayContains(this._tags[a].required,b))},validateAttribute:function(a,b,c){return this._tags[a]&&this._tags[a].attributes&&this._tags[a].attributes[b]&&c.length>0&&!c.match(this._tags[a].attributes[b])||this._tags[a]&&this._tags[a].required&&WYMeditor.Helper.arrayContains(this._tags[a].required,b)&&0===c.length?!1:"undefined"!=typeof this._tags[a]},getPossibleTagAttributes:function(a){return this._possible_tag_attributes||(this._possible_tag_attributes={}),this._possible_tag_attributes[a]||(this._possible_tag_attributes[a]=this.getUniqueAttributesAndEventsForTag(a).concat(this.getDefaultAttributesAndEventsForTag(a))),this._possible_tag_attributes[a]}},WYMeditor.XmlHelper=function(){return this._entitiesDiv=document.createElement("div"),this},WYMeditor.XmlHelper.prototype.tag=function(a,b,c){return b=b||!1,c=c||!1,"<"+a+(b?this.tagOptions(b):"")+(c?">":" />")},WYMeditor.XmlHelper.prototype.contentTag=function(a,b,c){return c=c||!1,"<"+a+(c?this.tagOptions(c):"")+">"+b+"</"+a+">"},WYMeditor.XmlHelper.prototype.cdataSection=function(a){return"<![CDATA["+a+"]]>"},WYMeditor.XmlHelper.prototype.escapeOnce=function(a){return this._fixDoubleEscape(this.escapeEntities(a))},WYMeditor.XmlHelper.prototype._fixDoubleEscape=function(a){return a.replace(/&amp;([a-z]+|(#\d+));/gi,"&$1;")},WYMeditor.XmlHelper.prototype.tagOptions=function(a){var b=this;b._formated_options="";for(var c in a){var d=a[c];"function"!=typeof d&&d.length>0&&(parseInt(c,10)==c&&"object"==typeof d&&(c=d.shift(),d=d.pop()),""!==c&&""!==d&&(b._formated_options+=" "+c+'="'+b.escapeOnce(d)+'"'))}return b._formated_options},WYMeditor.XmlHelper.prototype.escapeEntities=function(a,b){this._entitiesDiv.innerHTML=a,this._entitiesDiv.textContent=a;var c=this._entitiesDiv.innerHTML;return"undefined"==typeof b&&(b!==!1&&(c=c.replace('"',"&quot;")),b===!0&&(c=c.replace('"',"&#039;"))),c},WYMeditor.XmlHelper.prototype.parseAttributes=function(a){var b=[],c=a.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g);if(c.toString()!=a)for(var d in c){var e=c[d];if("function"!=typeof e&&0!==e.length){var f=new RegExp("(\\w+)\\s*"+e),g=a.match(f);if(g){var h=e.replace(/^[\s=]+/,""),i=h.charAt(0);i='"'==i?'"':"'"==i?"'":"",""!==i&&(h='"'==i?h.replace(/^"|"+$/g,""):h.replace(/^'|'+$/g,"")),a=a.replace(g[0],""),b.push([g[1],h])}}}return b},WYMeditor.STRINGS.bg={Strong:"Получер",Emphasis:"Курсив",Superscript:"Горен индекс",Subscript:"Долен индекс",Ordered_List:"Подреден списък",Unordered_List:"Неподреден списък",Indent:"Блок навътре",Outdent:"Блок навън",Undo:"Стъпка назад",Redo:"Стъпка напред",Link:"Създай хипервръзка",Unlink:"Премахни хипервръзката",Image:"Изображение",Table:"Таблица",HTML:"HTML",Paragraph:"Абзац",Heading_1:"Заглавие 1",Heading_2:"Заглавие 2",Heading_3:"Заглавие 3",Heading_4:"Заглавие 4",Heading_5:"Заглавие 5",Heading_6:"Заглавие 6",Preformatted:"Преформатиран",Blockquote:"Цитат",Table_Header:"Заглавие на таблицата",URL:"URL",Title:"Заглавие",Alternative_Text:"Алтернативен текст",Caption:"Етикет",Summary:"Общо",Number_Of_Rows:"Брой редове",Number_Of_Cols:"Брой колони",Submit:"Изпрати",Cancel:"Отмени",Choose:"Затвори",Preview:"Предварителен преглед",Paste_From_Word:"Вмъкни от MS WORD",Tools:"Инструменти",Containers:"Контейнери",Classes:"Класове",Status:"Статус",Source_Code:"Източник, код"},WYMeditor.STRINGS.ca={Strong:"Ressaltar",Emphasis:"Emfatitzar",Superscript:"Superindex",Subscript:"Subindex",Ordered_List:"Llistat ordenat",Unordered_List:"Llistat sense ordenar",Indent:"Indentat",Outdent:"Sense indentar",Undo:"Desfer",Redo:"Refer",Link:"Enllaçar",Unlink:"Eliminar enllaç",Image:"Imatge",Table:"Taula",HTML:"HTML",Paragraph:"Paràgraf",Heading_1:"Capçalera 1",Heading_2:"Capçalera 2",Heading_3:"Capçalera 3",Heading_4:"Capçalera 4",Heading_5:"Capçalera 5",Heading_6:"Capçalera 6",Preformatted:"Pre-formatejat",Blockquote:"Cita",Table_Header:"Capçalera de la taula",URL:"URL",Title:"Títol",Alternative_Text:"Text alternatiu",Caption:"Llegenda",Summary:"Summary",Number_Of_Rows:"Nombre de files",Number_Of_Cols:"Nombre de columnes",Submit:"Enviar",Cancel:"Cancel·lar",Choose:"Triar",Preview:"Vista prèvia",Paste_From_Word:"Pegar des de Word",Tools:"Eines",Containers:"Contenidors",Classes:"Classes",Status:"Estat",Source_Code:"Codi font"},WYMeditor.STRINGS.cs={Strong:"Tučné",Emphasis:"Kurzíva",Superscript:"Horní index",Subscript:"Dolní index",Ordered_List:"Číslovaný seznam",Unordered_List:"Nečíslovaný seznam",Indent:"Zvětšit odsazení",Outdent:"Zmenšit odsazení",Undo:"Zpět",Redo:"Znovu",Link:"Vytvořit odkaz",Unlink:"Zrušit odkaz",Image:"Obrázek",Table:"Tabulka",HTML:"HTML",Paragraph:"Odstavec",Heading_1:"Nadpis 1. úrovně",Heading_2:"Nadpis 2. úrovně",Heading_3:"Nadpis 3. úrovně",Heading_4:"Nadpis 4. úrovně",Heading_5:"Nadpis 5. úrovně",Heading_6:"Nadpis 6. úrovně",Preformatted:"Předformátovaný text",Blockquote:"Citace",Table_Header:"Hlavičková buňka tabulky",URL:"Adresa",Title:"Text po najetí myší",Alternative_Text:"Text pro případ nezobrazení obrázku",Caption:"Titulek tabulky",Summary:"Shrnutí obsahu",Number_Of_Rows:"Počet řádek",Number_Of_Cols:"Počet sloupců",Submit:"Vytvořit",Cancel:"Zrušit",Choose:"Vybrat",Preview:"Náhled",Paste_From_Word:"Vložit z Wordu",Tools:"Nástroje",Containers:"Typy obsahu",Classes:"Třídy",Status:"Stav",Source_Code:"Zdrojový kód"},WYMeditor.STRINGS.cy={Strong:"Bras",Emphasis:"Italig",Superscript:"Uwchsgript",Subscript:"Is-sgript",Ordered_List:"Rhestr mewn Trefn",Unordered_List:"Pwyntiau Bwled",Indent:"Mewnoli",Outdent:"Alloli",Undo:"Dadwneud",Redo:"Ailwneud",Link:"Cysylltu",Unlink:"Datgysylltu",Image:"Delwedd",Table:"Tabl",HTML:"HTML",Paragraph:"Paragraff",Heading_1:"Pennawd 1",Heading_2:"Pennawd 2",Heading_3:"Pennawd 3",Heading_4:"Pennawd 4",Heading_5:"Pennawd 5",Heading_6:"Pennawd 6",Preformatted:"Rhagfformat",Blockquote:"Bloc Dyfyniad",Table_Header:"Pennyn Tabl",URL:"URL",Title:"Teitl",Alternative_Text:"Testun Amgen",Caption:"Pennawd",Summary:"Crynodeb",Number_Of_Rows:"Nifer y rhesi",Number_Of_Cols:"Nifer y colofnau",Submit:"Anfon",Cancel:"Diddymu",Choose:"Dewis",Preview:"Rhagolwg",Paste_From_Word:"Gludo o Word",Tools:"Offer",Containers:"Cynhwysyddion",Classes:"Dosbarthiadau",Status:"Statws",Source_Code:"Cod ffynhonnell"},WYMeditor.STRINGS.da={Strong:"Fed",Emphasis:"Skrå",Superscript:"Superscript",Subscript:"Subscript",Ordered_List:"Ordnet liste",Unordered_List:"Uordnet liste",Indent:"Indrykke",Outdent:"Udrykke",Undo:"Fortryd",Redo:"Fortryd",Link:"Link",Unlink:"Fjern link",Image:"Billede",Table:"Tabel",HTML:"HTML",Paragraph:"Paragraf",Heading_1:"Overskrift 1",Heading_2:"Overskrift 2",Heading_3:"Overskrift 3",Heading_4:"Overskrift 4",Heading_5:"Overskrift 5",Heading_6:"Overskrift 6",Preformatted:"Forudformateret",Blockquote:"Citat",Table_Header:"Tabel Overskrift",URL:"URL",Title:"Titel",Alternative_Text:"Alternativ tekst",Caption:"Billedtekst",Summary:"Resumé",Number_Of_Rows:"Antal rækker",Number_Of_Cols:"Antal kolonner",Submit:"Indsend",Cancel:"Afbryd",Choose:"Vælg",Preview:"Forhåndsvisning",Paste_From_Word:"Indsæt fra Word",Tools:"Værktøjer",Containers:"Containere",Classes:"Klasser",Status:"Status",Source_Code:"Kildekode"},WYMeditor.STRINGS.de={Strong:"Fett",Emphasis:"Kursiv",Superscript:"Text hochstellen",Subscript:"Text tiefstellen",Ordered_List:"Geordnete Liste einfügen",Unordered_List:"Ungeordnete Liste einfügen",Indent:"Einzug erhöhen",Outdent:"Einzug vermindern",Undo:"Befehle rückgängig machen",Redo:"Befehle wiederherstellen",Link:"Hyperlink einfügen",Unlink:"Hyperlink entfernen",Image:"Bild einfügen",Table:"Tabelle einfügen",HTML:"HTML anzeigen/verstecken",Paragraph:"Absatz",Heading_1:"Überschrift 1",Heading_2:"Überschrift 2",Heading_3:"Überschrift 3",Heading_4:"Überschrift 4",Heading_5:"Überschrift 5",Heading_6:"Überschrift 6",Preformatted:"Vorformatiert",Blockquote:"Zitat",Table_Header:"Tabellenüberschrift",URL:"URL",Title:"Titel",Alternative_Text:"Alternativer Text",Caption:"Tabellenüberschrift",Summary:"Summary",Number_Of_Rows:"Anzahl Zeilen",Number_Of_Cols:"Anzahl Spalten",Submit:"Absenden",Cancel:"Abbrechen",Choose:"Auswählen",Preview:"Vorschau",Paste_From_Word:"Aus Word einfügen",Tools:"Werkzeuge",Containers:"Inhaltstyp",Classes:"Klassen",Status:"Status",Source_Code:"Quellcode"},WYMeditor.STRINGS.en={Strong:"Strong",Emphasis:"Emphasis",Superscript:"Superscript",Subscript:"Subscript",Ordered_List:"Ordered List",Unordered_List:"Unordered List",Indent:"Indent",Outdent:"Outdent",Undo:"Undo",Redo:"Redo",Link:"Link",Unlink:"Unlink",Image:"Image",Table:"Table",HTML:"HTML",Paragraph:"Paragraph",Heading_1:"Heading 1",Heading_2:"Heading 2",Heading_3:"Heading 3",Heading_4:"Heading 4",Heading_5:"Heading 5",Heading_6:"Heading 6",Preformatted:"Preformatted",Blockquote:"Blockquote",Table_Header:"Table Header",URL:"URL",Title:"Title",Relationship:"Relationship",Alternative_Text:"Alternative text",Caption:"Caption",Summary:"Summary",Number_Of_Rows:"Number of rows",Number_Of_Cols:"Number of cols",Submit:"Submit",
+Cancel:"Cancel",Choose:"Choose",Preview:"Preview",Paste_From_Word:"Paste from Word",Tools:"Tools",Containers:"Formatting",Classes:"Style",Status:"Status",Source_Code:"Source code"},WYMeditor.STRINGS.es={Strong:"Resaltar",Emphasis:"Enfatizar",Superscript:"Superindice",Subscript:"Subindice",Ordered_List:"Lista ordenada",Unordered_List:"Lista sin ordenar",Indent:"Indentado",Outdent:"Sin indentar",Undo:"Deshacer",Redo:"Rehacer",Link:"Enlazar",Unlink:"Eliminar enlace",Image:"Imagen",Table:"Tabla",HTML:"HTML",Paragraph:"Párrafo",Heading_1:"Cabecera 1",Heading_2:"Cabecera 2",Heading_3:"Cabecera 3",Heading_4:"Cabecera 4",Heading_5:"Cabecera 5",Heading_6:"Cabecera 6",Preformatted:"Preformateado",Blockquote:"Cita",Table_Header:"Cabecera de la tabla",URL:"URL",Title:"Título",Alternative_Text:"Texto alternativo",Caption:"Leyenda",Summary:"Summary",Number_Of_Rows:"Número de filas",Number_Of_Cols:"Número de columnas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Seleccionar",Preview:"Vista previa",Paste_From_Word:"Pegar desde Word",Tools:"Herramientas",Containers:"Contenedores",Classes:"Clases",Status:"Estado",Source_Code:"Código fuente"},WYMeditor.STRINGS.fa={Strong:"پررنگ",Emphasis:"ایتالیک",Superscript:"بالانويس‌ ",Subscript:"زيرنويس‌",Ordered_List:"لیست مرتب",Unordered_List:"لیست نامرتب",Indent:"افزودن دندانه",Outdent:"کاهش دندانه",Undo:"واگردانی",Redo:"تکرار",Link:"ساختن پیوند",Unlink:"برداشتن پیوند",Image:"تصویر",Table:"جدول",HTML:"HTML",Paragraph:"پاراگراف",Heading_1:"سرتیتر ۱",Heading_2:"سرتیتر ۲",Heading_3:"سرتیتر ۳",Heading_4:"سرتیتر ۴",Heading_5:"سرتیتر ۵",Heading_6:"سرتیتر ۶",Preformatted:"قالب آماده",Blockquote:"نقل قول",Table_Header:"سرجدول",URL:"آدرس اینترنتی",Title:"عنوان",Alternative_Text:"متن جایگزین",Caption:"عنوان",Summary:"Summary",Number_Of_Rows:"تعداد سطرها",Number_Of_Cols:"تعداد ستون‌ها",Submit:"فرستادن",Cancel:"لغو",Choose:"انتخاب",Preview:"پیش‌نمایش",Paste_From_Word:"انتقال از ورد",Tools:"ابزار",Containers:"‌قالب‌ها",Classes:"کلاس‌ها",Status:"وضعیت",Source_Code:"کد مبدأ"},WYMeditor.STRINGS.fi={Strong:"Lihavoitu",Emphasis:"Korostus",Superscript:"Yläindeksi",Subscript:"Alaindeksi",Ordered_List:"Numeroitu lista",Unordered_List:"Luettelomerkit",Indent:"Suurenna sisennystä",Outdent:"Pienennä sisennystä",Undo:"Kumoa",Redo:"Toista",Link:"Linkitä",Unlink:"Poista linkitys",Image:"Kuva",Table:"Taulukko",HTML:"HTML",Paragraph:"Kappale",Heading_1:"Otsikko 1",Heading_2:"Otsikko 2",Heading_3:"Otsikko 3",Heading_4:"Otsikko 4",Heading_5:"Otsikko 5",Heading_6:"Otsikko 6",Preformatted:"Esimuotoilu",Blockquote:"Sitaatti",Table_Header:"Taulukon otsikko",URL:"URL",Title:"Otsikko",Alternative_Text:"Vaihtoehtoinen teksti",Caption:"Kuvateksti",Summary:"Yhteenveto",Number_Of_Rows:"Rivien määrä",Number_Of_Cols:"Palstojen määrä",Submit:"Lähetä",Cancel:"Peruuta",Choose:"Valitse",Preview:"Esikatsele",Paste_From_Word:"Tuo Wordista",Tools:"Työkalut",Containers:"Muotoilut",Classes:"Luokat",Status:"Tila",Source_Code:"Lähdekoodi"},WYMeditor.STRINGS.fr={Strong:"Mise en évidence",Emphasis:"Emphase",Superscript:"Exposant",Subscript:"Indice",Ordered_List:"Liste Ordonnée",Unordered_List:"Liste Non-Ordonnée",Indent:"Imbriqué",Outdent:"Non-imbriqué",Undo:"Annuler",Redo:"Rétablir",Link:"Lien",Unlink:"Supprimer le Lien",Image:"Image",Table:"Tableau",HTML:"HTML",Paragraph:"Paragraphe",Heading_1:"Titre 1",Heading_2:"Titre 2",Heading_3:"Titre 3",Heading_4:"Titre 4",Heading_5:"Titre 5",Heading_6:"Titre 6",Preformatted:"Pré-formatté",Blockquote:"Citation",Table_Header:"Cellule de titre",URL:"URL",Title:"Titre",Alternative_Text:"Texte alternatif",Caption:"Légende",Summary:"Résumé",Number_Of_Rows:"Nombre de lignes",Number_Of_Cols:"Nombre de colonnes",Submit:"Envoyer",Cancel:"Annuler",Choose:"Choisir",Preview:"Prévisualisation",Paste_From_Word:"Copier depuis Word",Tools:"Outils",Containers:"Type de texte",Classes:"Type de contenu",Status:"Infos",Source_Code:"Code source"},WYMeditor.STRINGS.gl={Strong:"Moita énfase",Emphasis:"Énfase",Superscript:"Superíndice",Subscript:"Subíndice",Ordered_List:"Lista ordenada",Unordered_List:"Lista sen ordenar",Indent:"Aniñar",Outdent:"Desaniñar",Undo:"Desfacer",Redo:"Refacer",Link:"Ligazón",Unlink:"Desligar",Image:"Imaxe",Table:"Táboa",HTML:"HTML",Paragraph:"Parágrafo",Heading_1:"Título 1",Heading_2:"Título 2",Heading_3:"Título 3",Heading_4:"Título 4",Heading_5:"Título 5",Heading_6:"Título 6",Preformatted:"Preformatado",Blockquote:"Cita en parágrafo",Table_Header:"Cabeceira da táboa",URL:"URL",Title:"Título",Alternative_Text:"Texto alternativo",Caption:"Título",Summary:"Resumo",Number_Of_Rows:"Número de filas",Number_Of_Cols:"Número de columnas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Escoller",Preview:"Previsualizar",Paste_From_Word:"Colar dende Word",Tools:"Ferramentas",Containers:"Contenedores",Classes:"Clases",Status:"Estado",Source_Code:"Código fonte"},WYMeditor.STRINGS.he={Strong:"חזק",Emphasis:"מובלט",Superscript:"כתב עילי",Subscript:"כתב תחתי",Ordered_List:"רשימה ממוספרת",Unordered_List:"רשימה לא ממוספרת",Indent:"הזחה פנימה",Outdent:"הזחה החוצה",Undo:"בטל פעולה",Redo:"בצע מחדש פעולה",Link:"קישור",Unlink:"בטל קישור",Image:"תמונה",Table:"טבלה",HTML:"קוד HTML",Paragraph:"פסקה",Heading_1:"כותרת 1 ; תג &lt;h1&gt;",Heading_2:"כותרת 2 ; תג &lt;h2&gt;",Heading_3:"כותרת 3 ; תג &lt;h3&gt;",Heading_4:"כותרת 4 ; תג &lt;h4&gt;",Heading_5:"כותרת 5 ; תג &lt;h5&gt;",Heading_6:"כותרת 6 ; תג &lt;h6&gt;",Preformatted:"משמר רווחים",Blockquote:"ציטוט",Table_Header:"כותרת טבלה",URL:"קישור (URL)",Title:"כותרת",Alternative_Text:"טקסט חלופי",Caption:"כותרת",Summary:"סיכום",Number_Of_Rows:"מספר שורות",Number_Of_Cols:"מספר טורים",Submit:"שלח",Cancel:"בטל",Choose:"בחר",Preview:"תצוגה מקדימה",Paste_From_Word:"העתק מ-Word",Tools:"כלים",Containers:"מיכלים",Classes:"מחלקות",Status:"מצב",Source_Code:"קוד מקור"},WYMeditor.STRINGS.hr={Strong:"Podebljano",Emphasis:"Naglašeno",Superscript:"Iznad",Subscript:"Ispod",Ordered_List:"Pobrojana lista",Unordered_List:"Nepobrojana lista",Indent:"Uvuci",Outdent:"Izvuci",Undo:"Poništi promjenu",Redo:"Ponovno promjeni",Link:"Hiperveza",Unlink:"Ukloni hipervezu",Image:"Slika",Table:"Tablica",HTML:"HTML",Paragraph:"Paragraf",Heading_1:"Naslov 1",Heading_2:"Naslov 2",Heading_3:"Naslov 3",Heading_4:"Naslov 4",Heading_5:"Naslov 5",Heading_6:"Naslov 6",Preformatted:"Unaprijed formatirano",Blockquote:"Citat",Table_Header:"Zaglavlje tablice",URL:"URL",Title:"Naslov",Alternative_Text:"Alternativni tekst",Caption:"Zaglavlje",Summary:"Sažetak",Number_Of_Rows:"Broj redova",Number_Of_Cols:"Broj kolona",Submit:"Snimi",Cancel:"Odustani",Choose:"Izaberi",Preview:"Pregled",Paste_From_Word:"Zalijepi iz Word-a",Tools:"Alati",Containers:"Kontejneri",Classes:"Klase",Status:"Status",Source_Code:"Izvorni kod"},WYMeditor.STRINGS.hu={Strong:"Félkövér",Emphasis:"Kiemelt",Superscript:"Felső index",Subscript:"Alsó index",Ordered_List:"Rendezett lista",Unordered_List:"Rendezetlen lista",Indent:"Bekezdés",Outdent:"Bekezdés törlése",Undo:"Visszavon",Redo:"Visszaállít",Link:"Link",Unlink:"Link törlése",Image:"Kép",Table:"Tábla",HTML:"HTML",Paragraph:"Bekezdés",Heading_1:"Címsor 1",Heading_2:"Címsor 2",Heading_3:"Címsor 3",Heading_4:"Címsor 4",Heading_5:"Címsor 5",Heading_6:"Címsor 6",Preformatted:"Előformázott",Blockquote:"Idézet",Table_Header:"Tábla Fejléc",URL:"Webcím",Title:"Megnevezés",Alternative_Text:"Alternatív szöveg",Caption:"Fejléc",Summary:"Summary",Number_Of_Rows:"Sorok száma",Number_Of_Cols:"Oszlopok száma",Submit:"Elküld",Cancel:"Mégsem",Choose:"Választ",Preview:"Előnézet",Paste_From_Word:"Másolás Word-ból",Tools:"Eszközök",Containers:"Tartalmak",Classes:"Osztályok",Status:"Állapot",Source_Code:"Forráskód"},WYMeditor.STRINGS.it={Strong:"Grassetto",Emphasis:"Corsetto",Superscript:"Apice",Subscript:"Pedice",Ordered_List:"Lista Ordinata",Unordered_List:"Lista Puntata",Indent:"Indenta",Outdent:"Caccia",Undo:"Indietro",Redo:"Avanti",Link:"Inserisci Link",Unlink:"Togli Link",Image:"Inserisci Immagine",Table:"Inserisci Tabella",HTML:"HTML",Paragraph:"Paragrafo",Heading_1:"Heading 1",Heading_2:"Heading 2",Heading_3:"Heading 3",Heading_4:"Heading 4",Heading_5:"Heading 5",Heading_6:"Heading 6",Preformatted:"Preformattato",Blockquote:"Blockquote",Table_Header:"Header Tabella",URL:"Indirizzo",Title:"Titolo",Alternative_Text:"Testo Alternativo",Caption:"Caption",Summary:"Summary",Number_Of_Rows:"Numero di Righe",Number_Of_Cols:"Numero di Colonne",Submit:"Invia",Cancel:"Cancella",Choose:"Scegli",Preview:"Anteprima",Paste_From_Word:"Incolla",Tools:"Tools",Containers:"Contenitori",Classes:"Classi",Status:"Stato",Source_Code:"Codice Sorgente"},WYMeditor.STRINGS.ja={Strong:"強調<strong>",Emphasis:"強調<em>",Superscript:"上付き",Subscript:"下付き",Ordered_List:"番号付きリスト",Unordered_List:"番号無リスト",Indent:"インデントを増やす",Outdent:"インデントを減らす",Undo:"元に戻す",Redo:"やり直す",Link:"リンク",Unlink:"リンク取消",Image:"画像",Table:"テーブル",HTML:"HTML",Paragraph:"段落",Heading_1:"見出し 1",Heading_2:"見出し 2",Heading_3:"見出し 3",Heading_4:"見出し 4",Heading_5:"見出し 5",Heading_6:"見出し 6",Preformatted:"整形済みテキスト",Blockquote:"引用文",Table_Header:"表見出し",URL:"URL",Title:"タイトル",Alternative_Text:"代替テキスト",Caption:"キャプション",Summary:"サマリー",Number_Of_Rows:"行数",Number_Of_Cols:"列数",Submit:"送信",Cancel:"キャンセル",Choose:"選択",Preview:"プレビュー",Paste_From_Word:"貼り付け",Tools:"ツール",Containers:"コンテナ",Classes:"クラス",Status:"ステータス",Source_Code:"ソースコード"},WYMeditor.STRINGS.lt={Strong:"Pusjuodis",Emphasis:"Kursyvas",Superscript:"Viršutinis indeksas",Subscript:"Apatinis indeksas",Ordered_List:"Numeruotas sąrašas",Unordered_List:"Suženklintas sąrašas",Indent:"Padidinti įtrauką",Outdent:"Sumažinti įtrauką",Undo:"Atšaukti",Redo:"Atstatyti",Link:"Nuoroda",Unlink:"Panaikinti nuorodą",Image:"Vaizdas",Table:"Lentelė",HTML:"HTML",Paragraph:"Paragrafas",Heading_1:"Antraštinis 1",Heading_2:"Antraštinis 2",Heading_3:"Antraštinis 3",Heading_4:"Antraštinis 4",Heading_5:"Antraštinis 5",Heading_6:"Antraštinis 6",Preformatted:"Formuotas",Blockquote:"Citata",Table_Header:"Lentelės antraštė",URL:"URL",Title:"Antraštinis tekstas",Relationship:"Sąryšis",Alternative_Text:"Alternatyvus tekstas",Caption:"Antraštė",Summary:"Santrauka",Number_Of_Rows:"Eilučių skaičius",Number_Of_Cols:"Stulpelių skaičius",Submit:"Išsaugoti",Cancel:"Nutraukti",Choose:"Rinktis",Preview:"Peržiūra",Paste_From_Word:"Įkelti iš MS Word",Tools:"Įrankiai",Containers:"Stiliai",Classes:"Klasės",Status:"Statusas",Source_Code:"Išeities tekstas"},WYMeditor.STRINGS.nb={Strong:"Fet",Emphasis:"Uthevet",Superscript:"Opphøyet",Subscript:"Nedsenket",Ordered_List:"Nummerert liste",Unordered_List:"Punktliste",Indent:"Rykk inn",Outdent:"Rykk ut",Undo:"Angre",Redo:"Gjenta",Link:"Lenke",Unlink:"Ta bort lenken",Image:"Bilde",Table:"Tabell",HTML:"HTML",Paragraph:"Avsnitt",Heading_1:"Overskrift 1",Heading_2:"Overskrift 2",Heading_3:"Overskrift 3",Heading_4:"Overskrift 4",Heading_5:"Overskrift 5",Heading_6:"Overskrift 6",Preformatted:"Preformatert",Blockquote:"Sitat",Table_Header:"Tabelloverskrift",URL:"URL",Title:"Tittel",Alternative_Text:"Alternativ tekst",Caption:"Overskrift",Summary:"Sammendrag",Number_Of_Rows:"Antall rader",Number_Of_Cols:"Antall kolonner",Submit:"Ok",Cancel:"Avbryt",Choose:"Velg",Preview:"Forhåndsvis",Paste_From_Word:"Lim inn fra Word",Tools:"Verktøy",Containers:"Formatering",Classes:"Klasser",Status:"Status",Source_Code:"Kildekode"},WYMeditor.STRINGS.nl={Strong:"Sterk benadrukken",Emphasis:"Benadrukken",Superscript:"Bovenschrift",Subscript:"Onderschrift",Ordered_List:"Geordende lijst",Unordered_List:"Ongeordende lijst",Indent:"Inspringen",Outdent:"Terugspringen",Undo:"Ongedaan maken",Redo:"Opnieuw uitvoeren",Link:"Linken",Unlink:"Ontlinken",Image:"Afbeelding",Table:"Tabel",HTML:"HTML",Paragraph:"Paragraaf",Heading_1:"Kop 1",Heading_2:"Kop 2",Heading_3:"Kop 3",Heading_4:"Kop 4",Heading_5:"Kop 5",Heading_6:"Kop 6",Preformatted:"Voorgeformatteerd",Blockquote:"Citaat",Table_Header:"Tabel-kop",URL:"URL",Title:"Titel",Relationship:"Relatie",Alternative_Text:"Alternatieve tekst",Caption:"Bijschrift",Summary:"Summary",Number_Of_Rows:"Aantal rijen",Number_Of_Cols:"Aantal kolommen",Submit:"Versturen",Cancel:"Annuleren",Choose:"Kiezen",Preview:"Voorbeeld bekijken",Paste_From_Word:"Plakken uit Word",Tools:"Hulpmiddelen",Containers:"Teksttypes",Classes:"Klassen",Status:"Status",Source_Code:"Broncode"},WYMeditor.STRINGS.nn={Strong:"Feit",Emphasis:"Utheva",Superscript:"Opphøgd",Subscript:"Nedsenka",Ordered_List:"Nummerert liste",Unordered_List:"Punktliste",Indent:"Rykk inn",Outdent:"Rykk ut",Undo:"Angre",Redo:"Gjentaka",Link:"Lenkje",Unlink:"Ta bort lenkja",Image:"Bilete",Table:"Tabell",HTML:"HTML",Paragraph:"Avsnitt",Heading_1:"Overskrift 1",Heading_2:"Overskrift 2",Heading_3:"Overskrift 3",Heading_4:"Overskrift 4",Heading_5:"Overskrift 5",Heading_6:"Overskrift 6",Preformatted:"Preformatert",Blockquote:"Sitat",Table_Header:"Tabelloverskrift",URL:"URL",Title:"Tittel",Alternative_Text:"Alternativ tekst",Caption:"Overskrift",Summary:"Samandrag",Number_Of_Rows:"Tal på rader",Number_Of_Cols:"Tal på kolonnar",Submit:"Ok",Cancel:"Avbryt",Choose:"Vel",Preview:"Førehandsvis",Paste_From_Word:"Lim inn frå Word",Tools:"Verkty",Containers:"Formatering",Classes:"Klassar",Status:"Status",Source_Code:"Kjeldekode"},WYMeditor.STRINGS.pl={Strong:"Nacisk",Emphasis:"Emfaza",Superscript:"Indeks górny",Subscript:"Indeks dolny",Ordered_List:"Lista numerowana",Unordered_List:"Lista wypunktowana",Indent:"Zwiększ wcięcie",Outdent:"Zmniejsz wcięcie",Undo:"Cofnij",Redo:"Ponów",Link:"Wstaw link",Unlink:"Usuń link",Image:"Obraz",Table:"Tabela",HTML:"Źródło HTML",Paragraph:"Akapit",Heading_1:"Nagłówek 1",Heading_2:"Nagłówek 2",Heading_3:"Nagłówek 3",Heading_4:"Nagłówek 4",Heading_5:"Nagłówek 5",Heading_6:"Nagłówek 6",Preformatted:"Preformatowany",Blockquote:"Cytat blokowy",Table_Header:"Nagłówek tabeli",URL:"URL",Title:"Tytuł",Alternative_Text:"Tekst alternatywny",Caption:"Tytuł tabeli",Summary:"Summary",Number_Of_Rows:"Liczba wierszy",Number_Of_Cols:"Liczba kolumn",Submit:"Wyślij",Cancel:"Anuluj",Choose:"Wybierz",Preview:"Podgląd",Paste_From_Word:"Wklej z Worda",Tools:"Narzędzia",Containers:"Format",Classes:"Styl",Status:"Status",Source_Code:"Kod źródłowy"},WYMeditor.STRINGS["pt-br"]={Strong:"Resaltar",Emphasis:"Enfatizar",Superscript:"Sobre escrito",Subscript:"Sub escrito ",Ordered_List:"Lista ordenada",Unordered_List:"Lista desordenada",Indent:"Indentado",Outdent:"Desidentar",Undo:"Desfazer",Redo:"Refazer",Link:"Link",Unlink:"Remover Link",Image:"Imagem",Table:"Tabela",HTML:"HTML",Paragraph:"Parágrafo",Heading_1:"Título 1",Heading_2:"Título 2",Heading_3:"Título 3",Heading_4:"Título 4",Heading_5:"Título 5",Heading_6:"Título 6",Preformatted:"Preformatado",Blockquote:"Citação",Table_Header:"Título de tabela",URL:"URL",Title:"Título",Alternative_Text:"Texto alternativo",Caption:"Legenda",Summary:"Summary",Number_Of_Rows:"Número de linhas",Number_Of_Cols:"Número de colunas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Selecionar",Preview:"Previsualizar",Paste_From_Word:"Copiar do Word",Tools:"Ferramentas",Containers:"Conteneiners",Classes:"Classes",Status:"Estado",Source_Code:"Código fonte"},WYMeditor.STRINGS.pt={Strong:"Negrito",Emphasis:"Itálico",Superscript:"Sobrescrito",Subscript:"Subsescrito",Ordered_List:"Lista Numerada",Unordered_List:"Lista Marcada",Indent:"Aumentar Indentaçã",Outdent:"Diminuir Indentaçã",Undo:"Desfazer",Redo:"Restaurar",Link:"Link",Unlink:"Tirar link",Image:"Imagem",Table:"Tabela",HTML:"HTML",Paragraph:"Parágrafo",Heading_1:"Título 1",Heading_2:"Título 2",Heading_3:"Título 3",Heading_4:"Título 4",Heading_5:"Título 5",Heading_6:"Título 6",Preformatted:"Pré-formatado",Blockquote:"Citação",Table_Header:"Cabeçalho Tabela",URL:"URL",Title:"Título",Alternative_Text:"Texto Alterativo",Caption:"Título Tabela",Summary:"Summary",Number_Of_Rows:"Número de Linhas",Number_Of_Cols:"Número de Colunas",Submit:"Enviar",Cancel:"Cancelar",Choose:"Escolha",Preview:"Prever",Paste_From_Word:"Colar do Word",Tools:"Ferramentas",Containers:"Containers",Classes:"Classes",Status:"Status",Source_Code:"Código Fonte"},WYMeditor.STRINGS.ru={Strong:"Жирный",Emphasis:"Наклонный",Superscript:"Надстрочный",Subscript:"Подстрочный",Ordered_List:"Нумерованый список",Unordered_List:"Ненумерованый список",Indent:"Увеличить отступ",Outdent:"Уменьшить отступ",Undo:"Отменить",Redo:"Повторить",Link:"Ссылка",Unlink:"Удалить ссылку",Image:"Изображение",Table:"Таблица",HTML:"Править HTML",Paragraph:"Параграф",Heading_1:"Заголовок 1",Heading_2:"Заголовок 2",Heading_3:"Заголовок 3",Heading_4:"Заголовок 4",Heading_5:"Заголовок 5",Heading_6:"Заголовок 6",Preformatted:"Preformatted",Blockquote:"Цитата",Table_Header:"Заголовок таблицы",URL:"URL",Title:"Заголовок",Alternative_Text:"Альтернативный текст",Caption:"Надпись",Summary:"Summary",Number_Of_Rows:"Кол-во строк",Number_Of_Cols:"Кол-во столбцов",Submit:"Отправить",Cancel:"Отмена",Choose:"Выбор",Preview:"Просмотр",Paste_From_Word:"Вставить из Word",Tools:"Инструменты",Containers:"Контейнеры",Classes:"Классы",Status:"Статус",Source_Code:"Исходный код"},WYMeditor.STRINGS.sk={Strong:"Tučné",Emphasis:"Kurzíva",Superscript:"Horný index",Subscript:"Dolný index",Ordered_List:"Číslovaný zoznam",Unordered_List:"Nečíslovaný zoznam",Indent:"Zväčšiť odsadenie",Outdent:"Zmenšiť odsadenie",Undo:"Vrátiť",Redo:"Opakovať",Link:"Vytvoriť odkaz",Unlink:"Zrušiť odkaz",Image:"Obrázok",Table:"Tabuľka",HTML:"HTML",Paragraph:"Odstavec",Heading_1:"Nadpis 1. úrovne",Heading_2:"Nadpis 2. úrovne",Heading_3:"Nadpis 3. úrovne",Heading_4:"Nadpis 4. úrovne",Heading_5:"Nadpis 5. úrovne",Heading_6:"Nadpis 6. úrovne",Preformatted:"Predformátovaný text",Blockquote:"Citácia",Table_Header:"Hlavička tabuľky",URL:"URL adresa",Title:"Titulok",Alternative_Text:"Alternatívny text",Caption:"Titulok tabuľky",Summary:"Zhrnutie obsahu",Number_Of_Rows:"Počet riadkov",Number_Of_Cols:"Počet stĺpcov",Submit:"Odoslať",Cancel:"Zrušiť",Choose:"Vybrať",Preview:"Náhľad",Paste_From_Word:"Vložiť z Wordu",Tools:"Nástroje",Containers:"Typy obsahu",Classes:"Triedy",Status:"Stav",Source_Code:"Zdrojový kód"},WYMeditor.STRINGS.sv={Strong:"Viktigt",Emphasis:"Betoning",Superscript:"Upphöjt",Subscript:"Nedsänkt",Ordered_List:"Nummerlista",Unordered_List:"Punktlista",Indent:"Indrag",Outdent:"Utdrag",Undo:"Ångra",Redo:"Gör om",Link:"Länk",Unlink:"Ta bort länk",Image:"Bild",Table:"Tabell",HTML:"HTML",Paragraph:"Paragraf",Heading_1:"Rubrik 1",Heading_2:"Rubrik 2",Heading_3:"Rubrik 3",Heading_4:"Rubrik 4",Heading_5:"Rubrik 5",Heading_6:"Rubrik 6",Preformatted:"Förformaterad",Blockquote:"Blockcitat",Table_Header:"Tabellrubrik",URL:"URL",Title:"Titel",Relationship:"Relation",Alternative_Text:"Alternativ text",Caption:"Överskrift",Summary:"Summary",Number_Of_Rows:"Antal rader",Number_Of_Cols:"Antal kolumner",Submit:"Skicka",Cancel:"Avbryt",Choose:"Välj",Preview:"Förhandsgranska",Paste_From_Word:"Klistra in från Word",Tools:"Verktyg",Containers:"Formatering",Classes:"Klasser",Status:"Status",Source_Code:"Källkod"},WYMeditor.STRINGS.tr={Strong:"Kalın",Emphasis:"Vurgu",Superscript:"Üstsimge",Subscript:"Altsimge",Ordered_List:"Sıralı List",Unordered_List:"Sırasız List",Indent:"Girintile",Outdent:"Çıkıntıla",Undo:"Geri Al",Redo:"Yinele",Link:"Bağlantı",Unlink:"Bağlantıyı Kaldır",Image:"Resim",Table:"Tablo",HTML:"HTML",Paragraph:"Parağraf",Heading_1:"Başlık 1",Heading_2:"Başlık 2",Heading_3:"Başlık 3",Heading_4:"Başlık 4",Heading_5:"Başlık 5",Heading_6:"Başlık 6",Preformatted:"Önceden Formatlı",Blockquote:"Alıntı",Table_Header:"Tablo Başlığı",URL:"URL",Title:"Başlık",Alternative_Text:"Alternatif Metin",Caption:"Etiket",Summary:"Özet",Number_Of_Rows:"Satır sayısı",Number_Of_Cols:"Sütun sayısı",Submit:"Gönder",Cancel:"İptal",Choose:"Seç",Preview:"Önizleme",Paste_From_Word:"Word'den yapıştır",Tools:"Araçlar",Containers:"Kapsayıcılar",Classes:"Sınıflar",Status:"Durum",Source_Code:"Kaynak Kodu"},WYMeditor.STRINGS.zh_cn={Strong:"加粗",Emphasis:"斜体",Superscript:"上标",Subscript:"下标",Ordered_List:"有序列表",Unordered_List:"无序列表",Indent:"增加缩进",Outdent:"减少缩进",Undo:"撤消",Redo:"重做",Link:"链接",Unlink:"取消链接",Image:"图片",Table:"表格",HTML:"HTML源代码",Paragraph:"段落",Heading_1:"标题 1",Heading_2:"标题 2",Heading_3:"标题 3",Heading_4:"标题 4",Heading_5:"标题 5",Heading_6:"标题 6",Preformatted:"原始文本",Blockquote:"引语",Table_Header:"表头",URL:"地址",Title:"提示文字",Alternative_Text:"失效文字",Caption:"标题",Summary:"Summary",Number_Of_Rows:"行数",Number_Of_Cols:"列数",Submit:"提交",Cancel:"放弃",Choose:"选择",Preview:"预览",Paste_From_Word:"从Word粘贴纯文本",Tools:"工具",Containers:"容器",Classes:"预定义样式",Status:"状态",Source_Code:"源代码",Attachment:"附件",NewParagraph:"新段落"},WYMeditor.STRINGS.zh_tw={Strong:"加粗",Emphasis:"斜體",Superscript:"上標",Subscript:"下標",Ordered_List:"有序列表",Unordered_List:"無序列表",Indent:"增加縮排",Outdent:"減少縮排",Undo:"取消",Redo:"重做",Link:"鏈結",Unlink:"取消鏈結",Image:"圖片",Table:"表格",HTML:"HTML 源代碼",Paragraph:"段落",Heading_1:"標題 1",Heading_2:"標題 2",Heading_3:"標題 3",Heading_4:"標題 4",Heading_5:"標題 5",Heading_6:"標題 6",Preformatted:"原始文本",Blockquote:"引語",Table_Header:"表格頂部",URL:"地址",Title:"提示文字",Alternative_Text:"失效文字",Caption:"主題",Summary:"大綱",Number_Of_Rows:"行數",Number_Of_Cols:"列數",Submit:"提交",Cancel:"放棄",Choose:"選擇",Preview:"預覽",Paste_From_Word:"從Word複制純文本",Tools:"工具",Containers:"容器",Classes:"預定義樣式",Status:"狀態",Source_Code:"源代碼",Attachment:"附件",NewParagraph:"新段落"},window.rangy=function(){function a(a,b){var c=typeof a[b];return c==l||!(c!=k||!a[b])||"unknown"==c}function b(a,b){return!(typeof a[b]!=k||!a[b])}function c(a,b){return typeof a[b]!=m}function d(a){return function(b,c){for(var d=c.length;d--;)if(!a(b,c[d]))return!1;return!0}}function e(a){return a&&r(a,q)&&t(a,p)}function f(a){window.alert("Rangy not supported in your browser. Reason: "+a),u.initialized=!0,u.supported=!1}function g(a){var b="Rangy warning: "+a;u.config.alertOnWarn?window.alert(b):typeof window.console!=m&&typeof window.console.log!=m&&window.console.log(b)}function h(){if(!u.initialized){var c,d=!1,g=!1;a(document,"createRange")&&(c=document.createRange(),r(c,o)&&t(c,n)&&(d=!0),c.detach());var h=b(document,"body")?document.body:document.getElementsByTagName("body")[0];h&&a(h,"createTextRange")&&(c=h.createTextRange(),e(c)&&(g=!0)),d||g||f("Neither Range nor TextRange are implemented"),u.initialized=!0,u.features={implementsDomRange:d,implementsTextRange:g};for(var i=w.concat(v),j=0,k=i.length;k>j;++j)try{i[j](u)}catch(l){b(window,"console")&&a(window.console,"log")&&window.console.log("Init listener threw an exception. Continuing.",l)}}}function i(a){a=a||window,h();for(var b=0,c=x.length;c>b;++b)x[b](a)}function j(a){this.name=a,this.initialized=!1,this.supported=!1}var k="object",l="function",m="undefined",n=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer","START_TO_START","START_TO_END","END_TO_START","END_TO_END"],o=["setStart","setStartBefore","setStartAfter","setEnd","setEndBefore","setEndAfter","collapse","selectNode","selectNodeContents","compareBoundaryPoints","deleteContents","extractContents","cloneContents","insertNode","surroundContents","cloneRange","toString","detach"],p=["boundingHeight","boundingLeft","boundingTop","boundingWidth","htmlText","text"],q=["collapse","compareEndPoints","duplicate","getBookmark","moveToBookmark","moveToElementText","parentElement","pasteHTML","select","setEndPoint","getBoundingClientRect"],r=d(a),s=d(b),t=d(c),u={version:"1.2.2",initialized:!1,supported:!0,util:{isHostMethod:a,isHostObject:b,isHostProperty:c,areHostMethods:r,areHostObjects:s,areHostProperties:t,isTextRange:e},features:{},modules:{},config:{alertOnWarn:!1,preferTextRange:!1}};u.fail=f,u.warn=g,{}.hasOwnProperty?u.util.extend=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])}:f("hasOwnProperty not supported");var v=[],w=[];u.init=h,u.addInitListener=function(a){u.initialized?a(u):v.push(a)};var x=[];u.addCreateMissingNativeApiListener=function(a){x.push(a)},u.createMissingNativeApi=i,j.prototype.fail=function(a){throw this.initialized=!0,this.supported=!1,new Error("Module '"+this.name+"' failed to load: "+a)},j.prototype.warn=function(a){u.warn("Module "+this.name+": "+a)},j.prototype.createError=function(a){return new Error("Error in Rangy "+this.name+" module: "+a)},u.createModule=function(a,b){var c=new j(a);u.modules[a]=c,w.push(function(a){b(a,c),c.initialized=!0,c.supported=!0})},u.requireModules=function(a){for(var b,c,d=0,e=a.length;e>d;++d){if(c=a[d],b=u.modules[c],!(b&&b instanceof j))throw new Error("Module '"+c+"' not found");if(!b.supported)throw new Error("Module '"+c+"' not supported")}};var y=!1,z=function(a){y||(y=!0,u.initialized||h())};return typeof window==m?void f("No window found"):typeof document==m?void f("No document found"):(a(document,"addEventListener")&&document.addEventListener("DOMContentLoaded",z,!1),a(window,"addEventListener")?window.addEventListener("load",z,!1):a(window,"attachEvent")?window.attachEvent("onload",z):f("Window does not have required addEventListener or attachEvent method"),u)}(),rangy.createModule("DomUtil",function(a,b){function c(a){var b;return typeof a.namespaceURI==z||null===(b=a.namespaceURI)||"http://www.w3.org/1999/xhtml"==b}function d(a){var b=a.parentNode;return 1==b.nodeType?b:null}function e(a){for(var b=0;a=a.previousSibling;)b++;return b}function f(a){var b;return j(a)?a.length:(b=a.childNodes)?b.length:0}function g(a,b){var c,d=[];for(c=a;c;c=c.parentNode)d.push(c);for(c=b;c;c=c.parentNode)if(D(d,c))return c;return null}function h(a,b,c){for(var d=c?b:b.parentNode;d;){if(d===a)return!0;d=d.parentNode}return!1}function i(a,b,c){for(var d,e=c?a:a.parentNode;e;){if(d=e.parentNode,d===b)return e;e=d}return null}function j(a){var b=a.nodeType;return 3==b||4==b||8==b}function k(a,b){var c=b.nextSibling,d=b.parentNode;return c?d.insertBefore(a,c):d.appendChild(a),a}function l(a,b){var c=a.cloneNode(!1);return c.deleteData(0,b),a.deleteData(b,a.length-b),k(c,a),c}function m(a){if(9==a.nodeType)return a;if(typeof a.ownerDocument!=z)return a.ownerDocument;if(typeof a.document!=z)return a.document;if(a.parentNode)return m(a.parentNode);throw new Error("getDocument: no document found for node")}function n(a){var b=m(a);if(typeof b.defaultView!=z)return b.defaultView;if(typeof b.parentWindow!=z)return b.parentWindow;throw new Error("Cannot get a window object for node")}function o(a){if(typeof a.contentDocument!=z)return a.contentDocument;if(typeof a.contentWindow!=z)return a.contentWindow.document;throw new Error("getIframeWindow: No Document object found for iframe element")}function p(a){if(typeof a.contentWindow!=z)return a.contentWindow;if(typeof a.contentDocument!=z)return a.contentDocument.defaultView;throw new Error("getIframeWindow: No Window object found for iframe element")}function q(a){return A.isHostObject(a,"body")?a.body:a.getElementsByTagName("body")[0]}function r(a){for(var b;b=a.parentNode;)a=b;return a}function s(a,b,c,d){var f,h,j,k,l;if(a==c)return b===d?0:d>b?-1:1;if(f=i(c,a,!0))return b<=e(f)?-1:1;if(f=i(a,c,!0))return e(f)<d?-1:1;if(h=g(a,c),j=a===h?h:i(a,h,!0),k=c===h?h:i(c,h,!0),j===k)throw new Error("comparePoints got to case 4 and childA and childB are the same!");for(l=h.firstChild;l;){if(l===j)return-1;if(l===k)return 1;l=l.nextSibling}throw new Error("Should not be here!")}function t(a){for(var b,c=m(a).createDocumentFragment();b=a.firstChild;)c.appendChild(b);return c}function u(a){if(!a)return"[No node]";if(j(a))return'"'+a.data+'"';if(1==a.nodeType){var b=a.id?' id="'+a.id+'"':"";return"<"+a.nodeName+b+">["+a.childNodes.length+"]"}return a.nodeName}function v(a){this.root=a,this._next=a}function w(a){return new v(a)}function x(a,b){this.node=a,this.offset=b}function y(a){this.code=this[a],this.codeName=a,this.message="DOMException: "+this.codeName}var z="undefined",A=a.util;A.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||b.fail("document missing a Node creation method"),A.isHostMethod(document,"getElementsByTagName")||b.fail("document missing getElementsByTagName method");var B=document.createElement("div");A.areHostMethods(B,["insertBefore","appendChild","cloneNode"]||!A.areHostObjects(B,["previousSibling","nextSibling","childNodes","parentNode"]))||b.fail("Incomplete Element implementation"),A.isHostProperty(B,"innerHTML")||b.fail("Element is missing innerHTML property");var C=document.createTextNode("test");A.areHostMethods(C,["splitText","deleteData","insertData","appendData","cloneNode"]||!A.areHostObjects(B,["previousSibling","nextSibling","childNodes","parentNode"])||!A.areHostProperties(C,["data"]))||b.fail("Incomplete Text Node implementation");var D=function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1};v.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var a,b,c=this._current=this._next;if(this._current)if(a=c.firstChild)this._next=a;else{for(b=null;c!==this.root&&!(b=c.nextSibling);)c=c.parentNode;this._next=b}return this._current},detach:function(){this._current=this._next=this.root=null}},x.prototype={equals:function(a){return this.node===a.node&this.offset==a.offset},inspect:function(){return"[DomPosition("+u(this.node)+":"+this.offset+")]"}},y.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11},y.prototype.toString=function(){return this.message},a.dom={arrayContains:D,isHtmlNamespace:c,parentElement:d,getNodeIndex:e,getNodeLength:f,getCommonAncestor:g,isAncestorOf:h,getClosestAncestorIn:i,isCharacterDataNode:j,insertAfter:k,splitDataNode:l,getDocument:m,getWindow:n,getIframeWindow:p,getIframeDocument:o,getBody:q,getRootContainer:r,comparePoints:s,inspectNode:u,fragmentFromNodeChildren:t,createIterator:w,DomPosition:x},a.DOMException=y}),rangy.createModule("DomRange",function(a,b){function c(a,b){return 3!=a.nodeType&&(L.isAncestorOf(a,b.startContainer,!0)||L.isAncestorOf(a,b.endContainer,!0))}function d(a){return L.getDocument(a.startContainer)}function e(a,b,c){var d=a._listeners[b];if(d)for(var e=0,f=d.length;f>e;++e)d[e].call(a,{target:a,args:c})}function f(a){return new M(a.parentNode,L.getNodeIndex(a))}function g(a){return new M(a.parentNode,L.getNodeIndex(a)+1)}function h(a,b,c){var d=11==a.nodeType?a.firstChild:a;return L.isCharacterDataNode(b)?c==b.length?L.insertAfter(a,b):b.parentNode.insertBefore(a,0==c?b:L.splitDataNode(b,c)):c>=b.childNodes.length?b.appendChild(a):b.insertBefore(a,b.childNodes[c]),d}function i(a){for(var b,c,e,f=d(a.range).createDocumentFragment();c=a.next();){if(b=a.isPartiallySelectedSubtree(),c=c.cloneNode(!b),b&&(e=a.getSubtreeIterator(),c.appendChild(i(e)),e.detach(!0)),10==c.nodeType)throw new N("HIERARCHY_REQUEST_ERR");f.appendChild(c)}return f}function j(a,b,c){var d,e;c=c||{stop:!1};for(var f,g;f=a.next();)if(a.isPartiallySelectedSubtree()){if(b(f)===!1)return void(c.stop=!0);if(g=a.getSubtreeIterator(),j(g,b,c),g.detach(!0),c.stop)return}else for(d=L.createIterator(f);e=d.next();)if(b(e)===!1)return void(c.stop=!0)}function k(a){for(var b;a.next();)a.isPartiallySelectedSubtree()?(b=a.getSubtreeIterator(),k(b),b.detach(!0)):a.remove()}function l(a){for(var b,c,e=d(a.range).createDocumentFragment();b=a.next();){if(a.isPartiallySelectedSubtree()?(b=b.cloneNode(!1),c=a.getSubtreeIterator(),b.appendChild(l(c)),c.detach(!0)):a.remove(),10==b.nodeType)throw new N("HIERARCHY_REQUEST_ERR");e.appendChild(b)}return e}function m(a,b,c){var d,e=!(!b||!b.length),f=!!c;e&&(d=new RegExp("^("+b.join("|")+")$"));var g=[];return j(new o(a,!1),function(a){e&&!d.test(a.nodeType)||f&&!c(a)||g.push(a)}),g}function n(a){var b="undefined"==typeof a.getName?"Range":a.getName();return"["+b+"("+L.inspectNode(a.startContainer)+":"+a.startOffset+", "+L.inspectNode(a.endContainer)+":"+a.endOffset+")]"}function o(a,b){if(this.range=a,this.clonePartiallySelectedTextNodes=b,!a.collapsed){this.sc=a.startContainer,this.so=a.startOffset,this.ec=a.endContainer,this.eo=a.endOffset;var c=a.commonAncestorContainer;this.sc===this.ec&&L.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc!==c||L.isCharacterDataNode(this.sc)?L.getClosestAncestorIn(this.sc,c,!0):this.sc.childNodes[this.so],
+this._last=this.ec!==c||L.isCharacterDataNode(this.ec)?L.getClosestAncestorIn(this.ec,c,!0):this.ec.childNodes[this.eo-1])}}function p(a){this.code=this[a],this.codeName=a,this.message="RangeException: "+this.codeName}function q(a,b,c){this.nodes=m(a,b,c),this._next=this.nodes[0],this._position=0}function r(a){return function(b,c){for(var d,e=c?b:b.parentNode;e;){if(d=e.nodeType,L.arrayContains(a,d))return e;e=e.parentNode}return null}}function s(a,b){if(W(a,b))throw new p("INVALID_NODE_TYPE_ERR")}function t(a){if(!a.startContainer)throw new N("INVALID_STATE_ERR")}function u(a,b){if(!L.arrayContains(b,a.nodeType))throw new p("INVALID_NODE_TYPE_ERR")}function v(a,b){if(0>b||b>(L.isCharacterDataNode(a)?a.length:a.childNodes.length))throw new N("INDEX_SIZE_ERR")}function w(a,b){if(U(a,!0)!==U(b,!0))throw new N("WRONG_DOCUMENT_ERR")}function x(a){if(V(a,!0))throw new N("NO_MODIFICATION_ALLOWED_ERR")}function y(a,b){if(!a)throw new N(b)}function z(a){return!L.arrayContains(P,a.nodeType)&&!U(a,!0)}function A(a,b){return b<=(L.isCharacterDataNode(a)?a.length:a.childNodes.length)}function B(a){if(t(a),z(a.startContainer)||z(a.endContainer)||!A(a.startContainer,a.startOffset)||!A(a.endContainer,a.endOffset))throw new Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")")}function C(){}function D(a){a.START_TO_START=aa,a.START_TO_END=ba,a.END_TO_END=ca,a.END_TO_START=da,a.NODE_BEFORE=ea,a.NODE_AFTER=fa,a.NODE_BEFORE_AND_AFTER=ga,a.NODE_INSIDE=ha}function E(a){D(a),D(a.prototype)}function F(a,b){return function(){B(this);var c,d,e=this.startContainer,f=this.startOffset,h=this.commonAncestorContainer,i=new o(this,!0);e!==h&&(c=L.getClosestAncestorIn(e,h,!0),d=g(c),e=d.node,f=d.offset),j(i,x),i.reset();var k=a(i);return i.detach(),b(this,e,f,e,f),k}}function G(b,d,e){function h(a,b){return function(c){t(this),u(c,O),u(T(c),P);var d=(a?f:g)(c);(b?i:j)(this,d.node,d.offset)}}function i(a,b,c){var e=a.endContainer,f=a.endOffset;(b!==a.startContainer||c!==a.startOffset)&&((T(b)!=T(e)||1==L.comparePoints(b,c,e,f))&&(e=b,f=c),d(a,b,c,e,f))}function j(a,b,c){var e=a.startContainer,f=a.startOffset;(b!==a.endContainer||c!==a.endOffset)&&((T(b)!=T(e)||-1==L.comparePoints(b,c,e,f))&&(e=b,f=c),d(a,e,f,b,c))}function m(a,b,c){(b!==a.startContainer||c!==a.startOffset||b!==a.endContainer||c!==a.endOffset)&&d(a,b,c,b,c)}b.prototype=new C,a.util.extend(b.prototype,{setStart:function(a,b){t(this),s(a,!0),v(a,b),i(this,a,b)},setEnd:function(a,b){t(this),s(a,!0),v(a,b),j(this,a,b)},setStartBefore:h(!0,!0),setStartAfter:h(!1,!0),setEndBefore:h(!0,!1),setEndAfter:h(!1,!1),collapse:function(a){B(this),a?d(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):d(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(a){t(this),s(a,!0),d(this,a,0,a,L.getNodeLength(a))},selectNode:function(a){t(this),s(a,!1),u(a,O);var b=f(a),c=g(a);d(this,b.node,b.offset,c.node,c.offset)},extractContents:F(l,d),deleteContents:F(k,d),canSurroundContents:function(){B(this),x(this.startContainer),x(this.endContainer);var a=new o(this,!0),b=a._first&&c(a._first,this)||a._last&&c(a._last,this);return a.detach(),!b},detach:function(){e(this)},splitBoundaries:function(){B(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,e=this.endOffset,f=a===c;L.isCharacterDataNode(c)&&e>0&&e<c.length&&L.splitDataNode(c,e),L.isCharacterDataNode(a)&&b>0&&b<a.length&&(a=L.splitDataNode(a,b),f?(e-=b,c=a):c==a.parentNode&&e>=L.getNodeIndex(a)&&e++,b=0),d(this,a,b,c,e)},normalizeBoundaries:function(){B(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,e=this.endOffset,f=function(a){var b=a.nextSibling;b&&b.nodeType==a.nodeType&&(c=a,e=a.length,a.appendData(b.data),b.parentNode.removeChild(b))},g=function(d){var f=d.previousSibling;if(f&&f.nodeType==d.nodeType){a=d;var g=d.length;if(b=f.length,d.insertData(0,f.data),f.parentNode.removeChild(f),a==c)e+=b,c=a;else if(c==d.parentNode){var h=L.getNodeIndex(d);e==h?(c=d,e=g):e>h&&e--}}},h=!0;if(L.isCharacterDataNode(c))c.length==e&&f(c);else{if(e>0){var i=c.childNodes[e-1];i&&L.isCharacterDataNode(i)&&f(i)}h=!this.collapsed}if(h){if(L.isCharacterDataNode(a))0==b&&g(a);else if(b<a.childNodes.length){var j=a.childNodes[b];j&&L.isCharacterDataNode(j)&&g(j)}}else a=c,b=e;d(this,a,b,c,e)},collapseToPoint:function(a,b){t(this),s(a,!0),v(a,b),m(this,a,b)}}),E(b)}function H(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset,a.commonAncestorContainer=a.collapsed?a.startContainer:L.getCommonAncestor(a.startContainer,a.endContainer)}function I(a,b,c,d,f){var g=a.startContainer!==b||a.startOffset!==c,h=a.endContainer!==d||a.endOffset!==f;a.startContainer=b,a.startOffset=c,a.endContainer=d,a.endOffset=f,H(a),e(a,"boundarychange",{startMoved:g,endMoved:h})}function J(a){t(a),a.startContainer=a.startOffset=a.endContainer=a.endOffset=null,a.collapsed=a.commonAncestorContainer=null,e(a,"detach",null),a._listeners=null}function K(a){this.startContainer=a,this.startOffset=0,this.endContainer=a,this.endOffset=0,this._listeners={boundarychange:[],detach:[]},H(this)}a.requireModules(["DomUtil"]);var L=a.dom,M=L.DomPosition,N=a.DOMException;o.prototype={_current:null,_next:null,_first:null,_last:null,isSingleCharacterDataNode:!1,reset:function(){this._current=null,this._next=this._first},hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next;return a&&(this._next=a!==this._last?a.nextSibling:null,L.isCharacterDataNode(a)&&this.clonePartiallySelectedTextNodes&&(a===this.ec&&(a=a.cloneNode(!0)).deleteData(this.eo,a.length-this.eo),this._current===this.sc&&(a=a.cloneNode(!0)).deleteData(0,this.so))),a},remove:function(){var a,b,c=this._current;!L.isCharacterDataNode(c)||c!==this.sc&&c!==this.ec?c.parentNode&&c.parentNode.removeChild(c):(a=c===this.sc?this.so:0,b=c===this.ec?this.eo:c.length,a!=b&&c.deleteData(a,b-a))},isPartiallySelectedSubtree:function(){var a=this._current;return c(a,this.range)},getSubtreeIterator:function(){var a;if(this.isSingleCharacterDataNode)a=this.range.cloneRange(),a.collapse();else{a=new K(d(this.range));var b=this._current,c=b,e=0,f=b,g=L.getNodeLength(b);L.isAncestorOf(b,this.sc,!0)&&(c=this.sc,e=this.so),L.isAncestorOf(b,this.ec,!0)&&(f=this.ec,g=this.eo),I(a,c,e,f,g)}return new o(a,this.clonePartiallySelectedTextNodes)},detach:function(a){a&&this.range.detach(),this.range=this._current=this._next=this._first=this._last=this.sc=this.so=this.ec=this.eo=null}},p.prototype={BAD_BOUNDARYPOINTS_ERR:1,INVALID_NODE_TYPE_ERR:2},p.prototype.toString=function(){return this.message},q.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){return this._current=this._next,this._next=this.nodes[++this._position],this._current},detach:function(){this._current=this._next=this.nodes=null}};var O=[1,3,4,5,7,8,10],P=[2,9,11],Q=[5,6,10,12],R=[1,3,4,5,7,8,10,11],S=[1,3,4,5,7,8],T=L.getRootContainer,U=r([9,11]),V=r(Q),W=r([6,10,12]),X=document.createElement("style"),Y=!1;try{X.innerHTML="<b>x</b>",Y=3==X.firstChild.nodeType}catch(Z){}a.features.htmlParsingConforms=Y;var $=Y?function(a){var b=this.startContainer,c=L.getDocument(b);if(!b)throw new N("INVALID_STATE_ERR");var d=null;return 1==b.nodeType?d=b:L.isCharacterDataNode(b)&&(d=L.parentElement(b)),d=null===d||"HTML"==d.nodeName&&L.isHtmlNamespace(L.getDocument(d).documentElement)&&L.isHtmlNamespace(d)?c.createElement("body"):d.cloneNode(!1),d.innerHTML=a,L.fragmentFromNodeChildren(d)}:function(a){t(this);var b=d(this),c=b.createElement("body");return c.innerHTML=a,L.fragmentFromNodeChildren(c)},_=["startContainer","startOffset","endContainer","endOffset","collapsed","commonAncestorContainer"],aa=0,ba=1,ca=2,da=3,ea=0,fa=1,ga=2,ha=3;C.prototype={attachListener:function(a,b){this._listeners[a].push(b)},compareBoundaryPoints:function(a,b){B(this),w(this.startContainer,b.startContainer);var c,d,e,f,g=a==da||a==aa?"start":"end",h=a==ba||a==aa?"start":"end";return c=this[g+"Container"],d=this[g+"Offset"],e=b[h+"Container"],f=b[h+"Offset"],L.comparePoints(c,d,e,f)},insertNode:function(a){if(B(this),u(a,R),x(this.startContainer),L.isAncestorOf(a,this.startContainer,!0))throw new N("HIERARCHY_REQUEST_ERR");var b=h(a,this.startContainer,this.startOffset);this.setStartBefore(b)},cloneContents:function(){B(this);var a,b;if(this.collapsed)return d(this).createDocumentFragment();if(this.startContainer===this.endContainer&&L.isCharacterDataNode(this.startContainer))return a=this.startContainer.cloneNode(!0),a.data=a.data.slice(this.startOffset,this.endOffset),b=d(this).createDocumentFragment(),b.appendChild(a),b;var c=new o(this,!0);return a=i(c),c.detach(),a},canSurroundContents:function(){B(this),x(this.startContainer),x(this.endContainer);var a=new o(this,!0),b=a._first&&c(a._first,this)||a._last&&c(a._last,this);return a.detach(),!b},surroundContents:function(a){if(u(a,S),!this.canSurroundContents())throw new p("BAD_BOUNDARYPOINTS_ERR");var b=this.extractContents();if(a.hasChildNodes())for(;a.lastChild;)a.removeChild(a.lastChild);h(a,this.startContainer,this.startOffset),a.appendChild(b),this.selectNode(a)},cloneRange:function(){B(this);for(var a,b=new K(d(this)),c=_.length;c--;)a=_[c],b[a]=this[a];return b},toString:function(){B(this);var a=this.startContainer;if(a===this.endContainer&&L.isCharacterDataNode(a))return 3==a.nodeType||4==a.nodeType?a.data.slice(this.startOffset,this.endOffset):"";var b=[],c=new o(this,!0);return j(c,function(a){(3==a.nodeType||4==a.nodeType)&&b.push(a.data)}),c.detach(),b.join("")},compareNode:function(a){B(this);var b=a.parentNode,c=L.getNodeIndex(a);if(!b)throw new N("NOT_FOUND_ERR");var d=this.comparePoint(b,c),e=this.comparePoint(b,c+1);return 0>d?e>0?ga:ea:e>0?fa:ha},comparePoint:function(a,b){return B(this),y(a,"HIERARCHY_REQUEST_ERR"),w(a,this.startContainer),L.comparePoints(a,b,this.startContainer,this.startOffset)<0?-1:L.comparePoints(a,b,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:$,toHtml:function(){B(this);var a=d(this).createElement("div");return a.appendChild(this.cloneContents()),a.innerHTML},intersectsNode:function(a,b){if(B(this),y(a,"NOT_FOUND_ERR"),L.getDocument(a)!==d(this))return!1;var c=a.parentNode,e=L.getNodeIndex(a);y(c,"NOT_FOUND_ERR");var f=L.comparePoints(c,e,this.endContainer,this.endOffset),g=L.comparePoints(c,e+1,this.startContainer,this.startOffset);return b?0>=f&&g>=0:0>f&&g>0},isPointInRange:function(a,b){return B(this),y(a,"HIERARCHY_REQUEST_ERR"),w(a,this.startContainer),L.comparePoints(a,b,this.startContainer,this.startOffset)>=0&&L.comparePoints(a,b,this.endContainer,this.endOffset)<=0},intersectsRange:function(a,b){if(B(this),d(a)!=d(this))throw new N("WRONG_DOCUMENT_ERR");var c=L.comparePoints(this.startContainer,this.startOffset,a.endContainer,a.endOffset),e=L.comparePoints(this.endContainer,this.endOffset,a.startContainer,a.startOffset);return b?0>=c&&e>=0:0>c&&e>0},intersection:function(a){if(this.intersectsRange(a)){var b=L.comparePoints(this.startContainer,this.startOffset,a.startContainer,a.startOffset),c=L.comparePoints(this.endContainer,this.endOffset,a.endContainer,a.endOffset),d=this.cloneRange();return-1==b&&d.setStart(a.startContainer,a.startOffset),1==c&&d.setEnd(a.endContainer,a.endOffset),d}return null},union:function(a){if(this.intersectsRange(a,!0)){var b=this.cloneRange();return-1==L.comparePoints(a.startContainer,a.startOffset,this.startContainer,this.startOffset)&&b.setStart(a.startContainer,a.startOffset),1==L.comparePoints(a.endContainer,a.endOffset,this.endContainer,this.endOffset)&&b.setEnd(a.endContainer,a.endOffset),b}throw new p("Ranges do not intersect")},containsNode:function(a,b){return b?this.intersectsNode(a,!1):this.compareNode(a)==ha},containsNodeContents:function(a){return this.comparePoint(a,0)>=0&&this.comparePoint(a,L.getNodeLength(a))<=0},containsRange:function(a){return this.intersection(a).equals(a)},containsNodeText:function(a){var b=this.cloneRange();b.selectNode(a);var c=b.getNodes([3]);if(c.length>0){b.setStart(c[0],0);var d=c.pop();b.setEnd(d,d.length);var e=this.containsRange(b);return b.detach(),e}return this.containsNodeContents(a)},createNodeIterator:function(a,b){return B(this),new q(this,a,b)},getNodes:function(a,b){return B(this),m(this,a,b)},getDocument:function(){return d(this)},collapseBefore:function(a){t(this),this.setEndBefore(a),this.collapse(!1)},collapseAfter:function(a){t(this),this.setStartAfter(a),this.collapse(!0)},getName:function(){return"DomRange"},equals:function(a){return K.rangesEqual(this,a)},inspect:function(){return n(this)}},G(K,I,J),a.rangePrototype=C.prototype,K.rangeProperties=_,K.RangeIterator=o,K.copyComparisonConstants=E,K.createPrototypeRange=G,K.inspect=n,K.getRangeDocument=d,K.rangesEqual=function(a,b){return a.startContainer===b.startContainer&&a.startOffset===b.startOffset&&a.endContainer===b.endContainer&&a.endOffset===b.endOffset},a.DomRange=K,a.RangeException=p}),rangy.createModule("WrappedRange",function(a,b){function c(a){var b=a.parentElement(),c=a.duplicate();c.collapse(!0);var d=c.parentElement();c=a.duplicate(),c.collapse(!1);var e=c.parentElement(),f=d==e?d:h.getCommonAncestor(d,e);return f==b?f:h.getCommonAncestor(b,f)}function d(a){return 0==a.compareEndPoints("StartToEnd",a)}function e(a,b,c,d){var e=a.duplicate();e.collapse(c);var f=e.parentElement();if(h.isAncestorOf(b,f,!0)||(f=b),!f.canHaveHTML)return new i(f.parentNode,h.getNodeIndex(f));var g,j,k,l,m,n=h.getDocument(f).createElement("span"),o=c?"StartToStart":"StartToEnd";do f.insertBefore(n,n.previousSibling),e.moveToElementText(n);while((g=e.compareEndPoints(o,a))>0&&n.previousSibling);if(m=n.nextSibling,-1==g&&m&&h.isCharacterDataNode(m)){e.setEndPoint(c?"EndToStart":"EndToEnd",a);var p;if(/[\r\n]/.test(m.data)){var q=e.duplicate(),r=q.text.replace(/\r\n/g,"\r").length;for(p=q.moveStart("character",r);-1==(g=q.compareEndPoints("StartToEnd",q));)p++,q.moveStart("character",1)}else p=e.text.length;l=new i(m,p)}else j=(d||!c)&&n.previousSibling,k=(d||c)&&n.nextSibling,l=k&&h.isCharacterDataNode(k)?new i(k,0):j&&h.isCharacterDataNode(j)?new i(j,j.length):new i(f,h.getNodeIndex(n));return n.parentNode.removeChild(n),l}function f(a,b){var c,d,e,f,g=a.offset,i=h.getDocument(a.node),j=i.body.createTextRange(),k=h.isCharacterDataNode(a.node);return k?(c=a.node,d=c.parentNode):(f=a.node.childNodes,c=g<f.length?f[g]:null,d=a.node),e=i.createElement("span"),e.innerHTML="&#feff;",c?d.insertBefore(e,c):d.appendChild(e),j.moveToElementText(e),j.collapse(!b),d.removeChild(e),k&&j[b?"moveStart":"moveEnd"]("character",g),j}a.requireModules(["DomUtil","DomRange"]);var g,h=a.dom,i=h.DomPosition,j=a.DomRange;if(!a.features.implementsDomRange||a.features.implementsTextRange&&a.config.preferTextRange){if(a.features.implementsTextRange){g=function(a){this.textRange=a,this.refresh()},g.prototype=new j(document),g.prototype.refresh=function(){var a,b,f=c(this.textRange);d(this.textRange)?b=a=e(this.textRange,f,!0,!0):(a=e(this.textRange,f,!0,!1),b=e(this.textRange,f,!1,!1)),this.setStart(a.node,a.offset),this.setEnd(b.node,b.offset)},j.copyComparisonConstants(g);var k=function(){return this}();"undefined"==typeof k.Range&&(k.Range=g),a.createNativeRange=function(a){return a=a||document,a.body.createTextRange()}}}else!function(){function b(a){for(var b,c=k.length;c--;)b=k[c],a[b]=a.nativeRange[b]}function c(a,b,c,d,e){var f=a.startContainer!==b||a.startOffset!=c,g=a.endContainer!==d||a.endOffset!=e;(f||g)&&(a.setEnd(d,e),a.setStart(b,c))}function d(a){a.nativeRange.detach(),a.detached=!0;for(var b,c=k.length;c--;)b=k[c],a[b]=null}var e,f,i,k=j.rangeProperties;g=function(a){if(!a)throw new Error("Range must be specified");this.nativeRange=a,b(this)},j.createPrototypeRange(g,c,d),e=g.prototype,e.selectNode=function(a){this.nativeRange.selectNode(a),b(this)},e.deleteContents=function(){this.nativeRange.deleteContents(),b(this)},e.extractContents=function(){var a=this.nativeRange.extractContents();return b(this),a},e.cloneContents=function(){return this.nativeRange.cloneContents()},e.surroundContents=function(a){this.nativeRange.surroundContents(a),b(this)},e.collapse=function(a){this.nativeRange.collapse(a),b(this)},e.cloneRange=function(){return new g(this.nativeRange.cloneRange())},e.refresh=function(){b(this)},e.toString=function(){return this.nativeRange.toString()};var l=document.createTextNode("test");h.getBody(document).appendChild(l);var m=document.createRange();m.setStart(l,0),m.setEnd(l,0);try{m.setStart(l,1),f=!0,e.setStart=function(a,c){this.nativeRange.setStart(a,c),b(this)},e.setEnd=function(a,c){this.nativeRange.setEnd(a,c),b(this)},i=function(a){return function(c){this.nativeRange[a](c),b(this)}}}catch(n){f=!1,e.setStart=function(a,c){try{this.nativeRange.setStart(a,c)}catch(d){this.nativeRange.setEnd(a,c),this.nativeRange.setStart(a,c)}b(this)},e.setEnd=function(a,c){try{this.nativeRange.setEnd(a,c)}catch(d){this.nativeRange.setStart(a,c),this.nativeRange.setEnd(a,c)}b(this)},i=function(a,c){return function(d){try{this.nativeRange[a](d)}catch(e){this.nativeRange[c](d),this.nativeRange[a](d)}b(this)}}}e.setStartBefore=i("setStartBefore","setEndBefore"),e.setStartAfter=i("setStartAfter","setEndAfter"),e.setEndBefore=i("setEndBefore","setStartBefore"),e.setEndAfter=i("setEndAfter","setStartAfter"),m.selectNodeContents(l),m.startContainer==l&&m.endContainer==l&&0==m.startOffset&&m.endOffset==l.length?e.selectNodeContents=function(a){this.nativeRange.selectNodeContents(a),b(this)}:e.selectNodeContents=function(a){this.setStart(a,0),this.setEnd(a,j.getEndOffset(a))},m.selectNodeContents(l),m.setEnd(l,3);var o=document.createRange();o.selectNodeContents(l),o.setEnd(l,4),o.setStart(l,2),-1==m.compareBoundaryPoints(m.START_TO_END,o)&1==m.compareBoundaryPoints(m.END_TO_START,o)?e.compareBoundaryPoints=function(a,b){return b=b.nativeRange||b,a==b.START_TO_END?a=b.END_TO_START:a==b.END_TO_START&&(a=b.START_TO_END),this.nativeRange.compareBoundaryPoints(a,b)}:e.compareBoundaryPoints=function(a,b){return this.nativeRange.compareBoundaryPoints(a,b.nativeRange||b)},a.util.isHostMethod(m,"createContextualFragment")&&(e.createContextualFragment=function(a){return this.nativeRange.createContextualFragment(a)}),h.getBody(document).removeChild(l),m.detach(),o.detach()}(),a.createNativeRange=function(a){return a=a||document,a.createRange()};a.features.implementsTextRange&&(g.rangeToTextRange=function(a){if(a.collapsed){var b=f(new i(a.startContainer,a.startOffset),!0);return b}var c=f(new i(a.startContainer,a.startOffset),!0),d=f(new i(a.endContainer,a.endOffset),!1),e=h.getDocument(a.startContainer).body.createTextRange();return e.setEndPoint("StartToStart",c),e.setEndPoint("EndToEnd",d),e}),g.prototype.getName=function(){return"WrappedRange"},a.WrappedRange=g,a.createRange=function(b){return b=b||document,new g(a.createNativeRange(b))},a.createRangyRange=function(a){return a=a||document,new j(a)},a.createIframeRange=function(b){return a.createRange(h.getIframeDocument(b))},a.createIframeRangyRange=function(b){return a.createRangyRange(h.getIframeDocument(b))},a.addCreateMissingNativeApiListener(function(b){var c=b.document;"undefined"==typeof c.createRange&&(c.createRange=function(){return a.createRange(this)}),c=b=null})}),rangy.createModule("WrappedSelection",function(a,b){function c(a){return(a||window).getSelection()}function d(a){return(a||window).document.selection}function e(a,b,c){var d=c?"end":"start",e=c?"start":"end";a.anchorNode=b[d+"Container"],a.anchorOffset=b[d+"Offset"],a.focusNode=b[e+"Container"],a.focusOffset=b[e+"Offset"]}function f(a){var b=a.nativeSelection;a.anchorNode=b.anchorNode,a.anchorOffset=b.anchorOffset,a.focusNode=b.focusNode,a.focusOffset=b.focusOffset}function g(a){a.anchorNode=a.focusNode=null,a.anchorOffset=a.focusOffset=0,a.rangeCount=0,a.isCollapsed=!0,a._ranges.length=0}function h(b){var c;return b instanceof y?(c=b._selectionNativeRange,c||(c=a.createNativeRange(w.getDocument(b.startContainer)),c.setEnd(b.endContainer,b.endOffset),c.setStart(b.startContainer,b.startOffset),b._selectionNativeRange=c,b.attachListener("detach",function(){this._selectionNativeRange=null}))):b instanceof z?c=b.nativeRange:a.features.implementsDomRange&&b instanceof w.getWindow(b.startContainer).Range&&(c=b),c}function i(a){if(!a.length||1!=a[0].nodeType)return!1;for(var b=1,c=a.length;c>b;++b)if(!w.isAncestorOf(a[0],a[b]))return!1;return!0}function j(a){var b=a.getNodes();if(!i(b))throw new Error("getSingleElementFromRange: range "+a.inspect()+" did not consist of a single element");return b[0]}function k(a){return!!a&&"undefined"!=typeof a.text}function l(a,b){var c=new z(b);a._ranges=[c],e(a,c,!1),a.rangeCount=1,a.isCollapsed=c.collapsed}function m(b){if(b._ranges.length=0,"None"==b.docSelection.type)g(b);else{var c=b.docSelection.createRange();if(k(c))l(b,c);else{b.rangeCount=c.length;for(var d,f=w.getDocument(c.item(0)),h=0;h<b.rangeCount;++h)d=a.createRange(f),d.selectNode(c.item(h)),b._ranges.push(d);b.isCollapsed=1==b.rangeCount&&b._ranges[0].collapsed,e(b,b._ranges[b.rangeCount-1],!1)}}}function n(a,b){for(var c=a.docSelection.createRange(),d=j(b),e=w.getDocument(c.item(0)),f=w.getBody(e).createControlRange(),g=0,h=c.length;h>g;++g)f.add(c.item(g));try{f.add(d)}catch(i){throw new Error("addRange(): Element within the specified Range could not be added to control selection (does it have layout?)")}f.select(),m(a)}function o(a,b,c){this.nativeSelection=a,this.docSelection=b,this._ranges=[],this.win=c,this.refresh()}function p(a,b){for(var c,d=w.getDocument(b[0].startContainer),e=w.getBody(d).createControlRange(),f=0;f<rangeCount;++f){c=j(b[f]);try{e.add(c)}catch(g){throw new Error("setRanges(): Element within the one of the specified Ranges could not be added to control selection (does it have layout?)")}}e.select(),m(a)}function q(a,b){if(a.anchorNode&&w.getDocument(a.anchorNode)!==w.getDocument(b))throw new A("WRONG_DOCUMENT_ERR")}function r(a){var b=[],c=new B(a.anchorNode,a.anchorOffset),d=new B(a.focusNode,a.focusOffset),e="function"==typeof a.getName?a.getName():"Selection";if("undefined"!=typeof a.rangeCount)for(var f=0,g=a.rangeCount;g>f;++f)b[f]=y.inspect(a.getRangeAt(f));return"["+e+"(Ranges: "+b.join(", ")+")(anchor: "+c.inspect()+", focus: "+d.inspect()+"]"}a.requireModules(["DomUtil","DomRange","WrappedRange"]),a.config.checkSelectionRanges=!0;var s,t,u="boolean",v="_rangySelection",w=a.dom,x=a.util,y=a.DomRange,z=a.WrappedRange,A=a.DOMException,B=w.DomPosition,C="Control",D=a.util.isHostMethod(window,"getSelection"),E=a.util.isHostObject(document,"selection"),F=E&&(!D||a.config.preferTextRange);F?(s=d,a.isSelectionValid=function(a){var b=(a||window).document,c=b.selection;return"None"!=c.type||w.getDocument(c.createRange().parentElement())==b}):D?(s=c,a.isSelectionValid=function(){return!0}):b.fail("Neither document.selection or window.getSelection() detected."),a.getNativeSelection=s;var G=s(),H=a.createNativeRange(document),I=w.getBody(document),J=x.areHostObjects(G,["anchorNode","focusNode"]&&x.areHostProperties(G,["anchorOffset","focusOffset"]));a.features.selectionHasAnchorAndFocus=J;var K=x.isHostMethod(G,"extend");a.features.selectionHasExtend=K;var L="number"==typeof G.rangeCount;a.features.selectionHasRangeCount=L;var M=!1,N=!0;x.areHostMethods(G,["addRange","getRangeAt","removeAllRanges"])&&"number"==typeof G.rangeCount&&a.features.implementsDomRange&&!function(){var a=document.createElement("iframe");I.appendChild(a);var b=w.getIframeDocument(a);b.open(),b.write("<html><head></head><body>12</body></html>"),b.close();var c=w.getIframeWindow(a).getSelection(),d=b.documentElement,e=d.lastChild,f=e.firstChild,g=b.createRange();g.setStart(f,1),g.collapse(!0),c.addRange(g),N=1==c.rangeCount,c.removeAllRanges();var h=g.cloneRange();g.setStart(f,0),h.setEnd(f,2),c.addRange(g),c.addRange(h),M=2==c.rangeCount,g.detach(),h.detach(),I.removeChild(a)}(),a.features.selectionSupportsMultipleRanges=M,a.features.collapsedNonEditableSelectionsSupported=N;var O,P=!1;I&&x.isHostMethod(I,"createControlRange")&&(O=I.createControlRange(),x.areHostProperties(O,["item","add"])&&(P=!0)),a.features.implementsControlRange=P,t=J?function(a){return a.anchorNode===a.focusNode&&a.anchorOffset===a.focusOffset}:function(a){return a.rangeCount?a.getRangeAt(a.rangeCount-1).collapsed:!1};var Q;x.isHostMethod(G,"getRangeAt")?Q=function(a,b){try{return a.getRangeAt(b)}catch(c){return null}}:J&&(Q=function(b){var c=w.getDocument(b.anchorNode),d=a.createRange(c);return d.setStart(b.anchorNode,b.anchorOffset),d.setEnd(b.focusNode,b.focusOffset),d.collapsed!==this.isCollapsed&&(d.setStart(b.focusNode,b.focusOffset),d.setEnd(b.anchorNode,b.anchorOffset)),d}),a.getSelection=function(a){a=a||window;var b=a[v],c=s(a),e=E?d(a):null;return b?(b.nativeSelection=c,b.docSelection=e,b.refresh(a)):(b=new o(c,e,a),a[v]=b),b},a.getIframeSelection=function(b){return a.getSelection(w.getIframeWindow(b))};var R=o.prototype;if(!F&&J&&x.areHostMethods(G,["removeAllRanges","addRange"])){R.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),g(this)};var S=function(b,c){var d=y.getRangeDocument(c),e=a.createRange(d);e.collapseToPoint(c.endContainer,c.endOffset),b.nativeSelection.addRange(h(e)),b.nativeSelection.extend(c.startContainer,c.startOffset),b.refresh()};L?R.addRange=function(b,c){if(P&&E&&this.docSelection.type==C)n(this,b);else if(c&&K)S(this,b);else{var d;if(M?d=this.rangeCount:(this.removeAllRanges(),d=0),this.nativeSelection.addRange(h(b)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==d+1){if(a.config.checkSelectionRanges){var f=Q(this.nativeSelection,this.rangeCount-1);f&&!y.rangesEqual(f,b)&&(b=new z(f))}this._ranges[this.rangeCount-1]=b,e(this,b,V(this.nativeSelection)),this.isCollapsed=t(this)}else this.refresh()}}:R.addRange=function(a,b){b&&K?S(this,a):(this.nativeSelection.addRange(h(a)),this.refresh())},R.setRanges=function(a){if(P&&a.length>1)p(this,a);else{this.removeAllRanges();for(var b=0,c=a.length;c>b;++b)this.addRange(a[b])}}}else{if(!(x.isHostMethod(G,"empty")&&x.isHostMethod(H,"select")&&P&&F))return b.fail("No means of selecting a Range or TextRange was found"),!1;R.removeAllRanges=function(){try{if(this.docSelection.empty(),"None"!=this.docSelection.type){var a;if(this.anchorNode)a=w.getDocument(this.anchorNode);else if(this.docSelection.type==C){var b=this.docSelection.createRange();b.length&&(a=w.getDocument(b.item(0)).body.createTextRange())}if(a){var c=a.body.createTextRange();c.select(),this.docSelection.empty()}}}catch(d){}g(this)},R.addRange=function(a){this.docSelection.type==C?n(this,a):(z.rangeToTextRange(a).select(),this._ranges[0]=a,this.rangeCount=1,this.isCollapsed=this._ranges[0].collapsed,e(this,a,!1))},R.setRanges=function(a){this.removeAllRanges();var b=a.length;b>1?p(this,a):b&&this.addRange(a[0])}}R.getRangeAt=function(a){if(0>a||a>=this.rangeCount)throw new A("INDEX_SIZE_ERR");return this._ranges[a]};var T;if(F)T=function(b){var c;a.isSelectionValid(b.win)?c=b.docSelection.createRange():(c=w.getBody(b.win.document).createTextRange(),c.collapse(!0)),b.docSelection.type==C?m(b):k(c)?l(b,c):g(b)};else if(x.isHostMethod(G,"getRangeAt")&&"number"==typeof G.rangeCount)T=function(b){if(P&&E&&b.docSelection.type==C)m(b);else if(b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount,b.rangeCount){for(var c=0,d=b.rangeCount;d>c;++c)b._ranges[c]=new a.WrappedRange(b.nativeSelection.getRangeAt(c));e(b,b._ranges[b.rangeCount-1],V(b.nativeSelection)),b.isCollapsed=t(b)}else g(b)};else{if(!J||typeof G.isCollapsed!=u||typeof H.collapsed!=u||!a.features.implementsDomRange)return b.fail("No means of obtaining a Range or TextRange from the user's selection was found"),!1;T=function(a){var b,c=a.nativeSelection;c.anchorNode?(b=Q(c,0),a._ranges=[b],a.rangeCount=1,f(a),a.isCollapsed=t(a)):g(a)}}R.refresh=function(a){var b=a?this._ranges.slice(0):null;if(T(this),a){var c=b.length;if(c!=this._ranges.length)return!1;for(;c--;)if(!y.rangesEqual(b[c],this._ranges[c]))return!1;return!0}};var U=function(a,b){var c=a.getAllRanges(),d=!1;a.removeAllRanges();for(var e=0,f=c.length;f>e;++e)d||b!==c[e]?a.addRange(c[e]):d=!0;a.rangeCount||g(a)};P?R.removeRange=function(a){if(this.docSelection.type==C){for(var b,c=this.docSelection.createRange(),d=j(a),e=w.getDocument(c.item(0)),f=w.getBody(e).createControlRange(),g=!1,h=0,i=c.length;i>h;++h)b=c.item(h),b!==d||g?f.add(c.item(h)):g=!0;f.select(),m(this)}else U(this,a)}:R.removeRange=function(a){U(this,a)};var V;!F&&J&&a.features.implementsDomRange?(V=function(a){var b=!1;return a.anchorNode&&(b=1==w.comparePoints(a.anchorNode,a.anchorOffset,a.focusNode,a.focusOffset)),b},R.isBackwards=function(){return V(this)}):V=R.isBackwards=function(){return!1},R.toString=function(){for(var a=[],b=0,c=this.rangeCount;c>b;++b)a[b]=""+this._ranges[b];return a.join("")},R.collapse=function(b,c){q(this,b);var d=a.createRange(w.getDocument(b));d.collapseToPoint(b,c),this.removeAllRanges(),this.addRange(d),this.isCollapsed=!0},R.collapseToStart=function(){if(!this.rangeCount)throw new A("INVALID_STATE_ERR");var a=this._ranges[0];this.collapse(a.startContainer,a.startOffset)},R.collapseToEnd=function(){if(!this.rangeCount)throw new A("INVALID_STATE_ERR");var a=this._ranges[this.rangeCount-1];this.collapse(a.endContainer,a.endOffset)},R.selectAllChildren=function(b){q(this,b);var c=a.createRange(w.getDocument(b));c.selectNodeContents(b),this.removeAllRanges(),this.addRange(c)},R.deleteFromDocument=function(){if(P&&E&&this.docSelection.type==C){for(var a,b=this.docSelection.createRange();b.length;)a=b.item(0),b.remove(a),a.parentNode.removeChild(a);this.refresh()}else if(this.rangeCount){var c=this.getAllRanges();this.removeAllRanges();for(var d=0,e=c.length;e>d;++d)c[d].deleteContents();this.addRange(c[e-1])}},R.getAllRanges=function(){return this._ranges.slice(0)},R.setSingleRange=function(a){this.setRanges([a])},R.containsNode=function(a,b){for(var c=0,d=this._ranges.length;d>c;++c)if(this._ranges[c].containsNode(a,b))return!0;return!1},R.toHtml=function(){var a="";if(this.rangeCount){for(var b=y.getRangeDocument(this._ranges[0]).createElement("div"),c=0,d=this._ranges.length;d>c;++c)b.appendChild(this._ranges[c].cloneContents());a=b.innerHTML}return a},R.getName=function(){return"WrappedSelection"},R.inspect=function(){return r(this)},R.detach=function(){this.win[v]=null,this.win=this.anchorNode=this.focusNode=null},o.inspect=r,a.Selection=o,a.selectionPrototype=R,a.addCreateMissingNativeApiListener(function(b){"undefined"==typeof b.getSelection&&(b.getSelection=function(){return a.getSelection(this)}),b=null})}),rangy.createModule("SaveRestore",function(a,b){function c(a,b){return(b||document).getElementById(a)}function d(a,b){var c,d="selectionBoundary_"+ +new Date+"_"+(""+Math.random()).slice(2),e=k.getDocument(a.startContainer),f=a.cloneRange();return f.collapse(b),c=e.createElement("span"),c.id=d,c.style.lineHeight="0",c.style.display="none",c.className="rangySelectionBoundary",c.appendChild(e.createTextNode(l)),f.insertNode(c),f.detach(),c}function e(a,d,e,f){var g=c(e,a);g?(d[f?"setStartBefore":"setEndBefore"](g),g.parentNode.removeChild(g)):b.warn("Marker element has been removed. Cannot restore selection.")}function f(a,b){return b.compareBoundaryPoints(a.START_TO_START,a)}function g(e){e=e||window;var g=e.document;if(!a.isSelectionValid(e))return void b.warn("Cannot save selection. This usually happens when the selection is collapsed and the selection document has lost focus.");var h,i,j,k=a.getSelection(e),l=k.getAllRanges(),m=[];l.sort(f);for(var n=0,o=l.length;o>n;++n)j=l[n],j.collapsed?(i=d(j,!1),m.push({markerId:i.id,collapsed:!0})):(i=d(j,!1),h=d(j,!0),m[n]={startMarkerId:h.id,endMarkerId:i.id,collapsed:!1,backwards:1==l.length&&k.isBackwards()});for(n=o-1;n>=0;--n)j=l[n],j.collapsed?j.collapseBefore(c(m[n].markerId,g)):(j.setEndBefore(c(m[n].endMarkerId,g)),j.setStartAfter(c(m[n].startMarkerId,g)));
+return k.setRanges(l),{win:e,doc:g,rangeInfos:m,restored:!1}}function h(d,f){if(!d.restored){for(var g,h,i=d.rangeInfos,j=a.getSelection(d.win),k=[],l=i.length,m=l-1;m>=0;--m){if(g=i[m],h=a.createRange(d.doc),g.collapsed){var n=c(g.markerId,d.doc);if(n){n.style.display="inline";var o=n.previousSibling;o&&3==o.nodeType?(n.parentNode.removeChild(n),h.collapseToPoint(o,o.length)):(h.collapseBefore(n),n.parentNode.removeChild(n))}else b.warn("Marker element has been removed. Cannot restore selection.")}else e(d.doc,h,g.startMarkerId,!0),e(d.doc,h,g.endMarkerId,!1);1==l&&h.normalizeBoundaries(),k[m]=h}1==l&&f&&a.features.selectionHasExtend&&i[0].backwards?(j.removeAllRanges(),j.addRange(k[0],!0)):j.setRanges(k),d.restored=!0}}function i(a,b){var d=c(b,a);d&&d.parentNode.removeChild(d)}function j(a){for(var b,c=a.rangeInfos,d=0,e=c.length;e>d;++d)b=c[d],b.collapsed?i(a.doc,b.markerId):(i(a.doc,b.startMarkerId),i(a.doc,b.endMarkerId))}a.requireModules(["DomUtil","DomRange","WrappedRange"]);var k=a.dom,l="\ufeff";a.saveSelection=g,a.restoreSelection=h,a.removeMarkerElement=i,a.removeMarkers=j}),WYMeditor.SKINS.compact={init:function(a){jQuery(a._options.containersSelector+", "+a._options.classesSelector,a._box).appendTo(jQuery("div.wym_area_top",a._box)).addClass("wym_dropdown").css({"margin-right":"10px",width:"120px","float":"left"}),jQuery(a._options.toolsSelector,a._box).addClass("wym_buttons").css({"margin-right":"10px","float":"left"}),jQuery(".wym_section",a._box).hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")});var b=a._options.postInit;a._options.postInit=function(a){b&&b.call(a,a),a.$body().css("background-color","#f0f0f0")}}},WYMeditor.SKINS["default"]={init:function(a){jQuery(a._box).find(a._options.classesSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find(a._options.containersSelector).addClass("wym_dropdown").find(WYMeditor.H2).append("<span> ></span>"),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"155px"}),jQuery(a._box).find(".wym_section").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")})}},WYMeditor.SKINS.legacy={init:function(a){jQuery(a._box).find(a._options.classesSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find(a._options.containersSelector).addClass("wym_dropdown").find(WYMeditor.H2).append("<span> ></span>"),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"155px"}),jQuery(a._box).find(".wym_section").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")})}},jQuery.fn.selectify=function(){var a=this;return a.each(function(){var a=this;jQuery(a).hover(function(){var a=this;jQuery("h2",a).css("background-position","0px -18px"),jQuery("ul",a).fadeIn("fast")},function(){var a=this;jQuery("h2",a).css("background-position",""),jQuery("ul",a).fadeOut("fast")})})},WYMeditor.SKINS.minimal={init:function(a){jQuery(a._box).find(a._options.toolsSelector+", "+a._options.containersSelector+", "+a._options.classesSelector).addClass("wym_dropdown").selectify()}},function(a){var b=function(b,c){this.options=a.extend({},a.fn.wymAffix.defaults,c),this.$window=a(window),this.$window.bind("scroll.affix.data-api",a.proxy(this.checkPosition,this)),this.$window.bind("click.affix.data-api",a.proxy(function(){setTimeout(a.proxy(this.checkPosition,this),1)},this)),this.$element=a(b),this.checkPosition()};b.prototype.checkPosition=function(){var a,b=this.$window.scrollTop(),c=this.options.offset,d=c.bottom,e=c.top,f="affix affix-top affix-bottom",g=!0,h=!0;"object"!=typeof c&&(d=e=c),"function"==typeof e&&(e=c.top()),"function"==typeof d&&(d=c.bottom()),null!==e&&(g=b>e),null!==d&&(h=b+this.$element.height()<d),a=g&&h?"affix":h===!1?"affix-bottom":"affix-top",this.currentAffixType!==a&&(this.$element.removeClass(f).addClass(a),this.currentAffixType=a)},a.fn.wymAffix=function(c){var d=this;return d.each(function(){var d=this,e=a(d),f=e.data("affix"),g="object"==typeof c&&c;f||e.data("affix",f=new b(d,g)),"string"==typeof c&&f[c]()})},a.fn.wymAffix.Constructor=b,a.fn.wymAffix.defaults={offset:0}}(jQuery),WYMeditor.SKINS.seamless={OPTS:{iframeHtml:["",'<div class="wym_iframe wym_section">','<iframe src="'+WYMeditor.IFRAME_BASE_PATH+'wymiframe.html" ','frameborder="0" ','border="0" ','scrolling="no" ','marginheight="0px" ','marginwidth="0px" ',">","</iframe>","</div>"].join(""),initIframeCheckFrequency:50,imagesLoadedCheckFrequency:300,imagesLoadedCheckTimeout:5e3},init:function(a){var b=WYMeditor.SKINS.seamless;Date.now||(Date.now=function(){return(new Date).getTime()}),a.seamlessSkinOpts=jQuery.extend(b.OPTS,{initialIframeResizeTimer:null,resizeAfterImagesLoadTimer:null,_imagesLoadedCheckStartedTime:0,minimumHeight:jQuery(a.element).height()}),b.initUIChrome(a),jQuery(a.element).bind(WYMeditor.EVENTS.postIframeInitialization,b.postIframeInit)},postIframeInit:function(a,b){var c=WYMeditor.SKINS.seamless;c.resizeIframeOnceBodyExists(b),jQuery(b.element).bind(WYMeditor.EVENTS.postBlockMaybeCreated,function(){c.resizeAndScrollIfNeeded(b)})},initUIChrome:function(a){var b,c,d=WYMeditor.SKINS.seamless,e=jQuery([a._options.containersSelector,a._options.classesSelector].join(", "),a._box);c=jQuery("div.wym_area_top",a._box),e.appendTo(c),e.addClass("wym_dropdown"),jQuery(".wym_dropdown",a._box).click(function(){var a=this;jQuery(a).toggleClass("hover")}),b=jQuery(a._options.toolsSelector,a._box),b.addClass("wym_buttons"),d.affixTopControls(a)},affixTopControls:function(a){var b,c,d,e,f=5;b=jQuery("div.wym_area_top",a._box),c=jQuery('<div class="wym_skin_seamless wym_area_top_wrapper">'),b.wrap(c),c=b.parent(),c.wrap('<div class="wym_area_top_affix_placeholder">'),e=c.parent(),e.height(b.height()),d=function(){c.width(e.width())},d(),jQuery(window).resize(d),c.wymAffix({offset:{top:function(){return e.offset().top-f},bottom:function(){return e.offset().top+a.seamlessSkinIframeHeight}}})},resizeIframeOnceBodyExists:function(a){var b,c=WYMeditor.SKINS.seamless;return a.seamlessSkinOpts.initialIframeResizeTimer&&(window.clearTimeout(a.seamlessSkinOpts.initialIframeResizeTimer),a.seamlessSkinOpts.initialIframeResizeTimer=null),"undefined"==typeof a._doc.body||null===a._doc.body?void(a.seamlessSkinOpts.initialIframeResizeTimer=window.setTimeout(function(){c.resizeIframeOnceBodyExists(a)},a.seamlessSkinOpts.initIframeCheckFrequency)):(b=a._doc.body.scrollHeight,c.resizeIframe(a),void c.resizeIframeOnceImagesLoaded(a))},resizeIframeOnceImagesLoaded:function(a){var b,c,d,e=WYMeditor.SKINS.seamless,f=0,g=!0,h=a.seamlessSkinOpts;if(("undefined"==typeof h._imagesLoadedCheckStartedTime||0===h._imagesLoadedCheckStartedTime)&&(h._imagesLoadedCheckStartedTime=Date.now()),null!==h.resizeAfterImagesLoadTimer&&(window.clearTimeout(h.resizeAfterImagesLoadTimer),h.resizeAfterImagesLoadTimer=null),b=a.$body().find("img"),c=b.length,0!==c){for(f=0;c>f;f+=1)if(!e._imageIsLoaded(b[f])){g=!1;break}return e.resizeAndScrollIfNeeded(a),g===!0?void(h._imagesLoadedCheckStartedTime=0):(d=Date.now()-h._imagesLoadedCheckStartedTime,d>h.imagesLoadedCheckTimeout?void(h._imagesLoadedCheckStartedTime=0):void(h.resizeAfterImagesLoadTimer=window.setTimeout(function(){e.resizeIframeOnceImagesLoaded(a)},h.imagesLoadedCheckFrequency)))}},_imageIsLoaded:function(a){return a.complete!==!0?!1:"undefined"!=typeof a.naturalWidth&&0===a.naturalWidth?!1:!0},_getIframeHeightStrategy:function(a){var b,c,d,e,f;if(c=jQuery(a._doc).children().eq(0),b=a._doc.body.scrollHeight,d=c.height(),e=c[0].scrollHeight,WYMeditor.isInternetExplorerPre11())return f=function(a){var b=jQuery(a._doc).children().eq(0),c=b[0].scrollHeight;return c-10};if(d>=b)return f=function(a){var b=jQuery(a._doc).children().eq(0),c=b.height();return c};if(b>e)return f=function(a){return a._doc.body.scrollHeight};throw new Error("unsupported browser")},resizeIframe:function(a){var b,c=WYMeditor.SKINS.seamless,d=jQuery(a._iframe),e=d.height();return"undefined"==typeof WYMeditor.IFRAME_HEIGHT_GETTER&&(WYMeditor.IFRAME_HEIGHT_GETTER=c._getIframeHeightStrategy(a)),b=WYMeditor.IFRAME_HEIGHT_GETTER(a),b<a.seamlessSkinOpts.minimumHeight&&(b=a.seamlessSkinOpts.minimumHeight),e!==b?(d.height(b),a.seamlessSkinIframeHeight=b,!0):!1},scrollIfNeeded:function(a){var b,c,d,e,f=jQuery(a._iframe).offset(),g=f.top,h=jQuery(a.selectedContainer()),i=h.offset(),j=20,k=jQuery(window),l=jQuery(document.body);0!==h.length&&(c=g+i.top,c+=h.outerHeight(),b=k.scrollTop()+k.height(),e=c-b,e>0&&(d=l.scrollTop()+e+j,l.scrollTop(d)))},resizeAndScrollIfNeeded:function(a){var b=WYMeditor.SKINS.seamless,c=b.resizeIframe(a);c===!0&&b.scrollIfNeeded(a)}},jQuery.fn.selectify=function(){var a=this;return a.each(function(){var a=this;jQuery(a).hover(function(){var a=this;jQuery("h2",a).css("background-position","0px -18px"),jQuery("ul",a).fadeIn("fast")},function(){var a=this;jQuery("h2",a).css("background-position",""),jQuery("ul",a).fadeOut("fast")})})},WYMeditor.SKINS.silver={init:function(a){jQuery(a._box).append('<div class="clear"></div>').wrapInner('<div class="wym_inner"></div>'),jQuery(a._box).find(a._options.classesSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find(a._options.containersSelector).addClass("wym_dropdown").selectify(),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"155px"}),jQuery(a._box).find(".wym_section").hover(function(){var a=this;jQuery(a).addClass("hover")},function(){var a=this;jQuery(a).removeClass("hover")})}},WYMeditor.SKINS.twopanels={init:function(a){jQuery(a._box).find(a._options.containersSelector).appendTo("div.wym_area_left"),jQuery(a._box).find(a._options.classesSelector+", "+a._options.containersSelector).addClass("wym_panel"),jQuery(a._box).find(a._options.toolsSelector).addClass("wym_buttons"),jQuery(a._box).find("div.wym_area_right ul").parents("div.wym_area_right").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-right":"155px"}),jQuery(a._box).find("div.wym_area_left ul").parents("div.wym_area_left").show().parents(a._options.boxSelector).find("div.wym_area_main").css({"margin-left":"115px"}),jQuery(a._box).find(".wym_section").hover(function(){jQuery(this).addClass("hover")},function(){jQuery(this).removeClass("hover")})}}; \ No newline at end of file