/* @license Copyright (C) Exontrol. All rights reserved. */ !function(){"use strict";function e(e){try{var t=window.innerWidth-K,o=parseInt(getComputedStyle(vsplit).width)+4,r=K;e=Math.max(0,Math.min(e,t-o)),list.style.width=z(e),content.style.width=z(t-(o+parseInt(list.style.width))),vsplit.style.height=content.style.height=list.style.height=z(window.innerHeight-r),n()}catch(e){}}function n(){}function t(){window.frameElement&&(window.frameElement.height=window.parent.innerHeight-58)}function o(){oe(F,de,!Filter.value)}function r(e){return(e=(null!=e?String(e):"").toLowerCase())&&"ex"!=e.substr(0,"ex".length)&&(e="ex"+e),e}function i(){return document.getElementById(ye)}function a(e,n){return e.getElementsByTagName(n).item(0)}function l(e,n){function t(){I&&I.setExample(e.exsamp.sQ)}if(e&&e.exsamp){var o=i();o&&o==e||(c(!1),e.id=ye,!k.Get(Be)&&I&&(n?t():(clearTimeout(D),D=setTimeout(function(){t()},64))),e.parentElement.id&&e.exsamp.e&&(k.Set(Le,e.parentElement.id),k.Set(Ie,e.exsamp.e),k.Set(Be,null),window.top.history.replaceState(null,null,k.href),oe(content,ye)))}}function c(e){var n=i();n&&(n.removeAttribute(be),(e||null==e)&&(k.Set(Ie,null),k.Set(Be,null),window.top.history.replaceState(null,null,k.href),oe(content,ye,!0)))}function u(e){if(e&&e.exsamp){var n=e.parentElement,t=n.previousElementSibling,o=i();e.remove(),h(t),!o&&window.top.history.replaceState(null,null,k.Set(Ie,null).href),oe(content,ye,o),p(n),qe&&(e=function(e){for(var n=e.lastElementChild;n&&~n.className.indexOf(pe);)n=n.previousElementSibling;return n}(n))&&oe(e,xe)}}function s(e,n){if(B&&clearTimeout(B),e&&e.scrollIntoView){var t={block:"nearest"};(n=null!=n?n:128)?B=setTimeout(function(){t.behavior="smooth",e.scrollIntoView(t),B=null},n):e.scrollIntoView(t)}}function f(e,n,t){e=ne(e);var o=Z(e);return{q:e,p:function(e){var n,t=e instanceof HTMLLIElement?e.parentElement:e,o="";return t instanceof HTMLUListElement&&~(n=(o=t.previousElementSibling.innerText.toLowerCase()).indexOf("\n"))&&(o=o.substr(0,n).trim()),ae+o}(t),e:o.o&&o.o.e&&o.o.e[0]||n||0,sQ:o}}function m(e){function n(e){!function(e,n){e&&e.exsamp&&(e.exsamp=f(ee(e.exsamp.sQ.c,n,e.exsamp.sQ.o),e.exsamp.e,e),i()==e&&!k.Get(Be)&&I&&I.setExample(e.exsamp.sQ),p(e.parentElement))}(this.parentElement.parentElement,this.innerHTML)}function t(e){if(13==e.keyCode)return I&&I.code.focus(),V(e)}var o,r,c=i(),u=e.previousElementSibling.exname;return c&&c.parentElement!=e&&!confirm("You are about to add a copy of the selected question '"+c.exsamp.sQ.d+"' to a different component '"+u+"'. Is this really what you want to do?")||(r=Q.addLI(e,(c&&c.exsamp.q||De+ie+"o"+u).replace(Me,"$1"+function(){var n,t,o=e.children.length+1,r=e.lastChild;return r&&r.exsamp&&(n=r.exsamp.e)&&(t=n.match(Re))&&(o=n.replace(Re,1+~~t[0])),o}()+"$3").replace(He,""),!0))&&(qe&&(r.className=xe,(o=a(r,"QDESC"))&&(o.setAttribute(fe,ue),o.oninput=n,o.onkeydown=t)),l(r),s(r),p(e)),r}function d(e){for(var n=e&&e.target;n;){if(n.tagName!=le&&n.tagName!=ce||(n=n.parentElement),n&&Q.contains(n)&&"A"==n.tagName&&"LI"==n.parentElement.tagName)return n;n=n.parentElement}}function h(e){if(e&&e.exname){var n,t=e.exname,o=document.getElementById(r(e.exname));o&&o.children&&o.children.length&&(n=o.children.length-te(o.getElementsByClassName(pe)).length)&&(t+=""+n,n!=o.children.length&&(t+="/"+o.children.length),t+=""),e.innerHTML=t}}function p(e,n){oe(e,he,n),oe(e.previousElementSibling,he,n),!n&&w(e)}function g(e){return e?[e]:te(Q.getElementsByTagName(Qe))}function w(e){g(e).forEach(function(e){e.exblob&&(URL.revokeObjectURL(e.exblob),e.exblob=null)})}function x(e){var n,t=new Map,o=[];if(e){for(var r in Y)t.set(r=(ae+r).toLowerCase(),r);e.toLowerCase().split(" ").forEach(function(e){(e=function(e){if(e&&e.startsWith(ae))for(var n in re)if(~re[n].indexOf(e)){e=n;break}return e}(e.trim()))&&(!n&&t.has(e)?n=e:~o.indexOf(e)||o.push(e))})}return(n||o.length)&&{c:n,f:o}||null}function v(e){function n(e){return e.exsamp.q}function t(e){te(document.getElementsByClassName(pe)).forEach(function(e){oe(e,pe,!0)}),r&&Q.getElementsByTagName(Te).forEach(function(n){n.exsamp&&!((!r.c||n.exsamp.p==r.c)&&function(e){for(var n=!0,t=0,o=r.f.length;n&&t"}function b(e,n,t){var o="",r=0,i=-1,a=n.length;if(a)for(;~(i=e.indexOf(n,r));)o+=e.substr(r,i-r)+t,r=i+a;return o+=e.substr(r)}function y(e,n){var t="";return e.children.forEach(function(e){if(!~e.className.indexOf(ve)&&e.exsamp&&(t+=t?ie:"",t+=e.exsamp.q,n))for(var o=e.exsamp.q,r=0,i=o.length;!n.c&&r255&&(n.c=o.charAt(r),n.li=e)}),function(e){return R&&R.forEach(function(n,t){e=b(e,n,E(t))}),e}(t).replace(/\n/g,"\r\n")}function S(e){g(e).forEach(function(e){~e.className.indexOf(he)&&function(e){function n(e){var n=this.parentElement.nextElementSibling;this.remove(),e&&n&&p(n,!0)}var t,o=e.previousElementSibling;o&&o.exname&&(te(o.getElementsByClassName(ge)).forEach(function(e){n.call(e)}),w(e),e.exblob=URL.createObjectURL(new Blob([y(e)],{type:"text/plain"})),(t=document.createElement(Se)).href=e.exblob,t.download=e.id+se,t.className=ge,t.onclick=n,o.appendChild(t))}(e)})}function T(e){var n,t,o,r,i,a=window.top.location;if("file:"==a.protocol&&(n=a.pathname.substr(1,a.pathname.lastIndexOf("/")))){for(var c={},u=g(e),f=0,m=u.length;!i&&fl;)c=l,l=t+ie.length,u++;n=a.substr(c,i-c),c=i-c,r=e.getBoundingClientRect(),o=getComputedStyle(e),e.scrollLeft=function(e,n){var t=document.createElement("canvas").getContext("2d");return t.font=n,t.measureText(e)}(n,o.font).width-r.width/2,e.scrollTop=parseInt(o.lineHeight)*u-r.height/2}(I.code)}},128)}):t&&((o=new XMLHttpRequest).onreadystatechange=function(){this.readyState==(XMLHttpRequest.DONE||4)&&(~this.response.indexOf(Ce)?te(Q.getElementsByClassName(he)).forEach(function(e){oe(e,he,!0)}):H||(H=!0,alert("The 'localhost-upload.py' server failed. You need to start the 'localhost-upload.py' server, to let changes being saved once CTRL + S is pressed (also make sure that only ANSI characters are allowed!!).")))},o.open("POST","http://localhost:6798/"),o.send(t))}}function N(){document.getElementsByClassName(he).length&&(M||!qe||confirm("Do you want to save the changes?"))&&(M=!0,S(),qe&&T())}function L(e,n){function t(e){return e&&(e.nextElementSibling||e.parentElement.nextElementSibling&&e.parentElement.nextElementSibling.nextElementSibling&&e.parentElement.nextElementSibling.nextElementSibling.firstElementChild)}function o(e){return e&&(e.previousElementSibling||e.parentElement.previousElementSibling&&e.parentElement.previousElementSibling.previousElementSibling&&e.parentElement.previousElementSibling.previousElementSibling.lastElementChild)}for(var r=-1==e||2==e?o:t,i=function(e,n){var r;return-2==e||2==e?(r=Q.getElementsByTagName(Te))&&r.length&&(-2==e?r.item(0):r.item(r.length-1))||null:-1==e?o(n):t(n)}(e,n);i&&~i.className.indexOf(pe);)i=r(i);return i}function C(){return(new Date).getTime()}function O(){function e(){var e,n="Runs in: "+function(e){function n(e,n){var o=1==e?t:t%e;return t=~~(t/e),o?o+n:""}for(var t=e,o=[n(1e3," ms"),n(60," sec"),n(60," min"),n(24," hour"),n(1," day")],r="",i=o.length-1;i>=0;i--)o[i]&&(r+=(r?" ":"")+o[i]);return r}(C()-c),t=window.extnfo,o=n;t&&(t.err&&(n+="\nError(s): "+(t.err||0)),t.run&&(n+="\nRun for: "+(t.run||0)+" times"),t.rel&&(n+="\nReplace path for: "+(t.rel||0)+" times"),t.occ&&(n+="\nUnique replace path for: "+t.occ.size+" times"),o=n,t.occ&&t.occ.forEach(function(e,n){o+="\n "+n}),e="\nChecksum: "+((t.run||0)*(t.run||0)+(t.rel||0)+1)*((t.err||0)+1)*((t.occ&&t.occ.size||0)+1)%256,n+=e,o+=e),setTimeout(function(){alert(n),console.log("--------------------------------"),console.log(o),console.log("--------------------------------")},128),window.exttsa=null}function n(){clearTimeout(t),t=setTimeout(function(){Pe?e():(l(r,!0),s(r,0),window.extnfo=window.extnfo||{},window.extnfo.run=(window.extnfo.run||0)+1,(r=L(1,r))?n():e())},a)}var t,o,r=i(),a=64,c=C();if(!r&&(o=Q.getElementsByTagName(Qe)))for(var u=0,f=o.length;!r&&u/,Ue=/(?:.*\s*){2}/m,De="//e://t://k://Sample",qe=comrun.isLocal(),Pe=!1,Ve="AddTreeView,RemoveTreeView,TreeView,TreeColumnIndex".split(",");window.onload=function(){function n(){function e(e,n){var t,o=i.get(e.toLowerCase());o&&(t=document.getElementById(r(n)))&&Q.addUL(n.toLowerCase(),function(t){return t=function(e,n,t,o){var r="",i=0,a=-1,l=n.length;if(l)for(;~(a=e.indexOf(n,i));)r+=e.substr(i,a-i)+(o(a,n)?t:n),i=a+l;return r+=e.substr(i)}(t,e,n,function(e,n){function o(e){return/['"]/.test(e)}function r(e){return/\s|[\[\](){};,]/.test(e)||o(e)}for(var i,a=!0,l=e,c=e+n.length,u=t.length;l-1>0&&!r(t.charAt(l-1));)l--;for(l>0&&o(t.charAt(l-1))&&l--;co.clientWidth-18)&&o.exname?m(o.nextElementSibling):o.exsamp?t?confirm("You are about to delete '"+o.exsamp.sQ.d+"'. Is this really what you want to do?")&&u(o):l(o):o.className.indexOf(ge)<0&&(o==Q||!function(e){for(;e;){if(e.exsamp)return!0;e=e.parentElement}}(o))&&(c(),o.exname&&window.top.history.replaceState(null,null,k.Set(Le,r(o.exname)).href)))})},Q.onkeydown=function(e){if(document.activeElement==Q){var n=0,t=e.keyCode,o=i();if(36==t&&(n=-2),38==t&&(n=-1),40==t&&(n=1),35==t&&(n=2),n)return e.altKey?Filter.focus():(l(o=L(n,o)||function(){var e,n,t=L(-2);if(t)for(n=t.offsetTop;t&&t.offsetTop-n'+r.exsamp.e+""+function(e){var n=Fe.exec(e);return n&&(e=e.substr(0,n.index).trim()),e}(r.exsamp.sQ.d)+"",e.insertBefore(r,o),t&&h(e.previousElementSibling),r},Q.addUL=function(e,n,t){function o(n){if(!c){var o=document.createElement(Ne);o.exname=e,qe&&(o.className=we),(c=document.createElement(Qe)).id=l,Q.insertBefore(c,function(e){for(var n=null,t=Q.getElementsByTagName(Qe),o=0,r=t.length;ot.item(o).id;o++)n=t.item(o);return n&&n.nextElementSibling||null}(l)),Q.insertBefore(o,c),h(o)}if(n=ne(n))return Q.addLI(c,n,null,t)}if(e){var i,a=-1,l=r(e),c=document.getElementById(l);return _(Me,n,function(e){~a&&(i=o(n.substr(a,e.index-a))||i),a=e.index}),i=o(n.substr(a))||i,qe&&i&&!~i.className.indexOf(ve)&&oe(i,xe),c}},Filter.oninput=function(){clearTimeout(U),U=setTimeout(function(){v(Filter.value||"")},256)},Filter.onkeydown=function(e){if(38==e.keyCode||40==e.keyCode)return Q.focus(),!1},Q.style.background="url(https://exontrol.com/images/wait.gif) no-repeat center",I=content.contentWindow,k=new P(function(){var e="";return G(function(){e=window.top.location.href},window),e}()),(A=new P(k.o.host)).Set("config","/js"),t(),Ae=~~((~~W(me)||Ae+1)-1),o(),e(Ae),document.getElementsByClassName(Ee).forEach(function(e){(R=R||new Map).set(e.id,b(e.innerHTML,"-x_yz2","").trim())}),n()},window.onpointerdown=window.onmousedown=function(e){var n=function(e){var n=e&&e.target;if(n.tagName==le)return n}(e);if((!n||n.getAttribute(fe)!=ue)&&d(e))return V(e)},window.onclick=function(e){var n=d(e);if(n)return l(n.parentElement),V(e)},window.onbeforeunload=function(){w(),j(me,Ae+1)},window.onresize=function(){t(),e(Ae),n()},window.onkeydown=function(e){var n=!1;switch(e.keyCode){case 83:(n=e.ctrlKey)&&N();break;case 27:Pe=!0;break;case 13:(n=qe&&e.shiftKey&&e.ctrlKey)&&O()}if(n)return V(e)},window.onexample=function(e){var n,t,o=e,r=i();r&&r.exsamp.q!=o&&(r.exsamp=f(o,0,r),(n=a(r,ce))&&(n.innerHTML=r.exsamp.e),(t=a(r,le))&&(t.innerHTML=r.exsamp.sQ.d),p(r.parentElement)),N()},window.setError=function(e,n,t,o){e&&(Pe=!0)},window.testAll=O}();