survey-analytics 1.9.23 → 1.9.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/survey.analytics.css +5 -5
- package/survey.analytics.d.ts +1 -1
- package/survey.analytics.datatables.css +1 -1
- package/survey.analytics.datatables.js +17 -6
- package/survey.analytics.datatables.min.css +1 -1
- package/survey.analytics.datatables.min.js +2 -2
- package/survey.analytics.js +39 -22
- package/survey.analytics.min.css +2 -2
- package/survey.analytics.min.js +2 -2
- package/survey.analytics.tabulator.css +1 -1
- package/survey.analytics.tabulator.js +17 -6
- package/survey.analytics.tabulator.min.css +1 -1
- package/survey.analytics.tabulator.min.js +2 -2
package/survey.analytics.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS Analytics library v1.9.
|
|
2
|
+
* surveyjs - SurveyJS Analytics library v1.9.26
|
|
3
3
|
* Copyright (c) 2015-2022 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
5
|
*/
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
* Copyright (c) 2018-present, Niklas Rämö <inramo@gmail.com>
|
|
21
21
|
* @license MIT
|
|
22
22
|
*/
|
|
23
|
-
t.exports=function(){"use strict";var t={};function e(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}e.prototype.on=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];return i||(i=this._events[t]=[]),i.push(e),this},e.prototype.off=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];if(!i||!i.length)return this;if(!e)return i.length=0,this;for(var n=i.length;n--;)e===i[n]&&i.splice(n,1);return this},e.prototype.emit=function(t,e,i,n){if(this._isDestroyed)return this;var r=this._events[t];if(!r||!r.length)return this;var s,o=this._queue,a=o.length,l=arguments.length-1;for(s=0;s<r.length;s++)o.push(r[s]);for(++this._counter,s=a,a=o.length;s<a;s++)if(0===l?o[s]():1===l?o[s](e):2===l?o[s](e,i):o[s](e,i,n),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},e.prototype.destroy=function(){if(this._isDestroyed)return this;var t,e=this._events;for(t in this._isDestroyed=!0,this._queue.length=this._counter=0,e)e[t]&&(e[t].length=0,e[t]=void 0);return this};var i="transform",n="transform",r=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(t){if(!s){var e=t?t+"Transform":"transform";void 0!==r[e]&&(t=t.toLowerCase(),i=t?"-"+t+"-transform":"transform",n=e,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(t,e){var n=o&&o.get(t);return n||(n=window.getComputedStyle(t,null),o&&o.set(t,n)),n.getPropertyValue("transform"===e?i:e)}var l=/([A-Z])/g;function h(t){return t.replace(l,"-$1").toLowerCase()}function u(t){return"function"==typeof t}function c(t,e){for(var i in e)t.style["transform"===i?n:i]=e[i]}function d(t){this._element=t,this._animation=null,this._callback=null,this._props=[],this._values=[],this._keyframes=[],this._options={},this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}d.prototype.start=function(t,e,i){if(!this._isDestroyed){var n=this._animation,r=this._props,s=this._values,o=i||0,a=!1;if(n){var l,h=0;for(var d in e)if(++h,-1===(l=r.indexOf(d))||e[d]!==s[l]){a=!0;break}a||h===r.length||(a=!0)}if(a&&n.cancel(),this._callback=u(o.onFinish)?o.onFinish:null,!n||a){for(d in r.length=s.length=0,e)r.push(d),s.push(e[d]);var p=this._keyframes;p[0]=t,p[1]=e;var f=this._options;f.duration=o.duration||300,f.easing=o.easing||"ease";var m=this._element;(n=m.animate(p,f)).onfinish=this._onFinish,this._animation=n,c(m,e)}}},d.prototype.stop=function(t){if(!this._isDestroyed&&this._animation){var e,i,r,s=this._element,o=this._props,l=this._values;if(t)c(s,t);else for(r=0;r<o.length;r++)i=a(s,h(e=o[r])),s.style["transform"===e?n:e]=i;this._animation.cancel(),this._animation=this._callback=null,o.length=l.length=0}},d.prototype.isAnimating=function(){return!!this._animation},d.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=this._options=this._keyframes=null,this._isDestroyed=!0)},d.prototype._onFinish=function(){var t=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,t&&t()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),s=0;s<p.length;){if((n=(i=p[s])?i+r:e)in t)return n;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return this.setTimeout((function(){t(1e3/60)}),1e3/60)}).bind(window),_=!1;try{var g=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("testPassive",null,g),window.removeEventListener("testPassive",null,g)}catch(t){}var y="start",v="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),S=!!window.PointerEvent,T=!!window.navigator.msPointerEnabled,D=/(android)/i.test(window.navigator.userAgent),E=!!_&&{passive:!0},A=f(window.document.documentElement.style,"touchAction");function k(t,i){this._element=t,this._emitter=new e,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._startEvent=null,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._preStartCheck=this._preStartCheck.bind(this),this._abortNonCancelable=this._abortNonCancelable.bind(this),this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this.setCssProps(i),this._touchAction||this.setTouchAction("auto"),t.addEventListener("dragstart",k._preventDefault,!1),t.addEventListener(k._events.start,this._preStartCheck,E),!C||S||T||t.addEventListener(k._mouseEvents.start,this._preStartCheck,E)}function P(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}k._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},k._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},k._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},k._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},k._events=S?k._pointerEvents:T?k._msPointerEvents:C?k._touchEvents:k._mouseEvents,k._emitter=new e,k._activeInstances=[],k._preventDefault=function(t){t.preventDefault&&!1!==t.cancelable&&t.preventDefault()},k._activateInstance=function(t){k._activeInstances.indexOf(t)>-1||(k._activeInstances.push(t),k._emitter.on(v,t._onMove),k._emitter.on(w,t._onCancel),k._emitter.on(b,t._onEnd),1===k._activeInstances.length&&k._bindListeners())},k._deactivateInstance=function(t){var e=k._activeInstances.indexOf(t);-1!==e&&(k._activeInstances.splice(e,1),k._emitter.off(v,t._onMove),k._emitter.off(w,t._onCancel),k._emitter.off(b,t._onEnd),k._activeInstances.length||k._unbindListeners())},k._bindListeners=function(){var t=k._events;window.addEventListener(t.move,k._onMove,E),window.addEventListener(t.end,k._onEnd,E),t.cancel&&window.addEventListener(t.cancel,k._onCancel,E)},k._unbindListeners=function(){var t=k._events;window.removeEventListener(t.move,k._onMove,E),window.removeEventListener(t.end,k._onEnd,E),t.cancel&&window.removeEventListener(t.cancel,k._onCancel,E)},k._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},k._getTouchById=function(t,e){if("number"==typeof t.pointerId)return t.pointerId===e?t:null;if(t.changedTouches){for(var i=0;i<t.changedTouches.length;i++)if(t.changedTouches[i].identifier===e)return t.changedTouches[i];return null}return t},k._onMove=function(t){k._emitter.emit(v,t)},k._onCancel=function(t){k._emitter.emit(w,t)},k._onEnd=function(t){k._emitter.emit(b,t)},k.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(k._touchEvents.start,this._abortNonCancelable,E),k._deactivateInstance(this))},k.prototype._createEvent=function(t,e){var i=this._getTrackedTouch(e);return{type:t,srcEvent:e,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:t===y?0:this.getDeltaTime(),isFirst:t===y,isFinal:t===b||t===w,identifier:this._pointerId,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,target:i.target}},k.prototype._emit=function(t,e){this._emitter.emit(t,this._createEvent(t,e))},k.prototype._getTrackedTouch=function(t){return null===this._pointerId?null:k._getTouchById(t,this._pointerId)},k.prototype._preStartCheck=function(t){this._isDestroyed||this.isDragging()||D&&!1===t.cancelable||t.button||(this._pointerId=k._getEventPointerId(t),null!==this._pointerId&&(this._startEvent=t,C&&(S||T)?(D&&this._element.addEventListener(k._touchEvents.start,this._abortNonCancelable,E),m(this._onStart)):this._onStart()))},k.prototype._abortNonCancelable=function(t){this._element.removeEventListener(k._touchEvents.start,this._abortNonCancelable,E),this._startEvent&&!1===t.cancelable&&(this._pointerId=null,this._startEvent=null)},k.prototype._onStart=function(){var t=this._startEvent;if(t){this._startEvent=null;var e=this._getTrackedTouch(t);e&&(this._startX=this._currentX=e.clientX,this._startY=this._currentY=e.clientY,this._startTime=Date.now(),this._emit(y,t),k._activateInstance(this))}},k.prototype._onMove=function(t){var e=this._getTrackedTouch(t);e&&(this._currentX=e.clientX,this._currentY=e.clientY,this._emit(v,t))},k.prototype._onCancel=function(t){this._getTrackedTouch(t)&&(this._emit(w,t),this._reset())},k.prototype._onEnd=function(t){this._getTrackedTouch(t)&&(this._emit(b,t),this._reset())},k.prototype.isDragging=function(){return null!==this._pointerId},k.prototype.setTouchAction=function(t){this._touchAction=t,A&&(this._cssProps[A]="",this._element.style[A]=t),C&&(this._element.removeEventListener(k._touchEvents.start,k._preventDefault,!1),this._element.style[A]!==t&&this._element.addEventListener(k._touchEvents.start,k._preventDefault,!1))},k.prototype.setCssProps=function(t){if(t){var e,i,n=this._cssProps,r=this._element;for(e in n)r.style[e]=n[e],delete n[e];for(e in t)t[e]&&("touchAction"!==e?(i=f(r.style,e))&&(n[i]="",r.style[i]=t[e]):this.setTouchAction(t[e]))}},k.prototype.getDeltaX=function(){return this._currentX-this._startX},k.prototype.getDeltaY=function(){return this._currentY-this._startY},k.prototype.getDistance=function(){var t=this.getDeltaX(),e=this.getDeltaY();return Math.sqrt(t*t+e*e)},k.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},k.prototype.on=function(t,e){this._emitter.on(t,e)},k.prototype.off=function(t,e){this._emitter.off(eventName,e)},k.prototype.destroy=function(){if(!this._isDestroyed){var t=this._element,e=k._events;for(var i in this._reset(),this._emitter.destroy(),t.removeEventListener(e.start,this._preStartCheck,E),t.removeEventListener(k._mouseEvents.start,this._preStartCheck,E),t.removeEventListener("dragstart",k._preventDefault,!1),t.removeEventListener(k._touchEvents.start,k._preventDefault,!1),this._cssProps)t.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},P.prototype.add=function(t,e,i,n){var r=this._queue.indexOf(t);r>-1&&(this._queue[r]=void 0),n?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=m(this._step))},P.prototype.cancel=function(t){var e=this._queue.indexOf(t);e>-1&&(this._queue[e]=void 0,delete this._reads[t],delete this._writes[t])},P.prototype._step=function(){var t,e,i=this._queue,n=this._reads,r=this._writes,s=this._batch,o=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,e=0;e<l;e++)(t=i[e])&&(s.push(t),o[t]=n[t],delete n[t],a[t]=r[t],delete r[t]);for(i.length=0,e=0;e<l;e++)o[t=s[e]]&&(o[t](),delete o[t]);for(e=0;e<l;e++)a[t=s[e]]&&(a[t](),delete a[t]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var x=new P;function O(t){return x.cancel(t+"visibility")}function V(t){return x.cancel(t+"move")}function L(t){return x.cancel(t+"scroll")}function M(t){return x.cancel(t+"placeholder")}var z=window.Element.prototype,B=z.matches||z.matchesSelector||z.webkitMatchesSelector||z.mozMatchesSelector||z.msMatchesSelector||z.oMatchesSelector||function(){return!1};function I(t,e){return B.call(t,e)}function R(t,e){t.classList?t.classList.add(e):I(t,"."+e)||(t.className+=" "+e)}var j=[];function N(t,e,i){var n="number"==typeof i?i:-1;n<0&&(n=t.length-n+1),t.splice.apply(t,j.concat(n,0,e)),j.length=0}function H(t,e,i){var n=t.length,r=Math.max(0,i?n:n-1);return e>r?r:e<0?Math.max(r+e+1,0):e}function q(t,e,i){if(!(t.length<2)){var n=H(t,e),r=H(t,i);n!==r&&t.splice(r,0,t.splice(n,1)[0])}}function F(t,e,i){if(!(t.length<2)){var n,r=H(t,e),s=H(t,i);r!==s&&(n=t[r],t[r]=t[s],t[s]=n)}}var G=0;function X(t,e){var i,n=++G+"debounce";return e>0?function(r){void 0!==i&&(i=window.clearTimeout(i),x.cancel(n),"finish"===r&&t()),"cancel"!==r&&"finish"!==r&&(i=window.setTimeout((function(){i=void 0,x.add(n,t,null,!0)}),e))}:function(e){"cancel"!==e&&t()}}function Y(t){var e=a(t,"transform");if(!e||"none"===e)return!1;var i=a(t,"display");return"inline"!==i&&"none"!==i}function Q(t,e){for(var i=window.document,n=(e?t:t.parentElement)||i;n&&n!==i&&"static"===a(n,"position")&&!Y(n);)n=n.parentElement||i;return n}function U(t,e){return parseFloat(a(t,e))||0}var W={},K={},Z={};function J(t,e){var i,n=e||{};return n.left=0,n.top=0,t===document||(n.left=window.pageXOffset||0,n.top=window.pageYOffset||0,t.self===window.self||(i=t.getBoundingClientRect(),n.left+=i.left,n.top+=i.top,n.left+=U(t,"border-left-width"),n.top+=U(t,"border-top-width"))),n}function $(t,e,i){return Z.left=0,Z.top=0,t===e||i&&(t=Q(t,!0))===(e=Q(e,!0))||(J(t,W),J(e,K),Z.left=K.left-W.left,Z.top=K.top-W.top),Z}function tt(t){var e=a(t,"overflow");return"auto"===e||"scroll"===e||"auto"===(e=a(t,"overflow-x"))||"scroll"===e||"auto"===(e=a(t,"overflow-y"))||"scroll"===e}function et(t,e,i){for(var n=i||[],r=e?t:t.parentNode;r&&r!==document;)r.getRootNode&&r instanceof DocumentFragment?r=r.getRootNode().host:(tt(r)&&n.push(r),r=r.parentNode);return n.push(window),n}var it,nt,rt,st,ot={},at=/^matrix3d/,lt=/([^,]*,){4}/,ht=/([^,]*,){12}/,ut=/[^,]*,/;function ct(t){ot.x=0,ot.y=0;var e=a(t,"transform");if(!e||"none"===e)return ot;var i=at.test(e),n=e.replace(i?ht:lt,""),r=n.replace(ut,"");return ot.x=parseFloat(n)||0,ot.y=parseFloat(r)||0,ot}function dt(t,e){return"translateX("+t+"px) translateY("+e+"px)"}function pt(t,e){t.classList?t.classList.remove(e):I(t,"."+e)&&(t.className=(" "+t.className+" ").replace(" "+e+" "," ").trim())}function ft(t){var e=t._element,i=t.getGrid(),n=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(n.dragStartPredicate)?n.dragStartPredicate:ft.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var r=n.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,r),this._dragger=new k(e,n.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function mt(t,e){return t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top?0:(Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*(Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top))/(Math.min(t.width,e.width)*Math.min(t.height,e.height))*100}function _t(t){this._item=t,this._animate=new d,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function gt(){this._queue=[],this._isDestroyed=!1}function yt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new gt,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}ft.defaultStartPredicate=function(t,e,i){var n=t._drag,r=n._startPredicateData||n._setupStartPredicate(i);if(!e.isFinal)return!(!r.handleElement&&(r.handleElement=n._getStartPredicateHandle(e),!r.handleElement))&&(r.delay&&(r.event=e,r.delayTimer||(r.delayTimer=window.setTimeout((function(){r.delay=0,n._resolveStartPredicate(r.event)&&(n._forceResolveStartPredicate(r.event),n._resetStartPredicate())}),r.delay))),n._resolveStartPredicate(e));n._finishStartPredicate(e)},ft.defaultSortPredicate=(it={},nt={},rt={},st=[],function(t,e){var i=t._drag,n=i._getGrid(),r=e&&"number"==typeof e.threshold?e.threshold:50,s=e&&"swap"===e.action?"swap":"move";it.width=t._width,it.height=t._height,it.left=i._elementClientX,it.top=i._elementClientY;var o=function(t,e,i){var n,r,s,o,a=null,l=e._settings.dragSort,h=-1;if(!0===l?(st[0]=e,r=st):r=l.call(e,t),!Array.isArray(r))return a;for(o=0;o<r.length;o++)(s=r[o])._isDestroyed||(s._updateBoundingRect(),nt.width=s._width,nt.height=s._height,nt.left=s._left,nt.top=s._top,(n=mt(it,nt))>i&&n>h&&(h=n,a=s));return st.length=0,a}(t,n,r);if(!o)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(o===n?(it.left=i._gridX+t._marginLeft,it.top=i._gridY+t._marginTop):(o._updateBorders(1,0,1,0),d=o._left+o._borderLeft,p=o._top+o._borderTop),c=0;c<o._items.length;c++)(h=o._items[c])._isActive&&h!==t&&(l=!0,nt.width=h._width,nt.height=h._height,nt.left=h._left+h._marginLeft+d,nt.top=h._top+h._marginTop+p,(u=mt(it,nt))>f&&(a=c,f=u));return f<r&&t.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=r&&(rt.grid=o,rt.index=a,rt.action=s,rt)}),ft.prototype.stop=function(){var t=this._item,e=t._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(V(t._id),L(t._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),e.parentNode!==i._element&&(i._element.appendChild(e),e.style[n]=dt(this._gridX,this._gridY)),pt(e,i._settings.itemDraggingClass),this._reset(),this):this},ft.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},ft.prototype._getGrid=function(){return t[this._gridId]||null},ft.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},ft.prototype._bindScrollListeners=function(){var t,e,i=this._getGrid()._element,n=this._container,r=this._scrollers;if(r.length=0,et(this._item._element,!1,r),n!==i)for(et(i,!0,t=[]),e=0;e<t.length;e++)r.indexOf(t[e])<0&&r.push(t[e]);for(e=0;e<r.length;e++)r[e].addEventListener("scroll",this._onScroll)},ft.prototype._unbindScrollListeners=function(){var t,e=this._scrollers;for(t=0;t<e.length;t++)e[t].removeEventListener("scroll",this._onScroll);e.length=0},ft.prototype._setupStartPredicate=function(t){var e=t||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(e.distance)||0,delay:Math.max(e.delay,0)||0,handle:"string"==typeof e.handle&&e.handle}},ft.prototype._getStartPredicateHandle=function(t){var e=this._startPredicateData,i=this._item._element,n=i;if(!e.handle)return n;for(n=t.target;n&&!I(n,e.handle);)n=n!==i?n.parentElement:null;return n||null},ft.prototype._resolveStartPredicate=function(t){var e=this._startPredicateData;if(!(t.distance<e.distance||e.delay)){var i=e.handleElement.getBoundingClientRect(),n=i.left+(window.pageXOffset||0),r=i.top+(window.pageYOffset||0),s=i.width,o=i.height;return this._resetStartPredicate(),s&&o&&t.pageX>=n&&t.pageX<n+s&&t.pageY>=r&&t.pageY<r+o}},ft.prototype._forceResolveStartPredicate=function(t){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(t))},ft.prototype._finishStartPredicate=function(t){var e=this._item._element,i=Math.abs(t.deltaX)<2&&Math.abs(t.deltaY)<2&&t.deltaTime<200;this._resetStartPredicate(),i&&function(t){if("a"===t.tagName.toLowerCase()){var e=t.getAttribute("href");if(e){var i=t.getAttribute("target");i&&"_self"!==i?window.open(e,i):window.location.href=e}}}(e)},ft.prototype._resetHeuristics=function(t){this._hBlockedIndex=null,this._hX1=this._hX2=t.clientX,this._hY1=this._hY2=t.clientY},ft.prototype._checkHeuristics=function(t){var e=this._getGrid()._settings.dragSortHeuristics,i=e.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var n=t.clientX,r=t.clientY,s=n-this._hX2,o=r-this._hY2,a=i>3&&e.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(s)>i||Math.abs(o)>i){if(a){var l=Math.atan2(s,o),h=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),u=Math.atan2(Math.sin(l-h),Math.cos(l-h));Math.abs(u)>e.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=n,this._hY2=r,!0}return!1},ft.prototype._resetStartPredicate=function(){var t=this._startPredicateData;t&&(t.delayTimer&&(t.delayTimer=window.clearTimeout(t.delayTimer)),this._startPredicateData=null)},ft.prototype._checkOverlap=function(){if(this._isActive){var t,e,i,n,r,s,o,a=this._item,l=this._getGrid()._settings;(t=u(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):ft.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof t.index&&(o=(e=a.getGrid())!==(n=t.grid||e),i=e._items.indexOf(a),r=H(n._items,t.index,o),s="swap"===t.action?"swap":"move",(o||r!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("beforeReceive")&&n._emit("beforeReceive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),a._gridId=n._id,this._isMigrating=a._gridId!==this._gridId,e._items.splice(i,1),N(n._items,a,r),a._sortData=null,e._hasListeners("send")&&e._emit("send",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("receive")&&n._emit("receive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),e.layout(),n.layout()):i!==r&&(this._hBlockedIndex=i,("swap"===s?F:q)(e._items,i,r),e._hasListeners("move")&&e._emit("move",{item:a,fromIndex:i,toIndex:r,action:s}),e.layout())))}},ft.prototype._finishMigration=function(){var t,e,i=this._item,r=i._release,s=i._element,o=i._isActive,a=i.getGrid(),l=a._element,h=a._settings,u=h.dragContainer||l,d=this._getGrid()._settings,p=s.parentNode;this._isMigrating=!1,this.destroy(),pt(s,d.itemClass),pt(s,d.itemVisibleClass),pt(s,d.itemHiddenClass),R(s,h.itemClass),R(s,o?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(s),e=$(p,u,!0),(t=ct(s)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=$(u,l,!0),r._containerDiffX=e.left,r._containerDiffY=e.top,i._drag=h.dragEnabled?new ft(i):null,u!==p&&(s.style[n]=dt(t.x,t.y)),i._child.removeAttribute("style"),c(i._child,o?h.visibleStyles:h.hiddenStyles),r.start()},ft.prototype._preStartCheck=function(t){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,t),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(t)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(t)},ft.prototype._preEndCheck=function(t){var e=2===this._startPredicateState;this._startPredicate(this._item,t),this._startPredicateState=0,e&&this._isActive&&this._onEnd(t)},ft.prototype._onStart=function(t){var e=this._item;if(e._isActive){var i,r=e._element,s=this._getGrid(),o=s._settings,a=e._release,l=e._migrate,h=s._element,u=o.dragContainer||h,c=Q(u,!0),d=ct(r),p=d.x,f=d.y,m=r.getBoundingClientRect(),_=u!==h;this._resetHeuristics(t),_&&(i=$(c,h)),e.isPositioning()&&e._layout.stop(!0,{transform:dt(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:dt(p,f)})),e.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=t,this._container=u,this._containingBlock=c,this._elementClientX=m.left,this._elementClientY=m.top,this._left=this._gridX=p,this._top=this._gridY=f,o.dragPlaceholder.enabled&&e._dragPlaceholder.create(),s._emit("dragInit",e,t),_&&(this._containerDiffX=i.left,this._containerDiffY=i.top,r.parentNode===u?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,u.appendChild(r),r.style[n]=dt(this._left,this._top))),R(r,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",e,t)}},ft.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,n,r,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=t.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=t.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=t,i=e._id,n=this._prepareMove,r=this._applyMove,x.add(i+"move",n,r,!0)}else this.stop()},ft.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},ft.prototype._applyMove=function(){var t=this._item;t._isActive&&(t._element.style[n]=dt(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},ft.prototype._onScroll=function(t){var e,i,n,r=this._item;r._isActive?(this._scrollEvent=t,e=r._id,i=this._prepareScroll,n=this._applyScroll,x.add(e+"scroll",i,n,!0)):this.stop()},ft.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._element,n=this._getGrid(),r=n._settings,s=r.dragAxis,o=n._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,h=this._elementClientY-a.top;this._container!==o&&(e=$(this._containingBlock,o),this._containerDiffX=e.left,this._containerDiffY=e.top),"y"!==s&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==s&&(this._top+=h,this._gridY=this._top-this._containerDiffY),r.dragSort&&this._checkOverlapDebounce()}},ft.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[n]=dt(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},ft.prototype._onEnd=function(t){var e=this._item,i=e._element,n=this._getGrid(),r=n._settings,s=e._release;e._isActive?(V(e._id),L(e._id),r.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pt(i,r.itemDraggingClass),n._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():s.start()):this.stop()},_t.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),n=e._layout.slots[2*i],r=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==n||t._top!==r){var s,o,a;if(n+=t._marginLeft,r+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){M(t._id);var l={transform:dt(n,r)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(e.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=n,this._nextTop=r,s=t._id,o=this._setupAnimation,a=this._startAnimation,x.add(s+"placeholder",o,a)}},_t.prototype._setupAnimation=function(){if(this.isActive()){var t=ct(this._element);this._currentLeft=t.x,this._currentTop=t.y}},_t.prototype._startAnimation=function(){if(this.isActive()){var t=this._animate,e=this._currentLeft,i=this._currentTop,n=this._nextLeft,r=this._nextTop,s={transform:dt(n,r)};if(e!==n||i!==r){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:dt(e,i)};t.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(s)}},_t.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},_t.prototype._onReleaseEnd=function(t){if(t._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},_t.prototype._onMigrate=function(t){if(t.item===this._item){var e=this._item.getGrid(),i=t.toGrid;e.off("dragReleaseEnd",this._onReleaseEnd),e.off("layoutStart",this._onLayoutStart),e.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},_t.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var t,e=this._item,i=e.getGrid(),n=i._settings,r=this._animate;t=u(n.dragPlaceholder.createElement)?n.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,r._element=t,this._className=n.itemPlaceholderClass||"",this._className&&R(t,this._className);var s=e._left+e._marginLeft,o=e._top+e._marginTop;c(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:dt(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(n.dragPlaceholder.onCreate)&&n.dragPlaceholder.onCreate(e,t),i.getElement().appendChild(t)}},_t.prototype.reset=function(){if(this.isActive()){var t=this._element,e=this._item,i=e.getGrid(),n=i._settings,r=this._animate;this._resetAfterLayout=!1,M(e._id),r.stop(),r._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pt(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,u(n.dragPlaceholder.onRemove)&&n.dragPlaceholder.onRemove(e,t)}},_t.prototype.updateDimensions=function(t,e){this.isActive()&&c(this._element,{width:t+"px",height:e+"px"})},_t.prototype.isActive=function(){return!!this._element},_t.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},gt.prototype.add=function(t){return this._isDestroyed||this._queue.push(t),this},gt.prototype.flush=function(t,e){if(this._isDestroyed)return this;var i,n=this._queue,r=n.length;if(!r)return this;var s=1===r,o=s?n[0]:n.slice(0);if(n.length=0,s)return o(t,e),this;for(i=0;i<r&&(o[i](t,e),!this._isDestroyed);i++);return this},gt.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},yt.prototype.start=function(t,e){if(!this._isDestroyed){var i,n,r,s,o=this._item,a=o._element,l=o._release,h=o.getGrid()._settings,d=this._isActive,p=l._isActive&&!1===l._isPositioningStarted,f=p?h.dragReleaseDuration:h.layoutDuration,m=p?h.dragReleaseEasing:h.layoutEasing,_=!t&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),u(e)&&this._queue.add(e),_?(this._isActive=!0,this._animateOptions.easing=m,this._animateOptions.duration=f,this._isInterrupted=d,n=o._id,r=this._setupAnimation,s=this._startAnimation,x.add(n+"layout",r,s),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&c(a,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},yt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item;return i=n._id,x.cancel(i+"layout"),n._animate.stop(e),pt(n._element,n.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,n),this},yt.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0,{}),this._queue.destroy(),this._item=this._currentStyles=this._targetStyles=this._animateOptions=null,this._isDestroyed=!0),this},yt.prototype._updateOffsets=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._offsetLeft=i._isActive?i._containerDiffX:e._isActive?e._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:e._isActive?e._containerDiffY:0}},yt.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=dt(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},yt.prototype._finish=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._isActive&&(this._isActive=!1,pt(t._element,t.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),e._isActive&&e.stop(),this._queue.flush(!1,t)}},yt.prototype._setupAnimation=function(){var t=ct(this._item._element);this._currentLeft=t.x,this._currentTop=t.y},yt.prototype._startAnimation=function(){var t=this._item,e=t.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),t._left===this._currentLeft-this._offsetLeft&&t._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||R(t._element,e.itemPositioningClass),this._currentStyles.transform=dt(this._currentLeft,this._currentTop),t._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var vt={};function bt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}bt.prototype.start=function(t,e,i){if(this._isDestroyed)return this;var r,s,o,a,l,h,u,d,p=this._item,f=p._element,m=p.isVisible(),_=p.getGrid(),g=_._settings,y=t._settings,v=t._element,b=t._items,w=_._items.indexOf(p),C=i||window.document.body;if("number"==typeof e)r=H(b,e,!0);else{if(!(s=t._getItem(e)))return this;r=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(u=(h=ct(f)).x,d=h.y),p.isPositioning()&&p._layout.stop(!0,{transform:dt(u,d)}),this._isActive&&(u-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:dt(u,d)})),p.isReleasing()&&(u-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:dt(u,d)})),p._visibility._stopAnimation(),p._drag&&p._drag.destroy(),p._visibility._queue.flush(!0,p),_._hasListeners("beforeSend")&&_._emit("beforeSend",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),pt(f,g.itemClass),pt(f,g.itemVisibleClass),pt(f,g.itemHiddenClass),R(f,y.itemClass),R(f,m?y.itemVisibleClass:y.itemHiddenClass),_._items.splice(w,1),N(b,p,r),p._gridId=t._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),h||(u=(h=ct(f)).x,d=h.y),f.style[n]=dt(u+a.left,d+a.top)),p._child.removeAttribute("style"),c(p._child,m?y.visibleStyles:y.hiddenStyles),f.style.display=m?"block":"hidden",l=$(C,v,!0),p._refreshDimensions(),p._refreshSortData(),p._drag=y.dragEnabled?new ft(p):null,this._isActive=!0,this._container=C,this._containerDiffX=l.left,this._containerDiffY=l.top,_._hasListeners("send")&&_._emit("send",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),t._hasListeners("receive")&&t._emit("receive",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),this},bt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item,r=n._element,s=n.getGrid()._element;return this._container!==s&&(e||(t?(i=ct(r),vt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):vt.transform=dt(n._left,n._top),e=vt),s.appendChild(r),c(r,e)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},bt.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var wt={};function Ct(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function St(t){var e=t._isActive,i=t._element,n=t.getGrid()._settings;this._item=t,this._isDestroyed=!1,this._isHidden=!e,this._isHiding=!1,this._isShowing=!1,this._queue=new gt,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=e?"block":"none",R(i,e?n.itemVisibleClass:n.itemHiddenClass),c(t._child,e?n.visibleStyles:n.hiddenStyles)}Ct.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var t=this._item,e=t.getGrid();return this._isActive=!0,R(t._element,e._settings.itemReleasingClass),e._emit("dragReleaseStart",t),t._layout.start(!1),this},Ct.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item,r=n._element,s=n.getGrid(),o=s._element;return this._reset(),r.parentNode!==o&&(e||(t?(i=ct(r),wt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):wt.transform=dt(n._left,n._top),e=wt),o.appendChild(r),c(r,e)),t||s._emit("dragReleaseEnd",n),this},Ct.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ct.prototype._reset=function(){if(!this._isDestroyed){var t=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pt(t._element,t.getGrid()._settings.itemReleasingClass)}},St.prototype.show=function(t,e){if(this._isDestroyed)return this;var i=this._item,n=i._element,r=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(s&&r.add(s),this):(this._isShowing||(r.flush(!0,i),pt(n,o.itemHiddenClass),R(n,o.itemVisibleClass),this._isHiding||(n.style.display="block")),s&&r.add(s),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,t,this._finishShow),this):(s&&s(!1,i),this)},St.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,n=i._element,r=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!t?(s&&r.add(s),this):(this._isHiding||(r.flush(!0,i),R(n,o.itemHiddenClass),pt(n,o.itemVisibleClass)),s&&r.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,t,this._finishHide),this)},St.prototype.destroy=function(){if(this._isDestroyed)return this;var t=this._item,e=t._element,i=t.getGrid(),n=this._queue,r=i._settings;return this._stopAnimation({}),n.flush(!0,t).destroy(),pt(e,r.itemVisibleClass),pt(e,r.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},St.prototype._startAnimation=function(t,e,i){if(!this._isDestroyed){var n,r=this._item,s=r.getGrid()._settings,o=t?s.visibleStyles:s.hiddenStyles,l=parseInt(t?s.showDuration:s.hideDuration)||0,u=(t?s.showEasing:s.hideEasing)||"ease",d=e||l<=0;if(o){if(O(r._id),d)return r._animateChild.isAnimating()?r._animateChild.stop(o):c(r._child,o),void(i&&i());var p,f,m;p=r._id,f=function(){n=function(t,e){var i={};for(var n in e)i[n]=a(t,h(n));return i}(r._child,o)},m=function(){r._animateChild.start(n,o,{duration:l,easing:u,onFinish:i})},x.add(p+"visibility",f,m)}else i&&i()}},St.prototype._stopAnimation=function(t){if(!this._isDestroyed){var e=this._item;O(e._id),e._animateChild.stop(t)}},St.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Tt={};St.prototype._finishHide=function(){if(this._isHidden){var t=this._item;this._isHiding=!1,Tt.transform=dt(0,0),t._layout.stop(!0,Tt),t._element.style.display="none",this._queue.flush(!1,t)}};var Dt,Et,At,kt,Pt=0;function xt(){return++Pt}function Ot(t,e,i){var r=t._settings;this._id=xt(),this._gridId=t._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=e,this._child=e.children[0],e.parentNode!==t._element&&t._element.appendChild(e),R(e,r.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[n]=dt(0,0),this._animate=new d(e),this._animateChild=new d(this._child),this._visibility=new St(this),this._layout=new yt(this),this._migrate=new bt(this),this._release=new Ct(this),this._dragPlaceholder=new _t(this),this._drag=r.dragEnabled?new ft(this):null,this._refreshDimensions(),this._refreshSortData()}function Vt(){this._slots=[],this._slotSizes=[],this._freeSlots=[],this._newSlots=[],this._rectItem={},this._rectStore=[],this._rectId=0,this._layout={slots:null,setWidth:!1,setHeight:!1,width:!1,height:!1},this._sortRectsLeftTop=this._sortRectsLeftTop.bind(this),this._sortRectsTopLeft=this._sortRectsTopLeft.bind(this)}function Lt(t){var e=Object.prototype.toString.call(t);return"[object HTMLCollection]"===e||"[object NodeList]"===e}Ot.prototype.getGrid=function(){return t[this._gridId]},Ot.prototype.getElement=function(){return this._element},Ot.prototype.getWidth=function(){return this._width},Ot.prototype.getHeight=function(){return this._height},Ot.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Ot.prototype.getPosition=function(){return{left:this._left,top:this._top}},Ot.prototype.isActive=function(){return this._isActive},Ot.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Ot.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Ot.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Ot.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Ot.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Ot.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Ot.prototype.isDestroyed=function(){return this._isDestroyed},Ot.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var t=this._element,e=this._dragPlaceholder,i=t.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,U(t,"margin-left")),this._marginRight=Math.max(0,U(t,"margin-right")),this._marginTop=Math.max(0,U(t,"margin-top")),this._marginBottom=Math.max(0,U(t,"margin-bottom")),e&&e.updateDimensions(this._width,this._height)}},Ot.prototype._refreshSortData=function(){if(!this._isDestroyed){var t,e=this._sortData={},i=this.getGrid()._settings.sortData;for(t in i)e[t]=i[t](this,this._element)}},Ot.prototype._destroy=function(t){if(!this._isDestroyed){var e=this._element,i=this.getGrid(),n=i._settings,r=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),e.removeAttribute("style"),this._child.removeAttribute("style"),pt(e,n.itemClass),r>-1&&i._items.splice(r,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Vt.prototype.getLayout=function(t,e,i,n,r){var s,o=this._layout,a=!(!r||!r.fillGaps),l=!(!r||!r.horizontal),h=!(!r||!r.alignRight),u=!(!r||!r.alignBottom),c=!(!r||!r.rounding),d=this._slotSizes;if(o.slots=n||this._slots,o.width=l?0:c?Math.round(e):e,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!t.length)return o;for(s=0;s<t.length;s++)this._addSlot(t[s],l,a,c,h||u);if(h)for(s=0;s<o.slots.length;s+=2)o.slots[s]=o.width-(o.slots[s]+d[s]);if(u)for(s=1;s<o.slots.length;s+=2)o.slots[s]=o.height-(o.slots[s]+d[s]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,o},Vt.prototype._addSlot=(kt={},function(t,e,i,n,r){var s,o,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,kt.left=null,kt.top=null,kt.width=t._width+t._marginLeft+t._marginRight,kt.height=t._height+t._marginTop+t._marginBottom,n&&(kt.width=Math.round(kt.width),kt.height=Math.round(kt.height)),h=0;h<d.length;h++)if((o=d[h])&&(s=this._getRect(o),kt.width<=s.width+.001&&kt.height<=s.height+.001)){kt.left=s.left,kt.top=s.top;break}for(null===kt.left&&(kt.left=e?c.width:0,kt.top=e?0:c.height,i||(l=!0)),!e&&kt.top+kt.height>c.height&&(kt.left>0&&p.push(this._addRect(0,c.height,kt.left,1/0)),kt.left+kt.width<c.width&&p.push(this._addRect(kt.left+kt.width,c.height,c.width-kt.left-kt.width,1/0)),c.height=kt.top+kt.height),e&&kt.left+kt.width>c.width&&(kt.top>0&&p.push(this._addRect(c.width,0,1/0,kt.top)),kt.top+kt.height<c.height&&p.push(this._addRect(c.width,kt.top+kt.height,1/0,c.height-kt.top-kt.height)),c.width=kt.left+kt.width),h=i?0:l?d.length:h;h<d.length;h++)if(o=d[h])for(s=this._getRect(o),a=this._splitRect(s,kt),u=0;u<a.length;u++)o=a[u],(s=this._getRect(o)).width>.49&&s.height>.49&&(!e&&s.top<c.height||e&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(e?this._sortRectsLeftTop:this._sortRectsTopLeft),e?c.width=Math.max(c.width,kt.left+kt.width):c.height=Math.max(c.height,kt.top+kt.height),c.slots.push(kt.left,kt.top),r&&this._slotSizes.push(kt.width,kt.height),this._freeSlots=p,this._newSlots=d}),Vt.prototype._addRect=function(t,e,i,n){var r=++this._rectId,s=this._rectStore;return s[r]=t||0,s[++this._rectId]=e||0,s[++this._rectId]=i||0,s[++this._rectId]=n||0,r},Vt.prototype._getRect=function(t,e){var i=e||this._rectItem,n=this._rectStore;return i.left=n[t]||0,i.top=n[++t]||0,i.width=n[++t]||0,i.height=n[++t]||0,i},Vt.prototype._splitRect=(At=[],function(t,e){return At.length=0,this._doRectsOverlap(t,e)?(t.left<e.left&&At.push(this._addRect(t.left,t.top,e.left-t.left,t.height)),t.left+t.width>e.left+e.width&&At.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.top<e.top&&At.push(this._addRect(t.left,t.top,t.width,e.top-t.top)),t.top+t.height>e.top+e.height&&At.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),At):(At.push(this._addRect(t.left,t.top,t.width,t.height)),At)}),Vt.prototype._doRectsOverlap=function(t,e){return!(t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top)},Vt.prototype._isRectWithinRect=function(t,e){return t.left>=e.left&&t.top>=e.top&&t.left+t.width<=e.left+e.width&&t.top+t.height<=e.top+e.height},Vt.prototype._purgeRects=(Dt={},Et={},function(t){for(var e,i=t.length;i--;)if(e=t.length,t[i])for(this._getRect(t[i],Dt);e--;)if(t[e]&&i!==e&&this._isRectWithinRect(Dt,this._getRect(t[e],Et))){t[i]=0;break}return t}),Vt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,n){return this._getRect(i,t),this._getRect(n,e),t.top<e.top?-1:t.top>e.top?1:t.left<e.left?-1:t.left>e.left?1:0}}(),Vt.prototype._sortRectsLeftTop=function(){var t={},e={};return function(i,n){return this._getRect(i,t),this._getRect(n,e),t.left<e.left?-1:t.left>e.left?1:t.top<e.top?-1:t.top>e.top?1:0}}();var Mt=Object.prototype.toString;function zt(t){return"object"==typeof t&&"[object Object]"===Mt.call(t)}function Bt(t){return Lt(t)?Array.prototype.slice.call(t):Array.prototype.concat(t)}var It=new Vt,Rt=function(){};function jt(i,n){var r,s,o,a,l,h,c=this;if(!((i=this._element="string"==typeof i?window.document.querySelector(i):i).getRootNode?i.getRootNode({composed:!0})===document:window.document.body.contains(i))||i===window.document.documentElement)throw new Error("Container element must be an existing DOM element");u((r=this._settings=(a=jt.defaultOptions,l=n,h=Nt({},a),l&&(h=Nt(h,l)),h.visibleStyles=(l||0).visibleStyles||(a||0).visibleStyles,h.hiddenStyles=(l||0).hiddenStyles||(a||0).hiddenStyles,h)).dragSort)||(r.dragSort=!!r.dragSort),this._id=xt(),t[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new e,R(i,r.containerClass),this._items=[],"string"==typeof(s=r.items)?Bt(i.children).forEach((function(t){("*"===s||I(t,s))&&c._items.push(new Ot(c,t))})):(Array.isArray(s)||Lt(s))&&(this._items=Bt(s).map((function(t){return new Ot(c,t)}))),"number"!=typeof(o=r.layoutOnResize)&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),o)),r.layoutOnInit&&this.layout(!0)}function Nt(t,e){var i,n,r,s=Object.keys(e),o=s.length;for(r=0;r<o;r++)i=zt(e[n=s[r]]),zt(t[n])&&i?t[n]=Nt(Nt({},t[n]),e[n]):i?t[n]=Nt({},e[n]):Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}return jt.Item=Ot,jt.ItemLayout=yt,jt.ItemVisibility=St,jt.ItemMigrate=bt,jt.ItemAnimate=d,jt.ItemDrag=ft,jt.ItemRelease=Ct,jt.ItemDragPlaceholder=_t,jt.Emitter=e,jt.Dragger=k,jt.Packer=Vt,jt.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!0},layoutOnResize:100,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragStartPredicate:{distance:0,delay:0,handle:!1},dragAxis:null,dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:"move"},dragReleaseDuration:300,dragReleaseEasing:"ease",dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,duration:300,easing:"ease",createElement:null,onCreate:null,onRemove:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},jt.prototype.on=function(t,e){return this._emitter.on(t,e),this},jt.prototype.off=function(t,e){return this._emitter.off(t,e),this},jt.prototype.getElement=function(){return this._element},jt.prototype.getItems=function(t){if(this._isDestroyed||!t&&0!==t)return this._items.slice(0);var e,i,n=[],r=Bt(t);for(i=0;i<r.length;i++)(e=this._getItem(r[i]))&&n.push(e);return n},jt.prototype.refreshItems=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshDimensions();return this},jt.prototype.refreshSortData=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshSortData();return this},jt.prototype.synchronize=function(){if(this._isDestroyed)return this;var t,e,i,n=this._element,r=this._items;if(r.length){for(i=0;i<r.length;i++)(e=r[i]._element).parentNode===n&&(t=t||window.document.createDocumentFragment()).appendChild(e);t&&n.appendChild(t)}return this._emit("synchronize"),this},jt.prototype.layout=function(t,e){if(this._isDestroyed)return this;var i,n,r,s=this,o=this._element,l=this._updateLayout(),h=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=s._layout.id!==h,n=u(t)?t:e;u(n)&&n(i,l.items.slice(0)),!i&&s._hasListeners("layoutEnd")&&s._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(o,"box-sizing")),l.setHeight&&("number"==typeof l.height?o.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":o.style.height=l.height),l.setWidth&&("number"==typeof l.width?o.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":o.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(r=0;r<c;r++)(n=l.items[r])&&(n._left=l.slots[2*r],n._top=l.slots[2*r+1],n.isDragging()?p():n._layout.start(!0===t,p));return this},jt.prototype.add=function(t,e){if(this._isDestroyed||!t)return[];var i=Bt(t);if(!i.length)return i;var n,r,s=e||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(r=0;r<i.length;r++)n=new Ot(this,i[r],s.isActive),i[r]=n,n._isActive&&(l=!0,n._layout._skipNextAnimation=!0);return N(a,i,s.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&o&&this.layout("instant"===o,u(o)?o:void 0),i},jt.prototype.remove=function(t,e){if(this._isDestroyed)return this;var i,n,r=e||0,s=r.layout?r.layout:void 0===r.layout,o=!1,a=this.getItems(),l=this.getItems(t),h=[];for(n=0;n<l.length;n++)i=l[n],h.push(a.indexOf(i)),i._isActive&&(o=!0),i._destroy(r.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),h),o&&s&&this.layout("instant"===s,u(s)?s:void 0),l},jt.prototype.show=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!0,e),this},jt.prototype.hide=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!1,e),this},jt.prototype.filter=function(t,e){if(this._isDestroyed||!this._items.length)return this;var i,n,r=[],s=[],o="string"==typeof t,a=u(t),l=e||0,h=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=u(l.onFinish)?l.onFinish:null,p=-1,f=Rt;if(d&&(f=function(){++p&&d(r.slice(0),s.slice(0))}),a||o)for(n=0;n<this._items.length;n++)i=this._items[n],(a?t(i):I(i._element,t))?r.push(i):s.push(i);return r.length?this.show(r,{instant:h,onFinish:f,layout:!1}):f(),s.length?this.hide(s,{instant:h,onFinish:f,layout:!1}):f(),(r.length||s.length)&&(this._hasListeners("filter")&&this._emit("filter",r.slice(0),s.slice(0)),c&&this.layout("instant"===c,u(c)?c:void 0)),this},jt.prototype.sort=function(){var t,e,i,n;function r(t){for(var e={},i=0;i<t.length;i++)e[t[i]._id]=i;return e}function s(t,i){var r=n[t._id],s=n[i._id];return e?s-r:r-s}function o(o,a){for(var l,h,u,c,d=0,p=0;p<t.length;p++)if(l=t[p][0],h=t[p][1],u=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===h||!h&&e?c<u?-1:c>u?1:0:u<c?-1:u>c?1:0)return d;return d||(n||(n=r(i)),d=s(o,a)),d}function a(o,a){var l=t(o,a);return e&&l&&(l=-l),l||(n||(n=r(i)),s(o,a))}return function(r,s){if(this._isDestroyed||this._items.length<2)return this;var l,h=this._items,c=s||0,d=c.layout?c.layout:void 0===c.layout;if(t=r,e=!!c.descending,i=h.slice(0),n=null,u(t))h.sort(a);else if("string"==typeof t)t=r.trim().split(" ").map((function(t){return t.split(":")})),h.sort(o);else{if(!Array.isArray(t))return this;if(t.length!==h.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<h.length;l++){if(t.indexOf(h[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");h[l]=t[l]}e&&h.reverse()}return this._hasListeners("sort")&&this._emit("sort",h.slice(0),i),d&&this.layout("instant"===d,u(d)?d:void 0),this}}(),jt.prototype.move=function(t,e,i){if(this._isDestroyed||this._items.length<2)return this;var n,r,s=this._items,o=i||0,a=o.layout?o.layout:void 0===o.layout,l="swap"===o.action,h=l?"swap":"move",c=this._getItem(t),d=this._getItem(e);return c&&d&&c!==d&&(n=s.indexOf(c),r=s.indexOf(d),l?F(s,n,r):q(s,n,r),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:n,toIndex:r,action:h}),a&&this.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.send=function(t,e,i,n){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))return this;var r=n||0,s=r.appendTo||window.document.body,o=r.layoutSender?r.layoutSender:void 0===r.layoutSender,a=r.layoutReceiver?r.layoutReceiver:void 0===r.layoutReceiver;return t._migrate.start(e,i,s),t._migrate._isActive&&t._isActive&&(o&&this.layout("instant"===o,u(o)?o:void 0),a&&e.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.destroy=function(e){if(this._isDestroyed)return this;var i,n=this._element,r=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<r.length;i++)r[i]._destroy(e);return pt(n,this._settings.containerClass),n.style.height="",n.style.width="",this._emit("destroy"),this._emitter.destroy(),t[this._id]=void 0,this._isDestroyed=!0,this},jt.prototype._getItem=function(t){if(this._isDestroyed||!t&&0!==t)return null;if("number"==typeof t)return this._items[t>-1?t:this._items.length+t]||null;if(t instanceof Ot)return t._gridId===this._id?t:null;for(var e=0;e<this._items.length;e++)if(this._items[e]._element===t)return this._items[e];return null},jt.prototype._updateLayout=function(){var t,e,i,n,r=this._layout,s=this._settings.layout;for(++r.id,r.items.length=0,n=0;n<this._items.length;n++)this._items[n]._isActive&&r.items.push(this._items[n]);return this._refreshDimensions(),t=this._width-this._borderLeft-this._borderRight,e=this._height-this._borderTop-this._borderBottom,i=u(s)?s(r.items,t,e):It.getLayout(r.items,t,e,r.slots,s),r.slots=i.slots,r.setWidth=Boolean(i.setWidth),r.setHeight=Boolean(i.setHeight),r.width=i.width,r.height=i.height,r},jt.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},jt.prototype._hasListeners=function(t){var e=this._emitter._events[t];return!(!e||!e.length)},jt.prototype._updateBoundingRect=function(){var t=this._element.getBoundingClientRect();this._width=t.width,this._height=t.height,this._left=t.left,this._top=t.top},jt.prototype._updateBorders=function(t,e,i,n){var r=this._element;t&&(this._borderLeft=U(r,"border-left-width")),e&&(this._borderRight=U(r,"border-right-width")),i&&(this._borderTop=U(r,"border-top-width")),n&&(this._borderBottom=U(r,"border-bottom-width"))},jt.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},jt.prototype._setItemsVisibility=function(t,e,i){var n,r,s=this,o=this.getItems(t),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=e?"showStart":"hideStart",f=e?"showEnd":"hideEnd",m=e?"show":"hide",_=!1,g=[],y=[];if(d){for(this._hasListeners(p)&&this._emit(p,o.slice(0)),r=0;r<o.length;r++)n=o[r],(e&&!n._isActive||!e&&n._isActive)&&(_=!0),e&&!n._isActive&&(n._layout._skipNextAnimation=!0),e&&n._visibility._isHidden&&y.push(n),n._visibility[m](l,(function(t,e){t||g.push(e),--d<1&&(u(h)&&h(g.slice(0)),s._hasListeners(f)&&s._emit(f,g.slice(0)))}));y.length&&this.refreshItems(y),_&&c&&this.layout("instant"===c,u(c)?c:void 0)}else u(h)&&h(o)},jt}()},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";i.r(e),i.d(e,"localization",(function(){return n.a})),i.d(e,"surveyStrings",(function(){return n.b})),i.d(e,"DataProvider",(function(){return s})),i.d(e,"NumberModel",(function(){return c})),i.d(e,"SelectBase",(function(){return d})),i.d(e,"Matrix",(function(){return p})),i.d(e,"BooleanModel",(function(){return f})),i.d(e,"HistogramModel",(function(){return m})),i.d(e,"VisualizerBase",(function(){return u})),i.d(e,"VisualizationManager",(function(){return a})),i.d(e,"VisualizationPanel",(function(){return w})),i.d(e,"VisualizationPanelDynamic",(function(){return C})),i.d(e,"VisualizationMatrixDynamic",(function(){return S})),i.d(e,"VisualizationMatrixDropdown",(function(){return T})),i.d(e,"AlternativeVisualizersWrapper",(function(){return D})),i.d(e,"PlotlySetup",(function(){return E})),i.d(e,"PlotlyChartAdapter",(function(){return P})),i.d(e,"SelectBasePlotly",(function(){return x})),i.d(e,"MatrixPlotly",(function(){return O})),i.d(e,"PlotlyBoolChartAdapter",(function(){return V})),i.d(e,"BooleanPlotly",(function(){return L})),i.d(e,"RankingPlotly",(function(){return M})),i.d(e,"MatrixDropdownGroupedPlotly",(function(){return z})),i.d(e,"HistogramPlotly",(function(){return B})),i.d(e,"PlotlyGaugeAdapter",(function(){return I})),i.d(e,"GaugePlotly",(function(){return R})),i.d(e,"WordCloudAdapter",(function(){return F})),i.d(e,"WordCloud",(function(){return G})),i.d(e,"textHelper",(function(){return N})),i.d(e,"TextTableAdapter",(function(){return X})),i.d(e,"Text",(function(){return Y})),i.d(e,"ChoicesTableAdapter",(function(){return Q})),i.d(e,"ChoicesTable",(function(){return U})),i.d(e,"DocumentHelper",(function(){return h.b}));var n=i(1);i(9),i(10),i(11),i(12),i(13),i(14);n.a.locales.es={ungroupButton:"Desagrupar por mí",selectButton:"Seleccionarme",hideColumn:"Ocultar columna",showColumn:"Mostrar columna",makePrivateColumn:"Hacer que la columna sea privada",makePublicColumn:"Hacer pública la columna",moveToDetail:"Mover al detalle",showAsColumn:"Mostrar como columna",filterPlaceholder:"Buscar ...",removeRows:"Eliminar filas",showLabel:"Mostrar",entryLabel:"entradas",visualizer_text:"Textos en tabla",visualizer_wordcloud:"Wordcloud",chartType_bar:"Bar",chartType_stackedbar:"Barra apilada",chartType_doughnut:"Donut",chartType_pie:"Pie",chartType_scatter:"Dispersión",chartType_gauge:"Gauge",chartType_bullet:"Bullet",hideButton:"Ocultar",makePrivateButton:"Hacer privado",makePublicButton:"Hacer público",showButton:"Mostrar",filter:"Filtro",resetFilter:"Restablecer filtro",changeLocale:"Cambiar configuración regional",clearButton:"Borrar",addElement:"Elija la pregunta para mostrar ...",defaultOrder:"Orden predeterminado",ascOrder:"Ascendente",descOrder:"Descendente",showMinorColumns:"Mostrar columnas secundarias",otherCommentTitle:"Otros elementos y comentarios",showPercentages:"Mostrar porcentajes",hidePercentages:"Ocultar porcentajes",pdfDownloadCaption:"PDF",xlsxDownloadCaption:"Excel",csvDownloadCaption:"CSV",saveDiagramAsPNG:"Descargar el gráfico como png",hideEmptyAnswers:"Ocultar respuestas vacías",showEmptyAnswers:"Mostrar respuestas vacías","topNValueText-1":"Todas las respuestas",topNValueText5:"Las 5 respuestas principales",topNValueText10:"Las 10 respuestas principales",topNValueText20:"20 respuestas principales",noVisualizerForQuestion:"Este tipo de pregunta aún no se visualiza",noResults:"Aún no hay resultados"},n.a.localeNames.es="Spanish";var r=i(4),s=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this._data=t,this._getDataCore=e,this.filterValues={},this.onDataChanged=new r.Event}return t.prototype.getStatisticsCacheKey=function(t){return Array.isArray(t.dataName)?t.dataName.join("-"):t.dataName},t.prototype.reset=function(t){if(t){if(void 0!==this._statisticsCache){var e=this.getStatisticsCacheKey(t);delete this._statisticsCache[e]}}else void 0===this._statisticsCache&&void 0===this._filteredData||(this._statisticsCache=void 0,this._filteredData=void 0,this.raiseDataChanged())},Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(t){this._data=[].concat(t),this.reset()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filteredData",{get:function(){var e=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(e.filterValues).some((function(n){var r=e.filterValues[n],s=typeof r,o=i[n];if("object"==typeof o)return"object"!==s||!function(t,e){var i=Object.keys(t),n=Object.keys(e);if(n.length>i.length)return!1;for(var r=0,s=n;r<s.length;r++){var o=s[r];if(e[o]!=t[o])return!1}return!0}(o,r);var a=i[t.seriesMarkerKey];if(a&&"object"===s)return o!==r[a];if("object"===s&&void 0!==r.start&&void 0!==r.end){var l="number"==typeof o?o:Date.parse(o);return!(!isNaN(l)||(l=parseFloat(o),!isNaN(l)))||(l<r.start||l>=r.end)}return i[n]!==e.filterValues[n]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),t.prototype.setFilter=function(t,e){var i=!0;void 0!==e?(i=this.filterValues[t]!==e,this.filterValues[t]=e):(i=void 0!==this.filterValues[t],delete this.filterValues[t]),i&&this.reset()},t.prototype.getDataCore=function(e){if(this._getDataCore)return this._getDataCore(e);var i=Array.isArray(e.dataName)?e.dataName:[e.dataName],n=[],r=e.getValues(),s={};r.forEach((function(t,e){s[t]=e}));var o=-1!==r.indexOf(void 0),a=e.getSeriesValues(),l={};a.forEach((function(t,e){l[t]=e}));for(var h=a.length||1,u=0;u<i.length;++u){for(var c=new Array,d=0;d<h;++d)c.push(new Array(r.length).fill(0));n.push(c)}return this.filteredData.forEach((function(e){i.forEach((function(i,r){var h=e[i];if(void 0!==h||o){var u=Array.isArray(h)?h:[h];if(a.length>0)if(void 0!==e[t.seriesMarkerKey]){var c=l[e[t.seriesMarkerKey]]||0;u.forEach((function(t){n[r][c][s[t]]++}))}else u.forEach((function(t){a.forEach((function(e){if(void 0!==t[e]){var i=l[e]||0;n[r][i][s[t[e]]]++}}))}));else u.forEach((function(t){return n[0][0][s[t]]++}))}}))})),Array.isArray(e.dataName)?n:n[0]},t.prototype.getData=function(t){var e=this.getStatisticsCacheKey(t);return void 0!==this._statisticsCache&&void 0!==this._statisticsCache[e]||(void 0===this._statisticsCache&&(this._statisticsCache={}),this._statisticsCache[e]=this.getDataCore(t)),[].concat(this._statisticsCache[e])},t.prototype.raiseDataChanged=function(){this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{})},t.seriesMarkerKey="__sa_series_name",t}();var o=i(2),a=function(){function t(){}return t.registerVisualizer=function(e,i){var n=t.vizualizers[e];n||(n=[],t.vizualizers[e]=n),n.push(i)},t.unregisterVisualizer=function(e,i){var n=t.vizualizers[e];if(n){var r=n.indexOf(i);-1!==r&&n.splice(r,1)}},t.unregisterVisualizerForAll=function(e){Object.keys(t.vizualizers).forEach((function(i){return t.unregisterVisualizer(i,e)}))},t.getVisualizersByType=function(e){var i=t.vizualizers[e];return i||[u]},t.getAlternativesVisualizer=function(){return t.alternativesVisualizer||u},t.registerAlternativesVisualizer=function(e){t.alternativesVisualizer=e},t.alternativesVisualizer=void 0,t.vizualizers={},t}(),l=function(){function t(){}return t.createVisualizer=function(t,e,i){var n;n="text"===t.getType()&&t.inputType?t.inputType:t.getType();var r=a.getVisualizersByType(n).map((function(n){return new n(t,e,i)}));return r.length>1?new(a.getAlternativesVisualizer())(r,t,e,i):r[0]},t}(),h=i(0),u=(i(23),function(){function t(t,e,i,n){void 0===i&&(i={});var o=this;this.question=t,this.options=i,this._name=n,this._showHeader=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new r.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new s(e),this._dataProvider.onDataChanged.add((function(){return o.onDataChanged()})),void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLengt)}return t.prototype.afterRender=function(t){this.onAfterRender.fire(this,{htmlElement:t})},Object.defineProperty(t.prototype,"questionOptions",{get:function(){return this.options[this.question.name]},enumerable:!1,configurable:!0}),t.prototype.onDataChanged=function(){this.refresh()},Object.defineProperty(t.prototype,"dataName",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),t.prototype.createVisualizer=function(t){var e=Object.assign({},this.options);return void 0===e.dataProvider&&(e.dataProvider=this.dataProvider),l.createVisualizer(t,this.data,e)},Object.defineProperty(t.prototype,"footerVisualizer",{get:function(){var t=this;if(this.hasFooter){if(!this._footerVisualizer){var e=new r.QuestionCommentModel(this.question.name+(r.settings||{}).commentPrefix);e.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(e),this._footerVisualizer.onUpdate=function(){return t.invokeOnUpdate()}}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},t.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},t.prototype.getValues=function(){throw new Error("Method not implemented.")},t.prototype.getLabels=function(){return this.getValues()},t.prototype.registerToolbarItem=function(t,e){this.toolbarItemCreators[t]=e},Object.defineProperty(t.prototype,"name",{get:function(){return this._name||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),t.prototype.updateData=function(t){this.options.dataProvider||(this.dataProvider.data=t),this.hasFooter&&this.footerVisualizer.updateData(t)},t.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},t.prototype.destroy=function(){this.renderResult&&(this.clear(),this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this.renderResult.innerHTML="",this.renderResult=void 0),this._footerVisualizer&&(this._footerVisualizer.destroy(),this._footerVisualizer.onUpdate=void 0,this._footerVisualizer=void 0)},t.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},t.prototype.createToolbarItems=function(t){var e=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var n=e.toolbarItemCreators[i](t);n&&t.appendChild(n)}))},t.prototype.destroyToolbar=function(t){t.innerHTML=""},t.prototype.renderToolbar=function(t){if(this.showHeader){var e=h.b.createElement("div","sa-toolbar");this.createToolbarItems(e),t.appendChild(e)}},t.prototype.destroyContent=function(t){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(t,this):t.innerHTML=""},t.prototype.renderContent=function(t){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(t,this):t.innerHTML=n.a.getString("noVisualizerForQuestion"),this.afterRender(t)},t.prototype.destroyFooter=function(t){t.innerHTML=""},t.prototype.renderFooter=function(e){var i=this;if(e.innerHTML="",this.hasFooter){var r=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:n.a.getString("otherCommentTitle")});e.appendChild(r);var s=h.b.createElement("div","sa-visualizer__footer-content");s.style.display=t.otherCommentCollapsed?"none":"block";var o=h.b.createButton((function(){"none"===s.style.display?(s.style.display="block",o.innerText=n.a.getString("hideButton")):(s.style.display="none",o.innerText=n.a.getString(t.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),n.a.getString("showButton"));e.appendChild(o),e.appendChild(s),this.footerVisualizer.render(s)}},t.prototype.render=function(t){this.renderResult=t,this.toolbarContainer=h.b.createElement("div","sa-visualizer__toolbar"),t.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.contentContainer=h.b.createElement("div","sa-visualizer__content"),t.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=h.b.createElement("div","sa-visualizer__footer"),t.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},t.prototype.refresh=function(){var t=this;this.contentContainer&&setTimeout((function(){t.destroyContent(t.contentContainer),t.renderContent(t.contentContainer),t.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){t.destroyFooter(t.footerContainer),t.renderFooter(t.footerContainer),t.invokeOnUpdate()}))},t.prototype.processText=function(t){return!1!==this.options.stripHtmlFromTitles?(t||"").replace(/(<([^>]+)>)/gi,""):t},t.prototype.getRandomColor=function(){var t=this.getColors();return t[Math.floor(Math.random()*t.length)]},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(t){this.setBackgroundColorCore(t)},enumerable:!1,configurable:!0}),t.prototype.getBackgroundColorCore=function(){return this._backgroundColor},t.prototype.setBackgroundColorCore=function(t){this._backgroundColor=t,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=t)},t.prototype.getColors=function(e){void 0===e&&(e=10);for(var i=Array.isArray(t.customColors)&&t.customColors.length>0?t.customColors:t.colors,n=[],r=0;r<e;r++)n=n.concat(i);return n},Object.defineProperty(t.prototype,"showHeader",{get:function(){return this._showHeader},set:function(t){t!=this._showHeader&&(this._showHeader=t,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),t.prototype.getData=function(){return this.dataProvider.getData(this)},t.prototype.getState=function(){return{}},t.prototype.setState=function(t){},t.otherCommentCollapsed=!0,t.customColors=[],t.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],t}()),c=function(t){function e(e,i,r,s){void 0===r&&(r={});var o=t.call(this,e,i,r,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?h.b.createSelector(o.chartTypes.map((function(t){return{value:t,text:n.a.getString("chartType_"+t)}})),(function(t){return o.chartType===t.value}),(function(t){o.setChartType(t.target.value)})):null})),o}return Object(o.b)(e,t),e.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.onDataChanged.call(this)},e.prototype.onChartTypeChanged=function(){},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},e.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.destroy.call(this)},e.prototype.generateText=function(t,i,n){var r=[];if(5===n)r=["very high ("+t+")","high","medium","low","very low ("+i+")"];else{r.push(t);for(var s=0;s<n-2;s++)r.push("");r.push(i)}return e.generateTextsCallback?e.generateTextsCallback(this.question,t,i,n,r):r},e.prototype.generateValues=function(t,e){for(var i=[],n=0;n<e;n++)i.push(t/e);return i.push(t),i},e.prototype.generateColors=function(t,e,i){for(var n=this.getColors(),r=[],s=0;s<i;s++)r.push(n[s]);return r.push("rgba(255, 255, 255, 0)"),r},e.prototype.getData=function(){var t=this;if(void 0===this._resultAverage||void 0===this._resultMin||void 0===this._resultMax){var e=[];this._resultMin=Number.MAX_VALUE,this._resultMax=-Number.MAX_VALUE,this.data.forEach((function(i){var n=+i[t.question.name];void 0!==n&&(e.push(n),t._resultMin>n&&(t._resultMin=n),t._resultMax<n&&(t._resultMax=n))})),this._resultAverage=e.reduce((function(t,e){return t+e}),0)/e.length,this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},e.stepsCount=5,e.showAsPercentage=!1,e}(u),d=function(t){function e(i,s,o,a){var l=t.call(this,i,s,o,a||"selectBase")||this;return l.selectedItem=void 0,l.choicesOrderSelector=void 0,l.showPercentageBtn=void 0,l.emptyAnswersBtn=void 0,l.transposeDataBtn=void 0,l.topNSelector=void 0,l._showPercentages=!1,l._showOnlyPercentages=!1,l._answersOrder="default",l._supportSelection=!0,l._hideEmptyAnswers=!1,l._topN=-1,l.topNValues=[].concat(e.topNValuesDefaults),l._transposeData=!1,l._showMissingAnswers=!1,l.missingAnswersBtn=void 0,l.chartTypes=[],l.chartType="bar",l.onAnswersDataReady=new r.Event,i.visibleChoicesChangedCallback=function(){l.dataProvider.reset()},l._showPercentages=!0===l.options.showPercentages,l._showOnlyPercentages=!0===l.options.showOnlyPercentages,l._hideEmptyAnswers=!0===l.options.hideEmptyAnswers,l._answersOrder=l.options.answersOrder||"default",l._showMissingAnswers=l.isSupportMissingAnswers()&&!0===l.options.showMissingAnswers,l.registerToolbarItem("changeChartType",(function(){return l.chartTypes.length>1?h.b.createSelector(l.chartTypes.map((function(t){return{value:t,text:n.a.getString("chartType_"+t)}})),(function(t){return l.chartType===t.value}),(function(t){l.setChartType(t.target.value)})):null})),l.registerToolbarItem("changeAnswersOrder",(function(){return void 0!==l.options.allowChangeAnswersOrder&&!l.options.allowChangeAnswersOrder||0!==l.getSeriesValues().length||(l.choicesOrderSelector=h.b.createSelector([{text:n.a.getString("defaultOrder"),value:"default"},{text:n.a.getString("ascOrder"),value:"asc"},{text:n.a.getString("descOrder"),value:"desc"}],(function(t){return!1}),(function(t){l.answersOrder=t.target.value})),l.updateOrderSelector()),l.choicesOrderSelector})),l.registerToolbarItem("showPercentages",(function(){if(l.options.allowShowPercentages&&(-1!==l.chartTypes.indexOf("bar")||-1!==l.chartTypes.indexOf("stackedbar")))return l.showPercentageBtn=h.b.createButton((function(){l.showPercentages=!l.showPercentages})),l.updateShowPercentageBtn(),l.showPercentageBtn})),l.registerToolbarItem("hideEmptyAnswers",(function(){return l.options.allowHideEmptyAnswers&&(l.emptyAnswersBtn=h.b.createButton((function(){l.hideEmptyAnswers=!l._hideEmptyAnswers})),l.updateEmptyAnswersBtn()),l.emptyAnswersBtn})),l.registerToolbarItem("topNAnswers",(function(){return l.options.allowTopNAnswers&&0===l.getSeriesValues().length&&(l.topNSelector=h.b.createSelector(l.topNValues.map((function(t){return{text:n.a.getString("topNValueText"+t),value:t}})),(function(t){return!1}),(function(t){l.topN=parseInt(t.target.value)})),l.updateTopNSelector()),l.topNSelector})),l.registerToolbarItem("transposeData",(function(){return l.options.allowTransposeData&&(l.transposeDataBtn=h.b.createButton((function(){l.transposeData=!l.transposeData})),l.updateTransposeDataBtn()),l.transposeDataBtn})),l.registerToolbarItem("showMissingAnswers",(function(){return l.isSupportMissingAnswers()&&l.options.allowShowMissingAnswers&&(l.missingAnswersBtn=h.b.createButton((function(){l.showMissingAnswers=!l._showMissingAnswers})),l.updateMissingAnswersBtn()),l.missingAnswersBtn})),l}return Object(o.b)(e,t),e.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerHTML=this._hideEmptyAnswers?n.a.getString("showEmptyAnswers"):n.a.getString("hideEmptyAnswers"),"bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType?this.emptyAnswersBtn.style.display="inline":this.emptyAnswersBtn.style.display="none")},e.prototype.updateTransposeDataBtn=function(){this.transposeDataBtn&&(this.transposeDataBtn.innerHTML=this.transposeData?n.a.getString("showPerColumns"):n.a.getString("showPerValues"),this.getSeriesValues().length>0?this.transposeDataBtn.style.display="inline":this.transposeDataBtn.style.display="none")},e.prototype.updateOrderSelector=function(){this.choicesOrderSelector&&("bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType||("pie"==this.chartType||"doughnut"==this.chartType)&&this.topN>0?this.choicesOrderSelector.style.display="inline-block":this.choicesOrderSelector.style.display="none",this.choicesOrderSelector.getElementsByTagName("select")[0].value=this.answersOrder)},e.prototype.updateShowPercentageBtn=function(){this.showPercentageBtn&&(this.showPercentageBtn.innerHTML=this._showPercentages?n.a.getString("hidePercentages"):n.a.getString("showPercentages"),"bar"==this.chartType||"vbar"==this.chartType||"stackedbar"==this.chartType?this.showPercentageBtn.style.display="inline":this.showPercentageBtn.style.display="none")},e.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},e.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerHTML=this._showMissingAnswers?n.a.getString("hideMissingAnswers"):n.a.getString("showMissingAnswers"))},e.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector()},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.refreshContent())},e.prototype.getSelectedItemByText=function(t){var e=this.question;return this.question.hasOther&&t==e.otherText?e.otherItem:e.choices.filter((function(e){return e.text===t}))[0]},e.prototype.setSelection=function(t){this.selectedItem!==t&&(this.selectedItem=t,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==t?t.value:void 0,void 0!==t?t.text:""))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(t){this._showOnlyPercentages=t,this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(t){this._showPercentages=t,this.updateShowPercentageBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(t){this._answersOrder=t,this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(t){this._hideEmptyAnswers=t,this.updateEmptyAnswersBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transposeData",{get:function(){return this._transposeData},set:function(t){this._transposeData=t,this.updateTransposeDataBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topN",{get:function(){return this._topN},set:function(t){this._topN=t,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(e.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(t){this._showMissingAnswers=this.isSupportMissingAnswers()&&t,this.updateMissingAnswersBtn(),this.dataProvider.reset(this),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},e.prototype.valuesSource=function(){return this.question.activeChoices},e.prototype.getValues=function(){var t=this.valuesSource().map((function(t){return t.value}));return this.question.hasOther&&t.unshift("other"),this.showMissingAnswers&&t.push(void 0),t},e.prototype.getLabels=function(){var t=this;if(this.options.useValuesAsLabels)return this.getValues();var e=this.valuesSource().map((function(e){return r.ItemValue.getTextOrHtmlByValue(t.valuesSource(),e.value)})),i=this.question;return i.hasOther&&e.unshift(i.otherText),this.showMissingAnswers&&e.push(n.a.getString("missingAnswersLabel")),e},e.prototype.getPercentages=function(){var t=this.getData(),e=[];if(t.length<2)t.forEach((function(t,i){var n=t.reduce((function(t,e){return t+e}),0);e[i]=t.map((function(t){return n&&Math.round(t/n*1e4)/100}))}));else for(var i=0;i<t[0].length;i++){for(var n=0,r=0;r<t.length;r++)n+=t[r][i];for(r=0;r<t.length;r++)Array.isArray(e[r])||(e[r]=[]),e[r][i]=n&&Math.round(t[r][i]/n*100)}return e},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[[]],labels:[],colors:[],texts:[[]],seriesLabels:t.seriesLabels},i=0;i<t.datasets[0].length;i++)0!=t.datasets[0][i]&&(e.datasets[0].push(t.datasets[0][i]),e.labels.push(t.labels[i]),e.colors.push(t.colors[i]),e.texts[0].push(t.texts[0][i]));return e},e.prototype.answersDataReady=function(t){var e={};return e=this.hideEmptyAnswers?this.hideEmptyAnswersInData(t):t,this.topN>0&&(e.datasets[0]=e.datasets[0].slice(-this.topN),e.labels=e.labels.slice(-this.topN),e.colors=e.colors.slice(-this.topN),e.texts[0]=e.texts[0].slice(-this.topN)),e},e.prototype.getAnswersData=function(){var t=this.getSeriesLabels(),e=this.getData(),i=this.getLabels(),n=this.getColors(),r=this.showPercentages?this.getPercentages():e;if(this.transposeData){e=this.transpose(e),r=this.transpose(r);var s=t;t=i,i=s}if("asc"==this.answersOrder||"desc"==this.answersOrder){var o=this.showPercentages?h.a.zipArrays(i,n,r[0]):h.a.zipArrays(i,n),a=h.a.sortDictionary(o,e[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],n=l[1],this.showPercentages&&(r[0]=l[2]),e[0]=a.values}var u={datasets:e,labels:i,colors:n,texts:r,seriesLabels:t};return u=this.answersDataReady(u),this.onAnswersDataReady.fire(this,u),u},e.prototype.transpose=function(t){for(var e=t[0].length,i=new Array(e),n=0;n<e;++n)i[n]=new Array(t.length);for(n=0;n<t.length;++n)for(var r=0;r<e;++r)i[r][n]=t[n][r];return i},e.prototype.getState=function(){var t=this,i={};return e._stateProperties.forEach((function(e){i[e]=t[e]})),i},e.prototype.setState=function(t){var i=this;e._stateProperties.forEach((function(e){void 0!==t[e]&&(i[e]=t[e])}))},e.topNValuesDefaults=[-1,5,10,20],e._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],e}(u),p=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"matrix")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(t){return""+t.value}))},e.prototype.getSeriesLabels=function(){var t=this;return this.matrixQuestion.rows.map((function(e){return r.ItemValue.getTextOrHtmlByValue(t.matrixQuestion.rows,e.value)}))},e.prototype.getSelectedItemByText=function(t){return this.matrixQuestion.columns.filter((function(e){return e.text===t}))[0]},e.prototype.valuesSource=function(){return this.matrixQuestion.columns},e.prototype.getHasAnswersInAllSeriesArray=function(t){for(var e=Array(),i=0;i<t[0].length;i++)for(var n=0;n<t.length;n++)0!=t[n][i]&&(e[i]=!0);return e},e.prototype.getHasAnswersInSeries=function(t){for(var e=0;e<t.length;e++)if(0!=t[e])return!0;return!1},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(t.datasets),n=0;n<t.datasets.length;n++){if(this.getHasAnswersInSeries(t.datasets[n])){e.labels.push(t.labels[n]),e.colors.push(t.colors[n]);for(var r=[],s=[],o=0;o<t.datasets[0].length;o++)i[o]&&(r.push(t.datasets[n][o]),s.push(t.texts[n][o]));e.datasets.push(r),e.texts.push(s)}}for(n=0;n<t.datasets[0].length;n++)i[n]&&e.seriesLabels.push(t.seriesLabels[n]);return e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var s=i.map((function(t,i){return e[i][n]}));r.push(s)})),r}return e},e}(d),f=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r||"boolean")||this}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.getSelectedItemByText=function(t){var e=this.getLabels(),i=this.getValues();return new r.ItemValue(i[e.indexOf(t)],t)},e.prototype.getValues=function(){var t=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&t.push(void 0),t},e.prototype.getLabels=function(){var t=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(t[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(t[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(t[2]=n.a.getString("missingAnswersLabel")),t},e.trueColor="",e.falseColor="",e}(d),m=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"histogram")||this;return s.valueType="number",s._cachedValues=void 0,s._continiousData=void 0,s._cachedIntervals=void 0,"text"!==e.getType()||"date"!==e.inputType&&"datetime"!==e.inputType?s.valueType="number":s.valueType="date",s}return Object(o.b)(e,t),e.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},e.prototype.getContiniousValue=function(t){return"date"===this.valueType?Date.parse(t):parseFloat(t)},e.prototype.getString=function(t){return"date"===this.valueType?new Date(t).toLocaleDateString():""+t},e.prototype.getSelectedItemByText=function(t){if(this.hasCustomIntervals||this.getContiniousValues().length>e.UseIntervalsFrom){var i=this.intervals.filter((function(e){return e.label===t}))[0];return new r.ItemValue(i,void 0!==i?i.label:"")}var n=this.getLabels().filter((function(e){return e===t}))[0];return new r.ItemValue(n,n)},e.prototype.updateData=function(e){this.reset(),t.prototype.updateData.call(this,e)},e.prototype.onDataChanged=function(){this.reset(),t.prototype.onDataChanged.call(this)},e.prototype.getContiniousValues=function(){var t=this;if(void 0===this._cachedValues){var e=this.getSeriesValues();0===e.length&&e.push(""),this._continiousData={},e.forEach((function(e){return t._continiousData[e]=[]}));var i={};this.data.forEach((function(e){var n=e[t.dataName];if(void 0!==n){var r=e[s.seriesMarkerKey]||"";t._continiousData[r].push(t.getContiniousValue(n)),i[n]=0}})),this._cachedValues=Object.keys(i).map((function(e){return{original:e,continious:t.getContiniousValue(e)}})),this._cachedValues.sort((function(t,e){return t.continious-e.continious}))}return this._cachedValues},e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getValues=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom?this.intervals.map((function(t){return t.label})):t.map((function(t){return t.original}))},e.prototype.getLabels=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom?this.intervals.map((function(t){return t.label})):t.map((function(t){return t.original}))},Object.defineProperty(e.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals;if(void 0===this._cachedIntervals){var t=this.getContiniousValues();if(this._cachedIntervals=[],t.length)for(var i=t[0].continious-1,n=t[t.length-1].continious+1,r=e.IntervalsCount,s=(n-i)/r,o=0;o<r;++o){var a=i+s;this._cachedIntervals.push({start:i,end:a,label:this.getString(i)+"-"+this.getString(a)}),i=a}}return this._cachedIntervals},enumerable:!1,configurable:!0}),e.prototype.getData=function(){var i=this.getContiniousValues();if(!this.hasCustomIntervals&&i.length<=e.UseIntervalsFrom)return t.prototype.getData.call(this);var n=this.intervals,r=[],s=this.getSeriesValues();0===s.length&&s.push("");for(var o=0;o<s.length;++o)r.push(n.map((function(t){return 0}))),this._continiousData[s[o]].forEach((function(t){for(var e=0;e<n.length;++e)if(n[e].start<=t&&t<n[e].end){r[o][e]++;break}}));return r},e.IntervalsCount=10,e.UseIntervalsFrom=10,e}(d),_=function(){function t(t){this._htmlElement=void 0,this.text=void 0,this._htmlElement=h.b.createElement("div","sa-question__filter"),this.text=h.b.createElement("span","sa-question__filter-text"),this._htmlElement.appendChild(this.text);var e=h.b.createButton((function(){t.setSelection(void 0)}),n.a.getString("clearButton"));this._htmlElement.appendChild(e)}return Object.defineProperty(t.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),t.prototype.update=function(t){void 0!==t&&void 0!==t.value?(this._htmlElement.style.display="inline-block",this.text.innerHTML=n.a.getString("filter")+": ["+t.text+"]"):(this._htmlElement.style.display="none",this.text.innerHTML="")},t}(),g=i(24),y=function(t){function e(e,i){var n=t.call(this,e)||this;return n._selector=i,n._muuri=void 0,n._layoutingTimer=void 0,n}return Object(o.b)(e,t),e.prototype.startCore=function(t){var e=this;this._muuri=new g(t,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:!0}),this._muuri.on("dragReleaseEnd",(function(t){return e.onMoveCallback&&e.onMoveCallback(t.fromIndex,t.toIndex)}))},e.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},e.prototype.updateCore=function(){var t=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){t._layoutingTimer=void 0,t._muuri.refreshItems(),t._muuri.layout()}),10)},e.prototype.add=function(t,e){this._allowed&&this._muuri.add(t,e)},e.prototype.remove=function(t,e){this._allowed&&this._muuri.remove(t,e)},e}(function(){function t(t){this._allowed=t}return t.prototype.startCore=function(t){},t.prototype.stopCore=function(){},t.prototype.updateCore=function(){},Object.defineProperty(t.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),t.prototype.start=function(t){this._allowed&&this.startCore(t)},t.prototype.stop=function(){this._allowed&&this.stopCore()},t.prototype.update=function(){this._allowed&&this.updateCore()},t.prototype.add=function(t,e){},t.prototype.remove=function(t,e){},t.prototype.destroy=function(){this.stop()},t}());i(25);if(document){var v=i(15),b=document.createElement("div");b.style.display="none",b.innerHTML=v,document.head.appendChild(b)}var w=function(t){function e(i,s,o,a){void 0===o&&(o={}),void 0===a&&(a=void 0);var l=t.call(this,null,s,o,"panel")||this;return l.questions=i,l._elements=a,l.visualizers=[],l.haveCommercialLicense=!1,l.renderedQuestionsCount=0,l.onAfterRenderQuestionCallback=function(t,e){l.renderedQuestionsCount++,l.renderedQuestionsCount==l.questions.length&&(l.renderedQuestionsCount=0,l.afterRender(l.contentContainer))},l.onVisibleElementsChanged=new r.Event,l.onStateChanged=new r.Event,l._layoutEngine=o.layoutEngine||new y(l.allowDynamicLayout,".sa-question-layouted"),l._layoutEngine.onMoveCallback=function(t,e){return l.moveVisibleElement(t,e)},l.showHeader=!0,l.options.survey&&(n.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=e.haveCommercialLicense||void 0!==o.haveCommercialLicense&&o.haveCommercialLicense,l.buildVisualizers(i),l.haveCommercialLicense||l.registerToolbarItem("commercialLicense",(function(){return Object(h.c)()})),l.registerToolbarItem("resetFilter",(function(){return h.b.createButton((function(){l.visualizers.forEach((function(t){t instanceof d&&t.setSelection(void 0)}))}),n.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(t){if(l.allowHideQuestions){var e=void 0,i=function(i,r){var s=l.hiddenElements;if(s.length>0){var o=h.b.createSelector([{name:void 0,displayName:n.a.getString("addElement")}].concat(s).map((function(t){return{value:t.name,text:t.displayName}})),(function(t){return!1}),(function(t){l.showElement(t.target.value)}));e&&t.replaceChild(o,e)||t.appendChild(o),e=o}else e&&t.removeChild(e),e=void 0};i(),l.onVisibleElementsChanged.add(i)}})),l.locales.length>1&&l.registerToolbarItem("changeLocale",(function(){return h.b.createSelector([n.a.getString("changeLocale")].concat(l.locales).map((function(t){return{value:t,text:t}})),(function(t){return!1}),(function(t){var e=t.target.value;l.locale=e}))})),l}return Object(o.b)(e,t),e.prototype.showElement=function(t){var e=this.getElement(t),i=this._elements.indexOf(e);e.isVisible=!0;var n=this.renderPanelElement(e,this.contentContainer);this.layoutEngine.add([n],{index:i}),this.visibleElementsChanged(e,"ADDED")},e.prototype.hideElement=function(t){var e=this.getElement(t);e.isVisible=!1,e.renderedElement&&(this.layoutEngine.remove([e.renderedElement]),this.contentContainer.removeChild(e.renderedElement),e.renderedElement=void 0),this.visibleElementsChanged(e,"REMOVED")},e.prototype.makeElementPrivate=function(t){t.isPublic=!1,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.makeElementPublic=function(t){t.isPublic=!0,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.moveVisibleElement=function(t,e){var i,n,r=this.visibleElements[t],s=this.visibleElements[e];i=this._elements.indexOf(r),n=this._elements.indexOf(s),this.moveElement(i,n)},e.prototype.moveElement=function(t,e){var i=this._elements.splice(t,1);this._elements.splice(e,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.buildVisualizers=function(t){var e=this;t.forEach((function(t){var i=e.createVisualizer(t);if(e.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return h.b.createButton((function(){setTimeout((function(){return e.hideElement(t.name)}),0)}),n.a.getString("hideButton"))})),e.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=e.getElement(t.name),r=i.isPublic?"first":"second",s=n.a.getString("makePrivateButton"),o=n.a.getString("makePublicButton");return h.b.createSvgToggleButton("makepublic","makeprivate",s,o,(function(t){setTimeout((function(){return e.makeElementPublic(i)}),0)}),(function(t){setTimeout((function(){return e.makeElementPrivate(i)}),0)}),r)})),i.supportSelection){var r=i,s=new _(r);i.registerToolbarItem("questionFilterInfo",(function(){return s.update(r.selection),s.htmlElement})),r.onDataItemSelected=function(i,n){s.update({value:i,text:n}),e.setFilter(t.name,i)}}i.onUpdate=function(){return e.layout()},i.onAfterRender.add(e.onAfterRenderQuestionCallback),e.visualizers.push(i)}))},e.prototype.destroyVisualizers=function(){var t=this;this.visualizers.forEach((function(e){e.onUpdate=void 0,e instanceof d&&(e.onDataItemSelected=void 0),e.onAfterRender.remove(t.onAfterRenderQuestionCallback),e.destroy()})),this.visualizers=[]},Object.defineProperty(e.prototype,"locale",{get:function(){var t=this.options.survey;return t?t.locale:n.a.currentLocale},set:function(t){this.setLocale(t),this.refresh(),this.onStateChanged.fire(this,this.state)},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(t){var e=this,i=this.options.survey;i&&(i.locale=t,(this.questions||[]).forEach((function(t){var i=e.getElement(t.name);i&&(i.displayName=e.processText(t.title))}))),n.a.currentLocale=t},Object.defineProperty(e.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),e.prototype.buildElements=function(t){var e=this;return(t||[]).map((function(t){return{name:t.name,displayName:e.processText(t.title),isVisible:!0,isPublic:!0,type:void 0}}))},e.prototype.getElements=function(){return(this._elements||[]).map((function(t){return{name:t.name,displayName:t.displayName,isVisible:t.isVisible,isPublic:t.isPublic,type:t.type}}))},Object.defineProperty(e.prototype,"visibleElements",{get:function(){return this._elements.filter((function(t){return t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(t){return!t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publicElements",{get:function(){return this._elements.filter((function(t){return t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"privateElements",{get:function(){return this._elements.filter((function(t){return!t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),e.prototype.getElement=function(t){return this._elements.filter((function(e){return e.name===t}))[0]},e.prototype.getVisualizer=function(t){return this.visualizers.filter((function(e){return e.question.name===t}))[0]},e.prototype.visibleElementsChanged=function(t,e){this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:t,reason:e}),this.onStateChanged.fire(this,this.state),this.layout()},e.prototype.renderPanelElement=function(t,e){var i=this.getVisualizer(t.name),n=h.b.createElement("div");e.appendChild(n);var r=h.b.createElement("div"),s=h.b.createElement("h3"),o=h.b.createElement("div");return s.innerText=t.displayName,n.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",s.className="sa-question__title",this.allowDynamicLayout&&(s.className=s.className+" sa-question__title--draggable"),r.className="sa-question__content",r.style.backgroundColor=this.backgroundColor,r.appendChild(s),r.appendChild(o),n.appendChild(r),i.render(o),t.renderedElement=n,n},e.prototype.renderToolbar=function(e){e.className+=" sa-panel__header",t.prototype.renderToolbar.call(this,e)},e.prototype.renderContent=function(t){var e=this;t.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){e.renderPanelElement(i,t)})),this.layoutEngine.start(t)},e.prototype.destroyContent=function(e){this.layoutEngine.stop(),t.prototype.destroyContent.call(this,e)},e.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),t.prototype.refresh.call(this)},e.prototype.layout=function(){this.layoutEngine.update()},e.prototype.setFilter=function(t,e){this.dataProvider.setFilter(t,e)},Object.defineProperty(e.prototype,"state",{get:function(){var t=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(e){var i=t.getVisualizer(e.name),n=Object(o.a)(Object(o.a)({},e),null==i?void 0:i.getState());return void 0!==n.renderedElement&&delete n.renderedElement,n})))}},set:function(t){var e=this;if(t){if(Array.isArray(t.elements)){var i=this.questions.map((function(t){return t.name}));this._elements=[].concat(t.elements.filter((function(t){return-1!==i.indexOf(t.name)})))}void 0!==t.locale&&this.setLocale(t.locale),this._elements.forEach((function(t){var i=e.getVisualizer(t.name);void 0!==i&&i.setState(t)})),this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"permissions",{get:function(){return this._elements.map((function(t){return{name:t.name,isPublic:t.isPublic}}))},set:function(t){var e=this._elements.map((function(e){return t.forEach((function(t){t.name===e.name&&(e.isPublic=t.isPublic)})),Object(o.a)({},e)}));this._elements=[].concat(e),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.destroyVisualizers()},e.haveCommercialLicense=!1,e}(u),C=function(t){function e(e,i,n,r){void 0===n&&(n={});var s=t.call(this,e,i,n,r||"panelDynamic")||this;return s._panelVisualizer=void 0,s.onAfterRenderPanelCallback=function(){s.afterRender(s.contentContainer)},(n=Object.assign({},n)).allowDynamicLayout=!1,n.dataProvider=void 0,s._panelVisualizer=new w(s.getQuestions(),[],n),s._panelVisualizer.onAfterRender.add(s.onAfterRenderPanelCallback),s.updateData(i),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),e.prototype.updatePanelVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){void 0!==i[t.question.name]&&(e=e.concat(i[t.question.name]))})),this._panelVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updatePanelVisualizerData()},e.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){return this.question.template.questions},e.prototype.destroyContent=function(e){this._panelVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._panelVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},e}(u);a.registerVisualizer("paneldynamic",C);var S=function(t){function e(e,i,n){return t.call(this,e,i,n)||this}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),e.prototype.getQuestions=function(){var t=this.question.visibleRows;return 0===t.length?[]:t[0].cells.map((function(t){return t.question}))},e}(C);a.registerVisualizer("matrixdynamic",S);var T=function(t){function e(e,i,n,s){void 0===n&&(n={});var o=t.call(this,e,i,n,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},(n=Object.assign({},n)).dataProvider=void 0,n.allowDynamicLayout=!1,n.seriesValues=e.rows.map((function(t){return t.value})),n.seriesLabels=e.rows.map((function(t){return t.text}));var l=o.getQuestions();if(1==n.seriesValues.length&&l.every((function(t){return r.Helpers.isArraysEqual(t.choices,o.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new h[0](o.question,[],n)}else o._matrixDropdownVisualizer=new w(l,[],n);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),e.prototype.updateDropdownVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){var n=i[t.question.name];n&&Object.keys(n).forEach((function(t){var i=Object.assign({},n[t]);i[s.seriesMarkerKey]=t,e.push(i)}))})),this._matrixDropdownVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updateDropdownVisualizerData()},e.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){var t=this.question;return t.columns.map((function(e){var i=e.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=t.choices),i}))},e.prototype.destroyContent=function(e){this._matrixDropdownVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._matrixDropdownVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},e}(u);a.registerVisualizer("matrixdropdown",T);var D=function(t){function e(e,i,r,s){var o=t.call(this,i,r,s)||this;if(o.visualizers=e,o.visualizersWithSelection=[],o.onAfterVisualizerRenderCallback=function(){o.afterRender(o.contentContainer)},!e||e.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return o.visualizers.forEach((function(t){t.onUpdate=function(){return o.invokeOnUpdate()},t.supportSelection&&(o._supportSelection=!0,o.visualizersWithSelection.push(t))})),o.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(o.visualizers.map((function(t){return{value:t.name,text:n.a.getString("visualizer_"+t.name)}})),(function(t){return o.visualizer.name===t.value}),(function(t){return o.setVisualizer(t.target.value)}))})),o.visualizer=e[0],o.visualizer.onAfterRender.add(o.onAfterVisualizerRenderCallback),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getVisualizers=function(){return this.visualizers},e.prototype.setVisualizer=function(t){this.visualizer&&(this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=this.visualizers.filter((function(e){return e.name===t}))[0],this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.visualizers.forEach((function(t){t.updateData(e)}))},Object.defineProperty(e.prototype,"onDataItemSelected",{set:function(t){this.visualizersWithSelection.forEach((function(e){e.onDataItemSelected=t}))},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.visualizersWithSelection.forEach((function(e){e.setSelection(t)}))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),e.prototype.renderContent=function(t){this.visualizerContainer=t,this.visualizer.render(this.visualizerContainer)},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.destroy=function(){var e=this;this.visualizers.forEach((function(t){t.onAfterRender.remove(e.onAfterVisualizerRenderCallback),t.onUpdate=void 0})),this.visualizer.destroy(),t.prototype.destroy.call(this)},e}(u);a.registerAlternativesVisualizer(D);var E=function(){function t(){}return t.setup=function(t,e){return this.setups[t](e)},t.setupPie=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1,h={type:e.chartType,y:l?o:r,text:(l?o:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=s,h.textposition="inside","doughnut"===e.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),n.forEach((function(t,e){a.push(Object.assign({},h,{values:t,labels:l?o:r,customdata:l?o:r}))}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:(r.length<10?50*r.length+100:550)*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:s,hovermode:"closest",plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return l&&(u.grid={rows:Math.round(a.length/2),columns:2},u.annotations=[],r.forEach((function(t,e){a[e].domain={column:e%2,row:Math.floor(e/2)},a[e].title={position:"bottom center",text:t}}))),{traces:a,layout:u,hasSeries:l}},t.setupBar=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,s=i.colors,o=i.texts,a=i.seriesLabels,l=[],h=a.length>1,u={type:e.chartType,y:(h?a:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),customdata:h?a:r,hoverinfo:"x+y",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};u.marker.color=s,n.forEach((function(t,i){var n=Object.assign({},u,{x:t,text:o[i]});if(e.showPercentages){var r=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=r,n.width=.9,n.bargap=.1}l.push(n)}));var c={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return h&&(c.showlegend=!0,c.height=30*(r.length+1)*a.length+30+30,"stackedbar"==e.chartType&&(c.barmode="stack"),r.forEach((function(t,i){l[i].hoverinfo="x+name",l[i].marker.color=void 0,l[i].name=t,"stackedbar"===e.chartType&&(l[i].type="bar"),l[i].width=(e.showPercentages?.7:.5)/l.length}))),{traces:l,layout:c,hasSeries:h}},t.setupVBar=function(t){var e=t.getAnswersData(),i=e.datasets,n=e.labels,r=e.colors,s=e.texts,o=e.seriesLabels,a=[],l=o.length>1,h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:r,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1},u={type:"bar",customdata:l?o:n,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return u.marker.color=r,i.forEach((function(e,i){var r=Object.assign({},u,{x:n,y:t.showPercentages?s[i].map((function(t){return t/100})):e,text:s[i]});if(t.showPercentages){var o=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=o,r.width=.9,r.bargap=.1}a.push(r)})),t.showPercentages&&t.showOnlyPercentages&&(h.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:t.showOnlyPercentages?25:5,tickcolor:"transparent"}),{traces:a,layout:h,hasSeries:l}},t.setupScatter=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=o.length>1,l=[],h={type:"scatter",y:(a?o:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),customdata:a?o:r,text:a?o:r,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(h.marker.symbol="circle",h.marker.size=16),n.forEach((function(t){var e=Object.assign({},h,{x:t});l.push(e)}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return a&&(u.showlegend=!0,u.height=void 0,r.forEach((function(t,e){l[e].hoverinfo="x+name",l[e].marker.color=void 0,l[e].name=t}))),{traces:l,layout:u,hasSeries:a}},t.imageExportFormat="png",t.onImageSaving=new r.Event,t.onPlotCreating=new r.Event,t.setups={bar:t.setupBar,vbar:t.setupVBar,stackedbar:t.setupBar,doughnut:t.setupPie,pie:t.setupPie,scatter:t.setupScatter},t.getTruncatedLabel=function(t,e){var i="...".length;return e?-1===e||t.length<=e+i?t:t.substring(0,e)+"...":t},t}(),A=i(7),k=i.n(A),P=function(){function t(t){this.model=t,this._chart=void 0}return t.prototype.patchConfigParameters=function(t,e,i,n){},Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this,i=E.setup(this.model.chartType,this.model),s={displaylogo:!1,responsive:!0,locale:n.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:n.a.getString("saveDiagramAsPNG"),icon:k.a.Icons.camera,click:function(t){var i={format:E.imageExportFormat,filename:e.model.question.name};E.onImageSaving.fire(e.model,i),k.a.downloadImage(t,i)}}]};void 0!==x.displayModeBar&&(s.displayModeBar=x.displayModeBar),this.patchConfigParameters(t,i.traces,i.layout,s);var o={traces:i.traces,layout:i.layout,config:s};E.onPlotCreating.fire(this.model,o);var a=k.a.newPlot(t,o.traces,o.layout,o.config);t.on("plotly_click",(function(t){var n;if(t.points.length>0){var s="";if(i.hasSeries){s=t.points[0].data.name;var o=t.points[0].label,a=e.model.getSeriesValues()[e.model.getSeriesLabels().indexOf(o)],l=e.model.getSelectedItemByText(s);h=new r.ItemValue(((n={})[a]=l.value,n),o+": "+l.text);e.model.setSelection(h)}else{s=Array.isArray(t.points[0].customdata)?t.points[0].customdata[0]:t.points[0].customdata;var h=e.model.getSelectedItemByText(s);e.model.setSelection(h)}}}));var l=function(){return t.getElementsByClassName("nsewdrag")[0]};return t.on("plotly_hover",(function(){var t=l();t&&(t.style.cursor="pointer")})),t.on("plotly_unhover",(function(){var t=l();t&&(t.style.cursor="")})),this._chart=a,a},t.prototype.destroy=function(t){k.a.purge(t),this._chart=void 0},t}(),x=function(t){function e(i,n,r,s){void 0===r&&(r={});var o=t.call(this,i,n,r,s)||this;return o.chartTypes=[].concat(e.types),o.getSeriesValues().length>0&&-1===o.chartTypes.indexOf("stackedbar")&&o.chartTypes.push("stackedbar"),r.allowExperimentalFeatures&&o.chartTypes.splice(1,0,"vbar"),o.chartType=o.chartTypes[0],-1!==o.chartTypes.indexOf(r.defaultChartType)&&(o.chartType=r.defaultChartType),o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var s=i.map((function(t,i){return e[i][n]}));r.push(s)})),r}return e},e.types=["bar","pie","doughnut","scatter"],e.displayModeBar=void 0,e}(d);a.registerVisualizer("checkbox",x),a.registerVisualizer("radiogroup",x),a.registerVisualizer("dropdown",x),a.registerVisualizer("imagepicker",x);var O=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["bar","stackedbar","pie","doughnut"],e}(p);a.registerVisualizer("matrix",O);var V=function(t){function e(e){return t.call(this,e)||this}return Object(o.b)(e,t),e.prototype.patchConfigParameters=function(t,e,i,n){var r=this.model.getColors(),s=[L.trueColor||r[0],L.falseColor||r[1]];this.model.showMissingAnswers&&s.push(r[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?e.forEach((function(t){t.marker.colors=s})):"bar"===this.model.chartType&&e.forEach((function(t){t.marker.color=s}))},e}(P),L=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["pie","bar","doughnut"],e}(f);a.registerVisualizer("boolean",L);var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(o.b)(e,t),e.prototype.getQuestionResults=function(){var t=this.question.name;return this.data.map((function(e){return e[t]}))},e.prototype.getEmptyData=function(){var t=this.getValues(),e=[];return e.length=t.length,e.fill(0),e},e.prototype.getData=function(){var t=this,e=this.getQuestionResults(),i=this.getValues(),n=this.getEmptyData();return e.forEach((function(e){t.applyResultToPlotlyData(e,n,i)})),[n]},e.prototype.applyResultToPlotlyData=function(t,e,i){t&&e&&i&&t.forEach((function(t,n,r){var s=i.indexOf(t);e[s]=+e[s]+(r.length-n)}))},e}(x);a.registerVisualizer("ranking",M);var z=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["stackedbar","bar","pie","doughnut"],e}(function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"matrixDropdownGrouped")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataName",{get:function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},e.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(t){return t.title}))},e.prototype.valuesSource=function(){return this.matrixQuestion.choices},e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getData=function(){var t=this.getValues(),e=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(t){return t.value})),n=this.dataProvider.getData({dataName:e,getValues:function(){return t},getLabels:function(){return t},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),r=[];return t.forEach((function(t,i){var s=e.map((function(t,e){return n[e][0][i]}));r.push(s)})),r},e}(d));a.registerVisualizer("matrixdropdown-grouped",z);var B=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var s=i.map((function(t,i){return e[i][n]}));r.push(s)})),r}return e},e.types=["bar","scatter"],e}(m);a.registerVisualizer("date",B),a.registerVisualizer("number",B),a.registerVisualizer("rating",B);var I=function(){function t(t){this.model=t,this._chart=void 0}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this.model.question,i=this.model.getData(),r=i[0],s=i[1],o=i[2];if("rating"===e.getType()){var a=e.visibleRateValues;o=a[a.length-1].value,s=a[0].value}var l=this.model.generateColors(o,s,R.stepsCount);R.showAsPercentage&&(r=h.a.toPercentage(r,o),s=h.a.toPercentage(s,o),o=h.a.toPercentage(o,o));var u=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[s,o]},shape:this.model.chartType,bgcolor:"white",bar:{color:l[0]}},value:r,text:e.name,domain:{x:[0,1],y:[0,1]}}],c=400;"bullet"===this.model.chartType&&(c=250);var d={data:u,layout:{width:600,height:c,plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor},config:{displayModeBar:!1,staticPlot:!0,locale:n.a.currentLocale}};return E.onPlotCreating.fire(this.model,d),k.a.newPlot(t,d.data,d.layout,d.config)},t.prototype.destroy=function(t){k.a.purge(t),this._chart=void 0},t}(),R=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new I(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["gauge","bullet"],e}(c);a.registerVisualizer("number",R),a.registerVisualizer("rating",R),a.registerVisualizer("expression",R);var j={en:["...","a","about","above","across","after","again","against","all","almost","alone","along","already","also","although","always","among","an","and","another","any","anybody","anyone","anything","anywhere","are","area","areas","around","as","ask","asked","asking","asks","at","away","b","back","backed","backing","backs","be","became","because","become","becomes","been","before","began","behind","being","beings","best","better","between","big","both","but","by","c","came","can","cannot","case","cases","certain","certainly","clear","clearly","come","could","d","did","differ","different","differently","do","does","done","down","down","downed","downing","downs","during","e","each","early","either","end","ended","ending","ends","enough","even","evenly","ever","every","everybody","everyone","everything","everywhere","f","face","faces","fact","facts","far","felt","few","find","finds","first","for","four","from","full","fully","further","furthered","furthering","furthers","g","gave","general","generally","get","gets","give","given","gives","go","going","good","goods","got","great","greater","greatest","group","grouped","grouping","groups","h","had","has","have","having","he","her","here","herself","high","high","high","higher","highest","him","himself","his","how","however","i","if","important","in","interest","interested","interesting","interests","into","is","it","its","itself","j","just","k","keep","keeps","kind","knew","know","known","knows","l","large","largely","last","later","latest","least","less","let","lets","like","likely","long","longer","longest","m","made","make","making","man","many","may","me","member","members","men","might","more","most","mostly","mr","mrs","much","must","my","myself","n","necessary","need","needed","needing","needs","never","new","new","newer","newest","next","no","nobody","non","noone","not","nothing","now","nowhere","number","numbers","o","of","off","often","old","older","oldest","on","once","one","only","open","opened","opening","opens","or","order","ordered","ordering","orders","other","others","our","out","over","p","part","parted","parting","parts","per","perhaps","place","places","point","pointed","pointing","points","possible","present","presented","presenting","presents","problem","problems","put","puts","q","quite","r","rather","really","right","right","room","rooms","s","said","same","saw","say","says","second","seconds","see","seem","seemed","seeming","seems","sees","several","shall","she","should","show","showed","showing","shows","side","sides","since","small","smaller","smallest","so","some","somebody","someone","something","somewhere","state","states","still","still","such","sure","t","take","taken","than","that","the","their","them","then","there","therefore","these","they","thing","things","think","thinks","this","those","though","thought","thoughts","three","through","thus","to","today","together","too","took","toward","turn","turned","turning","turns","two","u","under","until","up","upon","us","use","used","uses","v","very","w","want","wanted","wanting","wants","was","way","ways","we","well","wells","went","were","what","when","where","whether","which","while","who","whole","whose","why","will","with","within","without","work","worked","working","works","would","x","y","year","years","yet","you","young","younger","youngest","your","yours","z"],no:["...","alle","andre","arbeid","at","av","bare","begge","ble","blei","bli","blir","blitt","bort","bruke","både","båe","da","de","deg","dei","deim","deira","deires","dem","den","denne","der","dere","deres","det","dette","di","din","disse","ditt","du","dykk","dykkar","då","eg","ein","eit","eitt","eller","elles","en","ene","eneste","enhver","enn","er","et","ett","etter","folk","for","fordi","forsøke","fra","få","før","før","først","gjorde","gjøre","god","gå","ha","hadde","han","hans","har","hennar","henne","hennes","her","hjå","ho","hoe","honom","hoss","hossen","hun","hva","hvem","hver","hvilke","hvilken","hvis","hvor","hvordan","hvorfor","i","ikke","ikkje","ingen","ingi","inkje","inn","innen","inni","ja","jeg","kan","kom","korleis","korso","kun","kunne","kva","kvar","kvarhelst","kven","kvi","kvifor","lage","lang","lik","like","makt","man","mange","me","med","medan","meg","meget","mellom","men","mens","mer","mest","mi","min","mine","mitt","mot","mye","mykje","må","måte","navn","ned","nei","no","noe","noen","noka","noko","nokon","nokor","nokre","ny","nå","når","og","også","om","opp","oss","over","part","punkt","på","samme","seg","selv","si","sia","sidan","siden","sin","sine","sist","sitt","sjøl","skal","skulle","slik","slutt","so","som","somme","somt","start","stille","så","sånn","tid","til","tilbake","tilstand","um","under","upp","ut","uten","var","vart","varte","ved","verdi","vere","verte","vi","vil","ville","vite","vore","vors","vort","vår","være","vært","vøre","vørt","æ","å"],nl:["de","en","van","ik","te","dat","die","in","een","hij","het","niet","zijn","is","was","op","aan","met","als","voor","had","er","maar","om","hem","dan","zou","of","wat","mijn","men","dit","zo","door","over","ze","zich","bij","ook","tot","je","mij","uit","der","daar","haar","naar","heb","hoe","heeft","hebben","deze","u","want","nog","zal","me","zij","nu","ge","geen","omdat","iets","worden","toch","al","waren","veel","meer","doen","toen","moet","ben","zonder","kan","hun","dus","alles","onder","ja","eens","hier","wie","werd","altijd","doch","wordt","wezen","kunnen","ons","zelf","tegen","na","reeds","wil","kon","niets","uw","iemand","geweest","andere"]},N={getStopWords:function(t){return void 0===t&&(t=""),j[t||"en"]||[]}},H=i(20),q=i.n(H),F=function(){function t(t){this.model=t}return Object.defineProperty(t.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),t.prototype.create=function(e){var i=this,r=this.model.getData(),s=(this.model.getColors(),h.b.createElement("canvas","")),o=h.b.createElement("p","",{innerHTML:n.a.getString("noResults")});if(0!==r.length){e.appendChild(s);var a={list:r,weightFactor:t.weightFactor,abortThreshold:t.abortThreshold,drawOutOfBound:t.drawOutOfBound,shrinkToFit:t.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(t,e){return i.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(t){console.log(t[0]+": "+t[1])}};return this._wordcloud=q()(s,a),this._wordcloud}e.appendChild(o)},t.prototype.destroy=function(t){this._wordcloud=void 0},t.drawOutOfBound=!1,t.shrinkToFit=!0,t.abortThreshold=void 0,t.weightFactor=20,t}(),G=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"wordcloud")||this;return s._wordcloudAdapter=new F(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e={},i=[],r=n.a.currentLocale;i=r?N.getStopWords(r):N.getStopWords();var s=function(t){(t=""+t).length>15&&(t=t.substring(0,14)+"..."),t&&t.split(" ").forEach((function(t){(t=function(t){return-1!==i.indexOf(t)?"":t}(t.toLowerCase()||""))&&(e[t]?e[t]++:e[t]=1)}))};return this.data.forEach((function(e){var i=e[t.question.name];i&&(Array.isArray(i)?i.forEach(s):"object"==typeof i?Object.keys(i).forEach((function(t){return s(i[t])})):s(i))})),Object.keys(e).map((function(t){return[t,e[t]]}))},e.prototype.destroyContent=function(e){this._wordcloudAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._wordcloudAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",G),a.registerVisualizer("comment",G),a.registerVisualizer("multipletext",G);i(26);var X=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=this.model.getData(),i=e.columnsCount,r=e.data,s=h.b.createElement("p","",{innerHTML:n.a.getString("noResults")});if(0!==r.length){var o=h.b.createElement("table","sa-text-table");o.style.backgroundColor=this.model.backgroundColor,t.appendChild(o),r.forEach((function(t){for(var e=h.b.createElement("tr"),n=0;n<i;n++){var r=h.b.createElement("td","sa-text-table__cell",{textContent:t[n]});e.appendChild(r)}o.appendChild(e)})),t.className="sa-text-table__container",t.appendChild(o)}else t.appendChild(s)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),Y=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"text")||this;return s._textTableAdapter=new X(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e=[],i=0;return this.data.forEach((function(n){var r=n[t.question.name],s=[];r&&(Array.isArray(r)?s.concat(r):"object"==typeof r?Object.keys(r).forEach((function(t){return s.push(r[t])})):s.push(r),e.push(s),s.length>i&&(i=s.length))})),{columnsCount:i,data:e}},e.prototype.destroyContent=function(e){this._textTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._textTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",Y),a.registerVisualizer("comment",Y),a.registerVisualizer("multipletext",Y);i(27);var Q=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=this,i=this.model.getAnswersData(),r=i.datasets,s=i.labels,o=(i.colors,i.texts),a=(i.seriesLabels.length,h.b.createElement("p","",{innerHTML:n.a.getString("noResults")}));0!==r.length&&0!==r[0].length?r.forEach((function(i,r){var a=h.b.createElement("table","sa-choices-table");a.style.backgroundColor=e.model.backgroundColor,t.appendChild(a);var l=h.b.createElement("tr"),u=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("answer")});l.appendChild(u);var c=h.b.createElement("th","sa-choices-table__cell-header",{textContent:""});l.appendChild(c);var d=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("percent")});l.appendChild(d);var p=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("responses")});l.appendChild(p),a.appendChild(l),i.forEach((function(t,e){var i=h.b.createElement("tr"),n=h.b.createElement("td","sa-choices-table__cell",{textContent:s[e]});i.appendChild(n);var l=h.b.createElement("td","sa-choices-table__cell"),u=h.b.createElement("div","sa-choices-sparkline"),c=h.b.createElement("div","sa-choices-sparkline-value");c.style.width=o[r][e]+"%",u.appendChild(c),l.appendChild(u),i.appendChild(l);var d=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:o[r][e]+"%"});i.appendChild(d);var p=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:t});i.appendChild(p),a.appendChild(i)})),t.className="sa-choices-table__container",t.appendChild(a)})):t.appendChild(a)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),U=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"choices")||this;return s._choicesTableAdapter=new Q(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._choicesTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._choicesTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(d)}])}));
|
|
23
|
+
t.exports=function(){"use strict";var t={};function e(){this._events={},this._queue=[],this._counter=0,this._isDestroyed=!1}e.prototype.on=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];return i||(i=this._events[t]=[]),i.push(e),this},e.prototype.off=function(t,e){if(this._isDestroyed)return this;var i=this._events[t];if(!i||!i.length)return this;if(!e)return i.length=0,this;for(var n=i.length;n--;)e===i[n]&&i.splice(n,1);return this},e.prototype.emit=function(t,e,i,n){if(this._isDestroyed)return this;var r=this._events[t];if(!r||!r.length)return this;var s,o=this._queue,a=o.length,l=arguments.length-1;for(s=0;s<r.length;s++)o.push(r[s]);for(++this._counter,s=a,a=o.length;s<a;s++)if(0===l?o[s]():1===l?o[s](e):2===l?o[s](e,i):o[s](e,i,n),this._isDestroyed)return this;return--this._counter,this._counter||(o.length=0),this},e.prototype.destroy=function(){if(this._isDestroyed)return this;var t,e=this._events;for(t in this._isDestroyed=!0,this._queue.length=this._counter=0,e)e[t]&&(e[t].length=0,e[t]=void 0);return this};var i="transform",n="transform",r=window.document.documentElement.style,s=!1;["","Webkit","Moz","O","ms"].forEach((function(t){if(!s){var e=t?t+"Transform":"transform";void 0!==r[e]&&(t=t.toLowerCase(),i=t?"-"+t+"-transform":"transform",n=e,s=!0)}}));var o="function"==typeof WeakMap?new WeakMap:null;function a(t,e){var n=o&&o.get(t);return n||(n=window.getComputedStyle(t,null),o&&o.set(t,n)),n.getPropertyValue("transform"===e?i:e)}var l=/([A-Z])/g;function h(t){return t.replace(l,"-$1").toLowerCase()}function u(t){return"function"==typeof t}function c(t,e){for(var i in e)t.style["transform"===i?n:i]=e[i]}function d(t){this._element=t,this._animation=null,this._callback=null,this._props=[],this._values=[],this._keyframes=[],this._options={},this._isDestroyed=!1,this._onFinish=this._onFinish.bind(this)}d.prototype.start=function(t,e,i){if(!this._isDestroyed){var n=this._animation,r=this._props,s=this._values,o=i||0,a=!1;if(n){var l,h=0;for(var d in e)if(++h,-1===(l=r.indexOf(d))||e[d]!==s[l]){a=!0;break}a||h===r.length||(a=!0)}if(a&&n.cancel(),this._callback=u(o.onFinish)?o.onFinish:null,!n||a){for(d in r.length=s.length=0,e)r.push(d),s.push(e[d]);var p=this._keyframes;p[0]=t,p[1]=e;var f=this._options;f.duration=o.duration||300,f.easing=o.easing||"ease";var m=this._element;(n=m.animate(p,f)).onfinish=this._onFinish,this._animation=n,c(m,e)}}},d.prototype.stop=function(t){if(!this._isDestroyed&&this._animation){var e,i,r,s=this._element,o=this._props,l=this._values;if(t)c(s,t);else for(r=0;r<o.length;r++)i=a(s,h(e=o[r])),s.style["transform"===e?n:e]=i;this._animation.cancel(),this._animation=this._callback=null,o.length=l.length=0}},d.prototype.isAnimating=function(){return!!this._animation},d.prototype.destroy=function(){this._isDestroyed||(this.stop(),this._element=this._options=this._keyframes=null,this._isDestroyed=!0)},d.prototype._onFinish=function(){var t=this._callback;this._animation=this._callback=null,this._props.length=this._values.length=0,t&&t()};var p=["","webkit","moz","ms","o","Webkit","Moz","MS","O"];function f(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),s=0;s<p.length;){if((n=(i=p[s])?i+r:e)in t)return n;++s}return null}var m=(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return this.setTimeout((function(){t(1e3/60)}),1e3/60)}).bind(window),_=!1;try{var g=Object.defineProperty({},"passive",{get:function(){_=!0}});window.addEventListener("testPassive",null,g),window.removeEventListener("testPassive",null,g)}catch(t){}var y="start",v="move",b="end",w="cancel",C=!(!("ontouchstart"in window)&&!window.TouchEvent),S=!!window.PointerEvent,T=!!window.navigator.msPointerEnabled,D=/(android)/i.test(window.navigator.userAgent),E=!!_&&{passive:!0},A=f(window.document.documentElement.style,"touchAction");function k(t,i){this._element=t,this._emitter=new e,this._isDestroyed=!1,this._cssProps={},this._touchAction="",this._startEvent=null,this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._preStartCheck=this._preStartCheck.bind(this),this._abortNonCancelable=this._abortNonCancelable.bind(this),this._onStart=this._onStart.bind(this),this._onMove=this._onMove.bind(this),this._onCancel=this._onCancel.bind(this),this._onEnd=this._onEnd.bind(this),this.setCssProps(i),this._touchAction||this.setTouchAction("auto"),t.addEventListener("dragstart",k._preventDefault,!1),t.addEventListener(k._events.start,this._preStartCheck,E),!C||S||T||t.addEventListener(k._mouseEvents.start,this._preStartCheck,E)}function P(){this._nextStep=null,this._queue=[],this._reads={},this._writes={},this._batch=[],this._batchReads={},this._batchWrites={},this._step=this._step.bind(this)}k._pointerEvents={start:"pointerdown",move:"pointermove",cancel:"pointercancel",end:"pointerup"},k._msPointerEvents={start:"MSPointerDown",move:"MSPointerMove",cancel:"MSPointerCancel",end:"MSPointerUp"},k._touchEvents={start:"touchstart",move:"touchmove",cancel:"touchcancel",end:"touchend"},k._mouseEvents={start:"mousedown",move:"mousemove",cancel:"",end:"mouseup"},k._events=S?k._pointerEvents:T?k._msPointerEvents:C?k._touchEvents:k._mouseEvents,k._emitter=new e,k._activeInstances=[],k._preventDefault=function(t){t.preventDefault&&!1!==t.cancelable&&t.preventDefault()},k._activateInstance=function(t){k._activeInstances.indexOf(t)>-1||(k._activeInstances.push(t),k._emitter.on(v,t._onMove),k._emitter.on(w,t._onCancel),k._emitter.on(b,t._onEnd),1===k._activeInstances.length&&k._bindListeners())},k._deactivateInstance=function(t){var e=k._activeInstances.indexOf(t);-1!==e&&(k._activeInstances.splice(e,1),k._emitter.off(v,t._onMove),k._emitter.off(w,t._onCancel),k._emitter.off(b,t._onEnd),k._activeInstances.length||k._unbindListeners())},k._bindListeners=function(){var t=k._events;window.addEventListener(t.move,k._onMove,E),window.addEventListener(t.end,k._onEnd,E),t.cancel&&window.addEventListener(t.cancel,k._onCancel,E)},k._unbindListeners=function(){var t=k._events;window.removeEventListener(t.move,k._onMove,E),window.removeEventListener(t.end,k._onEnd,E),t.cancel&&window.removeEventListener(t.cancel,k._onCancel,E)},k._getEventPointerId=function(t){return"number"==typeof t.pointerId?t.pointerId:t.changedTouches?t.changedTouches[0]?t.changedTouches[0].identifier:null:1},k._getTouchById=function(t,e){if("number"==typeof t.pointerId)return t.pointerId===e?t:null;if(t.changedTouches){for(var i=0;i<t.changedTouches.length;i++)if(t.changedTouches[i].identifier===e)return t.changedTouches[i];return null}return t},k._onMove=function(t){k._emitter.emit(v,t)},k._onCancel=function(t){k._emitter.emit(w,t)},k._onEnd=function(t){k._emitter.emit(b,t)},k.prototype._reset=function(){this._isDestroyed||(this._pointerId=null,this._startTime=0,this._startX=0,this._startY=0,this._currentX=0,this._currentY=0,this._startEvent=null,this._element.removeEventListener(k._touchEvents.start,this._abortNonCancelable,E),k._deactivateInstance(this))},k.prototype._createEvent=function(t,e){var i=this._getTrackedTouch(e);return{type:t,srcEvent:e,distance:this.getDistance(),deltaX:this.getDeltaX(),deltaY:this.getDeltaY(),deltaTime:t===y?0:this.getDeltaTime(),isFirst:t===y,isFinal:t===b||t===w,identifier:this._pointerId,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY,pageX:i.pageX,pageY:i.pageY,target:i.target}},k.prototype._emit=function(t,e){this._emitter.emit(t,this._createEvent(t,e))},k.prototype._getTrackedTouch=function(t){return null===this._pointerId?null:k._getTouchById(t,this._pointerId)},k.prototype._preStartCheck=function(t){this._isDestroyed||this.isDragging()||D&&!1===t.cancelable||t.button||(this._pointerId=k._getEventPointerId(t),null!==this._pointerId&&(this._startEvent=t,C&&(S||T)?(D&&this._element.addEventListener(k._touchEvents.start,this._abortNonCancelable,E),m(this._onStart)):this._onStart()))},k.prototype._abortNonCancelable=function(t){this._element.removeEventListener(k._touchEvents.start,this._abortNonCancelable,E),this._startEvent&&!1===t.cancelable&&(this._pointerId=null,this._startEvent=null)},k.prototype._onStart=function(){var t=this._startEvent;if(t){this._startEvent=null;var e=this._getTrackedTouch(t);e&&(this._startX=this._currentX=e.clientX,this._startY=this._currentY=e.clientY,this._startTime=Date.now(),this._emit(y,t),k._activateInstance(this))}},k.prototype._onMove=function(t){var e=this._getTrackedTouch(t);e&&(this._currentX=e.clientX,this._currentY=e.clientY,this._emit(v,t))},k.prototype._onCancel=function(t){this._getTrackedTouch(t)&&(this._emit(w,t),this._reset())},k.prototype._onEnd=function(t){this._getTrackedTouch(t)&&(this._emit(b,t),this._reset())},k.prototype.isDragging=function(){return null!==this._pointerId},k.prototype.setTouchAction=function(t){this._touchAction=t,A&&(this._cssProps[A]="",this._element.style[A]=t),C&&(this._element.removeEventListener(k._touchEvents.start,k._preventDefault,!1),this._element.style[A]!==t&&this._element.addEventListener(k._touchEvents.start,k._preventDefault,!1))},k.prototype.setCssProps=function(t){if(t){var e,i,n=this._cssProps,r=this._element;for(e in n)r.style[e]=n[e],delete n[e];for(e in t)t[e]&&("touchAction"!==e?(i=f(r.style,e))&&(n[i]="",r.style[i]=t[e]):this.setTouchAction(t[e]))}},k.prototype.getDeltaX=function(){return this._currentX-this._startX},k.prototype.getDeltaY=function(){return this._currentY-this._startY},k.prototype.getDistance=function(){var t=this.getDeltaX(),e=this.getDeltaY();return Math.sqrt(t*t+e*e)},k.prototype.getDeltaTime=function(){return this._startTime?Date.now()-this._startTime:0},k.prototype.on=function(t,e){this._emitter.on(t,e)},k.prototype.off=function(t,e){this._emitter.off(eventName,e)},k.prototype.destroy=function(){if(!this._isDestroyed){var t=this._element,e=k._events;for(var i in this._reset(),this._emitter.destroy(),t.removeEventListener(e.start,this._preStartCheck,E),t.removeEventListener(k._mouseEvents.start,this._preStartCheck,E),t.removeEventListener("dragstart",k._preventDefault,!1),t.removeEventListener(k._touchEvents.start,k._preventDefault,!1),this._cssProps)t.style[i]=this._cssProps[i],delete this._cssProps[i];this._element=null,this._isDestroyed=!0}},P.prototype.add=function(t,e,i,n){var r=this._queue.indexOf(t);r>-1&&(this._queue[r]=void 0),n?this._queue.unshift(t):this._queue.push(t),this._reads[t]=e,this._writes[t]=i,this._nextStep||(this._nextStep=m(this._step))},P.prototype.cancel=function(t){var e=this._queue.indexOf(t);e>-1&&(this._queue[e]=void 0,delete this._reads[t],delete this._writes[t])},P.prototype._step=function(){var t,e,i=this._queue,n=this._reads,r=this._writes,s=this._batch,o=this._batchReads,a=this._batchWrites,l=i.length;for(this._nextStep=null,e=0;e<l;e++)(t=i[e])&&(s.push(t),o[t]=n[t],delete n[t],a[t]=r[t],delete r[t]);for(i.length=0,e=0;e<l;e++)o[t=s[e]]&&(o[t](),delete o[t]);for(e=0;e<l;e++)a[t=s[e]]&&(a[t](),delete a[t]);s.length=0,!this._nextStep&&i.length&&(this._nextStep=m(this._step))};var x=new P;function O(t){return x.cancel(t+"visibility")}function V(t){return x.cancel(t+"move")}function L(t){return x.cancel(t+"scroll")}function M(t){return x.cancel(t+"placeholder")}var z=window.Element.prototype,B=z.matches||z.matchesSelector||z.webkitMatchesSelector||z.mozMatchesSelector||z.msMatchesSelector||z.oMatchesSelector||function(){return!1};function I(t,e){return B.call(t,e)}function R(t,e){t.classList?t.classList.add(e):I(t,"."+e)||(t.className+=" "+e)}var j=[];function N(t,e,i){var n="number"==typeof i?i:-1;n<0&&(n=t.length-n+1),t.splice.apply(t,j.concat(n,0,e)),j.length=0}function H(t,e,i){var n=t.length,r=Math.max(0,i?n:n-1);return e>r?r:e<0?Math.max(r+e+1,0):e}function q(t,e,i){if(!(t.length<2)){var n=H(t,e),r=H(t,i);n!==r&&t.splice(r,0,t.splice(n,1)[0])}}function F(t,e,i){if(!(t.length<2)){var n,r=H(t,e),s=H(t,i);r!==s&&(n=t[r],t[r]=t[s],t[s]=n)}}var G=0;function X(t,e){var i,n=++G+"debounce";return e>0?function(r){void 0!==i&&(i=window.clearTimeout(i),x.cancel(n),"finish"===r&&t()),"cancel"!==r&&"finish"!==r&&(i=window.setTimeout((function(){i=void 0,x.add(n,t,null,!0)}),e))}:function(e){"cancel"!==e&&t()}}function Y(t){var e=a(t,"transform");if(!e||"none"===e)return!1;var i=a(t,"display");return"inline"!==i&&"none"!==i}function Q(t,e){for(var i=window.document,n=(e?t:t.parentElement)||i;n&&n!==i&&"static"===a(n,"position")&&!Y(n);)n=n.parentElement||i;return n}function U(t,e){return parseFloat(a(t,e))||0}var W={},K={},Z={};function J(t,e){var i,n=e||{};return n.left=0,n.top=0,t===document||(n.left=window.pageXOffset||0,n.top=window.pageYOffset||0,t.self===window.self||(i=t.getBoundingClientRect(),n.left+=i.left,n.top+=i.top,n.left+=U(t,"border-left-width"),n.top+=U(t,"border-top-width"))),n}function $(t,e,i){return Z.left=0,Z.top=0,t===e||i&&(t=Q(t,!0))===(e=Q(e,!0))||(J(t,W),J(e,K),Z.left=K.left-W.left,Z.top=K.top-W.top),Z}function tt(t){var e=a(t,"overflow");return"auto"===e||"scroll"===e||"auto"===(e=a(t,"overflow-x"))||"scroll"===e||"auto"===(e=a(t,"overflow-y"))||"scroll"===e}function et(t,e,i){for(var n=i||[],r=e?t:t.parentNode;r&&r!==document;)r.getRootNode&&r instanceof DocumentFragment?r=r.getRootNode().host:(tt(r)&&n.push(r),r=r.parentNode);return n.push(window),n}var it,nt,rt,st,ot={},at=/^matrix3d/,lt=/([^,]*,){4}/,ht=/([^,]*,){12}/,ut=/[^,]*,/;function ct(t){ot.x=0,ot.y=0;var e=a(t,"transform");if(!e||"none"===e)return ot;var i=at.test(e),n=e.replace(i?ht:lt,""),r=n.replace(ut,"");return ot.x=parseFloat(n)||0,ot.y=parseFloat(r)||0,ot}function dt(t,e){return"translateX("+t+"px) translateY("+e+"px)"}function pt(t,e){t.classList?t.classList.remove(e):I(t,"."+e)&&(t.className=(" "+t.className+" ").replace(" "+e+" "," ").trim())}function ft(t){var e=t._element,i=t.getGrid(),n=i._settings;this._item=t,this._gridId=i._id,this._isDestroyed=!1,this._isMigrating=!1,this._startPredicate=u(n.dragStartPredicate)?n.dragStartPredicate:ft.defaultStartPredicate,this._startPredicateState=0,this._startPredicateResult=void 0,this._hBlockedIndex=null,this._hX1=0,this._hX2=0,this._hY1=0,this._hY2=0,this._reset(),this._preStartCheck=this._preStartCheck.bind(this),this._preEndCheck=this._preEndCheck.bind(this),this._onScroll=this._onScroll.bind(this),this._prepareMove=this._prepareMove.bind(this),this._applyMove=this._applyMove.bind(this),this._prepareScroll=this._prepareScroll.bind(this),this._applyScroll=this._applyScroll.bind(this),this._checkOverlap=this._checkOverlap.bind(this);var r=n.dragSortHeuristics.sortInterval;this._checkOverlapDebounce=X(this._checkOverlap,r),this._dragger=new k(e,n.dragCssProps),this._dragger.on("start",this._preStartCheck),this._dragger.on("move",this._preStartCheck),this._dragger.on("cancel",this._preEndCheck),this._dragger.on("end",this._preEndCheck)}function mt(t,e){return t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top?0:(Math.min(t.left+t.width,e.left+e.width)-Math.max(t.left,e.left))*(Math.min(t.top+t.height,e.top+e.height)-Math.max(t.top,e.top))/(Math.min(t.width,e.width)*Math.min(t.height,e.height))*100}function _t(t){this._item=t,this._animate=new d,this._element=null,this._className="",this._didMigrate=!1,this._resetAfterLayout=!1,this._currentLeft=0,this._currentTop=0,this._nextLeft=0,this._nextTop=0,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this),this._onLayoutStart=this._onLayoutStart.bind(this),this._onLayoutEnd=this._onLayoutEnd.bind(this),this._onReleaseEnd=this._onReleaseEnd.bind(this),this._onMigrate=this._onMigrate.bind(this)}function gt(){this._queue=[],this._isDestroyed=!1}function yt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isInterrupted=!1,this._currentStyles={},this._targetStyles={},this._currentLeft=0,this._currentTop=0,this._offsetLeft=0,this._offsetTop=0,this._skipNextAnimation=!1,this._animateOptions={onFinish:this._finish.bind(this)},this._queue=new gt,this._setupAnimation=this._setupAnimation.bind(this),this._startAnimation=this._startAnimation.bind(this)}ft.defaultStartPredicate=function(t,e,i){var n=t._drag,r=n._startPredicateData||n._setupStartPredicate(i);if(!e.isFinal)return!(!r.handleElement&&(r.handleElement=n._getStartPredicateHandle(e),!r.handleElement))&&(r.delay&&(r.event=e,r.delayTimer||(r.delayTimer=window.setTimeout((function(){r.delay=0,n._resolveStartPredicate(r.event)&&(n._forceResolveStartPredicate(r.event),n._resetStartPredicate())}),r.delay))),n._resolveStartPredicate(e));n._finishStartPredicate(e)},ft.defaultSortPredicate=(it={},nt={},rt={},st=[],function(t,e){var i=t._drag,n=i._getGrid(),r=e&&"number"==typeof e.threshold?e.threshold:50,s=e&&"swap"===e.action?"swap":"move";it.width=t._width,it.height=t._height,it.left=i._elementClientX,it.top=i._elementClientY;var o=function(t,e,i){var n,r,s,o,a=null,l=e._settings.dragSort,h=-1;if(!0===l?(st[0]=e,r=st):r=l.call(e,t),!Array.isArray(r))return a;for(o=0;o<r.length;o++)(s=r[o])._isDestroyed||(s._updateBoundingRect(),nt.width=s._width,nt.height=s._height,nt.left=s._left,nt.top=s._top,(n=mt(it,nt))>i&&n>h&&(h=n,a=s));return st.length=0,a}(t,n,r);if(!o)return!1;var a,l,h,u,c,d=0,p=0,f=-1;for(o===n?(it.left=i._gridX+t._marginLeft,it.top=i._gridY+t._marginTop):(o._updateBorders(1,0,1,0),d=o._left+o._borderLeft,p=o._top+o._borderTop),c=0;c<o._items.length;c++)(h=o._items[c])._isActive&&h!==t&&(l=!0,nt.width=h._width,nt.height=h._height,nt.left=h._left+h._marginLeft+d,nt.top=h._top+h._marginTop+p,(u=mt(it,nt))>f&&(a=c,f=u));return f<r&&t.getGrid()!==o&&(a=l?-1:0,f=1/0),f>=r&&(rt.grid=o,rt.index=a,rt.action=s,rt)}),ft.prototype.stop=function(){var t=this._item,e=t._element,i=this._getGrid();return this._isActive?this._isMigrating?(this._finishMigration(),this):(V(t._id),L(t._id),this._unbindScrollListeners(),this._checkOverlapDebounce("cancel"),e.parentNode!==i._element&&(i._element.appendChild(e),e.style[n]=dt(this._gridX,this._gridY)),pt(e,i._settings.itemDraggingClass),this._reset(),this):this},ft.prototype.destroy=function(){return this._isDestroyed||(this.stop(),this._dragger.destroy(),this._isDestroyed=!0),this},ft.prototype._getGrid=function(){return t[this._gridId]||null},ft.prototype._reset=function(){this._isActive=!1,this._container=null,this._containingBlock=null,this._dragEvent=null,this._scrollEvent=null,this._scrollers=[],this._left=0,this._top=0,this._gridX=0,this._gridY=0,this._elementClientX=0,this._elementClientY=0,this._containerDiffX=0,this._containerDiffY=0},ft.prototype._bindScrollListeners=function(){var t,e,i=this._getGrid()._element,n=this._container,r=this._scrollers;if(r.length=0,et(this._item._element,!1,r),n!==i)for(et(i,!0,t=[]),e=0;e<t.length;e++)r.indexOf(t[e])<0&&r.push(t[e]);for(e=0;e<r.length;e++)r[e].addEventListener("scroll",this._onScroll)},ft.prototype._unbindScrollListeners=function(){var t,e=this._scrollers;for(t=0;t<e.length;t++)e[t].removeEventListener("scroll",this._onScroll);e.length=0},ft.prototype._setupStartPredicate=function(t){var e=t||this._getGrid()._settings.dragStartPredicate||0;return this._startPredicateData={distance:Math.abs(e.distance)||0,delay:Math.max(e.delay,0)||0,handle:"string"==typeof e.handle&&e.handle}},ft.prototype._getStartPredicateHandle=function(t){var e=this._startPredicateData,i=this._item._element,n=i;if(!e.handle)return n;for(n=t.target;n&&!I(n,e.handle);)n=n!==i?n.parentElement:null;return n||null},ft.prototype._resolveStartPredicate=function(t){var e=this._startPredicateData;if(!(t.distance<e.distance||e.delay)){var i=e.handleElement.getBoundingClientRect(),n=i.left+(window.pageXOffset||0),r=i.top+(window.pageYOffset||0),s=i.width,o=i.height;return this._resetStartPredicate(),s&&o&&t.pageX>=n&&t.pageX<n+s&&t.pageY>=r&&t.pageY<r+o}},ft.prototype._forceResolveStartPredicate=function(t){this._isDestroyed||1!==this._startPredicateState||(this._startPredicateState=2,this._onStart(t))},ft.prototype._finishStartPredicate=function(t){var e=this._item._element,i=Math.abs(t.deltaX)<2&&Math.abs(t.deltaY)<2&&t.deltaTime<200;this._resetStartPredicate(),i&&function(t){if("a"===t.tagName.toLowerCase()){var e=t.getAttribute("href");if(e){var i=t.getAttribute("target");i&&"_self"!==i?window.open(e,i):window.location.href=e}}}(e)},ft.prototype._resetHeuristics=function(t){this._hBlockedIndex=null,this._hX1=this._hX2=t.clientX,this._hY1=this._hY2=t.clientY},ft.prototype._checkHeuristics=function(t){var e=this._getGrid()._settings.dragSortHeuristics,i=e.minDragDistance;if(i<=0)return this._hBlockedIndex=null,!0;var n=t.clientX,r=t.clientY,s=n-this._hX2,o=r-this._hY2,a=i>3&&e.minBounceBackAngle>0;if(a||(this._hBlockedIndex=null),Math.abs(s)>i||Math.abs(o)>i){if(a){var l=Math.atan2(s,o),h=Math.atan2(this._hX2-this._hX1,this._hY2-this._hY1),u=Math.atan2(Math.sin(l-h),Math.cos(l-h));Math.abs(u)>e.minBounceBackAngle&&(this._hBlockedIndex=null)}return this._hX1=this._hX2,this._hY1=this._hY2,this._hX2=n,this._hY2=r,!0}return!1},ft.prototype._resetStartPredicate=function(){var t=this._startPredicateData;t&&(t.delayTimer&&(t.delayTimer=window.clearTimeout(t.delayTimer)),this._startPredicateData=null)},ft.prototype._checkOverlap=function(){if(this._isActive){var t,e,i,n,r,s,o,a=this._item,l=this._getGrid()._settings;(t=u(l.dragSortPredicate)?l.dragSortPredicate(a,this._dragEvent):ft.defaultSortPredicate(a,l.dragSortPredicate))&&"number"==typeof t.index&&(o=(e=a.getGrid())!==(n=t.grid||e),i=e._items.indexOf(a),r=H(n._items,t.index,o),s="swap"===t.action?"swap":"move",(o||r!==this._hBlockedIndex)&&(o?(this._hBlockedIndex=null,e._hasListeners("beforeSend")&&e._emit("beforeSend",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("beforeReceive")&&n._emit("beforeReceive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),a._gridId=n._id,this._isMigrating=a._gridId!==this._gridId,e._items.splice(i,1),N(n._items,a,r),a._sortData=null,e._hasListeners("send")&&e._emit("send",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),n._hasListeners("receive")&&n._emit("receive",{item:a,fromGrid:e,fromIndex:i,toGrid:n,toIndex:r}),e.layout(),n.layout()):i!==r&&(this._hBlockedIndex=i,("swap"===s?F:q)(e._items,i,r),e._hasListeners("move")&&e._emit("move",{item:a,fromIndex:i,toIndex:r,action:s}),e.layout())))}},ft.prototype._finishMigration=function(){var t,e,i=this._item,r=i._release,s=i._element,o=i._isActive,a=i.getGrid(),l=a._element,h=a._settings,u=h.dragContainer||l,d=this._getGrid()._settings,p=s.parentNode;this._isMigrating=!1,this.destroy(),pt(s,d.itemClass),pt(s,d.itemVisibleClass),pt(s,d.itemHiddenClass),R(s,h.itemClass),R(s,o?h.itemVisibleClass:h.itemHiddenClass),u!==p&&(u.appendChild(s),e=$(p,u,!0),(t=ct(s)).x-=e.left,t.y-=e.top),i._refreshDimensions(),i._refreshSortData(),e=$(u,l,!0),r._containerDiffX=e.left,r._containerDiffY=e.top,i._drag=h.dragEnabled?new ft(i):null,u!==p&&(s.style[n]=dt(t.x,t.y)),i._child.removeAttribute("style"),c(i._child,o?h.visibleStyles:h.hiddenStyles),r.start()},ft.prototype._preStartCheck=function(t){0===this._startPredicateState&&(this._startPredicateState=1),1===this._startPredicateState?(this._startPredicateResult=this._startPredicate(this._item,t),!0===this._startPredicateResult?(this._startPredicateState=2,this._onStart(t)):!1===this._startPredicateResult&&(this._startPredicateState=3)):2===this._startPredicateState&&this._isActive&&this._onMove(t)},ft.prototype._preEndCheck=function(t){var e=2===this._startPredicateState;this._startPredicate(this._item,t),this._startPredicateState=0,e&&this._isActive&&this._onEnd(t)},ft.prototype._onStart=function(t){var e=this._item;if(e._isActive){var i,r=e._element,s=this._getGrid(),o=s._settings,a=e._release,l=e._migrate,h=s._element,u=o.dragContainer||h,c=Q(u,!0),d=ct(r),p=d.x,f=d.y,m=r.getBoundingClientRect(),_=u!==h;this._resetHeuristics(t),_&&(i=$(c,h)),e.isPositioning()&&e._layout.stop(!0,{transform:dt(p,f)}),l._isActive&&(p-=l._containerDiffX,f-=l._containerDiffY,l.stop(!0,{transform:dt(p,f)})),e.isReleasing()&&a._reset(),this._isActive=!0,this._dragEvent=t,this._container=u,this._containingBlock=c,this._elementClientX=m.left,this._elementClientY=m.top,this._left=this._gridX=p,this._top=this._gridY=f,o.dragPlaceholder.enabled&&e._dragPlaceholder.create(),s._emit("dragInit",e,t),_&&(this._containerDiffX=i.left,this._containerDiffY=i.top,r.parentNode===u?(this._gridX=p-this._containerDiffX,this._gridY=f-this._containerDiffY):(this._left=p+this._containerDiffX,this._top=f+this._containerDiffY,u.appendChild(r),r.style[n]=dt(this._left,this._top))),R(r,o.itemDraggingClass),this._bindScrollListeners(),s._emit("dragStart",e,t)}},ft.prototype._onMove=function(t){var e=this._item;if(e._isActive){var i,n,r,s=this._getGrid()._settings.dragAxis;if("y"!==s){var o=t.clientX-this._dragEvent.clientX;this._left+=o,this._gridX+=o,this._elementClientX+=o}if("x"!==s){var a=t.clientY-this._dragEvent.clientY;this._top+=a,this._gridY+=a,this._elementClientY+=a}this._dragEvent=t,i=e._id,n=this._prepareMove,r=this._applyMove,x.add(i+"move",n,r,!0)}else this.stop()},ft.prototype._prepareMove=function(){this._item._isActive&&this._getGrid()._settings.dragSort&&this._checkHeuristics(this._dragEvent)&&this._checkOverlapDebounce()},ft.prototype._applyMove=function(){var t=this._item;t._isActive&&(t._element.style[n]=dt(this._left,this._top),this._getGrid()._emit("dragMove",t,this._dragEvent))},ft.prototype._onScroll=function(t){var e,i,n,r=this._item;r._isActive?(this._scrollEvent=t,e=r._id,i=this._prepareScroll,n=this._applyScroll,x.add(e+"scroll",i,n,!0)):this.stop()},ft.prototype._prepareScroll=function(){var t=this._item;if(t._isActive){var e,i=t._element,n=this._getGrid(),r=n._settings,s=r.dragAxis,o=n._element,a=i.getBoundingClientRect(),l=this._elementClientX-a.left,h=this._elementClientY-a.top;this._container!==o&&(e=$(this._containingBlock,o),this._containerDiffX=e.left,this._containerDiffY=e.top),"y"!==s&&(this._left+=l,this._gridX=this._left-this._containerDiffX),"x"!==s&&(this._top+=h,this._gridY=this._top-this._containerDiffY),r.dragSort&&this._checkOverlapDebounce()}},ft.prototype._applyScroll=function(){var t=this._item;t._isActive&&(t._element.style[n]=dt(this._left,this._top),this._getGrid()._emit("dragScroll",t,this._scrollEvent))},ft.prototype._onEnd=function(t){var e=this._item,i=e._element,n=this._getGrid(),r=n._settings,s=e._release;e._isActive?(V(e._id),L(e._id),r.dragSort&&this._checkOverlapDebounce("finish"),this._unbindScrollListeners(),s._containerDiffX=this._containerDiffX,s._containerDiffY=this._containerDiffY,this._reset(),pt(i,r.itemDraggingClass),n._emit("dragEnd",e,t),this._isMigrating?this._finishMigration():s.start()):this.stop()},_t.prototype._onLayoutStart=function(){var t=this._item,e=t.getGrid(),i=e._items.indexOf(t),n=e._layout.slots[2*i],r=e._layout.slots[2*i+1];if(this._didMigrate||t._left!==n||t._top!==r){var s,o,a;if(n+=t._marginLeft,r+=t._marginTop,!(e._settings.dragPlaceholder.duration>0)||this._didMigrate){M(t._id);var l={transform:dt(n,r)};return this._animate.isAnimating()?this._animate.stop(l):c(this._element,l),void(this._didMigrate&&(e.getElement().appendChild(this._element),this._didMigrate=!1))}this._nextLeft=n,this._nextTop=r,s=t._id,o=this._setupAnimation,a=this._startAnimation,x.add(s+"placeholder",o,a)}},_t.prototype._setupAnimation=function(){if(this.isActive()){var t=ct(this._element);this._currentLeft=t.x,this._currentTop=t.y}},_t.prototype._startAnimation=function(){if(this.isActive()){var t=this._animate,e=this._currentLeft,i=this._currentTop,n=this._nextLeft,r=this._nextTop,s={transform:dt(n,r)};if(e!==n||i!==r){var o=this._item.getGrid()._settings.dragPlaceholder,a={transform:dt(e,i)};t.start(a,s,{duration:o.duration,easing:o.easing,onFinish:this._onLayoutEnd})}else t.isAnimating()&&t.stop(s)}},_t.prototype._onLayoutEnd=function(){this._resetAfterLayout&&this.reset()},_t.prototype._onReleaseEnd=function(t){if(t._id===this._item._id){if(!this._animate.isAnimating())return void this.reset();this._resetAfterLayout=!0}},_t.prototype._onMigrate=function(t){if(t.item===this._item){var e=this._item.getGrid(),i=t.toGrid;e.off("dragReleaseEnd",this._onReleaseEnd),e.off("layoutStart",this._onLayoutStart),e.off("beforeSend",this._onMigrate),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("layoutStart",this._onLayoutStart),i.on("beforeSend",this._onMigrate),this._didMigrate=!0}},_t.prototype.create=function(){if(this.isActive())this._resetAfterLayout=!1;else{var t,e=this._item,i=e.getGrid(),n=i._settings,r=this._animate;t=u(n.dragPlaceholder.createElement)?n.dragPlaceholder.createElement(e):window.document.createElement("div"),this._element=t,r._element=t,this._className=n.itemPlaceholderClass||"",this._className&&R(t,this._className);var s=e._left+e._marginLeft,o=e._top+e._marginTop;c(t,{display:"block",position:"absolute",left:"0",top:"0",width:e._width+"px",height:e._height+"px",transform:dt(s,o)}),i.on("layoutStart",this._onLayoutStart),i.on("dragReleaseEnd",this._onReleaseEnd),i.on("beforeSend",this._onMigrate),u(n.dragPlaceholder.onCreate)&&n.dragPlaceholder.onCreate(e,t),i.getElement().appendChild(t)}},_t.prototype.reset=function(){if(this.isActive()){var t=this._element,e=this._item,i=e.getGrid(),n=i._settings,r=this._animate;this._resetAfterLayout=!1,M(e._id),r.stop(),r._element=null,i.off("dragReleaseEnd",this._onReleaseEnd),i.off("layoutStart",this._onLayoutStart),i.off("beforeSend",this._onMigrate),this._className&&(pt(t,this._className),this._className=""),t.parentNode.removeChild(t),this._element=null,u(n.dragPlaceholder.onRemove)&&n.dragPlaceholder.onRemove(e,t)}},_t.prototype.updateDimensions=function(t,e){this.isActive()&&c(this._element,{width:t+"px",height:e+"px"})},_t.prototype.isActive=function(){return!!this._element},_t.prototype.destroy=function(){this.reset(),this._animate.destroy(),this._item=this._animate=null},gt.prototype.add=function(t){return this._isDestroyed||this._queue.push(t),this},gt.prototype.flush=function(t,e){if(this._isDestroyed)return this;var i,n=this._queue,r=n.length;if(!r)return this;var s=1===r,o=s?n[0]:n.slice(0);if(n.length=0,s)return o(t,e),this;for(i=0;i<r&&(o[i](t,e),!this._isDestroyed);i++);return this},gt.prototype.destroy=function(){return this._isDestroyed||(this._isDestroyed=!0,this._queue.length=0),this},yt.prototype.start=function(t,e){if(!this._isDestroyed){var i,n,r,s,o=this._item,a=o._element,l=o._release,h=o.getGrid()._settings,d=this._isActive,p=l._isActive&&!1===l._isPositioningStarted,f=p?h.dragReleaseDuration:h.layoutDuration,m=p?h.dragReleaseEasing:h.layoutEasing,_=!t&&!this._skipNextAnimation&&f>0;return d&&this._queue.flush(!0,o),p&&(l._isPositioningStarted=!0),u(e)&&this._queue.add(e),_?(this._isActive=!0,this._animateOptions.easing=m,this._animateOptions.duration=f,this._isInterrupted=d,n=o._id,r=this._setupAnimation,s=this._startAnimation,x.add(n+"layout",r,s),this):(this._updateOffsets(),this._updateTargetStyles(),i=o._animate.isAnimating(),this.stop(!1,this._targetStyles),!i&&c(a,this._targetStyles),this._skipNextAnimation=!1,this._finish())}},yt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item;return i=n._id,x.cancel(i+"layout"),n._animate.stop(e),pt(n._element,n.getGrid()._settings.itemPositioningClass),this._isActive=!1,t&&this._queue.flush(!0,n),this},yt.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0,{}),this._queue.destroy(),this._item=this._currentStyles=this._targetStyles=this._animateOptions=null,this._isDestroyed=!0),this},yt.prototype._updateOffsets=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._offsetLeft=i._isActive?i._containerDiffX:e._isActive?e._containerDiffX:0,this._offsetTop=i._isActive?i._containerDiffY:e._isActive?e._containerDiffY:0}},yt.prototype._updateTargetStyles=function(){this._isDestroyed||(this._targetStyles.transform=dt(this._item._left+this._offsetLeft,this._item._top+this._offsetTop))},yt.prototype._finish=function(){if(!this._isDestroyed){var t=this._item,e=t._migrate,i=t._release;this._isActive&&(this._isActive=!1,pt(t._element,t.getGrid()._settings.itemPositioningClass)),i._isActive&&i.stop(),e._isActive&&e.stop(),this._queue.flush(!1,t)}},yt.prototype._setupAnimation=function(){var t=ct(this._item._element);this._currentLeft=t.x,this._currentTop=t.y},yt.prototype._startAnimation=function(){var t=this._item,e=t.getGrid()._settings;if(this._updateOffsets(),this._updateTargetStyles(),t._left===this._currentLeft-this._offsetLeft&&t._top===this._currentTop-this._offsetTop)return this._isInterrupted&&this.stop(!1,this._targetStyles),this._isActive=!1,void this._finish();this._isInterrupted||R(t._element,e.itemPositioningClass),this._currentStyles.transform=dt(this._currentLeft,this._currentTop),t._animate.start(this._currentStyles,this._targetStyles,this._animateOptions)};var vt={};function bt(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._container=!1,this._containerDiffX=0,this._containerDiffY=0}bt.prototype.start=function(t,e,i){if(this._isDestroyed)return this;var r,s,o,a,l,h,u,d,p=this._item,f=p._element,m=p.isVisible(),_=p.getGrid(),g=_._settings,y=t._settings,v=t._element,b=t._items,w=_._items.indexOf(p),C=i||window.document.body;if("number"==typeof e)r=H(b,e,!0);else{if(!(s=t._getItem(e)))return this;r=b.indexOf(s)}return(p.isPositioning()||this._isActive||p.isReleasing())&&(u=(h=ct(f)).x,d=h.y),p.isPositioning()&&p._layout.stop(!0,{transform:dt(u,d)}),this._isActive&&(u-=this._containerDiffX,d-=this._containerDiffY,this.stop(!0,{transform:dt(u,d)})),p.isReleasing()&&(u-=p._release._containerDiffX,d-=p._release._containerDiffY,p._release.stop(!0,{transform:dt(u,d)})),p._visibility._stopAnimation(),p._drag&&p._drag.destroy(),p._visibility._queue.flush(!0,p),_._hasListeners("beforeSend")&&_._emit("beforeSend",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),t._hasListeners("beforeReceive")&&t._emit("beforeReceive",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),pt(f,g.itemClass),pt(f,g.itemVisibleClass),pt(f,g.itemHiddenClass),R(f,y.itemClass),R(f,m?y.itemVisibleClass:y.itemHiddenClass),_._items.splice(w,1),N(b,p,r),p._gridId=t._id,C!==(o=f.parentNode)&&(C.appendChild(f),a=$(C,o,!0),h||(u=(h=ct(f)).x,d=h.y),f.style[n]=dt(u+a.left,d+a.top)),p._child.removeAttribute("style"),c(p._child,m?y.visibleStyles:y.hiddenStyles),f.style.display=m?"block":"hidden",l=$(C,v,!0),p._refreshDimensions(),p._refreshSortData(),p._drag=y.dragEnabled?new ft(p):null,this._isActive=!0,this._container=C,this._containerDiffX=l.left,this._containerDiffY=l.top,_._hasListeners("send")&&_._emit("send",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),t._hasListeners("receive")&&t._emit("receive",{item:p,fromGrid:_,fromIndex:w,toGrid:t,toIndex:r}),this},bt.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item,r=n._element,s=n.getGrid()._element;return this._container!==s&&(e||(t?(i=ct(r),vt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):vt.transform=dt(n._left,n._top),e=vt),s.appendChild(r),c(r,e)),this._isActive=!1,this._container=null,this._containerDiffX=0,this._containerDiffY=0,this},bt.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this};var wt={};function Ct(t){this._item=t,this._isActive=!1,this._isDestroyed=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0}function St(t){var e=t._isActive,i=t._element,n=t.getGrid()._settings;this._item=t,this._isDestroyed=!1,this._isHidden=!e,this._isHiding=!1,this._isShowing=!1,this._queue=new gt,this._finishShow=this._finishShow.bind(this),this._finishHide=this._finishHide.bind(this),i.style.display=e?"block":"none",R(i,e?n.itemVisibleClass:n.itemHiddenClass),c(t._child,e?n.visibleStyles:n.hiddenStyles)}Ct.prototype.start=function(){if(this._isDestroyed||this._isActive)return this;var t=this._item,e=t.getGrid();return this._isActive=!0,R(t._element,e._settings.itemReleasingClass),e._emit("dragReleaseStart",t),t._layout.start(!1),this},Ct.prototype.stop=function(t,e){if(this._isDestroyed||!this._isActive)return this;var i,n=this._item,r=n._element,s=n.getGrid(),o=s._element;return this._reset(),r.parentNode!==o&&(e||(t?(i=ct(r),wt.transform=dt(i.x-this._containerDiffX,i.y-this._containerDiffY)):wt.transform=dt(n._left,n._top),e=wt),o.appendChild(r),c(r,e)),t||s._emit("dragReleaseEnd",n),this},Ct.prototype.destroy=function(){return this._isDestroyed||(this.stop(!0),this._item=null,this._isDestroyed=!0),this},Ct.prototype._reset=function(){if(!this._isDestroyed){var t=this._item;this._isActive=!1,this._isPositioningStarted=!1,this._containerDiffX=0,this._containerDiffY=0,pt(t._element,t.getGrid()._settings.itemReleasingClass)}},St.prototype.show=function(t,e){if(this._isDestroyed)return this;var i=this._item,n=i._element,r=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return this._isShowing||this._isHidden?this._isShowing&&!t?(s&&r.add(s),this):(this._isShowing||(r.flush(!0,i),pt(n,o.itemHiddenClass),R(n,o.itemVisibleClass),this._isHiding||(n.style.display="block")),s&&r.add(s),i._isActive=this._isShowing=!0,this._isHiding=this._isHidden=!1,this._startAnimation(!0,t,this._finishShow),this):(s&&s(!1,i),this)},St.prototype.hide=function(t,e){if(this._isDestroyed)return this;var i=this._item,n=i._element,r=this._queue,s=u(e)?e:null,o=i.getGrid()._settings;return!this._isHiding&&this._isHidden?(s&&s(!1,i),this):this._isHiding&&!t?(s&&r.add(s),this):(this._isHiding||(r.flush(!0,i),R(n,o.itemHiddenClass),pt(n,o.itemVisibleClass)),s&&r.add(s),this._isHidden=this._isHiding=!0,i._isActive=this._isShowing=!1,this._startAnimation(!1,t,this._finishHide),this)},St.prototype.destroy=function(){if(this._isDestroyed)return this;var t=this._item,e=t._element,i=t.getGrid(),n=this._queue,r=i._settings;return this._stopAnimation({}),n.flush(!0,t).destroy(),pt(e,r.itemVisibleClass),pt(e,r.itemHiddenClass),this._item=null,this._isHiding=this._isShowing=!1,this._isDestroyed=this._isHidden=!0,this},St.prototype._startAnimation=function(t,e,i){if(!this._isDestroyed){var n,r=this._item,s=r.getGrid()._settings,o=t?s.visibleStyles:s.hiddenStyles,l=parseInt(t?s.showDuration:s.hideDuration)||0,u=(t?s.showEasing:s.hideEasing)||"ease",d=e||l<=0;if(o){if(O(r._id),d)return r._animateChild.isAnimating()?r._animateChild.stop(o):c(r._child,o),void(i&&i());var p,f,m;p=r._id,f=function(){n=function(t,e){var i={};for(var n in e)i[n]=a(t,h(n));return i}(r._child,o)},m=function(){r._animateChild.start(n,o,{duration:l,easing:u,onFinish:i})},x.add(p+"visibility",f,m)}else i&&i()}},St.prototype._stopAnimation=function(t){if(!this._isDestroyed){var e=this._item;O(e._id),e._animateChild.stop(t)}},St.prototype._finishShow=function(){this._isHidden||(this._isShowing=!1,this._queue.flush(!1,this._item))};var Tt={};St.prototype._finishHide=function(){if(this._isHidden){var t=this._item;this._isHiding=!1,Tt.transform=dt(0,0),t._layout.stop(!0,Tt),t._element.style.display="none",this._queue.flush(!1,t)}};var Dt,Et,At,kt,Pt=0;function xt(){return++Pt}function Ot(t,e,i){var r=t._settings;this._id=xt(),this._gridId=t._id,this._isDestroyed=!1,this._left=0,this._top=0,this._element=e,this._child=e.children[0],e.parentNode!==t._element&&t._element.appendChild(e),R(e,r.itemClass),"boolean"!=typeof i&&(i="none"!==a(e,"display")),this._isActive=i,e.style.left="0",e.style.top="0",e.style[n]=dt(0,0),this._animate=new d(e),this._animateChild=new d(this._child),this._visibility=new St(this),this._layout=new yt(this),this._migrate=new bt(this),this._release=new Ct(this),this._dragPlaceholder=new _t(this),this._drag=r.dragEnabled?new ft(this):null,this._refreshDimensions(),this._refreshSortData()}function Vt(){this._slots=[],this._slotSizes=[],this._freeSlots=[],this._newSlots=[],this._rectItem={},this._rectStore=[],this._rectId=0,this._layout={slots:null,setWidth:!1,setHeight:!1,width:!1,height:!1},this._sortRectsLeftTop=this._sortRectsLeftTop.bind(this),this._sortRectsTopLeft=this._sortRectsTopLeft.bind(this)}function Lt(t){var e=Object.prototype.toString.call(t);return"[object HTMLCollection]"===e||"[object NodeList]"===e}Ot.prototype.getGrid=function(){return t[this._gridId]},Ot.prototype.getElement=function(){return this._element},Ot.prototype.getWidth=function(){return this._width},Ot.prototype.getHeight=function(){return this._height},Ot.prototype.getMargin=function(){return{left:this._marginLeft,right:this._marginRight,top:this._marginTop,bottom:this._marginBottom}},Ot.prototype.getPosition=function(){return{left:this._left,top:this._top}},Ot.prototype.isActive=function(){return this._isActive},Ot.prototype.isVisible=function(){return!!this._visibility&&!this._visibility._isHidden},Ot.prototype.isShowing=function(){return!(!this._visibility||!this._visibility._isShowing)},Ot.prototype.isHiding=function(){return!(!this._visibility||!this._visibility._isHiding)},Ot.prototype.isPositioning=function(){return!(!this._layout||!this._layout._isActive)},Ot.prototype.isDragging=function(){return!(!this._drag||!this._drag._isActive)},Ot.prototype.isReleasing=function(){return!(!this._release||!this._release._isActive)},Ot.prototype.isDestroyed=function(){return this._isDestroyed},Ot.prototype._refreshDimensions=function(){if(!this._isDestroyed&&!this._visibility._isHidden){var t=this._element,e=this._dragPlaceholder,i=t.getBoundingClientRect();this._width=i.width,this._height=i.height,this._marginLeft=Math.max(0,U(t,"margin-left")),this._marginRight=Math.max(0,U(t,"margin-right")),this._marginTop=Math.max(0,U(t,"margin-top")),this._marginBottom=Math.max(0,U(t,"margin-bottom")),e&&e.updateDimensions(this._width,this._height)}},Ot.prototype._refreshSortData=function(){if(!this._isDestroyed){var t,e=this._sortData={},i=this.getGrid()._settings.sortData;for(t in i)e[t]=i[t](this,this._element)}},Ot.prototype._destroy=function(t){if(!this._isDestroyed){var e=this._element,i=this.getGrid(),n=i._settings,r=i._items.indexOf(this);this._release.destroy(),this._migrate.destroy(),this._layout.destroy(),this._visibility.destroy(),this._animate.destroy(),this._animateChild.destroy(),this._dragPlaceholder.destroy(),this._drag&&this._drag.destroy(),e.removeAttribute("style"),this._child.removeAttribute("style"),pt(e,n.itemClass),r>-1&&i._items.splice(r,1),t&&e.parentNode.removeChild(e),this._isActive=!1,this._isDestroyed=!0}},Vt.prototype.getLayout=function(t,e,i,n,r){var s,o=this._layout,a=!(!r||!r.fillGaps),l=!(!r||!r.horizontal),h=!(!r||!r.alignRight),u=!(!r||!r.alignBottom),c=!(!r||!r.rounding),d=this._slotSizes;if(o.slots=n||this._slots,o.width=l?0:c?Math.round(e):e,o.height=l?c?Math.round(i):i:0,o.setWidth=l,o.setHeight=!l,o.slots.length=0,d.length=0,!t.length)return o;for(s=0;s<t.length;s++)this._addSlot(t[s],l,a,c,h||u);if(h)for(s=0;s<o.slots.length;s+=2)o.slots[s]=o.width-(o.slots[s]+d[s]);if(u)for(s=1;s<o.slots.length;s+=2)o.slots[s]=o.height-(o.slots[s]+d[s]);return d.length=0,this._freeSlots.length=0,this._newSlots.length=0,this._rectId=0,o},Vt.prototype._addSlot=(kt={},function(t,e,i,n,r){var s,o,a,l,h,u,c=this._layout,d=this._freeSlots,p=this._newSlots;for(p.length=0,kt.left=null,kt.top=null,kt.width=t._width+t._marginLeft+t._marginRight,kt.height=t._height+t._marginTop+t._marginBottom,n&&(kt.width=Math.round(kt.width),kt.height=Math.round(kt.height)),h=0;h<d.length;h++)if((o=d[h])&&(s=this._getRect(o),kt.width<=s.width+.001&&kt.height<=s.height+.001)){kt.left=s.left,kt.top=s.top;break}for(null===kt.left&&(kt.left=e?c.width:0,kt.top=e?0:c.height,i||(l=!0)),!e&&kt.top+kt.height>c.height&&(kt.left>0&&p.push(this._addRect(0,c.height,kt.left,1/0)),kt.left+kt.width<c.width&&p.push(this._addRect(kt.left+kt.width,c.height,c.width-kt.left-kt.width,1/0)),c.height=kt.top+kt.height),e&&kt.left+kt.width>c.width&&(kt.top>0&&p.push(this._addRect(c.width,0,1/0,kt.top)),kt.top+kt.height<c.height&&p.push(this._addRect(c.width,kt.top+kt.height,1/0,c.height-kt.top-kt.height)),c.width=kt.left+kt.width),h=i?0:l?d.length:h;h<d.length;h++)if(o=d[h])for(s=this._getRect(o),a=this._splitRect(s,kt),u=0;u<a.length;u++)o=a[u],(s=this._getRect(o)).width>.49&&s.height>.49&&(!e&&s.top<c.height||e&&s.left<c.width)&&p.push(o);p.length&&this._purgeRects(p).sort(e?this._sortRectsLeftTop:this._sortRectsTopLeft),e?c.width=Math.max(c.width,kt.left+kt.width):c.height=Math.max(c.height,kt.top+kt.height),c.slots.push(kt.left,kt.top),r&&this._slotSizes.push(kt.width,kt.height),this._freeSlots=p,this._newSlots=d}),Vt.prototype._addRect=function(t,e,i,n){var r=++this._rectId,s=this._rectStore;return s[r]=t||0,s[++this._rectId]=e||0,s[++this._rectId]=i||0,s[++this._rectId]=n||0,r},Vt.prototype._getRect=function(t,e){var i=e||this._rectItem,n=this._rectStore;return i.left=n[t]||0,i.top=n[++t]||0,i.width=n[++t]||0,i.height=n[++t]||0,i},Vt.prototype._splitRect=(At=[],function(t,e){return At.length=0,this._doRectsOverlap(t,e)?(t.left<e.left&&At.push(this._addRect(t.left,t.top,e.left-t.left,t.height)),t.left+t.width>e.left+e.width&&At.push(this._addRect(e.left+e.width,t.top,t.left+t.width-(e.left+e.width),t.height)),t.top<e.top&&At.push(this._addRect(t.left,t.top,t.width,e.top-t.top)),t.top+t.height>e.top+e.height&&At.push(this._addRect(t.left,e.top+e.height,t.width,t.top+t.height-(e.top+e.height))),At):(At.push(this._addRect(t.left,t.top,t.width,t.height)),At)}),Vt.prototype._doRectsOverlap=function(t,e){return!(t.left+t.width<=e.left||e.left+e.width<=t.left||t.top+t.height<=e.top||e.top+e.height<=t.top)},Vt.prototype._isRectWithinRect=function(t,e){return t.left>=e.left&&t.top>=e.top&&t.left+t.width<=e.left+e.width&&t.top+t.height<=e.top+e.height},Vt.prototype._purgeRects=(Dt={},Et={},function(t){for(var e,i=t.length;i--;)if(e=t.length,t[i])for(this._getRect(t[i],Dt);e--;)if(t[e]&&i!==e&&this._isRectWithinRect(Dt,this._getRect(t[e],Et))){t[i]=0;break}return t}),Vt.prototype._sortRectsTopLeft=function(){var t={},e={};return function(i,n){return this._getRect(i,t),this._getRect(n,e),t.top<e.top?-1:t.top>e.top?1:t.left<e.left?-1:t.left>e.left?1:0}}(),Vt.prototype._sortRectsLeftTop=function(){var t={},e={};return function(i,n){return this._getRect(i,t),this._getRect(n,e),t.left<e.left?-1:t.left>e.left?1:t.top<e.top?-1:t.top>e.top?1:0}}();var Mt=Object.prototype.toString;function zt(t){return"object"==typeof t&&"[object Object]"===Mt.call(t)}function Bt(t){return Lt(t)?Array.prototype.slice.call(t):Array.prototype.concat(t)}var It=new Vt,Rt=function(){};function jt(i,n){var r,s,o,a,l,h,c=this;if(!((i=this._element="string"==typeof i?window.document.querySelector(i):i).getRootNode?i.getRootNode({composed:!0})===document:window.document.body.contains(i))||i===window.document.documentElement)throw new Error("Container element must be an existing DOM element");u((r=this._settings=(a=jt.defaultOptions,l=n,h=Nt({},a),l&&(h=Nt(h,l)),h.visibleStyles=(l||0).visibleStyles||(a||0).visibleStyles,h.hiddenStyles=(l||0).hiddenStyles||(a||0).hiddenStyles,h)).dragSort)||(r.dragSort=!!r.dragSort),this._id=xt(),t[this._id]=c,this._isDestroyed=!1,this._layout={id:0,items:[],slots:[],setWidth:!1,setHeight:!1,width:0,height:0},this._emitter=new e,R(i,r.containerClass),this._items=[],"string"==typeof(s=r.items)?Bt(i.children).forEach((function(t){("*"===s||I(t,s))&&c._items.push(new Ot(c,t))})):(Array.isArray(s)||Lt(s))&&(this._items=Bt(s).map((function(t){return new Ot(c,t)}))),"number"!=typeof(o=r.layoutOnResize)&&(o=!0===o?0:-1),o>=0&&window.addEventListener("resize",c._resizeHandler=X((function(){c.refreshItems().layout()}),o)),r.layoutOnInit&&this.layout(!0)}function Nt(t,e){var i,n,r,s=Object.keys(e),o=s.length;for(r=0;r<o;r++)i=zt(e[n=s[r]]),zt(t[n])&&i?t[n]=Nt(Nt({},t[n]),e[n]):i?t[n]=Nt({},e[n]):Array.isArray(e[n])?t[n]=e[n].slice(0):t[n]=e[n];return t}return jt.Item=Ot,jt.ItemLayout=yt,jt.ItemVisibility=St,jt.ItemMigrate=bt,jt.ItemAnimate=d,jt.ItemDrag=ft,jt.ItemRelease=Ct,jt.ItemDragPlaceholder=_t,jt.Emitter=e,jt.Dragger=k,jt.Packer=Vt,jt.defaultOptions={items:"*",showDuration:300,showEasing:"ease",hideDuration:300,hideEasing:"ease",visibleStyles:{opacity:"1",transform:"scale(1)"},hiddenStyles:{opacity:"0",transform:"scale(0.5)"},layout:{fillGaps:!1,horizontal:!1,alignRight:!1,alignBottom:!1,rounding:!0},layoutOnResize:100,layoutOnInit:!0,layoutDuration:300,layoutEasing:"ease",sortData:null,dragEnabled:!1,dragContainer:null,dragStartPredicate:{distance:0,delay:0,handle:!1},dragAxis:null,dragSort:!0,dragSortHeuristics:{sortInterval:100,minDragDistance:10,minBounceBackAngle:1},dragSortPredicate:{threshold:50,action:"move"},dragReleaseDuration:300,dragReleaseEasing:"ease",dragCssProps:{touchAction:"none",userSelect:"none",userDrag:"none",tapHighlightColor:"rgba(0, 0, 0, 0)",touchCallout:"none",contentZooming:"none"},dragPlaceholder:{enabled:!1,duration:300,easing:"ease",createElement:null,onCreate:null,onRemove:null},containerClass:"muuri",itemClass:"muuri-item",itemVisibleClass:"muuri-item-shown",itemHiddenClass:"muuri-item-hidden",itemPositioningClass:"muuri-item-positioning",itemDraggingClass:"muuri-item-dragging",itemReleasingClass:"muuri-item-releasing",itemPlaceholderClass:"muuri-item-placeholder"},jt.prototype.on=function(t,e){return this._emitter.on(t,e),this},jt.prototype.off=function(t,e){return this._emitter.off(t,e),this},jt.prototype.getElement=function(){return this._element},jt.prototype.getItems=function(t){if(this._isDestroyed||!t&&0!==t)return this._items.slice(0);var e,i,n=[],r=Bt(t);for(i=0;i<r.length;i++)(e=this._getItem(r[i]))&&n.push(e);return n},jt.prototype.refreshItems=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshDimensions();return this},jt.prototype.refreshSortData=function(t){if(this._isDestroyed)return this;var e,i=this.getItems(t);for(e=0;e<i.length;e++)i[e]._refreshSortData();return this},jt.prototype.synchronize=function(){if(this._isDestroyed)return this;var t,e,i,n=this._element,r=this._items;if(r.length){for(i=0;i<r.length;i++)(e=r[i]._element).parentNode===n&&(t=t||window.document.createDocumentFragment()).appendChild(e);t&&n.appendChild(t)}return this._emit("synchronize"),this},jt.prototype.layout=function(t,e){if(this._isDestroyed)return this;var i,n,r,s=this,o=this._element,l=this._updateLayout(),h=l.id,c=l.items.length,d=c;function p(){if(!(--d>0)){var i=s._layout.id!==h,n=u(t)?t:e;u(n)&&n(i,l.items.slice(0)),!i&&s._hasListeners("layoutEnd")&&s._emit("layoutEnd",l.items.slice(0))}}if((l.setHeight&&"number"==typeof l.height||l.setWidth&&"number"==typeof l.width)&&(i="border-box"===a(o,"box-sizing")),l.setHeight&&("number"==typeof l.height?o.style.height=(i?l.height+this._borderTop+this._borderBottom:l.height)+"px":o.style.height=l.height),l.setWidth&&("number"==typeof l.width?o.style.width=(i?l.width+this._borderLeft+this._borderRight:l.width)+"px":o.style.width=l.width),this._hasListeners("layoutStart")&&this._emit("layoutStart",l.items.slice(0)),!c)return p(),this;for(r=0;r<c;r++)(n=l.items[r])&&(n._left=l.slots[2*r],n._top=l.slots[2*r+1],n.isDragging()?p():n._layout.start(!0===t,p));return this},jt.prototype.add=function(t,e){if(this._isDestroyed||!t)return[];var i=Bt(t);if(!i.length)return i;var n,r,s=e||0,o=s.layout?s.layout:void 0===s.layout,a=this._items,l=!1;for(r=0;r<i.length;r++)n=new Ot(this,i[r],s.isActive),i[r]=n,n._isActive&&(l=!0,n._layout._skipNextAnimation=!0);return N(a,i,s.index),this._hasListeners("add")&&this._emit("add",i.slice(0)),l&&o&&this.layout("instant"===o,u(o)?o:void 0),i},jt.prototype.remove=function(t,e){if(this._isDestroyed)return this;var i,n,r=e||0,s=r.layout?r.layout:void 0===r.layout,o=!1,a=this.getItems(),l=this.getItems(t),h=[];for(n=0;n<l.length;n++)i=l[n],h.push(a.indexOf(i)),i._isActive&&(o=!0),i._destroy(r.removeElements);return this._hasListeners("remove")&&this._emit("remove",l.slice(0),h),o&&s&&this.layout("instant"===s,u(s)?s:void 0),l},jt.prototype.show=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!0,e),this},jt.prototype.hide=function(t,e){return this._isDestroyed||this._setItemsVisibility(t,!1,e),this},jt.prototype.filter=function(t,e){if(this._isDestroyed||!this._items.length)return this;var i,n,r=[],s=[],o="string"==typeof t,a=u(t),l=e||0,h=!0===l.instant,c=l.layout?l.layout:void 0===l.layout,d=u(l.onFinish)?l.onFinish:null,p=-1,f=Rt;if(d&&(f=function(){++p&&d(r.slice(0),s.slice(0))}),a||o)for(n=0;n<this._items.length;n++)i=this._items[n],(a?t(i):I(i._element,t))?r.push(i):s.push(i);return r.length?this.show(r,{instant:h,onFinish:f,layout:!1}):f(),s.length?this.hide(s,{instant:h,onFinish:f,layout:!1}):f(),(r.length||s.length)&&(this._hasListeners("filter")&&this._emit("filter",r.slice(0),s.slice(0)),c&&this.layout("instant"===c,u(c)?c:void 0)),this},jt.prototype.sort=function(){var t,e,i,n;function r(t){for(var e={},i=0;i<t.length;i++)e[t[i]._id]=i;return e}function s(t,i){var r=n[t._id],s=n[i._id];return e?s-r:r-s}function o(o,a){for(var l,h,u,c,d=0,p=0;p<t.length;p++)if(l=t[p][0],h=t[p][1],u=(o._sortData?o:o._refreshSortData())._sortData[l],c=(a._sortData?a:a._refreshSortData())._sortData[l],d="desc"===h||!h&&e?c<u?-1:c>u?1:0:u<c?-1:u>c?1:0)return d;return d||(n||(n=r(i)),d=s(o,a)),d}function a(o,a){var l=t(o,a);return e&&l&&(l=-l),l||(n||(n=r(i)),s(o,a))}return function(r,s){if(this._isDestroyed||this._items.length<2)return this;var l,h=this._items,c=s||0,d=c.layout?c.layout:void 0===c.layout;if(t=r,e=!!c.descending,i=h.slice(0),n=null,u(t))h.sort(a);else if("string"==typeof t)t=r.trim().split(" ").map((function(t){return t.split(":")})),h.sort(o);else{if(!Array.isArray(t))return this;if(t.length!==h.length)throw new Error("[Muuri] sort reference items do not match with grid items.");for(l=0;l<h.length;l++){if(t.indexOf(h[l])<0)throw new Error("[Muuri] sort reference items do not match with grid items.");h[l]=t[l]}e&&h.reverse()}return this._hasListeners("sort")&&this._emit("sort",h.slice(0),i),d&&this.layout("instant"===d,u(d)?d:void 0),this}}(),jt.prototype.move=function(t,e,i){if(this._isDestroyed||this._items.length<2)return this;var n,r,s=this._items,o=i||0,a=o.layout?o.layout:void 0===o.layout,l="swap"===o.action,h=l?"swap":"move",c=this._getItem(t),d=this._getItem(e);return c&&d&&c!==d&&(n=s.indexOf(c),r=s.indexOf(d),l?F(s,n,r):q(s,n,r),this._hasListeners("move")&&this._emit("move",{item:c,fromIndex:n,toIndex:r,action:h}),a&&this.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.send=function(t,e,i,n){if(this._isDestroyed||e._isDestroyed||this===e)return this;if(!(t=this._getItem(t)))return this;var r=n||0,s=r.appendTo||window.document.body,o=r.layoutSender?r.layoutSender:void 0===r.layoutSender,a=r.layoutReceiver?r.layoutReceiver:void 0===r.layoutReceiver;return t._migrate.start(e,i,s),t._migrate._isActive&&t._isActive&&(o&&this.layout("instant"===o,u(o)?o:void 0),a&&e.layout("instant"===a,u(a)?a:void 0)),this},jt.prototype.destroy=function(e){if(this._isDestroyed)return this;var i,n=this._element,r=this._items.slice(0);for(this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler),i=0;i<r.length;i++)r[i]._destroy(e);return pt(n,this._settings.containerClass),n.style.height="",n.style.width="",this._emit("destroy"),this._emitter.destroy(),t[this._id]=void 0,this._isDestroyed=!0,this},jt.prototype._getItem=function(t){if(this._isDestroyed||!t&&0!==t)return null;if("number"==typeof t)return this._items[t>-1?t:this._items.length+t]||null;if(t instanceof Ot)return t._gridId===this._id?t:null;for(var e=0;e<this._items.length;e++)if(this._items[e]._element===t)return this._items[e];return null},jt.prototype._updateLayout=function(){var t,e,i,n,r=this._layout,s=this._settings.layout;for(++r.id,r.items.length=0,n=0;n<this._items.length;n++)this._items[n]._isActive&&r.items.push(this._items[n]);return this._refreshDimensions(),t=this._width-this._borderLeft-this._borderRight,e=this._height-this._borderTop-this._borderBottom,i=u(s)?s(r.items,t,e):It.getLayout(r.items,t,e,r.slots,s),r.slots=i.slots,r.setWidth=Boolean(i.setWidth),r.setHeight=Boolean(i.setHeight),r.width=i.width,r.height=i.height,r},jt.prototype._emit=function(){this._isDestroyed||this._emitter.emit.apply(this._emitter,arguments)},jt.prototype._hasListeners=function(t){var e=this._emitter._events[t];return!(!e||!e.length)},jt.prototype._updateBoundingRect=function(){var t=this._element.getBoundingClientRect();this._width=t.width,this._height=t.height,this._left=t.left,this._top=t.top},jt.prototype._updateBorders=function(t,e,i,n){var r=this._element;t&&(this._borderLeft=U(r,"border-left-width")),e&&(this._borderRight=U(r,"border-right-width")),i&&(this._borderTop=U(r,"border-top-width")),n&&(this._borderBottom=U(r,"border-bottom-width"))},jt.prototype._refreshDimensions=function(){this._updateBoundingRect(),this._updateBorders(1,1,1,1)},jt.prototype._setItemsVisibility=function(t,e,i){var n,r,s=this,o=this.getItems(t),a=i||0,l=!0===a.instant,h=a.onFinish,c=a.layout?a.layout:void 0===a.layout,d=o.length,p=e?"showStart":"hideStart",f=e?"showEnd":"hideEnd",m=e?"show":"hide",_=!1,g=[],y=[];if(d){for(this._hasListeners(p)&&this._emit(p,o.slice(0)),r=0;r<o.length;r++)n=o[r],(e&&!n._isActive||!e&&n._isActive)&&(_=!0),e&&!n._isActive&&(n._layout._skipNextAnimation=!0),e&&n._visibility._isHidden&&y.push(n),n._visibility[m](l,(function(t,e){t||g.push(e),--d<1&&(u(h)&&h(g.slice(0)),s._hasListeners(f)&&s._emit(f,g.slice(0)))}));y.length&&this.refreshItems(y),_&&c&&this.layout("instant"===c,u(c)?c:void 0)}else u(h)&&h(o)},jt}()},function(t,e,i){},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict";i.r(e),i.d(e,"localization",(function(){return n.a})),i.d(e,"surveyStrings",(function(){return n.b})),i.d(e,"DataProvider",(function(){return s})),i.d(e,"NumberModel",(function(){return c})),i.d(e,"SelectBase",(function(){return d})),i.d(e,"Matrix",(function(){return p})),i.d(e,"BooleanModel",(function(){return f})),i.d(e,"HistogramModel",(function(){return m})),i.d(e,"VisualizerBase",(function(){return u})),i.d(e,"VisualizationManager",(function(){return a})),i.d(e,"VisualizationPanel",(function(){return w})),i.d(e,"VisualizationPanelDynamic",(function(){return C})),i.d(e,"VisualizationMatrixDynamic",(function(){return S})),i.d(e,"VisualizationMatrixDropdown",(function(){return T})),i.d(e,"AlternativeVisualizersWrapper",(function(){return D})),i.d(e,"PlotlySetup",(function(){return E})),i.d(e,"PlotlyChartAdapter",(function(){return P})),i.d(e,"SelectBasePlotly",(function(){return x})),i.d(e,"MatrixPlotly",(function(){return O})),i.d(e,"PlotlyBoolChartAdapter",(function(){return V})),i.d(e,"BooleanPlotly",(function(){return L})),i.d(e,"RankingPlotly",(function(){return M})),i.d(e,"MatrixDropdownGroupedPlotly",(function(){return z})),i.d(e,"HistogramPlotly",(function(){return B})),i.d(e,"PlotlyGaugeAdapter",(function(){return I})),i.d(e,"GaugePlotly",(function(){return R})),i.d(e,"WordCloudAdapter",(function(){return F})),i.d(e,"WordCloud",(function(){return G})),i.d(e,"textHelper",(function(){return N})),i.d(e,"TextTableAdapter",(function(){return X})),i.d(e,"Text",(function(){return Y})),i.d(e,"ChoicesTableAdapter",(function(){return Q})),i.d(e,"ChoicesTable",(function(){return U})),i.d(e,"DocumentHelper",(function(){return h.b}));var n=i(1);i(9),i(10),i(11),i(12),i(13),i(14);n.a.locales.es={ungroupButton:"Desagrupar por mí",selectButton:"Seleccionarme",hideColumn:"Ocultar columna",showColumn:"Mostrar columna",makePrivateColumn:"Hacer que la columna sea privada",makePublicColumn:"Hacer pública la columna",moveToDetail:"Mover al detalle",showAsColumn:"Mostrar como columna",filterPlaceholder:"Buscar ...",removeRows:"Eliminar filas",showLabel:"Mostrar",entryLabel:"entradas",visualizer_text:"Textos en tabla",visualizer_wordcloud:"Wordcloud",chartType_bar:"Bar",chartType_stackedbar:"Barra apilada",chartType_doughnut:"Donut",chartType_pie:"Pie",chartType_scatter:"Dispersión",chartType_gauge:"Gauge",chartType_bullet:"Bullet",hideButton:"Ocultar",makePrivateButton:"Hacer privado",makePublicButton:"Hacer público",showButton:"Mostrar",filter:"Filtro",resetFilter:"Restablecer filtro",changeLocale:"Cambiar configuración regional",clearButton:"Borrar",addElement:"Elija la pregunta para mostrar ...",defaultOrder:"Orden predeterminado",ascOrder:"Ascendente",descOrder:"Descendente",showMinorColumns:"Mostrar columnas secundarias",otherCommentTitle:"Otros elementos y comentarios",showPercentages:"Mostrar porcentajes",hidePercentages:"Ocultar porcentajes",pdfDownloadCaption:"PDF",xlsxDownloadCaption:"Excel",csvDownloadCaption:"CSV",saveDiagramAsPNG:"Descargar el gráfico como png",hideEmptyAnswers:"Ocultar respuestas vacías",showEmptyAnswers:"Mostrar respuestas vacías","topNValueText-1":"Todas las respuestas",topNValueText5:"Las 5 respuestas principales",topNValueText10:"Las 10 respuestas principales",topNValueText20:"20 respuestas principales",noVisualizerForQuestion:"Este tipo de pregunta aún no se visualiza",noResults:"Aún no hay resultados"},n.a.localeNames.es="Spanish";var r=i(4),s=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this._data=t,this._getDataCore=e,this.filterValues={},this.onDataChanged=new r.Event}return t.prototype.getStatisticsCacheKey=function(t){return Array.isArray(t.dataName)?t.dataName.join("-"):t.dataName},t.prototype.reset=function(t){if(t){if(void 0!==this._statisticsCache){var e=this.getStatisticsCacheKey(t);delete this._statisticsCache[e]}}else void 0===this._statisticsCache&&void 0===this._filteredData||(this._statisticsCache=void 0,this._filteredData=void 0,this.raiseDataChanged())},Object.defineProperty(t.prototype,"data",{get:function(){return this._data},set:function(t){this._data=[].concat(t),this.reset()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"filteredData",{get:function(){var e=this;void 0===this._filteredData&&(Object.keys(this.filterValues).length>0?this._filteredData=this.data.filter((function(i){return!Object.keys(e.filterValues).some((function(n){var r=e.filterValues[n],s=typeof r,o=i[n];if("object"==typeof o)return"object"!==s||!function(t,e){var i=Object.keys(t),n=Object.keys(e);if(n.length>i.length)return!1;for(var r=0,s=n;r<s.length;r++){var o=s[r];if(e[o]!=t[o])return!1}return!0}(o,r);var a=i[t.seriesMarkerKey];if(a&&"object"===s)return o!==r[a];if("object"===s&&void 0!==r.start&&void 0!==r.end){var l="number"==typeof o?o:Date.parse(o);return!(!isNaN(l)||(l=parseFloat(o),!isNaN(l)))||(l<r.start||l>=r.end)}return i[n]!==e.filterValues[n]}))})):this._filteredData=this.data);return this._filteredData},enumerable:!1,configurable:!0}),t.prototype.setFilter=function(t,e){var i=!0;void 0!==e?(i=this.filterValues[t]!==e,this.filterValues[t]=e):(i=void 0!==this.filterValues[t],delete this.filterValues[t]),i&&this.reset()},t.prototype.getDataCore=function(e){if(this._getDataCore)return this._getDataCore(e);var i=Array.isArray(e.dataName)?e.dataName:[e.dataName],n=[],r=e.getValues(),s={};r.forEach((function(t,e){s[t]=e}));var o=-1!==r.indexOf(void 0),a=e.getSeriesValues(),l={};a.forEach((function(t,e){l[t]=e}));for(var h=a.length||1,u=0;u<i.length;++u){for(var c=new Array,d=0;d<h;++d)c.push(new Array(r.length).fill(0));n.push(c)}return this.filteredData.forEach((function(e){i.forEach((function(i,r){var h=e[i];if(void 0!==h||o){var u=Array.isArray(h)?h:[h];if(a.length>0)if(void 0!==e[t.seriesMarkerKey]){var c=l[e[t.seriesMarkerKey]]||0;u.forEach((function(t){n[r][c][s[t]]++}))}else u.forEach((function(t){a.forEach((function(e){if(void 0!==t[e]){var i=l[e]||0;n[r][i][s[t[e]]]++}}))}));else u.forEach((function(t){return n[0][0][s[t]]++}))}}))})),Array.isArray(e.dataName)?n:n[0]},t.prototype.getData=function(t){var e=this.getStatisticsCacheKey(t);return void 0!==this._statisticsCache&&void 0!==this._statisticsCache[e]||(void 0===this._statisticsCache&&(this._statisticsCache={}),this._statisticsCache[e]=this.getDataCore(t)),[].concat(this._statisticsCache[e])},t.prototype.raiseDataChanged=function(){this.onDataChanged.isEmpty||this.onDataChanged.fire(this,{})},t.seriesMarkerKey="__sa_series_name",t}();var o=i(2),a=function(){function t(){}return t.registerVisualizer=function(e,i){var n=t.vizualizers[e];n||(n=[],t.vizualizers[e]=n),n.push(i)},t.unregisterVisualizer=function(e,i){var n=t.vizualizers[e];if(n){var r=n.indexOf(i);-1!==r&&n.splice(r,1)}},t.unregisterVisualizerForAll=function(e){Object.keys(t.vizualizers).forEach((function(i){return t.unregisterVisualizer(i,e)}))},t.getVisualizersByType=function(e){var i=t.vizualizers[e];return i||[u]},t.getAlternativesVisualizer=function(){return t.alternativesVisualizer||u},t.registerAlternativesVisualizer=function(e){t.alternativesVisualizer=e},t.alternativesVisualizer=void 0,t.vizualizers={},t}(),l=function(){function t(){}return t.createVisualizer=function(t,e,i){var n;n="text"===t.getType()&&t.inputType?t.inputType:t.getType();var r=a.getVisualizersByType(n).map((function(n){return new n(t,e,i)}));return r.length>1?new(a.getAlternativesVisualizer())(r,t,e,i):r[0]},t}(),h=i(0),u=(i(23),function(){function t(t,e,i,n){void 0===i&&(i={});var o=this;this.question=t,this.options=i,this._name=n,this._showHeader=!0,this._footerVisualizer=void 0,this._dataProvider=void 0,this.labelTruncateLength=27,this.renderResult=void 0,this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this._supportSelection=!1,this.onAfterRender=new r.Event,this.toolbarItemCreators={},this._backgroundColor="#f7f7f7",this._dataProvider=i.dataProvider||new s(e),this._dataProvider.onDataChanged.add((function(){return o.onDataChanged()})),void 0!==i.labelTruncateLength&&(this.labelTruncateLength=i.labelTruncateLengt)}return t.prototype.afterRender=function(t){this.onAfterRender.fire(this,{htmlElement:t})},Object.defineProperty(t.prototype,"questionOptions",{get:function(){return this.options[this.question.name]},enumerable:!1,configurable:!0}),t.prototype.onDataChanged=function(){this.refresh()},Object.defineProperty(t.prototype,"dataName",{get:function(){return this.question.valueName||this.question.name},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hasFooter",{get:function(){return!!this.question&&(this.question.hasComment||this.question.hasOther)},enumerable:!1,configurable:!0}),t.prototype.createVisualizer=function(t){var e=Object.assign({},this.options);return void 0===e.dataProvider&&(e.dataProvider=this.dataProvider),l.createVisualizer(t,this.data,e)},Object.defineProperty(t.prototype,"footerVisualizer",{get:function(){var t=this;if(this.hasFooter){if(!this._footerVisualizer){var e=new r.QuestionCommentModel(this.question.name+(r.settings||{}).commentPrefix);e.title=this.processText(this.question.title),this._footerVisualizer=this.createVisualizer(e),this._footerVisualizer.onUpdate=function(){return t.invokeOnUpdate()}}return this._footerVisualizer}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"supportSelection",{get:function(){return(void 0===this.options.allowSelection||this.options.allowSelection)&&this._supportSelection},enumerable:!1,configurable:!0}),t.prototype.getSeriesValues=function(){return this.options.seriesValues||[]},t.prototype.getSeriesLabels=function(){return this.options.seriesLabels||this.getSeriesValues()},t.prototype.getValues=function(){throw new Error("Method not implemented.")},t.prototype.getLabels=function(){return this.getValues()},t.prototype.registerToolbarItem=function(t,e){this.toolbarItemCreators[t]=e},Object.defineProperty(t.prototype,"name",{get:function(){return this._name||"visualizer"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.dataProvider.filteredData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"dataProvider",{get:function(){return this._dataProvider},enumerable:!1,configurable:!0}),t.prototype.updateData=function(t){this.options.dataProvider||(this.dataProvider.data=t),this.hasFooter&&this.footerVisualizer.updateData(t)},t.prototype.invokeOnUpdate=function(){this.onUpdate&&this.onUpdate()},t.prototype.destroy=function(){this.renderResult&&(this.clear(),this.toolbarContainer=void 0,this.contentContainer=void 0,this.footerContainer=void 0,this.renderResult.innerHTML="",this.renderResult=void 0),this._footerVisualizer&&(this._footerVisualizer.destroy(),this._footerVisualizer.onUpdate=void 0,this._footerVisualizer=void 0)},t.prototype.clear=function(){this.toolbarContainer&&this.destroyToolbar(this.toolbarContainer),this.contentContainer&&this.destroyContent(this.contentContainer),this.footerContainer&&this.destroyFooter(this.footerContainer)},t.prototype.createToolbarItems=function(t){var e=this;Object.keys(this.toolbarItemCreators||{}).forEach((function(i){var n=e.toolbarItemCreators[i](t);n&&t.appendChild(n)}))},t.prototype.destroyToolbar=function(t){t.innerHTML=""},t.prototype.renderToolbar=function(t){if(this.showHeader){var e=h.b.createElement("div","sa-toolbar");this.createToolbarItems(e),t.appendChild(e)}},t.prototype.destroyContent=function(t){this.options&&"function"==typeof this.options.destroyContent?this.options.destroyContent(t,this):t.innerHTML=""},t.prototype.renderContent=function(t){this.options&&"function"==typeof this.options.renderContent?this.options.renderContent(t,this):t.innerHTML=n.a.getString("noVisualizerForQuestion"),this.afterRender(t)},t.prototype.destroyFooter=function(t){t.innerHTML=""},t.prototype.renderFooter=function(e){var i=this;if(e.innerHTML="",this.hasFooter){var r=h.b.createElement("h4","sa-visualizer__footer-title",{innerText:n.a.getString("otherCommentTitle")});e.appendChild(r);var s=h.b.createElement("div","sa-visualizer__footer-content");s.style.display=t.otherCommentCollapsed?"none":"block";var o=h.b.createButton((function(){"none"===s.style.display?(s.style.display="block",o.innerText=n.a.getString("hideButton")):(s.style.display="none",o.innerText=n.a.getString(t.otherCommentCollapsed?"showButton":"hideButton")),i.footerVisualizer.invokeOnUpdate()}),n.a.getString("showButton"));e.appendChild(o),e.appendChild(s),this.footerVisualizer.render(s)}},t.prototype.render=function(t){this.renderResult=t,this.toolbarContainer=h.b.createElement("div","sa-visualizer__toolbar"),t.appendChild(this.toolbarContainer),this.renderToolbar(this.toolbarContainer),this.contentContainer=h.b.createElement("div","sa-visualizer__content"),t.appendChild(this.contentContainer),this.renderContent(this.contentContainer),this.footerContainer=h.b.createElement("div","sa-visualizer__footer"),t.appendChild(this.footerContainer),this.renderFooter(this.footerContainer)},t.prototype.refresh=function(){var t=this;this.contentContainer&&setTimeout((function(){t.destroyContent(t.contentContainer),t.renderContent(t.contentContainer),t.invokeOnUpdate()})),this.footerContainer&&setTimeout((function(){t.destroyFooter(t.footerContainer),t.renderFooter(t.footerContainer),t.invokeOnUpdate()}))},t.prototype.processText=function(t){return!1!==this.options.stripHtmlFromTitles?(t||"").replace(/(<([^>]+)>)/gi,""):t},t.prototype.getRandomColor=function(){var t=this.getColors();return t[Math.floor(Math.random()*t.length)]},Object.defineProperty(t.prototype,"backgroundColor",{get:function(){return this.getBackgroundColorCore()},set:function(t){this.setBackgroundColorCore(t)},enumerable:!1,configurable:!0}),t.prototype.getBackgroundColorCore=function(){return this._backgroundColor},t.prototype.setBackgroundColorCore=function(t){this._backgroundColor=t,this.footerVisualizer&&(this.footerVisualizer.backgroundColor=t)},t.prototype.getColors=function(e){void 0===e&&(e=10);for(var i=Array.isArray(t.customColors)&&t.customColors.length>0?t.customColors:t.colors,n=[],r=0;r<e;r++)n=n.concat(i);return n},Object.defineProperty(t.prototype,"showHeader",{get:function(){return this._showHeader},set:function(t){t!=this._showHeader&&(this._showHeader=t,this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)))},enumerable:!1,configurable:!0}),t.prototype.getData=function(){return this.dataProvider.getData(this)},t.prototype.getState=function(){return{}},t.prototype.setState=function(t){},t.otherCommentCollapsed=!0,t.customColors=[],t.colors=["#86e1fb","#3999fb","#ff6771","#1eb496","#ffc152","#aba1ff","#7d8da5","#4ec46c","#cf37a6","#4e6198"],t}()),c=function(t){function e(e,i,r,s){void 0===r&&(r={});var o=t.call(this,e,i,r,s||"number")||this;return o.registerToolbarItem("changeChartType",(function(){return o.chartTypes.length>1?h.b.createSelector(o.chartTypes.map((function(t){return{value:t,text:n.a.getString("chartType_"+t)}})),(function(t){return o.chartType===t.value}),(function(t){o.setChartType(t.target.value)})):null})),o}return Object(o.b)(e,t),e.prototype.onDataChanged=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.onDataChanged.call(this)},e.prototype.onChartTypeChanged=function(){},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate())},e.prototype.destroy=function(){this._resultAverage=void 0,this._resultMin=void 0,this._resultMax=void 0,t.prototype.destroy.call(this)},e.prototype.generateText=function(t,i,n){var r=[];if(5===n)r=["very high ("+t+")","high","medium","low","very low ("+i+")"];else{r.push(t);for(var s=0;s<n-2;s++)r.push("");r.push(i)}return e.generateTextsCallback?e.generateTextsCallback(this.question,t,i,n,r):r},e.prototype.generateValues=function(t,e){for(var i=[],n=0;n<e;n++)i.push(t/e);return i.push(t),i},e.prototype.generateColors=function(t,e,i){for(var n=this.getColors(),r=[],s=0;s<i;s++)r.push(n[s]);return r.push("rgba(255, 255, 255, 0)"),r},e.prototype.getData=function(){var t=this;if(void 0===this._resultAverage||void 0===this._resultMin||void 0===this._resultMax){var e=[];this._resultMin=Number.MAX_VALUE,this._resultMax=-Number.MAX_VALUE,this.data.forEach((function(i){var n=+i[t.question.name];void 0!==n&&(e.push(n),t._resultMin>n&&(t._resultMin=n),t._resultMax<n&&(t._resultMax=n))})),this._resultAverage=e.reduce((function(t,e){return t+e}),0)/e.length,this._resultAverage=Math.ceil(100*this._resultAverage)/100}return[this._resultAverage,this._resultMin,this._resultMax]},e.stepsCount=5,e.showAsPercentage=!1,e}(u),d=function(t){function e(i,s,o,a){var l=t.call(this,i,s,o,a||"selectBase")||this;return l.selectedItem=void 0,l.choicesOrderSelector=void 0,l.showPercentageBtn=void 0,l.emptyAnswersBtn=void 0,l.transposeDataBtn=void 0,l.topNSelector=void 0,l._showPercentages=!1,l._showOnlyPercentages=!1,l._answersOrder="default",l._supportSelection=!0,l._hideEmptyAnswers=!1,l._topN=-1,l.topNValues=[].concat(e.topNValuesDefaults),l._transposeData=!1,l._showMissingAnswers=!1,l.missingAnswersBtn=void 0,l.chartTypes=[],l.chartType="bar",l.onAnswersDataReady=new r.Event,i.visibleChoicesChangedCallback=function(){l.dataProvider.reset()},l._showPercentages=!0===l.options.showPercentages,l._showOnlyPercentages=!0===l.options.showOnlyPercentages,l._hideEmptyAnswers=!0===l.options.hideEmptyAnswers,l._answersOrder=l.options.answersOrder||"default",l._showMissingAnswers=l.isSupportMissingAnswers()&&!0===l.options.showMissingAnswers,l.registerToolbarItem("changeChartType",(function(){return l.chartTypes.length>1?h.b.createSelector(l.chartTypes.map((function(t){return{value:t,text:n.a.getString("chartType_"+t)}})),(function(t){return l.chartType===t.value}),(function(t){l.setChartType(t.target.value)})):null})),l.registerToolbarItem("changeAnswersOrder",(function(){return void 0!==l.options.allowChangeAnswersOrder&&!l.options.allowChangeAnswersOrder||0!==l.getSeriesValues().length||(l.choicesOrderSelector=h.b.createSelector([{text:n.a.getString("defaultOrder"),value:"default"},{text:n.a.getString("ascOrder"),value:"asc"},{text:n.a.getString("descOrder"),value:"desc"}],(function(t){return!1}),(function(t){l.answersOrder=t.target.value})),l.updateOrderSelector()),l.choicesOrderSelector})),l.registerToolbarItem("showPercentages",(function(){if(l.options.allowShowPercentages&&(-1!==l.chartTypes.indexOf("bar")||-1!==l.chartTypes.indexOf("stackedbar")))return l.showPercentageBtn=h.b.createButton((function(){l.showPercentages=!l.showPercentages})),l.updateShowPercentageBtn(),l.showPercentageBtn})),l.registerToolbarItem("hideEmptyAnswers",(function(){return l.options.allowHideEmptyAnswers&&(l.emptyAnswersBtn=h.b.createButton((function(){l.hideEmptyAnswers=!l._hideEmptyAnswers})),l.updateEmptyAnswersBtn()),l.emptyAnswersBtn})),l.registerToolbarItem("topNAnswers",(function(){return l.options.allowTopNAnswers&&0===l.getSeriesValues().length&&(l.topNSelector=h.b.createSelector(l.topNValues.map((function(t){return{text:n.a.getString("topNValueText"+t),value:t}})),(function(t){return!1}),(function(t){l.topN=parseInt(t.target.value)})),l.updateTopNSelector()),l.topNSelector})),l.registerToolbarItem("transposeData",(function(){return l.options.allowTransposeData&&(l.transposeDataBtn=h.b.createButton((function(){l.transposeData=!l.transposeData})),l.updateTransposeDataBtn()),l.transposeDataBtn})),l.registerToolbarItem("showMissingAnswers",(function(){return l.isSupportMissingAnswers()&&l.options.allowShowMissingAnswers&&(l.missingAnswersBtn=h.b.createButton((function(){l.showMissingAnswers=!l._showMissingAnswers})),l.updateMissingAnswersBtn()),l.missingAnswersBtn})),l}return Object(o.b)(e,t),e.prototype.updateEmptyAnswersBtn=function(){this.emptyAnswersBtn&&(this.emptyAnswersBtn.innerHTML=this._hideEmptyAnswers?n.a.getString("showEmptyAnswers"):n.a.getString("hideEmptyAnswers"),"bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType?this.emptyAnswersBtn.style.display="inline":this.emptyAnswersBtn.style.display="none")},e.prototype.updateTransposeDataBtn=function(){this.transposeDataBtn&&(this.transposeDataBtn.innerHTML=this.transposeData?n.a.getString("showPerColumns"):n.a.getString("showPerValues"),this.getSeriesValues().length>0?this.transposeDataBtn.style.display="inline":this.transposeDataBtn.style.display="none")},e.prototype.updateOrderSelector=function(){this.choicesOrderSelector&&("bar"==this.chartType||"vbar"==this.chartType||"scatter"==this.chartType||("pie"==this.chartType||"doughnut"==this.chartType)&&this.topN>0?this.choicesOrderSelector.style.display="inline-block":this.choicesOrderSelector.style.display="none",this.choicesOrderSelector.getElementsByTagName("select")[0].value=this.answersOrder)},e.prototype.updateShowPercentageBtn=function(){this.showPercentageBtn&&(this.showPercentageBtn.innerHTML=this._showPercentages?n.a.getString("hidePercentages"):n.a.getString("showPercentages"),"bar"==this.chartType||"vbar"==this.chartType||"stackedbar"==this.chartType?this.showPercentageBtn.style.display="inline":this.showPercentageBtn.style.display="none")},e.prototype.updateTopNSelector=function(){this.topNSelector&&(this.topNSelector.getElementsByTagName("select")[0].value=this._topN)},e.prototype.updateMissingAnswersBtn=function(){this.missingAnswersBtn&&(this.missingAnswersBtn.innerHTML=this._showMissingAnswers?n.a.getString("hideMissingAnswers"):n.a.getString("showMissingAnswers"))},e.prototype.onChartTypeChanged=function(){this.updateOrderSelector(),this.updateShowPercentageBtn(),this.updateEmptyAnswersBtn(),this.updateTopNSelector()},e.prototype.setChartType=function(t){-1!==this.chartTypes.indexOf(t)&&this.chartType!==t&&(this.chartType=t,this.onChartTypeChanged(),this.refreshContent())},e.prototype.getSelectedItemByText=function(t){var e=this.question;return this.question.hasOther&&t==e.otherText?e.otherItem:e.choices.filter((function(e){return e.text===t}))[0]},e.prototype.setSelection=function(t){this.selectedItem!==t&&(this.selectedItem=t,void 0!==this.onDataItemSelected&&this.onDataItemSelected(void 0!==t?t.value:void 0,void 0!==t?t.text:""))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.selectedItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showOnlyPercentages",{get:function(){return this._showOnlyPercentages},set:function(t){this._showOnlyPercentages=t,this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"showPercentages",{get:function(){return this._showPercentages},set:function(t){this._showPercentages=t,this.updateShowPercentageBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"answersOrder",{get:function(){return this._answersOrder},set:function(t){this._answersOrder=t,this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hideEmptyAnswers",{get:function(){return this._hideEmptyAnswers},set:function(t){this._hideEmptyAnswers=t,this.updateEmptyAnswersBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transposeData",{get:function(){return this._transposeData},set:function(t){this._transposeData=t,this.updateTransposeDataBtn(),this.refreshContent()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"topN",{get:function(){return this._topN},set:function(t){this._topN=t,this.updateTopNSelector(),this.updateOrderSelector(),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!0},Object.defineProperty(e.prototype,"showMissingAnswers",{get:function(){return this._showMissingAnswers},set:function(t){this._showMissingAnswers=this.isSupportMissingAnswers()&&t,this.updateMissingAnswersBtn(),this.dataProvider.reset(this),this.refreshContent()},enumerable:!1,configurable:!0}),e.prototype.refreshContent=function(){this.contentContainer&&(this.destroyContent(this.contentContainer),this.renderContent(this.contentContainer)),this.invokeOnUpdate()},e.prototype.valuesSource=function(){return this.question.activeChoices},e.prototype.getValues=function(){var t=this.valuesSource().map((function(t){return t.value}));return this.question.hasOther&&t.unshift("other"),this.showMissingAnswers&&t.push(void 0),t},e.prototype.getLabels=function(){var t=this;if(this.options.useValuesAsLabels)return this.getValues();var e=this.valuesSource().map((function(e){return r.ItemValue.getTextOrHtmlByValue(t.valuesSource(),e.value)})),i=this.question;return i.hasOther&&e.unshift(i.otherText),this.showMissingAnswers&&e.push(n.a.getString("missingAnswersLabel")),e},e.prototype.getPercentages=function(){var t=this.getData(),e=[];if(t.length<2)t.forEach((function(t,i){var n=t.reduce((function(t,e){return t+e}),0);e[i]=t.map((function(t){return n&&Math.round(t/n*1e4)/100}))}));else for(var i=0;i<t[0].length;i++){for(var n=0,r=0;r<t.length;r++)n+=t[r][i];for(r=0;r<t.length;r++)Array.isArray(e[r])||(e[r]=[]),e[r][i]=n&&Math.round(t[r][i]/n*100)}return e},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[[]],labels:[],colors:[],texts:[[]],seriesLabels:t.seriesLabels},i=0;i<t.datasets[0].length;i++)0!=t.datasets[0][i]&&(e.datasets[0].push(t.datasets[0][i]),e.labels.push(t.labels[i]),e.colors.push(t.colors[i]),e.texts[0].push(t.texts[0][i]));return e},e.prototype.answersDataReady=function(t){var e={};return e=this.hideEmptyAnswers?this.hideEmptyAnswersInData(t):t,this.topN>0&&(e.datasets[0]=e.datasets[0].slice(-this.topN),e.labels=e.labels.slice(-this.topN),e.colors=e.colors.slice(-this.topN),e.texts[0]=e.texts[0].slice(-this.topN)),e},e.prototype.getAnswersData=function(){var t=this.getSeriesLabels(),e=this.getData(),i=this.getLabels(),n=this.getColors(),r=this.showPercentages?this.getPercentages():e;if(this.transposeData){e=this.transpose(e),r=this.transpose(r);var s=t;t=i,i=s}if("asc"==this.answersOrder||"desc"==this.answersOrder){var o=this.showPercentages?h.a.zipArrays(i,n,r[0]):h.a.zipArrays(i,n),a=h.a.sortDictionary(o,e[0],"desc"==this.answersOrder),l=h.a.unzipArrays(a.keys);i=l[0],n=l[1],this.showPercentages&&(r[0]=l[2]),e[0]=a.values}var u={datasets:e,labels:i,colors:n,texts:r,seriesLabels:t};return u=this.answersDataReady(u),this.onAnswersDataReady.fire(this,u),u},e.prototype.transpose=function(t){for(var e=t[0].length,i=new Array(e),n=0;n<e;++n)i[n]=new Array(t.length);for(n=0;n<t.length;++n)for(var r=0;r<e;++r)i[r][n]=t[n][r];return i},e.prototype.getState=function(){var t=this,i={};return e._stateProperties.forEach((function(e){i[e]=t[e]})),i},e.prototype.setState=function(t){var i=this;e._stateProperties.forEach((function(e){void 0!==t[e]&&(i[e]=t[e])}))},e.topNValuesDefaults=[-1,5,10,20],e._stateProperties=["chartType","answersOrder","hideEmptyAnswers","topN"],e}(u),p=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"matrix")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getSeriesValues=function(){return this.matrixQuestion.rows.map((function(t){return""+t.value}))},e.prototype.getSeriesLabels=function(){var t=this;return this.matrixQuestion.rows.map((function(e){return r.ItemValue.getTextOrHtmlByValue(t.matrixQuestion.rows,e.value)}))},e.prototype.getSelectedItemByText=function(t){return this.matrixQuestion.columns.filter((function(e){return e.text===t}))[0]},e.prototype.valuesSource=function(){return this.matrixQuestion.columns},e.prototype.getHasAnswersInAllSeriesArray=function(t){for(var e=Array(),i=0;i<t[0].length;i++)for(var n=0;n<t.length;n++)0!=t[n][i]&&(e[i]=!0);return e},e.prototype.getHasAnswersInSeries=function(t){for(var e=0;e<t.length;e++)if(0!=t[e])return!0;return!1},e.prototype.hideEmptyAnswersInData=function(t){for(var e={datasets:[],labels:[],colors:[],texts:[],seriesLabels:[]},i=this.getHasAnswersInAllSeriesArray(t.datasets),n=0;n<t.datasets.length;n++){if(this.getHasAnswersInSeries(t.datasets[n])){e.labels.push(t.labels[n]),e.colors.push(t.colors[n]);for(var r=[],s=[],o=0;o<t.datasets[0].length;o++)i[o]&&(r.push(t.datasets[n][o]),s.push(t.texts[n][o]));e.datasets.push(r),e.texts.push(s)}}for(n=0;n<t.datasets[0].length;n++)i[n]&&e.seriesLabels.push(t.seriesLabels[n]);return e},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var s=i.map((function(t,i){return e[i][n]}));r.push(s)})),r}return e},e}(d),f=function(t){function e(e,i,n,r){return t.call(this,e,i,n,r||"boolean")||this}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"booleanQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),e.prototype.getSelectedItemByText=function(t){var e=this.getLabels(),i=this.getValues();return new r.ItemValue(i[e.indexOf(t)],t)},e.prototype.getValues=function(){var t=[void 0===this.booleanQuestion.valueTrue||this.booleanQuestion.valueTrue,void 0!==this.booleanQuestion.valueFalse&&this.booleanQuestion.valueFalse];return this.showMissingAnswers&&t.push(void 0),t},e.prototype.getLabels=function(){var t=[].concat(this.getValues());return void 0!==this.booleanQuestion.labelTrue&&(t[0]=this.booleanQuestion.locLabelTrue.textOrHtml),void 0!==this.booleanQuestion.labelFalse&&(t[1]=this.booleanQuestion.locLabelFalse.textOrHtml),this.showMissingAnswers&&(t[2]=n.a.getString("missingAnswersLabel")),t},e.trueColor="",e.falseColor="",e}(d),m=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"histogram")||this;return s.valueType="number",s._cachedValues=void 0,s._continiousData=void 0,s._cachedIntervals=void 0,"text"!==e.getType()||"date"!==e.inputType&&"datetime"!==e.inputType?s.valueType="number":s.valueType="date",s}return Object(o.b)(e,t),e.prototype.reset=function(){this._continiousData=void 0,this._cachedValues=void 0,this._cachedIntervals=void 0},e.prototype.getContiniousValue=function(t){return"date"===this.valueType?Date.parse(t):parseFloat(t)},e.prototype.getString=function(t){return"date"===this.valueType?new Date(t).toLocaleDateString():""+t},e.prototype.getSelectedItemByText=function(t){if(this.hasCustomIntervals||this.getContiniousValues().length>e.UseIntervalsFrom){var i=this.intervals.filter((function(e){return e.label===t}))[0];return new r.ItemValue(i,void 0!==i?i.label:"")}var n=this.getLabels().filter((function(e){return e===t}))[0];return new r.ItemValue(n,n)},e.prototype.updateData=function(e){this.reset(),t.prototype.updateData.call(this,e)},e.prototype.onDataChanged=function(){this.reset(),t.prototype.onDataChanged.call(this)},e.prototype.getContiniousValues=function(){var t=this;if(void 0===this._cachedValues){var e=this.getSeriesValues();0===e.length&&e.push(""),this._continiousData={},e.forEach((function(e){return t._continiousData[e]=[]}));var i={};this.data.forEach((function(e){var n=e[t.dataName];if(void 0!==n){var r=e[s.seriesMarkerKey]||"";t._continiousData[r].push(t.getContiniousValue(n)),i[n]=0}})),this._cachedValues=Object.keys(i).map((function(e){return{original:e,continious:t.getContiniousValue(e)}})),this._cachedValues.sort((function(t,e){return t.continious-e.continious}))}return this._cachedValues},e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getValues=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom?this.intervals.map((function(t){return t.label})):t.map((function(t){return t.original}))},e.prototype.getLabels=function(){var t=this.getContiniousValues();return this.hasCustomIntervals||t.length>e.UseIntervalsFrom?this.intervals.map((function(t){return t.label})):t.map((function(t){return t.original}))},Object.defineProperty(e.prototype,"hasCustomIntervals",{get:function(){return!!this.questionOptions&&Array.isArray(this.questionOptions.intervals)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"intervals",{get:function(){if(this.hasCustomIntervals)return this.questionOptions.intervals;if(void 0===this._cachedIntervals){var t=this.getContiniousValues();if(this._cachedIntervals=[],t.length)for(var i=t[0].continious-1,n=t[t.length-1].continious+1,r=e.IntervalsCount,s=(n-i)/r,o=0;o<r;++o){var a=i+s;this._cachedIntervals.push({start:i,end:a,label:this.getString(i)+"-"+this.getString(a)}),i=a}}return this._cachedIntervals},enumerable:!1,configurable:!0}),e.prototype.getData=function(){var i=this.getContiniousValues();if(!this.hasCustomIntervals&&i.length<=e.UseIntervalsFrom)return t.prototype.getData.call(this);var n=this.intervals,r=[],s=this.getSeriesValues();0===s.length&&s.push("");for(var o=0;o<s.length;++o)r.push(n.map((function(t){return 0}))),this._continiousData[s[o]].forEach((function(t){for(var e=0;e<n.length;++e)if(n[e].start<=t&&t<n[e].end){r[o][e]++;break}}));return r},e.IntervalsCount=10,e.UseIntervalsFrom=10,e}(d),_=function(){function t(t){this._htmlElement=void 0,this.text=void 0,this._htmlElement=h.b.createElement("div","sa-question__filter"),this.text=h.b.createElement("span","sa-question__filter-text"),this._htmlElement.appendChild(this.text);var e=h.b.createButton((function(){t.setSelection(void 0)}),n.a.getString("clearButton"));this._htmlElement.appendChild(e)}return Object.defineProperty(t.prototype,"htmlElement",{get:function(){return this._htmlElement},enumerable:!1,configurable:!0}),t.prototype.update=function(t){void 0!==t&&void 0!==t.value?(this._htmlElement.style.display="inline-block",this.text.innerHTML=n.a.getString("filter")+": ["+t.text+"]"):(this._htmlElement.style.display="none",this.text.innerHTML="")},t}(),g=i(24),y=function(t){function e(e,i){var n=t.call(this,e)||this;return n._selector=i,n._muuri=void 0,n._layoutingTimer=void 0,n}return Object(o.b)(e,t),e.prototype.startCore=function(t){var e=this;this._muuri=new g(t,{dragStartPredicate:{handle:".sa-question__title--draggable"},items:this._selector,dragEnabled:!0}),this._muuri.on("dragReleaseEnd",(function(t){return e.onMoveCallback&&e.onMoveCallback(t.fromIndex,t.toIndex)}))},e.prototype.stopCore=function(){this._muuri.off("dragReleaseEnd"),this._muuri.destroy(),this._muuri=void 0},e.prototype.updateCore=function(){var t=this;void 0!==this._layoutingTimer&&clearTimeout(this._layoutingTimer),this._layoutingTimer=setTimeout((function(){t._layoutingTimer=void 0,t._muuri.refreshItems(),t._muuri.layout()}),10)},e.prototype.add=function(t,e){this._allowed&&this._muuri.add(t,e)},e.prototype.remove=function(t,e){this._allowed&&this._muuri.remove(t,e)},e}(function(){function t(t){this._allowed=t}return t.prototype.startCore=function(t){},t.prototype.stopCore=function(){},t.prototype.updateCore=function(){},Object.defineProperty(t.prototype,"allowed",{get:function(){return this._allowed},enumerable:!1,configurable:!0}),t.prototype.start=function(t){this._allowed&&this.startCore(t)},t.prototype.stop=function(){this._allowed&&this.stopCore()},t.prototype.update=function(){this._allowed&&this.updateCore()},t.prototype.add=function(t,e){},t.prototype.remove=function(t,e){},t.prototype.destroy=function(){this.stop()},t}());i(25);if(document){var v=i(15),b=document.createElement("div");b.style.display="none",b.innerHTML=v,document.head.appendChild(b)}var w=function(t){function e(i,s,o,a){void 0===o&&(o={}),void 0===a&&(a=void 0);var l=t.call(this,null,s,o,"panel")||this;return l.questions=i,l._elements=a,l.visualizers=[],l.haveCommercialLicense=!1,l.renderedQuestionsCount=0,l.onAfterRenderQuestionCallback=function(t,e){l.renderedQuestionsCount++,l.renderedQuestionsCount==l.questions.length&&(l.renderedQuestionsCount=0,l.afterRender(l.contentContainer))},l.onVisibleElementsChanged=new r.Event,l.onStateChanged=new r.Event,l._layoutEngine=o.layoutEngine||new y(l.allowDynamicLayout,".sa-question-layouted"),l._layoutEngine.onMoveCallback=function(t,e){return l.moveVisibleElement(t,e)},l.showHeader=!0,l.options.survey&&(n.a.currentLocale=l.options.survey.locale),void 0===a&&(l._elements=l.buildElements(i)),l.haveCommercialLicense=e.haveCommercialLicense||void 0!==o.haveCommercialLicense&&o.haveCommercialLicense,l.buildVisualizers(i),l.haveCommercialLicense||l.registerToolbarItem("commercialLicense",(function(){return Object(h.c)()})),l.registerToolbarItem("resetFilter",(function(){return h.b.createButton((function(){l.visualizers.forEach((function(t){t instanceof d&&t.setSelection(void 0)}))}),n.a.getString("resetFilter"))})),l.registerToolbarItem("addElement",(function(t){if(l.allowHideQuestions){var e=void 0,i=function(i,r){var s=l.hiddenElements;if(s.length>0){var o=h.b.createSelector([{name:void 0,displayName:n.a.getString("addElement")}].concat(s).map((function(t){return{value:t.name,text:t.displayName}})),(function(t){return!1}),(function(t){l.showElement(t.target.value)}));e&&t.replaceChild(o,e)||t.appendChild(o),e=o}else e&&t.removeChild(e),e=void 0};i(),l.onVisibleElementsChanged.add(i)}})),l.locales.length>1&&l.registerToolbarItem("changeLocale",(function(){return h.b.createSelector([n.a.getString("changeLocale")].concat(l.locales).map((function(t){return{value:t,text:t}})),(function(t){return!1}),(function(t){var e=t.target.value;l.locale=e}))})),l}return Object(o.b)(e,t),e.prototype.showElement=function(t){var e=this.getElement(t),i=this._elements.indexOf(e);e.isVisible=!0;var n=this.renderPanelElement(e,this.contentContainer);this.layoutEngine.add([n],{index:i}),this.visibleElementsChanged(e,"ADDED")},e.prototype.hideElement=function(t){var e=this.getElement(t);e.isVisible=!1,e.renderedElement&&(this.layoutEngine.remove([e.renderedElement]),this.contentContainer.removeChild(e.renderedElement),e.renderedElement=void 0),this.visibleElementsChanged(e,"REMOVED")},e.prototype.makeElementPrivate=function(t){t.isPublic=!1,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.makeElementPublic=function(t){t.isPublic=!0,this.onStateChanged.fire(this,this.state),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},e.prototype.moveVisibleElement=function(t,e){var i,n,r=this.visibleElements[t],s=this.visibleElements[e];i=this._elements.indexOf(r),n=this._elements.indexOf(s),this.moveElement(i,n)},e.prototype.moveElement=function(t,e){var i=this._elements.splice(t,1);this._elements.splice(e,0,i[0]),this.visibleElementsChanged(i[0],"MOVED")},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.buildVisualizers=function(t){var e=this;t.forEach((function(t){var i=e.createVisualizer(t);if(e.allowHideQuestions&&i.registerToolbarItem("removeQuestion",(function(){return h.b.createButton((function(){setTimeout((function(){return e.hideElement(t.name)}),0)}),n.a.getString("hideButton"))})),e.allowMakeQuestionsPrivate&&i.registerToolbarItem("makePrivatePublic",(function(){var i=e.getElement(t.name),r=i.isPublic?"first":"second",s=n.a.getString("makePrivateButton"),o=n.a.getString("makePublicButton");return h.b.createSvgToggleButton("makepublic","makeprivate",s,o,(function(t){setTimeout((function(){return e.makeElementPublic(i)}),0)}),(function(t){setTimeout((function(){return e.makeElementPrivate(i)}),0)}),r)})),i.supportSelection){var r=i,s=new _(r);i.registerToolbarItem("questionFilterInfo",(function(){return s.update(r.selection),s.htmlElement})),r.onDataItemSelected=function(i,n){s.update({value:i,text:n}),e.setFilter(t.name,i)}}i.onUpdate=function(){return e.layout()},i.onAfterRender.add(e.onAfterRenderQuestionCallback),e.visualizers.push(i)}))},e.prototype.destroyVisualizers=function(){var t=this;this.visualizers.forEach((function(e){e.onUpdate=void 0,e instanceof d&&(e.onDataItemSelected=void 0),e.onAfterRender.remove(t.onAfterRenderQuestionCallback),e.destroy()})),this.visualizers=[]},Object.defineProperty(e.prototype,"locale",{get:function(){var t=this.options.survey;return t?t.locale:n.a.currentLocale},set:function(t){this.setLocale(t),this.refresh(),this.onStateChanged.fire(this,this.state)},enumerable:!1,configurable:!0}),e.prototype.setLocale=function(t){var e=this,i=this.options.survey;i&&(i.locale=t,(this.questions||[]).forEach((function(t){var i=e.getElement(t.name);i&&(i.displayName=e.processText(t.title))}))),n.a.currentLocale=t},Object.defineProperty(e.prototype,"allowDynamicLayout",{get:function(){return void 0===this.options.allowDynamicLayout||!0===this.options.allowDynamicLayout},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowHideQuestions",{get:function(){return void 0===this.options.allowHideQuestions||!0===this.options.allowHideQuestions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"allowMakeQuestionsPrivate",{get:function(){return!0===this.options.allowMakeQuestionsPrivate},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layoutEngine",{get:function(){return this._layoutEngine},enumerable:!1,configurable:!0}),e.prototype.buildElements=function(t){var e=this;return(t||[]).map((function(t){return{name:t.name,displayName:e.processText(t.title),isVisible:!0,isPublic:!0,type:void 0}}))},e.prototype.getElements=function(){return(this._elements||[]).map((function(t){return{name:t.name,displayName:t.displayName,isVisible:t.isVisible,isPublic:t.isPublic,type:t.type}}))},Object.defineProperty(e.prototype,"visibleElements",{get:function(){return this._elements.filter((function(t){return t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hiddenElements",{get:function(){return this._elements.filter((function(t){return!t.isVisible}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"publicElements",{get:function(){return this._elements.filter((function(t){return t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"privateElements",{get:function(){return this._elements.filter((function(t){return!t.isPublic}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"locales",{get:function(){return this.options.survey?this.options.survey.getUsedLocales():[]},enumerable:!1,configurable:!0}),e.prototype.getElement=function(t){return this._elements.filter((function(e){return e.name===t}))[0]},e.prototype.getVisualizer=function(t){return this.visualizers.filter((function(e){return e.question.name===t}))[0]},e.prototype.visibleElementsChanged=function(t,e){this.onVisibleElementsChanged.isEmpty||this.onVisibleElementsChanged.fire(this,{elements:this._elements,changed:t,reason:e}),this.onStateChanged.fire(this,this.state),this.layout()},e.prototype.renderPanelElement=function(t,e){var i=this.getVisualizer(t.name),n=h.b.createElement("div");e.appendChild(n);var r=h.b.createElement("div"),s=h.b.createElement("h3"),o=h.b.createElement("div");return s.innerText=t.displayName,n.className=this.allowDynamicLayout?"sa-question sa-question-layouted":"sa-question",s.className="sa-question__title",this.allowDynamicLayout&&(s.className=s.className+" sa-question__title--draggable"),r.className="sa-question__content",r.style.backgroundColor=this.backgroundColor,r.appendChild(s),r.appendChild(o),n.appendChild(r),i.render(o),t.renderedElement=n,n},e.prototype.renderToolbar=function(e){e.className+=" sa-panel__header",t.prototype.renderToolbar.call(this,e)},e.prototype.renderContent=function(t){var e=this;t.className+=" sa-panel__content sa-grid",this.visibleElements.forEach((function(i){e.renderPanelElement(i,t)})),this.layoutEngine.start(t)},e.prototype.destroyContent=function(e){this.layoutEngine.stop(),t.prototype.destroyContent.call(this,e)},e.prototype.refresh=function(){this.toolbarContainer&&(this.destroyToolbar(this.toolbarContainer),this.renderToolbar(this.toolbarContainer)),t.prototype.refresh.call(this)},e.prototype.layout=function(){this.layoutEngine.update()},e.prototype.setFilter=function(t,e){this.dataProvider.setFilter(t,e)},Object.defineProperty(e.prototype,"state",{get:function(){var t=this;return{locale:this.locale,elements:[].concat(this._elements.map((function(e){var i=t.getVisualizer(e.name),n=Object(o.a)(Object(o.a)({},e),null==i?void 0:i.getState());return void 0!==n.renderedElement&&delete n.renderedElement,n})))}},set:function(t){var e=this;if(t){if(Array.isArray(t.elements)){var i=this.questions.map((function(t){return t.name}));this._elements=[].concat(t.elements.filter((function(t){return-1!==i.indexOf(t.name)})))}void 0!==t.locale&&this.setLocale(t.locale),this._elements.forEach((function(t){var i=e.getVisualizer(t.name);void 0!==i&&i.setState(t)})),this.refresh()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"permissions",{get:function(){return this._elements.map((function(t){return{name:t.name,isPublic:t.isPublic}}))},set:function(t){var e=this._elements.map((function(e){return t.forEach((function(t){t.name===e.name&&(e.isPublic=t.isPublic)})),Object(o.a)({},e)}));this._elements=[].concat(e),this.refresh(),this.onPermissionsChangedCallback&&this.onPermissionsChangedCallback(this)},enumerable:!1,configurable:!0}),e.prototype.destroy=function(){t.prototype.destroy.call(this),this.destroyVisualizers()},e.haveCommercialLicense=!1,e}(u),C=function(t){function e(e,i,n,r){void 0===n&&(n={});var s=t.call(this,e,i,n,r||"panelDynamic")||this;return s._panelVisualizer=void 0,s.onAfterRenderPanelCallback=function(){s.afterRender(s.contentContainer)},(n=Object.assign({},n)).allowDynamicLayout=!1,n.dataProvider=void 0,s._panelVisualizer=new w(s.getQuestions(),[],n),s._panelVisualizer.onAfterRender.add(s.onAfterRenderPanelCallback),s.updateData(i),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"panelDynamic"},enumerable:!1,configurable:!0}),e.prototype.updatePanelVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){void 0!==i[t.question.name]&&(e=e.concat(i[t.question.name]))})),this._panelVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updatePanelVisualizerData()},e.prototype.onDataChanged=function(){this.updatePanelVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){return this.question.template.questions},e.prototype.destroyContent=function(e){this._panelVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._panelVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._panelVisualizer.onAfterRender.remove(this.onAfterRenderPanelCallback)},e}(u);a.registerVisualizer("paneldynamic",C);var S=function(t){function e(e,i,n){return t.call(this,e,i,n)||this}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"matrixDynamic"},enumerable:!1,configurable:!0}),e.prototype.getQuestions=function(){var t=this.question.visibleRows;return 0===t.length?[]:t[0].cells.map((function(t){return t.question}))},e}(C);a.registerVisualizer("matrixdynamic",S);var T=function(t){function e(e,i,n,s){void 0===n&&(n={});var o=t.call(this,e,i,n,s||"matrixDropdown")||this;o._matrixDropdownVisualizer=void 0,o.onPanelAfterRenderCallback=function(){o.afterRender(o.contentContainer)},(n=Object.assign({},n)).dataProvider=void 0,n.allowDynamicLayout=!1,n.seriesValues=e.rows.map((function(t){return t.value})),n.seriesLabels=e.rows.map((function(t){return t.text}));var l=o.getQuestions();if(1==n.seriesValues.length&&l.every((function(t){return r.Helpers.isArraysEqual(t.choices,o.question.choices)}))){var h=a.getVisualizersByType("matrixdropdown-grouped");o._matrixDropdownVisualizer=new h[0](o.question,[],n)}else o._matrixDropdownVisualizer=new w(l,[],n);return o._matrixDropdownVisualizer.onAfterRender.add(o.onPanelAfterRenderCallback),o.updateData(i),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixDropdownVisualizer",{get:function(){return this._matrixDropdownVisualizer},enumerable:!1,configurable:!0}),e.prototype.updateDropdownVisualizerData=function(){var t=this,e=[];this.data.forEach((function(i){var n=i[t.question.name];n&&Object.keys(n).forEach((function(t){var i=Object.assign({},n[t]);i[s.seriesMarkerKey]=t,e.push(i)}))})),this._matrixDropdownVisualizer.updateData(e)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.updateDropdownVisualizerData()},e.prototype.onDataChanged=function(){this.updateDropdownVisualizerData(),t.prototype.onDataChanged.call(this)},e.prototype.getQuestions=function(){var t=this.question;return t.columns.map((function(e){var i=e.templateQuestion;return Array.isArray(i.choices)&&0===i.choices.length&&(i.choices=t.choices),i}))},e.prototype.destroyContent=function(e){this._matrixDropdownVisualizer.clear(),t.prototype.destroyContent.call(this,this.contentContainer)},e.prototype.renderContent=function(t){this._matrixDropdownVisualizer.render(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this._matrixDropdownVisualizer.onAfterRender.remove(this.onPanelAfterRenderCallback)},e}(u);a.registerVisualizer("matrixdropdown",T);var D=function(t){function e(e,i,r,s){var o=t.call(this,i,r,s)||this;if(o.visualizers=e,o.visualizersWithSelection=[],o.onAfterVisualizerRenderCallback=function(){o.afterRender(o.contentContainer)},!e||e.length<2)throw new Error("VisualizerArrayWrapper works with visualizers collection only.");return o.visualizers.forEach((function(t){t.onUpdate=function(){return o.invokeOnUpdate()},t.supportSelection&&(o._supportSelection=!0,o.visualizersWithSelection.push(t))})),o.registerToolbarItem("changeVisualizer",(function(){return h.b.createSelector(o.visualizers.map((function(t){return{value:t.name,text:n.a.getString("visualizer_"+t.name)}})),(function(t){return o.visualizer.name===t.value}),(function(t){return o.setVisualizer(t.target.value)}))})),o.visualizer=e[0],o.visualizer.onAfterRender.add(o.onAfterVisualizerRenderCallback),o}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return!1},enumerable:!1,configurable:!0}),e.prototype.getVisualizers=function(){return this.visualizers},e.prototype.setVisualizer=function(t){this.visualizer&&(this.visualizer.onAfterRender.remove(this.onAfterVisualizerRenderCallback),this.visualizer.destroy()),this.visualizer=this.visualizers.filter((function(e){return e.name===t}))[0],this.refresh(),this.visualizer.onAfterRender.add(this.onAfterVisualizerRenderCallback)},e.prototype.updateData=function(e){t.prototype.updateData.call(this,e),this.visualizers.forEach((function(t){t.updateData(e)}))},Object.defineProperty(e.prototype,"onDataItemSelected",{set:function(t){this.visualizersWithSelection.forEach((function(e){e.onDataItemSelected=t}))},enumerable:!1,configurable:!0}),e.prototype.setSelection=function(t){this.visualizersWithSelection.forEach((function(e){e.setSelection(t)}))},Object.defineProperty(e.prototype,"selection",{get:function(){return this.visualizer.selection||this.selectedItem},enumerable:!1,configurable:!0}),e.prototype.renderContent=function(t){this.visualizerContainer=t,this.visualizer.render(this.visualizerContainer)},e.prototype.setBackgroundColorCore=function(e){t.prototype.setBackgroundColorCore.call(this,e),this.visualizers.forEach((function(t){return t.backgroundColor=e}))},e.prototype.destroy=function(){var e=this;this.visualizers.forEach((function(t){t.onAfterRender.remove(e.onAfterVisualizerRenderCallback),t.onUpdate=void 0})),this.visualizer.destroy(),t.prototype.destroy.call(this)},e}(u);a.registerAlternativesVisualizer(D);var E=function(){function t(){}return t.setup=function(t,e){return this.setups[t](e)},t.setupPie=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=[],l=o.length>1,h={type:e.chartType,y:l?o:r,text:(l?o:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),hoverinfo:"x+y",mode:"markers",marker:{}};h.hoverinfo="label+value+percent",h.marker.colors=s,h.textposition="inside","doughnut"===e.chartType&&(h.type="pie",h.hole=.4),l||(h.marker.symbol="circle",h.marker.size=16),n.forEach((function(t,e){a.push(Object.assign({},h,{values:t,labels:l?o:r,customdata:l?o:r}))}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:(r.length<10?50*r.length+100:550)*Math.round(a.length/2)+25,margin:{l:0,t:25,b:0,r:10},colorway:s,hovermode:"closest",plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return l&&(u.grid={rows:Math.round(a.length/2),columns:2},u.annotations=[],r.forEach((function(t,e){a[e].domain={column:e%2,row:Math.floor(e/2)},a[e].title={position:"bottom center",text:t}}))),{traces:a,layout:u,hasSeries:l}},t.setupBar=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,s=i.colors,o=i.texts,a=i.seriesLabels,l=[],h=a.length>1,u=h?a:r,c={type:e.chartType,y:u,text:u,customdata:h?a:r,hoverinfo:"text",orientation:"h",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};c.marker.color=s,n.forEach((function(t,i){var n=Object.assign({},c,{x:t,text:o[i],hovertext:u.map((function(t,e){return"".concat(o[i][e],", ").concat(t)}))});if(e.showPercentages){var r=e.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";n.textposition="inside",n.texttemplate=r,n.width=.9,n.bargap=.1}l.push(n)}));var d={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,orientation:"h",tickmode:"array",tickvals:u,ticktext:u.map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)}))},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return h&&(d.showlegend=!0,"stackedbar"==e.chartType?d.barmode="stack":d.height=30*(r.length+1)*a.length+30+30,r.forEach((function(t,i){l[i].marker.color=void 0,l[i].name=t,"stackedbar"===e.chartType?(l[i].type="bar",l[i].width=.5):l[i].width=(e.showPercentages?.7:.5)/l.length})),l.forEach((function(t,i){var n=e.showPercentages?"%":"";l[i].hovertext=[],u.forEach((function(e,r){l[i].hovertext.push("".concat(t.y[r]," : ").concat(t.name,", ").concat(t.text[r]).concat(n))}))}))),{traces:l,layout:d,hasSeries:h}},t.setupVBar=function(t){var e=t.getAnswersData(),i=e.datasets,n=e.labels,r=e.colors,s=e.texts,o=e.seriesLabels,a=[],l=o.length>1,h={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},margin:{t:30,b:30,r:10},colorway:r,hovermode:"closest",plot_bgcolor:t.backgroundColor,paper_bgcolor:t.backgroundColor,showlegend:!1},u={type:"bar",customdata:l?o:n,hoverinfo:"x+y",mode:"markers",textposition:"none",width:.5,bargap:.5,marker:{}};return u.marker.color=r,i.forEach((function(e,i){var r=Object.assign({},u,{x:n,y:t.showPercentages?s[i].map((function(t){return t/100})):e,text:s[i]});if(t.showPercentages){var o=t.showOnlyPercentages?"%{text}%":"%{value} (%{text}%)";r.textposition="inside",r.texttemplate=o,r.width=.9,r.bargap=.1}a.push(r)})),t.showPercentages&&t.showOnlyPercentages&&(h.yaxis={automargin:!0,tickformat:".0%",range:[0,1],ticklen:t.showOnlyPercentages?25:5,tickcolor:"transparent"}),{traces:a,layout:h,hasSeries:l}},t.setupScatter=function(e){var i=e.getAnswersData(),n=i.datasets,r=i.labels,s=i.colors,o=(i.texts,i.seriesLabels),a=o.length>1,l=[],h={type:"scatter",y:(a?o:r).map((function(i){return t.getTruncatedLabel(i,e.options.labelTruncateLength)})),customdata:a?o:r,text:a?o:r,hoverinfo:"x+y",orientation:"h",mode:"markers",width:.5,marker:{}};a||(h.marker.symbol="circle",h.marker.size=16),n.forEach((function(t){var e=Object.assign({},h,{x:t});l.push(e)}));var u={font:{family:"Segoe UI, sans-serif",size:14,weight:"normal",color:"#404040"},height:30*(r.length+1)+30+30,margin:{t:30,b:30,r:10},colorway:s,hovermode:"closest",yaxis:{automargin:!0,type:"category",ticklen:5,tickcolor:"transparent"},xaxis:{rangemode:"nonnegative",automargin:!0},plot_bgcolor:e.backgroundColor,paper_bgcolor:e.backgroundColor,showlegend:!1};return a&&(u.showlegend=!0,u.height=void 0,r.forEach((function(t,e){l[e].hoverinfo="x+name",l[e].marker.color=void 0,l[e].name=t}))),{traces:l,layout:u,hasSeries:a}},t.imageExportFormat="png",t.onImageSaving=new r.Event,t.onPlotCreating=new r.Event,t.setups={bar:t.setupBar,vbar:t.setupVBar,stackedbar:t.setupBar,doughnut:t.setupPie,pie:t.setupPie,scatter:t.setupScatter},t.getTruncatedLabel=function(t,e){var i="...".length;return e?-1===e||t.length<=e+i?t:t.substring(0,e)+"...":t},t}(),A=i(7),k=i.n(A),P=function(){function t(t){this.model=t,this._chart=void 0}return t.prototype.patchConfigParameters=function(t,e,i,n){},Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this,i=E.setup(this.model.chartType,this.model),s={displaylogo:!1,responsive:!0,locale:n.a.currentLocale,modeBarButtonsToRemove:["toImage"],modeBarButtonsToAdd:[{name:"toImageSjs",title:n.a.getString("saveDiagramAsPNG"),icon:k.a.Icons.camera,click:function(t){var i={format:E.imageExportFormat,filename:e.model.question.name};E.onImageSaving.fire(e.model,i),k.a.downloadImage(t,i)}}]};void 0!==x.displayModeBar&&(s.displayModeBar=x.displayModeBar),this.patchConfigParameters(t,i.traces,i.layout,s);var o={traces:i.traces,layout:i.layout,config:s};E.onPlotCreating.fire(this.model,o);var a=k.a.newPlot(t,o.traces,o.layout,o.config);t.on("plotly_click",(function(t){var n;if(t.points.length>0){var s="";if(i.hasSeries){s=t.points[0].data.name;var o=t.points[0].label,a=e.model.getSeriesValues()[e.model.getSeriesLabels().indexOf(o)],l=e.model.getSelectedItemByText(s);h=new r.ItemValue(((n={})[a]=l.value,n),o+": "+l.text);e.model.setSelection(h)}else{s=Array.isArray(t.points[0].customdata)?t.points[0].customdata[0]:t.points[0].customdata;var h=e.model.getSelectedItemByText(s);e.model.setSelection(h)}}}));var l=function(){return t.getElementsByClassName("nsewdrag")[0]};return t.on("plotly_hover",(function(){var t=l();t&&(t.style.cursor="pointer")})),t.on("plotly_unhover",(function(){var t=l();t&&(t.style.cursor="")})),this._chart=a,a},t.prototype.destroy=function(t){k.a.purge(t),this._chart=void 0},t}(),x=function(t){function e(i,n,r,s){void 0===r&&(r={});var o=t.call(this,i,n,r,s)||this;return o.chartTypes=[].concat(e.types),o.getSeriesValues().length>0&&-1===o.chartTypes.indexOf("stackedbar")&&o.chartTypes.push("stackedbar"),r.allowExperimentalFeatures&&o.chartTypes.splice(1,0,"vbar"),o.chartType=o.chartTypes[0],-1!==o.chartTypes.indexOf(r.defaultChartType)&&(o.chartType=r.defaultChartType),o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var s=i.map((function(t,i){return e[i][n]}));r.push(s)})),r}return e},e.types=["bar","pie","doughnut","scatter"],e.displayModeBar=void 0,e}(d);a.registerVisualizer("checkbox",x),a.registerVisualizer("radiogroup",x),a.registerVisualizer("dropdown",x),a.registerVisualizer("imagepicker",x);var O=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["bar","stackedbar","pie","doughnut"],e}(p);a.registerVisualizer("matrix",O);var V=function(t){function e(e){return t.call(this,e)||this}return Object(o.b)(e,t),e.prototype.patchConfigParameters=function(t,e,i,n){var r=this.model.getColors(),s=[L.trueColor||r[0],L.falseColor||r[1]];this.model.showMissingAnswers&&s.push(r[2]),"pie"===this.model.chartType||"doughnut"===this.model.chartType?e.forEach((function(t){t.marker.colors=s})):"bar"===this.model.chartType&&e.forEach((function(t){t.marker.color=s}))},e}(P),L=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new V(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["pie","bar","doughnut"],e}(f);a.registerVisualizer("boolean",L);var M=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(o.b)(e,t),e.prototype.getQuestionResults=function(){var t=this.question.name;return this.data.map((function(e){return e[t]}))},e.prototype.getEmptyData=function(){var t=this.getValues(),e=[];return e.length=t.length,e.fill(0),e},e.prototype.getData=function(){var t=this,e=this.getQuestionResults(),i=this.getValues(),n=this.getEmptyData();return e.forEach((function(e){t.applyResultToPlotlyData(e,n,i)})),[n]},e.prototype.applyResultToPlotlyData=function(t,e,i){t&&e&&i&&t.forEach((function(t,n,r){var s=i.indexOf(t);e[s]=+e[s]+(r.length-n)}))},e}(x);a.registerVisualizer("ranking",M);var z=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["stackedbar","bar","pie","doughnut"],e}(function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"matrixDropdownGrouped")||this;return s.getAnswersData(),s}return Object(o.b)(e,t),Object.defineProperty(e.prototype,"matrixQuestion",{get:function(){return this.question},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataName",{get:function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},enumerable:!1,configurable:!0}),e.prototype.getSeriesValues=function(){return this.matrixQuestion.columns.map((function(t){return t.name}))},e.prototype.getSeriesLabels=function(){return this.matrixQuestion.columns.map((function(t){return t.title}))},e.prototype.valuesSource=function(){return this.matrixQuestion.choices},e.prototype.isSupportMissingAnswers=function(){return!1},e.prototype.getData=function(){var t=this.getValues(),e=this.getSeriesValues(),i=this.matrixQuestion.rows.map((function(t){return t.value})),n=this.dataProvider.getData({dataName:e,getValues:function(){return t},getLabels:function(){return t},getSeriesValues:function(){return i},getSeriesLabels:function(){return i}}),r=[];return t.forEach((function(t,i){var s=e.map((function(t,e){return n[e][0][i]}));r.push(s)})),r},e}(d));a.registerVisualizer("matrixdropdown-grouped",z);var B=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new P(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.prototype.getData=function(){var e=t.prototype.getData.call(this),i=this.getSeriesValues(),n=this.getValues();if(i.length>1){var r=[];return n.forEach((function(t,n){var s=i.map((function(t,i){return e[i][n]}));r.push(s)})),r}return e},e.types=["bar","scatter"],e}(m);a.registerVisualizer("date",B),a.registerVisualizer("number",B),a.registerVisualizer("rating",B);var I=function(){function t(t){this.model=t,this._chart=void 0}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!1,configurable:!0}),t.prototype.create=function(t){var e=this.model.question,i=this.model.getData(),r=i[0],s=i[1],o=i[2];if("rating"===e.getType()){var a=e.visibleRateValues;o=a[a.length-1].value,s=a[0].value}var l=this.model.generateColors(o,s,R.stepsCount);R.showAsPercentage&&(r=h.a.toPercentage(r,o),s=h.a.toPercentage(s,o),o=h.a.toPercentage(o,o));var u=[{type:"indicator",mode:"gauge+number",gauge:{axis:{range:[s,o]},shape:this.model.chartType,bgcolor:"white",bar:{color:l[0]}},value:r,text:e.name,domain:{x:[0,1],y:[0,1]}}],c={plot_bgcolor:this.model.backgroundColor,paper_bgcolor:this.model.backgroundColor};"bullet"===this.model.chartType&&(c.height=250,c.width=600);var d={data:u,layout:c,config:{displayModeBar:!1,staticPlot:!0,locale:n.a.currentLocale,responsive:!0}};return E.onPlotCreating.fire(this.model,d),k.a.newPlot(t,d.data,d.layout,d.config)},t.prototype.destroy=function(t){k.a.purge(t),this._chart=void 0},t}(),R=function(t){function e(i,n,r,s){var o=t.call(this,i,n,r,s)||this;return o.chartTypes=e.types,o.chartType=o.chartTypes[0],o._chartAdapter=new I(o),o}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._chartAdapter.destroy(e.children[0]),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){var e=this,i=h.b.createElement("div");t.appendChild(i),this._chartAdapter.create(i).then((function(){e.afterRender(e.contentContainer)}))},e.types=["gauge","bullet"],e}(c);a.registerVisualizer("number",R),a.registerVisualizer("rating",R),a.registerVisualizer("expression",R);var j={en:["...","a","about","above","across","after","again","against","all","almost","alone","along","already","also","although","always","among","an","and","another","any","anybody","anyone","anything","anywhere","are","area","areas","around","as","ask","asked","asking","asks","at","away","b","back","backed","backing","backs","be","became","because","become","becomes","been","before","began","behind","being","beings","best","better","between","big","both","but","by","c","came","can","cannot","case","cases","certain","certainly","clear","clearly","come","could","d","did","differ","different","differently","do","does","done","down","down","downed","downing","downs","during","e","each","early","either","end","ended","ending","ends","enough","even","evenly","ever","every","everybody","everyone","everything","everywhere","f","face","faces","fact","facts","far","felt","few","find","finds","first","for","four","from","full","fully","further","furthered","furthering","furthers","g","gave","general","generally","get","gets","give","given","gives","go","going","good","goods","got","great","greater","greatest","group","grouped","grouping","groups","h","had","has","have","having","he","her","here","herself","high","high","high","higher","highest","him","himself","his","how","however","i","if","important","in","interest","interested","interesting","interests","into","is","it","its","itself","j","just","k","keep","keeps","kind","knew","know","known","knows","l","large","largely","last","later","latest","least","less","let","lets","like","likely","long","longer","longest","m","made","make","making","man","many","may","me","member","members","men","might","more","most","mostly","mr","mrs","much","must","my","myself","n","necessary","need","needed","needing","needs","never","new","new","newer","newest","next","no","nobody","non","noone","not","nothing","now","nowhere","number","numbers","o","of","off","often","old","older","oldest","on","once","one","only","open","opened","opening","opens","or","order","ordered","ordering","orders","other","others","our","out","over","p","part","parted","parting","parts","per","perhaps","place","places","point","pointed","pointing","points","possible","present","presented","presenting","presents","problem","problems","put","puts","q","quite","r","rather","really","right","right","room","rooms","s","said","same","saw","say","says","second","seconds","see","seem","seemed","seeming","seems","sees","several","shall","she","should","show","showed","showing","shows","side","sides","since","small","smaller","smallest","so","some","somebody","someone","something","somewhere","state","states","still","still","such","sure","t","take","taken","than","that","the","their","them","then","there","therefore","these","they","thing","things","think","thinks","this","those","though","thought","thoughts","three","through","thus","to","today","together","too","took","toward","turn","turned","turning","turns","two","u","under","until","up","upon","us","use","used","uses","v","very","w","want","wanted","wanting","wants","was","way","ways","we","well","wells","went","were","what","when","where","whether","which","while","who","whole","whose","why","will","with","within","without","work","worked","working","works","would","x","y","year","years","yet","you","young","younger","youngest","your","yours","z"],no:["...","alle","andre","arbeid","at","av","bare","begge","ble","blei","bli","blir","blitt","bort","bruke","både","båe","da","de","deg","dei","deim","deira","deires","dem","den","denne","der","dere","deres","det","dette","di","din","disse","ditt","du","dykk","dykkar","då","eg","ein","eit","eitt","eller","elles","en","ene","eneste","enhver","enn","er","et","ett","etter","folk","for","fordi","forsøke","fra","få","før","før","først","gjorde","gjøre","god","gå","ha","hadde","han","hans","har","hennar","henne","hennes","her","hjå","ho","hoe","honom","hoss","hossen","hun","hva","hvem","hver","hvilke","hvilken","hvis","hvor","hvordan","hvorfor","i","ikke","ikkje","ingen","ingi","inkje","inn","innen","inni","ja","jeg","kan","kom","korleis","korso","kun","kunne","kva","kvar","kvarhelst","kven","kvi","kvifor","lage","lang","lik","like","makt","man","mange","me","med","medan","meg","meget","mellom","men","mens","mer","mest","mi","min","mine","mitt","mot","mye","mykje","må","måte","navn","ned","nei","no","noe","noen","noka","noko","nokon","nokor","nokre","ny","nå","når","og","også","om","opp","oss","over","part","punkt","på","samme","seg","selv","si","sia","sidan","siden","sin","sine","sist","sitt","sjøl","skal","skulle","slik","slutt","so","som","somme","somt","start","stille","så","sånn","tid","til","tilbake","tilstand","um","under","upp","ut","uten","var","vart","varte","ved","verdi","vere","verte","vi","vil","ville","vite","vore","vors","vort","vår","være","vært","vøre","vørt","æ","å"],nl:["de","en","van","ik","te","dat","die","in","een","hij","het","niet","zijn","is","was","op","aan","met","als","voor","had","er","maar","om","hem","dan","zou","of","wat","mijn","men","dit","zo","door","over","ze","zich","bij","ook","tot","je","mij","uit","der","daar","haar","naar","heb","hoe","heeft","hebben","deze","u","want","nog","zal","me","zij","nu","ge","geen","omdat","iets","worden","toch","al","waren","veel","meer","doen","toen","moet","ben","zonder","kan","hun","dus","alles","onder","ja","eens","hier","wie","werd","altijd","doch","wordt","wezen","kunnen","ons","zelf","tegen","na","reeds","wil","kon","niets","uw","iemand","geweest","andere"]},N={getStopWords:function(t){return void 0===t&&(t=""),j[t||"en"]||[]}},H=i(20),q=i.n(H),F=function(){function t(t){this.model=t}return Object.defineProperty(t.prototype,"wordcloud",{get:function(){return this._wordcloud},enumerable:!1,configurable:!0}),t.prototype.create=function(e){var i=this,r=this.model.getData(),s=(this.model.getColors(),h.b.createElement("canvas","")),o=h.b.createElement("p","",{innerHTML:n.a.getString("noResults")});if(0!==r.length){e.appendChild(s);var a={list:r,weightFactor:t.weightFactor,abortThreshold:t.abortThreshold,drawOutOfBound:t.drawOutOfBound,shrinkToFit:t.shrinkToFit,fontFamily:"Segoe UI Bold, sans-serif",color:function(t,e){return i.model.getRandomColor()},rotateRatio:.5,rotationSteps:2,backgroundColor:this.model.backgroundColor,click:function(t){console.log(t[0]+": "+t[1])}};return this._wordcloud=q()(s,a),this._wordcloud}e.appendChild(o)},t.prototype.destroy=function(t){this._wordcloud=void 0},t.drawOutOfBound=!1,t.shrinkToFit=!0,t.abortThreshold=void 0,t.weightFactor=20,t}(),G=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"wordcloud")||this;return s._wordcloudAdapter=new F(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e={},i=[],r=n.a.currentLocale;i=r?N.getStopWords(r):N.getStopWords();var s=function(t){(t=""+t).length>15&&(t=t.substring(0,14)+"..."),t&&t.split(" ").forEach((function(t){(t=function(t){return-1!==i.indexOf(t)?"":t}(t.toLowerCase()||""))&&(e[t]?e[t]++:e[t]=1)}))};return this.data.forEach((function(e){var i=e[t.question.name];i&&(Array.isArray(i)?i.forEach(s):"object"==typeof i?Object.keys(i).forEach((function(t){return s(i[t])})):s(i))})),Object.keys(e).map((function(t){return[t,e[t]]}))},e.prototype.destroyContent=function(e){this._wordcloudAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._wordcloudAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._wordcloudAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",G),a.registerVisualizer("comment",G),a.registerVisualizer("multipletext",G);i(26);var X=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=this.model.getData(),i=e.columnsCount,r=e.data,s=h.b.createElement("p","",{innerHTML:n.a.getString("noResults")});if(0!==r.length){var o=h.b.createElement("table","sa-text-table");o.style.backgroundColor=this.model.backgroundColor,t.appendChild(o),r.forEach((function(t){for(var e=h.b.createElement("tr"),n=0;n<i;n++){var r=h.b.createElement("td","sa-text-table__cell",{textContent:t[n]});e.appendChild(r)}o.appendChild(e)})),t.className="sa-text-table__container",t.appendChild(o)}else t.appendChild(s)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),Y=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"text")||this;return s._textTableAdapter=new X(s),s}return Object(o.b)(e,t),e.prototype.getData=function(){var t=this,e=[],i=0;return this.data.forEach((function(n){var r=n[t.question.name],s=[];r&&(Array.isArray(r)?s.concat(r):"object"==typeof r?Object.keys(r).forEach((function(t){return s.push(r[t])})):s.push(r),e.push(s),s.length>i&&(i=s.length))})),{columnsCount:i,data:e}},e.prototype.destroyContent=function(e){this._textTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._textTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._textTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(u);a.registerVisualizer("text",Y),a.registerVisualizer("comment",Y),a.registerVisualizer("multipletext",Y);i(27);var Q=function(){function t(t){this.model=t}return t.prototype.create=function(t){var e=this,i=this.model.getAnswersData(),r=i.datasets,s=i.labels,o=(i.colors,i.texts),a=(i.seriesLabels.length,h.b.createElement("p","",{innerHTML:n.a.getString("noResults")}));0!==r.length&&0!==r[0].length?r.forEach((function(i,r){var a=h.b.createElement("table","sa-choices-table");a.style.backgroundColor=e.model.backgroundColor,t.appendChild(a);var l=h.b.createElement("tr"),u=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("answer")});l.appendChild(u);var c=h.b.createElement("th","sa-choices-table__cell-header",{textContent:""});l.appendChild(c);var d=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("percent")});l.appendChild(d);var p=h.b.createElement("th","sa-choices-table__cell-header",{textContent:n.a.getString("responses")});l.appendChild(p),a.appendChild(l),i.forEach((function(t,e){var i=h.b.createElement("tr"),n=h.b.createElement("td","sa-choices-table__cell",{textContent:s[e]});i.appendChild(n);var l=h.b.createElement("td","sa-choices-table__cell"),u=h.b.createElement("div","sa-choices-sparkline"),c=h.b.createElement("div","sa-choices-sparkline-value");c.style.width=o[r][e]+"%",u.appendChild(c),l.appendChild(u),i.appendChild(l);var d=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:o[r][e]+"%"});i.appendChild(d);var p=h.b.createElement("td","sa-choices-table__cell sa-choices-table__cell-value",{textContent:t});i.appendChild(p),a.appendChild(i)})),t.className="sa-choices-table__container",t.appendChild(a)})):t.appendChild(a)},t.prototype.destroy=function(t){t.innerHTML=""},t}(),U=function(t){function e(e,i,n,r){var s=t.call(this,e,i,n,r||"choices")||this;return s._choicesTableAdapter=new Q(s),s.answersOrder="asc",s.showPercentages=!0,s}return Object(o.b)(e,t),e.prototype.destroyContent=function(e){this._choicesTableAdapter.destroy(e),t.prototype.destroyContent.call(this,e)},e.prototype.renderContent=function(t){this._choicesTableAdapter.create(t),this.afterRender(this.contentContainer)},e.prototype.destroy=function(){this._choicesTableAdapter.destroy(this.contentContainer),t.prototype.destroy.call(this)},e}(d)}])}));
|