51 lines
1.3 MiB
JavaScript
Raw Normal View History

/*
* Copyright (c) Ascensio System SIA 2019. All rights reserved
*
* http://www.onlyoffice.com
*
* Version: 0.0.0 (build:0)
*/
function onDropDownKeyDown(t){var e=$(this),i=e.parent(),n=jQuery.Event("keydown.before.bs.dropdown"),o=jQuery.Event("keydown.after.bs.dropdown");i.trigger(n),i.hasClass("no-stop-propagate")?(arguments.length>1&&arguments[1]instanceof KeyboardEvent&&(t=arguments[1]),!/^(38|40|27|13|9|37|39)$/.test(t.keyCode)||t.ctrlKey||t.altKey||(patchDropDownKeyDownAdditional.call(this,t),/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()))):(patchDropDownKeyDown.call(this,t),t.preventDefault(),t.stopPropagation()),i.trigger(o)}function patchDropDownKeyDown(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&27==t.keyCode){if(27==t.which){if(o=$("[role=menu] li.dropdown-submenu.over:visible",i),o.size())return o.eq(o.size()-1).removeClass("over"),!1;i.hasClass("dropdown-submenu")&&i.hasClass("over")?(i.removeClass("over"),i.find("> a").focus()):i.find("[data-toggle=dropdown]").focus()}return n?e.click():void 0}var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(":focus"));if(39==t.keyCode){if(s<0)return;var a=o.eq(s).parent();a.hasClass("dropdown-submenu")&&!a.hasClass("over")&&(a.mouseenter(),a.addClass("focused-submenu"),_.delay(function(){var t=$("> [role=menu]",a),e=t.find("> li:not(.divider):not(.disabled):visible > a"),i=0;if(t.find("> .menu-scroll").length>0)for(var n=t.scrollTop(),o=0;o<e.length;o++)if(e[o].offsetTop>n){i=o;break}e.length>0&&e.eq(i).focus()},250))}else 37==t.keyCode?i.hasClass("dropdown-submenu")&&i.hasClass("over")&&(i.removeClass("over"),i.find("> a").focus()):(38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),i.hasClass("dropdown-submenu")&&i.hasClass("over")&&i.addClass("focused-submenu"),o.eq(s).focus())}}}}function patchDropDownKeyDownAdditional(t){if(/(38|40|27|37|39)/.test(t.keyCode)){var e=$(this);if(/(37|39)/.test(t.keyCode)||(t.preventDefault(),t.stopPropagation()),!e.is(".disabled, :disabled")){var i=getParent(e),n=i.hasClass("open")||i.hasClass("over");if(!n||n&&(27==t.keyCode||37==t.keyCode||39==t.keyCode))return n?e.click():void 0;var o=$("> [role=menu] > li:not(.divider):not(.disabled):visible",i).find("> a");if(o.length){var s=o.index(o.filter(".focus"));38==t.keyCode?s>0?s--:s=e.hasClass("no-cyclic")?0:o.length-1:40==t.keyCode&&(s<o.length-1?s++:s=e.hasClass("no-cyclic")?o.length-1:0),~s||(s=0),o.removeClass("focus"),o.eq(s).addClass("focus")}}}}function getParent(t){var e=t.attr("data-target");e||(e=t.attr("href"),e=e&&/#/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i=e&&$(e);return i&&i.length?i:t.parent()}function clearMenus(t){$(".dropdown-toggle").each(function(e){var i=$(this).parent();i.hasClass("open")&&(i.trigger(e=$.Event("hide.bs.dropdown")),e.isDefaultPrevented()||i.removeClass("open").trigger("hidden.bs.dropdown",t))})}if(function(){var t=this,e=t._,i={},n=Array.prototype,o=Object.prototype,s=Function.prototype,a=n.push,r=n.slice,l=n.concat,c=o.toString,h=o.hasOwnProperty,d=n.forEach,p=n.map,m=n.reduce,u=n.reduceRight,g=n.filter,f=n.every,b=n.some,C=n.indexOf,v=n.lastIndexOf,y=Array.isArray,_=Object.keys,x=s.bind,w=function(t){return t instanceof w?t:this instanceof w?void(this._wrapped=t):new w(t)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=w),exports._=w):t._=w,w.VERSION="1.5.2";var S=w.each=w.forEach=function(t,e,n){if(null!=t)if(d&&t.forEach===d)t.forEach(e,n);else if(t.length===+t.length){for(var o=0,s=t.length;o<s;o++)if(e.call(n,t[o],o,t)===i)return}else for(var a=w.keys(t),o=0,s=a.length;o<s;o++)if(e.call(n,t[a[o]],a[o],t)===i)return};w.map=w.collect=function(t,e,i){var n=[];return null==t?n:p&&t.map===p?t.map(e,i):(S(t,function(t,o,s){n.push(e.call(i,t,o,s))}),n)};var A="Reduce of empty array with no initial value";w.reduce=w.foldl=w.inject=function(t,e,i,n){var o=arguments.length>2;if(null==t&&(t=[])
;if(i(t))for(n=t.length;o<n&&!1!==e.call(t[o],o,t[o]);o++);else for(o in t)if(!1===e.call(t[o],o,t[o]))break;return t},trim:function(t){return null==t?"":(t+"").replace(st,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(i(Object(t))?ot.merge(n,"string"==typeof t?[t]:t):J.call(n,t)),n},inArray:function(t,e,i){return null==e?-1:Q.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,o=t.length;n<i;n++)t[o++]=e[n];return t.length=o,t},grep:function(t,e,i){for(var n=[],o=0,s=t.length,a=!i;o<s;o++)!e(t[o],o)!==a&&n.push(t[o]);return n},map:function(t,e,n){var o,s,a=0,r=[];if(i(t))for(o=t.length;a<o;a++)null!=(s=e(t[a],a,n))&&r.push(s);else for(a in t)null!=(s=e(t[a],a,n))&&r.push(s);return Z.apply([],r)},guid:1,proxy:function(t,e){var i,n,o;if("string"==typeof e&&(i=t[e],e=t,t=i),ot.isFunction(t))return n=X.call(arguments,2),o=function(){return t.apply(e||this,n.concat(X.call(arguments)))},o.guid=t.guid=t.guid||ot.guid++,o},now:Date.now,support:nt}),"function"==typeof Symbol&&(ot.fn[Symbol.iterator]=K[Symbol.iterator]),ot.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){tt["[object "+e+"]"]=e.toLowerCase()});var ct=function(t){function e(t,e,i,n){var o,s,a,r,c,d,p,m,u=e&&e.ownerDocument,g=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==g&&9!==g&&11!==g)return i;if(!n&&((e?e.ownerDocument||e:R)!==M&&E(e),e=e||M,P)){if(11!==g&&(d=gt.exec(t)))if(o=d[1]){if(9===g){if(!(a=e.getElementById(o)))return i;if(a.id===o)return i.push(a),i}else if(u&&(a=u.getElementById(o))&&L(e,a)&&a.id===o)return i.push(a),i}else{if(d[2])return X.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&v.getElementsByClassName&&e.getElementsByClassName)return X.apply(i,e.getElementsByClassName(o)),i}if(v.qsa&&!z[t+" "]&&(!F||!F.test(t))){if(1!==g)u=e,m=t;else if("object"!==e.nodeName.toLowerCase()){for((r=e.getAttribute("id"))?r=r.replace(bt,"\\$&"):e.setAttribute("id",r=B),p=w(t),s=p.length,c=ht.test(r)?"#"+r:"[id='"+r+"']";s--;)p[s]=c+" "+h(p[s]);m=p.join(","),u=ft.test(t)&&l(e.parentNode)||e}if(m)try{return X.apply(i,u.querySelectorAll(m)),i}catch(t){}finally{r===B&&e.removeAttribute("id")}}}return A(t.replace(st,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>y.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[B]=!0,t}function o(t){var e=M.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function s(t,e){for(var i=t.split("|"),n=i.length;n--;)y.attrHandle[i[n]]=e}function a(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||W)-(~t.sourceIndex||W);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function r(t){return n(function(e){return e=+e,n(function(i,n){for(var o,s=t([],i.length,e),a=s.length;a--;)i[o=s[a]]&&(i[o]=!(n[o]=i[o]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function h(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function d(t,e,i){var n=e.dir,o=i&&"parentNode"===n,s=O++;return e.first?function(e,i,s){for(;e=e[n];)if(1===e.nodeType||o)return t(e,i,s)}:function(e,i,a){var r,l,c,h=[N,s];if(a){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,i,a))return!0}else for(;e=e[n];)if(1===e.nodeType||o){if(c=e[B]||(e[B]={}),l=c[e.uniqueID]||(c[e.uniqueID]={}),(r=l[n])&&r[0]===N&&r[1]===s)return h[2]=r[2];if(l[n]=h,h[2]=t(e,i,a))return!0}}}function p(t){return t.length>1?function(e,i,n){for(var o=t.length;o--;)if(!t[o](e,i,n))return!1;return!0}:t[0]}function m(t,i,n){for(var o=0,s=i.length;o<s;o++)e(t,i[o],n);return n}function u(t,e,i,n,o){for(var s,a=[],r=0,l=t.length,c=null!=e;r<l;r++)(s=t[r])&&(i&&!i(s,n,o)||(a.push(s),c&&e.push(r)));return a}function g(t,e,i,o,s,a){return o&&!o[B]&&(o=g(o)),s&&!s[B]&&(s=g(s,a)),n(function(n,a,r,l){var c,h,d,p=[],g=[],f=a.length,b=n||m(e||"*",r.nodeType?[r]:r,[]),C=!t||!n&&e?b:u(b,p,t,r,l),v=i?s||(n?t:f||o)?[]:a:C;if(i&&i(C,v,r,l),o)for(c=u(v,g),o(c,[],r,l),h=c.length;h--;)(d=c[h])&&(v[g[h]]=!(C[g[h]]=d));if(n){if(s||t){if(s){for(c=[],h=v.length;h--;)(
return void 0!==ot&&ot.event.triggered!==e.type?ot.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(vt)||[""],c=e.length;c--;)r=Rt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m&&(d=ot.event.special[m]||{},m=(o?d.delegateType:d.bindType)||m,d=ot.event.special[m]||{},h=ot.extend({type:m,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&ot.expr.match.needsContext.test(o),namespace:u.join(".")},s),(p=l[m])||(p=l[m]=[],p.delegateCount=0,d.setup&&!1!==d.setup.call(t,n,u,a)||t.addEventListener&&t.addEventListener(m,a)),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),ot.event.global[m]=!0)},remove:function(t,e,i,n,o){var s,a,r,l,c,h,d,p,m,u,g,f=wt.hasData(t)&&wt.get(t);if(f&&(l=f.events)){for(e=(e||"").match(vt)||[""],c=e.length;c--;)if(r=Rt.exec(e[c])||[],m=g=r[1],u=(r[2]||"").split(".").sort(),m){for(d=ot.event.special[m]||{},m=(n?d.delegateType:d.bindType)||m,p=l[m]||[],r=r[2]&&new RegExp("(^|\\.)"+u.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=p.length;s--;)h=p[s],!o&&g!==h.origType||i&&i.guid!==h.guid||r&&!r.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(p.splice(s,1),h.selector&&p.delegateCount--,d.remove&&d.remove.call(t,h));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(t,u,f.handle)||ot.removeEvent(t,m,f.handle),delete l[m])}else for(m in l)ot.event.remove(t,m+e[c],i,n,!0);ot.isEmptyObject(l)&&wt.remove(t,"handle events")}},dispatch:function(t){t=ot.event.fix(t);var e,i,n,o,s,a=[],r=X.call(arguments),l=(wt.get(this,"events")||{})[t.type]||[],c=ot.event.special[t.type]||{};if(r[0]=t,t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){for(a=ot.event.handlers.call(this,t,l),e=0;(o=a[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,i=0;(s=o.handlers[i++])&&!t.isImmediatePropagationStopped();)t.rnamespace&&!t.rnamespace.test(s.namespace)||(t.handleObj=s,t.data=s.data,void 0!==(n=((ot.event.special[s.origType]||{}).handle||s.handler).apply(o.elem,r))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,o,s,a=[],r=e.delegateCount,l=t.target;if(r&&l.nodeType&&("click"!==t.type||isNaN(t.button)||t.button<1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&(!0!==l.disabled||"click"!==t.type)){for(n=[],i=0;i<r;i++)s=e[i],o=s.selector+" ",void 0===n[o]&&(n[o]=s.needsContext?ot(o,this).index(l)>-1:ot.find(o,this,null,[l]).length),n[o]&&n.push(s);n.length&&a.push({elem:l,handlers:n})}return r<e.length&&a.push({elem:this,handlers:e.slice(r)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget detail eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var i,n,o,s=e.button;return null==t.pageX&&null!=e.clientX&&(i=t.target.ownerDocument||Y,n=i.documentElement,o=i.body,t.pageX=e.clientX+(n&&n.scrollLeft||o&&o.scrollLeft||0)-(n&&n.clientLeft||o&&o.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||o&&o.scrollTop||0)-(n&&n.clientTop||o&&o.clientTop||0)),t.which||void 0===s||(t.which=1&s?1:2&s?3:4&s?2:0),t}},fix:function(t){if(t[ot.expando])return t;var e,i,n,o=t.type,s=t,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=Bt.test(o)?this.mouseHooks:Lt.test(o)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,t=new ot.Event(s),e=n.length;e--;)i=n[e],t[i]=s[i];return t.target||(t.target=Y),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,s):t},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==g()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===g()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&ot.nod
ot.isArray(t)||t.jquery&&!ot.isPlainObject(t))ot.each(t,function(){o(this.name,this.value)});else for(i in t)j(i,t[i],e,o);return n.join("&").replace(ke,"+")},ot.fn.extend({serialize:function(){return ot.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=ot.prop(this,"elements");return t?ot.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!ot(this).is(":disabled")&&De.test(this.nodeName)&&!Me.test(t)&&(this.checked||!Dt.test(t))}).map(function(t,e){var i=ot(this).val();return null==i?null:ot.isArray(i)?ot.map(i,function(t){return{name:e.name,value:t.replace(Ee,"\r\n")}}):{name:e.name,value:i.replace(Ee,"\r\n")}}).get()}}),ot.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Pe={0:200,1223:204},Fe=ot.ajaxSettings.xhr();nt.cors=!!Fe&&"withCredentials"in Fe,nt.ajax=Fe=!!Fe,ot.ajaxTransport(function(e){var i,n;if(nt.cors||Fe&&!e.crossDomain)return{send:function(o,s){var a,r=e.xhr();if(r.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)r[a]=e.xhrFields[a];e.mimeType&&r.overrideMimeType&&r.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest");for(a in o)r.setRequestHeader(a,o[a]);i=function(t){return function(){i&&(i=n=r.onload=r.onerror=r.onabort=r.onreadystatechange=null,"abort"===t?r.abort():"error"===t?"number"!=typeof r.status?s(0,"error"):s(r.status,r.statusText):s(Pe[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=i(),n=r.onerror=i("error"),void 0!==r.onabort?r.onabort=n:r.onreadystatechange=function(){4===r.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{r.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),ot.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return ot.globalEval(t),t}}}),ot.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),ot.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=ot("<script>").prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&o("error"===t.type?404:200,t.type)}),Y.head.appendChild(e[0])},abort:function(){i&&i()}}}});var Ue=[],Ve=/(=)\?(?=&|$)|\?\?/;ot.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ue.pop()||ot.expando+"_"+ge++;return this[t]=!0,t}}),ot.ajaxPrefilter("json jsonp",function(e,i,n){var o,s,a,r=!1!==e.jsonp&&(Ve.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ve.test(e.data)&&"data");if(r||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=ot.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,r?e[r]=e[r].replace(Ve,"$1"+o):!1!==e.jsonp&&(e.url+=(fe.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||ot.error(o+" was not called"),a[0]},e.dataTypes[0]="json",s=t[o],t[o]=function(){a=arguments},n.always(function(){void 0===s?ot(t).removeProp(o):t[o]=s,e[o]&&(e.jsonpCallback=i.jsonpCallback,Ue.push(o)),a&&ot.isFunction(s)&&s(a[0]),a=s=void 0}),"script"}),ot.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||Y;var n=mt.exec(t),o=!i&&[];return n?[e.createElement(n[1])]:(n=p([t],e,o),o&&o.length&&ot(o).remove(),ot.merge([],n.childNodes))};var Le=ot.fn.load;ot.fn.load=function(t,e,i){if("string"!=typeof t&&Le)return Le.apply(this,arguments);var n,o,s,a=this,r=t.indexOf(" ");return r>-1&&(n=ot.trim(t.slice(r)),t=t.slice(0,r)),ot.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(o="POST"),a.length>0&&ot.ajax({url:t,type:o||"GET",dataType:"html",data:e}).done(function(t){s=arguments,a.html(n?ot("<div>").append(ot.parseHTML(t)).find(n):t)}).always(i&&function(t,e){a.each(function(){i.apply(thi
i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){if(!this.sliding)return this.slide("next")},i.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},i.prototype.slide=function(e,n){var o=this.$element.find(".item.active"),s=n||this.getItemForDirection(e,o),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var c=s[0],h=t.Event("slide.bs.carousel",{relatedTarget:c,direction:r});if(this.$element.trigger(h),!h.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var d=t(this.$indicators.children()[this.getItemIndex(s)]);d&&d.addClass("active")}var p=t.Event("slid.bs.carousel",{relatedTarget:c,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,o.addClass(r),s.addClass(r),o.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),o.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(p)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(o.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(p)),a&&this.cycle(),this}};var n=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=n,this};var o=function(i){var n,o=t(this),s=t(o.attr("data-target")||(n=o.attr("href"))&&n.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),o.data()),r=o.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",o).on("click.bs.carousel.data-api","[data-slide-to]",o),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),function(t){"use strict";function e(e){var i,n=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(n)}function i(e){return this.each(function(){var i=t(this),o=i.data("bs.collapse"),s=t.extend({},n.DEFAULTS,i.data(),"object"==typeof e&&e);!o&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),o||i.data("bs.collapse",o=new n(this,s)),"string"==typeof e&&o[e]()})}var n=function(e,i){this.$element=t(e),this.options=t.extend({},n.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};n.VERSION="3.3.7",n.TRANSITION_DURATION=350,n.DEFAULTS={toggle:!0},n.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},n.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,o=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(o&&o.length&&(e=o.data("bs.collapse"))&&e.transitioning)){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){o&&o.length&&(i.call(o,"hide"),e||o.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(n.TRANSITION_DURATION)[a](this.$element[0][l])}}}},n.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPreve
this[t]=this[t]||{}},this)},initialize:function(){},onReady:function(){this.start()},start:function(){this.initializeControllers(this.controllers||{}),this.launchControllers(),this.launch.call(this)},getClasseRefs:function(e,i){var n={},o=this.allocationMap[e],s=this[o];return _.each(i,function(e){n[e]=t(e,e.indexOf(".")>-1?window:s)},this),n},initializeControllers:function(e){this.controllers={},_.each(e,function(e){var i=e.indexOf(".")>-1?window:this[this.allocationMap.controller],n=t(e,i),o=(e.split(".").pop(),new n({id:e,application:this}));o.views=this.getClasseRefs("view",o.views||[]),_.extend(this.models,this.getClasseRefs("model",o.models||[])),_.extend(this.collections,this.getClasseRefs("collection",o.collections||{})),this.buildCollections(),this.controllers[e]=o},this)},launchControllers:function(){_.each(this.controllers,function(t,e){t.onLaunch(this)},this)},launch:function(){},addListeners:function(t,e){this.eventbus.addListeners(t,e)},getController:function(t){return this.controllers[t]},getModel:function(t){this._modelsCache=this._modelsCache||{};var e=this._modelsCache[t],i=this.getModelConstructor(t);return!e&&i&&(e=this.createModel(t),this._modelsCache[t]=e),e||null},getModelConstructor:function(t){return this.models[t]},createModel:function(t,e){var i=this.getModelConstructor(t),n=null;return i&&(n=new i(_.extend(e||{}))),n},getCollection:function(t){this._collectionsCache=this._collectionsCache||{};var e=this._collectionsCache[t],i=this.getCollectionConstructor(t);return!e&&i&&(e=this.createCollection(t),this._collectionsCache[t]=e),e||null},getCollectionConstructor:function(t){return this.collections[t]},createCollection:function(t){var e=this.getCollectionConstructor(t),i=null;return e&&(i=new e),i},buildCollections:function(){_.each(this.collections,function(t,e){this.getCollection(e)},this)}}),void 0!==Backbone.Application)throw"Native Backbone.Application instance already defined.";Backbone.Application=e,Backbone.Application.extend=Backbone.Model.extend;var i=function(t){_.extend(this,t||{}),this.initialize.apply(this,arguments)};if(_.extend(i.prototype,{name:null,views:{},models:{},collections:{},initialize:function(t){},addListeners:function(t){this.getApplication().addListeners(t,this)},onLaunch:function(t){},getApplication:function(){return this.application},getView:function(t){return this._viewsCache[t]},getViewConstructor:function(t){return this.views[t]},createView:function(t,e){var i=this.getViewConstructor(t),n=_.extend(e||{},{alias:t});return this._viewsCache=this._viewsCache||{},this._viewsCache[t]=new i(n),this._viewsCache[t].options=_.extend({},n),this._viewsCache[t]},getModel:function(t){return this.application.getModel(t)},getModelConstructor:function(t){return this.application.getModelConstructor(t)},createModel:function(t,e){return this.application.createModel(t)},getCollection:function(t){return this.application.getCollection(t)},getCollectionConstructor:function(t){return this.application.getCollectionConstructor(t)},createCollection:function(t){return this.application.createCollection(t)},fireEvent:function(t,e,i){this.application.eventbus.fireEvent(t,e,i)},bindViewEvents:function(t,e){this.unbindViewEvents(t),e=_.isFunction(e)?e.call(this):e;for(var i in e){var n=e[i];_.isFunction(n)||(n=this[e[i]]);var o=i.match(/^(\S+)\s*(.*)$/),s=o[1],a=o[2];n=_.bind(n,this),s+=".bindViewEvents"+t.cid,t.$el.on(s,a,n)}return this},unbindViewEvents:function(t){return t.$el.off(".bindViewEvents"+t.cid),this}}),void 0!==Backbone.Controller)throw"Native Backbone.Controller instance already defined.";Backbone.Controller=i,Backbone.Controller.extend=Backbone.Model.extend;var n=function(t){var e=this;_.extend(this,t||{}),_.extend(Backbone.View.prototype,{alias:null,hidden:!1,getAlias:function(){return this.options.alias},fireEvent:function(t,i){this.trigger.apply(this,arguments),e.fireEvent(this.getAlias(),t,i)},hide:function(){this.$el.hide(),this.hidden=!0},show:function(){this.$el.show(),this.hidden=!1}})};if(_.extend(n.prototype,{pool:{},addListeners:function(t,e){this.pool[e.id]=this.pool[
this.$window.append(_.template(n)),this.binding.resize=_.bind(l,this),this.binding.resizeStop=_.bind(c,this),this.binding.resizeStart=_.bind(r,this),e&&e.length>1&&(this.initConfig.minwidth=e[0]),e&&e.length>1&&(this.initConfig.minheight=e[1]),i&&i.length>1&&(this.initConfig.maxwidth=i[0]),i&&i.length>1&&(this.initConfig.maxheight=i[1]),this.$window.find(".resize-border").on("mousedown",this.binding.resizeStart)}else this.$window.find(".resize-border").remove();this.resizable=t}},onPrimary:function(){},cancelButtonText:"Cancel",okButtonText:"OK",yesButtonText:"Yes",noButtonText:"No",closeButtonText:"Close",textWarning:"Warning",textError:"Error",textConfirmation:"Confirmation",textInformation:"Information",textDontShow:"Don't show this message again"}}(),Common.UI.Window||{}))}),define("common/main/lib/view/RenameDialog",["common/main/lib/component/Window"],function(){"use strict";Common.Views.RenameDialog=Common.UI.Window.extend(_.extend({options:{width:330,header:!1,cls:"modal-dlg",filename:""},initialize:function(t){_.extend(this.options,t||{}),this.template=['<div class="box">','<div class="input-row">',"<label>"+this.textName+"</label>","</div>",'<div id="id-dlg-newname" class="input-row"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this;t.inputName=new Common.UI.InputField({el:$("#id-dlg-newname"),style:"width: 100%;",validateOnBlur:!1,validation:function(e){return!/[\t*\+:\"<>?|\\\\\/]/gim.test(e)||t.txtInvalidName+'*+:"<>?|/'}});var e=this.getChild();e.find(".btn").on("click",_.bind(this.onBtnClick,this)),t.inputNameEl=e.find("input"),t.inputNameEl.on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.inputName.setValue(t.options.filename),t.inputNameEl.focus().select()},100)},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&this._handleInput("ok")},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},_handleInput:function(t){if(this.options.handler){if("ok"==t&&!0!==this.inputName.checkValidate())return void this.inputNameEl.focus();this.options.handler.call(this,t,this.inputName.getValue())}this.close()},textName:"File name",cancelButtonText:"Cancel",okButtonText:"Ok",txtInvalidName:"The file name cannot contain any of the following characters: "},Common.Views.RenameDialog||{}))}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Header",["backbone","text!common/main/lib/template/Header.template","core","common/main/lib/view/RenameDialog"],function(t,e){"use strict";Common.Views.Header=t.View.extend(_.extend({options:{branding:{},headerCaption:"Default Caption",documentCaption:"",canBack:!1},el:"#header",template:_.template(e),events:{"click #header-logo":function(t){var e=this.branding&&this.branding.logo&&this.branding.logo.url?this.branding.logo.url:"http://www.onlyoffice.com",i=window.open(e);i&&i.focus()}},initialize:function(t){this.options=this.options?_({}).extend(this.options,t):t,this.headerCaption=this.options.headerCaption,this.documentCaption=this.options.documentCaption,this.canBack=this.options.canBack,this.branding=this.options.customization,this.isModified=!1},render:function(){$(this.el).html(this.template({headerCaption:this.headerCaption,documentCaption:Common.Utils.String.htmlEncode(this.documentCaption),canBack:this.canBack,textBack:this.textBack}));var t=new Common.UI.MenuItem({caption:this.openNewTabText}).on("click",function(t,e){Common.NotificationCenter.trigger("goback",!0),Common.component.Analytics.trackEvent("Back to Folder")});this.gotoDocsMenu=new Common.UI.Menu({style:"min-width: 100px;",items:[t]})},set
this.getChild().find(".btn").on("click",_.bind(this.onBtnClick,this)),this.autoSize()},autoSize:function(){var t=this.getChild(".box"),e=this.getChild(".footer"),i=this.getChild(".header"),n=this.getChild(".body");n.height(parseInt(t.height())+parseInt(e.css("height"))),this.setHeight(parseInt(n.css("height"))+parseInt(i.css("height")))},onBtnClick:function(t){this.options.handler&&this.options.handler.call(this,"checked"==this.chDontShow.getValue()),this.close()},onKeyPress:function(t){t.keyCode==Common.UI.Keys.RETURN&&(this.options.handler&&this.options.handler.call(this,"checked"==this.chDontShow.getValue()),this.close())},getSettings:function(){return"checked"==this.chDontShow.getValue()},textTitle:"Copy, Cut and Paste Actions",textMsg:"Copy, cut and paste actions using the editor toolbar buttons and context menu actions will be performed within this editor tab only.<br><br>.To copy or paste to or from applications outside the editor tab use the following keyboard combinations:",textToCopy:"for Copy",textToPaste:"for Paste",textToCut:"for Cut",textDontShow:"Don't show this message again"},Common.Views.CopyWarningDialog||{}))}),$(document).off("keydown.bs.dropdown.data-api").on("keydown.bs.dropdown.data-api","[data-toggle=dropdown], [role=menu]",onDropDownKeyDown),function(){function t(t){1!=t.which&&void 0!=t.which||clearMenus(/form-control/.test(t.target.className))}var e,i=$._data($(document).get(0),"events");i&&i.click&&i.click.every(function(t,i,n){return/click/.test(t.type)&&!t.selector&&/bs\..+\.dropdown/.test(t.namespace)&&(e=t.handler),!e}),e&&$(document).off("click.bs.dropdown.data-api",e).on("click.bs.dropdown.data-api",t)}(),define("common/main/lib/extend/Bootstrap",function(){}),void 0===Common)var Common={};if(define("common/main/lib/component/ToggleManager",["common/main/lib/component/BaseView"],function(){"use strict";function t(t,i){var n,o,s;if(i)for(n=e[t.toggleGroup],o=0,s=n.length;o<s;o++)n[o]!==t&&(n[o].isActive?n[o].isActive()&&n[o].toggle(!1):n[o].toggle(!1))}var e={};Common.UI.ToggleManager={register:function(i){if(i.toggleGroup){var n=e[i.toggleGroup];n||(n=e[i.toggleGroup]=[]),n.push(i),i.on("toggle",t)}},unregister:function(i){if(i.toggleGroup){var n=e[i.toggleGroup];n&&(_.without(n,i),i.off("toggle",t))}},getToggled:function(t){var i,n=e[t],o=0;if(n)for(i=n.length;o<i;o++)if(!0===n[o].pressed||!0===n[o].checked)return n[o];return null}}}),void 0===Common)var Common={};if(define("common/main/lib/component/MenuItem",["common/main/lib/component/BaseView","common/main/lib/component/ToggleManager"],function(){"use strict";Common.UI.MenuItem=Common.UI.BaseView.extend({options:{id:null,cls:"",style:"",hint:!1,checkable:!1,checked:!1,allowDepress:!1,disabled:!1,value:null,toggleGroup:null,iconCls:"",menu:null,canFocused:!0},tagName:"li",template:_.template(['<a id="<%= id %>" style="<%= style %>" <% if(options.canFocused) { %> tabindex="-1" type="menuitem" <% }; if(!_.isUndefined(options.stopPropagation)) { %> data-stopPropagation="true" <% }; %> >',"<% if (!_.isEmpty(iconCls)) { %>",'<span class="menu-item-icon <%= iconCls %>"></span>',"<% } %>","<%= caption %>","</a>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);this.id=e.options.id||Common.UI.getId(),this.cls=e.options.cls,this.style=e.options.style,this.caption=e.options.caption,this.menu=e.options.menu||null,this.checkable=e.options.checkable,this.checked=e.options.checked,e.allowDepress=e.options.allowDepress,this.disabled=e.options.disabled,this.value=e.options.value,this.toggleGroup=e.options.toggleGroup,this.template=e.options.template||this.template,this.iconCls=e.options.iconCls,this.rendered=!1,null===this.menu||this.menu instanceof Common.UI.Menu||(this.menu=new Common.UI.Menu(_.extend({},e.options.menu))),e.options.el&&this.render()},render:function(){var t=this,e=$(this.el);if(t.trigger("render:before",t),"--"===t.caption)e.addClass("divider");else if(!this.rendered){e.off("click"),Common.UI.ToggleManager.unregister(t),$(this.el).html(this.template({id:t.id,caption:t.c
value:"row-height"}]})}),e.pmiColumnWidth=new Common.UI.MenuItem({caption:e.txtColumnWidth,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:e.txtAutoColumnWidth,value:"auto-column-width"},{caption:e.txtCustomColumnWidth,value:"column-width"}]})}),e.pmiEntireHide=new Common.UI.MenuItem({caption:e.txtHide}),e.pmiEntireShow=new Common.UI.MenuItem({caption:e.txtShow}),e.pmiAddComment=new Common.UI.MenuItem({id:"id-context-menu-item-add-comment",caption:e.txtAddComment}),e.pmiCellMenuSeparator=new Common.UI.MenuItem({caption:"--"}),e.pmiAddNamedRange=new Common.UI.MenuItem({id:"id-context-menu-item-add-named-range",caption:e.txtAddNamedRange}),e.pmiFreezePanes=new Common.UI.MenuItem({caption:e.textFreezePanes}),e.pmiEntriesList=new Common.UI.MenuItem({caption:e.textEntriesList}),e.pmiSparklines=new Common.UI.MenuItem({caption:e.txtSparklines,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[{caption:e.txtClearSparklines,value:Asc.c_oAscCleanOptions.Sparklines},{caption:e.txtClearSparklineGroups,value:Asc.c_oAscCleanOptions.SparklineGroups}]})}),e.ssMenu=new Common.UI.Menu({id:"id-context-menu-cell",items:[e.pmiCut,e.pmiCopy,e.pmiPaste,{caption:"--"},e.pmiSelectTable,e.pmiInsertEntire,e.pmiInsertCells,e.pmiInsertTable,e.pmiDeleteEntire,e.pmiDeleteCells,e.pmiDeleteTable,e.pmiClear,{caption:"--"},e.pmiSparklines,e.pmiSortCells,e.pmiFilterCells,e.pmiReapply,{caption:"--"},e.pmiAddComment,e.pmiCellMenuSeparator,e.pmiEntriesList,e.pmiAddNamedRange,e.pmiInsFunction,e.menuAddHyperlink,e.menuHyperlink,e.pmiRowHeight,e.pmiColumnWidth,e.pmiEntireHide,e.pmiEntireShow,e.pmiFreezePanes]}),e.mnuGroupImg=new Common.UI.MenuItem({caption:this.txtGroup,iconCls:"mnu-group",type:"group",value:"grouping"}),e.mnuUnGroupImg=new Common.UI.MenuItem({caption:this.txtUngroup,iconCls:"mnu-ungroup",type:"group",value:"ungrouping"}),e.mnuShapeSeparator=new Common.UI.MenuItem({caption:"--"}),e.mnuShapeAdvanced=new Common.UI.MenuItem({caption:e.advancedShapeText}),e.mnuImgAdvanced=new Common.UI.MenuItem({caption:e.advancedImgText}),e.mnuChartEdit=new Common.UI.MenuItem({caption:e.chartText}),e.pmiImgCut=new Common.UI.MenuItem({caption:e.txtCut,value:"cut"}),e.pmiImgCopy=new Common.UI.MenuItem({caption:e.txtCopy,value:"copy"}),e.pmiImgPaste=new Common.UI.MenuItem({caption:e.txtPaste,value:"paste"}),this.imgMenu=new Common.UI.Menu({items:[e.pmiImgCut,e.pmiImgCopy,e.pmiImgPaste,{caption:"--"},{caption:this.textArrangeFront,iconCls:"mnu-arrange-front",type:"arrange",value:Asc.c_oAscDrawingLayerType.BringToFront},{caption:this.textArrangeBack,iconCls:"mnu-arrange-back",type:"arrange",value:Asc.c_oAscDrawingLayerType.SendToBack},{caption:this.textArrangeForward,iconCls:"mnu-arrange-forward",type:"arrange",value:Asc.c_oAscDrawingLayerType.BringForward},{caption:this.textArrangeBackward,iconCls:"mnu-arrange-backward",type:"arrange",value:Asc.c_oAscDrawingLayerType.SendBackward},{caption:"--"},e.mnuGroupImg,e.mnuUnGroupImg,e.mnuShapeSeparator,e.mnuChartEdit,e.mnuShapeAdvanced,e.mnuImgAdvanced]}),this.menuParagraphVAlign=new Common.UI.MenuItem({caption:this.vertAlignText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[e.menuParagraphTop=new Common.UI.MenuItem({caption:e.topCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Top}),e.menuParagraphCenter=new Common.UI.MenuItem({caption:e.centerCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Center}),this.menuParagraphBottom=new Common.UI.MenuItem({caption:e.bottomCellText,checkable:!0,toggleGroup:"popupparagraphvalign",value:Asc.c_oAscVAlign.Bottom})]})}),e.menuParagraphDirection=new Common.UI.MenuItem({caption:e.directionText,menu:new Common.UI.Menu({menuAlign:"tl-tr",items:[e.menuParagraphDirectH=new Common.UI.MenuItem({caption:e.directHText,iconCls:"mnu-direct-horiz",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVertDrawingText.normal}),e.menuParagraphDirect90=new Common.UI.MenuItem({caption:e.direct90Text,iconCls:"mnu-direct-rdown",checkable:!0,checked:!1,toggleGroup:"popupparagraphdirect",direction:Asc.c_oAscVer
el:$("#id-dlg-hyperlink-sheet"),cls:"input-group-nr",editable:!1,menuStyle:"min-width: 100%;max-height: 150px;"}),e.inputUrl=new Common.UI.InputField({el:$("#id-dlg-hyperlink-url"),allowBlank:!1,blankError:e.txtEmpty,validateOnBlur:!1,style:"width: 100%;",validation:function(t){var i=e.api.asc_getUrlType($.trim(t));return e.isEmail=2==i,i>0||e.txtNotUrl}}),e.inputRange=new Common.UI.InputField({el:$("#id-dlg-hyperlink-range"),allowBlank:!1,blankError:e.txtEmpty,style:"width: 100%;",validateOnChange:!0,validateOnBlur:!1,validation:function(t){var i=/^[A-Z]+[1-9]\d*:[A-Z]+[1-9]\d*$/.test(t);return i||(i=/^[A-Z]+[1-9]\d*$/.test(t)),!!i||e.textInvalidRange}}),e.inputDisplay=new Common.UI.InputField({el:$("#id-dlg-hyperlink-display"),allowBlank:!0,validateOnBlur:!1,style:"width: 100%;"}),e.inputTip=new Common.UI.InputField({el:$("#id-dlg-hyperlink-tip"),style:"width: 100%;",maxLength:Asc.c_oAscMaxTooltipLength}),t.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),t.find("input").on("keypress",_.bind(this.onKeyPress,this))},show:function(){Common.UI.Window.prototype.show.apply(this,arguments);var t=this;_.delay(function(){t.focusedInput&&t.focusedInput.focus()},500)},setSettings:function(t){if(t){this.cmbSheets.setData(t.sheets),t.props?(this.cmbLinkType.setValue(t.props.asc_getType()),this.cmbLinkType.setDisabled(!t.allowInternal),t.props.asc_getType()==Asc.c_oAscHyperlinkType.RangeLink?($("#id-dlg-hyperlink-external").hide(),$("#id-dlg-hyperlink-internal").show(),this.cmbSheets.setValue(t.props.asc_getSheet()),this.inputRange.setValue(t.props.asc_getRange()),this.focusedInput=this.inputRange.cmpEl.find("input")):(this.inputUrl.setValue(t.props.asc_getHyperlinkUrl().replace(new RegExp(" ","g"),"%20")),this.focusedInput=this.inputUrl.cmpEl.find("input"),this.cmbSheets.setValue(t.currentSheet)),this.inputDisplay.setValue(t.isLock?this.textDefault:t.props.asc_getText()),this.inputTip.setValue(t.props.asc_getTooltip())):(this.cmbLinkType.setValue(Asc.c_oAscHyperlinkType.WebLink),this.cmbLinkType.setDisabled(!t.allowInternal),this.inputDisplay.setValue(t.isLock?this.textDefault:t.text),this.focusedInput=this.inputUrl.cmpEl.find("input"),this.cmbSheets.setValue(t.currentSheet)),this.inputDisplay.setDisabled(t.isLock)}},getSettings:function(){var t=new Asc.asc_CHyperlink,e="";if(t.asc_setType(this.cmbLinkType.getValue()),this.cmbLinkType.getValue()==Asc.c_oAscHyperlinkType.RangeLink)t.asc_setSheet(this.cmbSheets.getValue()),t.asc_setRange(this.inputRange.getValue()),e=this.cmbSheets.getValue()+"!"+this.inputRange.getValue();else{var i=this.inputUrl.getValue().replace(/^\s+|\s+$/g,"");/(((^https?)|(^ftp)):\/\/)|(^mailto:)/i.test(i)||(i=(this.isEmail?"mailto:":"http://")+i),i=i.replace(new RegExp("%20","g")," "),t.asc_setHyperlinkUrl(i),e=i}return this.inputDisplay.isDisabled()?t.asc_setText(null):(_.isEmpty(this.inputDisplay.getValue())&&this.inputDisplay.setValue(e),t.asc_setText(this.inputDisplay.getValue())),t.asc_setTooltip(this.inputTip.getValue()),t},onBtnClick:function(t){this._handleInput(t.currentTarget.attributes.result.value)},onKeyPress:function(t){if(t.keyCode==Common.UI.Keys.RETURN)return this._handleInput("ok"),!1},_handleInput:function(t){if(this.options.handler){if("ok"==t){var e=this.cmbLinkType.getValue()!==Asc.c_oAscHyperlinkType.WebLink||this.inputUrl.checkValidate(),i=this.cmbLinkType.getValue()!==Asc.c_oAscHyperlinkType.RangeLink||this.inputRange.checkValidate(),n=this.inputDisplay.checkValidate();if(!0!==e)return void this.inputUrl.cmpEl.find("input").focus();if(!0!==i)return void this.inputRange.cmpEl.find("input").focus();if(!0!==n)return void this.inputDisplay.cmpEl.find("input").focus()}this.options.handler.call(this,this,t)}this.close()},textTitle:"Hyperlink Settings",textInternalLink:"Internal Data Range",textExternalLink:"Web Link",textEmptyLink:"Enter link here",textEmptyDesc:"Enter caption here",textEmptyTooltip:"Enter tooltip here",strSheet:"Sheet",strRange:"Range",textLinkType:"Link Type",strDisplay:"Display",textTipText:"Screen Tip Text",strLinkTo:"Link To",txtEmpty:"This field is required
this.dataViewItems.push(n),t.get("tip")){var a=$(n.el);a.attr("data-toggle","tooltip"),a.tooltip({title:t.get("tip"),placement:"cursor",zIndex:this.tipZIndex})}this.listenTo(n,"change",this.onChangeItem),this.listenTo(n,"remove",this.onRemoveItem),this.listenTo(n,"click",this.onClickItem),this.listenTo(n,"dblclick",this.onDblClickItem),this.listenTo(n,"select",this.onSelectItem),this.listenTo(n,"contextmenu",this.onContextMenuItem),this.isSuspendEvents||this.trigger("item:add",this,n,t)}}},onResetItems:function(){_.each(this.dataViewItems,function(t){var e=t.$el.data("bs.tooltip");e&&e.tip().remove()},this),$(this.el).html(this.template({groups:this.groups?this.groups.toJSON():null,style:this.style})),_.isUndefined(this.scroller)||(this.scroller.destroy(),delete this.scroller),this.store.length<1&&this.emptyText.length>0&&$(this.el).find(".inner").andSelf().filter(".inner").append('<table cellpadding="10" class="empty-text"><tr><td>'+this.emptyText+"</td></tr></table>"),_.each(this.dataViewItems,function(t){this.stopListening(t),t.stopListening(t.model)},this),this.dataViewItems=[],this.store.each(this.onAddItem,this),this.allowScrollbar&&(this.scroller=new Common.UI.Scroller({el:$(this.el).find(".inner").andSelf().filter(".inner"),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,wheelSpeed:10})),this.attachKeyEvents(),this.lastSelectedRec=null,this._layoutParams=void 0},onChangeItem:function(t,e){this.isSuspendEvents||this.trigger("item:change",this,t,e)},onRemoveItem:function(t,e){if(this.stopListening(t),t.stopListening(),this.store.length<1&&this.emptyText.length>0){var i=$(this.el).find(".inner").andSelf().filter(".inner");i.find(".empty-text").length<=0&&i.append('<table cellpadding="10" class="empty-text"><tr><td>'+this.emptyText+"</td></tr></table>")}for(var n=0;n<this.dataViewItems.length;n++)if(_.isEqual(t,this.dataViewItems[n])){this.dataViewItems.splice(n,1);break}this.isSuspendEvents||this.trigger("item:remove",this,t,e)},onClickItem:function(t,e,i){if(!this.disabled){window._event=i,this.showLast&&this.selectRecord(e),this.lastSelectedRec=null;var n=t.$el.data("bs.tooltip");n&&n.tip().remove(),this.isSuspendEvents||this.trigger("item:click",this,t,e,i)}},onDblClickItem:function(t,e,i){this.disabled||(window._event=i,this.selectRecord(e),this.lastSelectedRec=null,this.isSuspendEvents||this.trigger("item:dblclick",this,t,e,i))},onSelectItem:function(t,e,i){this.isSuspendEvents||this.trigger(i?"item:select":"item:deselect",this,t,e,this._fromKeyDown)},onContextMenuItem:function(t,e,i){this.isSuspendEvents||this.trigger("item:contextmenu",this,t,e,i)},scrollToRecord:function(t){var e=$(this.el).find(".inner"),i=e.offset().top,n=_.indexOf(this.store.models,t),o=n>=0&&this.dataViewItems.length>n?$(this.dataViewItems[n].el):e.find("#"+t.get("id"));if(!(o.length<=0)){var s=o.offset().top;(s<i||s+o.outerHeight()>i+e.height())&&(this.scroller&&this.allowScrollbar?this.scroller.scrollTop(e.scrollTop()+s-i,0):e.scrollTop(e.scrollTop()+s-i))}},onKeyDown:function(t,e){if(!this.disabled)if(void 0===e&&(e=t),_.indexOf(this.moveKeys,e.keyCode)>-1||e.keyCode==Common.UI.Keys.RETURN){e.preventDefault(),e.stopPropagation();var i=this.getSelectedRec()[0];if(null===this.lastSelectedRec&&(this.lastSelectedRec=i),e.keyCode==Common.UI.Keys.RETURN)this.lastSelectedRec=null,this.selectedBeforeHideRec&&(i=this.selectedBeforeHideRec),this.trigger("item:click",this,this,i,t),this.trigger("item:select",this,this,i,t),this.trigger("entervalue",this,i,t),this.parentMenu&&this.parentMenu.hide();else{var n=_.indexOf(this.store.models,i);if(n<0)if(e.keyCode==Common.UI.Keys.LEFT){var o=$(t.target).closest(".dropdown-submenu.over");o.length>0?(o.removeClass("over"),o.find("> a").focus()):n=0}else n=0;else if("both"==this.options.keyMoveDirection){void 0===this._layoutParams&&this.fillIndexesArray();var s=this.dataViewItems[n].topIdx,a=this.dataViewItems[n].leftIdx;if(n=void 0,e.keyCode==Common.UI.Keys.LEFT)for(;void 0===n;){if(--a<0){var o=$(t.target).closest(".dropdown-submenu.over");if(o.length>0){o.removeClass("over
n.addClass(i.selectedCls),i.value="transparent",i.trigger("select",i,"transparent");else if((!/^[a-fA-F0-9]{6}$/.test(i.value)||_.indexOf(i.colors,i.value)<0)&&(i.value=!1),$(i.el).find("div."+i.selectedCls).removeClass(i.selectedCls),n.addClass(i.selectedCls),e=n[0].className.match(i.colorRe)[1],n.hasClass("palette-color-effect")){var o=parseInt(n.attr("effectid"));e&&(i.value=e.toUpperCase(),i.trigger("select",i,{color:e,effectId:o}))}else/#?[a-fA-F0-9]{6}/.test(e)&&(e=/#?([a-fA-F0-9]{6})/.exec(e)[1].toUpperCase(),i.value=e,i.trigger("select",i,e))},select:function(t,e){var i=$(this.el);if(i.find("div."+this.selectedCls).removeClass(this.selectedCls),t)if("object"==typeof t){var n;void 0!==t.effectId?(n=i.find('div[effectid="'+t.effectId+'"]').first(),n.length>0?(n.addClass(this.selectedCls),this.value=n[0].className.match(this.colorRe)[1].toUpperCase()):this.value=!1):void 0!==t.effectValue&&(n=i.find('div[effectvalue="'+t.effectValue+'"].color-'+t.color.toUpperCase()).first(),n.length>0?(n.addClass(this.selectedCls),this.value=n[0].className.match(this.colorRe)[1].toUpperCase()):this.value=!1)}else if(/#?[a-fA-F0-9]{6}/.test(t)&&(t=/#?([a-fA-F0-9]{6})/.exec(t)[1].toUpperCase(),this.value=t),/^[a-fA-F0-9]{6}|transparent$/.test(t)&&_.indexOf(this.colors,t)>=0)_.indexOf(this.colors,this.value)<0&&(this.value=!1),(t!=this.value||this.options.allowReselect)&&("transparent"==t?i.find("div.color-transparent").addClass(this.selectedCls):i.find("div.palette-color.color-"+t).first().addClass(this.selectedCls),this.value=t,!0!==e&&this.fireEvent("select",this,t));else{var o=i.find("#"+t).first();0==o.length&&(o=i.find('div[color="'+t+'"]').first()),o.length>0&&(o.addClass(this.selectedCls),this.value=t.toUpperCase())}},updateColors:function(t){void 0!==t&&(this.colors=t,this.cmpEl=$(this.template({id:this.id,cls:this.cls,style:this.style,colors:this.colors})),$(this.el).html(this.cmpEl),this.cmpEl.on("click",_.bind(this.handleClick,this)))},clearSelection:function(t){$(this.el).find("div."+this.selectedCls).removeClass(this.selectedCls),this.value=void 0}})}),define("spreadsheeteditor/main/app/view/AutoFilterDialog",["common/main/lib/component/Window","common/main/lib/component/ColorPaletteExt"],function(){"use strict";SSE.Views=SSE.Views||{},SSE.Views.DigitalFilterDialog=Common.UI.Window.extend(_.extend({initialize:function(t){var e=this,i={};_.extend(i,{width:501,height:230,contentWidth:180,header:!0,cls:"filter-dlg",contentTemplate:"",title:e.txtTitle,items:[]},t),this.template=t.template||['<div class="box" style="height:'+(i.height-85)+'px;">','<div class="content-panel" >','<label class="header">',e.textShowRows,"</label>",'<div style="margin-top:15px;">','<div id="id-search-begin-digital-combo" class="input-group-nr" style="vertical-align:top;width:225px;display:inline-block;"></div>','<div id="id-sd-cell-search-begin" class="" style="width:225px;display:inline-block;margin-left:18px;"></div>',"</div>","<div>",'<div id="id-and-radio" class="padding-small" style="display: inline-block; margin-top:10px;"></div>','<div id="id-or-radio" class="padding-small" style="display: inline-block; margin-left:25px;"></div>',"</div>",'<div style="margin-top:10px;">','<div id="id-search-end-digital-combo" class="input-group-nr" style="vertical-align:top;width:225px;display:inline-block;"></div>','<div id="id-sd-cell-search-end" class="" style="width:225px;display:inline-block;margin-left:18px;"></div>',"</div>","</div>","</div>",'<div class="separator horizontal" style="width:100%"></div>','<div class="footer right" style="margin-left:-15px;">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right:10px;">',e.okButtonText,"</button>",'<button class="btn normal dlg-btn" result="cancel">',e.cancelButtonText,"</button>","</div>"].join(""),this.api=t.api,this.handler=t.handler,this.type=t.type||"number",i.tpl=_.template(this.template,i),Common.UI.Window.prototype.initialize.call(this,i)},render:function(){Common.UI.Window.prototype.render.call(this),this.conditions=[{value:Asc.c_oAscCustomAutoFilter.equals,displayValue
null===b.asc_getCellColor()?(this.miFilterCellColor.setChecked(!0,!0),this.mnuFilterColorCellsPicker.select(C||"transparent",!0)):!1===b.asc_getCellColor()&&(this.miFilterFontColor.setChecked(!0,!0),this.mnuFilterColorFontPicker.select(C||"000000",!0))}else if(i||n){var v=i?t.asc_getFilter().asc_getType():null,g=this.miNumFilter.menu.items;g.forEach(function(t){t.setChecked(i&&t.options.type==Asc.c_oAscAutoFilterTypes.DynamicFilter&&t.value==v||n&&t.options.type==Asc.c_oAscAutoFilterTypes.Top10,!0)})}this.miClear.setDisabled(this.initialFilterType===Asc.c_oAscAutoFilterTypes.None),this.miReapply.setDisabled(this.initialFilterType===Asc.c_oAscAutoFilterTypes.None),this.btnOk.setDisabled(this.initialFilterType!==Asc.c_oAscAutoFilterTypes.Filters&&this.initialFilterType!==Asc.c_oAscAutoFilterTypes.None)},setupDataCells:function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}var e,i,n=this,o=0,s=2,a=!0,r=!1,l=0,c=[],h=[],d=n.filter?n.filteredIndexes:n.throughIndexes;this.configTo.asc_getValues().forEach(function(r){i=r.asc_getText(),e=t(i),a=!0,n.filter?(null===i.match(n.filter)&&(a=!1),d[s]=a):void 0==d[s]&&(d[s]=r.asc_getVisible()),a?(c.push(new Common.UI.DataViewModel({id:++o,selected:!1,allowSelected:!0,cellvalue:i,value:e?i:i.length>0?i:n.textEmptyItem,intval:e?parseFloat(i):void 0,strval:e?"":i,groupid:"1",check:d[s],throughIndex:s})),d[s]&&l++):h.push(new Common.UI.DataViewModel({cellvalue:i})),++s}),l==c.length?r=!0:l>0&&(r="indeterminate"),(n.filter||void 0==d[0])&&(d[0]=!0),(!n.filter||c.length>0)&&c.unshift(new Common.UI.DataViewModel({id:++o,selected:!1,allowSelected:!0,value:n.filter?this.textSelectAllResults:this.textSelectAll,groupid:"0",check:d[0],throughIndex:0})),n.filter&&c.length>1&&(void 0==d[1]&&(d[1]=!1),c.splice(1,0,new Common.UI.DataViewModel({id:++o,selected:!1,allowSelected:!0,value:this.textAddSelection,groupid:"2",check:d[1],throughIndex:1}))),this.cells.reset(c),this.filterExcludeCells.reset(h),this.cells.length&&(this.checkCellTrigerBlock=!0,this.cells.at(0).set("check",r),this.checkCellTrigerBlock=void 0),this.btnOk.setDisabled(this.cells.length<1),this.cellsList.scroller.update({minScrollbarLength:40,alwaysVisibleY:!0,suppressScrollX:!0})},testFilter:function(){var t=this,e=!1;return this.cells&&(this.filter&&this.filteredIndexes[1]?e=!0:this.cells.forEach(function(t){if("1"==t.get("groupid")&&t.get("check"))return e=!0,!0})),e||(t._skipCheckDocumentClick=!0,Common.UI.warning({title:this.textWarning,msg:this.warnNoSelected,callback:function(){t._skipCheckDocumentClick=!1,_.delay(function(){t.input.$el.find("input").focus()},100,this)}})),e},save:function(){if(this.api&&this.configTo&&this.cells&&this.filterExcludeCells){var t=this.configTo.asc_getValues(),e=!1;if(this.filter&&this.filteredIndexes[1])this.initialFilterType===Asc.c_oAscAutoFilterTypes.CustomFilters&&t.forEach(function(t,e){t.asc_setVisible(!0)}),this.cells.each(function(e){"1"==e.get("groupid")&&t[parseInt(e.get("throughIndex"))-2].asc_setVisible(e.get("check"))}),t.forEach(function(t,i){if(t.asc_getVisible())return e=!0,!0});else{var i=this.filter?this.filteredIndexes:this.throughIndexes;t.forEach(function(t,e){t.asc_setVisible(i[e+2])}),e=!0}e&&(this.configTo.asc_getFilterObj().asc_setType(Asc.c_oAscAutoFilterTypes.Filters),this.api.asc_applyAutoFilter(this.configTo))}},onPrimary:function(){return this.save(),this.close(),!1},okButtonText:"Ok",btnCustomFilter:"Custom Filter",textSelectAll:"Select All",txtTitle:"Filter",warnNoSelected:"You must choose at least one value",textWarning:"Warning",cancelButtonText:"Cancel",textEmptyItem:"{Blanks}",txtEmpty:"Enter cell's filter",txtSortLow2High:"Sort Lowest to Highest",txtSortHigh2Low:"Sort Highest to Lowest",txtSortCellColor:"Sort by cells color",txtSortFontColor:"Sort by font color",txtNumFilter:"Number filter",txtTextFilter:"Text filter",txtFilterCellColor:"Filter by cells color",txtFilterFontColor:"Filter by font color",txtClear:"Clear",txtReapply:"Reapply",txtEquals:"Equals...",txtNotEquals:"Does not equal...",txtGreater:"Greater than...",txtGreaterEquals:"Greater th
p.pmiImgPaste.setDisabled(f),p.mnuImgAdvanced.setVisible(l&&!h&&!r),p.mnuImgAdvanced.setDisabled(f),e&&this.showPopupMenu(p.imgMenu,{},i),p.mnuShapeSeparator.setVisible(p.mnuShapeAdvanced.isVisible()||p.mnuChartEdit.isVisible()||p.mnuImgAdvanced.isVisible())}else if(c||d){if(!e&&!p.textInShapeMenu.isVisible())return;p.pmiTextAdvanced.textInfo=void 0;for(var x=this.api.asc_getGraphicObjectProps(),T=!1,w=0;w<x.length;w++){var k=x[w].asc_getObjectType();if(k==Asc.c_oAscTypeSelectElement.Image){var I=x[w].asc_getObjectValue(),E=I.asc_getVerticalTextAlign(),M=I.asc_getVert();f=f||I.asc_getLocked(),p.menuParagraphTop.setChecked(E==Asc.c_oAscVAlign.Top),p.menuParagraphCenter.setChecked(E==Asc.c_oAscVAlign.Center),p.menuParagraphBottom.setChecked(E==Asc.c_oAscVAlign.Bottom),p.menuParagraphDirectH.setChecked(M==Asc.c_oAscVertDrawingText.normal),p.menuParagraphDirect90.setChecked(M==Asc.c_oAscVertDrawingText.vert),p.menuParagraphDirect270.setChecked(M==Asc.c_oAscVertDrawingText.vert270)}else k==Asc.c_oAscTypeSelectElement.Paragraph?(p.pmiTextAdvanced.textInfo=x[w].asc_getObjectValue(),f=f||p.pmiTextAdvanced.textInfo.asc_getLocked()):k==Asc.c_oAscTypeSelectElement.Math&&(this._currentMathObj=x[w].asc_getObjectValue(),T=!0)}var D=t.asc_getHyperlink(),P=this.api.asc_canAddShapeHyperlink();p.menuHyperlinkShape.setVisible(c&&!1!==P&&D),p.menuAddHyperlinkShape.setVisible(c&&!1!==P&&!D),p.menuParagraphVAlign.setVisible(!0!==d&&!T),p.menuParagraphDirection.setVisible(!0!==d&&!T),p.pmiTextAdvanced.setVisible(void 0!==p.pmiTextAdvanced.textInfo),_.each(p.textInShapeMenu.items,function(t){t.setDisabled(f)}),p.pmiTextCopy.setDisabled(!1);this._currentParaObjDisabled=f,T?this.addEquationMenu(4):this.clearEquationMenu(4),e&&this.showPopupMenu(p.textInShapeMenu,{},i),p.textInShapeMenu.items[3].setVisible(p.menuHyperlinkShape.isVisible()||p.menuAddHyperlinkShape.isVisible()||p.menuParagraphVAlign.isVisible()||T)}else if(!this.permissions.isEditMailMerge&&!this.permissions.isEditDiagram||m!==Asc.c_oAscSelectionType.RangeImage&&m!==Asc.c_oAscSelectionType.RangeShape&&m!==Asc.c_oAscSelectionType.RangeChart&&m!==Asc.c_oAscSelectionType.RangeChartText&&m!==Asc.c_oAscSelectionType.RangeShapeText){if(!e&&!p.ssMenu.isVisible())return;var F=this.api.isCellEdited,U=t.asc_getFormatTableInfo(),V=null!==t.asc_getSparklineInfo(),L=null!==U,B=t.asc_getFlags().asc_getMultiselect();p.ssMenu.formatTableName=L?U.asc_getTableName():null,p.ssMenu.cellColor=t.asc_getFill().asc_getColor(),p.ssMenu.fontColor=t.asc_getFont().asc_getColor(),p.pmiInsertEntire.setVisible(o||s),p.pmiInsertEntire.setCaption(o?this.textInsertTop:this.textInsertLeft),p.pmiDeleteEntire.setVisible(o||s),p.pmiInsertCells.setVisible(n&&!F&&!L),p.pmiDeleteCells.setVisible(n&&!F&&!L),p.pmiSelectTable.setVisible(n&&!F&&L),p.pmiInsertTable.setVisible(n&&!F&&L),p.pmiDeleteTable.setVisible(n&&!F&&L),p.pmiSparklines.setVisible(V),p.pmiSortCells.setVisible((n||a||v)&&!F),p.pmiFilterCells.setVisible((n||v)&&!F),p.pmiReapply.setVisible((n||a||v)&&!F),p.ssMenu.items[12].setVisible((n||a||v||V)&&!F),p.pmiInsFunction.setVisible(n||C),p.pmiAddNamedRange.setVisible(n&&!F),L&&(p.pmiInsertTable.menu.items[0].setDisabled(!U.asc_getIsInsertRowAbove()),p.pmiInsertTable.menu.items[1].setDisabled(!U.asc_getIsInsertRowBelow()),p.pmiInsertTable.menu.items[2].setDisabled(!U.asc_getIsInsertColumnLeft()),p.pmiInsertTable.menu.items[3].setDisabled(!U.asc_getIsInsertColumnRight()),p.pmiDeleteTable.menu.items[0].setDisabled(!U.asc_getIsDeleteRow()),p.pmiDeleteTable.menu.items[1].setDisabled(!U.asc_getIsDeleteColumn()),p.pmiDeleteTable.menu.items[2].setDisabled(!U.asc_getIsDeleteTable()));var D=t.asc_getHyperlink();p.menuHyperlink.setVisible(n&&D&&!F&&!B),p.menuAddHyperlink.setVisible(n&&!D&&!F&&!B),p.pmiRowHeight.setVisible(o||a),p.pmiColumnWidth.setVisible(s||a),p.pmiEntireHide.setVisible(s||o),p.pmiEntireShow.setVisible(s||o),p.pmiFreezePanes.setVisible(!F),p.pmiFreezePanes.setCaption(this.api.asc_getSheetViewSettings().asc_getIsFreezePane()?p.textUnFreezePanes:p.textFreezePanes),p.pmiEntriesList.setVisible(!F),p.ssMenu.item
txtGroupCharUnder:"Char under text",txtDeleteGroupChar:"Delete char",txtHideDegree:"Hide degree",txtShowDegree:"Show degree",txtIncreaseArg:"Increase argument size",txtDecreaseArg:"Decrease argument size",txtInsertBreak:"Insert manual break",txtDeleteBreak:"Delete manual break",txtAlignToChar:"Align to character",txtDeleteRadical:"Delete radical",txtDeleteChars:"Delete enclosing characters",txtDeleteCharsAndSeparators:"Delete enclosing characters and separators",insertText:"Insert",alignmentText:"Alignment",leftText:"Left",rightText:"Right",centerText:"Center",insertRowAboveText:"Row Above",insertRowBelowText:"Row Below",insertColumnLeftText:"Column Left",insertColumnRightText:"Column Right",deleteText:"Delete",deleteRowText:"Delete Row",deleteColumnText:"Delete Column",txtNoChoices:"There are no choices for filling the cell.<br>Only text values from the column can be selected for replacement.",txtExpandSort:"The data next to the selection will not be sorted. Do you want to expand the selection to include the adjacent data or continue with sorting the currently selected cells only?",txtExpand:"Expand and sort",txtSorting:"Sorting",txtSortSelected:"Sort selected",txtPaste:"Paste",txtPasteFormulas:"Paste only formula",txtPasteFormulaNumFormat:"Formula + number format",txtPasteKeepSourceFormat:"Formula + all formatting",txtPasteBorders:"Formula without borders",txtPasteColWidths:"Formula + column width",txtPasteMerge:"Merge conditional formatting",txtPasteTranspose:"Transpose",txtPasteValues:"Paste only value",txtPasteValNumFormat:"Value + number format",txtPasteValFormat:"Value + all formatting",txtPasteFormat:"Paste only formatting",txtPasteLink:"Paste Link",txtPastePicture:"Picture",txtPasteLinkPicture:"Linked Picture",txtPasteSourceFormat:"Source formatting",txtPasteDestFormat:"Destination formatting"},SSE.Controllers.DocumentHolder||{}))}),define("text!spreadsheeteditor/main/app/template/CellEditor.template",[],function(){return'<div class="ce-group-name">\r\n <input id="ce-cell-name" class="aslabel form-control" type="text">\r\n <div id="ce-cell-name-menu"></div>\r\n <button id="ce-func-label" type="button" class="btn small btn-toolbar"><span class="btn-icon">&nbsp;</span></button>\r\n</div>\r\n<div class="ce-group-expand">\r\n <button id="ce-btn-expand" type="button" class="btn"><span class="caret img-commonctrl">&nbsp;</span></button>\r\n</div>\r\n<div class="ce-group-content">\r\n <textarea id="ce-cell-content" class="form-control" spellcheck="false" rows="1" cols="20"></textarea>\r\n</div>\r\n'}),define("spreadsheeteditor/main/app/view/CellEditor",["text!spreadsheeteditor/main/app/template/CellEditor.template","common/main/lib/component/BaseView"],function(t){"use strict";SSE.Views.CellEditor=Common.UI.BaseView.extend(_.extend({template:_.template(t),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t)},render:function(){$(this.el).html(this.template()),this.btnNamedRanges=new Common.UI.Button({menu:new Common.UI.Menu({style:"min-width: 70px;max-width:400px;",maxHeight:250,items:[{caption:this.textManager,value:"manager"},{caption:"--"}]}).on("render:after",function(t){this.scroller=new Common.UI.Scroller({el:$(this.el).find(".dropdown-menu "),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40})}).on("show:after",function(){this.scroller.update({alwaysVisibleY:!0})})}),this.btnNamedRanges.render($("#ce-cell-name-menu")),this.btnNamedRanges.setVisible(!1),this.btnNamedRanges.menu.setOffset(-55),this.$cellname=$("#ce-cell-name",this.el),this.$btnexpand=$("#ce-btn-expand",this.el),this.$btnfunc=$("#ce-func-label",this.el);var t=this;return this.$cellname.on("focusin",function(e){t.$cellname.select().one("mouseup",function(t){t.preventDefault()})}),this.$btnfunc.addClass("disabled"),this.$btnfunc.tooltip({title:this.tipFormula,placement:"cursor"}),this},updateCellInfo:function(t){t&&this.$cellname.val("string"==typeof t?t:t.asc_getName())},cellNameDisabled:function(t){t?this.$cellname.attr("disabled","disabled"):this.$cellname.removeAttr("disabled"),this.b
Accent_BorderBoxCustom:134283265,Accent_BarTop:134348800,Accent_BarBot:134348801,Accent_Custom_1:134414336,Accent_Custom_2:134414337,Accent_Custom_3:134414338,LimitLog_LogBase:150994944,LimitLog_Log:150994945,LimitLog_Lim:150994946,LimitLog_Min:150994947,LimitLog_Max:150994948,LimitLog_Ln:150994949,LimitLog_Custom_1:151060480,LimitLog_Custom_2:151060481,Operator_ColonEquals:167772160,Operator_EqualsEquals:167772161,Operator_PlusEquals:167772162,Operator_MinusEquals:167772163,Operator_Definition:167772164,Operator_UnitOfMeasure:167772165,Operator_DeltaEquals:167772166,Operator_ArrowL_Top:167837696,Operator_ArrowR_Top:167837697,Operator_ArrowL_Bot:167837698,Operator_ArrowR_Bot:167837699,Operator_DoubleArrowL_Top:167837700,Operator_DoubleArrowR_Top:167837701,Operator_DoubleArrowL_Bot:167837702,Operator_DoubleArrowR_Bot:167837703,Operator_ArrowD_Top:167837704,Operator_ArrowD_Bot:167837705,Operator_DoubleArrowD_Top:167837706,Operator_DoubleArrowD_Bot:167837707,Operator_Custom_1:167903232,Operator_Custom_2:167903233,Matrix_1_2:184549376,Matrix_2_1:184549377,Matrix_1_3:184549378,Matrix_3_1:184549379,Matrix_2_2:184549380,Matrix_2_3:184549381,Matrix_3_2:184549382,Matrix_3_3:184549383,Matrix_Dots_Center:184614912,Matrix_Dots_Baseline:184614913,Matrix_Dots_Vertical:184614914,Matrix_Dots_Diagonal:184614915,Matrix_Identity_2:184680448,Matrix_Identity_2_NoZeros:184680449,Matrix_Identity_3:184680450,Matrix_Identity_3_NoZeros:184680451,Matrix_2_2_RoundBracket:184745984,Matrix_2_2_SquareBracket:184745985,Matrix_2_2_LineBracket:184745986,Matrix_2_2_DLineBracket:184745987,Matrix_Flat_Round:184811520,Matrix_Flat_Square:184811521}}),define("text!spreadsheeteditor/main/app/template/Toolbar.template",[],function(){return'<div class="toolbar" style="<%= (isCompactView || isEditDiagram || isEditMailMerge) ? \'height: 41px;\' : \'height: 67px;\' %>">\n \x3c!-----------------------\x3e\n \x3c!-- Edit diagram mode --\x3e\n \x3c!-----------------------\x3e\n <div id="id-toolbar-diagramm" style="<%= isEditDiagram ? \'display: table;\' : \'display: none;\' %> width: 100%;" >\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-copy"></span>\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-paste"></span>\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-undo"></span>\n <span class="btn-placeholder" id="id-toolbar-diagram-placeholder-btn-redo"></span>\n </div>\n </div>\n <div class="separator short"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-formula"></span>\n </div>\n </div>\n <div class="separator short" style="margin-left: 5px;"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-digit-dec"></span>\n <span class="btn-placeholder split" id="id-toolbar-diagram-placeholder-btn-digit-inc"></span>\n <span class="btn-placeholder" id="id-toolbar-diagram-placeholder-btn-format" style="width: 84px; margin-left: 10px; vertical-align: middle;"></span>\n </div>\n </div>\n <div class="separator short"></div>\n <div class="toolbar-group">\n <div class="toolbar-row">\n <span class="btn-placeholder border" id="id-toolbar-diagram-placeholder-btn-chart" style="width: auto;"></span>\n </div>\n </div>\n <div class="toolbar-group" style="width: 100%;"></div>\n </div>\n \x3c!-----------------------\x3e\n \x3c!-- Edit mail merge mode --\x3e\n \x3c!-----------------------\x3e\n <div id="id-toolbar-merge" style="<%= isEditMailMerge ? \'display: table;\' : \'display: none;\' %> width: 100%;" >\n <div class="toolbar-group
$(document).on("mousemove",g)},C=function(t,e,i){$(document).off("mouseup",C),$(document).off("mousemove",g),g(t)},v=function(t,e,i){$(document).on("mouseup",y),$(document).on("mousemove",f),f(t)},y=function(t,e,i){$(document).off("mouseup",y),$(document).off("mousemove",f)},_=function(t){var e=new Common.util.RGBColor(c.color).toHSB();m(e,!0)},x=function(t){var m,g=$(c.el);g&&(e=g.find(".cnt-hb-arrow"),i=g.find(".cnt-sat-arrow"),n=g.find(".cnt-hb"),o=g.find(".cnt-sat"),s=g.find(".color-value"),r=g.find(".color-text"),l=g.find(".empty-color"),s.length>0&&(a=s.find(".transparent-color")),n.length>0&&(n.off("mousedown"),n.on("mousedown",b)),o.length>0&&(o.off("mousedown"),o.on("mousedown",v)),l.length>0&&(l.off("click"),l.on("click",_)),m="transparent"==c.color?{h:0,s:100,b:100}:new Common.Utils.RGBColor(c.color).toHSB(),h=m.h,d=m.s,p=m.b,h==d&&h==p&&0==h&&(d=100),u())};c.setColor=function(t){if(c.color!=t){var e;e="transparent"==t?{h:0,s:100,b:100}:new Common.Utils.RGBColor(t).toHSB(),h=e.h,d=e.s,p=e.b,h==d&&h==p&&0==h&&(d=100),c.color=t,u()}},c.getColor=function(){return c.color},c.on("render:after",x),c.render()},render:function(){return $(this.el).html(this.template()),this.trigger("render:after",this),this},textNoColor:"No Color"})}),void 0===Common)var Common={};if(define("common/main/lib/component/MaskedField",["common/main/lib/component/BaseView"],function(){"use strict";Common.UI.MaskedField=Common.UI.BaseView.extend({options:{maskExp:"",maxLength:999},initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this,i=$(this.el);i.addClass("masked-field user-select"),i.attr("maxlength",e.options.maxLength),i.on("keypress",function(t){var n=String.fromCharCode(t.which);e.options.maskExp.test(n)||t.ctrlKey||t.keyCode===Common.UI.Keys.DELETE||t.keyCode===Common.UI.Keys.BACKSPACE||t.keyCode===Common.UI.Keys.LEFT||t.keyCode===Common.UI.Keys.RIGHT||t.keyCode===Common.UI.Keys.HOME||t.keyCode===Common.UI.Keys.END||t.keyCode===Common.UI.Keys.ESC||t.keyCode===Common.UI.Keys.INSERT||t.keyCode===Common.UI.Keys.TAB||(t.keyCode==Common.UI.Keys.RETURN&&e.trigger("changed",e,i.val()),t.preventDefault(),t.stopPropagation())}),i.on("input",function(t){e.trigger("change",e,i.val())}),i.on("blur",function(t){e.trigger("changed",e,i.val())})},render:function(){return this},setValue:function(t){this.options.maskExp.test(t)&&t.length<=this.options.maxLength&&$(this.el).val(t)},getValue:function(){$(this.el).val()}})}),void 0===Common)var Common={};if(define("common/main/lib/view/ExtendedColorDialog",["text!common/main/lib/template/ExtendedColorDialog.template","common/main/lib/component/HSBColorPicker","common/main/lib/component/MetricSpinner","common/main/lib/component/MaskedField","common/main/lib/component/Window"],function(t){"use strict";Common.UI.ExtendedColorDialog=Common.UI.Window.extend(_.extend({tpl:_.template(t),options:{},rendered:!1,initialize:function(t){Common.UI.Window.prototype.initialize.call(this,{cls:"extended-color-dlg",tpl:this.tpl({txtNew:this.textNew,txtCurrent:this.textCurrent,txtAdd:this.addButtonText,txtCancel:this.cancelButtonText}),header:!1,width:340,height:272}),this.hexRe=/\s*#?([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)([0-9a-fA-F][0-9a-fA-F]?)\s*/},render:function(){function t(t){e.trigger("onmodalresult",parseInt(t.currentTarget.attributes.result.value)),e.close(!0)}var e=this;return Common.UI.Window.prototype.render.call(this),this.colorsPicker=new Common.UI.HSBColorPicker({el:$("#id-hsb-colorpicker"),showCurrentColor:!1}),this.colorsPicker.on("changecolor",_.bind(this.onChangeColor,this)),this.colorNew=$("#field-new-color"),this.colorSaved=$("#field-start-color"),this.spinR=new Common.UI.MetricSpinner({el:$("#extended-spin-r"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:1,maskExp:/[0-9]/,allowDecimal:!1}),this.spinG=new Common.UI.MetricSpinner({el:$("#extended-spin-g"),step:1,width:63,value:"0",defaultUnit:"",maxValue:255,minValue:0,tabindex:2,maskExp:/[0-9]/,allowDecimal:!1}),this.spinB=new Common.UI.MetricSpinner({el:$("#extended-spin-b"),
itemTemplate:_.template(['<div class="style" id="<%= id %>">','<img src="<%= imageUrl %>" width="'+this.itemWidth+'" height="'+this.itemHeight+'"/>','<% if (typeof title !== "undefined") {%>','<span class="title"><%= title %></span>',"<% } %>","</div>"].join(""))}),setInterval(_.bind(this.checkSize,this),500),this.options.el&&this.render()},render:function(t){if(!this.rendered){var e=this;e.trigger("render:before",e),e.cmpEl=$(e.el);var i=e.template({id:e.id,cls:e.cls,style:e.style});t?(e.setElement(t,!1),e.cmpEl=$(i),t.html(e.cmpEl)):e.cmpEl.html(i),e.rootWidth=e.cmpEl.width(),e.rootHeight=e.cmpEl.height(),e.fieldPicker.render($(".view",e.cmpEl)),e.openButton.render($(".button",e.cmpEl)),e.menuPicker.render($(".menu-picker-container",e.cmpEl)),e.openButton.menu.cmpEl&&e.openButton.menu.cmpEl&&(e.openButton.menu.menuAlignEl=e.cmpEl,e.openButton.menu.cmpEl.css("min-width",e.itemWidth),e.openButton.menu.on("show:before",_.bind(e.onBeforeShowMenu,e)),e.openButton.menu.on("show:after",_.bind(e.onAfterShowMenu,e)),e.openButton.cmpEl.on("hide.bs.dropdown",_.bind(e.onBeforeHideMenu,e)),e.openButton.cmpEl.on("hidden.bs.dropdown",_.bind(e.onAfterHideMenu,e))),e.options.hint&&(e.cmpEl.attr("data-toggle","tooltip"),e.cmpEl.tooltip({title:e.options.hint,placement:e.options.hintAnchor||"cursor"})),e.fieldPicker.on("item:select",_.bind(e.onFieldPickerSelect,e)),e.menuPicker.on("item:select",_.bind(e.onMenuPickerSelect,e)),e.fieldPicker.on("item:click",_.bind(e.onFieldPickerClick,e)),e.menuPicker.on("item:click",_.bind(e.onMenuPickerClick,e)),e.fieldPicker.on("item:contextmenu",_.bind(e.onPickerItemContextMenu,e)),e.menuPicker.on("item:contextmenu",_.bind(e.onPickerItemContextMenu,e)),e.fieldPicker.el.addEventListener("contextmenu",_.bind(e.onPickerComboContextMenu,e),!1),e.menuPicker.el.addEventListener("contextmenu",_.bind(e.onPickerComboContextMenu,e),!1),e.onResize(),e.rendered=!0,e.trigger("render:after",e)}return this},checkSize:function(){if(this.cmpEl&&this.cmpEl.is(":visible")){var t=this,e=this.cmpEl.width(),i=this.cmpEl.height();this.rootWidth==e&&this.rootHeight==i||(this.rootWidth=e,this.rootHeight=i,setTimeout(function(){t.openButton.menu.cmpEl.outerWidth(),t.rootWidth=t.cmpEl.width()},10),this.onResize())}},onResize:function(){if(this.openButton){var t=$("button",this.openButton.cmpEl);t&&t.css({width:$(".button",this.cmpEl).width(),height:$(".button",this.cmpEl).height()}),this.openButton.menu.hide();var e=this.menuPicker;if(e){var i=e.getSelectedRec();i&&(i=i[0],this.fillComboView(i||e.store.at(0),!!i,!0)),e.onResize()}}this.isSuspendEvents||this.trigger("resize",this)},onBeforeShowMenu:function(t){var e=this;if(_.isFunction(e.beforeOpenHandler))e.beforeOpenHandler(e,t);else if(e.openButton.menu.cmpEl){var i=0;try{var n=$($(".dropdown-menu .dataview.inner .style",e.cmpEl)[0]);i=n?parseInt(n.css("margin-left"))+parseInt(n.css("margin-right")):0}catch(t){}e.openButton.menu.cmpEl.css({width:Math.round((e.cmpEl.width()+i*e.fieldPicker.store.length)/e.itemWidth-.2)*(e.itemWidth+i),"min-height":this.cmpEl.height()})}if(e.options.hint){var o=e.cmpEl.data("bs.tooltip");o&&(void 0===o.dontShow&&(o.dontShow=!0),o.hide())}this.menuPicker.selectedBeforeHideRec=null},onBeforeHideMenu:function(t){if(this.trigger("hide:before",this,t),Common.UI.Scroller.isMouseCapture()&&t.preventDefault(),this.isStylesNotClosable)return!1},onAfterShowMenu:function(t){var e=this;e.menuPicker.scroller&&e.menuPicker.scroller.update({includePadding:!0,suppressScrollX:!0,alwaysVisibleY:!0})},onAfterHideMenu:function(t,e){this.menuPicker.selectedBeforeHideRec=this.menuPicker.getSelectedRec()[0],this.showLast?this.menuPicker.showLastSelected():this.menuPicker.deselectAll(),this.trigger("hide:after",this,t,e)},onFieldPickerSelect:function(t,e,i){},onMenuPickerSelect:function(t,e,i,n){this.needFillComboView=this.disabled,this.disabled||!0===n||(this.fillComboView(i,!1),i&&!this.isSuspendEvents&&this.trigger("select",this,i))},onFieldPickerClick:function(t,e,i){if(!this.disabled){if(this.isSuspendEvents||this.trigger("click",this,i),this.options.hint){var n=
icls:"btn-align-right",checkable:!0,allowDepress:!0,toggleGroup:"halignGroup",value:"right"},{caption:n.tipAlignJust,iconCls:"mnu-align-just",icls:"btn-align-just",checkable:!0,allowDepress:!0,toggleGroup:"halignGroup",value:"justify"}]})}),n.btnVerticalAlign=new Common.UI.Button({id:"id-toolbar-btn-valign",cls:"btn-toolbar",iconCls:"btn-valign-bottom",icls:"btn-valign-bottom",lock:[o.editCell,o.selChart,o.selChartText,o.lostConnect,o.coAuth,o.coAuthText],menu:new Common.UI.Menu({items:[{caption:n.tipAlignTop,iconCls:"mnu-valign-top",icls:"btn-valign-top",checkable:!0,allowDepress:!0,toggleGroup:"valignGroup",value:"top"},{caption:n.tipAlignCenter,iconCls:"mnu-valign-middle",icls:"btn-valign-middle",checkable:!0,allowDepress:!0,toggleGroup:"valignGroup",value:"center"},{caption:n.tipAlignBottom,iconCls:"mnu-valign-bottom",icls:"btn-valign-bottom",checkable:!0,allowDepress:!0,checked:!0,toggleGroup:"valignGroup",value:"bottom"}]})}),n.btnAutofilter=new Common.UI.Button({id:"id-toolbar-btn-autofilter",cls:"btn-toolbar",iconCls:"btn-autofilter",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.lostConnect,o.coAuth,o.ruleFilter],menu:new Common.UI.Menu({items:[n.mnuitemSortAZ=new Common.UI.MenuItem({caption:n.txtSortAZ,iconCls:"mnu-sort-asc",lock:[o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleFilter],value:Asc.c_oAscSortOptions.Ascending}),n.mnuitemSortZA=new Common.UI.MenuItem({caption:n.txtSortZA,iconCls:"mnu-sort-desc",lock:[o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleFilter],value:Asc.c_oAscSortOptions.Descending}),n.mnuitemAutoFilter=new Common.UI.MenuItem({caption:n.txtFilter,iconCls:"mnu-filter-add",checkable:!0,lock:[o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleFilter],value:"set-filter"}),n.mnuitemClearFilter=new Common.UI.MenuItem({caption:n.txtClearFilter,iconCls:"mnu-filter-clear",lock:[o.editCell,o.selChart,o.selChartText,o.selShape,o.selShapeText,o.selImage,o.coAuth,o.ruleDelFilter],value:"clear-filter"})]})}),n.lockControls=[n.cmbFontName,n.cmbFontSize,n.btnIncFontSize,n.btnDecFontSize,n.btnBold,n.btnItalic,n.btnUnderline,n.btnTextColor,n.btnHorizontalAlign,n.btnAlignLeft,n.btnAlignCenter,n.btnAlignRight,n.btnAlignJust,n.btnVerticalAlign,n.btnAlignTop,n.btnAlignMiddle,n.btnAlignBottom,n.btnWrap,n.btnTextOrient,n.btnBackColor,n.btnMerge,n.btnInsertFormula,n.btnNamedRange,n.btnIncDecimal,n.btnInsertShape,n.btnInsertEquation,n.btnInsertText,n.btnSortUp,n.btnSortDown,n.btnSetAutofilter,n.btnClearAutofilter,n.btnTableTemplate,n.btnPercentStyle,n.btnCurrencyStyle,n.btnDecDecimal,n.btnAddCell,n.btnDeleteCell,n.cmbNumberFormat,n.btnBorders,n.btnInsertImage,n.btnInsertHyperlink,n.btnInsertChart,n.btnColorSchemas,n.btnAutofilter,n.btnCopy,n.btnPaste,n.btnSettings,n.listStyles,n.btnPrint,n.btnShowMode,n.btnClearStyle,n.btnCopyStyle];var r=Common.localStorage.getItem("sse-hide-synch");n.showSynchTip=!(r&&1==parseInt(r)),n.needShowSynchTip=!1;var l=[n.cmbFontName,n.cmbFontSize,n.btnAlignLeft,n.btnAlignCenter,n.btnAlignRight,n.btnAlignJust,n.btnAlignTop,n.btnAlignMiddle,n.btnAlignBottom,n.btnHorizontalAlign,n.btnVerticalAlign,n.btnInsertImage,n.btnInsertText,n.btnInsertShape,n.btnInsertEquation,n.btnIncFontSize,n.btnDecFontSize,n.btnBold,n.btnItalic,n.btnUnderline,n.btnTextColor,n.btnBackColor,n.btnInsertHyperlink,n.btnBorders,n.btnTextOrient,n.btnPercentStyle,n.btnCurrencyStyle,n.btnColorSchemas,n.btnSettings,n.btnInsertFormula,n.btnNamedRange,n.btnDecDecimal,n.btnIncDecimal,n.cmbNumberFormat,n.btnWrap,n.btnInsertChart,n.btnMerge,n.btnAddCell,n.btnDeleteCell,n.btnShowMode,n.btnPrint,n.btnAutofilter,n.btnSortUp,n.btnSortDown,n.btnTableTemplate,n.btnSetAutofilter,n.btnClearAutofilter,n.btnSave,n.btnClearStyle,n.btnCopyStyle,n.btnCopy,n.btnPaste];return e.each(l,function(t){t&&e.isFunction(t.setDisabled)&&t.setDisabled(!0)}),this},lockToolbar:function(t,i,n){function o(t,n){if(e.contains(t.options.lock,n)){var o=t.keepState.indexOf(n);i?o<0&&t.keepState.push(n):o<0||t.keepState.splice(o,1)}}!n&&(
define("spreadsheeteditor/main/app/model/TableTemplate",["backbone"],function(t){"use strict";SSE.Models=SSE.Models||{},SSE.Models.TableTemplate=t.Model.extend({defaults:function(){return{id:Common.UI.getId(),name:null,caption:null,type:null,imageUrl:null}}})}),define("spreadsheeteditor/main/app/collection/TableTemplates",["backbone","spreadsheeteditor/main/app/model/TableTemplate"],function(t){"use strict";if(void 0===e)var e={};e.Collections=e.Collections||{},SSE.Collections.TableTemplates=t.Collection.extend({model:SSE.Models.TableTemplate})}),void 0===Common)var Common={};if(define("spreadsheeteditor/main/app/view/TableOptionsDialog",["common/main/lib/component/ComboBox","common/main/lib/component/CheckBox","common/main/lib/component/InputField","common/main/lib/component/Window"],function(){"use strict";SSE.Views.TableOptionsDialog=Common.UI.Window.extend(_.extend({options:{width:350,cls:"modal-dlg",modal:!1},initialize:function(t){_.extend(this.options,{title:this.txtFormat},t),this.template=['<div class="box">','<div id="id-dlg-tableoptions-range" class="input-row" style="margin-bottom: 5px;"></div>','<div class="input-row" id="id-dlg-tableoptions-title" style="margin-top: 5px;"></div>',"</div>",'<div class="footer right">','<button class="btn normal dlg-btn primary" result="ok" style="margin-right: 10px;">'+this.okButtonText+"</button>",'<button class="btn normal dlg-btn" result="cancel">'+this.cancelButtonText+"</button>","</div>"].join(""),this.options.tpl=_.template(this.template,this.options),this.checkRangeType=Asc.c_oAscSelectionDialogType.FormatTable,Common.UI.Window.prototype.initialize.call(this,this.options)},render:function(){Common.UI.Window.prototype.render.call(this);var t=this.getChild(),e=this;e.inputRange=new Common.UI.InputField({el:$("#id-dlg-tableoptions-range"),name:"range",style:"width: 100%;",allowBlank:!1,blankError:this.txtEmpty,validateOnChange:!0}),e.cbTitle=new Common.UI.CheckBox({el:$("#id-dlg-tableoptions-title"),labelText:this.txtTitle}),t.find(".dlg-btn").on("click",_.bind(this.onBtnClick,this)),e.inputRange.cmpEl.find("input").on("keypress",_.bind(this.onKeyPress,this)),this.on("close",_.bind(this.onClose,this))},onPrimary:function(){return this._handleInput("ok"),!1},setSettings:function(t){var e=this;if(t.api){if(e.api=t.api,t.range)e.cbTitle.setVisible(!1),e.setHeight(130),e.checkRangeType=Asc.c_oAscSelectionDialogType.FormatTableChangeRange,e.inputRange.setValue(t.range),e.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable,t.range);else{var i=e.api.asc_getAddFormatTableOptions();e.inputRange.setValue(i.asc_getRange()),e.cbTitle.setValue(i.asc_getIsTitle()),e.api.asc_setSelectionDialogMode(Asc.c_oAscSelectionDialogType.FormatTable,i.asc_getRange())}t.title&&e.setTitle(t.title),e.api.asc_unregisterCallback("asc_onSelectionRangeChanged",_.bind(e.onApiRangeChanged,e)),e.api.asc_registerCallback("asc_onSelectionRangeChanged",_.bind(e.onApiRangeChanged,e)),Common.NotificationCenter.trigger("cells:range",Asc.c_oAscSelectionDialogType.FormatTable)}e.inputRange.validation=function(t){return e.api.asc_checkDataRange(e.checkRangeType,t,!1)!=Asc.c_oAscError.ID.DataRangeError||e.txtInvalidRange}},getSettings:function(){if(this.checkRangeType==Asc.c_oAscSelectionDialogType.FormatTable){var t=this.api.asc_getAddFormatTableOptions(this.inputRange.getValue());return t.asc_setIsTitle(this.cbTitle.checked),t}return this.inputRange.getValue()},onApiRangeChanged:function(t){this.inputRange.setValue(t),this.inputRange.cmpEl.hasClass("error")&&this.inputRange.cmpEl.removeClass("error")},isRangeValid:function(){var t=this.api.asc_checkDataRange(this.checkRangeType,this.inputRange.getValue(),!0);return t==Asc.c_oAscError.ID.No||(t==Asc.c_oAscError.ID.AutoFilterDataRangeError?Common.UI.warning({msg:this.errorAutoFilterDataRange}):t==Asc.c_oAscError.ID.FTChangeTableRangeError?Common.UI.warning({msg:this.errorFTChangeTableRangeError}):t==Asc.c_oAscError.ID.FTRangeIncludedOtherTables&&Common.UI.warning({msg:this.errorFTRangeIncludedOtherTables}),!1)},onBtnClick:function(t){this._ha
define("spreadsheeteditor/main/app/controller/Toolbar",["core","common/main/lib/component/Window","common/main/lib/view/CopyWarningDialog","common/main/lib/view/ImageFromUrlDialog","common/main/lib/util/define","spreadsheeteditor/main/app/view/Toolbar","spreadsheeteditor/main/app/collection/TableTemplates","spreadsheeteditor/main/app/view/HyperlinkSettingsDialog","spreadsheeteditor/main/app/view/TableOptionsDialog","spreadsheeteditor/main/app/view/NamedRangeEditDlg","spreadsheeteditor/main/app/view/NamedRangePasteDlg","spreadsheeteditor/main/app/view/NameManagerDlg","spreadsheeteditor/main/app/view/FormatSettingsDialog"],function(){"use strict";SSE.Controllers.Toolbar=Backbone.Controller.extend(_.extend({models:[],collections:[],views:["Toolbar"],initialize:function(){var t=this;this.addListeners({Statusbar:{"sheet:changed":_.bind(this.onApiSheetChanged,this)},LeftMenu:{"settings:apply":_.bind(this.applyFormulaSettings,this)}}),this.editMode=!0,this._isAddingShape=!1,this._state={prstyle:void 0,clrtext:void 0,pralign:void 0,clrback:void 0,valign:void 0,can_undo:void 0,can_redo:void 0,bold:void 0,italic:void 0,underline:void 0,wrap:void 0,merge:void 0,angle:void 0,controlsdisabled:{rows:void 0,cols:void 0,cells_right:void 0,cells_down:void 0,filters:void 0},selection_type:void 0,filter:void 0,filterapplied:!1,tablestylename:void 0,tablename:void 0,namedrange_locked:!1,fontsize:void 0,multiselect:!1,sparklines_disabled:!1,numformatinfo:void 0,numformattype:void 0,numformat:void 0,langId:void 0};var e=function(e,i){var n=$(e.target),o=n.closest("#editor_sdk"),s=n.closest("button").attr("id");void 0===s&&(s=n.closest(".btn-group").attr("id")),t.api&&t.api.asc_isAddAutoshape()&&(o.length<=0||"cancel"==i)&&(t.toolbar.btnInsertText.pressed&&s!=t.toolbar.btnInsertText.id||t.toolbar.btnInsertShape.pressed&&s!=t.toolbar.btnInsertShape.id?(t._isAddingShape=!1,t._addAutoshape(!1),t.toolbar.btnInsertShape.toggle(!1,!0),t.toolbar.btnInsertText.toggle(!1,!0),Common.NotificationCenter.trigger("edit:complete",t.toolbar)):t.toolbar.btnInsertShape.pressed&&s==t.toolbar.btnInsertShape.id&&_.defer(function(){t.api.asc_endAddShape(),Common.NotificationCenter.trigger("edit:complete",t.toolbar)},100))};this.checkInsertAutoshape=function(t){e({},t.action)},this._addAutoshape=function(t,i){this.api&&(t?(this.api.asc_startAddShape(i),$(document.body).on("mouseup",e)):(this.api.asc_endAddShape(),$(document.body).off("mouseup",e)))},this.onApiEndAddShape=function(){this.toolbar.btnInsertShape.pressed&&this.toolbar.btnInsertShape.toggle(!1,!0),this.toolbar.btnInsertText.pressed&&this.toolbar.btnInsertText.toggle(!1,!0),$(document.body).off("mouseup",e)}},onLaunch:function(){this.toolbar=this.createView("Toolbar")},onToolbarAfterRender:function(t){t.btnNewDocument.on("click",_.bind(this.onNewDocument,this)),t.btnOpenDocument.on("click",_.bind(this.onOpenDocument,this)),t.btnPrint.on("click",_.bind(this.onPrint,this)),t.btnSave.on("click",_.bind(this.onSave,this)),t.btnUndo.on("click",_.bind(this.onUndo,this)),t.btnRedo.on("click",_.bind(this.onRedo,this)),t.btnCopy.on("click",_.bind(this.onCopyPaste,this,!0)),t.btnPaste.on("click",_.bind(this.onCopyPaste,this,!1)),t.btnIncFontSize.on("click",_.bind(this.onIncreaseFontSize,this)),t.btnDecFontSize.on("click",_.bind(this.onDecreaseFontSize,this)),t.btnBold.on("click",_.bind(this.onBold,this)),t.btnItalic.on("click",_.bind(this.onItalic,this)),t.btnUnderline.on("click",_.bind(this.onUnderline,this)),t.btnTextColor.on("click",_.bind(this.onTextColor,this)),t.btnBackColor.on("click",_.bind(this.onBackColor,this)),t.mnuTextColorPicker.on("select",_.bind(this.onTextColorSelect,this)),t.mnuBackColorPicker.on("select",_.bind(this.onBackColorSelect,this)),t.btnBorders.on("click",_.bind(this.onBorders,this)),t.btnBorders.rendered&&(t.btnBorders.menu.on("item:click",_.bind(this.onBordersMenu,this)),t.mnuBorderWidth.on("item:toggle",_.bind(this.onBordersWidth,this)),t.mnuBorderColorPicker.on("select",_.bind(this.onBordersColor,this))),t.btnAlignLeft.on("click",_.bind(this.onHorizontalAlign,this,"left")),t.btnAlign
Common.NotificationCenter.trigger("edit:complete",this.toolbar,{restorefocus:!0}),Common.component.Analytics.trackEvent("ToolBar","Font Size")},onFontSizeChanged:function(t,e,i,n){var o;if(t){if(!e.store.findWhere({displayValue:i.value})&&!(o=/^\+?(\d*\.?\d+)$|^\+?(\d+\.?\d*)$/.exec(i.value)))return o=this._getApiTextSize(),Common.UI.warning({msg:this.textFontSizeErr,callback:function(){_.defer(function(t){$("input",e.cmpEl).focus()})}}),e.setRawValue(o),n.preventDefault(),!1}else o=parseFloat(i.value),o=o>409?409:o<1?1:Math.floor(2*(o+.4))/2,e.setRawValue(o),this._state.fontsize=void 0,this.api&&this.api.asc_setCellFontSize(o),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onAdvSettingsClick:function(t,e){this.toolbar.fireEvent("file:settings",this),t.cmpEl.blur()},onZoomInClick:function(t){if(this.api){var e=Math.floor(10*this.api.asc_getZoom())/10;e+=.1,e>0&&!(e>2)&&this.api.asc_setZoom(e)}Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onZoomOutClick:function(t){if(this.api){var e=Math.ceil(10*this.api.asc_getZoom())/10;e-=.1,e<.5||this.api.asc_setZoom(e)}Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onHideMenu:function(t,e){var i,n={};switch(e.value){case"title":n.title=e.checked,i="sse-hidden-title";break;case"formula":n.formula=e.checked,i="sse-hidden-formula";break;case"headings":n.headings=e.checked;break;case"gridlines":n.gridlines=e.checked;break;case"freezepanes":n.freezepanes=e.checked}this.hideElements(n),i&&Common.localStorage.setItem(i,e.checked),Common.NotificationCenter.trigger("edit:complete",this.toolbar)},onListStyleSelect:function(t,e){this._state.prstyle=void 0,this.api&&(this.api.asc_setCellStyle(e.get("name")),Common.NotificationCenter.trigger("edit:complete",this.toolbar),Common.component.Analytics.trackEvent("ToolBar","Style"))},createDelayedElements:function(){var t=this;this.toolbar.createDelayedElements(),this.onToolbarAfterRender(this.toolbar),this.api.asc_registerCallback("asc_onShowChartDialog",_.bind(this.onApiChartDblClick,this)),this.api.asc_registerCallback("asc_onCanUndoChanged",_.bind(this.onApiCanRevert,this,"undo")),this.api.asc_registerCallback("asc_onCanRedoChanged",_.bind(this.onApiCanRevert,this,"redo")),this.api.asc_registerCallback("asc_onEditCell",_.bind(this.onApiEditCell,this)),this.api.asc_registerCallback("asc_onEndAddShape",_.bind(this.onApiEndAddShape,this)),this.api.asc_registerCallback("asc_onSheetsChanged",_.bind(this.onApiSheetChanged,this)),this.api.asc_registerCallback("asc_onStopFormatPainter",_.bind(this.onApiStyleChange,this)),this.api.asc_registerCallback("asc_onUpdateSheetViewSettings",_.bind(this.onApiSheetChanged,this)),Common.util.Shortcuts.delegateShortcuts({shortcuts:{"command+l,ctrl+l":function(e){if(t.editMode&&!t._state.multiselect){var i=t.api.asc_getCellInfo().asc_getFormatTableInfo();if(!i){_.isUndefined(t.toolbar.mnuTableTemplatePicker)&&t.onApiInitTableTemplates(t.api.asc_getTablePictures(i));var n=t.getCollection("TableTemplates");t._setTableFormat(n.at(23).get("name"))}}return!1},"command+shift+l,ctrl+shift+l":function(e){var i=t._state.filter;return t._state.filter=void 0,t.editMode&&t.api&&!t._state.multiselect&&(t._state.tablename||i?t.api.asc_changeAutoFilter(t._state.tablename,Asc.c_oAscChangeFilterOptions.filter,!i):t.api.asc_addAutoFilter()),!1},"command+s,ctrl+s":function(e){t.onSave(),e.preventDefault(),e.stopPropagation()},"command+k,ctrl+k":function(e){!t.editMode||t.toolbar.mode.isEditMailMerge||t.toolbar.mode.isEditDiagram||t.api.isCellEdited||t._state.multiselect||t.onHyperlink(),e.preventDefault()},"command+1,ctrl+1":function(e){return!t.editMode||t.toolbar.mode.isEditMailMerge||t.api.isCellEdited||t.toolbar.cmbNumberFormat.isDisabled()||t.onCustomNumberFormat(),!1}}}),this.wrapOnSelectionChanged=_.bind(this.onApiSelectionChanged,this),this.api.asc_registerCallback("asc_onSelectionChanged",this.wrapOnSelectionChanged),this.onApiSelectionChanged(this.api.asc_getCellInfo()),this.api.asc_registerCallback("asc_onEditorSelectionChanged",_.bind(this.onApiEditorSelectionChanged,th
onSetupCopyStyleButton:function(){this.modeAlwaysSetStyle=!1;var t={kOff:0,kOn:1,kMultiple:2},e=this;Common.NotificationCenter.on({"edit:complete":function(){e.api&&e.modeAlwaysSetStyle&&(e.api.asc_formatPainter(t.kOff),e.toolbar.btnCopyStyle.toggle(!1,!0),e.modeAlwaysSetStyle=!1)}}),$(e.toolbar.btnCopyStyle.cmpEl).dblclick(function(){e.api&&(e.modeAlwaysSetStyle=!0,e.toolbar.btnCopyStyle.toggle(!0,!0),e.api.asc_formatPainter(t.kMultiple))})},onCellsRange:function(t){this.api.isRangeSelection=t!=Asc.c_oAscSelectionDialogType.None,this.onApiEditCell(this.api.isRangeSelection?Asc.c_oAscCellEditorState.editStart:Asc.c_oAscCellEditorState.editEnd);var e=this.toolbar;e.lockToolbar(SSE.enumLock.selRange,this.api.isRangeSelection),this.setDisabledComponents([e.btnUndo],this.api.isRangeSelection||!this.api.asc_getCanUndo()),this.setDisabledComponents([e.btnRedo],this.api.isRangeSelection||!this.api.asc_getCanRedo()),this.onApiSelectionChanged(this.api.asc_getCellInfo())},onLockDefNameManager:function(t){this._state.namedrange_locked=t==Asc.c_oAscDefinedNameReason.LockDefNameManager},DisableToolbar:function(t){var e=$(".toolbar-mask");if(!(t&&e.length>0||!t&&0==e.length)){var i=this.toolbar;if(i.$el.find(".toolbar").toggleClass("masked",t),this.toolbar.lockToolbar(SSE.enumLock.menuFileOpen,t,{array:[i.btnShowMode]}),t){e=$("<div class='toolbar-mask'>").appendTo(i.$el);var n=i.isCompactView?75:i.mode.nativeApp?80:48;e.css("left",n+"px"),e.css("right",(i.isCompactView?0:45)+"px"),Common.util.Shortcuts.suspendEvents("command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+alt+h, ctrl+alt+h, command+1, ctrl+1")}else e.remove(),Common.util.Shortcuts.resumeEvents("command+l, ctrl+l, command+shift+l, ctrl+shift+l, command+k, ctrl+k, command+alt+h, ctrl+alt+h, command+1, ctrl+1")}},applyFormulaSettings:function(){for(var t=this.toolbar.btnInsertFormula.menu.items,e=0;e<Math.min(4,t.length);e++)t[e].setCaption(this.api.asc_getFormulaLocaleName(t[e].value))},textEmptyImgUrl:"You need to specify image URL.",warnMergeLostData:"Operation can destroy data in the selected cells.<br>Continue?",textWarning:"Warning",textFontSizeErr:"The entered value is incorrect.<br>Please enter a numeric value between 1 and 409",textCancel:"Cancel",confirmAddFontName:"The font you are going to save is not available on the current device.<br>The text style will be displayed using one of the device fonts, the saved font will be used when it is available.<br>Do you want to continue?",textSymbols:"Symbols",textFraction:"Fraction",textScript:"Script",textRadical:"Radical",textIntegral:"Integral",textLargeOperator:"Large Operator",textBracket:"Bracket",textFunction:"Function",textAccent:"Accent",textLimitAndLog:"Limit And Log",textOperator:"Operator",textMatrix:"Matrix",txtSymbol_pm:"Plus Minus",txtSymbol_infinity:"Infinity",txtSymbol_equals:"Equal",txtSymbol_neq:"Not Equal To",txtSymbol_about:"Approximately",txtSymbol_times:"Multiplication Sign",txtSymbol_div:"Division Sign",txtSymbol_factorial:"Factorial",txtSymbol_propto:"Proportional To",txtSymbol_less:"Less Than",txtSymbol_ll:"Much Less Than",txtSymbol_greater:"Greater Than",txtSymbol_gg:"Much Greater Than",txtSymbol_leq:"Less Than or Equal To",txtSymbol_geq:"Greater Than or Equal To",txtSymbol_mp:"Minus Plus",txtSymbol_cong:"Approximately Equal To",txtSymbol_approx:"Almost Equal To",txtSymbol_equiv:"Identical To",txtSymbol_forall:"For All",txtSymbol_additional:"Complement",txtSymbol_partial:"Partial Differential",txtSymbol_sqrt:"Radical Sign",txtSymbol_cbrt:"Cube Root",txtSymbol_qdrt:"Fourth Root",txtSymbol_cup:"Union",txtSymbol_cap:"Intersection",txtSymbol_emptyset:"Empty Set",txtSymbol_percent:"Percentage",txtSymbol_degree:"Degrees",txtSymbol_fahrenheit:"Degrees Fahrenheit",txtSymbol_celsius:"Degrees Celsius",txtSymbol_inc:"Increment",txtSymbol_nabla:"Nabla",txtSymbol_exists:"There Exist",txtSymbol_notexists:"There Does Not Exist",txtSymbol_in:"Element Of",txtSymbol_ni:"Contains as Member",txtSymbol_leftarrow:"Left Arrow",txtSymbol_uparrow:"Up Arrow",txtSymbol_rightarrow:"Right Arrow",tx
t.editMode&&t.rangeSelectionMode!==Asc.c_oAscSelectionDialogType.Chart&&t.rangeSelectionMode!==Asc.c_oAscSelectionDialogType.FormatTable&&t.fireEvent("sheet:changename")},this),"tab:move":_.bind(function(e,i){t.tabBarScroll={scrollLeft:t.tabbar.scrollX},_.isUndefined(i)||e===i||(e<i&&++i,t.fireEvent("sheet:move",[!1,!0,e,i]))},this)});var e=new Common.UI.Menu({maxHeight:260,menuAlign:"tl-tr"}).on("render:after",function(t){this.scroller=new Common.UI.Scroller({el:$(this.el).find(".dropdown-menu "),useKeyboard:this.enableKeyEvents&&!this.handleSelect,minScrollbarLength:40,alwaysVisibleY:!0})}).on("show:after",function(){this.scroller.update({alwaysVisibleY:!0})});e.on("item:click",function(e,i,n){t.fireEvent("show:hidden",[t,i.value])});var i=new Common.UI.Menu({menuAlign:"tl-tr",cls:"color-tab",items:[{template:_.template('<div id="id-tab-menu-color" style="width: 169px; height: 220px; margin: 10px;"></div>')},{template:_.template('<a id="id-tab-menu-new-color" style="padding-left:12px;">'+t.textNewColor+"</a>")}]});return t.mnuTabColor=function(){return{isDummy:!0,on:function(){}}}(),this.tabMenu=new Common.UI.Menu({menuAlign:"bl-tl",items:[{caption:this.itemInsert,value:"ins"},{caption:this.itemDelete,value:"del"},{caption:this.itemRename,value:"ren"},{caption:this.itemCopy,value:"copy"},{caption:this.itemMove,value:"move"},{caption:this.itemHide,value:"hide"},{caption:this.itemHidden,menu:e},{caption:this.itemTabColor,menu:i}]}).on("render:after",function(e){var i=$('<div class="btn-color-value-line"></div>');$("button:first-child",e.cmpEl).append(i),i.css("background-color",e.currentColor||"transparent"),t.mnuTabColor=new Common.UI.ThemeColorPalette({el:$("#id-tab-menu-color"),transparent:!0}),t.mnuTabColor.on("select",function(e,i){t.fireEvent("sheet:setcolor",[i])})}),this.tabbar.$el.append('<div class="dropdown-toggle" data-toggle="dropdown" style="width:0; height:0;"/>'),this.tabMenu.render(this.tabbar.$el),this.tabMenu.cmpEl.attr({tabindex:-1}),this.tabMenu.on("show:after",_.bind(this.onTabMenuAfterShow,this)),this.tabMenu.on("hide:after",_.bind(this.onTabMenuAfterHide,this)),this.tabMenu.on("item:click",_.bind(this.onTabMenuClick,this)),this.boxMath=$("#status-math-box",this.el),this.labelSum=$("#status-math-sum",this.boxMath),this.labelCount=$("#status-math-count",this.boxMath),this.labelAverage=$("#status-math-average",this.boxMath),this.boxMath.hide(),this.boxFiltered=$("#status-filtered-box",this.el),this.labelFiltered=$("#status-filtered-records",this.boxFiltered),this.boxFiltered.hide(),this.boxZoom=$("#status-zoom-box",this.el),this.boxZoom.find(".separator").css("border-left-color","transparent"),this},setApi:function(t){return this.api=t,this.api.asc_registerCallback("asc_onSheetsChanged",_.bind(this.update,this)),this.api.asc_registerCallback("asc_onAuthParticipantsChanged",_.bind(this.onApiUsersChanged,this)),this.api.asc_registerCallback("asc_onParticipantsChanged",_.bind(this.onApiUsersChanged,this)),this.api.asc_coAuthoringGetUsers(),this},setMode:function(t){this.mode=_.extend({},this.mode,t),this.btnAddWorksheet.setVisible(this.mode.isEdit),this.btnAddWorksheet.setDisabled(this.mode.isDisconnected),this.lblChangeRights[!this.mode.isOffline&&this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"](),this.panelUsers[!this.mode.isOffline&&this.mode.sharingSettingsUrl&&this.mode.sharingSettingsUrl.length?"show":"hide"](),this.updateTabbarBorders()},setVisible:function(t){t?this.show():this.hide()},update:function(){var t=this;if(this.tabbar.empty(!0),this.tabMenu.items[6].menu.removeAll(),this.tabMenu.items[6].hide(),this.btnAddWorksheet.setDisabled(!0),this.api){for(var e,i,n=this.api.asc_getWorksheetsCount(),o=-1,s=[],a=[],r=this.api.asc_getActiveWorksheetIndex();++o<n;)i=t.api.asc_isWorksheetLockedOrDeleted(o),e={sheetindex:o,active:r==o,label:t.api.asc_getWorksheetName(o),cls:i?"coauth-locked":"",isLockTheDrag:i},this.api.asc_isWorksheetHidden(o)?s.push(e):a.push(e);s.length&&(s.forEach(function(e){t.tabMenu.items[6].menu.addItem(new Common.UI.MenuItem({style:"white-spac
scope:this})),this.linkAdvanced=e("#paragraph-advanced-link")},setApi:function(t){return this.api=t,this.api&&this.api.asc_registerCallback("asc_onParaSpacingLine",i.bind(this._onLineSpacing,this)),this},onNumLineHeightChange:function(t,e,i,n){""!==this.cmbLineRule.getRawValue()&&(this.api&&this.api.asc_putPrLineSpacing(this.cmbLineRule.getValue(),this.cmbLineRule.getValue()==c_paragraphLinerule.LINERULE_AUTO?t.getNumberValue():Common.Utils.Metric.fnRecalcToMM(t.getNumberValue())),Common.NotificationCenter.trigger("edit:complete",this))},onNumSpacingBeforeChange:function(t,e,i,n){if(this.api){t.getNumberValue()<0?this.api.asc_putLineSpacingBeforeAfter(0,-1):this.api.asc_putLineSpacingBeforeAfter(0,Common.Utils.Metric.fnRecalcToMM(t.getNumberValue()))}Common.NotificationCenter.trigger("edit:complete",this)},onNumSpacingAfterChange:function(t,e,i,n){if(this.api){t.getNumberValue()<0?this.api.asc_putLineSpacingBeforeAfter(1,-1):this.api.asc_putLineSpacingBeforeAfter(1,Common.Utils.Metric.fnRecalcToMM(t.getNumberValue()))}Common.NotificationCenter.trigger("edit:complete",this)},onLineRuleSelect:function(t,e){this.api&&this.api.asc_putPrLineSpacing(e.value,e.defaultValue),this.numLineHeight.setDefaultUnit(e.defaultUnit),this.numLineHeight.setMinValue(e.minValue),this.numLineHeight.setStep(e.step),Common.NotificationCenter.trigger("edit:complete",this)},_onLineSpacing:function(t){if(!this._initSettings){var e=t.asc_getLineRule(),i=t.asc_getLine();if(this._state.LineRule!==e){var n,o=this.cmbLineRule.store.findWhere((n={},n.value=e,n));o||(o=this.cmbLineRule.store.at(0)),this.cmbLineRule.setValue(null!==e?e:""),this.numLineHeight.setMinValue(o.get("minValue")),this.numLineHeight.setDefaultUnit(o.get("defaultUnit")),this.numLineHeight.setStep(o.get("step")),this._state.LineRule=e}if(Math.abs(this._state.LineHeight-i)>.001||(null===this._state.LineHeight||null===i)&&this._state.LineHeight!==i){var s="";e==c_paragraphLinerule.LINERULE_AUTO?s=i:null!==e&&null!==i&&(s=Common.Utils.Metric.fnRecalcFromMM(i)),this.numLineHeight.setValue(null!==s?s:"",!0),this._state.LineHeight=i}}},ChangeSettings:function(t){if(this._initSettings&&this.createDelayedElements(),this.disableControls(this._locked),t){var e={Line:t.asc_getSpacing().asc_getLine(),Before:t.asc_getSpacing().asc_getBefore(),After:t.asc_getSpacing().asc_getAfter(),LineRule:t.asc_getSpacing().asc_getLineRule()};if(this._state.LineRule!==e.LineRule){var i,n=this.cmbLineRule.store.findWhere((i={},i.value=e.LineRule,i));n||(n=this.cmbLineRule.store.at(0)),this.cmbLineRule.setValue(null!==e.LineRule?e.LineRule:""),this.numLineHeight.setMinValue(n.get("minValue")),this.numLineHeight.setDefaultUnit(n.get("defaultUnit")),this.numLineHeight.setStep(n.get("step")),this._state.LineRule=e.LineRule}if(Math.abs(this._state.LineHeight-e.Line)>.001||(null===this._state.LineHeight||null===e.Line)&&this._state.LineHeight!==e.Line){var o="";e.LineRule==c_paragraphLinerule.LINERULE_AUTO?o=e.Line:null!==e.LineRule&&null!==e.Line&&(o=Common.Utils.Metric.fnRecalcFromMM(e.Line)),this.numLineHeight.setValue(null!==o?o:"",!0),this._state.LineHeight=e.Line}(Math.abs(this._state.LineSpacingBefore-e.Before)>.001||(null===this._state.LineSpacingBefore||null===e.Before)&&this._state.LineSpacingBefore!==e.Before)&&(this.numSpacingBefore.setValue(null!==e.Before?e.Before<0?e.Before:Common.Utils.Metric.fnRecalcFromMM(e.Before):"",!0),this._state.LineSpacingBefore=e.Before),(Math.abs(this._state.LineSpacingAfter-e.After)>.001||(null===this._state.LineSpacingAfter||null===e.After)&&this._state.LineSpacingAfter!==e.After)&&(this.numSpacingAfter.setValue(null!==e.After?e.After<0?e.After:Common.Utils.Metric.fnRecalcFromMM(e.After):"",!0),this._state.LineSpacingAfter=e.After)}},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.01)}if(this.cmbLineRule){var i=this.cmbLineRule.store.at(1);if(i.set({defaultUnit:Comm
return'<div id="id-chart-settings-dlg-style" class="settings-panel active">\r\n <div class="inner-content">\r\n <table cols="1" style="">\r\n <tr>\r\n <td class="padding-large">\r\n <label class="header"><%= scope.textType %></label>\r\n <div id="chart-dlg-button-type" style="margin-right: 15px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="separator horizontal padding-large"></div>\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td colspan=2 >\r\n <label class="header"><%= scope.textDataRange %></label>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="200">\r\n <div id="chart-dlg-txt-range" class="input-row" style="margin-right: 10px;"></div>\r\n </td>\r\n <td class="padding-small" style="text-align: right;">\r\n <button type="button" class="btn btn-text-default" id="chart-dlg-btn-data" style="min-width: 100px;width: auto;"><%= scope.textSelectData %></button>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan=2 class="padding-small">\r\n <label class="input-label"><%= scope.textDataSeries %></label>\r\n <div id="chart-dlg-combo-range" class="input-group-nr" style="width:120px;"></div>\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n</div>\r\n<div id="id-chart-settings-dlg-layout" class="settings-panel">\r\n <div class="inner-content">\r\n <table cols="2" style="width: 100%;">\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textChartTitle %></label>\r\n <div id="chart-dlg-combo-chart-title" class="input-group-nr" style="margin-right: 7px;"></div>\r\n </td>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label" style="margin-left: 7px;"><%= scope.textLegendPos %></label>\r\n <div id="chart-dlg-combo-legend-pos" class="input-group-nr" style="margin-left: 7px;" />\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textDataLabels %></label>\r\n <div id="chart-dlg-combo-data-labels" class="input-group-nr" style="margin-right: 7px;"></div>\r\n </td>\r\n <td rowspan="2" class="padding-small" width="50%">\r\n <div id="chart-dlg-check-series" style="margin: 20px 0 9px 7px;"></div>\r\n <div id="chart-dlg-check-category" style="margin: 0 0 9px 7px;"></div>\r\n <div id="chart-dlg-check-value" style="margin: 0 0 5px 7px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small" width="50%">\r\n <label class="input-label"><%= scope.textSeparator %></label>\r\n <div id="chart-dlg-txt-separator" class="input-row" style="margin-right: 7px;"/>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td width="50%">\r\n <label id="chart-dlg-label-lines" class="input-label"><%= scope.textLines %></label>\r\n <div id="chart-dlg-combo-lines" class="input-group-nr padding-small" style="margin-right: 7px;"></div>\r\n </td>\r\n <td style="vertical-align: bottom;" width="50%">\r\n <div id="chart-dlg-check-markers" style="margin: 0 0 12px 7px;"></div>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td colspan="2">\r\n <label class="header padding-small" style="padd
value:Asc.c_oAscChartLegendShowSettings.bottom,displayValue:this.textLegendBottom},{value:Asc.c_oAscChartLegendShowSettings.top,displayValue:this.textLegendTop},{value:Asc.c_oAscChartLegendShowSettings.right,displayValue:this.textLegendRight},{value:Asc.c_oAscChartLegendShowSettings.left,displayValue:this.textLegendLeft},{value:Asc.c_oAscChartLegendShowSettings.leftOverlay,displayValue:this.textLeftOverlay},{value:Asc.c_oAscChartLegendShowSettings.rightOverlay,displayValue:this.textRightOverlay}]}),this.cmbHorTitle=new Common.UI.ComboBox({el:$("#chart-dlg-combo-hor-title"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscChartHorAxisLabelShowSettings.none,displayValue:this.textNone},{value:Asc.c_oAscChartHorAxisLabelShowSettings.noOverlay,displayValue:this.textNoOverlay}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putHorAxisLabel(e.value)},this)),this.cmbVertTitle=new Common.UI.ComboBox({el:$("#chart-dlg-combo-vert-title"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscChartVertAxisLabelShowSettings.none,displayValue:this.textNone},{value:Asc.c_oAscChartVertAxisLabelShowSettings.rotated,displayValue:this.textRotated},{value:Asc.c_oAscChartVertAxisLabelShowSettings.horizontal,displayValue:this.textHorizontal}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putVertAxisLabel(e.value)},this)),this.cmbHorShow=new Common.UI.ComboBox({el:$("#chart-dlg-combo-hor-show"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:!0,displayValue:this.textShow},{value:!1,displayValue:this.textHide}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putShowHorAxis(e.value)},this)),this.cmbVertShow=new Common.UI.ComboBox({el:$("#chart-dlg-combo-vert-show"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:!0,displayValue:this.textShow},{value:!1,displayValue:this.textHide}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putShowVerAxis(e.value)},this)),this.cmbHorGrid=new Common.UI.ComboBox({el:$("#chart-dlg-combo-hor-grid"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscGridLinesSettings.none,displayValue:this.textNone},{value:Asc.c_oAscGridLinesSettings.major,displayValue:this.textMajor},{value:Asc.c_oAscGridLinesSettings.minor,displayValue:this.textMinor},{value:Asc.c_oAscGridLinesSettings.majorMinor,displayValue:this.textMajorMinor}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putHorGridLines(e.value)},this)),this.cmbVertGrid=new Common.UI.ComboBox({el:$("#chart-dlg-combo-vert-grid"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscGridLinesSettings.none,displayValue:this.textNone},{value:Asc.c_oAscGridLinesSettings.major,displayValue:this.textMajor},{value:Asc.c_oAscGridLinesSettings.minor,displayValue:this.textMinor},{value:Asc.c_oAscGridLinesSettings.majorMinor,displayValue:this.textMajorMinor}]}).on("selected",_.bind(function(t,e){this.chartSettings&&this.chartSettings.putVertGridLines(e.value)},this)),this.cmbDataLabels=new Common.UI.ComboBox({el:$("#chart-dlg-combo-data-labels"),menuStyle:"min-width: 140px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscChartDataLabelsPos.none,displayValue:this.textNone},{value:Asc.c_oAscChartDataLabelsPos.ctr,displayValue:this.textCenter},{value:Asc.c_oAscChartDataLabelsPos.inBase,displayValue:this.textInnerBottom},{value:Asc.c_oAscChartDataLabelsPos.inEnd,displayValue:this.textInnerTop},{value:Asc.c_oAscChartDataLabelsPos.outEnd,displayValue:this.textOuterTop}]}),this.cmbDataLabels.on("selected",_.bind(t.onSelectDataLabels,this)),this.txtSeparator=new Common.UI.InputField({el:$("#chart-dlg-txt-separator"),name:"range",style:"width: 100%;",allowBlank:!0,blankError:this.txtEmpty}),this.chSeriesName=new Common.UI.CheckBox({el:$("#chart-dlg-check-series"),labelText:this.textSeriesName}),this.chCategoryName=new Common.UI.CheckBox({el:$("#chart-dlg
this.updateDataLabels(this._state.ChartType,t.getDataLabelsPos()),this.chSeriesName.setValue(this.chartSettings.getShowSerName(),!0),this.chCategoryName.setValue(this.chartSettings.getShowCatName(),!0),this.chValue.setValue(this.chartSettings.getShowVal(),!0),n=t.getSeparator(),this.txtSeparator.setValue(n||""),this.vertAxisProps=t.getVertAxisProps(),this.horAxisProps=t.getHorAxisProps(),this.updateAxisProps(this._state.ChartType),this.currentChartType=this._state.ChartType,this.imageSettings&&(n=this.imageSettings.asc_getTitle(),this.inputAltTitle.setValue(n||""),n=this.imageSettings.asc_getDescription(),this.textareaAltDescription.val(n||""))}else{this._state.SparkType=t.asc_getType();var i=this.mnuSparkTypePicker.store.findWhere({type:this._state.SparkType});this.mnuSparkTypePicker.selectRecord(i,!0),i&&this.btnSparkType.setIconCls("item-chartlist "+i.get("iconCls")),this.updateSparkStyles(t.asc_getStyles()),this._state.SparkType!==Asc.c_oAscSparklineType.Line&&this._arrEmptyCells.pop(),this.cmbEmptyCells.setData(this._arrEmptyCells);var n=t.asc_getDisplayEmpty();this.cmbEmptyCells.setValue(this._state.SparkType!==Asc.c_oAscSparklineType.Line&&n==Asc.c_oAscEDispBlanksAs.Span?this.textEmptyLine:n),this.chShowEmpty.setValue(t.asc_getDisplayHidden(),!0),this.chShowAxis.setValue(t.asc_getDisplayXAxis(),!0),this.chReverse.setValue(t.asc_getRightToLeft(),!0),this.cmbSparkMinType.setValue(t.asc_getMinAxisType(),!0),this.cmbSparkMaxType.setValue(t.asc_getMaxAxisType(),!0),this.spnSparkMinValue.setDisabled(t.asc_getMinAxisType()!==Asc.c_oAscSparklineAxisMinMax.Custom),this.spnSparkMaxValue.setDisabled(t.asc_getMaxAxisType()!==Asc.c_oAscSparklineAxisMinMax.Custom),this.spnSparkMinValue.setValue(null!==t.asc_getManualMin()?t.asc_getManualMin():"",!0),this.spnSparkMaxValue.setValue(null!==t.asc_getManualMax()?t.asc_getManualMax():"",!0),this._changedProps=new Asc.sparklineGroup,this._noApply=!1}},getSettings:function(){var t,e=this.mnuChartTypePicker.getSelectedRec()[0].get("type");if(this.isChart){this.chartSettings.putType(e),this.chartSettings.putInColumns(1==this.cmbDataDirect.getValue()),this.chartSettings.putRange(this.txtDataRange.getValue()),this.chartSettings.putTitle(this.cmbChartTitle.getValue()),this.chartSettings.putLegendPos(this.cmbLegendPos.getValue()),this.chartSettings.putShowHorAxis(this.cmbHorShow.getValue()),this.chartSettings.putShowVerAxis(this.cmbVertShow.getValue()),this.chartSettings.putHorAxisLabel(this.cmbHorTitle.getValue()),this.chartSettings.putVertAxisLabel(this.cmbVertTitle.getValue()),this.chartSettings.putHorGridLines(this.cmbHorGrid.getValue()),this.chartSettings.putVertGridLines(this.cmbVertGrid.getValue()),this.chartSettings.putDataLabelsPos(this.cmbDataLabels.getValue()),this.chartSettings.putShowSerName("checked"==this.chSeriesName.getValue()),this.chartSettings.putShowCatName("checked"==this.chCategoryName.getValue()),this.chartSettings.putShowVal("checked"==this.chValue.getValue()),this.chartSettings.putSeparator(_.isEmpty(this.txtSeparator.getValue())?" ":this.txtSeparator.getValue()),this.chartSettings.putShowMarker("checked"==this.chMarkers.getValue()),t=e==Asc.c_oAscChartTypeSettings.lineNormal||e==Asc.c_oAscChartTypeSettings.lineStacked||e==Asc.c_oAscChartTypeSettings.lineStackedPer||e==Asc.c_oAscChartTypeSettings.scatter,t&&(t=this.cmbLines.getValue(),this.chartSettings.putLine(0!==t),t>0&&this.chartSettings.putSmooth(2==t)),this.chartSettings.putVertAxisProps(this.vertAxisProps),this.chartSettings.putHorAxisProps(this.horAxisProps);var i=this.isAltTitleChanged||this.isAltDescChanged?new Asc.asc_CImgProperty:null;return this.isAltTitleChanged&&i.asc_putTitle(this.inputAltTitle.getValue()),this.isAltDescChanged&&i.asc_putDescription(this.textareaAltDescription.val()),{chartSettings:this.chartSettings,imageSettings:i}}return{chartSettings:this._changedProps}},isRangeValid:function(){if(this.isChart){var t;if(_.isEmpty(this.txtDataRange.getValue()))this.txtDataRange.showError([this.txtEmpty]);else if((t=this.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart,this.txtDataRange.
type:Asc.c_oAscChartTypeSettings.barNormal3d,iconCls:"column-3d-normal"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStacked3d,iconCls:"column-3d-stack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barStackedPer3d,iconCls:"column-3d-pstack"},{group:"menu-chart-group-bar",type:Asc.c_oAscChartTypeSettings.barNormal3dPerspective,iconCls:"column-3d-normal-per"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineNormal,iconCls:"line-normal"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStacked,iconCls:"line-stack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.lineStackedPer,iconCls:"line-pstack"},{group:"menu-chart-group-line",type:Asc.c_oAscChartTypeSettings.line3d,iconCls:"line-3d"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie,iconCls:"pie-normal"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.doughnut,iconCls:"pie-doughnut"},{group:"menu-chart-group-pie",type:Asc.c_oAscChartTypeSettings.pie3d,iconCls:"pie-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal,iconCls:"bar-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked,iconCls:"bar-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer,iconCls:"bar-pstack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarNormal3d,iconCls:"bar-3d-normal"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStacked3d,iconCls:"bar-3d-stack"},{group:"menu-chart-group-hbar",type:Asc.c_oAscChartTypeSettings.hBarStackedPer3d,iconCls:"bar-3d-pstack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaNormal,iconCls:"area-normal"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStacked,iconCls:"area-stack"},{group:"menu-chart-group-area",type:Asc.c_oAscChartTypeSettings.areaStackedPer,iconCls:"area-pstack"},{group:"menu-chart-group-scatter",type:Asc.c_oAscChartTypeSettings.scatter,iconCls:"point-normal"},{group:"menu-chart-group-stock",type:Asc.c_oAscChartTypeSettings.stock,iconCls:"stock-normal"}]),itemTemplate:i.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')})}),this.btnChartType.render(e("#chart-button-type")),this.mnuChartTypePicker.on("item:click",i.bind(this.onSelectType,this,this.btnChartType)),this.lockedControls.push(this.btnChartType),this.spnWidth=new Common.UI.MetricSpinner({el:e("#chart-spin-width"),step:.1,width:78,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnWidth),this.lockedControls.push(this.spnWidth),this.spnHeight=new Common.UI.MetricSpinner({el:e("#chart-spin-height"),step:.1,width:78,defaultUnit:"cm",value:"3 cm",maxValue:55.88,minValue:0}),this.spinners.push(this.spnHeight),this.lockedControls.push(this.spnHeight),this.spnWidth.on("change",i.bind(this.onWidthChange,this)),this.spnHeight.on("change",i.bind(this.onHeightChange,this)),this.btnRatio=new Common.UI.Button({cls:"btn-toolbar",iconCls:"advanced-btn-ratio",style:"margin-bottom: 1px;",enableToggle:!0,hint:this.textKeepRatio}),this.btnRatio.render(e("#chart-button-ratio")),this.lockedControls.push(this.btnRatio),this.btnRatio.on("click",i.bind(function(t,e){if(t.pressed&&this.spnHeight.getNumberValue()>0&&(this._nRatio=this.spnWidth.getNumberValue()/this.spnHeight.getNumberValue()),this.api){var i=new Asc.asc_CImgProperty;i.asc_putLockAspect(t.pressed),this.api.asc_setGraphicObjectProps(i)}},this)),this.btnSparkType=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-chartlist spark-column",menu:new Common.UI.Menu({style:"width: 200px; padding-top: 12px;",items:[{template:i.template('<div id="id-spark-menu-type" class="menu-insertchart" style="margin: 5px 5px 0 10px;"></div>')}]})}),this.btnSparkType.on("render:after",function(n){t.mnuSparkTypePicker=new Common.UI.DataView({el:e("#id-spark-menu-type"),parentMenu:n.menu,restoreHeight:120,allowScrollbar:!1,groups:new Common.UI.DataViewGroupStore([{id:"menu-chart-group-sparkcolumn",inlin
template:_.template(['<div class="btn-group" id="<%= id %>">','<button type="button" class="btn btn-color dropdown-toggle <%= cls %>" data-toggle="dropdown" style="<%= style %>">',"<span>&nbsp;</span>","</button>","</div>"].join("")),setColor:function(t){var e,i,n=$(this.cmpEl).find("button span");this.color=t,"transparent"==t?(e="#BEBEBE",i=t,n.addClass("color-transparent")):(e="transparent",i="object"==typeof t?"#"+t.color:"#"+t,n.removeClass("color-transparent")),n.css({"background-color":i,"border-color":e})}})}),void 0===Common)var Common={};if(define("common/main/lib/component/Slider",["common/main/lib/component/BaseView","underscore"],function(t,e){"use strict";Common.UI.SingleSlider=Common.UI.BaseView.extend({options:{width:100,minValue:0,maxValue:100,step:1,value:100,enableKeyEvents:!1},disabled:!1,template:e.template(['<div class="slider single-slider" style="">','<div class="track">','<div class="track-left img-commonctrl"></div>','<div class="track-center img-commonctrl"></div>','<div class="track-right img-commonctrl" style=""></div>',"</div>",'<div class="thumb img-commonctrl" style=""></div>',"<% if (this.options.enableKeyEvents) { %>",'<input type="text" style="position: absolute; top:-10px; width: 1px; height: 1px;">',"<% } %>","</div>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,t);var e=this;$(this.el);e.width=e.options.width,e.minValue=e.options.minValue,e.maxValue=e.options.maxValue,e.delta=100/(e.maxValue-e.minValue),e.step=e.options.step,e.options.el&&e.render(),this.setValue(e.options.value)},render:function(t){var i=this;i.rendered?this.cmpEl=$(this.el):(this.cmpEl=$(this.template({})),t?(this.setElement(t,!1),t.html(this.cmpEl)):$(this.el).html(this.cmpEl)),this.cmpEl.find(".track-center").width(i.options.width-14),this.cmpEl.width(i.options.width),this.thumb=this.cmpEl.find(".thumb");var n,o=function(t){t.preventDefault(),t.stopPropagation();var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100)));i.setThumbPosition(e),i.lastValue=i.value,i.value=e/i.delta+i.minValue,i.thumb.removeClass("active"),$(document).off("mouseup",o),$(document).off("mousemove",s),i._dragstart=void 0,i.trigger("changecomplete",i,i.value,i.lastValue)},s=function(t){if(!i.disabled&&void 0!==i._dragstart){t.preventDefault(),t.stopPropagation();var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left-i._dragstart)/i.width*100)));i.setThumbPosition(e),i.lastValue=i.value,i.value=e/i.delta+i.minValue,Math.abs(i.value-i.lastValue)>.001&&i.trigger("change",i,i.value,i.lastValue)}},a=function(t){i.disabled||(i._dragstart=t.pageX*Common.Utils.zoom()-i.thumb.offset().left-7,i.thumb.addClass("active"),$(document).on("mouseup",o),$(document).on("mousemove",s),i.options.enableKeyEvents&&setTimeout(function(){i.input.focus()},10))},r=function(t){if(!i.disabled){var e=Math.max(0,Math.min(100,Math.round((t.pageX*Common.Utils.zoom()-i.cmpEl.offset().left)/i.width*100)));i.setThumbPosition(e),i.lastValue=i.value,i.value=e/i.delta+i.minValue,i.trigger("change",i,i.value,i.lastValue),i.trigger("changecomplete",i,i.value,i.lastValue)}},l=function(t){i.lastValue=i.value,i.value=Math.max(i.minValue,Math.min(i.maxValue,i.value+(t?i.step:-i.step))),i.setThumbPosition(Math.round((i.value-i.minValue)*i.delta)),i.trigger("change",i,i.value,i.lastValue)},c=function(t){i.disabled||t.keyCode!=Common.UI.Keys.UP&&t.keyCode!=Common.UI.Keys.DOWN&&t.keyCode!=Common.UI.Keys.LEFT&&t.keyCode!=Common.UI.Keys.RIGHT||(t.preventDefault(),t.stopPropagation(),d.off("keydown","input",c),n=setInterval(e.bind(l,i,t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.RIGHT),100))},h=function(t){i.disabled||(t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.DOWN||Common.UI.Keys.LEFT||Common.UI.Keys.RIGHT)&&(t.stopPropagation(),t.preventDefault(),clearInterval(n),l(t.keyCode==Common.UI.Keys.UP||t.keyCode==Common.UI.Keys.RIGHT),d.on("keydown","input",c),i.trigger("changecomplete",i,i.value,i.lastValue))};if(!i.rendered){var d=
for(var i=e.asc_getLinejoin(),n=0;n<this._arrJoinType.length;n++)if(i==this._arrJoinType[n].value){this.cmbJoinType.setValue(i);break}for(i=e.asc_getLinecap(),n=0;n<this._arrCapType.length;n++)if(i==this._arrCapType[n].value){this.cmbCapType.setValue(i);break}var o=e.asc_getCanChangeArrows();if(this.btnBeginStyle.setDisabled(!o),this.btnEndStyle.setDisabled(!o),this.btnBeginSize.setDisabled(!o),this.btnEndSize.setDisabled(!o),o){i=e.asc_getLinebeginsize();var s=this.mnuBeginSizePicker.store.findWhere({type:i});s?this._beginSizeIdx=s.get("value"):(this._beginSizeIdx=null,this._selectStyleItem(this.btnBeginSize,null)),i=e.asc_getLinebeginstyle(),s=this.mnuBeginStylePicker.store.findWhere({type:i}),s?(this.mnuBeginStylePicker.selectRecord(s,!0),this._updateSizeArr(this.btnBeginSize,this.mnuBeginSizePicker,s,this._beginSizeIdx),this._selectStyleItem(this.btnBeginStyle,s)):this._selectStyleItem(this.btnBeginStyle,null),i=e.asc_getLineendsize(),s=this.mnuEndSizePicker.store.findWhere({type:i}),s?this._endSizeIdx=s.get("value"):(this._endSizeIdx=null,this._selectStyleItem(this.btnEndSize,null)),i=e.asc_getLineendstyle(),s=this.mnuEndStylePicker.store.findWhere({type:i}),s?(this.mnuEndStylePicker.selectRecord(s,!0),this._updateSizeArr(this.btnEndSize,this.mnuEndSizePicker,s,this._endSizeIdx),this._selectStyleItem(this.btnEndStyle,s)):this._selectStyleItem(this.btnEndStyle,null)}else this._selectStyleItem(this.btnBeginStyle),this._selectStyleItem(this.btnEndStyle),this._selectStyleItem(this.btnBeginSize),this._selectStyleItem(this.btnEndSize)}}},updateMetricUnit:function(){if(this.spinners)for(var t=0;t<this.spinners.length;t++){var e=this.spinners[t];e.setDefaultUnit(Common.Utils.Metric.getCurrentMetricName()),e.setStep(Common.Utils.Metric.getCurrentMetric()==Common.Utils.Metric.c_MetricUnits.pt?1:.01)}this.sizeMax={width:Common.Utils.Metric.fnRecalcFromMM(10*this.options.sizeMax.width),height:Common.Utils.Metric.fnRecalcFromMM(10*this.options.sizeMax.height)},this.options.sizeOriginal&&(this.sizeOriginal={width:Common.Utils.Metric.fnRecalcFromMM(this.options.sizeOriginal.width),height:Common.Utils.Metric.fnRecalcFromMM(this.options.sizeOriginal.height)})},_updateSizeArr:function(t,e,i,n){i.get("value")>0?(e.store.each(function(t){t.set({offsetx:80*i.get("value")+10})},this),t.setDisabled(!1),null!==n?(e.selectByIndex(n,!0),this._selectStyleItem(t,e.store.at(n))):this._selectStyleItem(t,null)):(this._selectStyleItem(t,null),t.setDisabled(!0))},_selectStyleItem:function(t,e){$(t.el).find(".form-control").css("background-position",(e?20-e.get("offsetx")+"px":"0")+" "+(e?"-"+e.get("offsety")+"px":"-30px"))},onSelectBeginStyle:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc_CShapeProperty),null===this._changedProps.asc_getShapeProperties().asc_getStroke()&&this._changedProps.asc_getShapeProperties().asc_putStroke(new Asc.asc_CStroke),this._changedProps.asc_getShapeProperties().asc_getStroke().asc_putLinebeginstyle(i.get("type"))),null!==this._beginSizeIdx&&void 0!==this._beginSizeIdx||(this._beginSizeIdx=4),this._updateSizeArr(this.btnBeginSize,this.mnuBeginSizePicker,i,this._beginSizeIdx),this._selectStyleItem(this.btnBeginStyle,i)},onSelectBeginSize:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc_CShapeProperty),null===this._changedProps.asc_getShapeProperties().asc_getStroke()&&this._changedProps.asc_getShapeProperties().asc_putStroke(new Asc.asc_CStroke),this._changedProps.asc_getShapeProperties().asc_getStroke().asc_putLinebeginsize(i.get("type"))),this._beginSizeIdx=i.get("value"),this._selectStyleItem(this.btnBeginSize,i)},onSelectEndStyle:function(t,e,i){this._changedProps&&(null!==this._changedProps.asc_getShapeProperties()&&void 0!==this._changedProps.asc_getShapeProperties()||this._changedProps.asc_putShapeProperties(new Asc.asc
if(this.btnBackColor.setColor(this.ShapeColor.Color),"object"==typeof this.ShapeColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.ShapeColor.Color.effectValue){this.colorsBack.select(this.ShapeColor.Color,!0),C=!0;break}C||this.colorsBack.clearSelection()}else this.colorsBack.select(this.ShapeColor.Color,!0);this._state.ShapeColor=this.ShapeColor.Color}var y,_=n.asc_getStroke(),x=_.asc_getType();if(_?(x==Asc.c_oAscStrokeType.STROKE_COLOR?(l=_.asc_getColor(),l?l.asc_getType()==Asc.c_oAscColor.COLOR_TYPE_SCHEME?this.BorderColor={Value:1,Color:{color:Common.Utils.ThemeColor.getHexColor(l.asc_getR(),l.asc_getG(),l.asc_getB()),effectValue:l.asc_getValue()}}:this.BorderColor={Value:1,Color:Common.Utils.ThemeColor.getHexColor(l.asc_getR(),l.asc_getG(),l.asc_getB())}:this.BorderColor={Value:1,Color:"transparent"}):this.BorderColor={Value:1,Color:"transparent"},y=_.asc_getPrstDash()):(x=null,this.BorderColor={Value:0,Color:"transparent"}),f=typeof this.BorderColor.Color,b=typeof this._state.StrokeColor,f!==b||"object"==f&&(this.BorderColor.Color.effectValue!==this._state.StrokeColor.effectValue||this._state.StrokeColor.color.indexOf(this.BorderColor.Color.color)<0)||"object"!=f&&(this._state.StrokeColor.indexOf(this.BorderColor.Color)<0||"object"==typeof this.btnBorderColor.color)){if(this.btnBorderColor.setColor(this.BorderColor.Color),"object"==typeof this.BorderColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.BorderColor.Color.effectValue){this.colorsBorder.select(this.BorderColor.Color,!0),C=!0;break}C||this.colorsBorder.clearSelection()}else this.colorsBorder.select(this.BorderColor.Color,!0);this._state.StrokeColor=this.BorderColor.Color}if(this._state.StrokeType!==x||x==Asc.c_oAscStrokeType.STROKE_COLOR){if(x==Asc.c_oAscStrokeType.STROKE_COLOR){var w=_.asc_getWidth(),S=Math.abs(this._state.StrokeWidth-w)<.001&&!new RegExp(this.txtPt+"\\s*$").test(this.cmbBorderSize.getRawValue());if(Math.abs(this._state.StrokeWidth-w)>.001||S||(null===this._state.StrokeWidth||null===w)&&this._state.StrokeWidth!==w){this._state.StrokeWidth=w,null!==w&&(w=this._mm2pt(w));var A=null===w?w:i.find(this.cmbBorderSize.store.models,function(t){if(w<t.attributes.value+.01&&w>t.attributes.value-.01)return!0});A?this.cmbBorderSize.selectRecord(A):this.cmbBorderSize.setValue(null!==w?parseFloat(w.toFixed(2))+" "+this.txtPt:""),this.BorderSize=w}}else x==Asc.c_oAscStrokeType.STROKE_NONE?(this._state.StrokeWidth=0,this.BorderSize=this.cmbBorderSize.store.at(0).get("value"),this.cmbBorderSize.setValue(this.BorderSize)):(this._state.StrokeWidth=null,this.BorderSize=-1,this.cmbBorderSize.setValue(null));this._state.StrokeType=x}if(this._state.StrokeBorderType!==y&&(this.BorderType=this._state.StrokeBorderType=y,this.cmbBorderType.setValue(y)),f=typeof this.FGColor.Color,b=typeof this._state.FGColor,f!==b||"object"==f&&(this.FGColor.Color.effectValue!==this._state.FGColor.effectValue||this._state.FGColor.color.indexOf(this.FGColor.Color.color)<0)||"object"!=f&&this._state.FGColor.indexOf(this.FGColor.Color)<0){if(this.btnFGColor.setColor(this.FGColor.Color),"object"==typeof this.FGColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.FGColor.Color.effectValue){this.colorsFG.select(this.FGColor.Color,!0),C=!0;break}C||this.colorsFG.clearSelection()}else this.colorsFG.select(this.FGColor.Color,!0);this._state.FGColor=this.FGColor.Color}if(f=typeof this.BGColor.Color,b=typeof this._state.BGColor,f!==b||"object"==f&&(this.BGColor.Color.effectValue!==this._state.BGColor.effectValue||this._state.BGColor.color.indexOf(this.BGColor.Color.color)<0)||"object"!=f&&this._state.BGColor.indexOf(this.BGColor.Color)<0){if(this.btnBGColor.setColor(this.BGColor.Color),"object"==typeof this.BGColor.Color){for(var C=!1,v=0;v<10;v++)if(Common.Utils.ThemeColor.ThemeValues[v]==this.BGColor.Color.effectValue){this.colorsBG.select(this.BGColor.Color,!0),C=!0;break}C||this.colorsBG.clearSelection()}else this.colorsBG.select(this.BGColor.Color,!0);this._state.BGColor=this.BGCo
this.FillImageContainer=e("#textart-panel-image-fill"),this.FillPatternContainer=e("#textart-panel-pattern-fill"),this.FillGradientContainer=e("#textart-panel-gradient-fill"),this.TransparencyContainer=e("#textart-panel-transparent-fill")},render:function(){e(this.el).html(this.template({scope:this}))},setApi:function(t){return this.api=t,this.api&&(this.api.asc_setInterfaceDrawImagePlaceTextArt("textart-texture-img"),this.api.asc_registerCallback("asc_onInitStandartTextures",i.bind(this.onInitStandartTextures,this))),this},onFillSrcSelect:function(t,e){switch(this.ShowHideElem(e.value),e.value){case Asc.c_oAscFill.FILL_TYPE_SOLID:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_SOLID,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_SOLID),n.asc_putFill(new Asc.asc_CFillSolid),n.asc_getFill().asc_putColor(Common.Utils.ThemeColor.getRgbColor("transparent"==this.ShapeColor.Color?{color:"4f81bd",effectId:24}:this.ShapeColor.Color)),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_GRAD:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_GRAD,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;if(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_GRAD),n.asc_putFill(new Asc.asc_CFillGrad),n.asc_getFill().asc_putGradType(this.GradFillType),this.GradFillType==Asc.c_oAscFillGradType.GRAD_LINEAR&&(n.asc_getFill().asc_putLinearAngle(6e4*this.GradLinearDirectionType),n.asc_getFill().asc_putLinearScale(!0)),this.OriginalFillType!==Asc.c_oAscFill.FILL_TYPE_GRAD){var o=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[0]).get_color().get_hex(),s=Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1]).get_color().get_hex();o="ffffff"===o&&"ffffff"===s?{color:"4f81bd",effectId:24}:this.GradColor.colors[0],n.asc_getFill().asc_putPositions([1e3*this.GradColor.values[0],1e3*this.GradColor.values[1]]),n.asc_getFill().asc_putColors([Common.Utils.ThemeColor.getRgbColor(o),Common.Utils.ThemeColor.getRgbColor(this.GradColor.colors[1])])}i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_BLIP:this._state.FillType=Asc.c_oAscFill.FILL_TYPE_BLIP;break;case Asc.c_oAscFill.FILL_TYPE_PATT:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_PATT,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_PATT),n.asc_putFill(new Asc.asc_CFillHatch),n.asc_getFill().asc_putPatternType(this.PatternFillType);var a=Common.Utils.ThemeColor.getRgbColor(this.FGColor.Color).get_color().get_hex();a="ffffff"===Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color).get_color().get_hex()&&"ffffff"===a?{color:"4f81bd",effectId:24}:this.FGColor.Color,n.asc_getFill().asc_putColorFg(Common.Utils.ThemeColor.getRgbColor(a)),n.asc_getFill().asc_putColorBg(Common.Utils.ThemeColor.getRgbColor(this.BGColor.Color)),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}break;case Asc.c_oAscFill.FILL_TYPE_NOFILL:if(this._state.FillType=Asc.c_oAscFill.FILL_TYPE_NOFILL,!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;n.asc_putType(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.asc_putFill(null),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.asc_setGraphicObjectProps(this.imgprops)}}Common.NotificationCenter.trigger("edit:complete",this)},onColorsBackSelect:function(t,e){if(this.btnBackColor.setColor(e),this.ShapeColor={Value:1,Color:e},this.api&&!this._noApply){var i=new Asc.asc_TextArtProperties,n=new Asc.asc_CShapeFill;"transparent"==this.ShapeColor.Color?(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_NOFILL),n.asc_putFill(null)):(n.asc_putType(Asc.c_oAscFill.FILL_TYPE_SOLID),n.asc_putFill(new Asc.asc_CFillSolid),n.asc_getFill().asc_putColor(Common.Utils.ThemeColor.getRgbColor(this.ShapeColor.Color))),i.asc_putFill(n),this.shapeprops.put_TextArtProperties(i),this.api.as
offsety:50,type:0,subtype:6,iconcls:"gradient-left",cls:"item-gradient-separator",selected:!0},{offsetx:100,offsety:50,type:180,subtype:1,iconcls:"gradient-right"},{offsetx:0,offsety:100,type:315,subtype:2,iconcls:"gradient-left-bottom"},{offsetx:50,offsety:100,type:270,subtype:3,iconcls:"gradient-bottom"},{offsetx:100,offsety:100,type:225,subtype:7,iconcls:"gradient-right-bottom"}],this._viewDataRadial=[{offsetx:100,offsety:150,type:2,subtype:5,iconcls:"gradient-radial-center"}],this.btnDirection=new Common.UI.Button({cls:"btn-large-dataview",iconCls:"item-gradient gradient-left",menu:new Common.UI.Menu({style:"min-width: 60px;",menuAlign:"tr-br",items:[{template:i.template('<div id="id-textart-menu-direction" style="width: 175px; margin: 0 5px;"></div>')}]})}),this.btnDirection.on("render:after",function(n){t.mnuDirectionPicker=new Common.UI.DataView({el:e("#id-textart-menu-direction"),parentMenu:n.menu,restoreHeight:174,store:new Common.UI.DataViewStore(t._viewDataLinear),itemTemplate:i.template('<div id="<%= id %>" class="item-gradient" style="background-position: -<%= offsetx %>px -<%= offsety %>px;"></div>')})}),this.btnDirection.render(e("#textart-button-direction")),this.mnuDirectionPicker.on("item:click",i.bind(this.onSelectGradient,this,this.btnDirection)),this.lockedControls.push(this.btnDirection),this.sldrGradient=new Common.UI.MultiSliderGradient({el:e("#textart-slider-gradient"),width:125,minValue:0,maxValue:100,values:[0,100]}),this.sldrGradient.on("change",i.bind(this.onGradientChange,this)),this.sldrGradient.on("changecomplete",i.bind(this.onGradientChangeComplete,this)),this.sldrGradient.on("thumbclick",function(e,i){t.GradColor.currentIdx=i;var n=t.GradColor.colors[t.GradColor.currentIdx];t.btnGradColor.setColor(n),t.colorsGrad.select(n,!1)}),this.sldrGradient.on("thumbdblclick",function(e){t.btnGradColor.cmpEl.find("button").dropdown("toggle")}),this.lockedControls.push(this.sldrGradient),this.cmbBorderSize=new Common.UI.ComboBorderSizeEditable({el:e("#textart-combo-border-size"),style:"width: 93px;",txtNoBorders:this.txtNoBorders}).on("selected",i.bind(this.onBorderSizeSelect,this)).on("changed:before",i.bind(this.onBorderSizeChanged,this,!0)).on("changed:after",i.bind(this.onBorderSizeChanged,this,!1)).on("combo:blur",i.bind(this.onComboBlur,this,!1)),this.BorderSize=this.cmbBorderSize.store.at(2).get("value"),this.cmbBorderSize.setValue(this.BorderSize),this.lockedControls.push(this.cmbBorderSize),this.cmbBorderType=new Common.UI.ComboBorderType({el:e("#textart-combo-border-type"),style:"width: 93px;",menuStyle:"min-width: 93px;"}).on("selected",i.bind(this.onBorderTypeSelect,this)).on("combo:blur",i.bind(this.onComboBlur,this,!1)),this.BorderType=Asc.c_oDashType.solid,this.cmbBorderType.setValue(this.BorderType),this.lockedControls.push(this.cmbBorderType),this.cmbTransform=new Common.UI.ComboDataView({itemWidth:50,itemHeight:50,menuMaxHeight:300,enableKeyEvents:!0,cls:"combo-textart"}),this.cmbTransform.render(e("#textart-combo-transform")),this.cmbTransform.openButton.menu.cmpEl.css({"min-width":178,"max-width":178}),this.cmbTransform.on("click",i.bind(this.onTransformSelect,this)),this.cmbTransform.openButton.menu.on("show:after",function(){t.cmbTransform.menuPicker.scroller.update({alwaysVisibleY:!0})}),this.lockedControls.push(this.cmbTransform)},createDelayedElements:function(){this.createDelayedControls();var t=[0,1,3,2,4,53,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,49,50,51,52];this.patternViewData=[];for(var e=0;e<13;e++)for(var i=0;i<4;i++){var n=4*e+i;this.patternViewData[n]={offsetx:28*i,offsety:28*e,type:t[n]}}this.patternViewData.splice(this.patternViewData.length-2,2);for(var e=0;e<this.patternViewData.length;e++)this.patternViewData[e].id=Common.UI.getId();this.cmbPattern.menuPicker.store.add(this.patternViewData),this.cmbPattern.menuPicker.store.length>0&&(this.cmbPattern.fillComboView(this.cmbPattern.menuPicker.store.at(0),!0),this.PatternFillType=this.patternViewData[0].type),this.UpdateThemeColors(),this
disableControls:function(t){this._initSettings||this._state.DisabledControls!==t&&(this._state.DisabledControls=t,i.each(this.lockedControls,function(e){e.setDisabled(t)}),this.linkAdvanced.toggleClass("disabled",t))},textEdit:"Rows & Columns",selectRowText:"Select Row",selectColumnText:"Select Entire Column",selectDataText:"Select Column Data",selectTableText:"Select Table",insertRowAboveText:"Insert Row Above",insertRowBelowText:"Insert Row Below",insertColumnLeftText:"Insert Column Left",insertColumnRightText:"Insert Column Right",deleteRowText:"Delete Row",deleteColumnText:"Delete Column",deleteTableText:"Delete Table",textOK:"OK",textCancel:"Cancel",textTemplate:"Select From Template",textRows:"Rows",textColumns:"Columns",textHeader:"Header",textTotal:"Total",textBanded:"Banded",textFirst:"First",textLast:"Last",textEmptyTemplate:"No templates",textFilter:"Filter button",textTableName:"Table Name",textResize:"Resize table",textSelectData:"Select Data",textInvalidName:"ERROR! Invalid table name",textExistName:"ERROR! Range with such a name already exists",textIsLocked:"This element is being edited by another user.",notcriticalErrorTitle:"Warning",textReservedName:"The name you are trying to use is already referenced in cell formulas. Please use some other name.",textAdvanced:"Show advanced settings",textConvertRange:"Convert to range"},SSE.Views.TableSettings||{}))});var SCALE_MIN=40,MENU_SCALE_PART=260;if(define("spreadsheeteditor/main/app/view/RightMenu",["text!spreadsheeteditor/main/app/template/RightMenu.template","jquery","underscore","backbone","common/main/lib/component/Button","common/main/lib/component/MetricSpinner","common/main/lib/component/CheckBox","spreadsheeteditor/main/app/view/ParagraphSettings","spreadsheeteditor/main/app/view/ImageSettings","spreadsheeteditor/main/app/view/ChartSettings","spreadsheeteditor/main/app/view/ShapeSettings","spreadsheeteditor/main/app/view/TextArtSettings","spreadsheeteditor/main/app/view/TableSettings","common/main/lib/component/Scroller"],function(t,e,i,n){"use strict";SSE.Views.RightMenu=n.View.extend(i.extend({el:"#right-menu",template:i.template(t),events:{},initialize:function(){return this.minimizedMode=!0,this.btnText=new Common.UI.Button({hint:this.txtParagraphSettings,asctype:Common.Utils.documentSettingsType.Paragraph,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnImage=new Common.UI.Button({hint:this.txtImageSettings,asctype:Common.Utils.documentSettingsType.Image,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnChart=new Common.UI.Button({hint:this.txtChartSettings,asctype:Common.Utils.documentSettingsType.Chart,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnShape=new Common.UI.Button({hint:this.txtShapeSettings,asctype:Common.Utils.documentSettingsType.Shape,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnTextArt=new Common.UI.Button({hint:this.txtTextArtSettings,asctype:Common.Utils.documentSettingsType.TextArt,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this.btnTable=new Common.UI.Button({hint:this.txtTableSettings,asctype:Common.Utils.documentSettingsType.Table,enableToggle:!0,disabled:!0,toggleGroup:"tabpanelbtnsGroup",allowMouseEventsOnDisabled:!0}),this._settings=[],this._settings[Common.Utils.documentSettingsType.Paragraph]={panel:"id-paragraph-settings",btn:this.btnText},this._settings[Common.Utils.documentSettingsType.Image]={panel:"id-image-settings",btn:this.btnImage},this._settings[Common.Utils.documentSettingsType.Shape]={panel:"id-shape-settings",btn:this.btnShape},this._settings[Common.Utils.documentSettingsType.Chart]={panel:"id-chart-settings",btn:this.btnChart},this._settings[Common.Utils.documentSettingsType.TextArt]={panel:"id-textart-settings",btn:this.btnTextArt},this._settings[Common.Utils.documentSettingsType.Table]={panel:"id-table-settings",btn:this.btnTable},this},render:funct
return'<% if (!hide) { %>\r\n <div id="<%= id %>" class="user-comment-item">\r\n\r\n \x3c!-- comment block --\x3e\r\n\r\n <div class="user-name"><%=scope.getUserName(username)%></div>\r\n <div class="user-date"><%=date%></div>\r\n <% if (quote!==null) { %>\r\n <div class="user-quote"><%=scope.getFixedQuote(quote)%></div>\r\n <% } %>\r\n <% if (!editText) { %>\r\n <div class="user-message" data-can-copy="true"><%=scope.pickLink(comment)%></div>\r\n <% } else { %>\r\n <div class="inner-edit-ct">\r\n <textarea class="msg-reply user-select" maxlength="maxCommLength"><%=comment%></textarea>\r\n <button class="btn normal dlg-btn primary btn-inner-edit" id="id-comments-change">textEdit</button>\r\n <button class="btn normal dlg-btn btn-inner-close">textCancel</button>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- replys elements --\x3e\r\n\r\n <% if (replys.length) { %>\r\n <div class="reply-arrow img-commonctrl"></div>\r\n <% _.each(replys, function (item) { %>\r\n <div class="reply-item-ct">\r\n <div class="user-name"><%=scope.getUserName(item.get("username"))%></div>\r\n <div class="user-date"><%=item.get("date")%></div>\r\n <% if (!item.get("editText")) { %>\r\n <div class="user-message" data-can-copy="true"><%=scope.pickLink(item.get("reply"))%></div>\r\n <div class="btns-reply-ct">\r\n <% if (item.get("editable")) { %>\r\n <div class="btn-edit img-commonctrl" data-value="<%=item.get("id")%>"></div>\r\n <% } %>\r\n <div class="btn-delete img-commonctrl" data-value="<%=item.get("id")%>"></div>\r\n </div>\r\n <% } else { %>\r\n <div class="inner-edit-ct">\r\n <textarea class="msg-reply textarea-fix user-select" maxlength="maxCommLength"><%=item.get("reply")%></textarea>\r\n <button class="btn normal dlg-btn primary btn-inner-edit btn-fix" id="id-comments-change">textEdit</button>\r\n <button class="btn normal dlg-btn btn-inner-close">textClose</button>\r\n </div>\r\n <% } %>\r\n </div>\r\n <% }); %>\r\n <% } %>\r\n\r\n \x3c!-- add reply button --\x3e\r\n\r\n <% if (!showReply) { %>\r\n <% if (replys.length) { %>\r\n <label class="user-reply" style="margin-left: 20px; margin-top: 5px;" role="presentation" tabindex="-1">textAddReply</label>\r\n <% } else { %>\r\n <label class="user-reply" role="presentation" tabindex="-1">textAddReply</label>\r\n <% } %>\r\n <% } %>\r\n\r\n \x3c!-- edit buttons --\x3e\r\n\r\n <% if (!editText && !lock) { %>\r\n <div class="edit-ct">\r\n <% if (editable) { %>\r\n <div class="btn-edit img-commonctrl"></div>\r\n <% } %>\r\n <div class="btn-delete img-commonctrl"></div>\r\n <% if (resolved) { %>\r\n <div class="btn-resolve-check img-commonctrl" data-toggle="tooltip"></div>\r\n <% } else { %>\r\n <div class="btn-resolve img-commonctrl" data-toggle="tooltip"></div>\r\n <% } %>\r\n </div>\r\n <% } %>\r\n\r\n \x3c!-- reply --\x3e\r\n\r\n <% if (showReply) { %>\r\n <div class="reply-ct">\r\n <textarea class="msg-reply user-select" placeholder="textAddReply" maxlength="maxCommLength"></textarea>\r\n <button class="btn normal dlg-btn primary btn-reply" id="id-comments-change">textReply</button>\r\n <button class="btn normal dlg-btn btn-close">textClose</butt
var o=/((^mailto:)\/\/)/i.test(t)?t:"mailto:"+t;return e=arguments[arguments.length-2],i=t.length,_.find(n,function(t){return e>=t.start&&e<t.end||e<=t.start&&e+i>t.start})||n.push({start:e,end:i+e,str:'<a href="'+o+'">'+t+"</a>"}),""}),n=_.sortBy(n,function(t){return t.start});for(var o=n.length>0?t.substring(0,n[0].start)+n[0].str:t,s=1;s<n.length;s++)o+=t.substring(n[s-1].end,n[s].start)+n[s].str;return n.length>0&&(o+=t.substring(n[s-1].end,t.length)),o},textComments:"Comments",textAnonym:"Guest",textAddCommentToDoc:"Add Comment to Document",textAddComment:"Add Comment",textCancel:"Cancel",textAddReply:"Add Reply",textReply:"Reply",textClose:"Close",textResolved:"Resolved",textResolve:"Resolve",textEnterCommentHint:"Enter your comment here",textEdit:"Edit",textAdd:"Add",textOpenAgain:"Open Again"},Common.Views.Comments||{}))}),define("text!common/main/lib/template/Chat.template",[],function(){return'<div id="chat-box" class="layout-ct vbox">\r\n <div id="chat-users" class="layout-item area">\r\n <div id="chat-user-ct"></div>\r\n </div>\r\n <div id="chat-messages" class="layout-item area">\r\n <div id="chat-message-ct"></div>\r\n </div>\r\n <div id="chat-options" class="layout-item">\r\n <div id="chat-options-ct">\r\n <textarea id="chat-msg-text" class="user-select" maxlength="<%=maxMsgLength%>"></textarea>\r\n <button id="chat-msg-btn-add" class="btn normal dlg-btn primary"><%=scope.textSend%></button>\r\n </div>\r\n </div>\r\n</div>'}),void 0===Common)var Common={};if(Common.Views=Common.Views||{},define("common/main/lib/view/Chat",["text!common/main/lib/template/Chat.template","common/main/lib/util/utils","common/main/lib/component/BaseView","common/main/lib/component/Layout"],function(t){"use strict";Common.Views.Chat=Common.UI.BaseView.extend(_.extend({el:"#left-panel-chat",template:_.template(t),storeUsers:void 0,storeMessages:void 0,tplUser:['<li id="chat-user-<%= user.get("id") %>"<% if (!user.get("online")) { %> class="offline"<% } %>>','<div class="color" style="background-color: <%= user.get("color") %>;" >','<label class="name"><%= scope.getUserName(user.get("username")) %></label>',"</div>","</li>"].join(""),templateUserList:_.template("<ul><% _.each(users, function(item) { %><%= _.template(usertpl, {user: item, scope: scope}) %><% }); %></ul>"),tplMsg:["<li>",'<% if (msg.get("type")==1) { %>','<div class="message service" data-can-copy="true"><%= msg.get("message") %></div>',"<% } else { %>",'<div class="user" data-can-copy="true" style="color: <%= msg.get("usercolor") %>;"><%= scope.getUserName(msg.get("username")) %></div>','<label class="message user-select" data-can-copy="true"><%= msg.get("message") %></label>',"<% } %>","</li>"].join(""),templateMsgList:_.template("<ul><% _.each(messages, function(item) { %><%= _.template(msgtpl, {msg: item, scope: scope}) %><% }); %></ul>"),events:{},usersBoxHeight:72,messageBoxHeight:70,addMessageBoxHeight:110,initialize:function(t){_.extend(this,t),Common.UI.BaseView.prototype.initialize.call(this,arguments),this.storeUsers.bind({add:_.bind(this._onAddUser,this),change:_.bind(this._onUsersChanged,this),reset:_.bind(this._onResetUsers,this)}),this.storeMessages.bind({add:_.bind(this._onAddMessage,this),reset:_.bind(this._onResetMessages,this)})},render:function(t){return t=t||this.el,$(t).html(this.template({scope:this,maxMsgLength:Asc.c_oAscMaxCellOrCommentLength})),this.panelBox=$("#chat-box",this.el),this.panelUsers=$("#chat-users",this.el),this.panelMessages=$("#chat-messages",this.el),this.txtMessage=$("#chat-msg-text",this.el),this.panelOptions=$("#chat-options",this.el),this.panelUsers.scroller=new Common.UI.Scroller({el:$("#chat-users"),useKeyboard:!0,minScrollbarLength:25}),this.panelMessages.scroller=new Common.UI.Scroller({el:$("#chat-messages"),includePadding:!0,useKeyboard:!0,minScrollbarLength:40}),$("#chat-msg-btn-add",this.el).on("click",_.bind(this._onBtnAddMessage,this)),this.txtMessage.on("keydown",_.bind(this._onKeyDown,this)),this.setupLayout(),this},focus:function(){var t=t
el:e("#left-btn-support",this.el),hint:this.tipSupport,disabled:!0}),this.btnComments=new Common.UI.Button({el:e("#left-btn-comments",this.el),hint:this.tipComments+Common.Utils.String.platformKey("Ctrl+Shift+H"),enableToggle:!0,disabled:!0,toggleGroup:"leftMenuGroup"}),this.btnChat=new Common.UI.Button({el:e("#left-btn-chat",this.el),hint:this.tipChat+Common.Utils.String.platformKey("Alt+Q"),enableToggle:!0,disabled:!0,toggleGroup:"leftMenuGroup"}),this.btnComments.hide(),this.btnChat.hide(),this.btnComments.on("click",i.bind(this.onBtnMenuClick,this)),this.btnChat.on("click",i.bind(this.onBtnMenuClick,this)),this.btnPlugins=new Common.UI.Button({el:e("#left-btn-plugins"),hint:this.tipPlugins,enableToggle:!0,disabled:!0,toggleGroup:"leftMenuGroup"}),this.btnPlugins.hide(),this.btnPlugins.on("click",i.bind(this.onBtnMenuClick,this)),this.btnSearch.on("click",i.bind(this.onBtnMenuClick,this)),this.btnAbout.on("toggle",i.bind(this.onBtnMenuToggle,this)),this.btnFile.on("toggle",i.bind(this.onBtnMenuToggle,this));var t=new SSE.Views.FileMenu({});return t.options={alias:"FileMenu"},this.btnFile.panel=t.render(),this.btnAbout.panel=new Common.Views.About({el:e("#about-menu-panel"),appName:"Spreadsheet Editor"}).render(),this},onBtnMenuToggle:function(t,e){e?(this.btnFile.pressed&&this.fireEvent("file:show",this),t.panel.show(),this.$el.width(40),this.btnSearch.isActive()&&this.btnSearch.toggle(!1)):(this.btnFile.id==t.id&&this.fireEvent("file:hide",this),t.panel.hide()),this.mode.isEdit&&SSE.getController("Toolbar").DisableToolbar(1==e),Common.NotificationCenter.trigger("layout:changed","leftmenu")},onBtnMenuClick:function(t,e){this.btnFile.toggle(!1),this.btnAbout.toggle(!1),"search"==t.options.action||(t.pressed?this.$el.width()>40||this.$el.width(Common.localStorage.getItem("sse-mainmenu-width")||300):(Common.localStorage.setItem("sse-mainmenu-width",this.$el.width()),this.$el.width(40))),Common.NotificationCenter.trigger("layout:changed","leftmenu")},onCoauthOptions:function(t){this.mode.canCoAuthoring&&(this.mode.canComments&&(this.btnComments.pressed&&this.btnComments.$el.hasClass("notify")&&this.btnComments.$el.removeClass("notify"),this.panelComments[this.btnComments.pressed?"show":"hide"](),this.fireEvent(this.btnComments.pressed?"comments:show":"comments:hide",this)),this.mode.canChat&&(this.btnChat.pressed?(this.btnChat.$el.hasClass("notify")&&this.btnChat.$el.removeClass("notify"),this.panelChat.show(),this.panelChat.focus()):this.panelChat.hide())),this.mode.canPlugins&&this.panelPlugins&&(this.btnPlugins.pressed?this.panelPlugins.show():this.panelPlugins.hide())},setOptionsPanel:function(t,e){"chat"==t?this.panelChat=e.render("#left-panel-chat"):"comment"==t?this.panelComments=e:"plugins"!=t||this.panelPlugins||(this.panelPlugins=e.render("#left-panel-plugins"))},markCoauthOptions:function(t,e){"chat"!=t||!this.btnChat.isVisible()||this.btnChat.isDisabled()||this.btnChat.pressed||this.btnChat.$el.addClass("notify"),"comments"!=t||!this.btnComments.isVisible()||this.btnComments.pressed||this.btnComments.isDisabled()&&!e||this.btnComments.$el.addClass("notify")},close:function(t){this.btnFile.toggle(!1),this.btnAbout.toggle(!1),this.$el.width(40),this.mode.canCoAuthoring&&(this.mode.canComments&&(this.panelComments.hide(),this.btnComments.pressed&&this.fireEvent("comments:hide",this),this.btnComments.toggle(!1,!0)),this.mode.canChat&&(this.panelChat.hide(),this.btnChat.toggle(!1,!0))),this.mode.canPlugins&&this.panelPlugins&&(this.panelPlugins.hide(),this.btnPlugins.toggle(!1,!0))},isOpened:function(){var t=this.btnFile.pressed||this.btnSearch.pressed;return!t&&(t=this.btnComments.pressed||this.btnChat.pressed),t},disableMenu:function(t,e){this.btnFile.setDisabled(!1),this.btnAbout.setDisabled(!1),this.btnSupport.setDisabled(!1),this.btnSearch.setDisabled(!1),this.btnComments.setDisabled(!1),this.btnChat.setDisabled(!1),this.btnPlugins.setDisabled(!1)},showMenu:function(t){var e=/^(\w+):?(\w*)$/.exec(t);"file"==e[1]&&this.btnFile.isVisible()?(this.btnFile.pressed||(this.btnFile.toggle(!0),this.btnFile.$el.focus()
n.push(e);else n=[[37,"IBM EBCDIC (US-Canada)"],[437,"OEM United States"],[500,"IBM EBCDIC (International)"],[708,"Arabic (ASMO 708)"],[720,"Arabic (DOS)"],[737,"Greek (DOS)"],[775,"Baltic (DOS)"],[850,"Western European (DOS)"],[852,"Central European (DOS)"],[855,"OEM Cyrillic"],[857,"Turkish (DOS)"],[858,"OEM Multilingual Latin I"],[860,"Portuguese (DOS)"],[861,"Icelandic (DOS)"],[862,"Hebrew (DOS)"],[863,"French Canadian (DOS)"],[864,"Arabic (864) "],[865,"Nordic (DOS)"],[866,"Cyrillic (DOS)"],[869,"Greek, Modern (DOS)"],[870,"IBM EBCDIC (Multilingual Latin-2)"],[874,"Thai (Windows)"],[875,"IBM EBCDIC (Greek Modern)"],[932,"Japanese (Shift-JIS)"],[936,"Chinese Simplified (GB2312)"],[949,"Korean"],[950,"Chinese Traditional (Big5)"],[1026,"IBM EBCDIC (Turkish Latin-5)"],[1047,"IBM Latin-1"],[1140,"IBM EBCDIC (US-Canada-Euro)"],[1141,"IBM EBCDIC (Germany-Euro)"],[1142,"IBM EBCDIC (Denmark-Norway-Euro)"],[1143,"IBM EBCDIC (Finland-Sweden-Euro)"],[1144,"IBM EBCDIC (Italy-Euro)"],[1145,"IBM EBCDIC (Spain-Euro)"],[1146,"IBM EBCDIC (UK-Euro)"],[1147,"IBM EBCDIC (France-Euro)"],[1148,"IBM EBCDIC (International-Euro)"],[1149,"IBM EBCDIC (Icelandic-Euro)"],[1200,"Unicode"],[1201,"Unicode (Big-Endian)"],[1250,"Central European (Windows)"],[1251,"Cyrillic (Windows)"],[1252,"Western European (Windows)"],[1253,"Greek (Windows)"],[1254,"Turkish (Windows)"],[1255,"Hebrew (Windows) "],[1256,"Arabic (Windows) "],[1257,"Baltic (Windows)"],[1258,"Vietnamese (Windows)"],[1361,"Korean (Johab)"],[1e4,"Western European (Mac)"],[10001,"Japanese (Mac)"],[10002,"Chinese Traditional (Mac)"],[10003,"Korean (Mac)"],[10004,"Arabic (Mac) "],[10005,"Hebrew (Mac)"],[10006,"Greek (Mac) "],[10007,"Cyrillic (Mac)"],[10008,"Chinese Simplified (Mac)"],[10010,"Romanian (Mac)"],[10017,"Ukrainian (Mac)"],[10021,"Thai (Mac)"],[10029,"Central European (Mac) "],[10079,"Icelandic (Mac)"],[10081,"Turkish (Mac)"],[10082,"Croatian (Mac)"],[12e3,"Unicode (UTF-32)"],[12001,"Unicode (UTF-32 Big-Endian)"],[2e4,"Chinese Traditional (CNS)"],[20001,"TCA Taiwan"],[20002,"Chinese Traditional (Eten)"],[20003,"IBM5550 Taiwan"],[20004,"TeleText Taiwan"],[20005,"Wang Taiwan"],[20105,"Western European (IA5)"],[20106,"German (IA5)"],[20107,"Swedish (IA5) "],[20108,"Norwegian (IA5) "],[20127,"US-ASCII"],[20261,"T.61 "],[20269,"ISO-6937"],[20273,"IBM EBCDIC (Germany)"],[20277,"IBM EBCDIC (Denmark-Norway) "],[20278,"IBM EBCDIC (Finland-Sweden)"],[20280,"IBM EBCDIC (Italy)"],[20284,"IBM EBCDIC (Spain)"],[20285,"IBM EBCDIC (UK)"],[20290,"IBM EBCDIC (Japanese katakana)"],[20297,"IBM EBCDIC (France)"],[20420,"IBM EBCDIC (Arabic)"],[20423,"IBM EBCDIC (Greek)"],[20424,"IBM EBCDIC (Hebrew)"],[20833,"IBM EBCDIC (Korean Extended)"],[20838,"IBM EBCDIC (Thai)"],[20866,"Cyrillic (KOI8-R)"],[20871,"IBM EBCDIC (Icelandic) "],[20880,"IBM EBCDIC (Cyrillic Russian)"],[20905,"IBM EBCDIC (Turkish)"],[20924,"IBM Latin-1 "],[20932,"Japanese (JIS 0208-1990 and 0212-1990)"],[20936,"Chinese Simplified (GB2312-80) "],[20949,"Korean Wansung "],[21025,"IBM EBCDIC (Cyrillic Serbian-Bulgarian)"],[21866,"Cyrillic (KOI8-U)"],[28591,"Western European (ISO) "],[28592,"Central European (ISO)"],[28593,"Latin 3 (ISO)"],[28594,"Baltic (ISO)"],[28595,"Cyrillic (ISO) "],[28596,"Arabic (ISO)"],[28597,"Greek (ISO) "],[28598,"Hebrew (ISO-Visual)"],[28599,"Turkish (ISO)"],[28603,"Estonian (ISO)"],[28605,"Latin 9 (ISO)"],[29001,"Europa"],[38598,"Hebrew (ISO-Logical)"],[50220,"Japanese (JIS)"],[50221,"Japanese (JIS-Allow 1 byte Kana) "],[50222,"Japanese (JIS-Allow 1 byte Kana - SO/SI)"],[50225,"Korean (ISO)"],[50227,"Chinese Simplified (ISO-2022)"],[51932,"Japanese (EUC)"],[51936,"Chinese Simplified (EUC) "],[51949,"Korean (EUC)"],[52936,"Chinese Simplified (HZ)"],[54936,"Chinese Simplified (GB18030)"],[57002,"ISCII Devanagari "],[57003,"ISCII Bengali "],[57004,"ISCII Tamil"],[57005,"ISCII Telugu "],[57006,"ISCII Assamese "],[57007,"ISCII Oriya"],[57008,"ISCII Kannada"],[57009,"ISCII Malayalam "],[57010,"ISCII Gujarati"],[57011,"ISCII Punjabi"],[65e3,"Unicode (UTF-7)"],[65001,"Unicode (UTF-8)"]];if(s=n.length){for(t=0;t<s;++t)o.
langJson[lang])return langJson[lang];if("en"!=lang){try{var xhrObj=_createXMLHTTPObject();if(xhrObj&&lang)return xhrObj.open("GET","resources/formula-lang/"+lang+".json",!1),xhrObj.send(""),langJson[lang]=eval("("+xhrObj.responseText+")"),langJson[lang]}catch(t){}return null}},_getDescription=function(lang){if(!lang)return"";if(lang=lang.toLowerCase(),langDescJson[lang])return langDescJson[lang];try{var xhrObj=_createXMLHTTPObject();if(xhrObj&&lang)return xhrObj.open("GET","resources/formula-lang/"+lang+"_desc.json",!1),xhrObj.send(""),200==xhrObj.status?langDescJson[lang]=eval("("+xhrObj.responseText+")"):(xhrObj.open("GET","resources/formula-lang/en_desc.json",!1),xhrObj.send(""),langDescJson[lang]=eval("("+xhrObj.responseText+")")),langDescJson[lang]}catch(t){}return null};return{get:_get,getDescription:_getDescription}}}),define("spreadsheeteditor/main/app/controller/Main",["core","irregularstack","common/main/lib/component/Window","common/main/lib/component/LoadMask","common/main/lib/component/Tooltip","common/main/lib/controller/Fonts","common/main/lib/collection/TextArt","common/main/lib/view/OpenDialog","common/main/lib/util/LanguageInfo","common/main/lib/util/LocalStorage","spreadsheeteditor/main/app/collection/ShapeGroups","spreadsheeteditor/main/app/collection/TableTemplates","spreadsheeteditor/main/app/collection/EquationGroups","spreadsheeteditor/main/app/controller/FormulaDialog","spreadsheeteditor/main/app/view/FormulaLang"],function(){"use strict";SSE.Controllers.Main=Backbone.Controller.extend(_.extend(function(){var InitApplication=-254,ApplyEditRights=-255,LoadingDocument=-256,mapCustomizationElements={about:"button#left-btn-about",feedback:"button#left-btn-support",goback:"#fm-btn-back > a, #header-back > div"},mapCustomizationExtElements={toolbar:"#viewport #toolbar",leftMenu:"#viewport #left-menu, #viewport #id-toolbar-full-placeholder-btn-settings, #viewport #id-toolbar-short-placeholder-btn-settings",rightMenu:"#viewport #right-menu",header:"#viewport #header",statusBar:"#statusbar"};return Common.localStorage.setId("table"),Common.localStorage.setKeysFilter("sse-,asc.table"),Common.localStorage.sync(),{models:[],collections:["ShapeGroups","EquationGroups","TableTemplates","Common.Collections.TextArt"],views:[],initialize:function(){this.addListeners({FileMenu:{"settings:apply":_.bind(this.applySettings,this)}})},onLaunch:function(){if(this._state={isDisconnected:!1,usersCount:1,fastCoauth:!0,lostEditingRights:!1,licenseWarning:!1},!Common.Utils.isBrowserSupported())return Common.Utils.showBrowserRestriction(),void Common.Gateway.reportError(void 0,this.unsupportedBrowserErrorText);var t=Common.localStorage.getItem("sse-settings-fontrender");null===t&&(t=window.devicePixelRatio>1?"1":"3"),this.api=new Asc.spreadsheet_api({"id-view":"editor_sdk","id-input":"ce-cell-content"}),this.api.asc_setFontRenderingMode(parseInt(t)),this.api.asc_registerCallback("asc_onOpenDocumentProgress",_.bind(this.onOpenDocument,this)),this.api.asc_registerCallback("asc_onEndAction",_.bind(this.onLongActionEnd,this)),this.api.asc_registerCallback("asc_onError",_.bind(this.onError,this)),this.api.asc_registerCallback("asc_onCoAuthoringDisconnect",_.bind(this.onCoAuthoringDisconnect,this)),this.api.asc_registerCallback("asc_onAdvancedOptions",_.bind(this.onAdvancedOptions,this)),this.api.asc_registerCallback("asc_onDocumentUpdateVersion",_.bind(this.onUpdateVersion,this)),this.api.asc_registerCallback("asc_onServerVersion",_.bind(this.onServerVersion,this)),this.api.asc_registerCallback("asc_onDocumentName",_.bind(this.onDocumentName,this)),this.api.asc_registerCallback("asc_onPrintUrl",_.bind(this.onPrintUrl,this)),this.api.asc_registerCallback("asc_onMeta",_.bind(this.onMeta,this)),Common.NotificationCenter.on("api:disconnect",_.bind(this.onCoAuthoringDisconnect,this)),Common.NotificationCenter.on("goback",_.bind(this.goBack,this)),Common.NotificationCenter.on("namedrange:locked",_.bind(this.onNamedRangeLocked,this)),this.stackLongActions=new Common.IrregularStack({strongCompare:this._compareActionStrong,weakCompare:thi
this.appOptions.isDesktopApp&&this.appOptions.isOffline?this.api.asc_DownloadAs():this.getApplication().getController("LeftMenu").leftMenu.showMenu("file:saveas")),this._state.lostEditingRights=!1,this.onEditComplete()},this)),$(".asc-window.modal.alert:visible").length<1&&(Common.UI.alert(n),Common.component.Analytics.trackEvent("Internal Error",t.toString()))},onCoAuthoringDisconnect:function(){this.getApplication().getController("Viewport").getView("Viewport").setMode({isDisconnected:!0}),this.getApplication().getController("Viewport").getView("Common.Views.Header").setCanRename(!1),this.appOptions.canRename=!1,this._state.isDisconnected=!0},showTips:function(t){function e(){var e=t.shift();e&&(e+="\n"+i.textCloseTip,n.setTitle(e),n.show())}var i=this;if(t.length){"object"!=typeof t&&(t=[t]),this.tooltip||(this.tooltip=new Common.UI.Tooltip({owner:this.getApplication().getController("Toolbar").getView("Toolbar"),hideonclick:!0,placement:"bottom",cls:"main-info",offset:30}));var n=this.tooltip;n.on("tooltip:hide",function(){setTimeout(e,300)}),e()}},updateWindowTitle:function(t,e){if(this._state.isDocModified!==t||e){var i=this.defaultTitleText;if(_.isEmpty(this.headerView.getDocumentCaption())||(i=this.headerView.getDocumentCaption()+" - "+i),t)clearTimeout(this._state.timerCaption),_.isUndefined(i)||(i="* "+i,this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(),!0));else if(this._state.fastCoauth&&this._state.usersCount>1){var n=this;this._state.timerCaption=setTimeout(function(){n.headerView.setDocumentCaption(n.headerView.getDocumentCaption(),!1)},500)}else this.headerView.setDocumentCaption(this.headerView.getDocumentCaption(),!1);window.document.title!=i&&(window.document.title=i),Common.Gateway.setDocumentModified(t),this._state.isDocModified=t}},onDocumentChanged:function(){},onDocumentModifiedChanged:function(t){if(this.updateWindowTitle(t),Common.Gateway.setDocumentModified(t),this.toolbarView&&this.api){var e=$(".btn-icon",this.toolbarView.btnSave.cmpEl).hasClass("btn-synch"),i=this.appOptions.forcesave,n=this.api.asc_isDocumentCanSave();this.toolbarView.btnSave.isDisabled()!==(!n&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)&&this.toolbarView.btnSave.setDisabled(!n&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)}},onDocumentCanSaveChanged:function(t){if(this.toolbarView){var e=$(".btn-icon",this.toolbarView.btnSave.cmpEl).hasClass("btn-synch"),i=this.appOptions.forcesave;this.toolbarView.btnSave.isDisabled()!==(!t&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)&&this.toolbarView.btnSave.setDisabled(!t&&!e&&!i||this._state.isDisconnected||this._state.fastCoauth&&this._state.usersCount>1&&!i)}},onBeforeUnload:function(){if(Common.localStorage.save(),!1!==this.permissions.edit&&"view"!==this.editorConfig.mode&&"editdiagram"!==this.editorConfig.mode&&this.api.asc_isDocumentModified()){var t=this;return this.api.asc_stopSaving(),this.continueSavingTimer=window.setTimeout(function(){t.api.asc_continueSaving()},500),this.leavePageText}},onUnload:function(){this.continueSavingTimer&&clearTimeout(this.continueSavingTimer)},hidePreloader:function(){this._state.customizationDone||(this._state.customizationDone=!0,this.appOptions.customization&&(this.appOptions.isDesktopApp?this.appOptions.customization.about=!1:this.appOptions.canBrandingExt||(this.appOptions.customization.about=!0)),Common.Utils.applyCustomization(this.appOptions.customization,mapCustomizationElements),this.appOptions.canBrandingExt&&(Common.Utils.applyCustomization(this.appOptions.customization,mapCustomizationExtElements),Common.Utils.applyCustomizationPlugins(this.UICustomizePlugins))),this.stackLongActions.pop({id:InitApplication,type:Asc.c_oAscAsyncActionType.BlockInteraction}),Common.NotificationCenter.trigger("layout:changed","main"),$("#loading-mask").hide().remove()},onDownloadUrl:function(t){Common.Gateway.downloadAs(t)},onUpdateVersion:function(t){var e=this;e.needToUpdateVersion=!0,e.onLong
template:_.template(['<table class="main"><tbody>',"<tr>",'<td class="left"><label><%= scope.textSettings %></label></td>','<td class="right"><div id="advsettings-print-combo-sheets" class="input-group-nr" /></td>',"</tr>",'<tr class="divider"></tr>','<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.textPageSize %></label></td>','<td class="right"><div id="advsettings-print-combo-pages" class="input-group-nr" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.textPageOrientation %></label></td>','<td class="right"><span id="advsettings-print-combo-orient" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left"><label><%= scope.textPageScaling %></label></td>','<td class="right"><span id="advsettings-print-combo-layout" /></td>',"</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left" style="vertical-align: top;"><label><%= scope.strMargins %></label></td>','<td class="right" style="vertical-align: top;"><div id="advsettings-margins">','<table cols="2" class="no-padding">',"<tr>","<td><label><%= scope.strTop %></label></td>","<td><label><%= scope.strBottom %></label></td>","</tr>","<tr>",'<td><div id="advsettings-spin-margin-top"></div></td>','<td><div id="advsettings-spin-margin-bottom"></div></td>',"</tr>","<tr>","<td><label><%= scope.strLeft %></label></td>","<td><label><%= scope.strRight %></label></td>","</tr>","<tr>",'<td><div id="advsettings-spin-margin-left"></div></td>','<td><div id="advsettings-spin-margin-right"></div></td>',"</tr>","</table>","</div></td>","</tr>",'<tr class="divider"></tr>',"<tr>",'<td class="left" style="vertical-align: top;"><label><%= scope.strPrint %></label></td>','<td class="right" style="vertical-align: top;"><div id="advsettings-print">','<div id="advsettings-print-chb-grid" style="margin-bottom: 10px;"/>','<div id="advsettings-print-chb-rows"/>',"</div></td>","</tr>",'<tr class="divider"></tr>','<tr class="divider"></tr>',"<tr>",'<td class="left"></td>','<td class="right"><button id="advsettings-print-button-save" class="btn normal dlg-btn primary"><%= scope.okButtonText %></button></td>',"</tr>","</tbody></table>"].join("")),initialize:function(t){Common.UI.BaseView.prototype.initialize.call(this,arguments),this.menu=t.menu,this.spinners=[],this._initSettings=!0},render:function(t){return t&&this.setElement(t,!1),$(this.el).html(this.template({scope:this})),this.cmbSheet=new Common.UI.ComboBox({el:$("#advsettings-print-combo-sheets"),style:"width: 242px;",menuStyle:"min-width: 242px;max-height: 280px;",editable:!1,cls:"input-group-nr",data:[]}),this.cmbPaperSize=new Common.UI.ComboBox({el:$("#advsettings-print-combo-pages"),style:"width: 242px;",menuStyle:"max-height: 280px; min-width: 242px;",editable:!1,cls:"input-group-nr",data:[{value:"215.9|279.4",displayValue:"US Letter (21,59cm x 27,94cm)",caption:"US Letter"},{value:"215.9|355.6",displayValue:"US Legal (21,59cm x 35,56cm)",caption:"US Legal"},{value:"210|297",displayValue:"A4 (21cm x 29,7cm)",caption:"A4"},{value:"148.1|209.9",displayValue:"A5 (14,81cm x 20,99cm)",caption:"A5"},{value:"176|250.1",displayValue:"B5 (17,6cm x 25,01cm)",caption:"B5"},{value:"104.8|241.3",displayValue:"Envelope #10 (10,48cm x 24,13cm)",caption:"Envelope #10"},{value:"110.1|220.1",displayValue:"Envelope DL (11,01cm x 22,01cm)",caption:"Envelope DL"},{value:"279.4|431.7",displayValue:"Tabloid (27,94cm x 43,17cm)",caption:"Tabloid"},{value:"297|420.1",displayValue:"A3 (29,7cm x 42,01cm)",caption:"A3"},{value:"304.8|457.1",displayValue:"Tabloid Oversize (30,48cm x 45,71cm)",caption:"Tabloid Oversize"},{value:"196.8|273",displayValue:"ROC 16K (19,68cm x 27,3cm)",caption:"ROC 16K"},{value:"119.9|234.9",displayValue:"Envelope Choukei 3 (11,99cm x 23,49cm)",caption:"Envelope Choukei 3"},{value:"330.2|482.5",displayValue:"Super B/A3 (33,02cm x 48,25cm)",caption:"Super B/A3"}]}),this.cmbPaperOrientation=new Common.UI.ComboBox({el:$("#advsettings-print-combo-orient"),style:"width: 132px;",menuStyle:"min-width: 132px;",editable:!1,cls:"input-group-nr",data:[{value:Asc.c_oAscPageOrient
itemTemplate:_.template(['<div id="<%= id %>" class="help-item-wrap">','<div class="caption"><%= name %></div>',"</div>"].join(""))}),this.viewHelpPicker.on("item:add",function(t,e,i){i.has("headername")&&$(e.el).before('<div class="header-name">'+i.get("headername")+"</div>")}),this.viewHelpPicker.on("item:select",function(e,i,n){t.iFrame.src=t.urlPref+n.get("src")}),this.iFrame=document.createElement("iframe"),this.iFrame.src="",this.iFrame.align="top",this.iFrame.frameBorder="0",this.iFrame.width="100%",this.iFrame.height="100%",Common.Gateway.on("internalcommand",function(e){if("help:hyperlink"==e.type){var i=e.data,n=t.viewHelpPicker.store.find(function(t){return i.indexOf(t.get("src"))>0});n&&(t.viewHelpPicker.selectRecord(n,!0),t.viewHelpPicker.scrollToRecord(n))}}),$("#id-help-frame").append(this.iFrame),this},setLangConfig:function(t){var e=this,i=this.viewHelpPicker.store;if(t){t=t.split("-")[0];var n={dataType:"json",error:function(){e.urlPref.indexOf("resources/help/en/")<0?(e.urlPref="resources/help/en/",i.url="resources/help/en/Contents.json",i.fetch(n)):(e.urlPref="resources/help/en/",i.reset(e.en_data))},success:function(){var t=i.at(0);e.viewHelpPicker.selectRecord(t),e.iFrame.src=e.urlPref+t.get("src")}};i.url="resources/help/"+t+"/Contents.json",i.fetch(n),this.urlPref="resources/help/"+t+"/"}},show:function(){Common.UI.BaseView.prototype.show.call(this),this._scrollerInited||(this.viewHelpPicker.scroller.update(),this._scrollerInited=!0)}})}),define("text!spreadsheeteditor/main/app/template/PrintSettings.template",[],function(){return'<div class="settings-panel active">\r\n <div class="padding-large inner-content" >\r\n <div id="printadv-dlg-combo-range" class="input-group-nr" /> </div>\r\n <div class="padding-large"/>\r\n <div class="padding-large inner-content" >\r\n <div id="printadv-dlg-combo-sheets" class="input-group-nr" />\r\n </div>\r\n <div class="padding-large inner-content" >\r\n <div id="printadv-dlg-combo-pages" class="input-group-nr" />\r\n </div>\r\n <div class="padding-large inner-content" >\r\n <span id="printadv-dlg-combo-orient" />\r\n </div>\r\n <div class="padding-large inner-content" >\r\n <span id="printadv-dlg-combo-layout" />\r\n </div>\r\n <div id="printadv-dlg-content-to-hide">\r\n <div class="padding-large inner-content" >\r\n <table cols="2" class="no-padding">\r\n <tr>\r\n <td><label><%= scope.strTop %></label></td>\r\n <td><label><%= scope.strBottom %></label></td>\r\n </tr>\r\n <tr>\r\n <td class="padding-small"><div id="printadv-dlg-spin-margin-top" style="margin-right: 19px;"></div></td>\r\n <td class="padding-small"><div id="printadv-dlg-spin-margin-bottom"></div></td>\r\n </tr>\r\n <tr>\r\n <td><label><%= scope.strLeft %></label></td>\r\n <td><label><%= scope.strRight %></label></td>\r\n </tr>\r\n <tr>\r\n <td><div id="printadv-dlg-spin-margin-left" style="margin-right: 15px;"></div></td>\r\n <td><div id="printadv-dlg-spin-margin-right"></div></td>\r\n </tr>\r\n </table>\r\n </div>\r\n <div class="padding-small"/>\r\n <div class="inner-content">\r\n <div id="printadv-dlg-chb-grid" style="margin-bottom: 10px;"/>\r\n <div id="printadv-dlg-chb-rows"/>\r\n </div>\r\n </div>\r\n</div>\r\n'}),define("spreadsheeteditor/main/app/view/PrintSettings",["text!spreadsheeteditor/main/app/template/PrintSettings.template","common/main/lib/view/AdvancedSettingsWindow","common/main/lib/component/MetricSpinner","common/main/lib/component/CheckBox","common/main/lib/component/RadioBox","common/main/lib/component/ListView"],function(t){"use strict";SSE.Views.PrintSettings=Common.Views.AdvancedSettingsWindow.extend(_.extend({options:{alias:"PrintSettings",contentWidth:280,height:471},initialize:function(e){_.extend(this.o
0===this.popoverComments.length&&this.getPopover()&&this.getPopover().hide())}},onChangeComments:function(t){for(var e=0;e<t.length;++e)this.onApiChangeCommentData(t[e].Comment.Id,t[e].Comment,!0);this.updateComments(!0)},onRemoveComments:function(t){for(var e=0;e<t.length;++e)this.onApiRemoveComment(t[e],!0);this.updateComments(!0)},onApiChangeCommentData:function(t,e,i){var n=this,o=0,s=null,a=null,r=0,l=null,c=this.findComment(t);if(c){for(n=this,s=""==e.asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(e.asc_getTime())),c.set("comment",e.asc_getText()),c.set("userid",e.asc_getUserId()),c.set("username",e.asc_getUserName()),c.set("resolved",e.asc_getSolved()),c.set("quote",e.asc_getQuoteText()),c.set("time",s.getTime()),c.set("date",n.dateToLocaleTimeString(s)),a=_.clone(c.get("replys")),a.length=0,r=e.asc_getRepliesCount(),o=0;o<r;++o)l=""==e.asc_getReply(o).asc_getTime()?new Date:new Date(this.stringUtcToLocalDate(e.asc_getReply(o).asc_getTime())),a.push(new Common.Models.Reply({id:Common.UI.getId(),userid:e.asc_getReply(o).asc_getUserId(),username:e.asc_getReply(o).asc_getUserName(),date:n.dateToLocaleTimeString(l),reply:e.asc_getReply(o).asc_getText(),time:l.getTime(),editText:!1,editTextInPopover:!1,showReplyInPopover:!1,scope:n.view,editable:n.mode.canEditComments||e.asc_getReply(o).asc_getUserId()==n.currentUserId}));a.sort(function(t,e){return t.get("time")-e.get("time")}),c.set("replys",a),i||(this.updateComments(!1,!0),this.getPopover()&&this.getPopover().isVisible()&&(this._dontScrollToComment=!0,this.api.asc_showComment(t,!0)))}},onApiLockComment:function(t,e){var i=this.findComment(t),n=null,o=null;i&&(n=this.getApplication().getCollection("Common.Collections.Users"))&&(o=n.findWhere({id:e}))&&(this.getPopover()&&this.getPopover().saveText(),i.set("lock",!0),i.set("lockuserid",this.view.getUserName(o.get("username"))))},onApiUnLockComment:function(t){var e=this.findComment(t);e&&(e.set("lock",!1),this.getPopover()&&this.getPopover().loadText())},onApiShowComment:function(t,e,i,n,o,s){if(this.isModeChanged=!1,(!s||!this.isSelectedComment||0!==_.difference(this.uids,t).length)&&(this.mode&&!this.mode.canComments&&(s=!0),this.getPopover())){if(this.clearDummyComment(),this.isSelectedComment&&0===_.difference(this.uids,t).length)return void(this.api&&(this.getPopover().commentsView.setFocusToTextBox(!0),this.api.asc_enableKeyEvents(!0)));var a=0,r="",l="",c=null,h="",d=!0;for(this.popoverComments.reset(),a=0;a<t.length;++a)r=t[a],l=t[a]+"-R",c=this.findComment(r),this.subEditStrings[r]&&!s?(c.set("editTextInPopover",!0),h=this.subEditStrings[r]):this.subEditStrings[l]&&!s&&(c.set("showReplyInPopover",!0),h=this.subEditStrings[l]),c.set("hint",!_.isUndefined(s)&&s),!s&&this.hintmode&&(0===_.difference(this.uids,t).length&&0===this.uids.length&&(d=!1),this.oldUids.length&&0===_.difference(this.oldUids,t).length&&(d=!1,this.oldUids=[])),this.animate&&(d=this.animate,this.animate=!1),this.isSelectedComment=!s||!this.hintmode,this.uids=_.clone(t),this.popoverComments.push(c),this._dontScrollToComment||this.view.commentsView.scrollToRecord(c),this._dontScrollToComment=!1;this.getPopover().isVisible()&&this.getPopover().hide(),this.getPopover().setLeftTop(e,i,n),this.getPopover().show(d,!1,!0,h)}},onApiHideComment:function(t){var e=this;if(this.getPopover()){if(this.isSelectedComment&&t)return;if(t&&this.getPopover().isCommentsViewMouseOver())return;this.popoverComments.each(function(t){t.get("editTextInPopover")&&(e.subEditStrings[t.get("uid")]=e.getPopover().getEditText()),t.get("showReplyInPopover")&&(e.subEditStrings[t.get("uid")+"-R"]=e.getPopover().getEditText())}),this.getPopover().saveText(!0),this.getPopover().hide(),this.collection.clearEditing(),this.popoverComments.clearEditing(),this.oldUids=_.clone(this.uids),this.isSelectedComment=!1,this.uids=[],this.popoverComments.reset()}},onApiUpdateCommentPosition:function(t,e,i,n){var o,s=!1,a=null,r=void 0,l="",c="";if(this.getPopover())if(this.getPopover().saveText(),this.getPopover().hideTips(),i<0||this.getPopover().sdkBounds.height<i||!_.isUndefin