!function(b,J,m){"use strict";var s="px",N="0",K="innerHTML",g="className",d=ht.Default,H=ht.Color,x=ht.Node,n="position",Z="top",l="left",E=d.animate,W=d.getInternal(),z="width",N="0",v="none",U="max-height",c="font",D="background",V="border-box",k="user-select",L="box-sizing",o="overflow",h=d.isTouchable,T=d.isTouchEvent,W=d.getInternal(),f=H.titleIconBackground,j=d.scrollBarInteractiveSize,r=/msie 9/.test(b.navigator?b.navigator.userAgent.toLowerCase():""),S=null,B=function(){return document},Y=function(Y){return B().createElement(Y)},X=function(){return Y("div")},p=function(){var Y=X(),l=Y.style;return l.msTouchAction=v,l.cursor="default",h&&l.setProperty("-webkit-tap-highlight-color","rgba(0, 0, 0, 0)",S),l.position="absolute",l.left=N,l.top=N,Y},t=function(){return Y("canvas")},C=function(){return document.body},q=function(A,e,C){A.style.setProperty(e,C,S)},e=function(G,M){G.style.removeProperty(M)},P=function(e,V,X){d.def(ht.widget[e],V,X)},I=function(V,i){V.appendChild(i)},R=function(G,C){G.removeChild(C)},u=W.addEventListener;W.removeEventListener,W.addMethod(d,{paletteExpandIcon:{width:16,height:16,comps:[{type:"triangle",rect:[4,4,10,8],background:f,rotation:3.14}]},paletteCollapseIcon:{width:16,height:16,comps:[{type:"triangle",rect:[4,4,10,8],background:f}]},paletteTitleLabelColor:d.labelSelectColor,paletteTitleLabelFont:d.labelFont,paletteContentLabelFont:d.labelFont,paletteContentLabelColor:"#777",paletteContentBackground:"#fff",paletteTitleHeight:d.widgetTitleHeight,paletteTitleBackground:H.titleBackground,paletteTitleHoverBackground:H.titleBackground,paletteSeparatorWidth:1,paletteSeparatorColor:m,paletteItemHoverBorderColor:H.highlight,paletteItemSelectBackground:H.highlight},!0);var A=".palette-item:hover{border: 1px solid "+d.paletteItemHoverBorderColor+" !important}"+" .palette-header:hover{background: "+d.paletteTitleHoverBackground+" !important}",w=document.createElement("style");h||(w.styleSheet?w.styleSheet.cssText=A:w.appendChild(B().createTextNode(A))),B().getElementsByTagName("head")[0].appendChild(w);var Q=function(K){var i=this;i.$22h=K,i.addListeners()};d.def(Q,J,{ms_listener:1,getView:function(){return this.$22h.getView()},$26h:function(){var V=this;V.$36h&&C().removeChild(V.$36h),V.$23h=V.$24h=V.$25h=V.$35h=V.$36h=S},handle_touchstart:function(Y){for(var w,r=this,i=r.$22h,s=Y.target,f=i.sm(),C=i.dm(),F="palette-header",X="palette-header-tool",b="palette-item",_=!1,V=!1,q=!1;s&&(s[g]||"").indexOf(F)<0&&(s[g]||"").indexOf(b)<0;)s=s.parentNode;if(s&&s[g].indexOf(X)>=0?_=!0:s&&s[g].indexOf(F)>=0?q=!0:s&&s[g].indexOf(b)>=0&&(V=!0),d.isLeftButton(Y))if(r.$27h(Y))r.$24h=d.getClientPoint(Y),r.$25h=i.ty();else if(_){d.preventDefault(Y),w=s.parentNode.$11h;var P=C.getDataById(w),R=P.s("tools")[s.toolIndex];R.action&&R.action.call(i)}else if(q){d.preventDefault(Y),w=s.$11h;var P=C.getDataById(w);P.isExpanded()?P.setExpanded(!1):P.setExpanded(!0)}else if(V){w=s.$11h;var z=C.getDataById(w);f.ss(z),i.handleDragAndDrop&&(d.preventDefault(Y),z.s("draggable")&&(i.handleDragAndDrop(Y,"prepare"),r.$35h=0)),z.s("draggable")||(d.preventDefault(Y),r.$24h=d.getClientPoint(Y),r.$25h=i.ty())}else d.preventDefault(Y),r.$24h=d.getClientPoint(Y),r.$25h=i.ty();else r.$26h(Y)},handle_mousedown:function(L){this.handle_touchstart(L)},handle_mousewheel:function(r){this.handleScroll(r,r.wheelDelta/40,r.wheelDelta!==r.wheelDeltaX)},handle_DOMMouseScroll:function(i){this.handleScroll(i,-i.detail,1)},handleScroll:function(Y,H,W){var B=this.$22h;d.preventDefault(Y),W&&B._41o()&&B.ty(B.ty()+20*H)},handle_mouseup:function(f){this.handle_touchend(f)},handle_touchend:function(H){var g=this;g.$37h(H),g.$26h(H)},handleWindowMouseUp:function(Y){this.handleWindowTouchEnd(Y)},handleWindowTouchEnd:function(M){var a=this;a.$37h(M),a.$26h(M)},$37h:function(Z){var E=this,N=E.$22h;2===E.$35h&&(E.$35h=3,N.handleDragAndDrop(Z,"end"))},handleWindowMouseMove:function(Y){this.handleWindowTouchMove(Y)},handleWindowTouchMove:function(g){var N=this,e=N.$22h,Y=N.$23h,B=N.$24h,k=N.$25h,p=d.getClientPoint(g),m=e._29I,U=N.$36h;if(1===N.$35h||2===N.$35h){if(N.$35h=2,e.handleDragAndDrop(g,"between"),T(g)){var H=g.touches[0];g=H?H:g.changedTouches[0]}U.style.left=g.pageX-parseInt(U.width)/2+s,U.style.top=g.pageY-parseInt(U.height)/2+s}else"p"===Y?e.ty(k+p.y-B.y):"v"===Y&&e.ty(k+(B.y-p.y)/m.height*e._59I)},handle_mousemove:function(s){this.handle_touchmove(s)},handle_touchmove:function(V){if(!d.isDragging()&&d.isLeftButton(V)){var F=this,M=F.$22h,f=F.$27h(V);if(F.$24h){if(!F.$23h){if(d.getDistance(d.getClientPoint(V),F.$24h)<2)return;F.$23h=f?"v":"p",d.startDragging(F,V)}}else if(f)M._43o();else if(0===F.$35h){if(F.$35h=1,M.handleDragAndDrop(V,"begin"),d.startDragging(F,V),T(V)){var G=V.touches[0];V=G?G:V.changedTouches[0]}var g=F.$36h=new Image,O=M.$10h[M.sm().ld().getId()].querySelector(".image-box"),p=parseInt(O.style.width),z=parseInt(O.style.height);g.draggable=!1,g.src=O.toDataURL(),g.width=p,g.height=z,g.style.position="absolute",g.style.left=V.pageX-p/2+s,g.style.top=V.pageY-z/2+s,C().appendChild(g)}}},$27h:function(E){var k=this.$22h,h=k.getView(),O=h.getBoundingClientRect(),I=k._29I,l=E.clientX-O.left+h.scrollLeft;return k._41o()&&I.x+I.width-lt||(g.$21h=t)}}for(var i in b){v=b[i];var W,u;if(p.contains(v)){if(v instanceof ht.Group){var h,o=g.$1h(v),c=j[v.getId()];c&&(h=c.nextSibling,R(J,h),R(J,c)),n=p.getSiblings(v).indexOf(v);var C=J.children[2*n]||g._79O;C&&C.parentNode?(J.insertBefore(o[0],C),J.insertBefore(h||o[1],C)):(J.appendChild(o[0]),J.appendChild(h||o[1])),j[v.getId()]=o[0],k=l[v.getId()]=h||o[1],u=v.$12h;var V=v.s("promptText");u||(v.$12h=Y("div"),v.$12h[K]=V||"",u=v.$12h),0===v.getChildren().size()?k.contains(u)||I(k,u):k.contains(u)&&R(k,u)}else if(W=v.getParent()){var T=g.$2h(v),a=j[v.getId()];k=l[W.getId()],a&&R(a.parentNode,a),n=p.getSiblings(v).indexOf(v);var w=k.children[n];w?k.insertBefore(T,w):I(k,T),j[v.getId()]=T,g.$14h(v)}}else{var P=j[v.getId()],D=P.parentNode;if(v instanceof ht.Group){var M=P.nextSibling;R(J,P),R(J,M),delete l[v.getId()]}else R(D,P),0===D.children.length&&(W=p.getDataById(D.$11h),W&&(u=W.$12h,u&&!D.contains(u)&&I(D,u)));delete j[v.getId()]}}g.$4h={};var e=function(){var z=g._59I,f=0;g.$32h!=S&&(clearInterval(g.$32h),f=0,delete g.$32h),g.$32h=setInterval(function(){g.$31h(),z===g._59I?(f++,f>=2&&(clearInterval(g.$32h),delete g.$32h)):(f=0,z=g._59I)},30)};for(var F in l)if(k=l[F],v=p.getDataById(l[F].$11h),g.$15h(v),g._drawToolsIcon(v),v.isExpanded()){if(k.style.maxHeight===0+s){var m=k.scrollHeight+g._itemMargin+s;E(k).duration(200).set(U,m).set("padding-bottom",g._itemMargin+s).end(function(){return function(){e()}}(m))}else k.style.maxHeight=k.scrollHeight+s;k.style.paddingBottom=g._itemMargin+s}else k.style.maxHeight!==0+s&&E(k).duration(200).set(U,N).set("padding-bottom",N).end(function(){return function(){e()}}(k));g.$28h(),g.$31h()},$31h:function(){for(var x=this,m=x._view,w=0,d=m.children,c=0;c=0&&(w+=l.offsetHeight)}x._59I=w,x.$30h=x.$33h(x.ty());var S=x.ty();m.scrollTop=-S,x._29I={x:0,y:-S,width:m.clientWidth,height:m.clientHeight},q(x._79O,Z,-S+s),x._93I()},$33h:function(p){var $=this,E=$._29I.height-$._59I;return E>p&&(p=E),p>0?0:Math.round(p)},redraw:function(){this.$13h||(this.$13h=1,this.iv())},onPropertyChanged:function(u){["autoHideScrollBar","scrollBarSize","scrollBarColor","translateY"].indexOf(u.property)<0&&this.redraw(),"translateY"===u.property&&(this.iv(),this._43o())},findDataByName:function(W){for(var V=this.dm().getDatas(),C=0;C=0&&(N===m?q(y,D,d.paletteItemSelectBackground):e(y,D))})}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:(0,eval)("this"),Object);