!function(n,m,t,g){"use strict";var c={},o={};m.mce=m.mce||{},m.mce.views={register:function(e,t){c[e]=m.mce.View.extend(_.extend(t,{type:e}))},unregister:function(e){delete c[e]},get:function(e){return c[e]},unbind:function(){_.each(o,function(e){e.unbind()})},setMarkers:function(e){var a,t,r=[{content:e}],d=this;return _.each(c,function(s,o){t=r.slice(),r=[],_.each(t,function(e){var t,n,i=e.content;if(e.processed)r.push(e);else{for(;i&&(t=s.prototype.match(i));)t.index&&r.push({content:i.substring(0,t.index)}),n=(a=d.createInstance(o,t.content,t.options)).loader?".":a.text,r.push({content:a.ignore?n:'
'+n+"
",processed:!0}),i=i.slice(t.index+t.content.length);i&&r.push({content:i})}})}),(e=_.pluck(r,"content").join("")).replace(/\s*
")},createInstance:function(e,t,n,i){var s,e=this.get(e);return-1!==t.indexOf("[")&&-1!==t.indexOf("]")&&(t=t.replace(/\[[^\]]+\]/g,function(e){return e.replace(/[\r\n]/g,"")})),!i&&(s=this.getInstance(t))?s:(s=encodeURIComponent(t),n=_.extend(n||{},{text:t,encodedText:s}),o[s]=new e(n))},getInstance:function(e){return"string"==typeof e?o[encodeURIComponent(e)]:o[g(e).attr("data-wpview-text")]},getText:function(e){return decodeURIComponent(g(e).attr("data-wpview-text")||"")},render:function(t){_.each(o,function(e){e.render(null,t)})},update:function(e,t,n,i){var s=this.getInstance(n);s&&s.update(e,t,n,i)},edit:function(n,i){var s=this.getInstance(i);s&&s.edit&&s.edit(s.text,function(e,t){s.update(e,n,i,t)})},remove:function(e,t){var n=this.getInstance(t);n&&n.remove(e,t)}},m.mce.View=function(e){_.extend(this,e),this.initialize()},m.mce.View.extend=Backbone.View.extend,_.extend(m.mce.View.prototype,{content:null,loader:!0,initialize:function(){},getContent:function(){return this.content},render:function(e,t){null!=e&&(this.content=e),e=this.getContent(),(this.loader||e)&&(t&&this.unbind(),this.replaceMarkers(),e?this.setContent(e,function(e,t){g(t).data("rendered",!0),this.bindNode.call(this,e,t)},!!t&&null):this.setLoader())},bindNode:function(){},unbindNode:function(){},unbind:function(){this.getNodes(function(e,t){this.unbindNode.call(this,e,t)},!0)},getEditors:function(t){_.each(tinymce.editors,function(e){e.plugins.wpview&&t.call(this,e)},this)},getNodes:function(n,i){this.getEditors(function(e){var t=this;g(e.getBody()).find('[data-wpview-text="'+t.encodedText+'"]').filter(function(){var e;return null==i||(e=!0===g(this).data("rendered"),i?e:!e)}).each(function(){n.call(t,e,this,this)})})},getMarkers:function(n){this.getEditors(function(e){var t=this;g(e.getBody()).find('[data-wpview-marker="'+this.encodedText+'"]').each(function(){n.call(t,e,this)})})},replaceMarkers:function(){this.getMarkers(function(e,t){var n;this.loader||g(t).text()===tinymce.DOM.decode(this.text)?(n=e.$('
'),e.$(t).replaceWith(n)):e.dom.setAttrib(t,"data-wpview-marker",null)})},removeMarkers:function(){this.getMarkers(function(e,t){e.dom.setAttrib(t,"data-wpview-marker",null)})},setContent:function(n,i,e){_.isObject(n)&&-1!==n.body.indexOf("