text: !function(e){"use strict";void 0!==typeof window&&(e=window);var t,n,r,i=e,o=i&&i.document;"undefined"==typeof Kekule&&(Kekule={}),"undefined"==typeof navigator?(Kekule.Browser={},Kekule.BrowserFeature={}):(Kekule.Browser={IE:!(!i.attachEvent||i.opera),Opera:!!i.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("like Gecko")<0&&-1==navigator.userAgent.indexOf("KHTML"),MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/),language:navigator.language||navigator.browserLanguage},Kekule.Browser.IEVersion=Kekule.Browser.IE&&(-1!==(r=navigator.userAgent.toLowerCase()).indexOf("msie")&&parseInt(r.split("msie")[1])),Kekule.BrowserFeature={typedArray:"undefined"!=typeof ArrayBuffer,svg:!!i.SVGSVGElement,canvas:!!i.CanvasRenderingContext2D,webgl:!!function(){try{var e=o.createElement("canvas");return!!i.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl"))}catch(e){return!1}}(),htmlTemplate:!!i.HTMLTemplateElement,htmlSlot:!!i.HTMLSlotElement,downloadHref:"download"in o.createElement("a"),blob:!!i.Blob,workers:!!i.Worker,fileapi:!!(i.File&&i.FileReader&&i.FileList&&i.Blob),sessionStorage:function(){try{return!!i.sessionStorage}catch(e){return!1}}(),localStorage:function(){try{return!!i.localStorage}catch(e){return!1}}(),cssTransition:(n=o.createElement("div").style,"transition"in n||"WebkitTransition"in n||"MozTransition"in n||"msTransition"in n||"OTransition"in n),cssTranform:function(e){return"transform"in e||"WebkitTransform"in e||"MozTransform"in e||"msTransform"in e||"OTransform"in e}(o.createElement("div").style),cssFlex:function(e){return"flex"in e||"WebkitFlex"in e||"MozFlex"in e||"msFlex"in e||"OFlex"in e}(o.createElement("div").style),cssGrid:function(e){return"grid"in e||"WebkitGrid"in e||"MozGrid"in e||"msGrid"in e||"OGrid"in e}(o.createElement("div").style),html5Form:{placeholder:"placeholder"in o.createElement("input"),supportType:function(e){var t=o.createElement("input");t.setAttribute("type",e);var n=t.type===e;if(n&&["text","url","search"].indexOf(e.toLowerCase())<0){t.value=":)",n=":)"!==t.value}return n}},mutationObserver:i.MutationObserver||i.MozMutationObserver||i.WebkitMutationObserver,resizeObserver:!!i.ResizeObserver,touchEvent:!!i.touchEvent,pointerEvent:!!i.PointerEvent,draggable:(t=o.createElement("div"),"draggable"in t||"ondragstart"in t&&"ondrop"in t)}),function(){for(var e=0,t=["ms","moz","webkit","o"],n=0;n<t.length&&!i.requestAnimationFrame;++n)i.requestAnimationFrame=i[t[n]+"RequestAnimationFrame"],i.cancelAnimationFrame=i[t[n]+"CancelAnimationFrame"]||i[t[n]+"CancelRequestAnimationFrame"];i.requestAnimationFrame||(i.requestAnimationFrame=function(t,n){var r=(new Date).getTime(),o=Math.max(0,16-(r-e)),a=i.setTimeout(function(){t(r+o)},o);return e=r+o,a}),i.cancelAnimationFrame||(i.cancelAnimationFrame=function(e){clearTimeout(e)})}(),Kekule.X={};var a,l=Kekule.X,u=function(e){return!function(e){return null==e}(e)},s=function(e){var t=i.getComputedStyle?i.getComputedStyle(e,null).position:e.currentStyle?e.currentStyle.position:null;return!!t&&(!!t&&("relative"===(t=t.toString().toLowerCase())||"absolute"===t))};if(l.MutationObserver=i.MutationObserver||i.MozMutationObserver||i.WebkitMutationObserver,l.Event={MOUSE_BTN_LEFT:0,MOUSE_BTN_RIGHT:2,MOUSE_BTN_MID:1,MOUSE_BTN_LR:3},l.Event.PointerType={MOUSE:"mouse",TOUCH:"touch",PEN:"pen"},l.Event.MouseButton={LEFT:0,RIGHT:2,MID:1,LR:3},l.Event.KeyCode={BACKSPACE:8,TAB:9,CLEAR:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPSLOCK:20,ESC:27,SPACE:32,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRTSC:44,INS:45,DEL:46,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SCROLLLOCK:145},l.Event.isSupported=(a={},function(e){if(0===e.indexOf("touch"))return Kekule.BrowserFeature.touchEvent;if(0===e.indexOf("pointer"))return Kekule.BrowserFeature.pointerEvent;var t={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img",unload:"win",resize:"win"},n=e.replace(/^on/,"");if(a[n])return a[n];var r="win"==t[n]?i:o.createElement(t[n]||"div"),l=(e="on"+n)in r;return l||(r.setAttribute(e,"return;"),l="function"==typeof r[e]),r=null,a[n]=l,l}),l.Event.Methods={getType:function(e){return e.__$type__||e.type},setType:function(e,t){e.__$type__=t;try{e.type=t}catch(e){}},getPointerType:function(e){return e.pointerType},getTarget:function(e){var t=e.__$target__||e.target||e.srcElement;return 3==t.nodeType&&(t=t.parentNode),t},setTarget:function(e,t){e.__$target__=t;try{e.target=t}catch(e){}},getCurrentTarget:function(e){return e.currentTarget},getEventPhase:function(e){return e.eventPhase},getAltKey:function(e){return e.altKey},getCtrlKey:function(e){return e.ctrlKey},getShiftKey:function(e){return e.shiftKey},getMetaKey:function(e){return e.metaKey},getRepeat:function(e){return e.repeat},getCharCode:function(e){return u(e.charCode)?e.charCode:e.keyCode},getKeyCode:function(e){return e.keyCode},getKey:function(e){return e.key},getCode:function(e){return e.code},getClientX:function(e){var t;if(e.touches){var n=e.touches[0];t=n&&n.clientX}return void 0===t&&(t=e.clientX),t},getClientY:function(e){var t;if(e.touches){var n=e.touches[0];t=n&&n.clientY}return void 0===t&&(t=e.clientY),t},getScreenX:function(e){var t;if(e.touches){var n=e.touches[0];t=n&&n.screenX}return void 0===t&&(t=e.screenX),t},getScreenY:function(e){var t;if(e.touches){var n=e.touches[0];t=n&&n.screenY}return void 0===t&&(t=e.screenY),t},getPageX:function(e){var t;if(e.touches){var n=e.touches[0];n&&u(n.pageX)&&(t=n.pageX)}if(void 0===t&&u(e.pageX)&&(t=e.pageX),void 0===t){var r=l.Event.getTarget(e).ownerDocument||l.Event.getTarget(e),i=r?r.body:null;t=l.Event.getClientX(e)+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0)}return t},getPageY:function(e){var t;if(e.touches){var n=e.touches[0];if(n&&u(n.pageY))return n.pageY}else if(void 0===t&&u(e.pageY))return e.pageY;if(void 0===t){var r=l.Event.getTarget(e).ownerDocument||l.Event.getTarget(e),i=r?r.body:null;t=l.Event.getClientY(e)+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)}return t},getOffsetX:function(e){if(u(e.offsetX))return e.offsetX;var t=l.Event.getTarget(e);if((t.defaultView||t.parentWindow)&&t.body&&(t=t.body),u(e.layerX)&&s(t)&&!e.touches)return e.layerX;var n=l.Event.getClientX(e);return Math.round(n-Kekule.HtmlElementUtils.getElemPagePos(t,!0).x)},getOffsetY:function(e){if(u(e.offsetY))return e.offsetY;var t=l.Event.getTarget(e);if((t.defaultView||t.parentWindow)&&t.body&&(t=t.body),u(e.layerY)&&s(t)&&!e.touches)return e.layerY;var n=l.Event.getClientY(e);return Math.round(n-Kekule.HtmlElementUtils.getElemPagePos(t,!0).y)},getOffsetCoord:function(e,t){var n,r=l.Event.getTarget(e);if(t&&Kekule.ObjUtils.isUnset(e.offsetX)&&(n=Kekule.StyleUtils.getTotalTransformMatrix(r)),n){var i=l.Event.getClientX(e),o=l.Event.getClientY(e),a={x:i-Kekule.HtmlElementUtils.getElemBoundingClientRect(r).x,y:o-Kekule.HtmlElementUtils.getElemBoundingClientRect(r).y},u=Kekule.StyleUtils.calcInvertTransformMatrix(n);if(u){var s=Kekule.MatrixUtils.create(3,1);s[0][0]=a.x,s[1][0]=a.y,s[2][0]=1;var c=Kekule.MatrixUtils.multiply(u,s);return a.x=c[0][0],a.y=c[1][0],a}}return{x:l.Event.getOffsetX(e),y:l.Event.getOffsetY(e)}},getWindowX:function(e){var t=l.Event.getPageX(e),n=e.target.ownerDocument||e.target,r=n&&(n.defaultView||n.parentWindow);return t-(r&&r.scrollX||0)},getWindowY:function(e){var t=l.Event.getPageY(e),n=e.target.ownerDocument||e.target,r=n&&(n.defaultView||n.parentWindow);return t-(r&&r.scrollY||0)},getRelXToCurrTarget:function(e){var t=l.Event.getCurrentTarget(e);(t.defaultView||t.parentWindow)&&t.body&&(t=t.body);var n=l.Event.getClientX(e);return Math.round(n-Kekule.HtmlElementUtils.getElemPagePos(t,!0).left)},getRelYToCurrTarget:function(e){var t=l.Event.getCurrentTarget(e);(t.defaultView||t.parentWindow)&&t.body&&(t=t.body);var n=l.Event.getClientY(e);return Math.round(n-Kekule.HtmlElementUtils.getElemPagePos(t,!0).top)},getTouches:function(e){return e.touches}},l.Event._MouseEventEx={isMouseEnterLeaveEvent:function(e){return"mouseenter"===e||"mouseleave"===e},addMouseEnterLeaveListener:function(e,t,n,r){if("mouseenter"===t&&l.Event.isSupported("mouseenter")||"mouseleave"===t&&l.Event.isSupported("mouseleave"))return e.addEventListener(t,n,r);var o=function(e){var r=e.getTarget?e.getTarget():e.target,o=e.getCurrentTarget?e.getCurrentTarget():e.currentTarget;if(r===o||Kekule.DomUtils.isDescendantOf(r,o)){var a=e.getRelatedTarget?e.getRelatedTarget():e.relatedTarget;if(!a||!Kekule.DomUtils.isDescendantOf(a,o)){var l=new MouseEvent(t,{view:i,bubbles:!1,cancelable:!0,target:o,currentTarget:o,relatedTarget:a});n.call(o,l)}}};n.__$mouseExListenerWrapper__=o;var a="mouseenter"===t?"mouseover":"mouseout";return e.addEventListener(a,o,r)},removeMouseEnterLeaveListener:function(e,t,n){if("mouseenter"===t&&l.Event.isSupported("mouseenter")||"mouseleave"===t&&l.Event.isSupported("mouseleave"))return e.removeEventListener(t,n);var r="mouseenter"===t?"mouseover":"mouseout";return e.removeEventListener(r,n.__$mouseExListenerWrapper__||n)}},l.Event._W3C={addListener:function(e,t,n,r){return l.Event._MouseEventEx.isMouseEnterLeaveEvent(t)?l.Event._MouseEventEx.addMouseEnterLeaveListener(e,t,n,r):e.addEventListener(t,n,r)},removeListener:function(e,t,n,r){return l.Event._MouseEventEx.isMouseEnterLeaveEvent(t)&&n.__$listenerWrapper__?l.Event._MouseEventEx.removeMouseEnterLeaveListener(e,t,n.__$listenerWrapper__):e.removeEventListener(t,n,r)},stopPropagation:function(e){e.stopPropagation()},preventDefault:function(e){e.preventDefault()}},l.Event._W3CMethods={getRelatedTarget:function(e){return e.relatedTarget},getButton:function(e){return e.button}},l.Event._Gecko={addListener:function(e,t,n,r){if(l.Event._MouseEventEx.isMouseEnterLeaveEvent(t))return l.Event._MouseEventEx.addMouseEnterLeaveListener(e,t,n,r);if("mousewheel"===t){var i=function(t){t.wheelDeltaY=t.wheelDelta=40*-t.detail,t.__$type__="mousewheel",n.call(e,t)};n.__$mousewheelListenerWrapper__=i,e.addEventListener("DOMMouseScroll",i,r)}else e.addEventListener(t,n,r)},removeListener:function(e,t,n,r){"mousewheel"===t&&n.__$mousewheelListenerWrapper__?e.removeEventListener("DOMMouseScroll",n.__$mousewheelListenerWrapper__,r):e.removeEventListener(t,n,r)}},l.Event._IE={_handlers:{},WIN_UNLOAD_FLAG_FIELD:"__$win_unload_linked__",addListener:function(e,t,n,r){if(!(l.Event.findHandlerIndex(e,t,n)>=0)){var i=function(t){t||(t=a.event),t.currentTarget=e,t.eventPhase=t.srcElement===e?2:3,f||Object.extend(t,v),n.call(e,t)};e.attachEvent(l.Event.getEventName(t),i),l.Event.registerHandler(e,t,n,i);var o=e.ownerDocument||e,a=o.parentWindow||o;l.Event._linkUnloadEvent(a)}},removeListener:function(e,t,n,r){var i=l.Event.findHandlerIndex(e,t,n);if(i>=0){var o=l.Event._handlers[t][i].wrapper;e.detachEvent(l.Event.getEventName(t),o),l.Event._handlers[t].splice(i,1)}},stopPropagation:function(e){e.cancelBubble=!0},preventDefault:function(e){e.returnValue=!1},removeAllListeners:function(e){var t=l.Event._handlers;if(t)for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];if(r&&r.length)for(var i=l.Event.getEventName(n),o=r.length-1;o>=0;--o){var a=r[o];e&&a.element.ownerDocument!==e||(a.element.detachEvent(i,a.wrapper),r.splice(o,1))}}},getEventName:function(e){return"on"+e},registerHandler:function(e,t,n,r){var i=l.Event._handlers;i[t]||(i[t]=[]),i[t].push({element:e,handler:n,wrapper:r})},unregisterHandler:function(e,t,n){if(n[t]){var r=n[t],i=l.Event.findHandlerIndex(e,t,n);i>=0&&r.splice(i,1)}},findHandlerIndex:function(e,t,n){var r=l.Event._handlers[t];if(!r)return-1;for(var i=0,o=r.length;i<o;++i){var a=r[i];if(a.element===e&&a.handler===n)return i}return-1},_linkUnloadEvent:function(e){var t=l.Event.WIN_UNLOAD_FLAG_FIELD;e[t]||(e.attachEvent("onunload",l.Event.reactWinUnload),e[t]=!0)},reactWinUnload:function(){var e=this.ownerDocument;l.Event.removeAllListeners(e)}},l.Event._IEMethods={getRelatedTarget:function(e){var t=e.type;return["focusin","mouseenter","mouseover","pointerenter","pointerover","dragenter"].indexOf(t)>=0?e.fromElement||e.toElement:e.toElement||e.fromElement},getButton:function(e){switch(e.button){case 1:return 0;case 2:return 2;case 4:return 1;case 3:return 3;default:return e.button}},stopPropagation:function(e){e.cancelBubble=!0},preventDefault:function(e){e.returnValue=!1}},o)if(o.addEventListener)l.Event=Object.extend(l.Event,l.Event._W3C),l.Event.Methods=Object.extend(l.Event.Methods,l.Event._W3CMethods),Kekule.Browser.Gecko&&(l.Event=Object.extend(l.Event,l.Event._Gecko));else if(o.attachEvent&&(l.Event=Object.extend(l.Event,l.Event._IE),l.Event.Methods=Object.extend(l.Event.Methods,l.Event._IEMethods),i.Element)){var c=i.Element.prototype;c.addEventListener=l.Event.addListener.methodize(),c.removeEventListener=l.Event.removeListener.methodize()}Object.extend(l.Event,l.Event.Methods);var d=null;i.Event&&(d=i.Event.prototype),d||o&&o.createEvent&&(d=o.createEvent("HTMLEvents").__proto__);var f=!!d,v={},m=l.Event.Methods;for(var g in m)m.hasOwnProperty(g)&&"function"==typeof m[g]&&(v[g]=m[g].methodize());d&&Object.extend(d,v),function(){if(void 0!==o){var e=o.createElement("div");!("draggable"in e)&&"ondragstart"in e&&"ondrop"in e&&Kekule.X.Event.addListener(o,"selectstart",function(e){for(var t=e.target;t;t=t.parentNode)if(t.attributes&&t.attributes.draggable)return e.preventDefault(),e.stopImmediatePropagation?e.stopImmediatePropagation():e.stopPropagation(),t.dragDrop(),!1})}}(),l.Ajax={XMLHttpFactories:[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],_availableFactoryIndex:-1,createXMLHTTPObject:function(){var e=!1,t=l.Ajax.XMLHttpFactories,n=l.Ajax._availableFactoryIndex;if(n>=0)e=t[n]();else for(var r=0;r<t.length;r++){try{e=t[r](),l.Ajax._availableFactoryIndex=r}catch(e){continue}break}return e},preparePostData:function(e){var t=e;return"object"==typeof e&&(t=Kekule.UrlUtils.generateSearchString(e)),t},request:function(e){return l.Ajax.sendRequest(e.url,e.callback,e.postData,e.xhrProps)},sendRequest:function(e,t,n,r,i){var o=!1,a=!0,u=l.Ajax.createXMLHTTPObject();if(u){var s,c,d=n?"POST":"GET";if(u.open(d,e,!0),u.setRequestHeader("User-Agent","XMLHTTP/1.0"),n&&u.setRequestHeader("Content-type","application/x-www-form-urlencoded"),r&&("object"==typeof r?(s=(c=r).responseType,i=c.overwriteMimeType):"string"==typeof r&&(s=r)),s){try{u.responseType=s}catch(e){}"arraybuffer"!==s&&"blob"!==s||(o=!0),u.responseType!==s&&(a=!1)}if(o&&!a&&u.overwriteMimeType&&u.overrideMimeType("text/plain; charset=x-user-defined"),i&&u.overwriteMimeType&&u.overwriteMimeType(i),c)for(var f in c)if(f in u)try{u[f]=c[f]}catch(e){}if(u.onreadystatechange=function(){if(4==u.readyState){if(200!=u.status&&304!=u.status)throw t(null,u,!1),"HTTP error "+u.status;t(u.response||u.responseText,u,!0)}},4!=u.readyState)return u.send(l.Ajax.preparePostData(n)),u}},getResponseMimeType:function(e){return e.getResponseHeader("content-type")||""}},Kekule.Ajax=Kekule.X.Ajax,Kekule.X.DomReady={isReady:!1,suspendFlag:0,funcs:[],domReady:function(e,t){if(t||(t=o),p.initReady(t),!p.isReady){var n=t&&t.readyState;("complete"===n||"loaded"===n||"interactive"===n&&!Kekule.Browser.IE)&&(p.isReady=!0)}p.isReady?e():p.funcs.push(e)},fireReady:function(){p.isReady||(p.isReady=!0,p._execFuncs())},_execFuncs:function(){var e=p.funcs;if(e&&e.length)for(;e.length&&!p.isSuspending();){var t=e.shift();t&&t()}},suspend:function(){++p.suspendFlag},resume:function(){p.suspendFlag>0&&--p.suspendFlag,p.isSuspending()||p._execFuncs()},isSuspending:function(){return p.suspendFlag>0},initReady:function e(t){t||(t=o),t&&t.addEventListener?t.addEventListener("DOMContentLoaded",function(){t.removeEventListener("DOMContentLoaded",e,!1),p.fireReady()},!1):t&&t.getElementById&&(t.write('<script id="ie-domReady" defer="defer" src="//:"><\/script>'),t.getElementById("ie-domReady").onreadystatechange=function(){"complete"===this.readyState&&(p.fireReady(),this.onreadystatechange=null,this.parentNode.removeChild(this))})}};var p=Kekule.X.DomReady;Kekule.X.domReady=p.domReady}(this),function(e){"use strict";var t=!0;"undefined"==typeof window&&(t=!1),Kekule.NativeServices={MODE_OPEN:"open",MODE_SAVE:"save",FILTER_ALL_SUPPORT:"all",FILTER_ANY:"any",showFilePickerDialog:function(e,t,n){if(Kekule.NativeServices.doShowFilePickerDialog)return Kekule.NativeServices.doShowFilePickerDialog(e,t,n)},canLoadFileData:function(e){return!!n.doLoadFileData||!!n.doShowFilePickerDialog},loadFileData:function(e,t,r){if(Kekule.NativeServices.doLoadFileData)return Kekule.NativeServices.doLoadFileData(e,t,r);var i=Object.create(r||{});i.multiple=!1,i.mode=n.MODE_OPEN;n.showFilePickerDialog(e,function(e,n,r){if(e&&n)if(Kekule.BrowserFeature.fileapi){var o=n.name,a=i.binaryDetector&&i.binaryDetector(o,n),l=new FileReader;l.onload=function(e){var n=l.result;t&&t(!0,n,o)},l.onerror=function(){t&&t(!1),Kekule.error(Kekule.$L("ErrorMsg.ERROR_LOADING_FILE"+o))},a?l.readAsArrayBuffer(n):l.readAsText(n)}else Kekule.error(Kekule.$L("ErrorMsg.FILE_API_NOT_SUPPORTED"));else t(e,null,null)},i)},canSaveFileData:function(e){return!!n.doSaveFileData},saveFileData:function(e,t,n,r){if(Kekule.NativeServices.doSaveFileData)return Kekule.NativeServices.doSaveFileData(e,t,n,r)}};var n=Kekule.NativeServices;Kekule.HtmlNativeServiceImpl={doShowFilePickerDialog:function(e,t,n){Kekule.HtmlNativeServiceImpl._createFileInputElem(e,t,n||{}).click()},_createFileInputElem:function(e,t,n){var r=e.createElement("input");r.setAttribute("type","file");var i=n||{};if(i.multiple&&r.setAttribute("multiple","multiple"),i.filters){for(var o=[],a=0,l=i.filters.length;a<l;++a){var u=i.filters[a];if(u!==Kekule.NativeServices.FILTER_ALL_SUPPORT&&u!==Kekule.NativeServices.FILTER_ANY){var s=u.filter;s&&o.push(s)}}var c=o.join(",");r.setAttribute("accept",c)}var d=r.style;d.position="absolute",d.left="-100000px",d.opacity=0,e.body.appendChild(r);var f=function(e){var n=e.getTarget(),r=n.files,i=r&&r[0];t&&t(!0,i,r),Kekule.X.Event.removeListener(n,"change",f),n.ownerDocument.body.focus(),n.parentNode};return Kekule.X.Event.addListener(r,"change",f),r},doSaveFileData:function(e,t,n,r){var i=r.initialFileName||null,o=Kekule.HtmlNativeServiceImpl._createDataElem(e,t,i);o.click(),o.parentNode.removeChild(o),n&&n(null,null)},_createDataElem:function(e,t,n){var r=e.createElement("a"),i="data:application/octet-stream,"+encodeURIComponent(t);r.setAttribute("href",i),r.setAttribute("download",n||"");r.style;return r.position="absolute",r.left="-100000px",r.opacity=0,e.body.appendChild(r),r},doSaveFileDataIe:function(e,n,r,i){var o=i.initialFileName||null;if(Kekule.BrowserFeature.blob&&t&&window.navigator.msSaveOrOpenBlob){var a=new Blob([n]);window.navigator.msSaveBlob(a,o)}else{var l=Kekule.HtmlNativeServiceImpl._createAndExecDataIframe(e,n,o);l.parentNode.removeChild(l)}r&&r(null,null)},_createAndExecDataIframe:function(e,t,n){var r=e.createElement("iframe");e.body.appendChild(r);var i=r.contentWindow||r.contentDocument;i.document.open("text/html","replace");var o=t.toString();return i.document.write(o),i.document.close(),i.focus(),i.document.execCommand("SaveAs",!0,Kekule.UrlUtils.extractFileCoreName(n)),r}},Kekule.BrowserFeature.fileapi&&(n.doShowFilePickerDialog=Kekule.HtmlNativeServiceImpl.doShowFilePickerDialog),Kekule.Browser.IE||t&&window.navigator.msSaveOrOpenBlob?n.doSaveFileData=Kekule.HtmlNativeServiceImpl.doSaveFileDataIe:Kekule.BrowserFeature.downloadHref&&(n.doSaveFileData=Kekule.HtmlNativeServiceImpl.doSaveFileData)}(),Kekule.PredefinedResLoader=Class.create(ObjectEx,{CLASS_NAME:"Kekule.PredefinedResLoader",initialize:function(e,t,n){this.tryApplySuper("initialize"),t?(this.setPropStoreFieldValue("resUri",t),this.setDoc(e),n&&this.setResType(n)):Kekule.Error(Kekule.$L("ErrorMsg.EMPTY_RESURI"))},initProperties:function(){this.defineProp("doc",{dataType:DataType.OBJECT,serializable:!1}),this.defineProp("resUri",{dataType:DataType.STRING,serializable:!1,setter:null}),this.defineProp("resType",{dataType:DataType.STRING,serializable:!1})},getLinkedResUrl:function(e){var t=e.tagName.toLowerCase();return"link"===t?e.getAttribute("href"):"script"===t?e.getAttribute("src"):null},getElemResType:function(e){return e.getAttribute("type")},load:function(e){var t,n,r=this.getResUri(),i=Kekule.PredefinedResReferer.ID_MARK;if(r.startsWith(i)){var o=r.substr(i.length).trim();if(t=this.getDoc().getElementById(o)){n=this.getLinkedResUrl(t);var a=this.getElemResType(t);a&&this.setResType(a)}}else n=r;var l={resType:this.getResType(),resUri:r};if(n)Kekule.X.Ajax.sendRequest(n,function(t,r,i){if(i){if(!(l=Object.extend(l,{data:t,text:r.responseText,success:!0})).resType&&(l.resType=Kekule.X.Ajax.getResponseMimeType(r),l.resType===Kekule.IO.MimeType.OCTSTREAM)){var o=Kekule.UrlUtils.extractFileExt(n);if(o){var a=Kekule.IO.DataFormatsManager.findFormat(null,o);a&&(l.resType=a.mimeType)}}e(l,i)}else e(l,!1)},null,null,this.getResType()||null);else if(t){var u=t.innerHTML,s=2,c=u.indexOf("\r\n");c<0&&(c=u.indexOf("\n"),s=1),0===c&&(u=u.substring(s)),l=Object.extend(l,{data:u,text:u,resType:l.resType||"text/plain",success:!0}),e(l,!0)}else e(l,!1)}}),Kekule.PredefinedResReferer={REFER_PATTERN:/^\s*url\((\S+)\)\s*$/,ID_MARK:"#",isResValue:function(e){return Kekule.PredefinedResReferer.isResReferrer(e)},isResReferrer:function(e){return Kekule.PredefinedResReferer.REFER_PATTERN.test(e)},extractReferedValue:function(e){var t=Kekule.PredefinedResReferer.REFER_PATTERN.exec(e);if(t){var n=t[1];if(n)return n=Kekule.StrUtils.unquote(n)}return null},loadResource:function(e,t,n,r){r||(r=document);var i,o=Kekule.PredefinedResReferer.extractReferedValue(e);(i=new Kekule.PredefinedResLoader(r,o))&&(n&&i.setResType(n),i.load(t))}},Kekule._registerAfterLoadSysProc(function(){Kekule.IO&&(Kekule.IO.loadResourceData=function(e,t,n,r){Kekule.PredefinedResReferer.loadResource(e,function(e,n){var r;n&&(r=Kekule.IO.loadTypedData(e.data,e.resType,e.resUri)),t&&t(r,n)},n,r)})}),Kekule.StyleUtils={removeStyleProperty:function(e,t){e.removeProperty?e.removeProperty(t):e.removeAttribute?e.removeAttribute(t):e[t]=null},analysisUnitsValue:function(e){var t,n={};if(n.total=e,n.value=parseFloat(e),e&&e.length&&void 0!==n.value&&!isNaN(n.value)){t="";for(var r=e.length-1;r>=0;--r){var i=e.charAt(r);i>="0"&&i<="9"||"."===i||"-"===i||(t=i+t)}}return n.units=t||"",n},multiplyUnitsValue:function(e,t){var n=Kekule.StyleUtils.analysisUnitsValue(e);return n.value*=t,""+n.value+n.units},colorStrToValue:function(e){var t=Kekule.StyleUtils.analysisCssColor(e,!0);return(Math.round(t.r)<<16)+(Math.round(t.g)<<8)+Math.round(t.b)},analysisCssColor:function(e,t){var n=Kekule.StyleUtils,r=(e||"").toLowerCase();if(0===r.indexOf("#")){var i=r.substr(1);return n._analyisCssColorHex(i)}if(0===r.indexOf("rgb")){var o=r.indexOf("("),a=r.indexOf(")");return o<0||a<0?null:n._analysisCssColorRgbOrHsl(r.substring(o+1,a),!1)}if(0===r.indexOf("hsl")){if(o=r.indexOf("("),a=r.indexOf(")"),o<0||a<0)return null;var l=n._analysisCssColorRgbOrHsl(r.substring(o+1,a),!0);return t&&(l=Object.extend(l,n._convertHslToRgb(l))),l}return null},_analyisCssColorHex:function(e){for(var t=e.length,n=3===t,r=n?1:2,i=Math.min(4,Math.floor(t/r)),o=[],a=0;a<i;++a){var l=a*r,u=e.substr(l,r);n&&(u+=u),o.push(parseInt(u,16))}var s={r:o[0]||0,g:o[1]||0,b:o[2]||0};return Kekule.ObjUtils.notUnset(o[3])?s.a=o[3]/255:s.a=1,s},_analysisCssColorRgbOrHsl:function(e,t){var n,r=Kekule.StyleUtils._convertCssNumOrPercentageToNum,i=e.split(",");return n=t?{h:r(i[0],360),s:r(i[1]),l:r(i[2])}:{r:r(i[0],255),g:r(i[1],255),b:r(i[2],255)},Kekule.ObjUtils.notUnset(i[3])?n.a=r(i[3]):n.a=1,n},_convertHslToRgb:function(e,t){t||(t=255);var n,r,i,o=e.h,a=e.s,l=e.l;if(0===a)n=r=i=l;else{var u=l<.5?l*(1+a):l+a-l*a,s=2*l-u,c=o/360,d=[c+1/3,c,c-1/3],f=0;for(l=d.length;f<l;++f)d[f]<0?d[f]=d[f]+1:d[f]>1&&(d[f]=d[f]-1),6*d[f]<1?d[f]=s+6*(u-s)*d[f]:2*d[f]<1?d[f]=u:3*d[f]<2?d[f]=s+6*(u-s)*(2/3-d[f]):d[f]=s;n=d[0],r=d[1],i=d[2]}return{r:n*t,g:r*t,b:i*t}},_convertCssNumOrPercentageToNum:function(e,t){var n=parseFloat(e)||0;return e.endsWith("%")&&(n=n/100*(t||1)),n},getComputedStyle:function(e,t){var n,r=e.ownerDocument;if(!r)return null;var i=r.defaultView;return i&&i.getComputedStyle?n=i.getComputedStyle(e,null):e.currentStyle&&(n=e.currentStyle),n?t?t.indexOf("-")>=0&&n.getPropertyValue?n.getPropertyValue(t):n[t]:n:null},isShown:function(e){var t=Kekule.StyleUtils;return t.isDisplayed(e)&&t.isVisible(e)},isDisplayed:function(e){return"none"!==(Kekule.StyleUtils.getComputedStyle(e,"display")||"").toLowerCase()},getDisplayed:function(e){return Kekule.StyleUtils.getComputedStyle(e,"display")},setDisplay:function(e,t){e&&(e.style.display="string"==typeof t?t:t?"":"none")},isVisible:function(e){return"hidden"!==(Kekule.StyleUtils.getComputedStyle(e,"visibility")||"").toLowerCase()},getVisibility:function(e){return Kekule.StyleUtils.getComputedStyle(e,"visibility")},setVisibility:function(e,t){e&&(e.style.visibility="string"==typeof t?t:t?"":"hidden")},isBlockElem:function(e){var t=Kekule.StyleUtils.getComputedStyle(e,"display");return["block","list-item","table","flex","grid"].indexOf(t)>=0},isAbsOrFixPositioned:function(e){var t=Kekule.StyleUtils.getComputedStyle(e,"position")||"";return"absolute"===(t=t.toLowerCase())||"fixed"===t},_fillAbsOrFixedPositionStyleStack:function(e,t){if(Kekule.DomUtils.isElement(e)){var n=Kekule.StyleUtils.getComputedStyle(e,"position")||"";"absolute"!==(n=n.toLowerCase())&&"fixed"!==n||t.push(n.toLocaleLowerCase())}var r=e.parentNode;return r&&r.ownerDocument&&Kekule.StyleUtils._fillAbsOrFixedPositionStyleStack(r,t),t},isAncestorPositionFixed:function(e){return!!e.parentNode&&Kekule.StyleUtils.isSelfOrAncestorPositionFixed(e)},isSelfOrAncestorPositionFixed:function(e){var t=[];if(Kekule.StyleUtils._fillAbsOrFixedPositionStyleStack(e,t),!t.length)return null;for(var n=t.length-1;n>=0;--n)if("fixed"===t[n])return!0;return!1},setCursor:function(e,t){if(DataType.isArrayValue(t)){for(var n=0,r=t.length;n<r;++n){var i=t[n];if(e.style.cursor=i,e.style.cursor===i)return i}return e.style.cursor}return e.style.cursor=t,e.style.cursor},_cssTransformValuesToMatrix:function(e){var t=Kekule.MatrixUtils.create(3,3,0);return t[0][0]=e.a,t[1][0]=e.b,t[0][1]=e.c,t[1][1]=e.d,t[0][2]=e.tx,t[1][2]=e.ty,t},_matrixToCssTransformValues:function(e){return{a:e[0][0],b:e[1][0],c:e[0][1],d:e[1][1],tx:e[0][2],ty:e[1][2]}},hasTransform:function(e){var t=Kekule.StyleUtils.getComputedStyle(e,"transform");return t&&"none"!==t},getTransformMatrixValues:function(e){var t=(Kekule.StyleUtils.getComputedStyle(e,"transform")||"").match(/-?[\d\.]+/g);return t?{a:t[0],b:t[1],c:t[2],d:t[3],tx:t[4],ty:t[5]}:null},setTransformMatrixArrayValues:function(e,t){if(t){var n="matrix("+t.join(",")+")";e.style.transform=n}},getTransformMatrix:function(e){var t=Kekule.StyleUtils.getTransformMatrixValues(e);return t?Kekule.StyleUtils._cssTransformValuesToMatrix(t):null},getCascadeTranformMatrixes:function(e){for(var t=[],n=e;n;){if(1===n.nodeType){var r=Kekule.StyleUtils.getTransformMatrix(n);r&&t.unshift(r)}n=n.parentNode}return t},getTotalTransformMatrix:function(e){for(var t=Kekule.StyleUtils.getCascadeTranformMatrixes(e),n=null,r=t.length-1;r>=0;--r){var i=t[r];n=n?Kekule.MatrixUtils.multiply(n,i):i}return n},calcInvertTransformMatrix:function(e){var t=Kekule.StyleUtils._matrixToCssTransformValues(e),n=t.a*t.d-t.b*t.c;if(Math.abs(n)<1e-6)return!1;var r={a:t.d/n,b:-t.b/n,c:-t.c/n,d:t.a/n,tx:(t.c*t.ty-t.d*t.tx)/n,ty:(t.b*t.tx-t.a*t.ty)/n};return Kekule.StyleUtils._cssTransformValuesToMatrix(r)}},Kekule.HtmlElementUtils={getClassNames:function(e){return Kekule.StrUtils.splitTokens(e.className)},hasClass:function(e,t){return Kekule.HtmlElementUtils.getClassNames(e).indexOf(t)>=0},addClass:function(e,t){for(var n=Kekule.HtmlElementUtils,r=Kekule.ArrayUtils.isArray(t)?t:Kekule.StrUtils.splitTokens(t),i=0,o=r.length;i<o;++i)n.hasClass(e,r[i])||(e.className+=" "+r[i]);return n},removeClass:function(e,t){for(var n=Kekule.HtmlElementUtils,r=Kekule.ArrayUtils.isArray(t)?t:Kekule.StrUtils.splitTokens(t),i=n.getClassNames(e),o=i.length;o>=0;--o)r.indexOf(i[o])>=0&&i.splice(o,1);return e.className=i.join(" "),n},toggleClass:function(e,t){for(var n=Kekule.HtmlElementUtils,r=Kekule.ArrayUtils.isArray(t)?t:Kekule.StrUtils.splitTokens(t),i=0,o=r.length;i<o;++i)n.hasClass(e,r[i])?n.removeClass(e,r[i]):n.addClass(e,r[i]);return n},getInnerText:function(e){return e.innerText||e.textContent},resizeElem:function(e,t,n,r){e.style.width=t+(r||"px"),e.style.height=n+(r||"px")},getElemClientDimension:function(e){return{width:e.clientWidth,height:e.clientHeight}},getElemScrollDimension:function(e){return{width:e.scrollWidth,height:e.scrollHeight}},getElemComputedDimension:function(e){var t=Kekule.StyleUtils,n={width:t.getComputedStyle(e,"width"),height:t.getComputedStyle(e,"height")},r=t.analysisUnitsValue(n.width),i=t.analysisUnitsValue(n.height),o={};return"px"===r.units&&(o.width=r.value),"px"===i.units&&(o.height=r.value),o},getElemOffsetDimension:function(e){return{width:e.offsetWidth,height:e.offsetHeight}},getViewportDimension:function(e){var t;if(e&&(t=e.ownerDocument?Kekule.DocumentUtils.getDefaultView(e.ownerDocument):e.defaultView?e.defaultView:e.parentWindow?e.parentWindow:e),null!=(t=t||window).innerWidth)return{width:t.innerWidth,height:t.innerHeight};var n=t.document;return"CSS1Compat"==n.compatMode?{width:n.documentElement.clientWidth,height:n.documentElement.clientHeight}:{width:n.body.clientWidth,height:n.body.clientHeight}},getViewportVisibleBox:function(e){var t;e&&(t=e.ownerDocument?Kekule.DocumentUtils.getDefaultView(e.ownerDocument):e.defaultView?e.defaultView:e.parentWindow?e.parentWindow:e);var n=(t=t||window).document,r=Kekule.HtmlElementUtils.getViewportDimension(t),i=Kekule.DocumentUtils.getScrollPosition(n),o={x1:i.left,y1:i.top,x2:r.width,y2:r.height};return o.left=o.x1,o.top=o.y1,o.right=o.x2,o.bottom=o.y2,o},getElemBoundingClientRect:function(e,t){var n=Object.extend({},e.getBoundingClientRect());if(Kekule.ObjUtils.isUnset(n.width)&&(n.width=n.right-n.left),Kekule.ObjUtils.isUnset(n.height)&&(n.height=n.bottom-n.top),t){var r=e.ownerDocument,i=r.documentElement.scrollTop||r.body.scrollTop||0,o=r.documentElement.scrollLeft||r.body.scrollLeft||0;n.left+=o,n.right+=o,n.top+=i,n.bottom+=i}var a=n;return a.x=a.left,a.y=a.top,a},getElemPagePos:function(e,t){for(var n=0,r=0,i=e;i;)n+=i.offsetLeft-i.scrollLeft+i.clientLeft,r+=i.offsetTop-i.scrollTop+i.clientTop,i=i.offsetParent;if(t){var o=e.ownerDocument,a=o.documentElement.scrollTop||o.body.scrollTop||0;n-=o.documentElement.scrollLeft||o.body.scrollLeft||0,r-=a}return{x:n,y:r}},getElemPageRect:function(e,t){var n=Kekule.HtmlElementUtils.getElemPagePos(e,t),r=Kekule.HtmlElementUtils.getElemClientDimension(e);return{x:n.x,y:n.y,left:n.x,top:n.y,right:n.x+r.width,bottom:n.y+r.height,width:r.width,height:r.height}},getElemViewportPos:function(e){var t=Kekule.HtmlElementUtils.getElemPagePos(e,!0);return{x:t.left,y:t.top}},makePositioned:function(e){var t=Kekule.StyleUtils.getComputedStyle(e,"position");t&&"static"!==t.toLowerCase()||(e.style.position="relative")},isFormCtrlElement:function(e){var t=e&&e.tagName.toLowerCase();return!!t&&["input","button","textarea","select"].indexOf(t)>=0},requestFullScreen:function(e){var t=e.requestFullScreen||e.mozRequestFullScreen||e.webkitRequestFullScreen||e.msRequestFullScreen;return t?t.apply(e):null},exitFullScreen:function(e){var t=e.exitFullScreen||e.mozExitFullScreen||e.webkitExitFullScreen||e.msExitFullScreen;return t?t.apply(e):null}},Kekule.DocumentUtils={getDefaultView:function(e){return e.defaultView||e.parentWindow},getScrollPosition:function(e){var t=Kekule.DocumentUtils.getDefaultView(e),n={left:(void 0!==t.pageXOffset?t.pageXOffset:(e.documentElement||e.body.parentNode||e.body).scrollLeft)||0,top:(void 0!==t.pageYOffset?t.pageYOffset:(e.documentElement||e.body.parentNode||e.body).scrollTop)||0};return n.x=n.left,n.y=n.top,n},getClientDimension:function(e){return"BackCompat"==e.compatMode?{width:e.body.clientWidth,height:e.body.clientHeight}:{width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}},getClientVisibleBox:function(e){var t=Kekule.DocumentUtils.getScrollPosition(e),n=Kekule.DocumentUtils.getInnerClientDimension(e),r={};return r.left=r.x1=t.left,r.top=r.y1=t.top,r.right=r.x2=n.width+t.left,r.bottom=r.y2=n.height+t.top,r.width=n.width,r.height=n.height,r},getWindowInnerDimension:function(e){var t=Kekule.DocumentUtils.getDefaultView(e);return{width:Math.min(t.innerWidth,t.outerWidth),height:Math.min(t.innerHeight,t.outerHeight)}},getInnerClientDimension:function(e){var t=Kekule.DocumentUtils.getClientDimension(e),n=Kekule.DocumentUtils.getWindowInnerDimension(e);return{width:n.width?Math.min(n.width,t.width):t.width,height:n.height?Math.min(n.height,t.height):t.height}},getClientScaleLevel:function(e){return"BackCompat"==e.compatMode?e.body.clientWidth/window.innerWidth:e.documentElement.clientWidth/window.innerWidth},getPixelZoomLevel:function(e){return Kekule.DocumentUtils.getClientScaleLevel(e)*(Kekule.DocumentUtils.getDefaultView(e).devicePixelRatio||1)},getDevicePPI:function(e){var t=Kekule.DocumentUtils.getDefaultView(e);if(t.matchMedia){for(var n=0,r=0,i=200;!r||r-n>1;)t.matchMedia("(min-resolution: "+i+"dpi)").matches?r?(n=i,i=Math.round((n+r)/2)):(n=i,i*=2):(r=i,i=Math.round((n+r)/2));return i}return 96}};