From 249b4839b63ed86b0516da871b489c4714af8b26 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Thu, 4 Aug 2016 23:54:47 +0200 Subject: [PATCH] Fix type version --- dist/grapes.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/grapes.min.js b/dist/grapes.min.js index 411a8ad7b..08f35c3c8 100644 --- a/dist/grapes.min.js +++ b/dist/grapes.min.js @@ -1,4 +1,4 @@ -/*! grapesjs - v0.2.2 */ +/*! grapesjs - v0.3.0 */ !function(a,b){"function"==typeof define&&define.amd?define([],b):"object"==typeof exports&&"object"==typeof module?module.exports=mod():a.grapesjs=a.GrapesJS=b()}(this,function(){var a,b,c;return function(d){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,b){return function(){var c=v.call(arguments,0);return"string"!=typeof c[0]&&1===c.length&&c.push(null),n.apply(d,c.concat([a,b]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var b=r[a];delete r[a],t[a]=!0,m.apply(d,b)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,b,c,f){var h,k,l,m,n,s,u=[],v=typeof c;if(f=f||a,"undefined"===v||"function"===v){for(b=!b.length&&c.length?["require","exports","module"]:b,n=0;n
',attributes:{"class":"wte-fonts wte-f-b1"}},{id:"b2",label:"2 Blocks",content:'
',attributes:{"class":"wte-fonts wte-f-b2"}},{id:"b3",label:"3 Blocks",content:'
',attributes:{"class":"wte-fonts wte-f-b3"}},{id:"b4",label:"3/7 Block",content:'
',attributes:{"class":"wte-fonts wte-f-b37"}},{id:"hero",label:"Hero section",content:'
Build your templates without coding
Try it now
',attributes:{"class":"wte-fonts wte-f-hero"}},{id:"h1p",label:"Text section",content:'

Insert title here

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua

',attributes:{"class":"wte-fonts wte-f-h1p"}},{id:"3ba",label:"Badges",content:'
Adam Smith
CEO
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
ftln
John Black
Software Engineer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
ftln
Jessica White
Web Designer
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
ftln
',attributes:{"class":"wte-fonts wte-f-3ba"}},{id:"text",label:"Text",attributes:{"class":"wte-fonts wte-f-text"},content:{type:"text",content:"Insert your text here",style:{padding:"10px"},activeOnRender:1}},{id:"image",label:"Image",attributes:{"class":"wte-fonts wte-f-image"},content:{type:"image",activeOnRender:1}},{id:"quo",label:"Quote",content:'
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore ipsum dolor sit
',attributes:{"class":"wte-fonts wte-f-quo"}}]},defaultCommand:"select-comp",showDevices:1,el:""};return a}),function(){function a(a){function b(b,c,d,e,f,g){for(;f>=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=u(d,f,4);var g=!B(c)&&t.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function b(a){return function(b,c,d){c=v(c,d);for(var e=A(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function d(a,b,c){return function(d,e,f){var g=0,h=A(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(l.call(d,g,h),t.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function e(a,b){var c=G.length,d=a.constructor,e=t.isFunction(d)&&d.prototype||i,f="constructor";for(t.has(a,f)&&!t.contains(b,f)&&b.push(f);c--;)f=G[c],f in a&&a[f]!==e[f]&&!t.contains(b,f)&&b.push(f)}var f=this,g=f._,h=Array.prototype,i=Object.prototype,j=Function.prototype,k=h.push,l=h.slice,m=i.toString,n=i.hasOwnProperty,o=Array.isArray,p=Object.keys,q=j.bind,r=Object.create,s=function(){},t=function(a){return a instanceof t?a:this instanceof t?void(this._wrapped=a):new t(a)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports._=t):f._=t,t.VERSION="1.8.3";var u=function(a,b,c){if(void 0===b)return a;switch(null==c?3: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 function(){return a.apply(b,arguments)}},v=function(a,b,c){return null==a?t.identity:t.isFunction(a)?u(a,b,c):t.isObject(a)?t.matcher(a):t.property(a)};t.iteratee=function(a,b){return v(a,b,1/0)};var w=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},x=function(a){if(!t.isObject(a))return{};if(r)return r(a);s.prototype=a;var b=new s;return s.prototype=null,b},y=function(a){return function(b){return null==b?void 0:b[a]}},z=Math.pow(2,53)-1,A=y("length"),B=function(a){var b=A(a);return"number"==typeof b&&b>=0&&z>=b};t.each=t.forEach=function(a,b,c){b=u(b,c);var d,e;if(B(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=t.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},t.map=t.collect=function(a,b,c){b=v(b,c);for(var d=!B(a)&&t.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},t.reduce=t.foldl=t.inject=a(1),t.reduceRight=t.foldr=a(-1),t.find=t.detect=function(a,b,c){var d;return d=B(a)?t.findIndex(a,b,c):t.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},t.filter=t.select=function(a,b,c){var d=[];return b=v(b,c),t.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},t.reject=function(a,b,c){return t.filter(a,t.negate(v(b)),c)},t.every=t.all=function(a,b,c){b=v(b,c);for(var d=!B(a)&&t.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},t.some=t.any=function(a,b,c){b=v(b,c);for(var d=!B(a)&&t.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},t.contains=t.includes=t.include=function(a,b,c,d){return B(a)||(a=t.values(a)),("number"!=typeof c||d)&&(c=0),t.indexOf(a,b,c)>=0},t.invoke=function(a,b){var c=l.call(arguments,2),d=t.isFunction(b);return t.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},t.pluck=function(a,b){return t.map(a,t.property(b))},t.where=function(a,b){return t.filter(a,t.matcher(b))},t.findWhere=function(a,b){return t.find(a,t.matcher(b))},t.max=function(a,b,c){var d,e,f=-1/0,g=-1/0;if(null==b&&null!=a){a=B(a)?a:t.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=v(b,c),t.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-1/0&&f===-1/0)&&(f=a,g=e)});return f},t.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=B(a)?a:t.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=v(b,c),t.each(a,function(a,c,d){e=b(a,c,d),(g>e||1/0===e&&1/0===f)&&(f=a,g=e)});return f},t.shuffle=function(a){for(var b,c=B(a)?a:t.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=t.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},t.sample=function(a,b,c){return null==b||c?(B(a)||(a=t.values(a)),a[t.random(a.length-1)]):t.shuffle(a).slice(0,Math.max(0,b))},t.sortBy=function(a,b,c){return b=v(b,c),t.pluck(t.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).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}),"value")};var C=function(a){return function(b,c,d){var e={};return c=v(c,d),t.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};t.groupBy=C(function(a,b,c){t.has(a,c)?a[c].push(b):a[c]=[b]}),t.indexBy=C(function(a,b,c){a[c]=b}),t.countBy=C(function(a,b,c){t.has(a,c)?a[c]++:a[c]=1}),t.toArray=function(a){return a?t.isArray(a)?l.call(a):B(a)?t.map(a,t.identity):t.values(a):[]},t.size=function(a){return null==a?0:B(a)?a.length:t.keys(a).length},t.partition=function(a,b,c){b=v(b,c);var d=[],e=[];return t.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},t.first=t.head=t.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:t.initial(a,a.length-b)},t.initial=function(a,b,c){return l.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},t.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:t.rest(a,Math.max(0,a.length-b))},t.rest=t.tail=t.drop=function(a,b,c){return l.call(a,null==b||c?1:b)},t.compact=function(a){return t.filter(a,t.identity)};var D=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=A(a);h>g;g++){var i=a[g];if(B(i)&&(t.isArray(i)||t.isArguments(i))){b||(i=D(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};t.flatten=function(a,b){return D(a,b,!1)},t.without=function(a){return t.difference(a,l.call(arguments,1))},t.uniq=t.unique=function(a,b,c,d){t.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=v(c,d));for(var e=[],f=[],g=0,h=A(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?t.contains(f,j)||(f.push(j),e.push(i)):t.contains(e,i)||e.push(i)}return e},t.union=function(){return t.uniq(D(arguments,!0,!0))},t.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=A(a);e>d;d++){var f=a[d];if(!t.contains(b,f)){for(var g=1;c>g&&t.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},t.difference=function(a){var b=D(arguments,!0,!0,1);return t.filter(a,function(a){return!t.contains(b,a)})},t.zip=function(){return t.unzip(arguments)},t.unzip=function(a){for(var b=a&&t.max(a,A).length||0,c=Array(b),d=0;b>d;d++)c[d]=t.pluck(a,d);return c},t.object=function(a,b){for(var c={},d=0,e=A(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},t.findIndex=b(1),t.findLastIndex=b(-1),t.sortedIndex=function(a,b,c,d){c=v(c,d,1);for(var e=c(b),f=0,g=A(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var E=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=x(a.prototype),g=a.apply(f,e);return t.isObject(g)?g:f};t.bind=function(a,b){if(q&&a.bind===q)return q.apply(a,l.call(arguments,1));if(!t.isFunction(a))throw new TypeError("Bind must be called on a function");var c=l.call(arguments,2),d=function(){return E(a,d,b,this,c.concat(l.call(arguments)))};return d},t.partial=function(a){var b=l.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===t?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=t.bind(a[c],a);return a},t.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return t.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},t.delay=function(a,b){var c=l.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},t.defer=t.partial(t.delay,t,1),t.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:t.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=t.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},t.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=t.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=t.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},t.wrap=function(a,b){return t.partial(b,a)},t.negate=function(a){return function(){return!a.apply(this,arguments)}},t.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},t.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},t.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},t.once=t.partial(t.before,2);var F=!{toString:null}.propertyIsEnumerable("toString"),G=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];t.keys=function(a){if(!t.isObject(a))return[];if(p)return p(a);var b=[];for(var c in a)t.has(a,c)&&b.push(c);return F&&e(a,b),b},t.allKeys=function(a){if(!t.isObject(a))return[];var b=[];for(var c in a)b.push(c);return F&&e(a,b),b},t.values=function(a){for(var b=t.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},t.mapObject=function(a,b,c){b=v(b,c);for(var d,e=t.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},t.pairs=function(a){for(var b=t.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},t.invert=function(a){for(var b={},c=t.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},t.functions=t.methods=function(a){var b=[];for(var c in a)t.isFunction(a[c])&&b.push(c);return b.sort()},t.extend=w(t.allKeys),t.extendOwn=t.assign=w(t.keys),t.findKey=function(a,b,c){b=v(b,c);for(var d,e=t.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},t.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;t.isFunction(b)?(e=t.allKeys(g),d=u(b,c)):(e=D(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},t.omit=function(a,b,c){if(t.isFunction(b))b=t.negate(b);else{var d=t.map(D(arguments,!1,!1,1),String);b=function(a,b){return!t.contains(d,b)}}return t.pick(a,b,c)},t.defaults=w(t.allKeys,!0),t.create=function(a,b){var c=x(a);return b&&t.extendOwn(c,b),c},t.clone=function(a){return t.isObject(a)?t.isArray(a)?a.slice():t.extend({},a):a},t.tap=function(a,b){return b(a),a},t.isMatch=function(a,b){var c=t.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var H=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 t&&(a=a._wrapped),b instanceof t&&(b=b._wrapped);var e=m.call(a);if(e!==m.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+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}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(t.isFunction(g)&&g instanceof g&&t.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!H(a[i],b[i],c,d))return!1}else{var j,k=t.keys(a);if(i=k.length,t.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!t.has(b,j)||!H(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};t.isEqual=function(a,b){return H(a,b)},t.isEmpty=function(a){return null==a?!0:B(a)&&(t.isArray(a)||t.isString(a)||t.isArguments(a))?0===a.length:0===t.keys(a).length},t.isElement=function(a){return!(!a||1!==a.nodeType)},t.isArray=o||function(a){return"[object Array]"===m.call(a)},t.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},t.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){t["is"+a]=function(b){return m.call(b)==="[object "+a+"]"}}),t.isArguments(arguments)||(t.isArguments=function(a){return t.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(t.isFunction=function(a){return"function"==typeof a||!1}),t.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},t.isNaN=function(a){return t.isNumber(a)&&a!==+a},t.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===m.call(a)},t.isNull=function(a){return null===a},t.isUndefined=function(a){return void 0===a},t.has=function(a,b){return null!=a&&n.call(a,b)},t.noConflict=function(){return f._=g,this},t.identity=function(a){return a},t.constant=function(a){return function(){return a}},t.noop=function(){},t.property=y,t.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},t.matcher=t.matches=function(a){return a=t.extendOwn({},a),function(b){return t.isMatch(b,a)}},t.times=function(a,b,c){var d=Array(Math.max(0,a));b=u(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},t.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},t.now=Date.now||function(){return(new Date).getTime()};var I={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},J=t.invert(I),K=function(a){var b=function(b){return a[b]},c="(?:"+t.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};t.escape=K(I),t.unescape=K(J),t.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),t.isFunction(d)?d.call(a):d};var L=0;t.uniqueId=function(a){var b=++L+"";return a?a+b:b},t.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var M=/(.)^/,N={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,P=function(a){return"\\"+N[a]};t.template=function(a,b,c){!b&&c&&(b=c),b=t.defaults({},b,t.templateSettings);var d=RegExp([(b.escape||M).source,(b.interpolate||M).source,(b.evaluate||M).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(O,P),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,t)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},t.chain=function(a){var b=t(a);return b._chain=!0,b};var Q=function(a,b){return a._chain?t(b).chain():b};t.mixin=function(a){t.each(t.functions(a),function(b){var c=t[b]=a[b];t.prototype[b]=function(){var a=[this._wrapped];return k.apply(a,arguments),Q(this,c.apply(t,a))}})},t.mixin(t),t.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=h[a];t.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],Q(this,c)}}),t.each(["concat","join","slice"],function(a){var b=h[a];t.prototype[a]=function(){return Q(this,b.apply(this._wrapped,arguments))}}),t.prototype.value=function(){return this._wrapped},t.prototype.valueOf=t.prototype.toJSON=t.prototype.value,t.prototype.toString=function(){return""+this._wrapped},"function"==typeof c&&c.amd&&c("underscore",[],function(){return t})}.call(this),c("jquery",[],function(){return jQuery}),function(a){var d="object"==typeof self&&self.self==self&&self||"object"==typeof global&&global.global==global&&global;if("function"==typeof c&&c.amd)c("backbone",["underscore","jquery","exports"],function(b,c,e){d.Backbone=a(d,e,b,c)});else if("undefined"!=typeof exports){var e,f=b("underscore");try{e=b("jquery")}catch(g){}a(d,exports,f,e)}else d.Backbone=a(d,{},d._,d.jQuery||d.Zepto||d.ender||d.$)}(function(a,b,c,d){var e=a.Backbone,f=Array.prototype.slice;b.VERSION="1.2.3",b.$=d,b.noConflict=function(){return a.Backbone=e,this},b.emulateHTTP=!1,b.emulateJSON=!1;var g=function(a,b,d){switch(a){case 1:return function(){return c[b](this[d])};case 2:return function(a){return c[b](this[d],a)};case 3:return function(a,e){return c[b](this[d],i(a,this),e)};case 4:return function(a,e,f){return c[b](this[d],i(a,this),e,f)};default:return function(){var a=f.call(arguments);return a.unshift(this[d]),c[b].apply(c,a)}}},h=function(a,b,d){c.each(b,function(b,e){c[e]&&(a.prototype[e]=g(b,e,d))})},i=function(a,b){return c.isFunction(a)?a:c.isObject(a)&&!b._isModel(a)?j(a):c.isString(a)?function(b){return b.get(a)}:a},j=function(a){var b=c.matches(a);return function(a){return b(a.attributes)}},k=b.Events={},l=/\s+/,m=function(a,b,d,e,f){var g,h=0;if(d&&"object"==typeof d){void 0!==e&&"context"in f&&void 0===f.context&&(f.context=e);for(g=c.keys(d);hd;d++)c[d]=arguments[d+1];return m(r,this._events,a,void 0,c),this};var r=function(a,b,c,d){if(a){var e=a[b],f=a.all;e&&f&&(f=f.slice()),e&&s(e,d),f&&s(f,[b].concat(d))}return a},s=function(a,b){var c,d=-1,e=a.length,f=b[0],g=b[1],h=b[2];switch(b.length){case 0:for(;++df;f++)a[f+c]=b[f];for(f=0;fe&&(e+=this.length+1);for(var f,g=[],h=[],i=[],j={},k=b.add,l=b.merge,m=b.remove,n=!1,o=this.comparator&&null==e&&b.sort!==!1,p=c.isString(this.comparator)?this.comparator:null,q=0;qa&&(a+=this.length),this.models[a]},where:function(a,b){return this[b?"find":"filter"](a)},findWhere:function(a){return this.where(a,!0)},sort:function(a){var b=this.comparator;if(!b)throw new Error("Cannot sort a set without a comparator");a||(a={});var d=b.length;return c.isFunction(b)&&(b=c.bind(b,this)),1===d||c.isString(b)?this.models=this.sortBy(b):this.models.sort(b),a.silent||this.trigger("sort",this,a),this},pluck:function(a){return c.invoke(this.models,"get",a)},fetch:function(a){a=c.extend({parse:!0},a);var b=a.success,d=this;return a.success=function(c){var e=a.reset?"reset":"set";d[e](c,a),b&&b.call(a.context,d,c,a),d.trigger("sync",d,c,a)},P(this,a),this.sync("read",this,a)},create:function(a,b){b=b?c.clone(b):{};var d=b.wait;if(a=this._prepareModel(a,b),!a)return!1;d||this.add(a,b);var e=this,f=b.success;return b.success=function(a,b,c){d&&e.add(a,c),f&&f.call(c.context,a,b,c)},a.save(null,b),a},parse:function(a,b){return a},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(a){return a[this.model.prototype.idAttribute||"id"]},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(a,b){if(this._isModel(a))return a.collection||(a.collection=this),a;b=b?c.clone(b):{},b.collection=this;var d=new this.model(a,b);return d.validationError?(this.trigger("invalid",this,d.validationError,b),!1):d},_removeModels:function(a,b){for(var c=[],d=0;d7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(L,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var b=this.root.slice(0,-1)||"/";return this.location.replace(b+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var d=document.body,e=d.insertBefore(this.iframe,d.firstChild).contentWindow;e.document.open(),e.document.close(),e.location.hash="#"+this.fragment}var f=window.addEventListener||function(a,b){return attachEvent("on"+a,b)};return this._usePushState?f("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?f("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.options.silent?void 0:this.loadUrl()},stop:function(){var a=window.removeEventListener||function(a,b){return detachEvent("on"+a,b)};this._usePushState?a("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&a("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),J.started=!1},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(a){var b=this.getFragment();return b===this.fragment&&this.iframe&&(b=this.getHash(this.iframe.contentWindow)),b===this.fragment?!1:(this.iframe&&this.navigate(b),void this.loadUrl())},loadUrl:function(a){return this.matchRoot()?(a=this.fragment=this.getFragment(a),c.some(this.handlers,function(b){return b.route.test(a)?(b.callback(a),!0):void 0})):!1},navigate:function(a,b){if(!J.started)return!1;b&&b!==!0||(b={trigger:!!b}),a=this.getFragment(a||"");var c=this.root;(""===a||"?"===a.charAt(0))&&(c=c.slice(0,-1)||"/");var d=c+a;if(a=this.decodeFragment(a.replace(M,"")),this.fragment!==a){if(this.fragment=a,this._usePushState)this.history[b.replace?"replaceState":"pushState"]({},document.title,d);else{if(!this._wantsHashChange)return this.location.assign(d);if(this._updateHash(this.location,a,b.replace),this.iframe&&a!==this.getHash(this.iframe.contentWindow)){var e=this.iframe.contentWindow;b.replace||(e.document.open(),e.document.close()),this._updateHash(e.location,a,b.replace)}}return b.trigger?this.loadUrl(a):void 0}},_updateHash:function(a,b,c){if(c){var d=a.href.replace(/(javascript:|#).*$/,"");a.replace(d+"#"+b)}else a.hash="#"+b}}),b.history=new J;var N=function(a,b){var d,e=this;d=a&&c.has(a,"constructor")?a.constructor:function(){return e.apply(this,arguments)},c.extend(d,e,b);var f=function(){this.constructor=d};return f.prototype=e.prototype,d.prototype=new f,a&&c.extend(d.prototype,a),d.__super__=e.prototype,d};t.extend=v.extend=E.extend=A.extend=J.extend=N;var O=function(){throw new Error('A "url" property or function must be specified')},P=function(a,b){var c=b.error;b.error=function(d){c&&c.call(b.context,a,d,b),a.trigger("error",a,d,b)}};return b}),function(a){"function"==typeof c&&c.amd?c("backboneUndo",["underscore","backbone"],a):"undefined"!=typeof exports?module.exports=a(b("underscore"),b("backbone")):a(_,Backbone)}(function(a,b){function c(a,b,c){return c.length<=4?a.call(b,c[0],c[1],c[2],c[3]):a.apply(b,c)}function d(a,b){return n.call(a,b)}function e(b,c){return null==b?!1:(a.isArray(c)||(c=d(arguments,1)),a.all(c,function(a){return a in b}))}function f(){this.registeredObjects=[],this.cidIndexes=[]}function g(b,c,d,e){for(var f,g=0,h=c.length;h>g;g++)if(f=c[g]){if("on"===b){if(!e.objectRegistry.register(f))continue}else if(!e.objectRegistry.unregister(f))continue;a.isFunction(f[b])&&f[b]("all",d,e)}}function h(b,c){var d=c.type,e=c.undoTypes,f=!e[d]||e[d][b];a.isFunction(f)&&f(c.object,c.before,c.after,c.options)}function i(b,c,d,e,f){if(!(d.isCurrentlyUndoRedoing||"undo"===b&&-1===d.pointer||"redo"===b&&d.pointer===d.length-1)){d.isCurrentlyUndoRedoing=!0;var g,h,i="undo"===b;for(f?h=i&&d.pointer===d.length-1||!i&&-1===d.pointer?a.clone(d.models):n.apply(d.models,i?[0,d.pointer]:[d.pointer,d.length-1]):(g=d.at(i?d.pointer:d.pointer+1),h=e?d.where({magicFusionIndex:g.get("magicFusionIndex")}):[g]),d.pointer+=(i?-1:1)*h.length;g=i?h.pop():h.shift();)g[b]();d.isCurrentlyUndoRedoing=!1,c.trigger(b,c)}}function j(a,b){var d=a.condition,e=typeof d;return"function"===e?!!c(d,a,b):"boolean"===e?d:!0}function k(a,b,d,f){if(a.track&&!a.isCurrentlyUndoRedoing&&b in f&&j(f[b],d)){var g,h=c(f[b].on,f[b],d);if(e(h,"object","before","after")){if(h.type=b,h.magicFusionIndex=o(),h.undoTypes=f,a.pointera.maximumStackLength&&(a.shift(),a.pointer--)}}}function l(){}function m(b,c,d,f){if("object"==typeof c)return a.each(c,function(a,c){2===b?m(b,a,d,f):m(b,c,a,d)});switch(b){case 0:e(d,"undo","redo","on")&&a.all(a.pick(d,"undo","redo","on"),a.isFunction)&&(f[c]=d);break;case 1:f[c]&&a.isObject(d)&&(f[c]=a.extend({},f[c],d));break;case 2:delete f[c]}return this}var n=Array.prototype.slice,o=function(){function b(){d++,c=!0,a.defer(function(){c=!1})}var c=!1,d=-1;return function(){return c||b(),d}}();f.prototype={isRegistered:function(b){return b&&b.cid?this.registeredObjects[b.cid]:a.contains(this.registeredObjects,b)},register:function(a){return this.isRegistered(a)?!1:(a&&a.cid?(this.registeredObjects[a.cid]=a,this.cidIndexes.push(a.cid)):this.registeredObjects.push(a),!0)},unregister:function(b){if(this.isRegistered(b)){if(b&&b.cid)delete this.registeredObjects[b.cid],this.cidIndexes.splice(a.indexOf(this.cidIndexes,b.cid),1);else{var c=a.indexOf(this.registeredObjects,b);this.registeredObjects.splice(c,1)}return!0}return!1},get:function(){return a.map(this.cidIndexes,function(a){return this.registeredObjects[a]},this).concat(this.registeredObjects)}};var p={add:{undo:function(a,b,c,d){a.remove(c,d)},redo:function(a,b,c,d){d.index&&(d.at=d.index),a.add(c,d)},on:function(b,c,d){return{object:c,before:void 0,after:b,options:a.clone(d)}}},remove:{undo:function(a,b,c,d){"index"in d&&(d.at=d.index),a.add(b,d)},redo:function(a,b,c,d){a.remove(b,d)},on:function(b,c,d){return{object:c,before:b,after:void 0,options:a.clone(d)}}},change:{undo:function(b,c,d,e){a.isEmpty(c)?a.each(a.keys(d),b.unset,b):(b.set(c),e&&e.unsetData&&e.unsetData.before&&e.unsetData.before.length&&a.each(e.unsetData.before,b.unset,b))},redo:function(b,c,d,e){a.isEmpty(d)?a.each(a.keys(c),b.unset,b):(b.set(d),e&&e.unsetData&&e.unsetData.after&&e.unsetData.after.length&&a.each(e.unsetData.after,b.unset,b))},on:function(b,c){var d=b.changedAttributes(),e=a.keys(d),f=a.pick(b.previousAttributes(),e),g=a.keys(f),h=(c||(c={})).unsetData={after:[],before:[]};return e.length!=g.length&&(e.length>g.length?a.each(e,function(a){a in f||h.before.push(a)},this):a.each(g,function(a){a in d||h.after.push(a)})),{object:b,before:f,after:d,options:a.clone(c)}}},reset:{undo:function(a,b,c){a.reset(b)},redo:function(a,b,c){a.reset(c)},on:function(b,c){return{object:b,before:c.previousModels,after:a.clone(b.models)}}}};l.prototype=p;var q=b.Model.extend({defaults:{type:null,object:null,before:null,after:null,magicFusionIndex:null},undo:function(a){h("undo",this.attributes)},redo:function(a){h("redo",this.attributes)}}),r=b.Collection.extend({model:q,pointer:-1,track:!1,isCurrentlyUndoRedoing:!1,maximumStackLength:1/0,setMaxLength:function(a){this.maximumStackLength=a}}),s=b.Model.extend({defaults:{maximumStackLength:1/0,track:!1},initialize:function(b){this.stack=new r,this.objectRegistry=new f,this.undoTypes=new l,this.stack.setMaxLength(this.get("maximumStackLength")),this.on("change:maximumStackLength",function(a,b){this.stack.setMaxLength(b)},this),b&&b.track&&this.startTracking(),b&&b.register&&(a.isArray(b.register)||a.isArguments(b.register)?c(this.register,this,b.register):this.register(b.register))},startTracking:function(){this.set("track",!0),this.stack.track=!0},stopTracking:function(){this.set("track",!1),this.stack.track=!1},isTracking:function(){return this.get("track")},_addToStack:function(a){k(this.stack,a,d(arguments,1),this.undoTypes)},register:function(){g("on",arguments,this._addToStack,this)},unregister:function(){g("off",arguments,this._addToStack,this)},unregisterAll:function(){c(this.unregister,this,this.objectRegistry.get())},undo:function(a){i("undo",this,this.stack,a)},undoAll:function(){i("undo",this,this.stack,!1,!0)},redo:function(a){i("redo",this,this.stack,a)},redoAll:function(){i("redo",this,this.stack,!1,!0)},isAvailable:function(a){var b=this.stack,c=b.length;switch(a){case"undo":return c>0&&b.pointer>-1;case"redo":return c>0&&b.pointer0;for(f in v)(!v[f]&&b(e.mods,+f)>-1||v[f]&&-1==b(e.mods,+f))&&(i=!1);(0!=e.mods.length||v[16]||v[18]||v[17]||v[91])&&!i||e.method(a,e)===!1&&(a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation&&a.stopPropagation(),a.cancelBubble&&(a.cancelBubble=!0))}}function f(a){var c,d=a.keyCode,e=b(A,d);if(e>=0&&A.splice(e,1),(93==d||224==d)&&(d=91),d in v){v[d]=!1;for(c in x)x[c]==d&&(h[c]=!1)}}function g(){for(t in v)v[t]=!1;for(t in x)h[t]=!1}function h(a,b,c){var d,e;d=p(a),void 0===c&&(c=b,b="all");for(var f=0;f1&&(e=q(a),a=[a[a.length-1]]),a=a[0],a=z(a),a in u||(u[a]=[]),u[a].push({shortcut:d[f],scope:b,method:c,key:d[f],mods:e})}function i(a,b){var d,e,f,g,h,i=[];for(d=p(a),g=0;g1&&(i=q(e)),a=e[e.length-1],a=z(a),void 0===b&&(b=n()),!u[a])return;for(f=0;ft;t++)y["f"+t]=111+t;var B={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};for(t in x)h[t]=!1;r(document,"keydown",function(a){e(a)}),r(document,"keyup",f),r(window,"focus",g);var C=a.key;a.key=h,a.key.setScope=m,a.key.getScope=n,a.key.deleteScope=o,a.key.filter=l,a.key.isPressed=j,a.key.getPressedKeyCodes=k,a.key.noConflict=s,a.key.unbind=i,"undefined"!=typeof module&&(module.exports=h)}(this),c("keymaster",function(a){return function(){var b;return b||a.keymaster}}(this)),c("AssetManager/config/config",[],function(){return{autoload:1,stylePrefix:"am-",assets:[],storageType:"local",storageName:"assets",urlStore:"http://localhost/assets/store",urlLoad:"http://localhost/assets/load",paramsStore:{},paramsLoad:{},beforeSend:function(a,b){},onComplete:function(a,b){},urlUpload:"http://localhost/assets/upload",uploadText:"Drop files here or click to upload",disableUpload:!1,storeOnChange:!0,storeAfterUpload:!1}}),c("AssetManager/model/Asset",["backbone"],function(a){return a.Model.extend({defaults:{type:"none",src:""},initialize:function(a){this.options=a||{}},getFilename:function(){return this.get("src").split("/").pop()},getExtension:function(){return this.getFilename().split(".").pop()}})}),c("AssetManager/model/Assets",["backbone","./Asset"],function(a,b){return a.Collection.extend({model:b,addImg:function(a,b){return this.add({type:"image",src:a},b),this},add:function(b,c){var d=[];b=b instanceof Array?b:[b];for(var e=0,f=b.length;f>e;e++){var g=b[e];if(g&&g.src){var h=this.where({src:g.src});h.length||d.push(g)}}return 1==d.length&&(d=d[0]),a.Collection.prototype.add.apply(this,[d,c])}})}),c("AssetManager/view/AssetView",["backbone"],function(a){return a.View.extend({initialize:function(a){this.options=a,this.config=a.config||{},this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.className=this.pfx+"asset",this.listenTo(this.model,"destroy remove",this.remove)}})}),c("text",["module"],function(a){"use strict";var c,d,e,f,g,h=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],i=/^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,j=/]*>\s*([\s\S]+)\s*<\/body>/im,k="undefined"!=typeof location&&location.href,l=k&&location.protocol&&location.protocol.replace(/\:/,""),m=k&&location.hostname,n=k&&(location.port||void 0),o={},p=a.config&&a.config()||{};return c={version:"2.0.14",strip:function(a){if(a){a=a.replace(i,"");var b=a.match(j);b&&(a=b[1])}else a="";return a},jsEscape:function(a){return a.replace(/(['\\])/g,"\\$1").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r").replace(/[\u2028]/g,"\\u2028").replace(/[\u2029]/g,"\\u2029")},createXhr:p.createXhr||function(){var a,b,c;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"!=typeof ActiveXObject)for(b=0;3>b;b+=1){c=h[b];try{a=new ActiveXObject(c)}catch(d){}if(a){h=[c];break}}return a},parseName:function(a){var b,c,d,e=!1,f=a.lastIndexOf("."),g=0===a.indexOf("./")||0===a.indexOf("../");return-1!==f&&(!g||f>1)?(b=a.substring(0,f),c=a.substring(f+1)):b=a,d=c||b,f=d.indexOf("!"),-1!==f&&(e="strip"===d.substring(f+1),d=d.substring(0,f),c?c=d:b=d),{moduleName:b,ext:c,strip:e}},xdRegExp:/^((\w+)\:)?\/\/([^\/\\]+)/,useXhr:function(a,b,d,e){var f,g,h,i=c.xdRegExp.exec(a);return i?(f=i[2],g=i[3],g=g.split(":"),h=g[1],g=g[0],!(f&&f!==b||g&&g.toLowerCase()!==d.toLowerCase()||(h||g)&&h!==e)):!0},finishLoad:function(a,b,d,e){d=b?c.strip(d):d,p.isBuild&&(o[a]=d),e(d)},load:function(a,b,d,e){if(e&&e.isBuild&&!e.inlineText)return void d();p.isBuild=e&&e.isBuild;var f=c.parseName(a),g=f.moduleName+(f.ext?"."+f.ext:""),h=b.toUrl(g),i=p.useXhr||c.useXhr;return 0===h.indexOf("empty:")?void d():void(!k||i(h,l,m,n)?c.get(h,function(b){c.finishLoad(a,f.strip,b,d)},function(a){d.error&&d.error(a)}):b([g],function(a){c.finishLoad(f.moduleName+"."+f.ext,f.strip,a,d)}))},write:function(a,b,d,e){if(o.hasOwnProperty(b)){var f=c.jsEscape(o[b]);d.asModule(a+"!"+b,"define(function () { return '"+f+"';});\n")}},writeFile:function(a,b,d,e,f){var g=c.parseName(b),h=g.ext?"."+g.ext:"",i=g.moduleName+h,j=d.toUrl(g.moduleName+h)+".js";c.load(i,d,function(b){var d=function(a){return e(j,a)};d.asModule=function(a,b){return e.asModule(a,j,b)},c.write(a,i,d,f)},f)}},"node"===p.env||!p.env&&"undefined"!=typeof process&&process.versions&&process.versions.node&&!process.versions["node-webkit"]&&!process.versions["atom-shell"]?(d=b.nodeRequire("fs"),c.get=function(a,b,c){try{var e=d.readFileSync(a,"utf8");"\ufeff"===e[0]&&(e=e.substring(1)),b(e)}catch(f){c&&c(f)}}):"xhr"===p.env||!p.env&&c.createXhr()?c.get=function(a,b,d,e){var f,g=c.createXhr();if(g.open("GET",a,!0),e)for(f in e)e.hasOwnProperty(f)&&g.setRequestHeader(f.toLowerCase(),e[f]);p.onXhr&&p.onXhr(g,a),g.onreadystatechange=function(c){var e,f;4===g.readyState&&(e=g.status||0,e>399&&600>e?(f=new Error(a+" HTTP status: "+e),f.xhr=g,d&&d(f)):b(g.responseText),p.onXhrComplete&&p.onXhrComplete(g,a))},g.send(null)}:"rhino"===p.env||!p.env&&"undefined"!=typeof Packages&&"undefined"!=typeof java?c.get=function(a,b){var c,d,e="utf-8",f=new java.io.File(a),g=java.lang.System.getProperty("line.separator"),h=new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(f),e)),i="";try{for(c=new java.lang.StringBuffer,d=h.readLine(),d&&d.length()&&65279===d.charAt(0)&&(d=d.substring(1)),null!==d&&c.append(d);null!==(d=h.readLine());)c.append(g),c.append(d);i=String(c.toString())}finally{h.close()}b(i)}:("xpconnect"===p.env||!p.env&&"undefined"!=typeof Components&&Components.classes&&Components.interfaces)&&(e=Components.classes,f=Components.interfaces,Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),g="@mozilla.org/windows-registry-key;1"in e,c.get=function(a,b){var c,d,h,i={};g&&(a=a.replace(/\//g,"\\")),h=new FileUtils.File(a);try{c=e["@mozilla.org/network/file-input-stream;1"].createInstance(f.nsIFileInputStream),c.init(h,1,0,!1),d=e["@mozilla.org/intl/converter-input-stream;1"].createInstance(f.nsIConverterInputStream),d.init(c,"utf-8",c.available(),f.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),d.readString(c.available(),i),d.close(),c.close(),b(i.value)}catch(j){throw new Error((h&&h.path||"")+": "+j)}}),c}),c("text!AssetManager/template/assetImage.html",[],function(){return'
\n
\n
\n
\n
\n
<%= name %>
\n
<%= dim %>
\n
\n
\n
'}),c("AssetManager/view/AssetImageView",["./AssetView","text!./../template/assetImage.html"],function(a,b){return a.extend({events:{click:"selected",dblclick:"chosen"},template:_.template(b),initialize:function(b){a.prototype.initialize.apply(this,arguments),this.className+=" "+this.pfx+"asset-image",this.events["click #"+this.pfx+"close"]="removeItem",this.delegateEvents()},selected:function(){this.model.collection.trigger("deselectAll"),this.$el.addClass(this.pfx+"highlight"),this.updateTarget(this.model.get("src"))},chosen:function(){this.updateTarget(this.model.get("src"));var a=this.model.collection.onSelect;a&&"function"==typeof a&&a(this.model)},updateTarget:function(a){var b=this.model.collection.target;if(b&&b.set){var c=_.clone(b.get("attributes"));b.set("attributes",c),b.set("src",a)}},removeItem:function(a){a.stopPropagation(),this.model.collection.remove(this.model)},render:function(){var a=this.model.get("name"),b=this.model.get("width")&&this.model.get("height")?this.model.get("width")+" x "+this.model.get("height"):""; return a=a?a:this.model.get("src").split("/").pop(),a=a&&a.length>30?a.substring(0,30)+"...":a,b=b?b+(this.model.get("unitDim")?this.model.get("unitDim"):" px"):"",this.$el.html(this.template({name:a,src:this.model.get("src"),dim:b,pfx:this.pfx,ppfx:this.ppfx})),this.$el.attr("class",this.className),this}})}),c("text!AssetManager/template/fileUploader.html",[],function(){return'
\n
<%= title %>
\n multiple/>\n
\n
'}),c("AssetManager/view/FileUploader",["backbone","text!./../template/fileUploader.html"],function(a,b){return a.View.extend({template:_.template(b),events:{},initialize:function(a){this.options=a||{},this.config=a.config||{},this.pfx=this.config.stylePrefix||"",this.target=this.collection||{},this.uploadId=this.pfx+"uploadFile",this.disabled=this.config.disableUpload,this.events["change #"+this.uploadId]="uploadFile",this.delegateEvents()},uploadFile:function(a){for(var b=a.dataTransfer?a.dataTransfer.files:a.target.files,c=new FormData,d=0;d\n
\n
\n \n \n
\n
\n \n
\n
\n
\n'}),c("AssetManager/view/AssetsView",["backbone","./AssetView","./AssetImageView","./FileUploader","text!./../template/assets.html"],function(a,b,c,d,e){return a.View.extend({template:_.template(e),initialize:function(a){if(this.options=a,this.config=a.config,this.pfx=this.config.stylePrefix||"",this.ppfx=this.config.pStylePrefix||"",this.listenTo(this.collection,"add",this.addToAsset),this.listenTo(this.collection,"deselectAll",this.deselectAll),this.className=this.pfx+"assets",this.config.stm&&""!==this.config.storageType){var b=this.config.storageType;if(this.provider=this.config.stm.get(b),this.storeName=this.config.storageName?this.config.storageName:this.className,this.provider&&(this.storagePrv=this.provider.clone().set(this.config),this.collection.reset(),this.collection.add(this.load()),this.config.storeOnChange)){var c="remove"+(this.config.storeAfterUpload?" add":"");this.listenTo(this.collection,c,this.store)}}this.events={},this.events.submit="addFromStr",this.delegateEvents()},addFromStr:function(a){a.preventDefault();var b=this.getInputUrl(),c=b.value.trim();return c?(this.collection.addImg(c,{at:0}),this.getAssetsEl().scrollTop=0,b.value="",this):void 0},getAssetsEl:function(){return this.assets=this.el.querySelector("."+this.pfx+"assets"),this.assets},getInputUrl:function(){return this.inputUrl&&this.inputUrl.value||(this.inputUrl=this.el.querySelector("."+this.pfx+"add-asset input")),this.inputUrl},store:function(){this.storagePrv&&this.storagePrv.store(this.storeName,JSON.stringify(this.collection.toJSON()))},load:function(){var a=null;if(this.storagePrv&&(a=this.storagePrv.load(this.storeName)),"object"!=typeof a)try{a=JSON.parse(a)}catch(b){console.warn(b)}return a},addToAsset:function(a){this.addAsset(a)},addAsset:function(a,d){var e=d||null,f=b;a.get("type").indexOf("image")>-1&&(f=c);var g=new f({model:a,config:this.config}),h=g.render().el;if(e)e.appendChild(h);else{var i=this.getAssetsEl();i.insertBefore(h,i.firstChild)}return h},deselectAll:function(){this.$el.find("."+this.pfx+"highlight").removeClass(this.pfx+"highlight")},render:function(){var a=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(b){this.addAsset(b,a)},this),this.$el.html(this.template({pfx:this.pfx,ppfx:this.ppfx})),this.$el.find("."+this.pfx+"assets").append(a),this}})}),c("AssetManager/main",["require","./config/config","./model/Assets","./view/AssetsView","./view/FileUploader"],function(a){var b=function(b){var c=b||{},d=a("./config/config"),e=a("./model/Assets"),f=a("./view/AssetsView"),g=a("./view/FileUploader");for(var h in d)h in c||(c[h]=d[h]);this.assets=new e(c.assets);var i={collection:this.assets,config:c};this.am=new f(i),this.fu=new g(i)};return b.prototype={add:function(a){return this},get:function(a){return{}},getAll:function(){return assets},remove:function(a){return this},store:function(){},load:function(){},getAssets:function(){return this.assets},setTarget:function(a){this.am.collection.target=a},onSelect:function(a){this.am.collection.onSelect=a},render:function(a){return(!this.rendered||a)&&(this.rendered=this.am.render().$el.add(this.fu.render().$el)),this.rendered}},b}),c("AssetManager",["AssetManager/main"],function(a){return a}),c("BlockManager/config/config",[],function(){return{blocks:[]}}),c("BlockManager/model/Block",["backbone"],function(a){return a.Model.extend({defaults:{label:"",content:"",attributes:{}}})}),c("BlockManager/model/Blocks",["backbone","./Block"],function(a,b){return a.Collection.extend({model:b})}),c("BlockManager/view/BlockView",["backbone"],function(a){return a.View.extend({events:{mousedown:"onDrag"},initialize:function(a,b){_.bindAll(this,"onDrop"),this.config=b||{},this.ppfx=this.config.pStylePrefix||"",this.listenTo(this.model,"destroy",this.remove),this.doc=$(document)},onDrag:function(){if(this.config.getSorter){var a=this.config.getSorter();a.startSort(this.el),a.setDropContent(this.model.get("content")),this.doc.on("mouseup",this.onDrop)}},onDrop:function(){this.doc.off("mouseup",this.onDrop),this.config.getSorter().endMove()},render:function(){return this.el.innerHTML=this.model.get("label"),this.$el.addClass(this.ppfx+"block"),this}})}),c("BlockManager/view/BlocksView",["backbone","./BlockView"],function(a,b){return a.View.extend({initialize:function(a,b){_.bindAll(this,"getSorter","onDrag","onDrop","dragHelper","moveHelper"),this.config=b||{},this.ppfx=this.config.pStylePrefix||"",this.listenTo(this.collection,"add",this.addTo),this.em=this.config.em,this.tac="test-tac",this.em&&(this.config.getSorter=this.getSorter,this.config.dragHelper=this.dragHelper,this.canvas=this.em.get("Canvas"))},getSorter:function(){if(this.em){if(!this.sorter){var a=this.em.get("Utils"),b=this.canvas;this.sorter=new a.Sorter({container:b.getBody(),placer:b.getPlacerEl(),containerSel:"*",itemSel:"*",pfx:this.ppfx,onStart:this.onDrag,onEndMove:this.onDrop,document:b.getFrameEl().contentDocument,direction:"a",wmargin:1,nested:1,em:this.em})}return this.sorter}},onDrag:function(){this.em.stopDefault(),this.em.get("Canvas").getBody().style.cursor="grabbing",document.body.style.cursor="grabbing"},dragHelper:function(a){a.className+=" "+this.ppfx+"bdrag",this.helper=a,document.body.appendChild(a),$(this.em.get("Canvas").getBody()).on("mousemove",this.moveHelper),$(document).on("mousemove",this.moveHelper)},moveHelper:function(a){this.helper.style.left=a.pageX+"px",this.helper.style.top=a.pageY+"px"},onDrop:function(a){this.em.runDefault(),this.em.get("Canvas").getBody().style.cursor="",document.body.style.cursor="",a&&a.get("activeOnRender")&&(a.trigger("active"),a.set("activeOnRender",0))},addTo:function(a){this.add(a)},add:function(a,c){var d=c||null,e=new b({model:a,attributes:a.get("attributes")},this.config),f=e.render().el;d?d.appendChild(f):this.$el.append(f)},render:function(){var a=document.createDocumentFragment();return this.$el.empty(),this.collection.each(function(b){this.add(b,a)},this),this.$el.append(a),this.$el.addClass(this.ppfx+"blocks-c"),this}})}),c("BlockManager/main",["require","./config/config","./model/Blocks","./view/BlocksView"],function(a){return function(b){var c=b||{},d=a("./config/config"),e=a("./model/Blocks"),f=a("./view/BlocksView");for(var g in d)g in c||(c[g]=d[g]);var h=new e(c.blocks),i=new f({collection:h},c);return{add:function(a,b){var c=b||{};return c.id=a,h.add(c)},get:function(a){return h.get(a)},getAll:function(){return h},render:function(){return i.render().el}}}}),c("BlockManager",["BlockManager/main"],function(a){return a}),c("StorageManager/config/config",[],function(){return{id:"gjs-",autosave:1,autoload:1,type:"local",stepsBeforeSave:1,storeComponents:!1,storeStyles:!1,storeHtml:!0,storeCss:!0,checkLocal:!0,params:{},urlStore:"",urlLoad:"",beforeSend:function(a,b){},onComplete:function(a,b){}}}),c("StorageManager/model/LocalStorage",["backbone"],function(a){return a.Model.extend({defaults:{checkLocal:!0},store:function(a){this.checkStorageEnvironment();for(var b in a)localStorage.setItem(b,a[b])},load:function(a){this.checkStorageEnvironment();for(var b={},c=0,d=a.length;d>c;c++){var e=localStorage.getItem(a[c]);e&&(b[a[c]]=e)}return b},remove:function(a){this.checkStorageEnvironment();for(var b=0,c=a.length;c>b;b++)localStorage.removeItem(a[b])},checkStorageEnvironment:function(){this.get("checkLocal")&&!localStorage&&console.warn("Your browser doesn't support localStorage")}})}),c("StorageManager/model/RemoteStorage",["backbone"],function(a){return a.Model.extend({defaults:{urlStore:"",urlLoad:"",params:{},beforeSend:function(){},onComplete:function(){}},store:function(a){var b={},c=this.get("params");for(var d in a)b[d]=a[d];for(var e in c)b[e]=c[e];$.ajax({url:this.get("urlStore"),beforeSend:this.get("beforeSend"),complete:this.get("onComplete"),method:"POST",dataType:"json",data:b})},load:function(a){var b={},c={},d=this.get("params");for(var e in d)c[e]=d[e];return c.keys=a,$.ajax({url:this.get("urlLoad"),beforeSend:this.get("beforeSend"),complete:this.get("onComplete"),data:c,async:!1,method:"GET"}).done(function(a){b=a}),b}})}),c("StorageManager/main",["require","./config/config","./model/LocalStorage","./model/RemoteStorage"],function(a){var b=function(b){var c=b||{},d=a("./config/config"),e=a("./model/LocalStorage"),f=a("./model/RemoteStorage");for(var g in d)g in c||(c[g]=d[g]);var h={},i={};return i.remote=new f(c),i.local=new e(c),c.currentStorage=c.type,{isAutosave:function(){return!!c.autosave},setAutosave:function(a){return c.autosave=!!a,this},getStepsBeforeSave:function(){return c.stepsBeforeSave},setStepsBeforeSave:function(a){return c.stepsBeforeSave=a,this},add:function(a,b){return h[a]=b,this},get:function(a){return h[a]||null},getStorages:function(){return h},getCurrent:function(){return c.currentStorage},setCurrent:function(a){return c.currentStorage=a,this},store:function(a){var b=this.get(this.getCurrent()),d={};for(var e in a)d[c.id+e]=a[e];return b?b.store(d):null},load:function(a){var b=this.get(this.getCurrent()),d=[],e={};"string"==typeof a&&(a=[a]);for(var f=0,g=a.length;g>f;f++)d.push(c.id+a[f]);var h=b?b.load(d):{};for(var i in h){var j=new RegExp("^"+c.id),k=i.replace(j,"");e[k]=h[i]}return e},loadDefaultProviders:function(){for(var a in i)this.add(a,i[a]);return this},getConfig:function(){return c}}};return b}),c("StorageManager",["StorageManager/main"],function(a){return a}),c("DeviceManager/config/config",[],function(){return{devices:[],deviceLabel:"Device"}}),c("DeviceManager/model/Device",["backbone"],function(a){return a.Model.extend({idAttribute:"name",defaults:{name:"",width:""}})}),c("DeviceManager/model/Devices",["backbone","./Device"],function(a,b){return a.Collection.extend({model:b})}),c("text!DeviceManager/template/devices.html",[],function(){return'
<%= deviceLabel %>
\n
\n \n \n \n
\n
\n
\n
\n'}),c("DeviceManager/view/DevicesView",["backbone","text!./../template/devices.html"],function(a,b){return a.View.extend({template:_.template(b),events:{change:"updateDevice"},initialize:function(a){this.config=a.config||{},this.em=this.config.em,this.ppfx=this.config.pStylePrefix||"",this.events["click ."+this.ppfx+"add-trasp"]=this.startAdd,this.listenTo(this.em,"change:device",this.updateSelect),this.delegateEvents()},startAdd:function(){},updateDevice:function(){var a=this.em;if(a){var b=this.devicesEl,c=b?b.val():"";a.set("device",c)}},updateSelect:function(){var a=this.em,b=this.devicesEl;if(a&&a.getDeviceModel&&b){var c=a.getDeviceModel(),d=c?c.get("name"):"";b.val(d)}},getOptions:function(){var a="";return this.collection.each(function(b){var c=b.get("name");a+='"}),a},render:function(){var a=this.ppfx;return this.$el.html(this.template({ppfx:a,deviceLabel:this.config.deviceLabel})),this.devicesEl=this.$el.find("."+a+"devices"),this.devicesEl.append(this.getOptions()),this.el.className=a+"devices-c",this}})}),c("DeviceManager/main",["require","./config/config","./model/Devices","./view/DevicesView"],function(a){return function(b){var c=b||{},d=a("./config/config"),e=a("./model/Devices"),f=a("./view/DevicesView");for(var g in d)g in c||(c[g]=d[g]);var h=new e(c.devices),i=new f({collection:h,config:c});return{add:function(a,b,c){var d=c||{};return d.name=a,d.width=b,h.add(d)},get:function(a){return h.get(a)},getAll:function(){return h},render:function(){return i.render().el}}}}),c("DeviceManager",["DeviceManager/main"],function(a){return a}),c("ModalDialog/config/config",[],function(){return{stylePrefix:"mdl-",title:"",content:"",backdrop:!0}}),c("ModalDialog/model/Modal",["backbone"],function(a){return a.Model.extend({defaults:{title:"",content:"",open:!1}})}),c("text!ModalDialog/template/modal.html",[],function(){return'
\n
\n
<%= title %>
\n
\n
\n
\n
<%= content %>
\n
\n
\n
\n
'}),c("ModalDialog/view/ModalView",["backbone","text!./../template/modal.html"],function(a,b){return a.View.extend({template:_.template(b),events:{},initialize:function(a){this.config=a.config||{},this.pfx=this.config.stylePrefix,this.listenTo(this.model,"change:open",this.updateOpen),this.listenTo(this.model,"change:title",this.updateTitle),this.listenTo(this.model,"change:content",this.updateContent),this.events["click ."+this.pfx+"btn-close"]="hide",this.config.backdrop&&(this.events["click ."+this.pfx+"backlayer"]="hide"),this.delegateEvents()},updateContent:function(){this.$content||(this.$content=this.$el.find("."+this.pfx+"content #"+this.pfx+"c")),this.$content.html(this.model.get("content"))},updateTitle:function(){this.$title||(this.$title=this.$el.find("."+this.pfx+"title")),this.$title.html(this.model.get("title"))},updateOpen:function(){this.model.get("open")?this.$el.show():this.$el.hide()},hide:function(){this.model.set("open",0)},show:function(){this.model.set("open",1)},setTitle:function(a){return this.model.set("title",a),this},setContent:function(a){return this.model.set("content",a),this},render:function(){var a=this.model.toJSON();return a.pfx=this.pfx,this.$el.html(this.template(a)),this.$el.attr("class",this.pfx+"container"),this.updateOpen(),this}})}),c("ModalDialog/main",["require","./config/config","./model/Modal","./view/ModalView"],function(a){function b(b){var c=b||{},d=a("./config/config"),e=a("./model/Modal"),f=a("./view/ModalView");for(var g in d)g in c||(c[g]=d[g]);this.model=new e(c);var h={model:this.model,config:c};this.modal=new f(h)}return b.prototype={getModel:function(){return this.model},render:function(){return this.modal.render().$el},show:function(){return this.modal.show()},hide:function(){return this.modal.hide()},setTitle:function(a){return this.modal.setTitle(a)},setContent:function(a){return this.modal.setContent(a)}},b}),c("ModalDialog",["ModalDialog/main"],function(a){return a}),c("CodeManager/config/config",[],function(){return{stylePrefix:"cm-"}}),c("CodeManager/model/HtmlGenerator",["backbone"],function(a){return a.Model.extend({build:function(a){var b=a.get("components")||a,c="";return b.each(function(a){var b=a.get("tagName"),d="",e="",f="",g=a.get("components"),h=a.get("attributes"),i=a.get("void"),j=a.get("classes");_.each(h,function(a,b){"onmousedown"!=b&&(d+=a&&"style"!=b?" "+b+'="'+a+'"':"")}),"image"==a.get("type")&&(b="img",i=1,d+=' src="'+a.get("src")+'"'),_.isEmpty(a.get("style"))||(e=' id="'+a.cid+'" '),j.each(function(a){f+=" "+a.get("name")}),f=""!==f?' class="'+f.trim()+'"':"",c+="<"+b+f+e+d+(i?"/":"")+">"+a.get("content"),g.length&&(c+=this.build(g)),i||(c+="")},this),c}})}),c("CodeManager/model/CssGenerator",["backbone"],function(a){return a.Model.extend({initialize:function(){this.compCls=[]},buildFromComp:function(a){var b=a.get("components")||a,c="";return b.each(function(a){var b=a.get("style"),d=a.get("classes"),e=a.get("components");if(d.each(function(a){this.compCls.push(a.get("name"))},this),b&&0!==Object.keys(b).length){c+="#"+a.cid+"{";for(var f in b)b.hasOwnProperty(f)&&(c+=f+":"+b[f]+";");c+="}"}e.length&&(c+=this.buildFromComp(e))},this),c},build:function(a,b){this.compCls=[];var c=this.buildFromComp(a);this.compCls;if(b){var d=b.getRules(),e={};d.each(function(a){var b=a.get("maxWidth");if(b){var d=e[b];return void(d?d.push(a):e[b]=[a])}c+=this.buildFromRule(a)},this);for(var f in e){for(var g=e[f],h="",i=0,j=g.length;j>i;i++)h+=this.buildFromRule(g[i]);h&&(c+="@media (max-width: "+f+"){"+h+"}")}}return c},buildFromRule:function(a){var b="",c=a.get("selectors"),d=a.get("style"),e=a.get("state"),f="",g=0,h=this.compCls;if(c.each(function(a){f+="."+a.get("name"),h.indexOf(a.get("name"))>-1&&(g=1)}),f&&g){f+=e?":"+e:"";var i="";if(d&&0!==Object.keys(d).length)for(var j in d)d.hasOwnProperty(j)&&(i+=j+":"+d[j]+";");i&&(b+=f+"{"+i+"}")}return b}})}),c("CodeManager/model/JsonGenerator",["backbone"],function(a){return a.Model.extend({build:function(b){var c=b.toJSON();return this.beforeEach(c),_.each(c,function(b,d){var e=c[d];if(e instanceof a.Model)c[d]=this.build(e);else if(e instanceof a.Collection){var f=e;c[d]=[],f.length&&f.each(function(a,b){c[d][b]=this.build(a)},this)}},this),c},beforeEach:function(a){delete a.status}})}),function(a){if("object"==typeof exports&&"object"==typeof module)module.exports=a();else{if("function"==typeof c&&c.amd)return c("codemirror/lib/codemirror",[],a);(this||window).CodeMirror=a()}}(function(){"use strict";function a(c,d){if(!(this instanceof a))return new a(c,d);this.options=d=d?Ke(d):{},Ke($f,d,!1),n(d);var e=d.value;"string"==typeof e&&(e=new wg(e,d.mode,null,d.lineSeparator)),this.doc=e;var f=new a.inputStyles[d.inputStyle](this),g=this.display=new b(c,e,f);g.wrapper.CodeMirror=this,j(this),h(this),d.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),d.autofocus&&!Cf&&g.input.focus(),r(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new De,keySeq:null,specialChars:null};var i=this;sf&&11>tf&&setTimeout(function(){i.display.input.reset(!0)},20),Qb(this),We(),ub(this),this.curOp.forceUpdate=!0,Xd(this,e),d.autofocus&&!Cf||i.hasFocus()?setTimeout(Le(qc,this),20):rc(this);for(var k in _f)_f.hasOwnProperty(k)&&_f[k](this,d[k],ag);w(this),d.finishInit&&d.finishInit(this);for(var l=0;ltf&&(d.gutters.style.zIndex=-1,d.scroller.style.paddingRight=0),uf||pf&&Cf||(d.scroller.draggable=!0),a&&(a.appendChild?a.appendChild(d.wrapper):a(d.wrapper)),d.viewFrom=d.viewTo=b.first,d.reportedViewFrom=d.reportedViewTo=b.first,d.view=[],d.renderedView=null,d.externalMeasured=null,d.viewOffset=0,d.lastWrapHeight=d.lastWrapWidth=0,d.updateLineNumbers=null,d.nativeBarWidth=d.barHeight=d.barWidth=0,d.scrollbarsClipped=!1,d.lineNumWidth=d.lineNumInnerWidth=d.lineNumChars=null,d.alignWidgets=!1,d.cachedCharWidth=d.cachedTextHeight=d.cachedPaddingH=null,d.maxLine=null,d.maxLineLength=0,d.maxLineChanged=!1,d.wheelDX=d.wheelDY=d.wheelStartX=d.wheelStartY=null,d.shift=!1,d.selForContextMenu=null,d.activeTouch=null,c.init(d)}function c(b){b.doc.mode=a.getMode(b.options,b.doc.modeOption),d(b)}function d(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Na(a,100),a.state.modeGen++,a.curOp&&Jb(a)}function e(a){a.options.lineWrapping?(Yg(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth="",a.display.sizerWidth=null):(Xg(a.display.wrapper,"CodeMirror-wrap"),m(a)),g(a),Jb(a),hb(a),setTimeout(function(){s(a)},100)}function f(a){var b=sb(a.display),c=a.options.lineWrapping,d=c&&Math.max(5,a.display.scroller.clientWidth/tb(a.display)-3);return function(e){if(vd(a.doc,e))return 0;var f=0;if(e.widgets)for(var g=0;gb.maxLineLength&&(b.maxLineLength=c,b.maxLine=a)})}function n(a){var b=Ge(a.gutters,"CodeMirror-linenumbers");-1==b&&a.lineNumbers?a.gutters=a.gutters.concat(["CodeMirror-linenumbers"]):b>-1&&!a.lineNumbers&&(a.gutters=a.gutters.slice(0),a.gutters.splice(b,1))}function o(a){var b=a.display,c=b.gutters.offsetWidth,d=Math.round(a.doc.height+Sa(a.display));return{clientHeight:b.scroller.clientHeight,viewHeight:b.wrapper.clientHeight,scrollWidth:b.scroller.scrollWidth,clientWidth:b.scroller.clientWidth,viewWidth:b.wrapper.clientWidth,barLeft:a.options.fixedGutter?c:0,docHeight:d,scrollHeight:d+Ua(a)+b.barHeight,nativeBarWidth:b.nativeBarWidth,gutterWidth:c}}function p(a,b,c){this.cm=c;var d=this.vert=Pe("div",[Pe("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),e=this.horiz=Pe("div",[Pe("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a(d),a(e),Cg(d,"scroll",function(){d.clientHeight&&b(d.scrollTop,"vertical")}),Cg(e,"scroll",function(){e.clientWidth&&b(e.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,sf&&8>tf&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function q(){}function r(b){b.display.scrollbars&&(b.display.scrollbars.clear(),b.display.scrollbars.addClass&&Xg(b.display.wrapper,b.display.scrollbars.addClass)),b.display.scrollbars=new a.scrollbarModel[b.options.scrollbarStyle](function(a){b.display.wrapper.insertBefore(a,b.display.scrollbarFiller),Cg(a,"mousedown",function(){b.state.focused&&setTimeout(function(){b.display.input.focus()},0)}),a.setAttribute("cm-not-content","true")},function(a,c){"horizontal"==c?ec(b,a):dc(b,a)},b),b.display.scrollbars.addClass&&Yg(b.display.wrapper,b.display.scrollbars.addClass)}function s(a,b){b||(b=o(a));var c=a.display.barWidth,d=a.display.barHeight;t(a,b);for(var e=0;4>e&&c!=a.display.barWidth||d!=a.display.barHeight;e++)c!=a.display.barWidth&&a.options.lineWrapping&&F(a),t(a,o(a)),c=a.display.barWidth,d=a.display.barHeight}function t(a,b){var c=a.display,d=c.scrollbars.update(b);c.sizer.style.paddingRight=(c.barWidth=d.right)+"px",c.sizer.style.paddingBottom=(c.barHeight=d.bottom)+"px",d.right&&d.bottom?(c.scrollbarFiller.style.display="block",c.scrollbarFiller.style.height=d.bottom+"px",c.scrollbarFiller.style.width=d.right+"px"):c.scrollbarFiller.style.display="",d.bottom&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(c.gutterFiller.style.display="block",c.gutterFiller.style.height=d.bottom+"px",c.gutterFiller.style.width=b.gutterWidth+"px"):c.gutterFiller.style.display=""}function u(a,b,c){var d=c&&null!=c.top?Math.max(0,c.top):a.scroller.scrollTop;d=Math.floor(d-Ra(a));var e=c&&null!=c.bottom?c.bottom:d+a.wrapper.clientHeight,f=be(b,d),g=be(b,e);if(c&&c.ensure){var h=c.ensure.from.line,i=c.ensure.to.line;f>h?(f=h,g=be(b,ce(Yd(b,h))+a.wrapper.clientHeight)):Math.min(i,b.lastLine())>=g&&(f=be(b,ce(Yd(b,i))-a.wrapper.clientHeight),g=i)}return{from:f,to:Math.max(g,f+1)}}function v(a){var b=a.display,c=b.view;if(b.alignWidgets||b.gutters.firstChild&&a.options.fixedGutter){for(var d=y(b)-b.scroller.scrollLeft+a.doc.scrollLeft,e=b.gutters.offsetWidth,f=d+"px",g=0;g=c.viewFrom&&b.visible.to<=c.viewTo&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo)&&c.renderedView==c.view&&0==Pb(a))return!1;w(a)&&(Lb(a),b.dims=H(a));var e=d.first+d.size,f=Math.max(b.visible.from-a.options.viewportMargin,d.first),g=Math.min(e,b.visible.to+a.options.viewportMargin);c.viewFromg&&c.viewTo-g<20&&(g=Math.min(e,c.viewTo)),Jf&&(f=td(a.doc,f),g=ud(a.doc,g));var h=f!=c.viewFrom||g!=c.viewTo||c.lastWrapHeight!=b.wrapperHeight||c.lastWrapWidth!=b.wrapperWidth;Ob(a,f,g),c.viewOffset=ce(Yd(a.doc,c.viewFrom)),a.display.mover.style.top=c.viewOffset+"px";var i=Pb(a);if(!h&&0==i&&!b.force&&c.renderedView==c.view&&(null==c.updateLineNumbers||c.updateLineNumbers>=c.viewTo))return!1;var j=Se();return i>4&&(c.lineDiv.style.display="none"),I(a,c.updateLineNumbers,b.dims),i>4&&(c.lineDiv.style.display=""),c.renderedView=c.view,j&&Se()!=j&&j.offsetHeight&&j.focus(),Qe(c.cursorDiv),Qe(c.selectionDiv),c.gutters.style.height=c.sizer.style.minHeight=0,h&&(c.lastWrapHeight=b.wrapperHeight,c.lastWrapWidth=b.wrapperWidth,Na(a,400)),c.updateLineNumbers=null,!0}function C(a,b){for(var c=b.viewport,d=!0;(d&&a.options.lineWrapping&&b.oldDisplayWidth!=Va(a)||(c&&null!=c.top&&(c={top:Math.min(a.doc.height+Sa(a.display)-Wa(a),c.top)}),b.visible=u(a.display,a.doc,c),!(b.visible.from>=a.display.viewFrom&&b.visible.to<=a.display.viewTo)))&&B(a,b);d=!1){F(a);var e=o(a);Ia(a),E(a,e),s(a,e)}b.signal(a,"update",a),(a.display.viewFrom!=a.display.reportedViewFrom||a.display.viewTo!=a.display.reportedViewTo)&&(b.signal(a,"viewportChange",a,a.display.viewFrom,a.display.viewTo),a.display.reportedViewFrom=a.display.viewFrom,a.display.reportedViewTo=a.display.viewTo)}function D(a,b){var c=new z(a,b);if(B(a,c)){F(a),C(a,c);var d=o(a);Ia(a),E(a,d),s(a,d),c.finish()}}function E(a,b){a.display.sizer.style.minHeight=b.docHeight+"px";var c=b.docHeight+a.display.barHeight;a.display.heightForcer.style.top=c+"px",a.display.gutters.style.height=Math.max(c+Ua(a),b.clientHeight)+"px"}function F(a){for(var b=a.display,c=b.lineDiv.offsetTop,d=0;dtf){var g=f.node.offsetTop+f.node.offsetHeight;e=g-c,c=g}else{var h=f.node.getBoundingClientRect();e=h.bottom-h.top}var i=f.line.height-e;if(2>e&&(e=sb(b)),(i>.001||-.001>i)&&(_d(f.line,e),G(f.line),f.rest))for(var j=0;j