UNPKG

137 kBJavaScriptView Raw
1!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("lit-html"),require("@finos/perspective/dist/esm/config"),require("core-js/modules/es.array.iterator"),require("core-js/modules/web.dom-collections.iterator"),require("@finos/perspective"),require("core-js/modules/es.promise"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.regexp.to-string"),require("core-js/modules/es.string.includes"),require("lodash/debounce"),require("awesomplete"),require("core-js/modules/es.array.reverse"),require("core-js/modules/es.string.trim"),require("core-js/modules/es.symbol.description"),require("lodash/values"),require("lodash/isEqual"),require("core-js/modules/es.array-buffer.slice"),require("core-js/modules/es.typed-array.uint8-array"),require("core-js/modules/es.typed-array.to-locale-string"),require("core-js/modules/web.url"),require("@webcomponents/webcomponentsjs"),require("core-js/modules/es.object.assign"),require("core-js/modules/es.string.match"),require("core-js/modules/es.string.split"),require("core-js/modules/es.array.flat-map"),require("core-js/modules/es.array.sort"),require("core-js/modules/es.array.unscopables.flat-map"));else if("function"==typeof define&&define.amd)define(["lit-html","@finos/perspective/dist/esm/config","core-js/modules/es.array.iterator","core-js/modules/web.dom-collections.iterator","@finos/perspective","core-js/modules/es.promise","core-js/modules/es.string.replace","core-js/modules/es.regexp.to-string","core-js/modules/es.string.includes","lodash/debounce","awesomplete","core-js/modules/es.array.reverse","core-js/modules/es.string.trim","core-js/modules/es.symbol.description","lodash/values","lodash/isEqual","core-js/modules/es.array-buffer.slice","core-js/modules/es.typed-array.uint8-array","core-js/modules/es.typed-array.to-locale-string","core-js/modules/web.url","@webcomponents/webcomponentsjs","core-js/modules/es.object.assign","core-js/modules/es.string.match","core-js/modules/es.string.split","core-js/modules/es.array.flat-map","core-js/modules/es.array.sort","core-js/modules/es.array.unscopables.flat-map"],e);else{var o="object"==typeof exports?e(require("lit-html"),require("@finos/perspective/dist/esm/config"),require("core-js/modules/es.array.iterator"),require("core-js/modules/web.dom-collections.iterator"),require("@finos/perspective"),require("core-js/modules/es.promise"),require("core-js/modules/es.string.replace"),require("core-js/modules/es.regexp.to-string"),require("core-js/modules/es.string.includes"),require("lodash/debounce"),require("awesomplete"),require("core-js/modules/es.array.reverse"),require("core-js/modules/es.string.trim"),require("core-js/modules/es.symbol.description"),require("lodash/values"),require("lodash/isEqual"),require("core-js/modules/es.array-buffer.slice"),require("core-js/modules/es.typed-array.uint8-array"),require("core-js/modules/es.typed-array.to-locale-string"),require("core-js/modules/web.url"),require("@webcomponents/webcomponentsjs"),require("core-js/modules/es.object.assign"),require("core-js/modules/es.string.match"),require("core-js/modules/es.string.split"),require("core-js/modules/es.array.flat-map"),require("core-js/modules/es.array.sort"),require("core-js/modules/es.array.unscopables.flat-map")):e(t["lit-html"],t["@finos/perspective/dist/esm/config"],t["core-js/modules/es.array.iterator"],t["core-js/modules/web.dom-collections.iterator"],t["@finos/perspective"],t["core-js/modules/es.promise"],t["core-js/modules/es.string.replace"],t["core-js/modules/es.regexp.to-string"],t["core-js/modules/es.string.includes"],t["lodash/debounce"],t.awesomplete,t["core-js/modules/es.array.reverse"],t["core-js/modules/es.string.trim"],t["core-js/modules/es.symbol.description"],t["lodash/values"],t["lodash/isEqual"],t["core-js/modules/es.array-buffer.slice"],t["core-js/modules/es.typed-array.uint8-array"],t["core-js/modules/es.typed-array.to-locale-string"],t["core-js/modules/web.url"],t["@webcomponents/webcomponentsjs"],t["core-js/modules/es.object.assign"],t["core-js/modules/es.string.match"],t["core-js/modules/es.string.split"],t["core-js/modules/es.array.flat-map"],t["core-js/modules/es.array.sort"],t["core-js/modules/es.array.unscopables.flat-map"]);for(var i in o)("object"==typeof exports?exports:t)[i]=o[i]}}(window,(function(t,e,o,i,n,r,s,a,c,l,d,p,u,_,h,g,m,f,v,b,y,w,x,A,O,S,k){return function(t){var e={};function o(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(i,n,function(e){return t[e]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=40)}([function(e,o){e.exports=t},function(t,e,o){"use strict";(function(t){o.d(e,"b",(function(){return n})),o.d(e,"c",(function(){return s})),o.d(e,"f",(function(){return c})),o.d(e,"e",(function(){return l})),o.d(e,"d",(function(){return d})),o.d(e,"a",(function(){return p}));o(17),o(3),o(14),o(7),o(10),o(4);function i(t,e,o){const i=function(t){const e=document.createElement("div");return e.innerHTML=t,Array.prototype.slice.call(e.children)[0]}(t);!function(t){if(t.content)return;let e;for(t.content=document.createDocumentFragment();e=t.firstChild;)Node.prototype.appendChild.call(t.content,e)}(i),e&&(i.innerHTML="<style>".concat(e.toString(),"</style>")+i.innerHTML),i.innerHTML='<style id="psp_styles" scope="'.concat(i.getAttribute("id"),'">test{}</style>')+i.innerHTML;for(let t of Object.getOwnPropertyNames(o.prototype)){let e=Object.getOwnPropertyDescriptor(o.prototype,t);if(e&&e.set){let i=e.set;e.set=function(e){this.hasAttribute(t)&&this.getAttribute(t)===e?(this._initializing||this._initialized)&&i.call(this,e):this.setAttribute(t,e)},Object.defineProperty(o.prototype,t,e)}}let n=i.getAttribute("id");console.log("Registered ".concat(n)),window.customElements.define(n,class extends o{attributeChangedCallback(t,e,i){null===i&&(i="null"),"_"!==t[0]&&e!=i&&Object.getOwnPropertyDescriptor(o.prototype,t).set&&(this[t]=i)}connectedCallback(){if(!this._initialized){this._initializing=!0;var t=document.importNode(i.content,!0);this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(t),super.connectedCallback&&super.connectedCallback();for(let t of Object.getOwnPropertyNames(o.prototype))"connectedCallback"!==t&&this.hasAttribute(t)&&"_"!==t[0]&&Object.getOwnPropertyDescriptor(o.prototype,t).set&&(this[t]=this.getAttribute(t));this._initializing=!1,this._initialized=!0}}static get observedAttributes(){return Object.getOwnPropertyNames(o.prototype)}})}function n(t,...e){const o=e.map(t=>t.toString()).join("\n");return function(e){return i(t,{toString:()=>o},e)}}function r(t){return function(e,o,i){const n=i.value;return i.set=function(e){let i=this.getAttribute(o);try{null!=e&&""!==e||(e=t()),"string"!=typeof e&&(e=JSON.stringify(e)),e!==i&&(i=e),i=JSON.parse(i)}catch(n){console.warn('Invalid value for attribute "'.concat(o,'": ').concat(e)),i=t()}n.call(this,i)},i.get=function(){return this.hasAttribute(o)?JSON.parse(this.getAttribute(o)):t()},delete i.value,delete i.writable,i}}function s(t){let e=document.createElement("textarea");document.body.appendChild(e),e.value=t,e.select(),document.execCommand("copy"),document.body.removeChild(e)}const a=()=>{let t,e=new Promise(e=>{t=e});return e.resolve=t,e};function c(t,e,o){const i=Symbol("private lock"),n=o.value;return o.value=async function(...t){if(this[i]&&(await this[i],this[i]))return void await this[i];let e;this[i]=a();try{e=await n.call(this,...t)}catch(t){console.error(t)}finally{const t=this[i];return this[i]=void 0,t.resolve(),e}},o}function l(t,...e){if(e[0]===e[1])return;if(e.every(t=>t.classList.contains("null-column")))return;let[o,i]=e.map(e=>Array.prototype.slice.call(t.children).indexOf(e));i<o&&([o,i]=[i,o],e=e.reverse()),t.insertBefore(e[1],e[0]),i+1===t.children.length?t.appendChild(e[0]):t.insertBefore(e[0],t.children[i+1])}const d=r(()=>({})),p=r(()=>[])}).call(this,o(16))},function(t,o){t.exports=e},function(t,e){t.exports=o},function(t,e){t.exports=i},function(t,e,o){"use strict";(function(t){o.d(e,"b",(function(){return s})),o.d(e,"a",(function(){return c}));o(3),o(7),o(4);var i=o(0);function n(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n <pre style="margin:0;overflow:scroll;position:absolute;width:100%;height:100%">',"</pre>\n "]);return n=function(){return t},t}const r={},s=new class{registerPlugin(t,e){if(r[t])throw new Error('A perspective-viewer plugin "'.concat(t,'" has already been registered'));for(const o in r){const i=r[o];i&&i.name===e.name&&(console.warn('Conflicting plugin name "'.concat(e.name,'", qualifying with id')),i.name="".concat(i.name," [").concat(o,"]"),e.name="".concat(e.name," [").concat(t,"]"))}r[t]=e}getPlugin(t){return r[t]}getInstance(){return r}};t.registerPlugin=s.registerPlugin,t.getPlugin=s.getPlugin,t.__perspective_plugins__&&t.__perspective_plugins__.forEach(([e,o])=>t.registerPlugin(e,o));const a=t=>Object(i.html)(n(),t);function c(){t.registerPlugin("debug",{name:"Debug",create:async function(t){const e=await this._view.to_csv({config:{delimiter:"|"}}),o=this._render_time();Object(i.render)(a(e),t),o()},selectMode:"toggle",resize:function(){},delete:function(){}})}}).call(this,o(16))},function(t,e){t.exports=n},function(t,e){t.exports=r},function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var o=function(t,e){var o=t[1]||"",i=t[3];if(!i)return o;if(e&&"function"==typeof btoa){var n=(s=i,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=i.sources.map((function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"}));return[o].concat(r).concat([n]).join("\n")}var s;return[o].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+o+"}":o})).join("")},e.i=function(t,o){"string"==typeof t&&(t=[[null,t,""]]);for(var i={},n=0;n<this.length;n++){var r=this[n][0];"number"==typeof r&&(i[r]=!0)}for(n=0;n<t.length;n++){var s=t[n];"number"==typeof s[0]&&i[s[0]]||(o&&!s[2]?s[2]=o:o&&(s[2]="("+s[2]+") and ("+o+")"),e.push(s))}},e}},function(t,e){t.exports=s},function(t,e){t.exports=a},function(t,e){t.exports=c},function(t,e){t.exports=l},function(t,e){t.exports=d},function(t,e){t.exports=p},function(t,e){t.exports=u},function(t,e){var o;o=function(){return this}();try{o=o||new Function("return this")()}catch(t){"object"==typeof window&&(o=window)}t.exports=o},function(t,e){t.exports=_},function(t,e){t.exports=h},function(t,e){t.exports='\x3c!--\n\nCopyright (c) 2017, the Perspective Authors.\n\nThis file is part of the Perspective library, distributed under the terms of\nthe Apache License 2.0. The full license can be found in the LICENSE file.\n\n--\x3e\n\n<template id="perspective-computed-column">\n <div id="psp-cc__body">\n <span id="psp-cc__close" aria-label="Close Computed Column">&times;</span>\n <div class="psp-cc__container" style="display:none">\n <span id="psp-cc__mode"></span>\n </div>\n <div class="psp-cc__container" style="margin-top:-7px;">\n <div class="psp-cc__content">\n <div id="psp-cc-computation__type"></div>\n <span contentEditable=true type="text" required maxlength="25" size="10" autocomplete="off" id="psp-cc-name"></span>\n </div>\n <div class="psp-cc__content psp-cc__content--nomargin">\n <span class="psp-cc__label psp-cc__error" id="psp-cc__error--name"></span>\n </div>\n </div>\n <div class="psp-cc__container">\n <div class="psp-cc__content">\n <select id="psp-cc-computation__select">\n </select>\n </div>\n </div>\n <div class="psp-cc__container" style="margin-top:-12px;">\n <div id="psp-cc-computation-inputs">\n \x3c!--<div class="psp-cc-computation__input-column" drop-target></div>--\x3e\n </div>\n </div>\n </div>\n <div id="psp-cc__actions">\n <button id="psp-cc-button-delete" class="psp-cc__button">Delete</button>\n <button id="psp-cc-button-save" class="psp-cc__button" disabled>Save</button>\n </div>\n</template>'},function(t,e,o){(t.exports=o(8)(!1)).push([t.i,':host{display:none;flex-direction:column;max-height:35%;margin-top:34px;margin-bottom:24px;flex:0 0 auto!important}:host *{box-sizing:border-box}:host select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--select--background,url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgNC45IDEwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0LjkgMTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojQUFBQUFBO30KPC9zdHlsZT4KPHRpdGxlPmFycm93czwvdGl0bGU+Cjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMS40LDQuNyAyLjUsMy4yIDMuNSw0LjcgIi8+Cjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMy41LDUuMyAyLjUsNi44IDEuNCw1LjMgIi8+Cjwvc3ZnPg==) no-repeat 95% 50%);background-color:#fff;outline:0;border:none;height:24px;padding:0 0 0 6px;font-size:12px}:host.edit #psp-cc-button-delete{display:block!important}:host .psp-cc__label{color:#666;font-size:10px;margin-left:8px}:host .psp-cc__label.psp-cc__error{color:#cb4549!important;display:none}:host #psp-cc__actions{display:flex;justify-content:flex-start;margin-right:5px;margin-left:20px;margin-top:12px}:host #psp-cc__body,:host .psp-cc__container{display:flex;flex-direction:column}:host #psp-cc__body.row,:host .psp-cc__container.row{align-items:center;flex-direction:row}:host span#psp-cc__close{color:#666;position:absolute}:host span#psp-cc__close:hover{cursor:pointer}:host .psp-cc__container{margin:2px 0 10px 26px}:host .psp-cc__container:first-of-type{margin-bottom:0}:host .psp-cc__container span#psp-cc__mode{color:#000;font-size:12px}:host .psp-cc__container input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border-bottom:1px solid #ccc;font-size:12px;padding:3px 4px;flex-basis:500px}:host #psp-cc-name{background-color:#eee;border-bottom:1px solid #ccc;color:#333;cursor:default!important;font-size:12px;padding-left:2px;width:100%}:host #psp-cc-name:empty:before{content:"New Column";color:#ccc}:host #psp-cc-name *{display:inline}:host #psp-cc-name br{display:none}:host .psp-label__placeholder{color:#ccc;display:inline-block;font-size:12px;margin-left:4px}:host .psp-label__requiredType{margin-left:5px;margin-top:-1px;display:inline-block}:host .psp-label__requiredType.float::before,:host .psp-label__requiredType.integer::before{font-family:monospace;display:flex;content:"123";color:#016bc6}:host .psp-label__requiredType.string::before{font-family:monospace;display:flex;content:"abc";color:#fe9292}:host .psp-label__requiredType.boolean::before{font-family:monospace;display:flex;content:"t/f";color:#999}:host .psp-label__requiredType.datetime::before{font-family:monospace;display:flex;content:"mdy";color:#999}:host .psp-label__requiredType.date::before{font-family:monospace;display:flex;content:"mdy";color:#999}:host .psp-cc-computation__input-column{box-sizing:border-box;display:flex;align-items:center;border-bottom:1px solid #ccc;margin-top:5px;height:23px;width:100%}:host .psp-cc-computation__input-column perspective-row{margin-left:-26px;margin-right:-5px;width:calc(100% + 26px)}:host .psp-cc-computation__input-column.dropping{background-color:#f0f0ff!important;border:1px solid #1078d1!important;cursor:copy!important}:host .psp-cc-computation__input-column.dropping perspective-row{display:none!important;pointer-events:none}:host .psp-cc-computation__input-column.dropped{border:0;background:0 0}:host perspective-row{margin-bottom:2px;--row_draggable-overflow:hidden;--name-before-display:inline-block;--is_visible-display:inline-block;--row_draggable-padding:2px 10px 2px 2px;--row_close-display:none;--psp_row-margin:0 5px 0 0;--column_name-max-width:180px}:host perspective-row[drop-target]{--row_draggable_children-opacity:0}:host .psp-cc__content{align-items:center;display:flex;margin-top:5px}:host .psp-cc__content.psp-cc__content--nomargin{margin-top:0}:host #psp-cc-computation__type{box-sizing:border-box;display:flex;font-family:monospace;flex-direction:column;font-size:12px;padding-right:3px;padding-left:6px;background:eee;height:24px;text-align:center;padding-top:4px}:host #psp-cc-computation__type .boolean,:host #psp-cc-computation__type .date,:host #psp-cc-computation__type .datetime{color:#999}:host #psp-cc-computation__type .float,:host #psp-cc-computation__type .integer{color:#016bc6}:host #psp-cc-computation__type .string{color:#fe9292}:host #psp-cc-computation__select{margin-left:auto;width:100%;background-color:#eee;font-size:10px;border-bottom:none;color:#666}:host #psp-cc-computation__drop-target-hover{display:none}:host .psp-cc__button{border-radius:0;border-bottom:1px solid #ccc;border-left:0;border-right:0;border-top:0;font-size:12px;margin-left:6px;padding:2px 5px;width:45px}:host .psp-cc__button:hover{cursor:pointer}:host .psp-cc__button[disabled]{background:#666!important;color:#a0a0a0!important;cursor:not-allowed;border-bottom-color:#000!important;opacity:.5}:host .psp-cc__button#psp-cc-button-delete{background:#e76056;border-bottom-color:#bf4d45;color:#fff;display:none}:host .psp-cc__button#psp-cc-button-delete:active{background:#bf4d45;border-bottom-color:#9d3f39}:host .psp-cc__button#psp-cc-button-save{background:#0171d2;border-bottom-color:#0160b1;color:#fff;height:22px}:host .psp-cc__button#psp-cc-button-save:active{background:#0160b1;border-bottom-color:#014986}',""])},function(t,e,o){(t.exports=o(8)(!1)).push([t.i,'.awesomplete [hidden] {\n display: none;\n}\n\n.awesomplete .visually-hidden {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n}\n\n.awesomplete {\n display: inline-block;\n position: relative;\n}\n\n.awesomplete > input {\n display: block;\n}\n\n.awesomplete > ul {\n position: absolute;\n left: 0;\n z-index: 1;\n min-width: 100%;\n box-sizing: border-box;\n list-style: none;\n padding: 0;\n margin: 0;\n background: #fff;\n}\n\n.awesomplete > ul:empty {\n display: none;\n}\n\n.awesomplete > ul {\n\tborder-radius: .3em;\n\tmargin: .2em 0 0;\n\tbackground: hsla(0,0%,100%,.9);\n\tbackground: linear-gradient(to bottom right, white, hsla(0,0%,100%,.8));\n\tborder: 1px solid rgba(0,0,0,.3);\n\tbox-shadow: .05em .2em .6em rgba(0,0,0,.2);\n\ttext-shadow: none;\n}\n\n@supports (transform: scale(0)) {\n\t.awesomplete > ul {\n\t\ttransition: .3s cubic-bezier(.4,.2,.5,1.4);\n\t\ttransform-origin: 1.43em -.43em;\n\t}\n\t\n\t.awesomplete > ul[hidden],\n\t.awesomplete > ul:empty {\n\t\topacity: 0;\n\t\ttransform: scale(0);\n\t\tdisplay: block;\n\t\ttransition-timing-function: ease;\n\t}\n}\n\n\t/* Pointer */\n\t.awesomplete > ul:before {\n\t\tcontent: "";\n\t\tposition: absolute;\n\t\ttop: -.43em;\n\t\tleft: 1em;\n\t\twidth: 0; height: 0;\n\t\tpadding: .4em;\n\t\tbackground: white;\n\t\tborder: inherit;\n\t\tborder-right: 0;\n\t\tborder-bottom: 0;\n\t\t-webkit-transform: rotate(45deg);\n\t\ttransform: rotate(45deg);\n\t}\n\n\t.awesomplete > ul > li {\n\t\tposition: relative;\n\t\tpadding: .2em .5em;\n\t\tcursor: pointer;\n\t}\n\t\n\t.awesomplete > ul > li:hover {\n\t\tbackground: hsl(200, 40%, 80%);\n\t\tcolor: black;\n\t}\n\t\n\t.awesomplete > ul > li[aria-selected="true"] {\n\t\tbackground: hsl(205, 40%, 40%);\n\t\tcolor: white;\n\t}\n\t\n\t\t.awesomplete mark {\n\t\t\tbackground: hsl(65, 100%, 50%);\n\t\t}\n\t\t\n\t\t.awesomplete li:hover mark {\n\t\t\tbackground: hsl(68, 100%, 41%);\n\t\t}\n\t\t\n\t\t.awesomplete li[aria-selected="true"] mark {\n\t\t\tbackground: hsl(86, 100%, 21%);\n\t\t\tcolor: inherit;\n\t\t}\n',""])},function(t,e){t.exports='\x3c!--\r\n \r\n Copyright (c) 2017, the Perspective Authors.\r\n \r\n This file is part of the Perspective library, distributed under the terms of\r\n the Apache License 2.0. The full license can be found in the LICENSE file.\r\n\r\n--\x3e\r\n\r\n<template id="perspective-row">\r\n <div id="psp_row">\r\n <span class=\'is_visible\'></span>\r\n <div draggable=\'true\' class="row_draggable">\r\n <span id=\'name\' class="column_name"></span>\r\n <div class="row_computed">\r\n <span id="row_edit"></span>\r\n </div>\r\n <span id="sort_order"></span>\r\n <select id="column_aggregate" class="string"></select>\r\n <select id="filter_operator"></select>\r\n <input id="filter_operand" placeholder="Value" />\r\n <span id="row_exclamation" hidden>&#x26A0;</span>\r\n <span id=\'row_close\'>&#x2715;</span>\r\n </div>\r\n </div>\r\n</template>'},function(t,e,o){(t.exports=o(8)(!1)).push([t.i,':host{display:block;border:0 solid transparent}:host .row_computed{display:none;flex-direction:row}.dropping *{pointer-events:none}:host #psp_row{display:var(--psp_row-display,flex);margin:var(--psp_row-margin,0);overflow:visible;align-items:var(--column_selector--align-items,center);width:auto!important;height:auto!important;float:none!important}:host .is_visible{width:var(--column_selector--width,20px);min-width:var(--column_selector--width,20px);height:var(--is_visible--height,auto);cursor:var(--is_visible--cursor,pointer);font-size:var(--column_selector--font-size,14px);margin-top:-2px;display:var(--is_visible-display,none);color:var(--column-selector--color,#999);font-family:var(--column-selector--font-family,Arial)!important}:host #sort_order{display:none;font-family:var(--button--font-family,inherit);margin-right:4px;cursor:pointer;width:10px;display:var(--sort_order-display,none);padding:var(--sort_order-padding,0)}:host #sort_order:before{content:var(--row-sort-order--before, "-")}:host #sort_order:hover{color:var(--active--color,inherit)}:host #filter_operand{display:var(--filter_operand-display,none);margin:0;padding:0;height:19px;color:inherit;outline:0;border-color:var(--inactive--color,#ccc)}:host #filter_operator{margin:0 0 0 15px;display:var(--filter_operator-display,none);height:17px}:host #filter_operator:hover{color:var(--active--color,inherit)}@keyframes expand2{from{transform:translateX(10px)}}@keyframes expand3{from{transform:scale(.9)}}:host(:hover) .is_visible{color:var(--active--color,--column-selector--color)}:host #row_close{display:var(--row_close-display,inline);cursor:pointer;min-width:5px;max-width:5px;margin-right:3px;flex-grow:0;margin-left:3px;color:#999;font-family:Arial;font-size:10px}:host .is_visible:before{content:var(--is_visible--before,none)}:host #row_exclamation{color:red}:host #row_close:hover{color:var(--active--color,inherit)}:host .row_draggable select{border:none}:host .row_draggable select:focus{outline:0}:host select::-ms-expand{display:none}:host select{margin-left:15px;padding-right:15px;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:var(--select--background,url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgNC45IDEwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0LjkgMTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojQUFBQUFBO30KPC9zdHlsZT4KPHRpdGxlPmFycm93czwvdGl0bGU+Cjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMS40LDQuNyAyLjUsMy4yIDMuNSw0LjcgIi8+Cjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMy41LDUuMyAyLjUsNi44IDEuNCw1LjMgIi8+Cjwvc3ZnPg==) no-repeat 95% 50%);background-color:var(--select--background-color,#fff);color:inherit;border-radius:5px;height:24px;padding:var(--column_type--padding,0 0 0 5px);font-size:12px}:host .awesomplete>ul{border-radius:0;margin:0;border:none;transition:none!important;background:var(--plugin--background,#fff)!important}:host .awesomplete>ul:before{content:none}:host .awesomplete>input,:host input{border-color:#ccc;border-width:0 0 1px;box-sizing:border-box;background-color:transparent}:host .row_draggable{animation:var(--row_draggable--animation,expand2 .5s ease-out);cursor:move;border-style:solid;background-color:var(--row_draggable-background-color,none);overflow:var(--row_draggable-overflow,visible);border-color:var(--row_draggable-border-color,none);border-width:var(--row_draggable-border-width,0);padding:var(--row_draggable-padding,0);font-size:12px;flex-grow:1;color:inherit;transition:height .2s;box-sizing:border-box;height:var(--row_draggable-height,21px);min-height:var(--row_draggable-height,21px);display:var(--row_draggable-display,flex);align-items:var(--row-draggable--align-items);flex-direction:var(--row-draggable--flex-direction,column);justify-content:var(--row_draggable--justify-content,center);margin:var(--row_draggable--margin,0);transition:var(--row_draggable--transition,none)}:host .row_draggable *{opacity:var(--row_draggable_children-opacity,1)}:host .row_draggable select{margin:0 0 0 27px}:host ul{transition:background-color .2s,border-color .2s}:host(.null-column) .is_visible{opacity:0!important}:host(.null-column) .row_draggable{background-color:var(--null--background,transparent)!important;border-color:#ccc!important;border-width:0 0 1px!important}:host([drop-target]) .row_draggable{background-color:var(--active--background,#f0f0ff)!important;animation:var(--drop-target--animation,var(--row_draggable--animation,expand3 .5s ease-out));border:none!important}:host .float:before,:host .integer:before{content:var(--float--column-type--content, var(--column-type--content, "123"));color:var(--float--column-type--color,var(--column-type--color,#016bc6))}:host .string:before{content:var(--string--column-type--content, var(--column-type--content, "abc"));color:var(--string--column-type--color,var(--column-type--color,#fe9292))}:host .boolean:before{content:var(--boolean--column-type--content, var(--column-type--content, "t/f"));color:var(--boolean--column-type--color,var(--column-type--color,#999))}:host .date:before{content:var(--date--column-type--content, var(--column-type--content, "mdy"));color:var(--date--column-type--color,var(--column-type--color,#999))}:host .datetime:before{content:var(--datetime--column-type--content, var(--column-type--content, "mdy"));color:var(--datetime--column-type--color,var(--column-type--color,#999))}:host .column_name{overflow:hidden;max-width:var(--column_name-max-width,none);white-space:nowrap;text-overflow:ellipsis}:host span#name:before{font-family:var(--interface-monospace--font-family,monospace);position:relative;display:inline-block;padding:var(--column_type--padding,0 5px);min-width:18px;display:var(--name-before-display,none);width:var(--column_type--width,auto)}:host #column_aggregate{display:var(--column_aggregate-display,none);font-size:10px;font-family:Arial,sans-serif;width:88%;height:20px}:host span#name{flex:var(--column-name--flex,0 1 auto);width:100%;white-space:nowrap;margin:var(--column_name-margin,0)}',""])},function(t,e){t.exports='\x3c!--\r\n \r\n Copyright (c) 2017, the Perspective Authors.\r\n \r\n This file is part of the Perspective library, distributed under the terms of\r\n the Apache License 2.0. The full license can be found in the LICENSE file.\r\n\r\n--\x3e\r\n\r\n<template id="perspective-viewer">\r\n\r\n <div id="app">\r\n <div id="menubar">\r\n <div id="copy_button" class="noselect button" title="Copy CSV"></div>\r\n <div id="download_button" class="noselect button" title="Download CSV"></div>\r\n <div id="reset_button" class="noselect button" title="Reset Viewer"></div>\r\n </div>\r\n <div id=\'side_panel\' class="column fixed noselect">\r\n <div id="vis_selector_container">\r\n <select id="vis_selector">\r\n </select>\r\n </div>\r\n <div id="columns_container" style="visibility: hidden">\r\n <ul id=\'active_columns\'></ul>\r\n <div id="sub_columns">\r\n <ul id=\'inactive_columns\'></ul>\r\n <div id="side_panel__actions" style="visibility: hidden">\r\n <div id="add-computed-column" class="side_panel-action"><span class="psp-icon psp-icon__add"></span><span class="psp-title__columnName">New Column</span></div>\r\n </div>\r\n </div>\r\n <perspective-computed-column></perspective-computed-column>\r\n </div>\r\n <div id="resize_bar"></div>\r\n </div>\r\n <div class="column noselect">\r\n <div id=\'top_panel\'>\r\n <div class="rrow">\r\n <div id="row_pivots">\r\n <div class="psp-text-field">\r\n <ul class="psp-text-field__input" for="row-pivots"></ul>\r\n <label for="row_pivots"></label>\r\n </div>\r\n </div>\r\n </div>\r\n <span id="transpose_button" class="rrow centered" title="Transpose Pivots">&#x21C4;</span>\r\n <div class="rrow">\r\n <div id="column_pivots">\r\n <div class="psp-text-field">\r\n <ul class="psp-text-field__input" for="column-pivots"></ul>\r\n <label for="column_pivots"></label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="rrow">\r\n <div id="sort">\r\n <div class="psp-text-field">\r\n <ul class="psp-text-field__input" for="sort"></ul>\r\n <label for="sort"></label>\r\n </div>\r\n </div>\r\n </div>\r\n <div class="rrow" style=\'flex-grow:3;height:auto;flex:1 1 400px;max-width:none\'>\r\n <div id="filters">\r\n <div class="psp-text-field">\r\n <ul class="psp-text-field__input" for=\'filters\'></ul>\r\n <label for="filters"></label>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div id="pivot_chart_container">\r\n <div class="plugin_information plugin_information--warning hidden" id="plugin_information--size">\r\n <span class="plugin_information__text" id="plugin_information_count">Estimated rendering</span>\r\n <span class="plugin_information__actions">\r\n <span class="plugin_information__action">Render all points</span>\r\n <span class="plugin_information__action--close" id="close_button"></span>\r\n </span>\r\n </div>\r\n <div id="pivot_chart"></div>\r\n </div>\r\n </div>\r\n\r\n <div id="config_button" class="noselect button" title="Right click for additional options"></div>\r\n\r\n <div id=\'drop_target\'>\r\n <div id=\'drop_target_inner\'>\r\n\r\n </div>\r\n </div>\r\n\r\n <slot></slot>\r\n </div>\r\n\r\n</template>'},function(t,e,o){(t.exports=o(8)(!1)).push([t.i,':host #app #top_panel #row_pivots label:before{content:var(--row_pivots--before, "Row Pivots")}:host #app #top_panel #column_pivots label:before{content:var(--column_pivots--before, "Column Pivots")}:host #app #top_panel #sort label:before{content:"Sort"}:host #app #top_panel #filters label:before{content:"Filter"}:host #app #side_panel #active_columns perspective-row:before{font-size:10px;margin-left:var(--column_selector--width,20px);left:1px;padding:var(--column_type--padding,0 0 0 5px);color:var(--inactive--color,#666);position:absolute;margin-top:-15px}:host:hover #config_button{opacity:1}#config_button{background:0 0;opacity:1!important}.button{padding:var(--button--padding,12px 14px 24px 8px)}[settings=true] #config_button{opacity:1!important}@keyframes expand{from{opacity:0}}:host{position:relative;display:inline-block;overflow:hidden;word-wrap:normal;--highcharts-full--gradient:linear-gradient(#4d342f 0%, #e4521b 22.5%, #feeb65 42.5%, #f0f0f0 50%, #dcedc8 57.5%, #42b3d5 67.5%, #1a237e 100%);--highcharts-positive--gradient:linear-gradient(#dcedc8 0%, #42b3d5 35%, #1a237e 100%);--highcharts-negative--gradient:linear-gradient(#feeb65 100%, #e4521b 70%, #4d342f 0%);--hypergrid-tree-header--background:#fff;--hypergrid-tree-header--color:#666;--hypergrid-header--background:#fff;--hypergrid-separator--color:#666;--hypergrid-header--color:#666;--hypergrid-positive--color:#1078d1;--hypergrid-negative--color:#ff8888;--hypergrid--font-size:12px;--hypergrid-header--font-size:12px;--hypergrid--font-family:Helvetica,Arial,sans-serif;--hypergrid-header--font-family:Helvetica,Arial,sans-serif;--hypergrid-row-hover--background:#f6f6f6;--hypergrid-row-hover--color:#666;--hypergrid-cell-hover--background:#eeeeee;--hypergrid-cell-hover--color:#666;--integer--hypergrid--text-align:right;--float--hypergrid--text-align:right;--d3fc-series:rgba(31, 119, 180, 0.5);--d3fc-series-1:#0366d6;--d3fc-series-2:#ff7f0e;--d3fc-series-3:#2ca02c;--d3fc-series-4:#d62728;--d3fc-series-5:#9467bd;--d3fc-series-6:#8c564b;--d3fc-series-7:#e377c2;--d3fc-series-8:#7f7f7f;--d3fc-series-9:#bcbd22;--d3fc-series-10:#17becf;--d3fc-full--gradient:linear-gradient(#4d342f 0%, #e4521b 22.5%, #feeb65 42.5%, #f0f0f0 50%, #dcedc8 57.5%, #42b3d5 67.5%, #1a237e 100%);--d3fc-positive--gradient:linear-gradient(#dcedc8 0%, #42b3d5 35%, #1a237e 100%);--d3fc-negative--gradient:linear-gradient(#feeb65 100%, #e4521b 70%, #4d342f 0%)}:host #pivot_chart{position:absolute;width:100%;height:100%;display:grid;justify-content:stretch}:host .hidden{display:none}:host .psp-icon{color:#999}:host .psp-icon:hover{cursor:pointer}:host .psp-icon__add{display:flex;width:20px;min-width:20px;margin-top:-2px;height:0;font-family:var(--column-add--font-family,inherit)}:host .psp-icon__add:before{font-feature-settings:"liga";content:var(--column-add--before, "+")}:host .psp-title__columnName{display:flex;margin-left:34px;margin-top:3px;font-size:12px;color:#666}:host .side_panel-action:hover{cursor:pointer}:host *{box-sizing:border-box;line-height:1.42857143}:host #app{display:flex;position:relative;width:100%;height:100%}:host #app.hide_message #drop_target{display:none}:host .chart{padding:15px}:host #pivot_chart_container{flex-grow:1;position:relative;border:var(--plugin--border,none);overflow:hidden}:host .config{display:flex}:host #column_pivots #psp_row,:host #filters #psp_row,:host #row_pivots #psp_row,:host #sort #psp_row{display:inline}:host ul{min-height:20px;padding:0;margin:0;font-size:12px}:host #active_columns perspective-row{animation:.3s ease-out expand;--column-selector--color:var(--active--color, #999);--is_visible--before:var(--active-column-selector--content, "\\25CF")}:host #inactive_columns perspective-row{animation:.3s ease-out expand;--column-selector--color:var(--inactive-column-selector--color, #999);--is_visible--before:var(--inactive-column-selector--content, "\\25CB");--row_draggable--animation:none;opacity:var(--inactive-column--opacity,1);transition:opacity .3s}:host #inactive_columns perspective-row:hover{transition:none;opacity:1}:host #top_panel perspective-row{animation:.3s ease-out expand;--column-name--flex:1;padding:0 10px 0 0;margin-bottom:-1px;display:var(--top-panel-row--display,inline-block);--psp_row-display:inline-block}:host #active_columns,:host #inactive_columns{list-style:none;padding:0;width:100%;margin:var(--column-container--margin,8px 0 0 0);overflow-y:auto;overflow-x:hidden;position:relative}:host #inactive_columns perspective-row.active{--row_draggable--margin:0px 0px 0px 10px;opacity:0;height:0!important;overflow:hidden}:host .columns_horizontal #sub_columns.collapse #side_panel__actions{margin-top:0}:host #sub_columns{min-height:33.3%;flex-shrink:100000;display:flex;flex-direction:column;overflow-x:hidden;width:100%}:host #sub_columns.collapse{flex-shrink:0;min-height:64px}:host #sub_columns.collapse #inactive_columns{display:none}:host .column{display:flex;list-style:none;flex-direction:column;flex:1}:host .rrow{display:flex;flex-grow:1;min-height:24px;align-items:center;max-width:400px;list-style:none;min-width:140px;margin:var(--column-drop-container--margin,5px 10px 0 0)}:host .rrow>div{display:flex;min-height:24px;flex-direction:column;justify-content:flex-end}:host #top_panel>.rrow>*{width:100%;padding:12px 0;margin:-12px 0}:host .rrow #psp_row{white-space:nowrap}:host #sort perspective-row{--sort_order-display:inline;--sort_order-padding:0 0 0 4px}:host #sort perspective-row[sort-order=asc]{--row-sort-order--before:var(--sort-order-asc--before, "\\2191")}:host #sort perspective-row[sort-order=desc]{--row-sort-order--before:var(--sort-order-desc--before, "\\2193")}:host #sort perspective-row[sort-order=none]{--row-sort-order--before:var(--sort-order-none--before, "-")}:host #sort perspective-row[sort-order="asc abs"]{--row-sort-order--before:var(--sort-order-asc-abs--before, "\\21E7")}:host #sort perspective-row[sort-order="desc abs"]{--row-sort-order--before:var(--sort-order-desc-abs--before, "\\21E9")}:host #sort perspective-row[sort-order="col asc"]{--row-sort-order--before:var(--sort-order-col-asc--before, "\\2192")}:host #sort perspective-row[sort-order="col desc"]{--row-sort-order--before:var(--sort-order-col-desc--before, "\\2190")}:host #sort perspective-row[sort-order="col asc abs"]{--row-sort-order--before:var(--sort-order-col-asc-abs--before, "\\21E8")}:host #sort perspective-row[sort-order="col desc abs"]{--row-sort-order--before:var(--sort-order-col-desc-abs--before, "\\21E6")}:host #top_panel perspective-row::after{content:","}:host #top_panel perspective-row:last-child::after{display:none;content:""!important}:host label{white-space:nowrap;display:inline-block;vertical-align:middle;margin-bottom:0}:host #drop_target{position:absolute;left:0;top:0;right:0;bottom:0;padding:30px}:host #drop_target_inner{width:100%;height:100%;display:flex;align-items:center;justify-content:center}:host #drop_target_inner h3{font-weight:300}:host #config_button{position:absolute;top:0;left:0;opacity:0;display:flex;align-items:center;justify-content:center;transition:opacity .2s ease-out}:host #config_button:hover{color:var(--active--color,inherit)}:host .button{cursor:pointer;font-size:16px;font-weight:400}:host select::-ms-expand{display:none}:host select{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;background:var(--select--background,url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgNC45IDEwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0LjkgMTA7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4KCS5zdDB7ZmlsbDojQUFBQUFBO30KPC9zdHlsZT4KPHRpdGxlPmFycm93czwvdGl0bGU+Cjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMS40LDQuNyAyLjUsMy4yIDMuNSw0LjcgIi8+Cjxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMy41LDUuMyAyLjUsNi44IDEuNCw1LjMgIi8+Cjwvc3ZnPg==) no-repeat 95% 50%);background-color:#fff;color:inherit;border-radius:5px;height:24px;padding:var(--select--padding,0 0 0 6px);font-size:12px;font-family:inherit}:host input{padding:0 10px}:host .centered{display:flex;align-items:center;justify-content:center}:host #top_panel{display:flex;flex-wrap:wrap;justify-content:flex-start;padding:var(--top_panel--padding,5px 0 10px 0);max-width:1000px;z-index:1}:host #side_panel{position:relative;flex:0 0 auto;padding:var(--side_panel--padding,10px 10px 0 11px)}:host #side_panel>div{display:flex}:host #vis_selector_container{min-height:29px;margin-left:var(--column_selector--width,20px);overflow:hidden}:host #vis_selector{flex-grow:1}:host #transpose_button{cursor:pointer;min-width:5px;max-width:5px;flex-grow:0;color:#999;font-family:Arial;font-size:12px}:host #transpose_button:hover{color:var(--active--color,inherit)}:host #resize_bar{position:absolute;top:0;right:0;bottom:0;width:8px;cursor:col-resize}',""])},function(t,e,o){(t.exports=o(8)(!1)).push([t.i,'.psp-text-field{position:relative;background-color:var(--column-drop-container--background,#fff);border-width:0 0 1px;border-style:solid;border-color:var(--inactive--color,#ccc);display:flex;flex-direction:column;justify-content:flex-end;min-height:24px;transition:border-color .3s ease-out}:host(.dragging) .psp-text-field.dropping{border-bottom-width:2px;border-style:solid;border-color:var(--active--color,#1a7da1)}:host(.dragging) .psp-text-field{border-bottom-width:1px;border-style:solid;border-color:var(--active--color,#1a7da1)}.psp-text-field>.psp-text-field__input{border:0;line-height:20px;vertical-align:bottom;padding-bottom:0;display:none}.psp-text-field__input+label{height:var(--column--height,auto);line-height:17px;box-sizing:border-box;color:var(--inactive--color,#ccc);font-weight:400;white-space:nowrap;padding:var(--column-drop-container--padding,0 0 2px 10px);font-size:12px;display:inline-block;transition:font-size .3s,margin .3s}.dropping .psp-text-field__input,.psp-text-field__input:not(:empty){display:block!important}.dropping .psp-text-field__input::after{content:"|";width:0;overflow:visible;margin-top:-1px;position:absolute}.dropping *{pointer-events:none}.dropping .psp-text-field label,.psp-text-field__input:not(:empty)+label{position:absolute;top:0;margin:var(--column-drop-label--margin,0);font-size:var(--column-drop-label--font-size,12px);display:var(--column-drop-label--display,none)}.dropping perspective-row.inserting{border-top:25px solid transparent}.dropping perspective-row.postserting{border-bottom:25px solid transparent}:host perspective-row{height:var(--column--height,21px);--row_draggable-height:var(--column--height, 21px)}:host([row-pivots]) #active_columns perspective-row{height:var(--active-column--height,41px);min-height:var(--active-column--height,41px);--row_draggable-height:var(--active-column--height, 41px);--column_aggregate-display:inline-block;--is_visible--height:var(--active-column-selector--height, auto)}:host{font-family:Arial,sans-serif;background-color:#eee;color:#333}:host #app.columns_horizontal #columns_container{flex-direction:row-reverse}:host #app.columns_horizontal #active_columns,:host #app.columns_horizontal #inactive_columns{display:flex;flex-direction:column;flex:0 1 auto;width:100%}:host #app.columns_horizontal #inactive_columns{flex:1 1 auto}:host #app.columns_horizontal #sub_columns{flex-shrink:1}:host #app.columns_horizontal #sub_columns perspective-row{--column_name-margin:0 25px 0 0}:host #app.columns_horizontal #side_panel #divider{display:none}:host #app.columns_horizontal perspective-computed-column{max-height:none;margin-right:24px}:host perspective-computed-column{--is_visible--before:var(--active-column-selector--content, "\\25CF");--row_draggable-background-color:var(--column--background, white);--row_draggable-border-color:var(--inactive--color, #ccc);--row_draggable-border-width:0 0 1px 0;--row_draggable-overflow:hidden;--column-selector--color:var(--active--color, #999)}:host #side_panel perspective-row{--name-before-display:inline-block;--is_visible-display:inline-block;--row_draggable-padding:0px 10px 0px 0px;--row_close-display:none;--column_name-max-width:180px}:host #top_panel perspective-row{--row_draggable-display:inline-flex;--row-draggable--flex-direction:row;--row-draggable--align-items:center}:host #columns_container{flex-direction:column;height:calc(100% - 29px)}:host #columns_container #active_columns{flex:0 1 auto}:host #columns_container #active_columns perspective-row{margin-bottom:2px;--row_draggable-background-color:var(--column--background, white);--row_draggable-border-color:var(--inactive--color, #ccc);--row_draggable-border-width:0 0 1px 0;--row_draggable-overflow:hidden;--row_draggable--justify-content:space-evenly}:host #columns_container #active_columns perspective-row:last-child{--row_draggable-border-width:var(--row_draggable-border-last-child-width, 0 0 1px 0)}:host #columns_container #active_columns perspective-row[drop-target]{--row_draggable_children-opacity:0}:host #columns_container #active_columns perspective-row.null-column{--row_draggable_children-opacity:0;pointer-events:none}:host #columns_container #active_columns.one_lock perspective-row:first-child,:host #columns_container #active_columns.two_lock perspective-row:first-child{--active--color:#ccc;--is_visible--cursor:normal}:host #columns_container #active_columns.two_lock perspective-row:nth-child(2){--active--color:#ccc;--is_visible--cursor:normal}:host #columns_container #active_columns perspective-row:only-child{--active--color:#ccc;--is_visible--cursor:normal}:host #columns_container #active_columns,:host #columns_container #inactive_columns{border:none!important}:host ul{transition:background-color .2s,border-color .2s;outline:0;border-style:solid;border-color:var(--inactive--color,#ccc);font-size:12px;padding:var(--column-drop-container--padding,0 10px 0 10px);border-width:0 0 1px}:host #side_panel #side_panel__actions{display:flex;flex-direction:column;flex-shrink:1000;justify-content:flex-start;position:relative;overflow-y:hidden;width:100%;padding-top:20px;margin:var(--column-container--margin,8px);min-height:36px}:host #side_panel #side_panel__actions button.side_panel-action{align-items:center;align-content:center;background:0 0;border:none;display:flex;flex-direction:row;font-size:12px;padding-right:10px;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host #side_panel #side_panel__actions button.side_panel-action span{margin-left:5px;font-size:15px}:host #side_panel #side_panel__actions button.side_panel-action:hover{cursor:pointer}:host .noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host svg .highcharts-legend-box{fill:none}:host #pivot_chart{background-color:var(--plugin--background,#fff)}:host #drop_target{border:var(--plugin--border,none);background:var(--plugin--background,#fff)}:host #pivot_chart_container{box-shadow:var(--plugin--box-shadow,none)}:host #filters perspective-row{margin:0;--filter_operator-display:inline-block;--filter_operand-display:inline-block}:host .plugin_information{color:var(--warning--color,inherit);display:flex;position:absolute;flex-direction:row;justify-content:flex-start;padding:.5rem;width:100%;z-index:10000;transition:opacity .3s ease-out;opacity:1}:host .plugin_information.hidden{display:none;opacity:0}:host .plugin_information.plugin_information--warning{background:#ffca28}:host .plugin_information .plugin_information__text{font-size:12px;margin-right:.25rem;display:flex;flex-wrap:wrap;align-items:center}:host .plugin_information .plugin_information__text:before{content:var(--overflow_hint--before);font-family:var(--overflow_hint--font-family);color:var(--overflow_hint--color);padding:var(--overflow_hint--padding);font-size:16px}:host .plugin_information .plugin_information__action{font-size:12px;text-decoration:underline;cursor:pointer;margin-right:.25rem}:host .plugin_information .plugin_information__action--close{margin-left:12px;display:inline-flex;font-size:12px;cursor:pointer}:host .plugin_information .plugin_information__actions{margin-left:auto;display:flex;align-items:center;flex-direction:row;justify-content:flex-start}:host .plugin_information .plugin_information--overflow-hint-percent{font-weight:700}:host .plugin_information .plugin_information--overflow-hint{white-space:nowrap}:host #drop_target_inner h3{color:#aaa;font-weight:300}:host #config_button,:host #copy_button,:host #download_button,:host #reset_button{font-weight:400;font-family:var(--button--font-family,Arial);color:var(--inactive--color,#999);font-size:var(--button--font-size,16px);transition:opacity .3s;overflow:hidden}:host #config_button:hover,:host #copy_button:hover,:host #download_button:hover,:host #reset_button:hover{color:var(--active--color,inherit)}:host #config_button:before{font-feature-settings:"liga";content:var(--settings-button--content, "\\1F527")}:host #reset_button:before{font-feature-settings:"liga";content:var(--reset_button--before, "Reset")}:host #close_button:before{font-family:var(--button--font-family,Arial);font-feature-settings:"liga";content:var(--close_button--before, "Close")}:host #download_button:before{font-feature-settings:"liga";content:var(--download_button--before, "Save")}:host #copy_button:before{font-feature-settings:"liga";content:var(--copy_button--before, "Copy")}:host #menubar{display:none;flex-direction:column;padding-top:55px}:host #app.show_menu #menubar{display:flex}:host select{border-radius:0;background-color:var(--select--background-color,#fff);border-style:solid;border-color:var(--inactive--color,#ccc);border-width:0 0 1px}:host select:focus{outline:0}:host input{border-style:solid;border-color:var(--inactive--color,#ccc);border-width:0 0 1px}:host input::placeholder{color:var(--inactive--color,#ccc)}:host option[value=""]{color:#fff!important}:host #app{background-color:inherit}:host ::-webkit-scrollbar,:host ::shadow ::-webkit-scrollbar{width:12px}:host ::-webkit-scrollbar-thumb,:host ::shadow ::-webkit-scrollbar-thumb{background:#ccc}:host ::-webkit-scrollbar-track,:host ::shadow ::-webkit-scrollbar-track{background:0 0}',""])},function(t,e){t.exports=g},function(t,e){t.exports=m},function(t,e){t.exports=f},function(t,e){t.exports=v},function(t,e){t.exports=b},function(t,e){t.exports=y},function(t,e,o){o(3),o(9),o(4);const i="dnd-poly-snapback",n="dnd-poly-dragstart-pending",r="dnd-poly-dragstart-cancel",s=["none","copy","copyLink","copyMove","link","linkMove","move","all"],a=["none","copy","move","link"];const c=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}();function l(t){return t&&t.tagName}function d(t,e,o){void 0===o&&(o=!0),document.addEventListener(t,e,!!c&&{passive:o})}function p(t,e){document.removeEventListener(t,e)}function u(t,e,o,i){void 0===i&&(i=!1);const n=c?{passive:!0,capture:i}:i;return t.addEventListener(e,o,n),{off:function(){t.removeEventListener(e,o,n)}}}function _(t){return 0===t.length?0:t.reduce((function(t,e){return e+t}),0)/t.length}function h(t,e){for(let o=0;o<t.changedTouches.length;o++){if(t.changedTouches[o].identifier===e)return!0}return!1}function g(t,e,o){const i=[],n=[];for(let o=0;o<e.touches.length;o++){const r=e.touches[o];i.push(r[t+"X"]),n.push(r[t+"Y"])}o.x=_(i),o.y=_(n)}const m=["","-webkit-"];function f(t,e,o,i,n){void 0===n&&(n=!0);let r=e.x,s=e.y;i&&(r+=i.x,s+=i.y),n&&(r-=parseInt(t.offsetWidth,10)/2,s-=parseInt(t.offsetHeight,10)/2);const a="translate3d("+r+"px,"+s+"px, 0)";for(let e=0;e<m.length;e++){const i=m[e]+"transform";t.style[i]=a+" "+o[e]}}const v=function(){function t(t,e){this._dataStore=t,this._setDragImageHandler=e,this._dropEffect=a[0]}return Object.defineProperty(t.prototype,"dropEffect",{get:function(){return this._dropEffect},set:function(t){0!==this._dataStore.mode&&s.indexOf(t)>-1&&(this._dropEffect=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"types",{get:function(){if(0!==this._dataStore.mode)return Object.freeze(this._dataStore.types)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"effectAllowed",{get:function(){return this._dataStore.effectAllowed},set:function(t){2===this._dataStore.mode&&s.indexOf(t)>-1&&(this._dataStore.effectAllowed=t)},enumerable:!0,configurable:!0}),t.prototype.setData=function(t,e){if(2===this._dataStore.mode){if(t.indexOf(" ")>-1)throw new Error("illegal arg: type contains space");this._dataStore.data[t]=e,-1===this._dataStore.types.indexOf(t)&&this._dataStore.types.push(t)}},t.prototype.getData=function(t){if(1===this._dataStore.mode||2===this._dataStore.mode)return this._dataStore.data[t]||""},t.prototype.clearData=function(t){if(2===this._dataStore.mode){if(t&&this._dataStore.data[t]){delete this._dataStore.data[t];const e=this._dataStore.types.indexOf(t);return void(e>-1&&this._dataStore.types.splice(e,1))}this._dataStore.data={},this._dataStore.types=[]}},t.prototype.setDragImage=function(t,e,o){2===this._dataStore.mode&&this._setDragImageHandler(t,e,o)},t}();function b(t,e){return t?t===s[0]?a[0]:0===t.indexOf(s[1])||t===s[7]?a[1]:0===t.indexOf(s[4])?a[3]:t===s[6]?a[2]:a[1]:3===e.nodeType&&"A"===e.tagName?a[3]:a[1]}function y(t,e,o,i,n,r,s){void 0===r&&(r=!0),void 0===s&&(s=null),console.log("dnd-poly: dispatching "+t);const a=function(t,e,o,i,n,r,s){void 0===s&&(s=null);const a=e.changedTouches[0],c=new Event(o,{bubbles:!0,cancelable:i});c.dataTransfer=r,c.relatedTarget=s,c.screenX=a.screenX,c.screenY=a.screenY,c.clientX=a.clientX,c.clientY=a.clientY,c.pageX=a.pageX,c.pageY=a.pageY;const l=t.getBoundingClientRect();return c.offsetX=c.clientX-l.left,c.offsetY=c.clientY-l.top,c}(e,o,t,r,document.defaultView,n,s),c=!e.dispatchEvent(a);return i.mode=0,c}function w(t,e){if(!t||t===s[7])return e;if(e===a[1]){if(0===t.indexOf(a[1]))return a[1]}else if(e===a[3]){if(0===t.indexOf(a[3])||t.indexOf("Link")>-1)return a[3]}else if(e===a[2]&&(0===t.indexOf(a[2])||t.indexOf("Move")>-1))return a[2];return a[0]}const x=function(){function t(t,e,o,i){this._initialEvent=t,this._config=e,this._sourceNode=o,this._dragOperationEndedCb=i,this._dragOperationState=0,this._immediateUserSelection=null,this._currentDropTarget=null,console.log("dnd-poly: setting up potential drag operation.."),this._lastTouchEvent=t,this._initialTouch=t.changedTouches[0],this._touchMoveHandler=this._onTouchMove.bind(this),this._touchEndOrCancelHandler=this._onTouchEndOrCancel.bind(this),d("touchmove",this._touchMoveHandler,!1),d("touchend",this._touchEndOrCancelHandler,!1),d("touchcancel",this._touchEndOrCancelHandler,!1)}return t.prototype._setup=function(){const t=this;console.log("dnd-poly: starting drag and drop operation"),this._dragOperationState=1,this._currentDragOperation=a[0],this._dragDataStore={data:{},effectAllowed:void 0,mode:3,types:[]},this._currentHotspotCoordinates={x:null,y:null},this._dragImagePageCoordinates={x:null,y:null};let e=this._sourceNode;if(this._dataTransfer=new v(this._dragDataStore,(function(o,i,n){e=o,"number"!=typeof i&&"number"!=typeof n||(t._dragImageOffset={x:i||0,y:n||0})})),this._dragDataStore.mode=2,this._dataTransfer.dropEffect=a[0],y("dragstart",this._sourceNode,this._lastTouchEvent,this._dragDataStore,this._dataTransfer))return console.log("dnd-poly: dragstart cancelled"),this._dragOperationState=3,this._cleanup(),!1;g("page",this._lastTouchEvent,this._dragImagePageCoordinates);const o=this._config.dragImageSetup(e);var i;if(this._dragImageTransforms=(i=o,m.map((function(t){const e=i.style[t+"transform"];return e&&"none"!==e?e.replace(/translate\(\D*\d+[^,]*,\D*\d+[^,]*\)\s*/g,""):""}))),o.style.position="absolute",o.style.left="0px",o.style.top="0px",o.style.zIndex="999999",o.classList.add("dnd-poly-drag-image"),o.classList.add("dnd-poly-icon"),this._dragImage=o,!this._dragImageOffset)if(this._config.dragImageOffset)this._dragImageOffset={x:this._config.dragImageOffset.x,y:this._config.dragImageOffset.y};else if(this._config.dragImageCenterOnTouch){const t=getComputedStyle(e);this._dragImageOffset={x:0-parseInt(t.marginLeft,10),y:0-parseInt(t.marginTop,10)}}else{const t=e.getBoundingClientRect(),o=getComputedStyle(e);this._dragImageOffset={x:t.left-this._initialTouch.clientX-parseInt(o.marginLeft,10)+t.width/2,y:t.top-this._initialTouch.clientY-parseInt(o.marginTop,10)+t.height/2}}return f(this._dragImage,this._dragImagePageCoordinates,this._dragImageTransforms,this._dragImageOffset,this._config.dragImageCenterOnTouch),document.body.appendChild(this._dragImage),this._iterationIntervalId=window.setInterval((function(){t._iterationLock?console.log("dnd-poly: iteration skipped because previous iteration hast not yet finished."):(t._iterationLock=!0,t._dragAndDropProcessModelIteration(),t._iterationLock=!1)}),this._config.iterationInterval),!0},t.prototype._cleanup=function(){console.log("dnd-poly: cleanup"),this._iterationIntervalId&&(clearInterval(this._iterationIntervalId),this._iterationIntervalId=null),p("touchmove",this._touchMoveHandler),p("touchend",this._touchEndOrCancelHandler),p("touchcancel",this._touchEndOrCancelHandler),this._dragImage&&(this._dragImage.parentNode.removeChild(this._dragImage),this._dragImage=null),this._dragOperationEndedCb(this._config,this._lastTouchEvent,this._dragOperationState)},t.prototype._onTouchMove=function(t){const e=this;if(!1!==h(t,this._initialTouch.identifier)){if(this._lastTouchEvent=t,0===this._dragOperationState){let e=void 0;if(this._config.dragStartConditionOverride)try{e=this._config.dragStartConditionOverride(t)}catch(t){console.error("dnd-poly: error in dragStartConditionOverride hook: "+t),e=!1}else e=1===t.touches.length;return e?void(!0===this._setup()&&(this._initialEvent.preventDefault(),t.preventDefault())):void this._cleanup()}if(console.log("dnd-poly: moving draggable.."),t.preventDefault(),g("client",t,this._currentHotspotCoordinates),g("page",t,this._dragImagePageCoordinates),this._config.dragImageTranslateOverride)try{let o=!1;if(this._config.dragImageTranslateOverride(t,{x:this._currentHotspotCoordinates.x,y:this._currentHotspotCoordinates.y},this._immediateUserSelection,(function(t,i){e._dragImage&&(o=!0,e._currentHotspotCoordinates.x+=t,e._currentHotspotCoordinates.y+=i,e._dragImagePageCoordinates.x+=t,e._dragImagePageCoordinates.y+=i,f(e._dragImage,e._dragImagePageCoordinates,e._dragImageTransforms,e._dragImageOffset,e._config.dragImageCenterOnTouch))})),o)return}catch(t){console.log("dnd-poly: error in dragImageTranslateOverride hook: "+t)}f(this._dragImage,this._dragImagePageCoordinates,this._dragImageTransforms,this._dragImageOffset,this._config.dragImageCenterOnTouch)}},t.prototype._onTouchEndOrCancel=function(t){if(!1!==h(t,this._initialTouch.identifier)){if(this._config.dragImageTranslateOverride)try{this._config.dragImageTranslateOverride(void 0,void 0,void 0,(function(){}))}catch(t){console.log("dnd-poly: error in dragImageTranslateOverride hook: "+t)}0!==this._dragOperationState?(t.preventDefault(),this._dragOperationState="touchcancel"===t.type?3:2):this._cleanup()}},t.prototype._dragAndDropProcessModelIteration=function(){const t=this,e=this._currentDragOperation;this._dragDataStore.mode=3,this._dataTransfer.dropEffect=a[0];const o=y("drag",this._sourceNode,this._lastTouchEvent,this._dragDataStore,this._dataTransfer);if(o&&(console.log("dnd-poly: drag event cancelled."),this._currentDragOperation=a[0]),o||2===this._dragOperationState||3===this._dragOperationState){return this._dragOperationEnded(this._dragOperationState)?void function(t,e,o,n){const r=getComputedStyle(t);if("hidden"===r.visibility||"none"===r.display)return console.log("dnd-poly: source node is not visible. skipping snapback transition."),void n();e.classList.add(i);const s=getComputedStyle(e),a=parseFloat(s.transitionDuration);if(isNaN(a)||0===a)return console.log("dnd-poly: no transition used - skipping snapback"),void n();console.log("dnd-poly: starting dragimage snap back");const c=t.getBoundingClientRect(),l={x:c.left,y:c.top};l.x+=document.body.scrollLeft||document.documentElement.scrollLeft,l.y+=document.body.scrollTop||document.documentElement.scrollTop,l.x-=parseInt(r.marginLeft,10),l.y-=parseInt(r.marginTop,10);const d=parseFloat(s.transitionDelay),p=Math.round(1e3*(a+d));f(e,l,o,void 0,!1),setTimeout(n,p)}(this._sourceNode,this._dragImage,this._dragImageTransforms,(function(){t._finishDragOperation()})):void this._finishDragOperation()}const n=this._config.elementFromPoint(this._currentHotspotCoordinates.x,this._currentHotspotCoordinates.y);console.log("dnd-poly: new immediate user selection is: "+n);const r=this._currentDropTarget;n!==this._immediateUserSelection&&n!==this._currentDropTarget&&(this._immediateUserSelection=n,null!==this._currentDropTarget&&(this._dragDataStore.mode=3,this._dataTransfer.dropEffect=a[0],y("dragexit",this._currentDropTarget,this._lastTouchEvent,this._dragDataStore,this._dataTransfer,!1)),null===this._immediateUserSelection?(this._currentDropTarget=this._immediateUserSelection,console.log("dnd-poly: current drop target changed to null")):(this._dragDataStore.mode=3,this._dataTransfer.dropEffect=b(this._dragDataStore.effectAllowed,this._sourceNode),y("dragenter",this._immediateUserSelection,this._lastTouchEvent,this._dragDataStore,this._dataTransfer)?(console.log("dnd-poly: dragenter default prevented"),this._currentDropTarget=this._immediateUserSelection,this._currentDragOperation=w(this._dataTransfer.effectAllowed,this._dataTransfer.dropEffect)):this._immediateUserSelection!==document.body&&(this._currentDropTarget=document.body))),r!==this._currentDropTarget&&l(r)&&(console.log("dnd-poly: current drop target changed."),this._dragDataStore.mode=3,this._dataTransfer.dropEffect=a[0],y("dragleave",r,this._lastTouchEvent,this._dragDataStore,this._dataTransfer,!1,this._currentDropTarget)),l(this._currentDropTarget)&&(this._dragDataStore.mode=3,this._dataTransfer.dropEffect=b(this._dragDataStore.effectAllowed,this._sourceNode),!1===y("dragover",this._currentDropTarget,this._lastTouchEvent,this._dragDataStore,this._dataTransfer)?(console.log("dnd-poly: dragover not prevented on possible drop-target."),this._currentDragOperation=a[0]):(console.log("dnd-poly: dragover prevented."),this._currentDragOperation=w(this._dataTransfer.effectAllowed,this._dataTransfer.dropEffect))),console.log("dnd-poly: d'n'd iteration ended. current drag operation: "+this._currentDragOperation),e!==this._currentDragOperation&&this._dragImage.classList.remove("dnd-poly-"+e);const s="dnd-poly-"+this._currentDragOperation;this._dragImage.classList.add(s)},t.prototype._dragOperationEnded=function(t){console.log("dnd-poly: drag operation end detected with "+this._currentDragOperation);const e=this._currentDragOperation===a[0]||null===this._currentDropTarget||3===t;return e?l(this._currentDropTarget)&&(this._dragDataStore.mode=3,this._dataTransfer.dropEffect=a[0],y("dragleave",this._currentDropTarget,this._lastTouchEvent,this._dragDataStore,this._dataTransfer,!1)):l(this._currentDropTarget)&&(this._dragDataStore.mode=1,this._dataTransfer.dropEffect=this._currentDragOperation,!0===y("drop",this._currentDropTarget,this._lastTouchEvent,this._dragDataStore,this._dataTransfer)?this._currentDragOperation=this._dataTransfer.dropEffect:this._currentDragOperation=a[0]),e},t.prototype._finishDragOperation=function(){console.log("dnd-poly: dragimage snap back transition ended"),this._dragDataStore.mode=3,this._dataTransfer.dropEffect=this._currentDragOperation,y("dragend",this._sourceNode,this._lastTouchEvent,this._dragDataStore,this._dataTransfer,!1),this._dragOperationState=2,this._cleanup()},t}(),A={iterationInterval:150,tryFindDraggableTarget:function(t){let e=t.target;do{if(!1!==e.draggable){if(!0===e.draggable)return e;if(e.getAttribute&&"true"===e.getAttribute("draggable"))return e}}while((e=e.parentNode)&&e!==document.body)},dragImageSetup:function(t){const e=t.cloneNode(!0);return function t(e,o){if(1===e.nodeType){const t=getComputedStyle(e);for(let e=0;e<t.length;e++){const i=t[e];o.style.setProperty(i,t.getPropertyValue(i),t.getPropertyPriority(i))}if(o.style.pointerEvents="none",o.removeAttribute("id"),o.removeAttribute("class"),o.removeAttribute("draggable"),"CANVAS"===o.nodeName){const t=e,i=o,n=t.getContext("2d").getImageData(0,0,t.width,t.height);i.getContext("2d").putImageData(n,0,0)}}if(e.hasChildNodes())for(let i=0;i<e.childNodes.length;i++)t(e.childNodes[i],o.childNodes[i])}(t,e),e},elementFromPoint:function(t,e){return document.elementFromPoint(t,e)}};let O;function S(t,e){if(console.log("dnd-poly: global touchstart"),O)return void console.log("dnd-poly: drag operation already active");const o=A.tryFindDraggableTarget(t,e);if(o)try{O=new x(t,A,o,E)}catch(e){throw E(A,t,3),e}else console.log("dnd-poly: no draggable at touchstart coordinates")}function k(t){console.log("dnd-poly: setup delayed dragstart..");const e=t.target,o=t.composedPath(),i=function(t){console.log("dnd-poly: aborting delayed drag because of "+t.type),a.off(),c.off(),l.off(),d.off(),e&&e.dispatchEvent(new CustomEvent(r,{bubbles:!0,cancelable:!0})),clearTimeout(s)};e&&e.dispatchEvent(new CustomEvent(n,{bubbles:!0,cancelable:!0}));const s=window.setTimeout((function(){console.log("dnd-poly: starting delayed drag.."),a.off(),c.off(),l.off(),d.off(),S(t,o)}),A.holdToDrag),a=u(e,"touchend",i),c=u(e,"touchcancel",i),l=u(e,"touchmove",i),d=u(window,"scroll",i,!0)}function E(t,e,o){if(0===o&&(console.log("dnd-poly: Drag never started. Last event was "+e.type),t.defaultActionOverride))try{t.defaultActionOverride(e),e.defaultPrevented&&console.log("dnd-poly: defaultActionOverride has taken care of triggering the default action. preventing default on original event")}catch(t){console.log("dnd-poly: error in defaultActionOverride: "+t)}O=null}!function(t){if(t&&Object.keys(t).forEach((function(e){A[e]=t[e]})),!A.forceApply){const t=function(){const t={dragEvents:"ondragstart"in document.documentElement,draggable:"draggable"in document.documentElement,userAgentSupportingNativeDnD:void 0},e=!!window.chrome||/chrome/i.test(navigator.userAgent);return t.userAgentSupportingNativeDnD=!(/iPad|iPhone|iPod|Android/.test(navigator.userAgent)||e&&"ontouchstart"in document.documentElement),t}();if(t.userAgentSupportingNativeDnD&&t.draggable&&t.dragEvents)return!1}console.log("dnd-poly: Applying mobile drag and drop polyfill."),A.holdToDrag?(console.log("dnd-poly: holdToDrag set to "+A.holdToDrag),d("touchstart",k,!1)):d("touchstart",S,!1)}({tryFindDraggableTarget:function(t,e){const o=e||t.composedPath();for(let t of o){let e=t;do{if(!1!==e.draggable&&e.getAttribute&&"true"===e.getAttribute("draggable"))return e}while((e=e.parentNode)&&e!==document.body)}},elementFromPoint:function(t,e){for(let o of this._path)if(o.elementFromPoint){let i=o.elementFromPoint(t,e);if(i){for(;i.shadowRoot;)i=i.shadowRoot.elementFromPoint(t,e);return i}}},dragStartConditionOverride:function(t){return this._path=t.composedPath(),!0},holdToDrag:500})},function(t,e){t.exports=w},function(t,e){t.exports=x},function(t,e){t.exports=A},function(t,e){t.exports=O},function(t,e){t.exports=S},function(t,e){t.exports=k},function(t,e,o){"use strict";o.r(e);o(3),o(14),o(28),o(7),o(9),o(15),o(29),o(30),o(4),o(31),o(32),o(33);var i=o(1),n=o(5),r=(o(34),o(11),o(18)),s=o.n(r);class a{constructor(){this.edit=!1,this.column_name=void 0,this.computation=void 0,this.input_columns=[],this.swap_target=!1,this.name_edited=!1,this.computed_function_name=""}is_valid(){const t=s()(this);return!t.includes(null)&&!t.includes(void 0)&&!t.includes("")&&this.input_columns.length===this.computation.num_params}}o(17),o(10);const c=Symbol("formatter");class l{constructor(t,e,o,i,n,r,s=1){this.category=r,this.name=t,this[c]=e,this.input_type=o,this.return_type=i,this.func=n.toString(),this.num_params=s}}var d=o(19),p=o.n(d),u=o(20),_=o.n(u);function h(t){if(0==this._active_columns.children.length)return 0;{let o=!1;for(let i in this._active_columns.children){var e;let n=this._active_columns.children[i];if(o=o||(null==n?void 0:null===(e=n.classList)||void 0===e?void 0:e.contains("null-column")),n.offsetTop+n.offsetHeight>t.offsetY+this._active_columns.scrollTop)return parseInt(i)}let i=this._active_columns.children.length;return o&&i--,i}}function g(t){let e=t.target.getRootNode().host,o=e;o="PERSPECTIVE-VIEWER"===o.tagName?t.target.parentElement:e.parentElement;let i=Array.prototype.slice.call(o.children).indexOf("PERSPECTIVE-ROW"===e.tagName?e:t.target),n=o.getAttribute("for");if(this.hasAttribute(n)){let t=JSON.parse(this.getAttribute(n));t.splice(i,1),0===t.length?this.removeAttribute(n):this.setAttribute(n,JSON.stringify(t))}}function m(t){t.preventDefault(),t.currentTarget.classList.remove("dropping"),this._drop_target_hover&&this._drop_target_hover.removeAttribute("drop-target");let e=t.dataTransfer.getData("text");if(!e)return;e=JSON.parse(e);let o=t.currentTarget.querySelector("ul").getAttribute("for")||t.currentTarget.getAttribute("id").replace("_","-"),i=JSON.parse(this.getAttribute(o)||"[]"),n=i.indexOf(e[0]);-1!==n&&i.splice(n,1);const r=o.indexOf("filter")>-1;if(r?this.setAttribute(o,JSON.stringify(i.concat([e]))):o.indexOf("sort")>-1?this.setAttribute(o,JSON.stringify(i.concat([[e[0]]]))):this.setAttribute(o,JSON.stringify(i.concat([e[0]]))),"pivots"===this._plugin.deselectMode&&this._get_visible_column_count()>1&&"sort"!==o&&!r){for(let t of this.shadowRoot.querySelectorAll("#active_columns perspective-row"))if(t.getAttribute("name")===e[0]){this._active_columns.removeChild(t);break}this._update_column_view()}this._debounce_update()}function f(t){let e=t.target.parentElement.parentElement;Array.prototype.slice(this._active_columns.children).indexOf(e)>-1&&this._get_visible_column_count()>1&&"move"!==t.dataTransfer.dropEffect&&(this._active_columns.removeChild(e),this._update_column_view()),this._active_columns.classList.remove("dropping")}function v(t){let e=t.relatedTarget;for(;e&&e!==this._active_columns;)e=e.parentElement;null===e&&(this._active_columns.classList.remove("dropping"),this._drop_target_null&&(this._active_columns.replaceChild(this._drop_target_null,this._drop_target_hover),delete this._drop_target_null),this._drop_target_hover.parentElement===this._active_columns&&this._active_columns.removeChild(this._drop_target_hover),-1!==this._original_index&&this._active_columns.insertBefore(this._drop_target_hover,this._active_columns.children[this._original_index]),this._drop_target_hover.removeAttribute("drop-target"))}function b(){this._drop_target_null&&(this._drop_target_null.parentElement===this._active_columns?Object(i.e)(this._active_columns,this._drop_target_hover,this._drop_target_null):this._active_columns.replaceChild(this._drop_target_null,this._drop_target_hover),delete this._drop_target_null)}function y(t){b.call(this),this._active_columns.children[t]&&this._drop_target_hover!==this._active_columns.children[t]&&(this._drop_target_null=this._active_columns.children[t],Object(i.e)(this._active_columns,this._active_columns.children[t],this._drop_target_hover))}function w(t){b.call(this),this._active_columns.children[t]&&(this._drop_target_null=this._active_columns.children[t],this._active_columns.replaceChild(this._drop_target_hover,this._active_columns.children[t]))}function x(t){var e,o,n,r,s,a,c,l;t.preventDefault(),t.dataTransfer.dropEffect="move","dropping"!==t.currentTarget.className&&t.currentTarget.classList.add("dropping"),this._drop_target_hover.hasAttribute("drop-target")||this._drop_target_hover.toggleAttribute("drop-target",!0);let d=h.call(this,t);const p=Array.prototype.slice.call(this._active_columns.children).indexOf(this._drop_target_hover),u=this._active_columns.children[d],_=d<(null===(e=this._plugin.initial)||void 0===e?void 0:null===(o=e.names)||void 0===o?void 0:o.length)-1,g=this._drop_target_hover!==this._active_columns.children[d],m=-1!==this._original_index,f=m&&this._original_index<(null===(n=this._plugin.initial)||void 0===n?void 0:null===(r=n.names)||void 0===r?void 0:r.length)-1,v=m&&this._original_index>=(null===(s=this._plugin.initial)||void 0===s?void 0:null===(a=s.names)||void 0===a?void 0:a.length)-1,x=m&&this._original_index<(null===(c=this._plugin.initial)||void 0===c?void 0:c.count),A=!(d<(null===(l=this._plugin.initial)||void 0===l?void 0:l.count))&&(null==u?void 0:u.classList.contains("null-column"));if(x&&A)b.call(this);else if(_&&v&&g){var O,S,k,E,j;b.call(this),this._original_index===(null===(O=this._plugin.initial)||void 0===O?void 0:null===(S=O.names)||void 0===S?void 0:S.length)-1&&this._drop_target_hover===this._active_columns.children[this._original_index]&&this._active_columns.children.length===(null===(k=this._plugin.initial)||void 0===k?void 0:null===(E=k.names)||void 0===E?void 0:E.length)?(this._drop_target_null=this._active_columns.children[d],Object(i.e)(this._active_columns,this._active_columns.children[d],this._drop_target_hover)):(null===(j=this._active_columns.children[d])||void 0===j?void 0:j.classList.contains("null-column"))?this._drop_target_hover!==this._active_columns.children[d]&&(this._drop_target_null=this._active_columns.children[d],this._active_columns.replaceChild(this._drop_target_hover,this._active_columns.children[d])):(this._drop_target_null=this._active_columns.children[d],this._active_columns.replaceChild(this._drop_target_hover,this._active_columns.children[d]),this._active_columns.insertBefore(this._drop_target_null,this._active_columns.children[this._original_index]))}else _&&m&&g?y.call(this,d):_&&!m&&g?w.call(this,d):!_&&f&&g?y.call(this,d):A&&m?y.call(this,d):A&&!m?w.call(this,d):p<d?d+1<this._active_columns.children.length?this._active_columns.children[d+1].hasAttribute("drop-target")||(b.call(this),this._active_columns.insertBefore(this._drop_target_hover,this._active_columns.children[d+1])):this._active_columns.children[this._active_columns.children.length-1].hasAttribute("drop-target")||(b.call(this),this._active_columns.appendChild(this._drop_target_hover)):d<this._active_columns.children.length?this._active_columns.children[d].hasAttribute("drop-target")||(b.call(this),this._active_columns.insertBefore(this._drop_target_hover,this._active_columns.children[d])):this._active_columns.children[this._active_columns.children.length-1].hasAttribute("drop-target")||(b.call(this),this._active_columns.appendChild(this._drop_target_hover))}function A(t){t.preventDefault(),delete this._drop_target_null,t.currentTarget.classList.remove("dropping"),this._drop_target_hover.parentElement===this._active_columns&&this._drop_target_hover.removeAttribute("drop-target"),t.dataTransfer.getData("text")&&this._update_column_view()}function O(t){t.stopPropagation(),t.preventDefault(),t.currentTarget.classList.add("dropping")}function S(t){t.stopPropagation(),t.preventDefault(),t.currentTarget.classList.add("dropping"),t.dataTransfer.dropEffect="move"}function k(t){t.currentTarget==t.target&&(t.stopPropagation(),t.preventDefault(),t.currentTarget.classList.remove("dropping"))}var E,j=o(0);function T(){const t=I(["\n <optgroup label=",">","</optgroup>\n "]);return T=function(){return t},t}function L(){const t=I(["\n <option value=",">","</option>\n "]);return L=function(){return t},t}function I(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function z(){return Reflect.construct(HTMLElement,[],this.__proto__.constructor)}Object.setPrototypeOf(z.prototype,HTMLElement.prototype),Object.setPrototypeOf(z,HTMLElement);const D={hour_of_day:new l("Hour of Day",t=>"hour_of_day(".concat(t,")"),"datetime","integer",(function(t){return new Date(t).getHours()}),["Time"]),day_of_week:new l("Day of Week",t=>"day_of_week(".concat(t,")"),"datetime","string",(function(t){return["1 Sunday","2 Monday","3 Tuesday","4 Wednesday","5 Thursday","6 Friday","7 Saturday"][new Date(t).getDay()]}),["Time"]),month_of_year:new l("Month of Year",t=>"month_of_year(".concat(t,")"),"datetime","string",(function(t){return["01 January","02 February","03 March","04 April","05 May","06 June","07 July","08 August","09 September","10 October","11 November","12 December"][new Date(t).getMonth()]}),["Time"]),second_bucket:new l("Bucket (s)",t=>"second_bucket(".concat(t,")"),"datetime","datetime",(function(t){return new Date(1e3*Math.floor(new Date(t).getTime()/1e3))}),["Time"]),minute_bucket:new l("Bucket (m)",t=>"minute_bucket(".concat(t,")"),"datetime","datetime",(function(t){let e=new Date(t);return e.setSeconds(0),e.setMilliseconds(0),e}),["Time"]),hour_bucket:new l("Bucket (h)",t=>"hour_bucket(".concat(t,")"),"datetime","datetime",(function(t){let e=new Date(t);return e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}),["Time"]),day_bucket:new l("Bucket (D)",t=>"day_bucket(".concat(t,")"),"datetime","date",(function(t){let e=new Date(t);return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}),["Time"]),week_bucket:new l("Bucket (W)",t=>"week_bucket(".concat(t,")"),"datetime","date",(function(t){let e=new Date(t),o=e.getDay(),i=e.getDate()-o+(0==o?-6:1);return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(i),e}),["Time"]),month_bucket:new l("Bucket (M)",t=>"month_bucket(".concat(t,")"),"datetime","date",(function(t){let e=new Date(t);return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(1),e}),["Time"]),year_bucket:new l("Bucket (Y)",t=>"year_bucket(".concat(t,")"),"datetime","date",(function(t){let e=new Date(t);return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(1),e.setMonth(1),e}),["Time"]),"10_bucket":new l("Bucket (10)",t=>"bin10(".concat(t,")"),"float","float",t=>10*Math.floor(t/10),["Math"]),"100_bucket":new l("Bucket (100)",t=>"bin100(".concat(t,")"),"float","float",t=>100*Math.floor(t/100),["Math"]),"1000_bucket":new l("Bucket (1000)",t=>"bin1000(".concat(t,")"),"float","float",t=>1e3*Math.floor(t/1e3),["Math"]),"0.1_bucket":new l("Bucket (1/10)",t=>"bin10th(".concat(t,")"),"float","float",t=>.1*Math.floor(t/.1),["Math"]),"0.01_bucket":new l("Bucket (1/100)",t=>"bin100th(".concat(t,")"),"float","float",t=>.01*Math.floor(t/.01),["Math"]),"0.001_bucket":new l("Bucket (1/1000)",t=>"bin1000th(".concat(t,")"),"float","float",t=>.001*Math.floor(t/.001),["Math"]),add:new l("+",(t,e)=>"(".concat(t," + ").concat(e,")"),"float","float",(t,e)=>t+e,["Math"],2),subtract:new l("-",(t,e)=>"(".concat(t," - ").concat(e,")"),"float","float",(t,e)=>t-e,["Math"],2),multiply:new l("*",(t,e)=>"(".concat(t," * ").concat(e,")"),"float","float",(t,e)=>t*e,["Math"],2),divide:new l("/",(t,e)=>"(".concat(t," / ").concat(e,")"),"float","float",(t,e)=>t/e,["Math"],2),invert:new l("1/x",t=>"(1 / ".concat(t,")"),"float","float",t=>1/t,["Math"],1),pow:new l("x^2",t=>"(".concat(t," ^ 2)"),"float","float",t=>Math.pow(t,2),["Math"],1),sqrt:new l("sqrt",t=>"sqrt(".concat(t,")"),"float","float",t=>Math.sqrt(t),["Math"],1),abs:new l("abs",t=>"abs(".concat(t,")"),"float","float",t=>Math.abs(t),["Math"],1),percent_a_of_b:new l("%",(t,e)=>"(".concat(t," %% ").concat(e,")"),"float","float",(t,e)=>t/e*100,["Math"],2),uppercase:new l("Uppercase",t=>"uppercase(".concat(t,")"),"string","string",t=>t.toUpperCase(),["Text"]),lowercase:new l("Lowercase",t=>"lowercase(".concat(t,")"),"string","string",t=>t.toLowerCase(),["Text"]),length:new l("length",t=>"length(".concat(t,")"),"string","integer",t=>t.length,["Text"]),concat_space:new l("concat_space",t=>"concat_space(".concat(t,")"),"string","string",(t,e)=>t+" "+e,["Text"],2),concat_comma:new l("concat_comma",t=>"concat_comma(".concat(t,")"),"string","string",(t,e)=>t+", "+e,["Text"],2)};function C(t,e,o){let i=o;const n=e.category;for(const t of n)i=i[t]=i[t]||{};i[t]=e}function P(){const t={};for(const e in D)C(e,D[e],t);return t}let q=P();Object(i.b)(p.a,_.a)(E=class extends z{constructor(){super(),this.state=new a,this.column_names=[],this.type_markers={float:"123",integer:"123",string:"abc",boolean:"t/f",datetime:"mdy",date:"mdy"}}get computations(){return D}connectedCallback(){this._register_ids(),Object(j.render)(Array.from(this._selector_template()),this._computation_selector),this._register_callbacks(),this._update_computation(null),this._register_inputs()}_register_computations(){q=P(),Object(j.render)(Array.from(this._selector_template()),this._computation_selector)}*_selector_template(t=q){for(const[e,o]of Object.entries(t))o.name?yield Object(j.html)(L(),e,o.name):yield Object(j.html)(T(),e,Array.from(this._selector_template(o)))}_register_inputs(){this._clear_error_messages(),this._disable_save_button(),this._input_columns.innerHTML="";const t=this.state.computation,e=t.input_type;this.state.input_columns=[],this.state.swap_target=!1;for(let o=0;o<t.num_params;o++)this._input_columns.innerHTML+='<div class="psp-cc-computation__input-column"\n data-index="'.concat(o,'"\n drop-target>\n <span class="psp-label__requiredType ').concat(e,'"></span>\n <span class="psp-label__placeholder">Param ').concat(o+1,'</span>\n <div class="psp-cc-computation__drop-target-hover"></div>\n </div>');for(let t of this._input_columns.children)t.addEventListener("drop",this._drop_column.bind(this)),t.addEventListener("dragstart",this._drag_column.bind(this)),t.addEventListener("dragend",this._remove_column.bind(this)),t.addEventListener("dragover",this._hover_column.bind(this)),t.addEventListener("dragleave",this._pass_column.bind(this));this._clear_column_name()}_parse_data_transfer(t){const e=JSON.parse(t);if(e)return{column_name:e[0],column_type:e[3]}}_drag_column(t){this.state.computation.num_params>1&&(this.state.swap_target=t.currentTarget)}_hover_column(t){t.preventDefault(),t.dataTransfer.dropEffect="move";const e=t.currentTarget,o=e.querySelector(".psp-cc-computation__drop-target-hover");"dropping"!==e.className&&e.classList.add("dropping"),o&&!o.hasAttribute("drop-target")&&o.toggleAttribute("drop-target","true"),2===e.children.length&&e.parentNode.insertBefore(o,e.nextSibling)}_drop_column(t){const e=t.currentTarget;t.preventDefault(),e.classList.remove("dropping");const o=void 0!==this.state.swap_target&&e.innerHTML.indexOf("perspective-row")>-1,i=this._parse_data_transfer(t.dataTransfer.getData("text"));if(i){if(o){const o=e.children[0],i=o.getAttribute("name"),n=o.getAttribute("type");t.swapTarget=this.state.swap_target,this._set_input_column(t,i,n),this.state.swap_target=!1,delete t.swapTarget}this._set_input_column(t,i.column_name,i.column_type)}}deselect_column(t){this.state.input_columns=this.state.input_columns.map(e=>e&&e.name===t?void 0:e),this._apply_state(this.state.input_columns,this.state.computation)}_remove_column(t){t.currentTarget.classList.remove("dropping")}_pass_column(t){const e=t.currentTarget,o=e.getBoundingClientRect(),i=t.pageX>=o.left&&t.pageX<=o.right-2,n=t.pageY>=o.top&&t.pageY<=o.bottom-2;if(!(i&&n||null===e||"SPAN"===e.nodeName)){e.classList.remove("dropping");const t=e.querySelector(".psp-cc-computation__drop-target-hover");t&&t.removeAttribute("drop-target")}}_apply_state(t,e,o){this._update_computation(null,this.state.computed_function_name),this.state.input_columns=t;const i=this._input_columns.children;for(let t=0;t<this.state.input_columns.length;t++)void 0!==this.state.input_columns[t]&&this._set_input_column({currentTarget:i[t]},this.state.input_columns[t].name,this.state.input_columns[t].type);this._column_name_input.innerText=o||"",this._set_column_name(),this.state.name_edited=void 0!==o,this.state.is_valid()&&this._enable_save_button()}_set_column_name(){let t=this._column_name_input.innerText;if(0==t.length)return this.state.column_name=void 0,void this._disable_save_button();this.state.column_name=t,this.state.is_valid()&&this._enable_save_button()}_auto_column_name(){if(!this.state.name_edited){if(this.state.input_columns.length>0){let t=[];for(let e of this.state.input_columns)t.push(e.name);this.state.computation[c]?this._column_name_input.innerText=this.state.computation[c].apply(void 0,t):this._column_name_input.innerText="".concat(this.state.computation.name,"(").concat(t.join(", "),")")}else this._column_name_input.innerText="";this._set_column_name()}}_clear_column_name(){this._column_name_input.innerText="",this.state.name_edited=!1,this._set_column_name()}_set_input_column(t,e,o){const i=this.state.computation,n=i.input_type,r=this.state.input_columns;let s;s=t.swapTarget?t.swapTarget:t.currentTarget;const a=Number.parseInt(s.getAttribute("data-index"));if("float"!==n&&"datetime"!==n&&o!==n||"float"===n&&"float"!==o&&"integer"!==o||"datetime"===n&&"datetime"!==o&&"date"!==o)return this._register_inputs(),void s.classList.remove("dropped");s.classList.add("dropped");const c=s.querySelector(".psp-cc-computation__drop-target-hover");c&&c.removeAttribute("drop-target"),s.innerHTML="";const l={name:e,type:o};r[a]=l,this.state.input_columns=r,r.filter(t=>t).length===i.num_params&&this._auto_column_name(),this.dispatchEvent(new CustomEvent("perspective-computed-column-update",{detail:{target:s,column:l}})),this.state.is_valid()&&this._enable_save_button()}_update_computation(t,e){const o=this._computation_selector;e?null==t&&(o.value=e):e=o[o.selectedIndex].value;const i=Object.assign({},D[e]);if(void 0===i)throw"Undefined computation could not be set.";const n=i.num_params,r=i.input_type,s=i.return_type;let a=!0;this.state.computation&&(a=r!==this.state.computation.input_type||n!==this.state.computation.num_params),this._computation_type.innerHTML='<span class="'.concat(s,'">').concat(this.type_markers[s],"</span>"),this.state.computation=i,this.state.computed_function_name=e,a||null===t?(this._register_inputs(),this._clear_column_name()):this._auto_column_name()}_set_error_message(t,e){e&&(e.innerText=t,e.style.display="block")}_clear_error_messages(){this._column_name_error.innerText="",this._column_name_error.style.display="none"}_disable_save_button(){this._save_button.toggleAttribute("disabled",!0)}_enable_save_button(){this._save_button.removeAttribute("disabled")}_save_computed_column(){if(this.state.is_valid()){const t=this.state;if(this.column_names.includes(this.state.column_name))return void this._set_error_message("Column names must be unique.",this._column_name_error);this._clear_error_messages();const e=new CustomEvent("perspective-computed-column-save",{detail:{name:t.column_name,inputs:t.input_columns.map(t=>t.name),func:t.computed_function_name}});this.dispatchEvent(e),this.column_names.push(t.column_name)}}_close_computed_column(){this.style.display="none",this._side_panel_actions.style.display="flex",this.classList.remove("edit"),this._column_name_input.innerText="",this._input_columns.innerHTML="";for(let t of this._input_columns.children)t.classList.remove("dropped");this.state=new a,this._update_computation()}_register_ids(){this._side_panel_actions=this.parentElement.querySelector("#side_panel__actions"),this._close_button=this.shadowRoot.querySelector("#psp-cc__close"),this._column_name_input=this.shadowRoot.querySelector("#psp-cc-name"),this._column_name_error=this.shadowRoot.querySelector("#psp-cc__error--name"),this._computation_selector=this.shadowRoot.querySelector("#psp-cc-computation__select"),this._computation_type=this.shadowRoot.querySelector("#psp-cc-computation__type"),this._input_columns=this.shadowRoot.querySelector("#psp-cc-computation-inputs"),this._save_button=this.shadowRoot.querySelector("#psp-cc-button-save")}_register_callbacks(){this._close_button.addEventListener("click",this._close_computed_column.bind(this)),this._computation_selector.addEventListener("change",this._update_computation.bind(this)),this._column_name_input.addEventListener("dragover",k.bind(this)),this._column_name_input.addEventListener("keyup",t=>{this.state.name_edited=this._column_name_input.innerText&&this._column_name_input.innerText.length>0,this._set_column_name(t)}),this._save_button.addEventListener("click",this._save_computed_column.bind(this))}});o(35),o(36);var N,R=o(12),M=o.n(R),H=o(13),B=o.n(H),J=o(21),W=o.n(J),U=o(6),Z=o.n(U),F=o(2),Y=o(22),G=o.n(Y),X=o(23),K=o.n(X);function V(){const t=tt(["\n "," ","\n "]);return V=function(){return t},t}function Q(){const t=tt(['\n <optgroup label="weighted mean">\n ',"\n </optgroup>\n "]);return Q=function(){return t},t}function $(){const t=tt(['\n <option value="','" data-desc="','">',"</option>\n "]);return $=function(){return t},t}function tt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function et(){return Reflect.construct(HTMLElement,[],this.__proto__.constructor)}Object.setPrototypeOf(et.prototype,HTMLElement.prototype),Object.setPrototypeOf(et,HTMLElement);const ot=document.createElement("span");function it(t,e=0){ot.innerHTML=t,document.body.appendChild(ot);const o="".concat(Math.max(e,ot.offsetWidth)+20,"px");return document.body.removeChild(ot),o}ot.style.visibility="hidden",ot.style.fontFamily="monospace",ot.style.fontSize="12px",ot.style.position="absolute";Object(i.b)(G.a,{toString:()=>K.a+"\n"+W.a})(N=class extends et{set name(t){this.shadowRoot.querySelector("#name").innerHTML=this.getAttribute("name")}_option_template(t,e){return Object(j.html)($(),t,e,e||t)}_select_template(t,e){const o=Z.a[t][e]||[],i=Object(j.html)(Q(),this._weights.map(t=>this._option_template(JSON.stringify(["weighted mean",t]),t)));return Object(j.html)(V(),o.map(t=>this._option_template(t)),"integer"===e||"float"===e?i:j.nothing)}set_weights(t){this._weights=t}set type(t){const e=this.shadowRoot.querySelector("#name"),o=this.getAttribute("type");if(!o)return;const i=Object(F.get_type_config)(o);i.type&&e.classList.add(i.type),e.classList.add(o);const n=this.shadowRoot.querySelector("#column_aggregate"),r=this.shadowRoot.querySelector("#filter_operator");Object(j.render)(this._select_template("TYPE_AGGREGATES",i.type||o),n),Object(j.render)(this._select_template("TYPE_FILTERS",i.type||o),r),this.hasAttribute("aggregate")?this.aggregate=this.getAttribute("aggregate"):this.aggregate=i.aggregate,this.hasAttribute("filter")&&(this.filter=this.getAttribute("filter"));const s=this.shadowRoot.querySelector("#filter_operand");this._callback=t=>this._update_filter(t),s.addEventListener("keyup",this._callback.bind(this))}choices(t){const e=this.shadowRoot.querySelector("#filter_operand"),o=this.shadowRoot.querySelector("#filter_operator"),i=new B.a(e,{label:this.getAttribute("name"),list:t,minChars:0,autoFirst:!0,filter:function(t,e){return B.a.FILTER_CONTAINS(t,e.match(/[^,]*$/)[0])},item:function(t,e){return B.a.ITEM(t,e.match(/[^,]*$/)[0])},replace:function(t){const e=this.input.value.match(/^.+,\s*|/)[0];"in"===o.value||"not in"===o.value?this.input.value=e+t+", ":this.input.value=e+t}});""===e.value&&i.evaluate(),e.focus(),this._filter_operand.addEventListener("focus",()=>{0===e.value.trim().length&&i.evaluate()}),e.addEventListener("awesomplete-selectcomplete",this._callback)}set filter(t){const e=this.shadowRoot.querySelector("#filter_operator"),o=JSON.parse(this.getAttribute("filter"));e.value!==o.operator&&(e.value=o.operator||Object(F.get_type_config)(this.getAttribute("type")).filter_operator),e.style.width=it(e.value);const i=this.shadowRoot.querySelector("#filter_operand"),n=o.operand?o.operand.toString():"";this._initialized||(i.value=n),e.value===Z.a.FILTER_OPERATORS.isNull||e.value===Z.a.FILTER_OPERATORS.isNotNull?i.style.display="none":(i.style.display="inline-block",i.style.width=it(n,30))}set aggregate(t){const e=this.shadowRoot.querySelector("#column_aggregate"),o=this.getAttribute("aggregate");if(e.value!==o&&this.hasAttribute("type")){const t=this.getAttribute("type");e.value=o||Object(F.get_type_config)(t).aggregate}this._blur_agg_dropdown()}set computed_column(t){}_get_computed_data(){const t=JSON.parse(this.getAttribute("computed_column"));return{column_name:t.column_name,input_columns:t.input_columns,input_type:t.input_type,computation:t.computation,type:t.type}}_update_filter(t){const e=this.shadowRoot.querySelector("#filter_operand"),o=this.shadowRoot.querySelector("#filter_operator");let i=e.value;switch(this.getAttribute("type")){case"float":i=parseFloat(i);break;case"integer":i=parseInt(i);break;case"boolean":i=i.toLowerCase().indexOf("true")>-1}o.value!==Z.a.FILTER_OPERATORS.isIn&&o.value!==Z.a.FILTER_OPERATORS.isNotIn||(i=i.split(",").map(t=>t.trim())),this.setAttribute("filter",JSON.stringify({operator:o.value,operand:i})),this.dispatchEvent(new CustomEvent("filter-selected",{detail:t}))}_set_data_transfer(t){if(this.hasAttribute("filter")){const{operator:e,operand:o}=JSON.parse(this.getAttribute("filter"));t.dataTransfer.setData("text",JSON.stringify([this.getAttribute("name"),e,o,this.getAttribute("type"),this.getAttribute("aggregate")]))}else t.dataTransfer.setData("text",JSON.stringify([this.getAttribute("name"),Object(F.get_type_config)(this.getAttribute("type")).filter_operator,void 0,this.getAttribute("type"),this.getAttribute("aggregate")]));this.dispatchEvent(new CustomEvent("row-drag"))}_register_ids(){this._li=this.shadowRoot.querySelector(".row_draggable"),this._visible=this.shadowRoot.querySelector(".is_visible"),this._row_close=this.shadowRoot.querySelector("#row_close"),this._agg_dropdown=this.shadowRoot.querySelector("#column_aggregate"),this._sort_order=this.shadowRoot.querySelector("#sort_order"),this._filter_operand=this.shadowRoot.querySelector("#filter_operand"),this._filter_operator=this.shadowRoot.querySelector("#filter_operator"),this._edit_computed_column_button=this.shadowRoot.querySelector("#row_edit"),this._column_aggregate_category=this.shadowRoot.querySelector("#column_aggregate_category")}_blur_agg_dropdown(){if(this._agg_dropdown.blur(),"["===this._agg_dropdown.value[0])for(const t of this._agg_dropdown.querySelectorAll("optgroup option")){const e=t.getAttribute("data-desc");t.innerHTML="mean by ".concat(e)}}_focus_agg_dropdown(){for(const t of this._agg_dropdown.querySelectorAll("optgroup option")){const e=t.getAttribute("data-desc");t.innerHTML="by ".concat(e)}}_register_callbacks(){this._li.addEventListener("dragstart",this._set_data_transfer.bind(this)),this._li.addEventListener("dragend",()=>{this.dispatchEvent(new CustomEvent("row-dragend"))}),this._visible.addEventListener("mousedown",t=>this.dispatchEvent(new CustomEvent("visibility-clicked",{detail:t}))),this._row_close.addEventListener("mousedown",t=>this.dispatchEvent(new CustomEvent("close-clicked",{detail:t}))),this._agg_dropdown.addEventListener("focus",this._focus_agg_dropdown.bind(this)),this._agg_dropdown.addEventListener("change",t=>{this._blur_agg_dropdown();const e=this._agg_dropdown.value;this.setAttribute("aggregate",e),this.dispatchEvent(new CustomEvent("aggregate-selected",{detail:t}))}),this._sort_order.addEventListener("click",t=>{this.dispatchEvent(new CustomEvent("sort-order",{detail:t}))});const t=M()(t=>this._update_filter(t),50);this._filter_operator.addEventListener("change",()=>{this._filter_operand.focus(),this._filter_operator.style.width=it(this._filter_operator.value),this.shadowRoot.querySelector("#filter_operand").style.width=it(""+this._filter_operand.value,30),t()}),this._edit_computed_column_button.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("perspective-computed-column-edit",{bubbles:!0,detail:this._get_computed_data()}))})}connectedCallback(){this._register_ids(),this._register_callbacks()}});var nt=o(24),rt=o.n(nt),st=o(25),at=o.n(st),ct=o(26),lt=o.n(ct),dt=(o(37),o(38),o(39),o(27)),pt=o.n(dt);class ut{constructor(t,e=!1){this._on_cancel=t,this._cancelled=!1,this.initial=e}cancel(){!this._cancelled&&this._on_cancel&&(this._on_cancel(),this._on_cancel=void 0),this._cancelled=!0}get cancelled(){return this._cancelled}}function _t(){return Reflect.construct(HTMLElement,[],this.__proto__.constructor)}Object.setPrototypeOf(_t.prototype,HTMLElement.prototype),Object.setPrototypeOf(_t,HTMLElement);class ht extends _t{get _plugin(){let t=n.b.getInstance(),e=this.getAttribute("plugin");return e||(e=Object.keys(t)[0],this.setAttribute("plugin",e)),t[e]||t[Object.keys(t)[0]]}_get_view_dom_columns(t,e){t=t||"#active_columns perspective-row";let o=Array.prototype.slice.call(this.shadowRoot.querySelectorAll(t));return e?o.map(e).filter(t=>t):o}_get_view_all_columns(){return Array.prototype.slice.call(this.shadowRoot.querySelectorAll("#inactive_columns perspective-row"))}_get_view_active_columns(){return Array.prototype.slice.call(this.shadowRoot.querySelectorAll("#active_columns perspective-row"))}_get_view_active_valid_columns(){return Array.prototype.slice.call(this.shadowRoot.querySelectorAll("#active_columns perspective-row")).filter(t=>!t.classList.contains("null-column"))}_get_view_all_column_names(){return this._get_view_all_columns().map(t=>t.getAttribute("name"))}_get_view_active_column_names(){return this._get_view_active_columns().map(t=>t.getAttribute("name"))}_get_view_all_valid_column_names(){return this._get_view_all_column_names().filter(t=>t)}_get_view_active_valid_column_names(){return this._get_view_active_column_names().filter(t=>t)}_get_view_active_valid_column_count(){return this._get_view_active_valid_column_names().length}_get_view_columns({active:t=!0}={}){let e;return e=t?"#active_columns perspective-row":"#inactive_columns perspective-row",this._get_view_dom_columns(e,t=>t.getAttribute("name"))}_get_view_aggregates(t){return t=t||"#active_columns perspective-row",this._get_view_dom_columns(t,t=>{let e=t.getAttribute("aggregate");if("["===e[0])try{e=JSON.parse(e)}catch(t){console.error(t)}const o=t.getAttribute("name");return o&&{op:e,column:o}})}_get_view_row_pivots(){return this._get_view_dom_columns("#row_pivots perspective-row",t=>t.getAttribute("name"))}_get_view_column_pivots(){return this._get_view_dom_columns("#column_pivots perspective-row",t=>t.getAttribute("name"))}_get_view_filter_nodes(){return this._get_view_dom_columns("#filters perspective-row")}_get_view_filters(){return this._get_view_dom_columns("#filters perspective-row",t=>{let{operator:e,operand:o}=JSON.parse(t.getAttribute("filter"));return[t.getAttribute("name"),e,o]})}_get_view_sorts(){return this._get_view_dom_columns("#sort perspective-row",t=>{let e=t.getAttribute("sort-order")||"asc";return[t.getAttribute("name"),e]})}_get_visible_column_count(){return this._get_view_dom_columns().length}get_aggregate_attribute(){const t=JSON.parse(this.getAttribute("aggregates"))||{},e=new Set,o=Object.keys(t).map(o=>(e.add(o),{column:o,op:t[o]}));if(this._aggregate_defaults)for(const t of Object.keys(this._aggregate_defaults))e.has(t)||o.push({column:t,op:this._aggregate_defaults[t]});return o}}function gt(){const t=yt(["Rendering "," of points."]);return gt=function(){return t},t}function mt(){const t=yt(["Rendering "," of columns."]);return mt=function(){return t},t}function ft(){const t=yt(["Rendering "," of columns and "," of points."]);return ft=function(){return t},t}function vt(){const t=yt(['\n <span style="white-space:nowrap">',"</span>\n "]);return vt=function(){return t},t}function bt(){const t=yt(['\n <span title="'," / ",'" class="plugin_information--overflow-hint">&nbsp;<span class="plugin_information--overflow-hint-percent">',"%</span>&nbsp;</span>\n "]);return bt=function(){return t},t}function yt(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function wt(t){return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")}let xt={integer:2,string:0,float:3,boolean:4,datetime:1,date:1};const At=t=>(e,o)=>{const i=xt[t[e]],n=xt[t[o]];let r=0;return r=i==n?e.toLowerCase()<o.toLowerCase()?-1:1:i<n?-1:1,r};const Ot=t=>{if(t){const e=wt(t[0]),o=wt(t[1]),i=Math.floor(t[0]/t[1]*100);return Object(j.html)(bt(),e,o,i)}},St=t=>{if(""!==t)return Object(j.html)(vt(),t)},kt=(t,...e)=>t.flatMap((t,o)=>[St(t),Ot(e[o])]).filter(t=>t);class Et extends ht{async _check_recreate_computed_columns(){const t=JSON.parse(this.getAttribute("computed-columns"));if(t.length>0){for(const e of t)await this._create_computed_column({detail:{column_name:e.name,input_columns:e.inputs.map(t=>({name:t})),computation:D[e.func]}});return this._debounce_update({ignore_size_check:!1}),!0}return!1}async _load_table(t,e=!1){this.shadowRoot.querySelector("#app").classList.add("hide_message");const o=this._set_updating();if(this._table&&!e&&this.removeAttribute("computed-columns"),this._clear_state(),this._table=t,this.hasAttribute("computed-columns")&&!e&&await this._check_recreate_computed_columns())return;const[i,n,r]=await Promise.all([t.columns(),t.schema(!0),t.computed_schema()]);this._clear_columns(),this._initial_col_order=i.slice(),this.hasAttribute("columns")||this.setAttribute("columns",JSON.stringify(this._initial_col_order)),i.sort(At(n));const s=this.get_aggregate_attribute();Object.entries(r).forEach(([t,e])=>{s.find(e=>e.column===t)||s.push({column:t,op:e})});const a=i.concat(Object.keys(r)),c=function(t,e,o){const i=new Set,n=[];for(const o of t){const t=e[o.column],r=Object(F.get_type_config)(t);i.add(o.column),r.type||t?(""!==o.op&&-1!==Z.a.TYPE_AGGREGATES[r.type||t].indexOf(o.op)||(o.op=r.aggregate),n.push(o)):console.warn('No column "'.concat(o.column,'" found (specified in aggregates attribute).'))}for(const t of o)i.has(t)||n.push({column:t,op:Object(F.get_type_config)(e[t]).aggregate});return n}(s,n,a);let l=JSON.parse(this.getAttribute("columns"));0===l.filter(t=>a.indexOf(t)>-1).length&&(l=this._initial_col_order),this._aggregate_defaults=function(t,e){const o={};for(const i of e)o[i]=Object(F.get_type_config)(t[i]).aggregate;return o}(n,a);for(const t of a){const e=c.find(e=>e.column===t).op,o=this._new_row(t,n[t],e,null,null,r[t]);this._inactive_columns.appendChild(o),l.includes(t)&&o.classList.add("active")}for(;l.length<(null===(d=this._plugin.initial)||void 0===d?void 0:null===(p=d.names)||void 0===p?void 0:p.length);){var d,p;l.push(null)}for(const t of l){const e=this._new_row(t,n[t]);this._active_columns.appendChild(e)}a.length===l.filter(t=>a.indexOf(t)>-1).length?this._inactive_columns.parentElement.classList.add("collapse"):this._inactive_columns.parentElement.classList.remove("collapse"),this._show_column_container(),!0===await this._table.compute()&&this._show_side_panel_actions(),this.hasAttribute("filters")&&(this.filters=this.getAttribute("filters"));try{await this._debounce_update({force_update:!0})}catch(t){throw console.warn("Initial view failed, resetting UI state"),await this.reset(),t}o()}async get_maxes(){let t,e;const[o,i]=await Promise.all([this._view.schema(),this._view.num_columns()]),n=Object.keys(o||{}).length||1;if(void 0!==this._plugin.max_columns){const e=this._plugin.max_columns%n,o=this._plugin.max_columns+e;t=o<i?o:void 0}return void 0!==this._plugin.max_cells&&(e=Math.ceil(t?this._plugin.max_cells/t:this._plugin.max_cells/(i||1))),{max_cols:t,max_rows:e}}async _warn_render_size_exceeded(t,e){if(this._show_warnings&&(t||e)){const o=await this._view.num_columns(),i=await this._view.num_rows(),n=o*i,r=t&&t<o,s=e&&e<i;if(r&&s){this._plugin_information.classList.remove("hidden");const i=kt(ft(),[t,o],[o*e,n]);return Object(j.render)(i,this._plugin_information_message),!0}if(r){this._plugin_information.classList.remove("hidden");const e=kt(mt(),[t,o]);return Object(j.render)(e,this._plugin_information_message),!0}if(s){this._plugin_information.classList.remove("hidden");const t=kt(gt(),[o*e,n]);return Object(j.render)(t,this._plugin_information_message),!0}this._plugin_information.classList.add("hidden")}return!1}_calculate_throttle_timeout(){let t;const e=this.getAttribute("throttle");if(void 0!==e&&"null"!==e&&this.hasAttribute("throttle")){if(t=parseInt(e),isNaN(t)||t<0)return console.warn('Bad throttle attribute value "'.concat(e,'". Can be (non-negative integer) milliseconds.')),this.removeAttribute("throttle"),0}else{if(!this.__render_times||this.__render_times.length<5)return 0;t=this.__render_times.reduce((t,e)=>t+e,0)/this.__render_times.length,t=Math.min(5e3,t)}return Math.max(0,t)}_view_on_update(t){this._debounced||(this._debounced=setTimeout(async()=>{this._debounced=void 0;const e=this._render_time();this._task&&!this._task.initial&&this._task.cancel();const o=this._task=new ut,i=this._plugin.update||this._plugin.create;try{if(t){const{max_cols:t,max_rows:e}=await this.get_maxes();o.cancelled||(await this._warn_render_size_exceeded(t,e),await i.call(this,this._datavis,this._view,o,t,e))}else await i.call(this,this._datavis,this._view,o);e(),o.cancel()}catch(t){console.error("Error rendering plugin.",t)}finally{this.dispatchEvent(new Event("perspective-view-update"))}},this._calculate_throttle_timeout()))}async _validate_filters(){const t=[];for(const e of this._get_view_filter_nodes()){const o=e.shadowRoot.getElementById("filter_operand"),i=e.shadowRoot.getElementById("row_exclamation"),{operator:n,operand:r}=JSON.parse(e.getAttribute("filter")),s=[e.getAttribute("name"),n,r];await this._table.is_valid_filter(s)?(t.push(s),e.title="",o.style.borderColor="",i.hidden=!0):(e.title="Invalid Filter",o.style.borderColor="red",i.hidden=!1)}return t}_is_config_changed(t){const e=this.getAttribute("plugin");return(!pt()(t,this._previous_config)||e!==this._previous_plugin_name)&&(this._previous_config=t,this._previous_plugin_name=e,!0)}async _new_view({force_update:t=!1,ignore_size_check:e=!1,limit_points:o=!0}={}){if(!this._table)return;this._check_responsive_layout();const i=this._get_view_row_pivots(),n=this._get_view_column_pivots(),r=await this._validate_filters(),s=this._get_view_aggregates();if(0===s.length)return;const a=this._get_view_sorts();let c=s.map(t=>t.column),l={};for(const t of s)l[t.column]=t.op;for(const t of a){const e=t[0];if(-1===c.indexOf(e)&&!(n.indexOf(t)>-1||i.indexOf(t)>-1)){const t=this.get_aggregate_attribute(),{column:o,op:i}=t.reduce((t,o)=>o.column===e?o:t);l[o]=i}}const d={filter:r,row_pivots:i,column_pivots:n,aggregates:l,columns:c,sort:a};this._view&&(this._view.remove_update(this._view_updater),this._view.delete(),this._view=void 0);try{this._view=this._table.view(d),this._view_updater=()=>this._view_on_update(o),this._view.on_update(this._view_updater)}catch(t){throw this._view.delete(),t}const p=this._render_time();this._render_count=(this._render_count||0)+1,this._task&&this._task.cancel();const u=this._task=new ut(()=>this._render_count--,!0);try{const{max_cols:i,max_rows:n}=await this.get_maxes();e||await this._warn_render_size_exceeded(i,n),o?await this._plugin.create.call(this,this._datavis,this._view,u,i,n,t):await this._plugin.create.call(this,this._datavis,this._view,u,void 0,void 0,t)}catch(t){console.warn(t)}finally{this.__render_times||(this.__render_times=[],this.dispatchEvent(new Event("perspective-view-update"))),p(),u.cancel(),0===this._render_count&&(this.removeAttribute("updating"),this.dispatchEvent(new Event("perspective-update-complete")))}}_check_loaded_table(){if(this._table){const t=this._table;delete this._table,this._load_table(t)}}_render_time(){const t=performance.now();return()=>{this.__render_times.unshift(performance.now()-t),this.__render_times=this.__render_times.slice(0,5)}}_restyle_plugin(){if(this._plugin.styleElement){const t=this._task=new ut;this._plugin.styleElement.call(this,this._datavis,this._view,t)}}_clear_state(t=!0){this._task&&this._task.cancel();const e=[];if(this._view){const t=this._view;this._view=void 0,e.push(t.delete()),t.remove_update(this._view_updater),t.remove_delete()}if(this._table&&t){const t=this._table;this._table=void 0,t._owner_viewer&&t._owner_viewer===this&&e.push(t.delete())}return Promise.all(e)}_set_updating(){let t;return this.toggleAttribute("updating",!0),this._updating_promise=new Promise(e=>{t=e}),t}_register_debounce_instance(){const t=M()((t,e,o,i)=>{this._new_view({ignore_size_check:e,force_update:o,limit_points:i}).then(t)},0);this._debounce_update=async({force_update:e=!1,ignore_size_check:o=!1,limit_points:i=!0}={})=>{if(this._table){let n=this._set_updating();await new Promise(n=>t(n,o,e,i)),n()}}}_get_worker(){return this._table?this._table._worker:Z.a.shared_worker()}}function jt(){const t=function(t,e){e||(e=t.slice(0));return Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}(['\n <option value="','">',"</option>\n "]);return jt=function(){return t},t}const Tt=t=>{const e=[];for(name in t)e.push(Object(j.html)(jt(),name,t[name].name||name));return e};class Lt extends Et{_clear_columns(){this._inactive_columns.innerHTML="",this._active_columns.innerHTML=""}set_aggregate_attribute(t){let e=!1,o=t.reduce((t,o)=>(this._aggregate_defaults[o.column]!==o.op&&(t[o.column]=o.op,e=!0),t),{});e?this.setAttribute("aggregates",JSON.stringify(o)):this.removeAttribute("aggregates")}_get_type(t){let e=this._get_view_dom_columns("#inactive_columns perspective-row");if(e.length>0){const o=e.find(e=>e.getAttribute("name")===t);return o?o.getAttribute("type"):"integer"}return""}_set_row_type(t){const e=this._get_view_dom_columns("#inactive_columns perspective-row").filter(t=>"integer"===t.getAttribute("type")||"float"===t.getAttribute("type")).map(t=>t.getAttribute("name"));t.set_weights(e),t.setAttribute("type",this._get_type(t.getAttribute("name")))}_new_row(t,e,o,i,n,r){let s=document.createElement("perspective-row");if(e=e||this._get_type(t),!o){let i=this.get_aggregate_attribute();o=i&&(o=i.find(e=>e.column===t))?o.op:Object(F.get_type_config)(e).aggregate}if(i&&(s.setAttribute("filter",i),"string"===e)){const e=this._table.view({row_pivots:[t],aggregates:{}});e.to_json().then(t=>{s.choices(this._autocomplete_choices(t))}),e.delete()}n?s.setAttribute("sort-order",n):this._get_view_column_pivots().indexOf(t)>-1?s.setAttribute("sort-order","col asc"):s.setAttribute("sort-order","asc");const a=this._get_view_dom_columns("#inactive_columns perspective-row").filter(t=>"integer"===t.getAttribute("type")||"float"===t.getAttribute("type")).map(t=>t.getAttribute("name"));return s.set_weights(a),null===t?s.classList.add("null-column"):(s.setAttribute("type",e),s.setAttribute("name",t)),s.setAttribute("aggregate",Array.isArray(o)?JSON.stringify(o):o),s.addEventListener("visibility-clicked",this._column_visibility_clicked.bind(this)),s.addEventListener("aggregate-selected",this._column_aggregate_clicked.bind(this)),s.addEventListener("filter-selected",this._column_filter_clicked.bind(this)),s.addEventListener("close-clicked",t=>g.call(this,t.detail)),s.addEventListener("sort-order",this._sort_order_clicked.bind(this)),s.addEventListener("row-drag",()=>{this.classList.add("dragging"),this._active_columns.style.overflow="hidden",this._original_index=Array.prototype.slice.call(this._active_columns.children).findIndex(e=>e.getAttribute("name")===t),-1!==this._original_index?(this._drop_target_hover=this._active_columns.children[this._original_index],setTimeout(()=>s.setAttribute("drop-target",!0))):this._drop_target_hover=this._new_row(t,e,o)}),s.addEventListener("row-dragend",()=>{this._active_columns.style.overflow="auto",this.classList.remove("dragging")}),r&&(s.setAttribute("computed_column",JSON.stringify(r)),s.classList.add("computed")),s}_update_column_view(t,e=!1){if(t||(t=this._get_view_active_column_names()),this._plugin.initial&&this._plugin.initial.names)for(;t.length<this._plugin.initial.names.length;)t.push(null);this.setAttribute("columns",JSON.stringify(t));const o=t.filter(t=>null!=t),i=this._get_view_dom_columns("#inactive_columns perspective-row");o.length===i.length?this._inactive_columns.parentElement.classList.add("collapse"):this._inactive_columns.parentElement.classList.remove("collapse"),i.forEach(t=>{-1===o.indexOf(t.getAttribute("name"))?t.classList.remove("active"):t.classList.add("active")}),e&&this._update_column_list(t,this._active_columns,t=>{if(null===t)return this._new_row(null);{const e=i.find(e=>e.getAttribute("name")===t);if(e)return this._new_row(e.getAttribute("name"),e.getAttribute("type"))}})}_update_column_list(t,e,o,i){i=i||((t,e)=>e.getAttribute("name")===t);const n=Array.prototype.slice.call(e.children);for(let r=0,s=0;r<n.length||s<t.length;r++,s++){const a=t[s],c=n[r],l=n[r+1];if(c)if(void 0===a)e.removeChild(c);else if(i(a,c))this._set_row_type(c);else if(c.classList.contains("null-column")){const t=o(a);t&&e.replaceChild(t,c)}else if(l&&i(a,l))e.removeChild(c),r++;else{const t=o(a);t&&(e.insertBefore(t,c),r--)}else{const t=o(a);t&&e.appendChild(t)}}}_set_row_styles(){let t="";if(this._plugin.initial&&this._plugin.initial.names)for(const e in this._plugin.initial.names){const o=this._plugin.initial.names[e];t+="#active_columns perspective-row:nth-child(".concat(parseInt(e)+1,"){margin-top:23px;}"),t+="#active_columns perspective-row:nth-child(".concat(parseInt(e)+1,'):before{content:"').concat(o,'";}')}this.shadowRoot.querySelector("#psp_styles").innerHTML=t}_show_column_container(){this.shadowRoot.querySelector("#columns_container").style.visibility="visible"}_show_side_panel_actions(){this.shadowRoot.querySelector("#side_panel__actions").style.visibility="visible"}_remove_null_columns(t=0){const e=this._get_view_active_columns();for(;++t<e.length;){const o=e[t];o.classList.contains("null-column")&&this.shadowRoot.querySelector("#active_columns").removeChild(o)}}_set_column_defaults(){const t=this._get_view_all_columns(),e=this._get_view_active_valid_columns(),o=this._get_view_active_valid_column_names();if(t.length>0)if(this._plugin.initial){let o=[],i=this._plugin.initial.count||2;this._fill_numeric(e,o),this._fill_numeric(t,o),this._fill_numeric(t,o,!0),o=o.slice(0,i);const n=this._plugin.initial.names;for(;n&&o.length<n.length;)o.push(null);this.setAttribute("columns",JSON.stringify(o))}else"select"===this._plugin.selectMode?this.setAttribute("columns",JSON.stringify([t[0].getAttribute("name")])):(this.setAttribute("columns",JSON.stringify(o)),this._remove_null_columns())}_fill_numeric(t,e,o=!1){for(let i of t){let t=i.getAttribute("type"),n=i.getAttribute("name");(o||["float","integer"].indexOf(t)>-1&&-1===e.indexOf(n))&&e.push(n)}}async _check_responsive_layout(){if(this.shadowRoot){const t=this.shadowRoot.querySelector("#app");if(this.clientHeight<500&&this.clientWidth>600&&this._get_view_columns({active:!1}).length>this._get_view_columns().length){if(!t.classList.contains("columns_horizontal")){const e=this._persisted_side_panel_width;return this._persisted_side_panel_width=this._side_panel.style.width,this._side_panel.style.width=e||"",t.classList.add("columns_horizontal"),!1}return!1}if(t.classList.contains("columns_horizontal")){const e=this.shadowRoot.querySelector("#pivot_chart_container");e.clientWidth,this._side_panel.clientWidth;const o=this._persisted_side_panel_width||e.clientWidth+this._side_panel.clientWidth/2,i=e.clientHeight+50;return await this._pre_resize(o,i,()=>{const e=this._persisted_side_panel_width;this._persisted_side_panel_width=this._side_panel.style.width,this._side_panel.style.width=e||"",t.classList.remove("columns_horizontal")}),!0}}return!1}_register_ids(){this._aggregate_selector=this.shadowRoot.querySelector("#aggregate_selector"),this._vis_selector=this.shadowRoot.querySelector("#vis_selector"),this._filters=this.shadowRoot.querySelector("#filters"),this._row_pivots=this.shadowRoot.querySelector("#row_pivots"),this._column_pivots=this.shadowRoot.querySelector("#column_pivots"),this._datavis=this.shadowRoot.querySelector("#pivot_chart"),this._active_columns=this.shadowRoot.querySelector("#active_columns"),this._inactive_columns=this.shadowRoot.querySelector("#inactive_columns"),this._side_panel_actions=this.shadowRoot.querySelector("#side_panel__actions"),this._add_computed_column=this.shadowRoot.querySelector("#add-computed-column"),this._computed_column=this.shadowRoot.querySelector("perspective-computed-column"),this._computed_column_inputs=this._computed_column.querySelector("#psp-cc-computation-inputs"),this._inner_drop_target=this.shadowRoot.querySelector("#drop_target_inner"),this._drop_target=this.shadowRoot.querySelector("#drop_target"),this._config_button=this.shadowRoot.querySelector("#config_button"),this._reset_button=this.shadowRoot.querySelector("#reset_button"),this._download_button=this.shadowRoot.querySelector("#download_button"),this._copy_button=this.shadowRoot.querySelector("#copy_button"),this._side_panel=this.shadowRoot.querySelector("#side_panel"),this._top_panel=this.shadowRoot.querySelector("#top_panel"),this._sort=this.shadowRoot.querySelector("#sort"),this._transpose_button=this.shadowRoot.querySelector("#transpose_button"),this._plugin_information=this.shadowRoot.querySelector(".plugin_information"),this._plugin_information_action=this.shadowRoot.querySelector(".plugin_information__action"),this._plugin_information_action_close=this.shadowRoot.querySelector(".plugin_information__action--close"),this._plugin_information_message=this.shadowRoot.querySelector("#plugin_information_count"),this._resize_bar=this.shadowRoot.querySelector("#resize_bar")}_register_view_options(){let t=n.b.getInstance();Object(j.render)(Tt(t),this._vis_selector)}_register_data_attribute(){if(this.getAttribute("data")){let t=this.getAttribute("data");try{t=JSON.parse(t)}catch(t){}this.load(t)}}_autocomplete_choices(t){return t.slice(1,t.length).map(t=>t.__ROW_PATH__).filter(t=>Array.isArray(t)?t.filter(t=>!!t).length>0:!!t)}}class It extends Lt{_show_context_menu(t){return this.shadowRoot.querySelector("#app").classList.toggle("show_menu"),t.stopPropagation(),t.preventDefault(),!1}_hide_context_menu(){this.shadowRoot.querySelector("#app").classList.remove("show_menu")}async _toggle_config(t){if(!t||2!==t.button){this._show_config=!this._show_config,this._hide_context_menu();const t=this.shadowRoot.querySelector("#pivot_chart_container");this._show_config?await this._post_resize(()=>{this.toggleAttribute("settings",!0)},()=>{this._side_panel.style.display="flex",this._top_panel.style.display="flex",this.dispatchEvent(new CustomEvent("perspective-toggle-settings",{detail:this._show_config}))}):await this._pre_resize(t.clientWidth+this._side_panel.clientWidth,t.clientHeight+this._top_panel.clientHeight,()=>{this._side_panel.style.display="none",this._top_panel.style.display="none",this.removeAttribute("settings")},()=>this.dispatchEvent(new CustomEvent("perspective-toggle-settings",{detail:this._show_config})))}}async _pre_resize(t,e,o,i){this._datavis.style.width="".concat(t,"px"),this._datavis.style.height="".concat(e,"px");try{!document.hidden&&this.offsetParent&&await this._plugin.resize.call(this)}finally{null==i||i(),this._datavis.style.width="100%",this._datavis.style.height="100%",o()}}async _post_resize(t,e){null==e||e();try{!document.hidden&&this.offsetParent&&await this._plugin.resize.call(this)}finally{t()}}_open_computed_column(t){t.stopImmediatePropagation(),this._computed_column.style.display="flex",this._side_panel_actions.style.display="none"}_set_computed_column_input(t){t.detail.target.appendChild(this._new_row(t.detail.column.name,t.detail.column.type)),this._update_column_view()}_validate_computed_column(t){const e=t.detail;let o=JSON.parse(this.getAttribute("computed-columns"));null===o&&(o=[]);for(let t of o)if(e.name===t.name)return;o.push(e),this.setAttribute("computed-columns",JSON.stringify(o))}async _create_computed_column(t){const e=t.detail;let o=e.column_name;(await this._table.columns()).includes(o)&&(o+=" ".concat(Math.round(100*Math.random())));const i=[{computation:e.computation,column:o,computed_function_name:e.computation.name,func:e.computation.func,inputs:e.input_columns.map(t=>t.name),input_type:e.computation.input_type,type:e.computation.return_type}],n=this._table.add_computed(i);await this._load_table(n,!0),this._update_column_view()}_column_visibility_clicked(t){const e=t.currentTarget;if("active_columns"===e.parentElement.getAttribute("id")){var o;const s=(null===(o=this._plugin.initial)||void 0===o?void 0:o.count)||1;if(this._get_view_active_valid_column_count()===s)return;if(t.detail.shiftKey)for(let t of Array.prototype.slice.call(this._active_columns.children))t!==e&&this._active_columns.removeChild(t);else{var i,n,r;const t=Array.prototype.slice.call(this._active_columns.children).indexOf(e);if(t<(null===(i=this._plugin.initial)||void 0===i?void 0:i.count))return;t<(null===(n=this._plugin.initial)||void 0===n?void 0:null===(r=n.names)||void 0===r?void 0:r.length)-1&&this._active_columns.insertBefore(this._new_row(null),e),this._active_columns.removeChild(e)}}else{var s,a;if(null===(s=t.path[1])||void 0===s?void 0:s.classList.contains("psp-cc-computation__input-column"))return this._computed_column.deselect_column(t.currentTarget.getAttribute("name")),void this._update_column_view();if(t.detail.shiftKey&&"toggle"===this._plugin.selectMode||!t.detail.shiftKey&&"select"===this._plugin.selectMode)for(let t of Array.prototype.slice.call(this._active_columns.children))this._active_columns.removeChild(t);let o=this._new_row(e.getAttribute("name"),e.getAttribute("type"));const i=this._get_view_active_columns();let n=i.length-1;if(i[n]&&(null===(a=i[n])||void 0===a?void 0:a.classList.contains("null-column"))){for(;n-- >0;)if(!i[n].classList.contains("null-column")){this._active_columns.replaceChild(o,i[n+1]);break}}else this._active_columns.appendChild(o)}this._check_responsive_layout(),this._update_column_view()}_column_aggregate_clicked(){let t=this.get_aggregate_attribute(),e=this._get_view_aggregates();for(let o of t){let t=e.find(t=>t.column===o.column);t&&(o.op=t.op)}this.set_aggregate_attribute(t),this._update_column_view(),this._debounce_update()}_column_filter_clicked(){let t=this._get_view_filters();this._updating_filter=!0,this.setAttribute("filters",JSON.stringify(t)),this._updating_filter=!1,this._debounce_update()}_increment_sort(t,e,o){let i=["asc","desc"];return e&&i.push("col asc","col desc"),o&&(i=i.map(t=>"".concat(t," abs"))),i.push("none"),i[(i.indexOf(t)+1)%i.length]}_sort_order_clicked(t){const e=t.target,o=t.detail.shiftKey&&"string"!==e.getAttribute("type"),i=this._increment_sort(e.getAttribute("sort-order"),this._get_view_column_pivots().length>0,o);e.setAttribute("sort-order",i);const n=this._get_view_sorts();this.setAttribute("sort",JSON.stringify(n))}_transpose(){const t=this.hasAttribute("row-pivots"),e=this.hasAttribute("column-pivots");if(t&&e){let t=this.getAttribute("row-pivots");this.setAttribute("row-pivots",this.getAttribute("column-pivots")),this.setAttribute("column-pivots",t)}else if(t){let t=this.getAttribute("row-pivots");this.removeAttribute("row-pivots"),this.setAttribute("column-pivots",t)}else if(e){let t=this.getAttribute("column-pivots");this.removeAttribute("column-pivots"),this.setAttribute("row-pivots",t)}else this.removeAttribute("column-pivots"),this.removeAttribute("row-pivots")}_reset_sidepanel(){this._side_panel.style.width=""}_resize_sidepanel(t){const e=document.body.style.cursor;document.body.style.cursor="col-resize";const o=t.clientX,i=this._side_panel.offsetWidth,n=t=>{const e=Math.max(0,Math.min(i+(t.clientX-o),this.offsetWidth-10));this._side_panel.style.width="".concat(e,"px"),this._plugin&&this.notifyResize()},r=()=>{document.body.style.cursor=e,document.removeEventListener("mousemove",n),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",n),document.addEventListener("mouseup",r)}_vis_selector_changed(){var t;this._plugin_information.classList.add("hidden"),this.setAttribute("plugin",this._vis_selector.value),this._active_columns.classList.remove("one_lock","two_lock");const e=["one_lock","two_lock"][(null===(t=this._plugin.initial)||void 0===t?void 0:t.count)-1];e&&this._active_columns.classList.add(e),this._debounce_update()}_register_callbacks(){this._sort.addEventListener("drop",m.bind(this)),this._sort.addEventListener("dragend",g.bind(this)),this._sort.addEventListener("dragenter",O.bind(this)),this._sort.addEventListener("dragover",S.bind(this)),this._sort.addEventListener("dragleave",k.bind(this)),this._row_pivots.addEventListener("drop",m.bind(this)),this._row_pivots.addEventListener("dragend",g.bind(this)),this._row_pivots.addEventListener("dragenter",O.bind(this)),this._row_pivots.addEventListener("dragover",S.bind(this)),this._row_pivots.addEventListener("dragleave",k.bind(this)),this._column_pivots.addEventListener("drop",m.bind(this)),this._column_pivots.addEventListener("dragend",g.bind(this)),this._column_pivots.addEventListener("dragenter",O.bind(this)),this._column_pivots.addEventListener("dragover",S.bind(this)),this._column_pivots.addEventListener("dragleave",k.bind(this)),this._filters.addEventListener("drop",m.bind(this)),this._filters.addEventListener("dragend",g.bind(this)),this._filters.addEventListener("dragenter",O.bind(this)),this._filters.addEventListener("dragover",S.bind(this)),this._filters.addEventListener("dragleave",k.bind(this)),this._active_columns.addEventListener("drop",A.bind(this)),this._active_columns.addEventListener("dragenter",O.bind(this)),this._active_columns.addEventListener("dragend",f.bind(this)),this._active_columns.addEventListener("dragover",x.bind(this)),this._active_columns.addEventListener("dragleave",v.bind(this)),this._add_computed_column.addEventListener("click",this._open_computed_column.bind(this)),this._computed_column.addEventListener("perspective-computed-column-save",this._validate_computed_column.bind(this)),this._computed_column.addEventListener("perspective-computed-column-update",this._set_computed_column_input.bind(this)),this._config_button.addEventListener("mousedown",this._toggle_config.bind(this)),this._config_button.addEventListener("contextmenu",this._show_context_menu.bind(this)),this._reset_button.addEventListener("click",this.reset.bind(this)),this._copy_button.addEventListener("click",t=>this.copy(t.shiftKey)),this._download_button.addEventListener("click",t=>this.download(t.shiftKey)),this._transpose_button.addEventListener("click",this._transpose.bind(this)),this._drop_target.addEventListener("dragover",S.bind(this)),this._resize_bar.addEventListener("mousedown",this._resize_sidepanel.bind(this)),this._resize_bar.addEventListener("dblclick",this._reset_sidepanel.bind(this)),this._vis_selector.addEventListener("change",this._vis_selector_changed.bind(this)),this._plugin_information_action.addEventListener("click",()=>{this._debounce_update({ignore_size_check:!0,limit_points:!1}),this._plugin_information.classList.add("hidden")}),this._plugin_information_action_close.addEventListener("click",()=>{this._plugin_information.classList.add("hidden")})}}var zt,Dt;function Ct(t,e,o,i,n){var r={};return Object.keys(i).forEach((function(t){r[t]=i[t]})),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),r=o.slice().reverse().reduce((function(o,i){return i(t,e,o)||o}),r),n&&void 0!==r.initializer&&(r.value=r.initializer?r.initializer.call(n):void 0,r.initializer=void 0),void 0===r.initializer&&(Object.defineProperty(t,e,r),r=null),r}const Pt=["selectable","editable","plugin","row-pivots","column-pivots","aggregates","filters","sort","computed-columns","columns"];Object(i.b)(rt.a,at.a,lt.a)((Ct((Dt=class extends It{constructor(){super(),this._register_debounce_instance(),this._show_config=!0,this._show_warnings=!0,this.__render_times=[],this._resize_handler=this.notifyResize.bind(this),window.addEventListener("resize",this._resize_handler)}connectedCallback(){0===Object.keys(n.b.getInstance()).length&&Object(n.a)(),this.toggleAttribute("settings",!0),this._register_ids(),this._register_callbacks(),this._register_view_options(),this._register_data_attribute(),this.toggleConfig(),this._check_loaded_table()}sort(t){null!=t&&0!==t.length||(this.hasAttribute("sort")&&this.removeAttribute("sort"),t=[]);var e=this._sort.querySelector("ul");this._update_column_list(t,e,t=>{let e="asc";return Array.isArray(t)&&(e=t[1],t=t[0]),this._new_row(t,!1,!1,!1,e)},(t,e)=>Array.isArray(t)?e.getAttribute("name")===t[0]&&e.getAttribute("sort-order")===t[1]:e.getAttribute("name")===t),this.dispatchEvent(new Event("perspective-config-update")),this._debounce_update()}columns(t){null!=t&&0!==t.length||(this.hasAttribute("columns")&&(this._initial_col_order?this.setAttribute("columns",JSON.stringify(this._initial_col_order)):this.removeAttribute("columns")),t=(this._initial_col_order||[]).slice()),this._update_column_view(t,!0),this.dispatchEvent(new Event("perspective-config-update")),this._debounce_update()}"computed-columns"(t){null!=t&&0!==t.length||(this.hasAttribute("computed-columns")&&this.removeAttribute("computed-columns"),t=[]);const e=this._set_updating();(async()=>{if(this._table){const o=await this._table.computed_schema();this._computed_column._close_computed_column();for(let e of t)o[e.name]||await this._create_computed_column({detail:{column_name:e.name,input_columns:e.inputs.map(t=>({name:t})),computation:D[e.func]}});await this._debounce_update(),e()}else this._computed_column._close_computed_column();this.dispatchEvent(new Event("perspective-config-update")),this.dispatchEvent(new Event("perspective-computed-column-update"))})()}aggregates(t){null!=t&&0!==Object.keys(t).length||(this.hasAttribute("aggregates")&&this.removeAttribute("aggregates"),t={}),this._get_view_dom_columns().map(e=>{let o=t[e.getAttribute("name")];o&&e.setAttribute("aggregate",Array.isArray(o)?JSON.stringify(o):o)}),this.dispatchEvent(new Event("perspective-config-update")),this._debounce_update()}filters(t){if(null!=t&&0!==t.length||(this.hasAttribute("filters")&&this.removeAttribute("filters"),t=[]),!this._updating_filter){var e=this._filters.querySelector("ul");this._update_column_list(t,e,t=>{const e=JSON.stringify({operator:t[1],operand:t[2]});return this._new_row(t[0],void 0,void 0,e)},(t,e)=>e.getAttribute("name")===t[0]&&e.getAttribute("filter")===JSON.stringify({operator:t[1],operand:t[2]}))}this.dispatchEvent(new Event("perspective-config-update")),this._debounce_update()}set plugin(t){if("null"===t||null==t)return void this.setAttribute("plugin",this._vis_selector.options[0].value);const e=Object.keys(n.b.getInstance());if(this.hasAttribute("plugin")){let t=this.getAttribute("plugin");if(-1===e.indexOf(t)){const o=e.find(e=>e.indexOf(t)>-1);o?(console.warn('Unknown plugin "'.concat(t,'", using "').concat(o,'"')),this.setAttribute("plugin",o)):(console.error('Unknown plugin "'.concat(t,'"')),this.setAttribute("plugin",this._vis_selector.options[0].value))}else this._vis_selector.value!==t&&(this._vis_selector.value=t,this._vis_selector_changed()),this._set_row_styles(),this._set_column_defaults(),this.dispatchEvent(new Event("perspective-config-update"))}else this.setAttribute("plugin",this._vis_selector.options[0].value)}"column-pivots"(t){null!=t&&0!==t.length||(this.hasAttribute("column-pivots")&&this.removeAttribute("column-pivots"),t=[]);var e=this._column_pivots.querySelector("ul");this._update_column_list(t,e,t=>this._new_row(t)),this.dispatchEvent(new Event("perspective-config-update")),this._debounce_update()}"row-pivots"(t){null!=t&&0!==t.length||(this.hasAttribute("row-pivots")&&this.removeAttribute("row-pivots"),t=[]);var e=this._row_pivots.querySelector("ul");this._update_column_list(t,e,t=>this._new_row(t)),this.dispatchEvent(new Event("perspective-config-update")),this._debounce_update()}set editable(t){"null"===t?this.hasAttribute("editable")&&this.removeAttribute("editable"):this.toggleAttribute("editable",!0),this._debounce_update({force_update:!0}),this.dispatchEvent(new Event("perspective-config-update"))}set throttle(t){"null"===t&&this.hasAttribute("throttle")&&this.removeAttribute("throttle"),this._calculate_throttle_timeout()}set selectable(t){"null"===t?this.hasAttribute("selectable")&&this.removeAttribute("selectable"):this.toggleAttribute("selectable",!0),this._debounce_update({force_update:!0}),this.dispatchEvent(new Event("perspective-config-update"))}get worker(){return this._get_worker()}get table(){return this._table}get view(){return this._view}async load(t,e){let o;if(t instanceof Promise)o=await t;else{try{t=t.trim()}catch(t){}"table"===t.type?o=t:(o=this.worker.table(t,e),o._owner_viewer=this)}this.isConnected?await this._load_table(o):this._table=o}update(t){void 0===this._table?this.load(t):this._table.update(t)}async notifyResize(t){await this._check_responsive_layout()||document.hidden||!this.offsetParent||await this._plugin.resize.call(this,t)}clone(t){this._inner_drop_target&&(this._inner_drop_target.innerHTML=t._inner_drop_target.innerHTML),this._load_table(t.table),this.restore(t.save())}delete(t=!0){let e=this._clear_state(t);return this._plugin.delete&&this._plugin.delete.call(this),window.removeEventListener("load",this._resize_handler),window.removeEventListener("resize",this._resize_handler),e}restyleElement(){this._restyle_plugin()}save(){let t={};const e=new Set(Pt);for(let o=0;o<this.attributes.length;o++){let i=this.attributes[o];e.has(i.name)&&(""===i.value?t[i.name]=!0:"plugin"!==i.name&&void 0!==i.value&&null!==i.value?t[i.name]=JSON.parse(i.value):t[i.name]=i.value,e.delete(i.name))}for(const o of e)t[o]=null;return this._plugin.save&&(t.plugin_config=this._plugin.save.call(this)),t}async restore(t){"string"==typeof t&&(t=JSON.parse(t));for(const e of Pt)if(t.hasOwnProperty(e)){let o=t[e];!0===o?this.toggleAttribute(e,!0):null!=o&&!1!==o?("string"!=typeof o&&(o=JSON.stringify(o)),this.setAttribute(e,o)):this.removeAttribute(e)}this._plugin.restore&&t.plugin_config&&this._plugin.restore.call(this,t.plugin_config),await this._debounce_update()}async flush(){for(await new Promise(setTimeout);this.hasAttribute("updating");)await this._updating_promise}clear(){var t;null===(t=this._table)||void 0===t||t.clear()}replace(t){this._table?this._table.replace(t):this._load(t)}reset(){this.removeAttribute("row-pivots"),this.removeAttribute("column-pivots"),this.removeAttribute("filters"),this.removeAttribute("sort"),this._initial_col_order?this.setAttribute("columns",JSON.stringify(this._initial_col_order)):this.removeAttribute("columns"),this.setAttribute("plugin",Object.keys(n.b.getInstance())[0]),this.dispatchEvent(new Event("perspective-config-update")),this._hide_context_menu()}async download(t=!1){const e=t?this._table.view():this._view,o=await e.to_csv(),i=document.createElement("a"),n=o,r=n.length,s=new Uint8Array(r);for(let t=0;t<r;t++)s[t]=n.charCodeAt(t);const a=new Blob([s]);i.setAttribute("href",URL.createObjectURL(a)),i.setAttribute("download","perspective.csv"),i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),this._hide_context_menu()}copy(t=!1){let e;(t?this._table.view():this._view).to_csv().then(t=>{e=t}).catch(t=>{console.error(t),e=""});let o=0,n=()=>{void 0!==e?Object(i.c)(e):o<200?(o++,setTimeout(n,50)):console.warn("Timeout expired - copy to clipboard cancelled.")};n(),this._hide_context_menu()}async toggleConfig(){await this._toggle_config()}}).prototype,"sort",[i.a],Object.getOwnPropertyDescriptor(Dt.prototype,"sort"),Dt.prototype),Ct(Dt.prototype,"columns",[i.a],Object.getOwnPropertyDescriptor(Dt.prototype,"columns"),Dt.prototype),Ct(Dt.prototype,"computed-columns",[i.a],Object.getOwnPropertyDescriptor(Dt.prototype,"computed-columns"),Dt.prototype),Ct(Dt.prototype,"aggregates",[i.d],Object.getOwnPropertyDescriptor(Dt.prototype,"aggregates"),Dt.prototype),Ct(Dt.prototype,"filters",[i.a],Object.getOwnPropertyDescriptor(Dt.prototype,"filters"),Dt.prototype),Ct(Dt.prototype,"column-pivots",[i.a],Object.getOwnPropertyDescriptor(Dt.prototype,"column-pivots"),Dt.prototype),Ct(Dt.prototype,"row-pivots",[i.a],Object.getOwnPropertyDescriptor(Dt.prototype,"row-pivots"),Dt.prototype),Ct(Dt.prototype,"notifyResize",[i.f],Object.getOwnPropertyDescriptor(Dt.prototype,"notifyResize"),Dt.prototype),zt=Dt))}])}));
2//# sourceMappingURL=perspective-viewer.js.map
\No newline at end of file