diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 907aa24ea..000000000 --- a/.editorconfig +++ /dev/null @@ -1,28 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = false -insert_final_newline = false - -[*.md] -trim_trailing_whitespace = false - -[*.js] -indent_style = tab -trim_trailing_whitespace = false -insert_final_newline = false - -[*.ts,*.tsx] -indent_style = space -indent_size = 2 -trim_trailing_whitespace = false -insert_final_newline = true - -[*.pegjs] -indent_style = tab -trim_trailing_whitespace = false -insert_final_newline = false \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 70861e8b6..000000000 --- a/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -/nbproject/private/ -/node_modules -.brackets.json -.idea -dist -build -/bower_components -/tmp -/yarn-error.log -/reports/ \ No newline at end of file diff --git a/calc.e900012b8e502c240f6c.css b/calc.5f5c7fd49bb7b3aea41e.css similarity index 100% rename from calc.e900012b8e502c240f6c.css rename to calc.5f5c7fd49bb7b3aea41e.css diff --git a/calc.e900012b8e502c240f6c.css.gz b/calc.5f5c7fd49bb7b3aea41e.css.gz similarity index 100% rename from calc.e900012b8e502c240f6c.css.gz rename to calc.5f5c7fd49bb7b3aea41e.css.gz diff --git a/index.html b/index.html index 4442527c0..26090d898 100644 --- a/index.html +++ b/index.html @@ -116,7 +116,7 @@ } } - +
@@ -125,6 +125,6 @@
- + \ No newline at end of file diff --git a/index.html.gz b/index.html.gz index e641203a7..bcf9e66a5 100644 Binary files a/index.html.gz and b/index.html.gz differ diff --git a/js/calc.e900012b8e502c240f6c.bundle.js b/js/calc.5f5c7fd49bb7b3aea41e.bundle.js similarity index 82% rename from js/calc.e900012b8e502c240f6c.bundle.js rename to js/calc.5f5c7fd49bb7b3aea41e.bundle.js index 1907f02c0..392c52c3d 100644 --- a/js/calc.e900012b8e502c240f6c.bundle.js +++ b/js/calc.5f5c7fd49bb7b3aea41e.bundle.js @@ -109,4 +109,4 @@ var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r,o,i,a,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var l=null,u=null,c=function(){if(null!==l)try{var e=t.unstable_now();l(!0,e),l=null}catch(e){throw setTimeout(c,0),e}},d=Date.now();t.unstable_now=function(){return Date.now()-d},r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(c,0))},o=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.performance,f=window.Date,m=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof h&&"function"==typeof h.now)t.unstable_now=function(){return h.now()};else{var y=f.now();t.unstable_now=function(){return f.now()-y}}var b=!1,v=null,_=-1,w=5,E=0;a=function(){return t.unstable_now()>=E},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0T(a,n))void 0!==l&&0>T(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var M=[],x=[],R=1,L=null,A=3,D=!1,N=!1,P=!1;function I(e){for(var t=O(x);null!==t;){if(null===t.callback)k(x);else{if(!(t.startTime<=e))break;k(x),t.sortIndex=t.expirationTime,S(M,t)}t=O(x)}}function H(e){if(P=!1,I(e),!N)if(null!==O(M))N=!0,r(Y);else{var t=O(x);null!==t&&o(H,t.startTime-e)}}function Y(e,n){N=!1,P&&(P=!1,i()),D=!0;var r=A;try{for(I(n),L=O(M);null!==L&&(!(L.expirationTime>n)||e&&!a());){var s=L.callback;if(null!==s){L.callback=null,A=L.priorityLevel;var l=s(L.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?L.callback=l:L===O(M)&&k(M),I(n)}else k(M);L=O(M)}if(null!==L)var u=!0;else{var c=O(x);null!==c&&o(H,c.startTime-n),u=!1}return u}finally{L=null,A=r,D=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||D||(N=!0,r(Y))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return O(M)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=W,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0s?(e.sortIndex=l,S(x,e),null===O(M)&&e===O(x)&&(P?i():P=!0,o(H,l-s))):(e.sortIndex=a,S(M,e),N||D||(N=!0,r(Y))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();I(e);var n=O(M);return n!==L&&null!==L&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},"./node_modules/strict-uri-encode/index.js":function(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},"./node_modules/symbol-observable/es/index.js":function(e,t,n){"use strict";(function(e,r){var o,i=n("./node_modules/symbol-observable/es/ponyfill.js");o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/webpack/buildin/harmony-module.js")(e))},"./node_modules/symbol-observable/es/ponyfill.js":function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},"./node_modules/timers-browserify/main.js":function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/warning/warning.js":function(e,t,n){"use strict";var r=function(){};e.exports=r},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/harmony-module.js":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/calc2/calculator.entry.tsx":function(e,t,n){"use strict";n.r(t);var r=n("./src/calc2/i18n.tsx"),o=n("./src/calc2/utils/groupUtils.ts"),i=n("./node_modules/immutable/dist/immutable.es.js"),a=function(e){return"@@redux-saga/"+e},s=a("CANCEL_PROMISE"),l=a("CHANNEL_END"),u=a("IO"),c=a("MATCH"),d=a("MULTICAST"),h=a("SAGA_ACTION"),f=a("SELF_CANCELLATION"),m=a("TASK"),p=a("TASK_CANCEL"),g=a("TERMINATE"),y=a("LOCATION"),b=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),v=function(e){return null==e},_=function(e){return null!=e},w=function(e){return"function"==typeof e},E=function(e){return"string"==typeof e},j=Array.isArray,C=function(e){return e&&w(e.then)},S=function(e){return e&&w(e.next)&&w(e.throw)},O=function e(t){return t&&(E(t)||M(t)||w(t)||j(t)&&t.every(e))},k=function(e){return e&&w(e.take)&&w(e.close)},T=function(e){return w(e)&&e.hasOwnProperty("toString")},M=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};var x=function(e){return function(){return e}}(!0),R=function(){};var L=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var A=function(e,t){Object(b.a)(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function D(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function N(e){var t=!1;return function(){t||(t=!0,e())}}var P=function(e){throw e},I=function(e){return{value:e,done:!0}};function H(e,t,n){void 0===t&&(t=P),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:I,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Y(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var F=function(e){return Array.apply(null,new Array(e))},W=function(e){return function(t){return e(Object.defineProperty(t,h,{value:!0}))}},B=function(e){return e===g},U=function(e){return e===p},z=function(e){return B(e)||U(e)};function V(e,t){var n=Object.keys(e),r=n.length;var o,i=0,a=j(e)?F(r):{},s={};return n.forEach((function(e){var n=function(n,s){o||(s||z(n)?(t.cancel(),t(n,s)):(a[e]=n,++i===r&&(o=!0,t(a))))};n.cancel=R,s[e]=n})),t.cancel=function(){o||(o=!0,n.forEach((function(e){return s[e].cancel()})))},s}function q(e){return{name:e.name||"anonymous",location:G(e)}}function G(e){return e[y]}function K(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,i=0,a=function(t){n[o]=t,o=(o+1)%e,r++},s=function(){if(0!=r){var t=n[i];return n[i]=null,r--,i=(i+1)%e,t}},l=function(){for(var e=[];r;)e.push(s());return e};return{isEmpty:function(){return 0==r},put:function(s){var u;if(r1?t-1:0),r=1;r1?t-1:0),r=1;r2?n-2:0),o=2;oe.groupInfo.source===n&&e.groupInfo.id===r&&e.groupInfo.filename===o&&e.groupInfo.index===i);return a?Object.assign(Object.assign({},e),{current:Object.assign(Object.assign({},e.current),{group:a})}):(console.error("could not find group ",a),e)}case"GROUPS_LOAD_SUCCESS":{const{loadedGroups:n}=t;let r=e;for(const e of n)r=Object.assign(Object.assign({},r),{groups:r.groups.set(le(e),e)});return r}case"GROUP_SET_DRAFT":{let{draft:n}=t;n=Object.assign(Object.assign({},n),{isDraft:!0}),e=Object.assign(Object.assign({},e),{groups:e.groups.set(le(n),n),current:Object.assign(Object.assign({},e.current),{group:n})})}default:return e}}function le(e){const{source:t,id:n,filename:r,index:o}=e.groupInfo;return`${t}/${n}/${r}/${o}`}n("./node_modules/custom-event-polyfill/polyfill.js");var ue=n("./node_modules/react/index.js"),ce=n("./node_modules/react-dom/index.js"),de=n("./node_modules/react-hot-loader/index.js"),he=(n.p,n("./src/calc2/main.hot.tsx")),fe=n("./node_modules/redux/es/redux.js"),me=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");function pe(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var ge=pe,ye=[],be=0;function ve(e){try{Ee(),e()}finally{je()}}function _e(e){ye.push(e),be||(Ee(),Ce())}function we(e){try{return Ee(),e()}finally{Ce()}}function Ee(){be++}function je(){be--}function Ce(){var e;for(je();!be&&void 0!==(e=ye.shift());)ve(e)}var Se=function(e){return function(t){return e.some((function(e){return xe(e)(t)}))}},Oe=function(e){return function(t){return e(t)}},ke=function(e){return function(t){return t.type===String(e)}},Te=function(e){return function(t){return t.type===e}},Me=function(){return x};function xe(e){var t="*"===e?Me:E(e)?ke:j(e)?Se:T(e)?ke:w(e)?Oe:M(e)?Te:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var Re={type:l},Le=function(e){return e&&e.type===l};function Ae(e){void 0===e&&(e=X());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(Re):e.isEmpty()?(n.push(r),r.cancel=function(){D(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(Re):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r2?h-2:0),m=2;m2?n-2:0),o=2;o1?t-1:0),r=1;r!(e.groupInfo.source!==t||e.groupInfo.id!==n||!r||"first"!==r&&r.filename!==e.groupInfo.filename||!r||"first"!==r&&r.index!==e.groupInfo.index));if(s){const{source:e,id:t,filename:n,index:r}=s.groupInfo,o={type:"GROUP_SET_CURRENT",source:e,id:t,filename:n,index:r};yield Q(o)}else try{if("local"!==t&&"gist"!==t)throw new Error(`unsupported source-type ${t}`);const e=yield ee(o.b,t,n,i,a),s={type:"GROUPS_LOAD_SUCCESS",loadedGroups:e};if(yield Q(s),void 0!==r&&e.length>0){const{source:t,id:n,filename:r}=e[0].groupInfo,o={type:"GROUP_SET_CURRENT",source:t,id:n,filename:r,index:0};yield Q(o)}}catch(e){console.error("could not fetch group",e),window.alert("Could not fetch group!\nDefault group loaded.\n"+e)}}))})),ce.render(ue.createElement(de.AppContainer,null,ue.createElement(he.a,{store:et})),document.getElementById("root"));{const e={type:"SET_LOCALE",locale:r.c.language};et.dispatch(e)}for(const e of function(){const e=[{maintainerGroup:Object(r.d)("calc.maintainer-groups.misc"),maintainer:"",source:"local",id:"uibk"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'mtschu',source:"gist",id:"2923a30a474fdcb46bee"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Wolfgang Gassler',source:"gist",id:"7d1871f79a8bcb4788de"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Michael Rampl',source:"gist",id:"b58108eacc9c5916726b2327789204ab"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Michael Rampl',source:"gist",id:"963d8b886fb468d742c71d34ba0dbbed"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"41cf5ce652756d9331eec7562644e074"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"c306ecf21c6e6d175508d3ac6b4355e7"}];let t=!0;return e.map(({source:e,id:n,maintainer:r,maintainerGroup:o})=>{const i={type:"GROUPS_LOAD_REQUEST",source:e,id:n,setCurrent:t?"first":void 0,maintainer:r,maintainerGroup:o};return t=!1,i})}())et.dispatch(e)},"./src/calc2/components/calculator.scss":function(e,t,n){},"./src/calc2/components/dropdownList.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("./node_modules/react/index.js"),o=n("./node_modules/reactstrap/lib/Dropdown.js"),i=n.n(o),a=n("./node_modules/reactstrap/lib/DropdownItem.js"),s=n.n(a),l=n("./node_modules/reactstrap/lib/DropdownMenu.js"),u=n.n(l),c=n("./node_modules/reactstrap/lib/DropdownToggle.js"),d=n.n(c);class h extends r.Component{constructor(e){super(e),this.id=`dropdown-${Math.random().toString(36).substr(2,10)}`,this.state={isOpen:!1},this.toggle=this.toggle.bind(this)}toggle(){this.setState({isOpen:!this.state.isOpen})}render(){const{label:e,elements:t,value:n,onChange:o,disabled:a=!1}=this.props,{isOpen:l}=this.state;return r.createElement(i.a,{isOpen:l,toggle:this.toggle},r.createElement(d.a,{color:"",disabled:a||0===t.length},e),r.createElement(u.a,null,t.map((e,t)=>"separator"===e.type?r.createElement(s.a,{key:t,divider:!0}):"header"===e.type?r.createElement(s.a,{key:t,header:!0},e.label):r.createElement(s.a,{key:t,onClick:t=>{t.preventDefault(),o&&o(e.value)},active:e.active||e.value===n},e.label))))}}},"./src/calc2/components/editorBase.tsx":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return k})),n.d(t,"c",(function(){return T}));var r=n("./node_modules/@fortawesome/free-solid-svg-icons/index.es.js"),o=n("./node_modules/@fortawesome/react-fontawesome/index.es.js"),i=n("./src/calc2/components/dropdownList.tsx"),a=n("./src/calc2/components/toolbar.tsx"),s=n("./src/calc2/i18n.tsx"),l=n("./node_modules/classnames/index.js"),u=n("./node_modules/codemirror/lib/codemirror.js"),c=(n("./node_modules/codemirror/addon/hint/show-hint.js"),n("./src/db/exec/RANode.ts")),d=n("./src/db/translate/utils.ts"),h=n("./node_modules/react/index.js"),f=n("./node_modules/react-dom/index.js"),m=n("./node_modules/react-toastify/esm/react-toastify.js"),p=n("./node_modules/reactstrap/es/Button.js"),g=n("./node_modules/reactstrap/es/Modal.js"),y=n("./node_modules/reactstrap/es/ModalHeader.js"),b=n("./node_modules/reactstrap/es/ModalBody.js"),v=n("./node_modules/reactstrap/es/ModalFooter.js"),_=n("./node_modules/reactstrap/es/Input.js"),w=n("./node_modules/@handsontable/react/es/react-handsontable.js");n("./node_modules/codemirror/lib/codemirror.css"),n("./node_modules/codemirror/theme/eclipse.css"),n("./node_modules/codemirror/addon/hint/show-hint.css"),n("./node_modules/codemirror/addon/lint/lint.js"),n("./node_modules/codemirror/addon/lint/lint.css"),n("./node_modules/codemirror/addon/display/placeholder.js"),n("./node_modules/codemirror/addon/display/autorefresh.js"),n("./node_modules/codemirror/mode/sql/sql.js"),n("./node_modules/handsontable/dist/handsontable.full.css"),u.defineMode("relalg",(function(){const e=["pi","sigma","rho","tau","<-","->","intersect","union","except","/","-","\\\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","left semi join","right semi join","anti join","anti semi join","and","or","xor"],t=["π","σ","ρ","τ","←","→","∩","∪","÷","-","⨯","⨝","⟕","⟖","⟗","⋉","⋊","▷"],n=["<-","->",">=","<=","=","∧","∨","⊻","⊕","≠","=","¬",">","<","≥","≤"],r=(e,t,n,r="")=>{for(let o=0;o({inBlockComment:!1}),token:(o,i)=>i.inBlockComment?(o.match(/.*?\*\//,!0)?i.inBlockComment=!1:o.match(/.*/,!0),"comment"):o.match(/\/\*.*?\*\//,!0)?"comment":!i.inBlockComment&&o.match(/^\/\*.*/,!0)?(i.inBlockComment=!0,"comment"):i.inInlineRelation?(o.match(/.*?}/,!0)?i.inInlineRelation=!1:o.match(/.*/,!0),"inlineRelation"):o.match(/^{/,!0)?(i.inInlineRelation=!0,"inlineRelation"):o.match(/^--[\t ]/,!0)?(o.skipToEnd(),"comment"):o.match(/^\/\*.*?$/,!0)?"comment":r(o,t,!0)?"keyword math":r(o,e,!0,"([\\(\\)[\\]{\\}, \\.\\t]|$)")?"keyword":r(o,n,!0)?"operator math":o.match(/^\[[0-9]+]/,!0)?"attribute":o.match(/^[0-9]+(\.[0-9]+)?/,!0)?"number":o.match(/\^'[^']*'/i,!0)?"string":o.match(/\^[a-z]+\.[a-z]*/i,!0)?"qualified-column":o.match(/^[\(\)\[]\{},]/i,!0)?"bracket":o.match(/^[a-z][a-z0-9\.]*/i,!0)?"word":(o.next(),"else")}}));const E=e=>{const{editor:t}=e,{type:n,message:r,position:o}=e.alert,i={error:Object(s.d)("editor.alert-message-headers.error"),warning:Object(s.d)("editor.alert-message-headers.warning")}[n];return h.createElement("div",{className:l("alert ",{"alert-danger":"error"===n,"alert-warning":"warning"===n})},o?h.createElement("strong",null,i,": ",h.createElement("a",{onClick:e=>{if(t)return t.focus(),t.getDoc().setCursor(o),t.scrollIntoView(null,42),e.preventDefault(),!1;console.warn("editor not initialized yet")},href:"#"},Object(s.d)("editor.error-at-line-x",{line:o.line+1})),": ",r):h.createElement("strong",null,i,": ",r))};class j{constructor(){this.name="",this.type="",this.data=[]}}class C{constructor(){this.name="",this.attributes=[]}toString(e){let t="";t=!1===e?this.name+" = {\n":"{ ";const n=new Array;for(let e=0;e<1+this.attributes[0].data.length;e++)n.push("");return this.attributes.forEach((e,t)=>{t>0&&(n[0]+=", "),n[0]+=e.name,e.data.forEach((r,o)=>{t>0&&(n[o+1]+=", "),"number"===e.type?n[o+1]+=r:n[o+1]+="'"+r+"'"})}),t+=n.join("\n"),t+="\n}\n",t}fromTableData(e){if(null==e)return;const t=new Array;t.push([]),t.push([]),e.columns.forEach(e=>{t[0].push(e.name),t[1].push(e.type)}),e.rows.forEach(e=>{t.push(e)}),this.fromData(t)}toData(){const e=new Array;if(0===this.attributes.length)return[[]];for(let t=0;t<2+this.attributes[0].data.length;t++)e.push([]);return this.attributes.forEach(t=>{e[0].push(t.name),e[1].push(t.type),t.data.forEach((t,n)=>{e[n+2].push(t)})}),e}fromData(e){for(let t=0;t{const r=new Array,i=e.split(t);-1===o&&(o=i.length),i.length===o&&(i.forEach(e=>{r.push(e)}),n.push(r))}),this.fromData(n)}toCSV(e=";"){let t="";return this.toData().forEach(n=>{t+=n.join(e)+"\n"}),t}}const S="CodeMirror-table-edit-markers";class O extends h.Component{constructor(e){super(e);const t=Object.assign({theme:"eclipse",smartdent:!0,tabSize:2,indentWithTabs:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseBrackets:!0,smartIndent:!0,autofocus:!1,autoRefresh:!0,enableInlineRelationEditor:!0,gutters:["CodeMirror-lint-markers",S],mode:e.mode,viewportMargin:1/0,extraKeys:{"Shift-Tab":"indentLess","Ctrl-Enter":e=>{this.exec(!1)},"Shift-Ctrl-Enter":e=>{const{editor:t}=this.state;t&&t.getDoc().somethingSelected()&&this.exec(!0)},"Ctrl-S":e=>{this.downloadEditorText()},"Ctrl-Space":e=>{u.showHint(e,e=>this.genericHint(e),{closeOnUnfocus:!0})}},placeholder:Object(s.d)("editor.codemirror-placeholder"),textChange:null},e.codeMirrorOptions);this.hotTableSettings={colHeaders:!1,rowHeaders:function(e){return 0===e?Object(s.d)("calc.editors.ra.inline-editor.row-name"):1===e?Object(s.d)("calc.editors.ra.inline-editor.row-type"):e-1},height:function(){return.7*document.body.clientHeight},fixedRowsTop:2,minRows:2,minCols:1,minSpareRows:1,minSpareCols:1,colWidths:"100px",contextMenu:!0,cells:function(e,t){return 1===e?{type:"dropdown",source:["number","string","date"]}:{}}},this.state={editor:null,codeMirrorOptions:t,history:[],isSelectionSelected:!1,execSuccessful:!1,execErrors:[],isExecutionDisabled:!1,execResult:null,modal:!1,inlineRelationModal:!1,relationEditorName:"",replSelStart:null,replSelEnd:null},this.toggle=this.toggle.bind(this),this.inlineRelationEditorOk=this.inlineRelationEditorOk.bind(this),this.toggleInlineRelationEditor=this.toggleInlineRelationEditor.bind(this),this.inlineRelationEditorClose=this.inlineRelationEditorClose.bind(this),this.inlineRelationEditorUpload=this.inlineRelationEditorUpload.bind(this),this.inlineRelationEditorDownload=this.inlineRelationEditorDownload.bind(this),this.hinterCache={hints:[],hintsFromLinter:[],changed:!0},this.linter=this.linter.bind(this),this.exec=this.exec.bind(this),this.applyHistory=this.applyHistory.bind(this),this.downloadEditorText=this.downloadEditorText.bind(this),this.uploadCSVRef=h.createRef()}getInlineRelationData(){return this.hotTableSettings.data}setInlineRelationData(e){this.hotTableSettings.datta=e}inlineRelationEditorOpen(e){const t=new C,{editor:n}=this.state;if(n){let r=n.getDoc().getCursor(),o=n.getDoc().getCursor();e?(t.name=e.assignmentName,t.fromTableData(e.content),r=u.Pos(e.line-1,0),o=u.Pos(e.end.line,e.end.column)):(t.attributes.push(new j),t.attributes.push(new j)),this.setState({inlineRelationModal:!0,relationEditorName:t.name,replSelStart:r,replSelEnd:o},()=>{this.hotTableSettings.data=t.toData()})}}inlineRelationEditorOk(){const e=new C;e.name=this.state.relationEditorName,e.fromData(this.getInlineRelationData());const{editor:t,replSelStart:n,replSelEnd:r}=this.state;t&&t.getDoc().replaceRange(e.toString("relalg"===this.props.tab),n,r),this.inlineRelationEditorClose()}inlineRelationEditorClose(){this.setState({inlineRelationModal:!1})}inlineRelationEditorUpload(e){const t=e.target.files;if(t.length>0){const e=new FileReader;e.onload=e=>{const n=e.target.result,r=new C;r.fromCSV(n),r.name=t[0].name.replace(".csv",""),this.setInlineRelationData(r.toData())},e.readAsText(t[0])}}inlineRelationEditorDownload(){const e=new C;e.fromData(this.getInlineRelationData());const t=e.toCSV(),n=(document.createElement("a"),document.createElement("a"));n.href=window.URL.createObjectURL(new Blob([t],{type:"text/csv"})),n.download=this.state.relationEditorName+".csv",n.click()}componentDidMount(){const e=Object(f.findDOMNode)(this).querySelector("textarea");if(!e)throw new Error("could not fid textarea");const t=u.fromTextArea(e,this.state.codeMirrorOptions);this.setState({editor:t,relationEditorName:""}),null!=this.props.linterFunction&&t.setOption("lint",{getAnnotations:this.linter}),t.on("cursorActivity",e=>{this.setState({isSelectionSelected:e.getDoc().somethingSelected()})}),t.on("change",e=>{this.props.textChange(e)})}render(){const{execErrors:e,isSelectionSelected:t,editor:n,history:u,execSuccessful:c,isExecutionDisabled:d,execResult:f}=this.state,{toolbar:m,disableHistory:j=!1,execButtonLabel:C}=this.props;return h.createElement("div",null,h.createElement("div",{className:"editor-base"},h.createElement(a.a,{groups:m}),h.createElement("textarea",null),h.createElement("div",{className:"exec-errors"},e.map((e,t)=>h.createElement(E,{key:t,alert:e,editor:n}))),h.createElement("div",{className:"input-buttons"},h.createElement("button",{type:"button",disabled:d,className:l("btn btn-primary exec-button selection",{"selection-selected":t,"btn-danger":e.length>0,"btn-success":c,disabled:d}),onClick:()=>{n?this.exec(n.getDoc().somethingSelected()):console.warn("editor not initialized yet")}},C?h.createElement("span",null,h.createElement(o.a,{icon:r.o})," ",h.createElement(s.b,{id:C})):h.createElement(h.Fragment,null,h.createElement("span",{className:"glyphicon glyphicon-play"})," ",h.createElement("span",{className:"query"},h.createElement(o.a,{icon:r.n})," ",h.createElement(s.b,{id:"calc.editors.ra.button-execute-query"})),h.createElement("span",{className:"selection"},h.createElement(s.b,{id:"calc.editors.ra.button-execute-selection"})))),h.createElement("div",{style:{float:"right"}},h.createElement(p.a,{color:"Link",type:"button",className:"hideOnSM",onClick:this.downloadEditorText},h.createElement(o.a,{icon:r.h})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.ra.button-download"}))),j?null:h.createElement("div",{className:"btn-group history-container"},h.createElement(i.a,{label:h.createElement("span",null,h.createElement(o.a,{icon:r.k})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.button-history"}))),elements:u.map(e=>({label:h.createElement(h.Fragment,null,h.createElement("small",{className:"muted text-muted"},e.time.toLocaleTimeString()),h.createElement("div",null,e.code)),value:e})),onChange:this.applyHistory})))),h.createElement("div",{className:"exec-result"},f),h.createElement(g.a,{isOpen:this.state.modal,toggle:this.toggle,className:"showOnSM"},h.createElement(y.a,{toggle:this.toggle},Object(s.d)("calc.result.modal.title")),h.createElement(b.a,null,h.createElement("div",null,f)),h.createElement(v.a,null,h.createElement("span",null),h.createElement(p.a,{color:"secondary",onClick:this.toggle},Object(s.d)("calc.result.modal.close")))),h.createElement(g.a,{isOpen:this.state.inlineRelationModal,toggle:this.toggleInlineRelationEditor},h.createElement(y.a,{toggle:this.toggleInlineRelationEditor},Object(s.d)("calc.editors.ra.inline-editor.title")),h.createElement(b.a,null,h.createElement("div",null,"group"===this.props.tab?h.createElement("div",null,h.createElement(_.a,{placeholder:Object(s.d)("calc.editors.ra.inline-editor.input-relation-name"),value:this.state.relationEditorName,onChange:e=>{this.setState({relationEditorName:e.target.value})}}),h.createElement("br",null)):null,h.createElement(w.a,{settings:this.hotTableSettings,licenseKey:"non-commercial-and-evaluation"}))),h.createElement(v.a,null,h.createElement(p.a,{color:"light",onClick:this.inlineRelationEditorDownload},h.createElement(o.a,{icon:r.h})," ",Object(s.d)("calc.editors.ra.inline-editor.button-download-csv")),h.createElement(p.a,{color:"light",onClick:()=>{var e;null===(e=this.uploadCSVRef.current)||void 0===e||e.click()}},h.createElement(o.a,{icon:r.s})," ",Object(s.d)("calc.editors.ra.inline-editor.button-upload-csv")),h.createElement("input",{className:"hidden",ref:this.uploadCSVRef,onChange:this.inlineRelationEditorUpload,type:"file"}),h.createElement("span",{className:"flexSpan"}),h.createElement(p.a,{color:"primary",onClick:this.inlineRelationEditorOk},h.createElement(o.a,{icon:r.e})," ",Object(s.d)("calc.editors.ra.inline-editor.button-ok")),h.createElement(p.a,{color:"secondary",onClick:this.inlineRelationEditorClose},h.createElement(o.a,{icon:r.r})," ",Object(s.d)("calc.editors.ra.inline-editor.button-cancel"))))))}isMobile(){return window.innerWidth<=992}toggleInlineRelationEditor(){this.setState({inlineRelationModal:!this.state.inlineRelationModal})}toggle(){this.isMobile()&&this.setState({modal:!this.state.modal})}applyHistory(e){this.replaceAll(e.code)}forceLinterRun(){const{editor:e}=this.state;if(!e)return void console.warn("editor not initialized yet");const t=e.getValue();e.setValue(""),e.setValue(t)}historyAddEntry(e){const{historyMaxEntries:t=10,historyMaxLabelLength:n=20}=this.props,r={time:new Date,label:e.length>n?e.substr(0,n-4)+" ...":e,code:e};this.setState({history:[r,...this.state.history].slice(-t)})}clearExecutionAlerts(){this.state.execErrors.splice(0,this.state.execErrors.length),m.b.dismiss()}addExecutionWarning(e,t){this._addExecutionAlert(e,t,"warning"),this.isMobile()&&m.b.warn(e,{className:"fancyToastWarning"})}addExecutionError(e,t){this._addExecutionAlert(e,t,"error"),this.isMobile()&&m.b.error(e,{className:"fancyToastError"})}_addExecutionAlert(e,t,n){this.isMobile();const{editor:r}=this.state,o={type:n,message:e,position:t},i=this.state.execErrors;i.push(o),this.setState({execErrors:i})}setText(e,t){const{editor:n}=this.state;n?("selection"===t?n.getDoc().replaceSelection(e,"end"):n.setValue(e),this.clearExecutionAlerts(),this.setState({execSuccessful:!1})):console.warn("editor not initialized yet")}getText(){const{editor:e}=this.state;if(e)return e.getValue();console.warn("editor not initialized yet")}focus(){const{editor:e}=this.state;e?e.focus():console.warn("editor not initialized yet")}refresh(){const{editor:e}=this.state;e?e.refresh():console.warn("editor not initialized yet")}downloadEditorText(){let e="query";const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");switch(t.getOption("mode")){case"sql":case"text/x-mysql":e+=".sql";break;case"ra":default:e+=".txt"}((e,t)=>{const n=document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"text/plain"})),n.download=e,n.click()})(e,t.getValue())}resetHinter(){this.hinterCache={hints:[],hintsFromLinter:[],changed:!0}}linter(t){const{editor:n}=this.state;if(!n)return console.warn("editor not initialized yet"),[];if(0===t.length||!this.props.linterFunction)return[];try{const e=this.props.linterFunction(this,n,t);return 0===e.length&&0===this.hinterCache.hintsFromLinter.length||(this.hinterCache.hintsFromLinter=e,this.hinterCache.changed=!0),[]}catch(t){const r=[];console.log(t);const o=O._generateErrorFromException(t,0,0),i=e("").append(o.message).text();if(!o.codemirrorPositions)return this.clearExecutionAlerts(),this.addExecutionError(i),[];const a=o.codemirrorPositions.from;let s=o.codemirrorPositions.to;const l=n.getTokenAt({line:a.line,ch:a.ch+1},!0),u=n.getDoc().getRange(a,s);return void 0!==l.string&&l.string.length>u.length&&(s=n.getDoc().posFromIndex(n.getDoc().indexFromPos(a)+l.string.length)),r.push({from:a,to:s,message:i,severity:"error"}),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers(),r}}genericHint(e){const{getHintsFunction:t}=this.props,n=e.getDoc().getCursor(),r=e.getTokenAt(n),o=(e,t="unknown")=>({text:e,displayText:e,className:`hint-${t}`});let i=[];if(!0===this.hinterCache.changed){const e={},n=t?t():[];for(let t=0;t0)for(let e=0;es.length&&0===t.indexOf(s)&&a.push(i[e])}else a=i;return{list:a,from:u.Pos(n.line,r.start),to:u.Pos(n.line,r.end)}}exec(e){const{editor:t}=this.state;if(!t)throw new Error("editor not initialized yet");this.setState({execResult:h.createElement("div",{className:"spinner"},h.createElement("div",{className:"rect1"}),h.createElement("div",{className:"rect2"}),h.createElement("div",{className:"rect3"}),h.createElement("div",{className:"rect4"}),h.createElement("div",{className:"rect5"}))},()=>{this.clearExecutionAlerts();let n="",r={line:0,ch:0};!0!==e?n=t.getValue():(n=t.getDoc().getSelection(),r=t.getDoc().getCursor("from")),0===n.length&&(this.clearExecutionAlerts(),this.addExecutionError(Object(s.d)("editor.error-no-query-found"))),this.clearExecutionAlerts();try{const{result:e}=this.props.execFunction(this,n,r);this.setState({execResult:e});const t=new CustomEvent("editor.execSuccessful",{detail:{editor:this}});return document.dispatchEvent(t),this.toggle(),!0}catch(e){console.error(e,e.stack);const t=O._generateErrorFromException(e,r.line,r.ch);this.addExecutionError(t.message,t.codemirrorPositions?t.codemirrorPositions.from:void 0),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers()}})}static _generateErrorFromException(e,t,n){let r=void 0!==e.message?e.message:e;r=r.replace(/(\\(u|x)[0-9A-F]+)/g,(e,t)=>`${String.fromCharCode(parseInt(t.substr(2),16))}`);let o=null;void 0!==e.codeInfo&&void 0!==e.codeInfo.location?o=e.codeInfo.location:void 0!==e.location&&(o=e.location);let i=null;return null!==o&&(i={from:{line:o.start.line+(t||0)-1,ch:o.start.column+(n||0)-1},to:{line:o.end.line+(t||0)-1,ch:o.end.column+(n||0)-1}}),{message:r,location:o,codemirrorPositions:i}}static buildTranslatedPegJsMessage(e,t){return null!==e&&function(e){let t=1;for(e.sort((e,t)=>e.descriptiont.description?1:0);t1?`${n.slice(0,-1).join(", ")} ${Object(s.d)("editor.pegjs-error.or")} ${n[e.length-1]}`:n[0],o=t?`"${function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+t(e)})).replace(/[\u0180-\u0FFF]/g,(function(e){return"\\u0"+t(e)})).replace(/[\u1080-\uFFFF]/g,(function(e){return"\\u"+t(e)}))}(t)}"`:Object(s.d)("editor.pegjs-error.end-of-input");return Object(s.d)("editor.pegjs-error.expected-found",{expected:r,found:o})}(e,t)}setExecutionDisabled(e){this.setState({isExecutionDisabled:e})}replaceText(e,t){const n="string"==typeof e.label?e.label:"";this.replaceSelection(n,t)}replaceSelection(e,t){this.setText(t||e,"selection"),this.focus()}replaceAll(e,t){this.setText(t||e,"all"),this.focus()}setReadOnly(t){const{editor:n}=this.state;if(!n)throw new Error("editor not initialized yet");const r=e(n.getWrapperElement());!1===t?(n.setOption("readOnly",!1),r.removeClass("readonly")):(n.setOption("readOnly","nocursor"),r.addClass("readonly"))}addInlineRelationMarkers(e){const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");const n=function(e){const t=[];return Object(d.a)(e,e=>{const n=e;if(n&&"table"===n.type){const e={name:n.name,line:n.codeInfo.location.start.line-1,column:n.codeInfo.location.start.column-1,length:n.codeInfo.text.length,assignmentName:n.assignmentName?n.assignmentName:"",content:{columns:n.columns,rows:n.rows},start:n.codeInfo.location.start,end:n.codeInfo.location.end};t.push(e)}}),t}(e);this.clearInlineRelationMarkers();for(let e=0;e{this.inlineRelationEditorOpen(n[e])},f.render(h.createElement(o.a,{icon:r.q}),i,()=>{i.style.marginLeft="-15px",t.setGutterMarker(n[e].line++,S,i)})}}clearInlineRelationMarkers(){const{editor:e}=this.state;e?e.clearGutter(S):console.warn("editor not initialized yet")}}function k(e){const t=[],n=function(e){const r=e.getSchema();for(let e=0;e-1&&!this.props.autohide&&(this._hideTimeout&&this.clearHideTimeout(),this.state.isOpen&&!this.props.isOpen&&this.toggle())},n.onMouseLeaveTooltipContent=function(e){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._showTimeout&&this.clearShowTimeout(),e.persist(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide")))},n.onEscKeyDown=function(e){"Escape"===e.key&&this.hide(e)},n.getRef=function(e){var t=this.props.innerRef;t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),this._popover=e},n.getDelay=function(e){var t=this.props.delay;return"object"==typeof t?isNaN(t[e])?S[e]:t[e]:t},n.show=function(e){if(!this.props.isOpen){if(this.clearShowTimeout(),this.currentTargetElement=e?e.currentTarget||e.target:null,e&&e.composedPath&&"function"==typeof e.composedPath){var t=e.composedPath();this.currentTargetElement=t&&t[0]||this.currentTargetElement}this.toggle(e)}},n.showWithDelay=function(e){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show.bind(this,e),this.getDelay("show"))},n.hide=function(e){this.props.isOpen&&(this.clearHideTimeout(),this.currentTargetElement=null,this.toggle(e))},n.hideWithDelay=function(e){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide"))},n.clearShowTimeout=function(){clearTimeout(this._showTimeout),this._showTimeout=void 0},n.clearHideTimeout=function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0},n.handleDocumentClick=function(e){var t=this.props.trigger.split(" ");t.indexOf("legacy")>-1&&(this.props.isOpen||T(e.target,this._targets))?(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&!k(e.target,this._popover)?this.hideWithDelay(e):this.props.isOpen||this.showWithDelay(e)):t.indexOf("click")>-1&&T(e.target,this._targets)&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen?this.hideWithDelay(e):this.showWithDelay(e))},n.addEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.addEventListener(e,t,n)}))},n.removeEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.removeEventListener(e,t,n)}))},n.addTargetEvents=function(){if(this.props.trigger){var e=this.props.trigger.split(" ");-1===e.indexOf("manual")&&((e.indexOf("click")>-1||e.indexOf("legacy")>-1)&&document.addEventListener("click",this.handleDocumentClick,!0),this._targets&&this._targets.length&&(e.indexOf("hover")>-1&&(this.addEventOnTargets("mouseover",this.showWithDelay,!0),this.addEventOnTargets("mouseout",this.hideWithDelay,!0)),e.indexOf("focus")>-1&&(this.addEventOnTargets("focusin",this.show,!0),this.addEventOnTargets("focusout",this.hide,!0)),this.addEventOnTargets("keydown",this.onEscKeyDown,!0)))}},n.removeTargetEvents=function(){this._targets&&(this.removeEventOnTargets("mouseover",this.showWithDelay,!0),this.removeEventOnTargets("mouseout",this.hideWithDelay,!0),this.removeEventOnTargets("keydown",this.onEscKeyDown,!0),this.removeEventOnTargets("focusin",this.show,!0),this.removeEventOnTargets("focusout",this.hide,!0)),document.removeEventListener("click",this.handleDocumentClick,!0)},n.updateTarget=function(){var e=Object(b.i)(this.props.target,!0);e!==this._targets&&(this.removeTargetEvents(),this._targets=e?Array.from(e):[],this.currentTargetElement=this.currentTargetElement||this._targets[0],this.addTargetEvents())},n.toggle=function(e){return this.props.disabled||!this._isMounted?e&&e.preventDefault():this.props.toggle(e)},n.render=function(){if(!this.props.isOpen)return null;this.updateTarget();var e=this.props,t=e.className,n=e.cssModule,r=e.innerClassName,o=e.isOpen,s=e.hideArrow,l=e.boundariesElement,u=e.placement,c=e.placementPrefix,d=e.arrowClassName,h=e.popperClassName,f=e.container,m=e.modifiers,p=e.offset,g=e.fade,y=e.flip,v=Object(b.l)(this.props,Object.keys(C)),_=Object(b.k)(h,n),w=Object(b.k)(r,n);return i.a.createElement(j,{className:t,target:this.currentTargetElement||this._targets[0],isOpen:o,hideArrow:s,boundariesElement:l,placement:u,placementPrefix:c,arrowClassName:d,popperClassName:_,container:f,modifiers:m,offset:p,cssModule:n,fade:g,flip:y},i.a.createElement("div",Object(a.a)({},v,{ref:this.getRef,className:w,role:"tooltip",onMouseOver:this.onMouseOverTooltipContent,onMouseLeave:this.onMouseLeaveTooltipContent,onKeyDown:this.onEscKeyDown})))},t}(i.a.Component);M.propTypes=C,M.defaultProps=O;var x=M,R=function(e){var t=l()("popover","show",e.popperClassName),n=l()("popover-inner",e.innerClassName);return i.a.createElement(x,Object(a.a)({},e,{popperClassName:t,innerClassName:n}))};R.propTypes=C,R.defaultProps={placement:"right",placementPrefix:"bs-popover",trigger:"click"};var L=R,A={tag:b.o,className:h.a.string,cssModule:h.a.object},D=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-header"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};D.propTypes=A,D.defaultProps={tag:"h3"};var N=D,P={tag:b.o,className:h.a.string,cssModule:h.a.object},I=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-body"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};I.propTypes=P,I.defaultProps={tag:"div"};var H=I;class Y extends o.Component{constructor(e){super(e),this.body=Object(r.a)((e,t)=>!1===t?null:"function"==typeof e?e():e),this.state={id:"popWrapper_"+Math.random().toString(36).substr(2),isOpen:!1},this.hoverOpen=this.hoverOpen.bind(this),this.hoverClose=this.hoverClose.bind(this),this.handleClick=this.handleClick.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this)}componentWillUnmount(){this.close()}open(){this.setState({isOpen:!0}),document.addEventListener("click",this.close)}close(e){if(e){const{target:t}=e;if(t instanceof Element&&null!==t.closest(".popover__inside"))return}this.setState({isOpen:!1}),document.removeEventListener("click",this.close)}hoverOpen(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.open()}hoverClose(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.close()}handleClick(e){const{trigger:t,onClick:n}=this.props;if(n&&n(e),"click"===t||Array.isArray(t)&&t.includes("click")){const{isOpen:e}=this.state;e?this.close():this.open()}}render(){const{id:e,isOpen:t}=this.state,{title:n,className:r=""}=this.props,i=this.body(this.props.body,t);return o.createElement(o.Fragment,null,o.createElement("div",{onMouseEnter:this.hoverOpen,onMouseLeave:this.hoverClose,onFocus:this.hoverOpen,onBlur:this.hoverClose,onClick:this.handleClick,id:e,className:`popover__outside ${r}`},o.Children.only(this.props.children),o.createElement(L,{target:`#${e}`,isOpen:t,className:`popover__inside ${r}`},o.createElement(N,null,n),o.createElement(H,null,i))))}}},"./src/calc2/components/raTree.scss":function(e,t,n){},"./src/calc2/components/result.scss":function(e,t,n){},"./src/calc2/components/toolbar.scss":function(e,t,n){},"./src/calc2/components/toolbar.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("./src/calc2/components/dropdownList.tsx"),o=n("./src/calc2/components/popover.tsx"),i=n("./src/calc2/i18n.tsx"),a=n("./node_modules/react/index.js");n("./src/calc2/components/toolbar.scss");class s extends a.Component{render(){const{groups:e}=this.props;return a.createElement("div",{className:"toolbar codemirror-toolbar"},e.map((e,t)=>e.items.map((e,t)=>a.createElement(o.a,{key:t,trigger:["hover","focus"],placement:"dropdown"===e.type?"top":"bottom",title:e.tooltipTitle?String(Object(i.d)(e.tooltipTitle)):"",body:a.createElement(i.b,{id:e.tooltip,html:!0}),className:("dropdown"===e.type?"toolbar__popover__dropdown":"toolbar__popover")+" "+(void 0===e.className?"":e.className)},"dropdown"===e.type?a.createElement(r.a,{label:e.label,elements:e.elements,onChange:e.onChange,value:e.value}):a.createElement("span",{onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onClick(e)}},e.label)))))}}},"./src/calc2/data/uibk.txt":function(e,t,n){"use strict";n.r(t),t.default="group: UIBK - R, S, T\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \ncategory@de:Universität Innsbruck\ncategory@en:University of Innsbruck\n\nR = {\na, b, c\n\n1, 'a', 'd'\n3, 'c', 'c'\n4, 'd', 'f'\n5, 'd', 'b'\n6, 'e', 'f'\n}\n\nS = {\nb, d\n\n'a', 100\n'b', 300\n'c', 400\n'd', 200\n'e', 150\n}\n\nT = {\nb, d\n\n'a', 100\n'd', 200\n'f', 400\n'g', 120\n}\n\ngroup: Kemper Datenbanksysteme\ndescription: Source: [Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage](http://www3.in.tum.de/teaching/bookDBMSeinf/), Seite 84, Abbildung 3.8\n\nProfessoren = {\nPersNr:number\tName:string\tRang:string\tRaum:number\n2125\tSokrates\tC4\t226\n2126\tRussel\tC4\t232\n2127\tKopernikus\tC3\t310\n2133\tPopper\tC3\t52\n2134\tAugustinus\tC3\t309\n2136\tCurie\tC4\t36\n2137\tKant\tC4\t7\n}\n\nStudenten = {\nMatrNr:number\tName:string\tSemester:number\n24002\tXenokrates\t18\n25403\tJonas\t12\n26120\tFichte\t10\n26830\tAristoxenos\t8\n27550\tSchopenhauer\t6\n28106\tCarnap\t3\n29120\tTheophrastos\t2\n29555\tFeuerbach\t2\n}\n\n\nVorlesungen = {\nVorlNr:number\tTitel:string\tSWS:number\tgelesenVon:number\n5001\tGrundzuege\t4\t2137\n5041\tEthik\t4\t2125\n5043\tErkenntnistheorie\t3\t2126\n5049\tMaeeutik\t2\t2125\n4052\tLogik\t4\t2125\n5052\tWissenschaftstheorie\t3\t2126\n5216\tBioethik\t2\t2126\n5259\t'Der Wiener Kreis'\t2\t2133\n5022\t'Glaube und wissen'\t2\t2134\n4630\t'Glaube und wissen'\t4\t2137\n}\n\nvoraussetzen = {\nVorgaenger:number\tNachfolger:number\n5001\t5041\n5001\t5043\n5001\t5049\n5041\t5216\n5043\t5052\n5041\t5052\n5052\t5259\n}\n\nhoeren = {\nMatrNr:number\tVorlNr:number\n26120\t5001\n27550\t5001\n27550\t4052\n28106\t5041\n28106\t5052\n28106\t5216\n28106\t5259\n29120\t5001\n29120\t5041\n29120\t5049\n29555\t5022\n25403\t5022\n29555\t5001\n}\n\nAssistenten = {\nPersNr:number\tName:string\tFachgebiet:string\tBoss:number\n3002\tPlaton\tIdeenlehre\t2125\n3003\tAristoteles\tSyllogistik\t2125\n3004\tWittgenstein\tSprachtheorie\t2126\n3005\tRhetikus\tPlanetenbewegung\t2127\n3006\tNewton\t'Keplersche Gesetze'\t2127\n3007\tSpinoza\t'Gott und Natur'\t2134\n}\n\npruefen = {\nMatrNr:number\tVorlNr:number\tPersNr:number\tNote:number\n28106\t5001\t2126\t1\n25403\t5041\t2125\t2\n27550\t4630\t2137\t2\n}\n\n\n\ngroup: UIBK - KursDB\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \n\nKurs = {\nKursNr, Titel\n\nG08, 'Grundlagen I'\nG10, 'Grundlagen II'\nP13, 'C-Programmierung'\nI09, Datenbanken\n}\n\nKursleiter = {\nPersNr, Name, Gehalt\n\n27183, 'Meier, I.', 4300.50\n29594, 'Schulze, H.', 3890.20\n38197, 'Huber, L.', 4200.10\n43325, 'Müller, K.', 3400.80\n}\n\nVorauss = {\nVorNr, KursNr\nG08, P13\nG10, P13\nG08, I09\nG10, I09\nP13, I09\n}\n\nFuehrt_durch = {\nAngNr\tKursNr\tPersNr\n1\tG08\t38197\n2\tG08\t38197\n1\tG10\t43325\n2\tG10\t29594\n1\tP13\t27183\n2\tP13\t27183\n1\tI09\t29594\n2\tI09\t29594\n3\tI09\t29594\n}\n\nTeilnehmer = {\nTnNr, Name, Ort \n143, 'Schmidt, M.', Bremen \n145, 'Huber, Chr.', Augsburg \n146, 'Abele, I.', Senden \n149, 'Kircher, B.', Bochum \n155, 'Meier, W.', Stuttgart \n171, 'Möller, H.', Innsbruck \n173, 'Schulze, B.', Stuttgart \n177, 'Mons, F.', Essen \n185, 'Meier, K.', Heidelberg \n187, 'Karstens, L.', Hamburg \n194, 'Gerstner, M.', Innsbruck \n}\n\nNimmt_teil = {\nAngNr\tKursNr\tTnNr\n2\tG08\t143\n2\tP13\t143\n1\tG08\t145\n1\tP13\t146\n1\tI09\t146\n2\tP13\t149\n1\tI09\t155\n1\tI09\t171\n1\tI09\t173\n2\tP13\t177\n1\tI09\t185\n2\tI09\t187\n1\tP13\t194\n}\n\nAngebot = {\nAngNr\tKursNr\tDatum\tOrt\n1\tG08\t2000-10-13\t'München'\n2\tG08\t2000-11-24\tBremen\n1\tG10\t2000-12-01\t'München'\n2\tG10\t2001-02-15\tHamburg\n1\tP13\t2001-05-28\tInnsbruck\n2\tP13\t2001-07-01\tEssen\n1\tI09\t2001-03-27\tStuttgart\n2\tI09\t2001-04-23\tHamburg\n3\tI09\t2001-05-29\t'München'\n}\n\n\n\ngroup:Database Systems The Complete Book - Exercise 2.4.1\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 52-55 ]]\n\nProduct = {\nmaker\tmodel\ttype\nA\t1001\tpc\nA\t1002\tpc\nA\t1003\tpc\nA\t2004\tlaptop\nA\t2005\tlaptop\nA\t2006\tlaptop\nB\t1004\tpc\nB\t1005\tpc\nB\t1006\tpc\nB\t2007\tlaptop\nC\t1007\tpc\nD\t1008\tpc\nD\t1009\tpc\nD\t1010\tpc\nD\t3004\tprinter\nD\t3005\tprinter\nE\t1011\tpc\nE\t1012\tpc\nE\t1013\tpc\nE\t2001\tlaptop\nE\t2002\tlaptop\nE\t2003\tlaptop\nE\t3001\tprinter\nE\t3002\tprinter\nE\t3003\tprinter\nF\t2008\tlaptop\nF\t2009\tlaptop\nG\t2010\tlaptop\nH\t3006\tprinter\nH\t3007\tprinter\n}\n\nPC = {\nmodel\tspeed\tram\thd\tprice\n1001\t2.66\t1024\t250\t2114\n1002\t2.1\t512\t250\t995\n1003\t1.42\t512\t80\t478\n1004\t2.8\t1024\t250\t649\n1005\t3.2\t512\t250\t630\n1006\t3.2\t1024\t320\t1049\n1007\t2.2\t1024\t200\t510\n1008\t2.2\t2048\t250\t770\n1009\t2\t1024\t250\t650\n1010\t2.8\t2048\t300\t770\n1011\t1.86\t2048\t160\t959\n1012\t2.8\t1024\t160\t649\n1013\t3.06\t512\t80\t529\n}\n\nLaptop = {\nmodel\tspeed\tram\thd\tscreen\tprice\n2001\t2\t2048\t240\t20.1\t3673\n2002\t1.73\t1024\t80\t17\t949\n2003\t1.8\t512\t60\t15.4\t549\n2004\t2\t512\t60\t13.3\t1150\n2005\t2.16\t1024\t120\t17\t2500\n2006\t2\t2048\t80\t15.4\t1700\n2007\t1.83\t1024\t120\t13.3\t1429\n2008\t1.6\t1024\t100\t15.4\t900\n2009\t1.6\t512\t80\t14.1\t680\n2010\t2\t2048\t160\t15.4\t2300\n}\n\nPrinter = {\nmodel\tcolor\ttype\tprice\n3001\ttrue\tink-jet\t99\n3002\tfalse\tlaser\t239\n3003\ttrue\tlaser\t899\n3004\ttrue\tink-jet\t120\n3005\tfalse\tlaser\t120\n3006\ttrue\tink-jet\t100\n3007\ttrue\tlaser\t200\n}\n\ngroup:Database Systems The Complete Book - Exercise 2.4.3\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 55-57 ]]\n\nClasses = {\nclass\ttype\tcountry\tnumGuns\tbore\tdisplacement\nBismarck\tbb\tGermany\t8\t15\t42000\nIowa\tbb\tUSA\t9\t16\t46000\nKongo\tbc\tJapan\t8\t14\t32000\n'North Carolina'\tbb\tUSA\t9\t16\t37000\nRenown\tbc\t'Gt. Britan'\t6\t15\t23000\nRevenge\tbb\t'Gt. Britan'\t8\t15\t29000\nTennessee\tbb\tUSA\t12\t14\t32000\nYamato\tbb\tJapan\t9\t18\t65000\n}\n\nBattles = {\nname\tdate\n'Denmark Strait'\t1941-05-24\nGuadalcanal\t1942-11-15\n'North Cape'\t1943-12-26\n'Surigao Strait'\t1944-10-25\n}\n\nOutcomes = {\nship\tbattle\tresult\nArizona\t'Pearl Harbor'\tsunk\nBismarck\t'Denmark Strait'\tsunk\nCalifornia\t'Surigao Strait'\tok\n'Duke of York'\t'North Cape'\tok\nFuso\t'Surigao Strait'\tsunk\nHood\t'Denmark Strait'\tsunk\n'King George V'\t'Denmark Strait'\tok\nKirishima\tGuadalcanal\tsunk\n'Prince of Wales'\t'Denmark Strait'\tdamaged\nRodney\t'Denmark Strait'\tok\nScharnhorst\t'North Cape'\tsunk\n'South Dakota'\tGuadalcanal\tdamaged\nTennessee\t'Surigao Strait'\tok\nWashington\tGuadalcanal\tok\n'West Virginia'\t'Surigao Strait'\tok\nYamashiro\t'Surigao Strait'\tsunk\n}\n\nShips = {\nname\tclass\tlaunched\nCalifornia\tTennessee\t1921\nHaruna\tKongo\t1915\nHiei\tKongo\t1914\nIowa\tIowa\t1943\nKirishima\tKongo\t1915\nKongo\tKongo\t1913\nMissouri\tIowa\t1944\nMusashi\tYamato\t1942\n'New Jersey'\tIowa\t1943\n'North Carolina'\t'North Carolina'\t1941\nRamillies\tRevenge\t1917\nRenown\tRenown\t1916\nRepulse\tRenown\t1916\nResolution\tRevenge\t1916\nRevenge\tRevenge\t1916\n'Royal Oak'\tRevenge\t1916\n'Royal Sovereign'\tRevenge\t1916\nTennessee\tTennessee\t1920\nWashington\t'North Carolina'\t1941\nWisconsin\tIowa\t1944\nYamato\tYamato\t1941\n}\n\n\ngroup:Wikipedia - Relational algebra (en)\ndescription[[This are the tables from [Relational algebra - Wikipedia The Free Encyclopedia](http://en.wikipedia.org/wiki/Relational_algebra)\n\nlicense: [CC BY-SA](http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)]]\n\nEmployee = {\n\tName:string, EmpId:number, DeptName:string\n\t'Harry' , 3415 , 'Finance' \n\t'Sally' , 2241 , 'Sales' \n\t'George' , 3401 , 'Finance' \n\t'Harriet' , 2202 , 'Sales' \n\t'Tim' , 1123 , 'Executive' \n}\n\nDept = {\n\tDeptName:string, Manager:string\n\t'Sales' , 'Harriet' \n\t'Production' , 'Charles' \n}\n\nCompleted = {\n\tStudent:string, Task:string\n\t'Fred' , 'Database1'\n\t'Fred' , 'Database2'\n\t'Fred' , 'Compiler1'\n\t'Eugene' , 'Database1'\n\t'Eugene' , 'Compiler1'\n\t'Sarah' , 'Database1'\n\t'Sarah' , 'Database2'\n}\n\nDBProject = {\n\tTask:string\n\t'Database1'\n\t'Database2'\n}\n\nCar = {\n\tCarModel:string, CarPrice:number\n\t'CarA' , 20000 \n\t'CarB' , 30000 \n\t'CarC' , 50000 \n}\n\nBoat = {\n\tBoatModel:string, BoatPrice:number\n\t'Boat1' , 10000 \n\t'Boat2' , 40000 \n\t'Boat3' , 60000 \n}"},"./src/calc2/i18n.tsx":function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return g}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./node_modules/i18next-browser-languagedetector/index.js"),i=n("./node_modules/react/index.js"),a=n("./src/locales/de.json"),s=n("./src/locales/en.json"),l=n("./src/locales/es.json"),u=n("./src/locales/kr.json"),c=n("./src/locales/pt.json");const d=r.b(o).init({resources:{en:{translations:s},de:{translations:a},es:{translations:l},kr:{translations:u},pt:{translations:c}},fallbackLng:"en",nsSeparator:":",keySeparator:!1,defaultNS:"translations",debug:!0});function h(e,t){return String(d.t(e,t))}const{Provider:f,Consumer:m}=i.createContext(d),p=e=>i.createElement(f,{value:d},e.children),g=({id:e,html:t=!1})=>i.createElement(m,null,n=>t?i.createElement("span",{dangerouslySetInnerHTML:{__html:String(n.t(e,{interpolation:{escapeValue:!1}}))}}):i.createElement("span",null,String(n.t(e))))},"./src/calc2/main.hot.tsx":function(e,t,n){"use strict";(function(e){var r=n("./src/calc2/main.tsx"),o=n("./node_modules/react-hot-loader/index.js");t.a=Object(o.hot)(e)(r.a)}).call(this,n("./node_modules/webpack/buildin/harmony-module.js")(e))},"./src/calc2/main.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return Gn}));n("./node_modules/bootstrap/dist/css/bootstrap.css");var r=n("./src/calc2/i18n.tsx"),o=n("./node_modules/react/index.js"),i=n.n(o),a=n("./node_modules/prop-types/index.js"),s=n.n(a),l=i.a.createContext(null);var u=function(e){e()},c={notify:function(){}};function d(){var e=u,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var h=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=d())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();var f=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=new h(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),s=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,s]);var u=n||l;return i.a.createElement(u.Provider,{value:a},r)},m=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),p=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"),g=n("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"),y=n.n(g),b=n("./node_modules/react-is/index.js"),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,_=[],w=[null,null];function E(e,t){var n=e[1];return[t.payload,n+1]}function j(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function C(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function S(e,t,n,r,o,i,a,s,l,u){if(e){var c=!1,d=null,h=function(){if(!c){var e,n,h=t.getState();try{e=r(h,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||l():(i.current=e,s.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=h,n.trySubscribe(),h();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var O=function(){return[null,0]};function k(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,s=n.methodName,u=void 0===s?"connectAdvanced":s,c=n.renderCountProp,d=void 0===c?void 0:c,f=n.shouldHandleStateChanges,g=void 0===f||f,v=n.storeKey,k=void 0===v?"store":v,T=(n.withRef,n.forwardRef),M=void 0!==T&&T,x=n.context,R=void 0===x?l:x,L=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),A=R;return function(t){var n=t.displayName||t.name||"Component",r=a(n),s=Object(m.a)({},L,{getDisplayName:a,methodName:u,renderCountProp:d,shouldHandleStateChanges:g,storeKey:k,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=L.pure;var c=l?o.useMemo:function(e){return e()};function f(n){var r=Object(o.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),a=r[0],l=r[1],u=r[2],d=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(b.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:A}),[a,A]),f=Object(o.useContext)(d),y=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var v=y?n.store:f.store,k=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,s)}(v)}),[v]),T=Object(o.useMemo)((function(){if(!g)return w;var e=new h(v,y?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[v,y,f]),M=T[0],x=T[1],R=Object(o.useMemo)((function(){return y?f:Object(m.a)({},f,{subscription:M})}),[y,f,M]),L=Object(o.useReducer)(E,_,O),D=L[0][0],N=L[1];if(D&&D.error)throw D.error;var P=Object(o.useRef)(),I=Object(o.useRef)(u),H=Object(o.useRef)(),Y=Object(o.useRef)(!1),F=c((function(){return H.current&&u===I.current?H.current:k(v.getState(),u)}),[v,D,u]);j(C,[I,P,Y,u,F,H,x]),j(S,[g,v,M,k,I,P,Y,H,x,N],[v,M,k]);var W=Object(o.useMemo)((function(){return i.a.createElement(t,Object(m.a)({},F,{ref:l}))}),[l,t,F]);return Object(o.useMemo)((function(){return g?i.a.createElement(d.Provider,{value:R},W):W}),[d,W,R])}var v=l?i.a.memo(f):f;if(v.WrappedComponent=t,v.displayName=r,M){var T=i.a.forwardRef((function(e,t){return i.a.createElement(v,Object(m.a)({},e,{forwardedRef:t}))}));return T.displayName=r,T.WrappedComponent=t,y()(T,t)}return y()(v,t)}}function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function M(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function B(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?k:n,o=t.mapStateToPropsFactories,i=void 0===o?N:o,a=t.mapDispatchToPropsFactories,s=void 0===a?D:a,l=t.mergePropsFactories,u=void 0===l?I:l,c=t.selectorFactory,d=void 0===c?F:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,l=a.pure,c=void 0===l||l,h=a.areStatesEqual,f=void 0===h?B:h,g=a.areOwnPropsEqual,y=void 0===g?M:g,b=a.areStatePropsEqual,v=void 0===b?M:b,_=a.areMergedPropsEqual,w=void 0===_?M:_,E=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),j=W(e,i,"mapStateToProps"),C=W(t,s,"mapDispatchToProps"),S=W(n,u,"mergeProps");return r(d,Object(m.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:j,initMapDispatchToProps:C,initMergeProps:S,pure:c,areStatesEqual:f,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var z=U();var V,q=n("./node_modules/react-dom/index.js");V=q.unstable_batchedUpdates,u=V;var G=n("./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");function K(e){return"/"===e.charAt(0)}function X(e,t){for(var n=t,r=n+1,o=e.length;r=0;c--){var d=o[c];"."===d?X(o,c):".."===d?(X(o,c),u++):u&&(X(o,c),u--)}if(!s)for(;u--;u)o.unshift("..");!s||""===o[0]||o[0]&&K(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function J(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var Q=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=J(t),o=J(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var Z=function(e,t){if(!e)throw new Error("Invariant failed")};function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e){return"/"===e.charAt(0)?e.substr(1):e}function ne(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function re(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function oe(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function ie(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(m.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=$(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function ae(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),c({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=ie(e,t,d(),y.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(y.entries[y.index]=r,c({action:"REPLACE",location:r}))}))},go:g,goBack:function(){g(-1)},goForward:function(){g(1)},canGo:function(e){var t=y.index+e;return t>=0&&t=0&&t<=r),active:e===t},o.createElement(ct,{onClick:()=>this.setPage(t)},t+1)));return o.createElement("ul",{className:"pagination"},o.createElement(st,{disabled:0===e},o.createElement(ct,{previous:!0,onClick:()=>this.setPage(e-1)})),i,o.createElement(st,{disabled:e+1>=r},o.createElement(ct,{next:!0,onClick:()=>this.setPage(e+1)})))}}var ht=n("./src/db/exec/ValueExpr.ts");n("./src/calc2/components/pagedTable.scss");class ft extends o.Component{constructor(e){super(e),this.state={page:0}}render(){const{table:e,maxLinesPerPage:t,showPagination:n=!0,className:r=""}=this.props,{page:i}=this.state,a=e.getSchema();return o.createElement("div",{className:"result-table pagedTable"},o.createElement("table",{className:r},o.createElement("thead",null,o.createElement("tr",null,a.getColumns().map((e,t)=>o.createElement("th",{key:t},e.toString())))),o.createElement("tbody",null,e.getRows(i*t,t).map((e,t)=>o.createElement("tr",{key:`row ${t}`},e.map((e,t)=>{const n=a.getType(t);return o.createElement("td",{key:`value ${t}`,className:`${n} ${null===e?"null":""}`},Object(ht.d)(e,n))}))))),n?o.createElement("div",{className:"pagination"},o.createElement(dt,{total:e.getNumRows(),maxLinesPerPage:t,pageChanged:e=>this.setState({page:e}),currentPage:i})):null)}}var mt=n("./src/calc2/components/popover.tsx"),pt=n("./src/db/exec/RANode.ts");n("./src/calc2/components/raTree.scss");class gt extends o.Component{constructor(e){super(e)}render(){const{root:e,numTreeLabelColors:t=0,activeNode:n,setActiveNode:r}=this.props;let i=0;const a=new Map,s=e=>{const l=e instanceof pt.c||e instanceof pt.a?s(e.getChild()):null,u=e instanceof pt.a?s(e.getChild2()):null;let c="";if(e.hasMetaData("fromVariable")){const n=e.getMetaData("fromVariable");!1===a.has(n)&&a.set(n,i++);const r=a.get(n)%t;c=o.createElement("span",null," ",o.createElement("span",{className:`label label-info label-info-${r}`},n," =")," ")}return o.createElement("li",null,o.createElement("div",{className:nt({node:!0,active:e===n}),onClick:()=>r&&r(e)},o.createElement(mt.a,{title:o.createElement("div",null,c,o.createElement("div",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!0,!1)}})),body:()=>{e.check(),e.getResult();const t=e.getSchema(),n=e.getResultNumRows();return o.createElement("div",null,"columns:",o.createElement("ul",null,t.getColumns().map((e,n)=>o.createElement("li",{key:n},e.toString()," ",o.createElement("small",{className:"muted text-muted"},t.getType(n))))),e.hasMetaData("naturalJoinConditions")?o.createElement("div",null,"natural join conditions:",o.createElement("ul",null,e.getMetaData("naturalJoinConditions").map(e=>o.createElement("li",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml()}})))):null,o.createElement("p",null,`${n} row${1===n?"":"s"}`),!0===e.getMetaData("isInlineRelation")&&e.hasMetaData("inlineRelationDefinition")?o.createElement("pre",null,e.getMetaData("inlineRelationDefinition")):null)},placement:"right",trigger:"hover"},o.createElement("a",{className:"formula"},c,o.createElement("span",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!1,!1)}}),o.createElement("br",null),o.createElement("span",{className:"resultCountLabel"},`${e.getResultNumRows()} row${1===e.getResultNumRows()?"":"s"}`)))),l||u?o.createElement("ul",null,l,u):null)};return o.createElement("div",{className:"ra-tree"},o.createElement("div",{className:"tree"},o.createElement("ul",null,s(e))))}}var yt=n("./node_modules/memoize-one/dist/memoize-one.esm.js");n("./src/calc2/components/result.scss");class bt extends o.Component{constructor(e){super(e),this.result=Object(yt.a)(e=>{try{return e.check(),e.getResult()}catch(e){return console.error(e),null}}),this.state={activeNode:e.root,result:null},this.setActiveNode=this.setActiveNode.bind(this)}setActiveNode(e){this.setState({activeNode:e})}render(){const{root:e,numTreeLabelColors:t}=this.props,{activeNode:n}=this.state,r=this.result(n);return o.createElement("div",{className:"ra-result clearfix"},o.createElement("div",null,o.createElement(gt,{root:e,activeNode:n,numTreeLabelColors:t,setActiveNode:this.setActiveNode})),o.createElement("div",{className:"result"},o.createElement("div",null,o.createElement("h4",{className:"result-formula",dangerouslySetInnerHTML:{__html:n.getFormulaHtml(!0,!1)}}),o.createElement("div",{className:"result-table"},r?o.createElement(ft,{className:"table table-condensed",maxLinesPerPage:10,table:r,showPagination:!0}):null))))}}var vt=n("./src/db/relalg.ts");const _t=["pi","sigma","rho","tau","<-","intersect","union","/","-","\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","full outer join","left semi join","right semi join","anti join","and","or","xor","||"];class wt extends o.Component{constructor(e){super(e),this.editorBase=null,this.state={autoreplaceOperatorsMode:"none"},this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,{autoreplaceOperatorsMode:t}=this.state,n={};return e.tables.forEach(e=>{n[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",execFunction:(e,t,i)=>{const a=Object(vt.b)(t,Object.keys(n));if(Object(vt.j)(a,n),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.h)(a,n);return s.check(),e.historyAddEntry(t),e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(a),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"relalg",linterFunction:(e,o,i)=>{const a=[],s=Object(vt.b)(i,Object.keys(n));Object(vt.j)(s,n);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const l=Object(vt.h)(s,n);if(l.check(),!1===o.getDoc().somethingSelected()){const e=o.getDoc().getCursor(),{query:n,cursor:r}=Object(vt.f)(i,s.operatorPositions,{line:e.line+1,column:e.ch+1},t);n!==i&&(o.setValue(n),o.getDoc().setCursor({line:r.line-1,ch:r.column-1}))}return e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(s),a.concat(Object(tt.b)(l))},getHintsFunction:()=>[..._t,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!0,items:[{label:"π",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.projection",tooltip:"calc.editors.ra.toolbar.projection-content"},{label:"σ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.selection",tooltip:"calc.editors.ra.toolbar.selection-content"},{label:"ρ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename",tooltip:"calc.editors.ra.toolbar.rename-content"},{label:"←",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename-columns-operator",tooltip:"calc.editors.ra.toolbar.rename-columns-operator-content"},{label:"→",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-arrow",tooltip:"calc.editors.ra.toolbar.right-arrow"},{label:"τ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.orderBy",tooltip:"calc.editors.ra.toolbar.orderBy-content"},{label:"γ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.groupBy",tooltip:"calc.editors.ra.toolbar.groupBy-content"}]},{math:!0,items:[{label:"∧",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.and",tooltip:"calc.editors.ra.toolbar.and-content"},{label:"∨",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.or",tooltip:"calc.editors.ra.toolbar.or-content"},{label:"¬",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not",tooltip:"calc.editors.ra.toolbar.not-content"},{label:"=",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.equals",tooltip:"calc.editors.ra.toolbar.equals-content"},{label:"≠",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not-equals",tooltip:"calc.editors.ra.toolbar.not-equals-content"},{label:"≥",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.greater-or-equals",tooltip:"calc.editors.ra.toolbar.greater-or-equals-content"},{label:"≤",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.lesser-or-equals",tooltip:"calc.editors.ra.toolbar.lesser-or-equals-content"}]},{math:!0,items:[{label:"∩",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.intersect",tooltip:"calc.editors.ra.toolbar.intersect-content"},{label:"∪",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.union",tooltip:"calc.editors.ra.toolbar.union-content"},{label:"÷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.division",tooltip:"calc.editors.ra.toolbar.division-content"},{label:"-",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.subtraction",tooltip:"calc.editors.ra.toolbar.subtraction-content"}]},{math:!0,items:[{label:"⨯",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.cross-join",tooltip:"calc.editors.ra.toolbar.cross-join-content"},{label:"⨝",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.natural-join",tooltip:"calc.editors.ra.toolbar.natural-join-content"},{label:"⟕",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-outer-join",tooltip:"calc.editors.ra.toolbar.left-outer-join-content"},{label:"⟖",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-outer-join",tooltip:"calc.editors.ra.toolbar.right-outer-join-content"},{label:"⟗",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.full-outer-join",tooltip:"calc.editors.ra.toolbar.full-outer-join-content"},{label:"⋉",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-semi-join",tooltip:"calc.editors.ra.toolbar.left-semi-join-content"},{label:"⋊",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-semi-join",tooltip:"calc.editors.ra.toolbar.right-semi-join-content"},{label:"▷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.anti-join",tooltip:"calc.editors.ra.toolbar.anti-join-content"}]},{math:!0,items:[{label:"=",onClick:e=>this.replaceText(e,"= "),tooltipTitle:"calc.editors.ra.toolbar.assignment",tooltip:"calc.editors.ra.toolbar.assignment-content"},{label:"--",onClick:e=>this.replaceText(e,"-- "),tooltipTitle:"calc.editors.ra.toolbar.single-line-comment",tooltip:"calc.editors.ra.toolbar.single-line-comment-content"},{label:"/*",onClick:e=>this.replaceText(e,"/* */"),tooltipTitle:"calc.editors.ra.toolbar.multi-line-comment",tooltip:"calc.editors.ra.toolbar.multi-line-comment-content"},{label:"{}",onClick:e=>this.replaceText(e,"{a:string, b:number, X.c:date\n\ta, 1, 1970-01-01\n}"),tooltipTitle:"calc.editors.ra.toolbar.inline-relation",tooltip:"calc.editors.ra.toolbar.inline-relation-content"}]},{items:[{label:o.createElement(et.a,{icon:Ze.q}),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.ra.toolbar.inline-relation-editor",tooltip:"calc.editors.ra.toolbar.inline-relation-editor-content"},{label:o.createElement(et.a,{icon:Ze.d}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.ra.toolbar.insert-date",tooltip:"calc.editors.ra.toolbar.insert-date-content"},{className:"showOnSM",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.m}),onClick:()=>{this.props.relInsertModalToggle()},tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{items:[{className:"dropdownToolbarButton",type:"dropdown",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.l}),tooltipTitle:"calc.editors.ra.toolbar.autoreplace-operators.title",tooltip:"calc.editors.ra.toolbar.autoreplace-operators.header",elements:[{type:"header",label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.header"})},{type:"separator"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.none"}),value:"none"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.plain2math"}),value:"plain2math"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.math2plain"}),value:"math2plain"}],value:t,onChange:e=>{this.setState({autoreplaceOperatorsMode:e},()=>{this.editorBase&&this.editorBase.forceLinterRun()})}}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}var Et=n("./src/calc2/utils/groupUtils.ts"),jt=n("./node_modules/reactstrap/lib/Button.js"),Ct=n.n(jt);class St extends o.Component{constructor(e){super(e),this.editorBase=null,this.autoParsingTimeout=null,this.replaceSelection=this.replaceSelection.bind(this)}static generateInfo(e){return{groupInfo:{source:"local",id:"draft",filename:"draft",index:0,maintainer:"",maintainerGroup:""},sourceInfo:{}}}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",disableHistory:!0,execButtonLabel:"calc.editors.group.button-exec",execFunction:(e,t,n)=>{const i=Object(vt.c)(t),{groupInfo:a,sourceInfo:s}=St.generateInfo(i),l=Object(Et.a)(i,a,s),u=o.createElement(o.Fragment,null,l.map((e,t)=>o.createElement("div",{key:t},o.createElement("h4",null,e.groupName.fallback," ",o.createElement(Ct.a,{color:"link",onClick:()=>{this.props.setDraft(e)}},o.createElement(r.b,{id:"calc.editors.group.button-use"}))),o.createElement("ul",{className:"table-list"},e.tables.map((e,n)=>{const r=l[t].tables[n].relation.getResult().getHtml();return o.createElement("li",{key:n},o.createElement("h5",null,e.tableName),o.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))})))));return i.groups.forEach(t=>{e.addInlineRelationMarkers(t)}),{result:u}},tab:"group",linterFunction:(e,t,n)=>{const r=Object(vt.c)(n);r.groups.forEach(t=>{e.addInlineRelationMarkers(t)});const{groupInfo:o,sourceInfo:i}=St.generateInfo(r);return Object(Et.a)(r,o,i),[]},getHintsFunction:()=>[..._t,"group","group@de","group@en","group@es","description","description@de","description@en","description@es","category","category@de","category@en","category@es",...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:o.createElement("span",null,o.createElement(et.a,{icon:Ze.q})," ",o.createElement(r.b,{id:"calc.editors.group.toolbar.add-new-relation"})),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.group.toolbar.add-new-relation",tooltip:"calc.editors.group.toolbar.add-new-relation-content"}]}]})}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}const Ot=["distinct","select distinct","from","where","order by","asc","desc","inner join","inner","join","natural","union","intersect","outer join","natural join","left join","right join","left outer join","right outer join","full outer join","group by","having","limit","offset","and","or","xor","||"];class kt extends o.Component{constructor(e){super(e),this.editorBase=null,this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"text/x-mysql",execFunction:(e,n,i)=>{const a=Object(vt.e)(n);if(Object(vt.j)(a,t),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),e.historyAddEntry(n),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"sql",linterFunction:(e,n,o)=>{const i=[],a=Object(vt.e)(o);Object(vt.j)(a,t);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),i.concat(Object(tt.b)(s))},getHintsFunction:()=>[...Ot,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:"select",tooltipTitle:"calc.editors.sql.toolbar.select",tooltip:"calc.editors.sql.toolbar.select",onClick:e=>this.replaceText(e,"select distinct")},{label:"from",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.from",tooltip:"calc.editors.sql.toolbar.from"},{label:"where",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.where",tooltip:"calc.editors.sql.toolbar.where"},{label:"group",tooltipTitle:"calc.editors.sql.toolbar.group-by",tooltip:"calc.editors.sql.toolbar.group-by",onClick:e=>this.replaceText(e,"group by")},{label:"having",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.having",tooltip:"calc.editors.sql.toolbar.having"},{label:"order",tooltipTitle:"calc.editors.sql.toolbar.order-by",tooltip:"calc.editors.sql.toolbar.order-by",onClick:e=>this.replaceText(e,"order by")},{label:"limit",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.limit",tooltip:"calc.editors.sql.toolbar.limit"},{label:o.createElement(et.a,{className:"showOnSM",icon:Ze.i}),onClick:e=>this.props.relInsertModalToggle,tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{math:!0,items:[{label:o.createElement("i",{className:"fa fa-calendar"}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.sql.toolbar.insert-date",tooltip:"calc.editors.sql.toolbar.insert-date-content"}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}function Tt(e,t){return e[t]?e[t]:e.fallback}var Mt=n("./node_modules/react-toastify/esm/react-toastify.js"),xt=(n("./node_modules/react-toastify/dist/ReactToastify.css"),{tabs:s.a.bool,pills:s.a.bool,vertical:s.a.oneOfType([s.a.bool,s.a.string]),horizontal:s.a.string,justified:s.a.bool,fill:s.a.bool,navbar:s.a.bool,card:s.a.bool,tag:ot.o,className:s.a.string,cssModule:s.a.object}),Rt=function(e){var t=e.className,n=e.cssModule,r=e.tabs,o=e.pills,a=e.vertical,s=e.horizontal,l=e.justified,u=e.fill,c=e.navbar,d=e.card,h=e.tag,f=Object(p.a)(e,["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"]),g=Object(ot.k)(rt()(t,c?"navbar-nav":"nav",!!s&&"justify-content-"+s,function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-"+e+"-column")}(a),{"nav-tabs":r,"card-header-tabs":d&&r,"nav-pills":o,"card-header-pills":d&&o,"nav-justified":l,"nav-fill":u}),n);return i.a.createElement(h,Object(m.a)({},f,{className:g}))};Rt.propTypes=xt,Rt.defaultProps={tag:"ul",vertical:!1};var Lt=Rt,At=n("./node_modules/@babel/runtime/helpers/esm/objectSpread.js"),Dt=n("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),Nt=n("./node_modules/react-popper/lib/esm/Manager.js"),Pt=i.a.createContext({}),It={a11y:s.a.bool,disabled:s.a.bool,direction:s.a.oneOf(["up","down","left","right"]),group:s.a.bool,isOpen:s.a.bool,nav:s.a.bool,active:s.a.bool,addonType:s.a.oneOfType([s.a.bool,s.a.oneOf(["prepend","append"])]),size:s.a.string,tag:ot.o,toggle:s.a.func,children:s.a.node,className:s.a.string,cssModule:s.a.object,inNavbar:s.a.bool,setActiveFromChild:s.a.bool},Ht=[ot.j.space,ot.j.enter,ot.j.up,ot.j.down,ot.j.end,ot.j.home],Yt=function(e){function t(t){var n;return(n=e.call(this,t)||this).addEvents=n.addEvents.bind(Object(Dt.a)(n)),n.handleDocumentClick=n.handleDocumentClick.bind(Object(Dt.a)(n)),n.handleKeyDown=n.handleKeyDown.bind(Object(Dt.a)(n)),n.removeEvents=n.removeEvents.bind(Object(Dt.a)(n)),n.toggle=n.toggle.bind(Object(Dt.a)(n)),n.containerRef=i.a.createRef(),n}Object(G.a)(t,e);var n=t.prototype;return n.getContextValue=function(){return{toggle:this.toggle,isOpen:this.props.isOpen,direction:"down"===this.props.direction&&this.props.dropup?"up":this.props.direction,inNavbar:this.props.inNavbar,disabled:this.props.disabled}},n.componentDidMount=function(){this.handleProps()},n.componentDidUpdate=function(e){this.props.isOpen!==e.isOpen&&this.handleProps()},n.componentWillUnmount=function(){this.removeEvents()},n.getContainer=function(){return this.containerRef.current},n.getMenuCtrl=function(){return this._$menuCtrl||(this._$menuCtrl=this.getContainer().querySelector("[aria-expanded]")),this._$menuCtrl},n.getMenuItems=function(){return[].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'))},n.addEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.addEventListener(t,e.handleDocumentClick,!0)}))},n.removeEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)}))},n.handleDocumentClick=function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===ot.j.tab)){var t=this.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==ot.j.tab)&&this.toggle(e)}},n.handleKeyDown=function(e){var t=this;if(!/input|textarea/i.test(e.target.tagName)&&(ot.j.tab!==e.which||"menuitem"===e.target.getAttribute("role")&&this.props.a11y)&&((-1!==Ht.indexOf(e.which)||e.which>=48&&e.which<=90)&&e.preventDefault(),!this.props.disabled&&(this.getMenuCtrl()===e.target&&(!this.props.isOpen&&[ot.j.space,ot.j.enter,ot.j.up,ot.j.down].indexOf(e.which)>-1?(this.toggle(e),setTimeout((function(){return t.getMenuItems()[0].focus()}))):this.props.isOpen&&e.which===ot.j.esc&&this.toggle(e)),this.props.isOpen&&"menuitem"===e.target.getAttribute("role"))))if([ot.j.tab,ot.j.esc].indexOf(e.which)>-1)this.toggle(e),this.getMenuCtrl().focus();else if([ot.j.space,ot.j.enter].indexOf(e.which)>-1)e.target.click(),this.getMenuCtrl().focus();else if([ot.j.down,ot.j.up].indexOf(e.which)>-1||[ot.j.n,ot.j.p].indexOf(e.which)>-1&&e.ctrlKey){var n=this.getMenuItems(),r=n.indexOf(e.target);ot.j.up===e.which||ot.j.p===e.which&&e.ctrlKey?r=0!==r?r-1:n.length-1:(ot.j.down===e.which||ot.j.n===e.which&&e.ctrlKey)&&(r=r===n.length-1?0:r+1),n[r].focus()}else if(ot.j.end===e.which){var o=this.getMenuItems();o[o.length-1].focus()}else if(ot.j.home===e.which){this.getMenuItems()[0].focus()}else if(e.which>=48&&e.which<=90)for(var i=this.getMenuItems(),a=String.fromCharCode(e.which).toLowerCase(),s=0;s-1?"menuitem":void 0,n=Object(ot.l)(this.props,["toggle"]),r=n.className,o=n.cssModule,a=n.divider,s=n.tag,l=n.header,u=n.active,c=Object(p.a)(n,["className","cssModule","divider","tag","header","active"]),d=Object(ot.k)(rt()(r,{disabled:c.disabled,"dropdown-item":!a&&!l,active:u,"dropdown-header":l,"dropdown-divider":a}),o);return"button"===s&&(l?s="h6":a?s="div":c.href&&(s="a")),i.a.createElement(s,Object(m.a)({type:"button"===s&&(c.onClick||this.props.toggle)?"button":void 0},c,{tabIndex:e,role:t,className:d,onClick:this.onClick}))},t}(i.a.Component);tn.propTypes=en,tn.defaultProps={tag:"button",toggle:!0},tn.contextType=Pt;var nn=tn,rn={tag:ot.o,active:s.a.bool,className:s.a.string,cssModule:s.a.object},on=function(e){var t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=Object(p.a)(e,["className","cssModule","active","tag"]),s=Object(ot.k)(rt()(t,"nav-item",!!r&&"active"),n);return i.a.createElement(o,Object(m.a)({},a,{className:s}))};on.propTypes=rn,on.defaultProps={tag:"li"};var an=on,sn={tag:ot.o,innerRef:s.a.oneOfType([s.a.object,s.a.func,s.a.string]),disabled:s.a.bool,active:s.a.bool,className:s.a.string,cssModule:s.a.object,onClick:s.a.func,href:s.a.any},ln=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(Dt.a)(n)),n}Object(G.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():("#"===this.props.href&&e.preventDefault(),this.props.onClick&&this.props.onClick(e))},n.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=e.innerRef,s=Object(p.a)(e,["className","cssModule","active","tag","innerRef"]),l=Object(ot.k)(rt()(t,"nav-link",{disabled:s.disabled,active:r}),n);return i.a.createElement(o,Object(m.a)({},s,{ref:a,onClick:this.onClick,className:l}))},t}(i.a.Component);ln.propTypes=sn,ln.defaultProps={tag:"a"};var un=ln,cn=n("./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js"),dn=i.a.createContext({}),hn={tag:ot.o,activeTab:s.a.any,className:s.a.string,cssModule:s.a.object},fn=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={activeTab:n.props.activeTab},n}return Object(G.a)(t,e),t.getDerivedStateFromProps=function(e,t){return t.activeTab!==e.activeTab?{activeTab:e.activeTab}:null},t.prototype.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.tag,o=Object(ot.l)(this.props,Object.keys(hn)),a=Object(ot.k)(rt()("tab-content",t),n);return i.a.createElement(dn.Provider,{value:{activeTabId:this.state.activeTab}},i.a.createElement(r,Object(m.a)({},o,{className:a})))},t}(o.Component);Object(cn.polyfill)(fn);var mn=fn;fn.propTypes=hn,fn.defaultProps={tag:"div"};var pn={tag:ot.o,className:s.a.string,cssModule:s.a.object,tabId:s.a.any};function gn(e){var t=e.className,n=e.cssModule,r=e.tabId,o=e.tag,a=Object(p.a)(e,["className","cssModule","tabId","tag"]),s=function(e){return Object(ot.k)(rt()("tab-pane",t,{active:r===e}),n)};return i.a.createElement(dn.Consumer,null,(function(e){var t=e.activeTabId;return i.a.createElement(o,Object(m.a)({},a,{className:s(t)}))}))}gn.propTypes=pn,gn.defaultProps={tag:"div"};var yn=n("./node_modules/reactstrap/es/Modal.js"),bn=n("./node_modules/reactstrap/es/ModalHeader.js"),vn=n("./node_modules/reactstrap/es/ModalBody.js"),_n=n("./node_modules/reactstrap/es/ModalFooter.js");n("./src/calc2/components/groupRelationList.scss");const wn=({tables:e,replace:t,onElementClick:n})=>o.createElement("div",{className:"groupRelationList"},o.createElement("ul",null,e.map(e=>{const{columnNames:r,columnTypes:i,tableName:a}=e;return o.createElement("li",{key:a},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(a),n&&n()}},a),o.createElement("ul",null,e.columnNames.map((e,r)=>o.createElement("li",{key:e},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(e),n&&n()}},e," ",o.createElement("small",{className:"muted text-muted"},i[r]))," "))))})));var En=n("./node_modules/immutable/dist/immutable.es.js");class jn extends o.Component{constructor(e){super(e),this.getGroupsByHeadlineName=Object(yt.a)((e,t)=>{let n=En.b();const o=e=>Tt(e,t);for(const t of e.values()){let e=null;!0===t.isDraft?e=r.c.t("calc.maintainer-groups.temp"):t.category&&(e=o({lang:"",fallback:t.groupInfo.maintainerGroup}));const i=[...n.get(e)||[],t];i.sort((e,t)=>o(e.groupName).localeCompare(o(t.groupName))),n=n.set(e,i)}return n}),this.gistLink=""}render(){const{current:e,locale:t}=this.props,n=this.getGroupsByHeadlineName(this.props.groups,t);return o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-6"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.headline"})),o.createElement("ul",{id:"groups-selector-list"},n.map((n,i)=>o.createElement("li",{key:`${i}`},i||o.createElement(r.b,{id:"calc.maintainer-groups.misc"}),o.createElement("ul",null,n.map((n,r)=>{const{groupName:i,groupInfo:a}=n,s=`/relax/calc/${a.source}/${a.id}/${a.filename}/${a.index}`;return o.createElement("li",{key:s,className:nt({active:e&&e.group.groupInfo===n.groupInfo})},o.createElement(Qe,{to:s,onClick:()=>{this.props.datasetLoaded()}},Tt(i,t)))})))).valueSeq().toArray())),o.createElement("div",{className:"col-md-6 align-text-top align-top"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.load-gist-headline"})),o.createElement("input",{type:"text",className:"form-control gist-load-input",placeholder:"","data-i18n":"[placeholder]calc.menu.load-gist-insert-placeholder",size:32,onChange:e=>{this.gistLink="/relax/calc/gist/"+e.target.value}}),o.createElement("button",{onClick:()=>{document.location.href=this.gistLink,this.props.datasetLoaded()},type:"button",className:"fullWidthBtn btn btn-secondary gist-load-btn"},o.createElement(r.b,{id:"calc.menu.load-gist-button"})),o.createElement("hr",null),o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-headline"})),o.createElement("p",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-text"})," ",o.createElement(Xe,{to:"/help#tutorial-maintainer"},o.createElement(r.b,{id:"calc.menu.create-own-dataset-text-link"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-new-btn",onClick:()=>{this.props.loadGroupTab(!1)}},o.createElement("i",{className:"fa fa-plus-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-new"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-current-btn",onClick:()=>{this.props.loadGroupTab(!0)}},o.createElement("i",{className:"fa fa-pencil-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-modify"}))))))}}const Cn=z(e=>({groups:e.groups.groups,current:e.groups.current,locale:e.session.locale}))(jn);var Sn={light:s.a.bool,dark:s.a.bool,full:s.a.bool,fixed:s.a.string,sticky:s.a.string,color:s.a.string,role:s.a.string,tag:ot.o,className:s.a.string,cssModule:s.a.object,expand:s.a.oneOfType([s.a.bool,s.a.string])},On=function(e){var t,n=e.expand,r=e.className,o=e.cssModule,a=e.light,s=e.dark,l=e.fixed,u=e.sticky,c=e.color,d=e.tag,h=Object(p.a)(e,["expand","className","cssModule","light","dark","fixed","sticky","color","tag"]),f=Object(ot.k)(rt()(r,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-"+e)}(n),((t={"navbar-light":a,"navbar-dark":s})["bg-"+c]=c,t["fixed-"+l]=l,t["sticky-"+u]=u,t)),o);return i.a.createElement(d,Object(m.a)({},h,{className:f}))};On.propTypes=Sn,On.defaultProps={tag:"nav",expand:!1};var kn=On,Tn={tag:ot.o,className:s.a.string,cssModule:s.a.object},Mn=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(p.a)(e,["className","cssModule","tag"]),a=Object(ot.k)(rt()(t,"navbar-brand"),n);return i.a.createElement(r,Object(m.a)({},o,{className:a}))};Mn.propTypes=Tn,Mn.defaultProps={tag:"a"};var xn=Mn,Rn=n("./node_modules/reactstrap/lib/NavLink.js"),Ln=n.n(Rn);class An extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"desktopNavbar"},o.createElement(xn,{href:"/"},"RelaX"),o.createElement(Lt,{className:"ml-auto",navbar:!0},o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," Calculator")),o.createElement(Bt,{nav:!0,inNavbar:!0,className:"navItemSpace"},o.createElement(Gt,{nav:!0,caret:!0},o.createElement(et.a,{icon:Ze.j})," ",o.createElement(r.b,{id:"calc.navigation.language"})),o.createElement(Zt,{right:!0},o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"),o.createElement(nn,{onClick:()=>this.changeLocale("pt")},"pt"))),o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.feedback"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.help"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})))))}}n("./src/calc2/components/calculator.scss");class Dn extends o.Component{constructor(e){super(e),this.refEditorRelalg=o.createRef(),this.refEditorSql=o.createRef(),this.refEditorGroup=o.createRef(),Mt.b.configure(),this.state={activeTab:"relalg",datasetModal:!1,relationModal:!1},this.getCurrentEditor=this.getCurrentEditor.bind(this),this.toggleDatasetModal=this.toggleDatasetModal.bind(this),this.insertRelationToggle=this.insertRelationToggle.bind(this),this.loadGroupEditor=this.loadGroupEditor.bind(this)}toggleDatasetModal(){this.setState({datasetModal:!this.state.datasetModal})}insertRelationToggle(){this.setState({relationModal:!this.state.relationModal})}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}getCurrentEditor(){switch(this.state.activeTab){case"sql":return this.refEditorSql;case"relalg":return this.refEditorRelalg;case"group":return this.refEditorGroup}}loadGroupEditor(e){let t="-- this is an example\ngroup: nameOfTheNewGroup \n\nA = {\na:string, b:number\nexample, 42\n}";!0===e&&(t=this.props.group.definition),this.setState({activeTab:"group"},()=>{const e=this.getCurrentEditor().current;e&&e.editorBase.state.editor.setValue(t),this.toggleDatasetModal()})}render(){const{group:e,locale:t}=this.props,{activeTab:n}=this.state;return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement("div",{className:"calculator"},o.createElement(Mt.a,{enableMultiContainer:!0,position:Mt.b.POSITION.TOP_RIGHT}),o.createElement("div",{className:"row"},o.createElement("div",{className:"d-none d-xs-block d-sm-block d-md-block col-lg-1 col-xl-2"}),o.createElement("div",{className:"groups-container col-xs-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"},o.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"dropdownMenu1",onClick:this.toggleDatasetModal,style:{width:"100%",textAlign:"left",textOverflow:"ellipsis",overflow:"hidden"}},o.createElement("span",null,"Select DB (",Tt(e.groupName,t),")"),o.createElement("span",{className:"caret",style:{display:"block",position:"absolute",top:"50%",right:"10px"}})),o.createElement("div",null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:null}))),o.createElement("div",{className:"calculator-container col-xs-12 col-sm-12 col-md-12 col-lg-8 col-xl-6"},o.createElement(Lt,{tabs:!0},o.createElement(Bt,{nav:!0,inNavbar:!0,className:"showOnSM"},o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{onClick:this.toggleDatasetModal},o.createElement(et.a,{icon:Ze.g})," ",o.createElement(r.b,{id:"calc.menu.datasets"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(an,null,o.createElement(un,{className:nt({active:"relalg"===n}),onClick:()=>{this.setState({activeTab:"relalg"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"sql"===n}),onClick:()=>{this.setState({activeTab:"sql"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"group"===n}),onClick:()=>{this.setState({activeTab:"group"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name-short"}))))),o.createElement(mn,{activeTab:this.state.activeTab,className:"tab-content-border"},o.createElement(gn,{tabId:"relalg"},o.createElement(wt,{group:e,ref:this.refEditorRelalg,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"sql"},o.createElement(kt,{group:e,ref:this.refEditorSql,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"group"},o.createElement(St,{group:e,ref:this.refEditorGroup,setDraft:this.props.setDraft}))))),o.createElement(yn.a,{isOpen:this.state.datasetModal,toggle:this.toggleDatasetModal},o.createElement(bn.a,{toggle:this.toggleDatasetModal},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement("div",null,o.createElement(Cn,{datasetLoaded:()=>{this.setState({datasetModal:!1})},loadGroupTab:e=>{this.loadGroupEditor(e)}}))),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.toggleDatasetModal},Object(r.d)("calc.result.modal.close")))),o.createElement(yn.a,{isOpen:this.state.relationModal,toggle:this.insertRelationToggle},o.createElement(bn.a,{toggle:this.insertRelationToggle},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:this.insertRelationToggle})),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.insertRelationToggle},Object(r.d)("calc.result.modal.close"))))))}}class Nn extends o.Component{constructor(e){super(e),this.query="",this.success="",this.result="",this.state={},this.query=atob(e.params.query)}componentDidMount(){this.runQuery(this.query)}runQuery(e){try{const{group:t}=this.props,n={};t.tables.forEach(e=>{n[e.tableName]=e.relation});const o=Object(vt.b)(e,Object.keys(n));if(Object(vt.j)(o,n),null===o.child)throw o.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const i=Object(vt.h)(o,n);i.check(),this.result=JSON.stringify(i.getResult()),this.success="true"}catch(e){this.success="false",this.result=e.toString()}}render(){return o.createElement("div",{id:"apiContainer"},o.createElement("div",{id:"success"},this.success),o.createElement("div",{id:"query"},this.query),o.createElement("div",{id:"result"},this.result))}}var Pn=n("./node_modules/query-string/index.js"),In=n.n(Pn);class Hn extends o.Component{constructor(e){super(e),this.apiView=!1,this.params={},this.init=!1}componentDidMount(){this.apiView="api"==this.props.location.pathname.split("/")[2],this.params=In.a.parse(this.props.location.search)}componentDidUpdate(e){const{params:t}=this.props.match,{params:n}=e.match;!1!==this.init&&t.source===n.source&&t.id===n.id&&t.filename===n.filename&&t.index===n.index||(this.init=!0,this.loadGroup(this.props))}loadGroup(e){const{source:t,id:n,filename:r,index:o}=e.match.params;this.props.loadGroup(t,n,r,Number.parseInt(o,10),"","")}componentWillReceiveProps(e){const{params:t}=this.props.match,{params:n}=e.match;n.source!==t.source||n.id!==t.id||n.filename!==t.filename||(n.index,t.index)}render(){const{locale:e}=this.props,{current:t}=this.props.groups;return null!==t?1==this.apiView?o.createElement(Nn,{group:t.group,locale:e,params:this.params}):o.createElement(Dn,{group:t.group,locale:e,setDraft:this.props.setDraft}):o.createElement("div",null,"loading ...")}}const Yn=z(e=>({groups:e.groups,locale:e.session.locale}),e=>({loadGroup:(t,n,r,o,i,a)=>{e({type:"GROUPS_LOAD_REQUEST",source:t,id:n,maintainer:i,maintainerGroup:a,setCurrent:{filename:r,index:o}})},setDraft:t=>{e({type:"GROUP_SET_DRAFT",draft:t})}}))(Hn);var Fn=n("./node_modules/jquery/dist/jquery.js"),Wn=n("./node_modules/railroad-diagrams/railroad-diagrams.js");n("./node_modules/railroad-diagrams/railroad-diagrams.css");class Bn extends o.Component{componentDidMount(){const e=q.findDOMNode(this);if(!e)throw new Error("could not find node");this.props.diagram.addTo(e)}shouldComponentUpdate(e){return this.props.diagram!==e.diagram}render(){return o.createElement("div",null)}}n("./src/calc2/views/help.css");class Un extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"mobileNavbar"},o.createElement(Bt,null,o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(xn,{href:"/"},"RelaX"))}}class zn extends o.Component{componentDidMount(){const e=Fn("#toc");let t=0,n=null,r=null,o=null;Fn("h2, h3, h4, h5, h6").each((function(){const i=Fn(this),a=i.attr("name")||i.attr("id")||"tocId"+t++;i.attr("name",a),i.attr("id",a);const s=''+i.text()+"";if(i.is("h2"))e.append(Fn(`
${s}
    `)),n=e.find("ul:last");else if(i.is("h3")){if(!n)throw new Error("malformed headings");n.append(Fn(`
  • ${s}
    • `)),r=n.find("ul:last")}else if(i.is("h4")){if(!r)throw new Error("malformed headings");r.append(Fn(`
    • ${s}
      • `)),o=r.find("ul:last")}else{if(!o)throw new Error("malformed headings");o.append(`
      • ${s}
      • `)}})),Fn("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each((function(){Fn(this).append(` `)}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Un,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("h1",{id:"help"},"RelaX - Help"),o.createElement("div",{id:"toc"}),o.createElement("h2",{id:"tutorial-user"},"Tutorial - user"),o.createElement("h3",{id:"tutorial-user-coreconcepts"},"The core concepts"),o.createElement("p",null,"The goal of this tutorial is to give a quick introduction how to use the relational algebra calculator and its concepts. It assumes that you already know the relational algebra or are learning it from other sources."),o.createElement("p",null,"There is no real standard for the relational algebra like there is for SQL. So every book or teacher might have its slightly different interpretation and notation.",o.createElement("br",null),'The goal of this progam was to support the most commonly used "mathematical" notation used by ',o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),", ",o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/",lang:"de"},"Datenbanksysteme: Eine Einführung by Alfons Kemper and André Eickler")," and ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Relational_algebra"},"Wikipedia - Relational Algebra")," and others."),o.createElement("h4",{id:"tutorial-user-relations"},"relations"),o.createElement("p",null,"The core element of the calculator is the relation (or table) which consists of a fixed number of attributes (or columns) in a fixed order (this is called the schema of the relation) and a set of tuples or rows containing the specific values."),o.createElement("p",null,"Each attribute has three distinct properties: its type, its position and its name."),o.createElement("p",null,"The type or domain of an attribute is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean"),".",o.createElement("br",null),"The type is used for example to determine if two values can be compared in a boolean expression or if two schemas are union compatible. In most cases the type of the attributes are obvious if you look at the values."),o.createElement("p",null,"The position of each attribute in a schema is fixed and can be used to adress the attributes.",o.createElement("br",null),"An example would be the projection of the first and third attribute or column of an arbitrary relation R: ",o.createElement("code",{className:"example block"},"π [1], [3] ( R )")),o.createElement("p",null,"The full qualified name of the attribute is a unique identifier of the attribute within the schema of its relation. It consists of the name itself and a relation qualifier and are written like in SQL as ",o.createElement("code",null,"R.a"),"where a is the name and R is the relation qualifier.",o.createElement("br",null),"An example would be the projectoin of the attributes a, b from a relation R: ",o.createElement("code",{className:"example block"},"π R.a, R.b ( R )"),o.createElement("br",null),"The default relation qualifier of each attribute is the name of its relation.",o.createElement("br",null),"If the attributes name without the qualifier is unique within the relation's schema, it also can be used to address a specific attribute.",o.createElement("br",null),"The previous example could also be written as ",o.createElement("code",null,"π a, b ( R )"),"."),o.createElement("p",null,"Each relation has a set of tuples (or rows). This means that there are no duplicate tuples within one relation and the duplicate-elimination is implicitly executed after every single step of the calculation.",o.createElement("br",null),"The tuples in the calculator have a defined order and unlike a normal database system all operations are implemented to preserve that order. This should help the users to see what has changed from one step to the next."),o.createElement("p",null,"so far we covered that"),o.createElement("ul",null,o.createElement("li",null,"relations are the core elements,"),o.createElement("li",null,"relations have a schema and a set of tuples,"),o.createElement("li",null,"each attribute in the schema has",o.createElement("ul",null,o.createElement("li",null,"data-type"),o.createElement("li",null,"a position"),o.createElement("li",null,"a fully qualified name (RELATION.attributename)"))),o.createElement("li",null,"and that each attribute can be addressed within an operation using",o.createElement("ul",null,o.createElement("li",null,"its position e.g. ",o.createElement("code",{className:""},"π [1], [2] ( R )"),","),o.createElement("li",null,"the attribute name e.g. ",o.createElement("code",{className:""},"π a, b ( R )")),o.createElement("li",null,"or its full quallified name if the unqualified is not unique e.g. ",o.createElement("code",{className:""},"π R.a, S.a ( R x S )"))))),o.createElement("h3",{id:"tutorial-user-plain-text-notation"},"Alternative plain text notation"),o.createElement("p",null,"Before we introduce how to use the operators this should be a quick introduction of a very handy feature of the relational algebra calculator: the alternative plain text notation"),o.createElement("p",null,'The "classNameic" mathematical notation uses greek letters like π, σ for the unary operations and special symbols like the join symbol ',o.createElement("span",{className:"math"},"⋈")," or the union symbol ",o.createElement("span",{className:"math"},"∪"),"for some binary operations.",o.createElement("br",null),"This symbols can be entered using the toolbar at the top of the editor."),o.createElement("p",null,'This calculator also supports a alternative syntax for all this symbols that follows two very simple rules: Every greek letter can be substituted with its name spelled out ("pi" for π, "gamma" for γ) and every other symbol has an equivalent name that is borrowed from SQL, programming languages like C and ',o.createElement("a",{href:"http://en.wikipedia.org/wiki/Set_theory"},"Set theory"),"."),o.createElement("p",null,"This substitutions should be easy to read and much more important very easy to write because you don't need any toolbar or mouse. The calculator also supports autocomplete: just press [CTRL]+[SPACE] to complete the current keyword.",o.createElement("br",null),"This feature should help you to write your statements more quickly and fluently."),o.createElement("code",{className:"example block"},"π R.a, S.a, S.b σ R.a = S.a ∧ ( R.a > 5 ∨ R.a ","<"," 0 ) ( R ⨯ S )"),"is equivalent to:",o.createElement("code",{className:"example block"},"pi R.a, S.a, S.b sigma R.a = S.a and ( R.a > 5 or R.a ","<"," 0 ) ( R cross join S )"),"In the following table you can see a list of all supported substitutions:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"classNameical notation"),o.createElement("th",null,"alternative notation"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",{className:"math"},"π"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("td",{className:"math"},"σ"),o.createElement("td",null,"sigma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"ρ"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("td",{className:"math"},"τ"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("td",{className:"math"},"γ"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∩"),o.createElement("td",null,"intersect")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∪"),o.createElement("td",null,"union")),o.createElement("tr",null,o.createElement("td",{className:"math"},"-"),o.createElement("td",null,"\\")),o.createElement("tr",null,o.createElement("td",{className:"math"},"÷"),o.createElement("td",null,"/")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⨯"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"x"),o.createElement("li",null,"cross join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋈"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"join"),o.createElement("li",null,"inner join"),o.createElement("li",null,"natural join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟕"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"left join"),o.createElement("li",null,"left outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟖"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"right join"),o.createElement("li",null,"right outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟗"),o.createElement("td",null,"full outer join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋉"),o.createElement("td",null,"left semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋊"),o.createElement("td",null,"right semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"▷"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"anti semi join"),o.createElement("li",null,"anti join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"←"),o.createElement("td",null,"<","-",o.createElement("code",{className:"example block"},"pi new_name ","<","- a ( R )"))),o.createElement("tr",null,o.createElement("td",{className:"math"},"→"),o.createElement("td",null,"->",o.createElement("code",{className:"example block"},"pi a -> new_name ( R )")))))),o.createElement("ul",null,o.createElement("li",null,"schema preserving operations - operations where the resulting relation has the same schema as its first argument-relation:",o.createElement("ul",null,o.createElement("li",null,"selection"),o.createElement("li",null,"union"),o.createElement("li",null,"intersection"),o.createElement("li",null,"subtraction"),o.createElement("li",null,"orderby"),o.createElement("li",null,"left outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"anti join")))),o.createElement("h3",{id:"tutorial-user-relalg"},"Relational algebra"),o.createElement("p",null,"For this Part we use the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset')," with 3 relations: ",o.createElement("i",null,"Customers"),", ",o.createElement("i",null,"Accounts")," and ",o.createElement("i",null,"PremiumCustomers"),". By convention relations start with a uppercase letter and attributes with a lower case letter."),o.createElement("h4",null,"Open and inspect dataset"),o.createElement("p",null,"Open the dataset used in this tutorial using the following link to the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset'),"."),o.createElement("p",null,"You find the relations and their attributes listed on the side and if you hover a relations name a preview of the first view tuples is displayed."),o.createElement("h4",{id:"tutorial-user-basic-query"},"The most basic query"),o.createElement("p",null,"After you have found the Dataset you can formulate the very first and most basic query in relational algebra: a relation without any further manipulation."),o.createElement("p",null,"Just enter the name of a relation into the code editor or click on the relation/attribute names to insert them into the code editor.",o.createElement("br",null),"Note that the editor supports auto completing the relation/attribute names of the current dataset and the operators with [CTRL]+[SPACE]"),o.createElement("p",null,"So if you want all tuples of the relation ",o.createElement("i",null,"Customer")," you should have the following statement: ",o.createElement("code",null,"Customer"),". And get all the tuples if you press the execute button or press [CTRL]+[RETURN]."),o.createElement("h4",{id:"tutorial-user-unary-operations"},"Unary operations"),o.createElement("p",null,"All unary operations have the same basic syntax ",o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")")),"."),o.createElement("p",{className:"hint"},"The braces around the ",o.createElement("code",null,"CHILD_EXPRESSION")," can be omitted. In this case the predefined ",o.createElement("a",{href:"#relalg-operator-precedence"},"operator precedence for relational algebra")," applies."),o.createElement("p",null,"A complete list of the supported relalg operations can be found here: ",o.createElement("a",{href:"#relalg-syntax"},"general syntax"),", ",o.createElement("a",{href:"#relalg-unary-operations"},"unary operations")," and ",o.createElement("a",{href:"#relalg-binary-operations"},"binary operations"),"."),o.createElement("p",null,"The projection is one of the basic operations that allow to choose which of the attributes of the parent relations should be included in the new one and in which order they should be."),o.createElement("p",null,"Renaming a relation (ρ) changes the qualifiers of all the relations attributes but does not touch the tuples."),o.createElement("p",null,"Renaming an attribute (ρ) only changes the name of a specific attribute (and leaves his relation-qualifier unchanged)."),o.createElement("p",null,"The statement ",o.createElement("code",null,"pi balance ( Accounts )")," returns a new relation with only the balance attribute."),o.createElement("p",null,"The next statement gets the balance with the account-id after renaming the relation to ",o.createElement("i",null,"A")," and renames one of the attributes."),o.createElement("code",{className:"example block"},"rho account_number ","<","- aid ( pi aid, A.balance ( rho A ( Accounts ) ) )"),o.createElement("p",{className:"hint"},"Like in SQL or most programming languages you can format your statement and use SQL like comments (with ",o.createElement("code",null,"-- ...")," or ",o.createElement("code",null,"/* ... */"),") to increase the readability."),o.createElement("p",null,"The next statement uses a selection to filter the tuples of a relation based on a boolean expression. The calculator supports complex boolean expression with functions and built in operator precedence.",o.createElement("br",null),"The attributes in the boolean expression can be given as name or numeric position like with the projection."),o.createElement("p",null,"The next statement selects all customers-ids of customers who have the same value for their firstname and lastname."),o.createElement("code",{className:"example block"},"-- this should return an relation with no tuples: pi cid ( sigma firstname=lastname ( Customers ) )"),o.createElement("p",null,"The next example uses a more complex expression to get all accounts with a balance over 100 or under -100."),o.createElement("code",{className:"example block"},"sigma balance > 100 or (balance*-1 > 100) ( Accounts ) -- (balance ","<"," -100) would also be correct"),o.createElement("p",null,"As a shorter alternative you can use a ",o.createElement("a",{href:"#relalg-valueexpr"},"function in your expression")," to get the same result:"),o.createElement("code",{className:"example block"},"sigma abs(balance) > 100 ( Accounts )"),o.createElement("h2",{id:"tutorial-maintainer"},"Tutorial - maintainer"),o.createElement("p",null,"Everybody can provide datasets that can be used in the relational algebra calculator and share them with others.",o.createElement("br",null),"We assume the scenario of a teacher wanting to provide a dataset for his/her students for this short tutorial."),o.createElement("p",null,"The datasets are specified in a simple text format and can be shared with others via ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gists")," (a simple and free platform to share snippets).",o.createElement("br",null),"The shared gist gets an unique ID and the relational algebra calculator can load the dataset directly using this ID."),o.createElement("h3",{id:"tutorial-maintainer-create-dataset"},"Creating a dataset"),o.createElement("p",null,"The fist step is the creation of the dataset which is actually only a group of relation definitions with some additional information and is therefore refered as group in the specified format.",o.createElement("br",null),"The relations can then be used by the students to formulate the there statements.",o.createElement("br",null),"Lets assume we want to create a dataset of employees of a company."),"Every group definition starts with a simple header which (at least) contains the name of the group:",o.createElement("code",{className:"example block"},"group: bank example"),"every header field starts with the name of the field and is followed by a colon for single line values. The next (optional) header field we should specify is the description. It should contain information like who is maintaining this dataset or where to find additional information.",o.createElement("br",null),"In the description ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Markdown"},"Markdown")," can be used to format the text or set links to external resources.",o.createElement("p",null,"In our example we add a description that takes more than a single line and therefore we enclose the value in double brackets instead of using the colon."),o.createElement("code",{className:"example block"},"group: bank example description[[ the data for this dataset was generated using ","<","http://www.generatedata.com/> * the relation _Customers_ contains basic information about the customers of the bank. The relation _Accounts_ contains the basic information of a single account. Note that a customer can have any number of accounts. * the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over 1000 ]]"),o.createElement("p",null,"The next step is to actually add the relations the students can use for their queries.",o.createElement("br",null),"The relation definitions are use the relational algebra syntax that can be used in this tool.",o.createElement("br",null),"Every relation is defined by a single variable assignment where the name of the variable is used as the relations name and the result of the expression defines the relation.",o.createElement("br",null),"The relalg expression can use all features that can be used in the tool and can also use other relations defined within the same dataset.",o.createElement("br",null),"Note that the name of the relation is used as the qualifier of each attribute/column."),o.createElement("p",null,"For the relation ",o.createElement("code",null,"Customers")," relation we use the ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation")," syntax as the most basic method to define the relation and can also be edited using the relation editor ",o.createElement("i",{className:"fa fa-table",title:"relation editor"})," which is a simple spread-sheet like editor. ",o.createElement("br",null),"The inline relations in combination with the editor should be very easy to use if you enter the data directly or if you have them as a csv/spread-sheet file."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\t\t\t\t"),o.createElement("p",null,"As we can see the name of the relations are defined by the assignments.",o.createElement("br",null),"The inline-relations are enclosed by curly braces and contain the names of the attributes/columns in the first line and then a tuple/row per line where the values are simply separated by whitespace. You can also other seperators and can define the types explicitly as we can see at the Accounts relation. For further information can be found at ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation description"),"."),o.createElement("p",null,"Note that, unlike the variables used in a query, the definition of a new relation implicitly sets the attribute qualifier to the name of the relation. So the schema of the account relation is ",o.createElement("code",null,"(Accounts.aid, Accounts.cid, Accounts.balance)"),". This allows each attribute to be accessible with this name."),o.createElement("p",null,"The last relation we need to add in this example is the relation containing the banks premium Customers.",o.createElement("br",null),"They are specified by using the other two relations in a simple relational algebra statement that selects all customers with a total balance over 1000."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\n\t\t\t\tPremiumCustomers =\n\t\t\t\t\tpi cid (\n\t\t\t\t\t\tsigma sum > 1000 (\n\t\t\t\t\t\t\tgamma cid; sum(balance)->sum (\n\t\t\t\t\t\t\t\tAccounts\n\t\t\t\t\t\t\t\tjoin Customers\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t"),o.createElement("p",null,"We have now seen how to define a dataset with its header containing the name and the description followed by relational algebra assignments defining the relations of the dataset."),o.createElement("p",null,"We can paste this definition directly in the ",o.createElement("i",null,"Group Editor")," to load and use it.",o.createElement("br",null),"In the next section we want to look at how we can publish this definition so that we give our students a single url or id to directly load the dataset."),o.createElement("h3",{id:"tutorial-maintainer-share-dataset"},"Share a dataset"),o.createElement("p",null,"If we want to share the definition of a dataset with other people we could simply give them the definition and they load it using the ",o.createElement("i",null,"group editor"),", but that would not be that practical for most cases."),o.createElement("p",null,"The simpler solution (for the users) is to publish the definition as a ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gist")," and share the ID of the gist with others."),o.createElement("p",null,"Just create a gist with the definition as its content (the filename does not matter) and publish it. The ID of the Gist can now be found at the top of the page as ",o.createElement("i",null,"gist:xxxxxxxxxxxx")," or in the url after the last slash."),o.createElement("p",null,"This ID can then be shared and loaded in the interface or the calculator can be called directly with a specific ID by using using the parameter ",o.createElement("code",null,"?data=gist:xxxxxxxxxxxxxx"),"."),o.createElement("p",null,"For example the simple bank definition of this tutorial has been published as a ",o.createElement("a",{href:"https://gist.github.com/ragtime/2cfb981fbc5676182d64"},"Gist with the ID 2cfb981fbc5676182d64")," and can therefore be loaded directly with modifying the url by replacing all after ",o.createElement("code",null,"DOMAIN/relax/calc/")," with ",o.createElement("code",null,"/gist/2cfb981fbc5676182d64"),"."),o.createElement("h2",{id:"relalg-reference"},"Reference - relational algebra"),o.createElement("h3",{id:"relalg-syntax"},"General syntax"),o.createElement("div",null,o.createElement("h4",{id:"relalg-assignment"},"assignment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"NAME")," ",o.createElement("strong",null,"=")," ",o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"Defines a new local variable with the name ",o.createElement("i",null,"NAME"),"; its content is defined by",o.createElement("i",null,"EXPRESSION")),o.createElement("p",null,"The name of the new relation must be unique."),o.createElement("p",null,"The definition has to be executed with the statement."),o.createElement("div",{className:"example"},o.createElement("code",null,"TestA = π a,b R TestB = σ d > 0 S -- statement using the variable TestA join TestB")),o.createElement("p",null,"An assignment (= definition of a variable) is no valid relational algebra expression on its own. If you miss the acutal query a error is thrown (",o.createElement("i",null,"Error: only assignments found; query is missing"),")."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- this is the definition of the variable Test = π Customer.firstname, surname ( Customer ) -- this is the actual query/statement using the variable Test")),o.createElement("p",null,"The defined variable can be used like the assigned expression could be used because every usage of the variable gets replaced with its definition before the query gets executed.",o.createElement("br",null),"This also means that the variable-name has no influence on the schema of the expression and the names of the attributes/columns are not affected by assignment:",o.createElement("code",{className:"block example"},"X = R X join S"),"The attributes of the relation R are only accessible with its original names (R.a, R.b, ..), and are not affected by the assignment."),o.createElement("p",null,"There is a known problem when the last assignment ends with a natural join and the query consists of a single relation:"),o.createElement("code",null,"A = S join R A -- this is the query"),o.createElement("p",null,"The statement is ambiguous and the parser interprets it as ",o.createElement("code",null,"A = (S join R A)"),"where R is interpreted as a column argument for the theta-join and therefore detects a cyclic usage of the variable A."),o.createElement("p",null,"Solution: To get the expected behaviour you have to set braces around the assigned expression like ",o.createElement("code",null,"A = (S join R) A")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-sl"},"single-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"-- "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"the '--' must be followed by at least one whitespace charater! inserts a comment; its text goes until the end of the line"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,"Test =",o.createElement("b",null,"-- This is the expression that is assigned to Test:"),"π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relation-name"},"pre defined relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"RELATION_NAME"))))))),o.createElement("div",null,o.createElement("p",null,"Uses a pre defined relation with the name ",o.createElement("i",null,"RELATION_NAME")),o.createElement("p",null,"The code completion only works for this relations."),o.createElement("div",{className:"example"},o.createElement("code",null,"( Customers ) cross join ( Accounts )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-ml"},"multi-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"/* "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("strong",null," */"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"inserts a comment that can span multiple lines"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,o.createElement("b",null,"/* This is a very very long comment */"),"Test = π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-inline-relation"},"inline-relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("b",null,"{"),o.createElement("i",null,"COLUMN_NAME_1"),":",o.createElement("i",null,"COLUMN_TYPE_1")," ...",o.createElement("i",null,"ROW_1"),o.createElement("i",null,"ROW_2"),"...",o.createElement("b",null,"}"))))))),o.createElement("div",null,o.createElement("p",null,"The inline-relation is a temporary relation that can be defined directly in the statement. It is only valid in the defining statement"),o.createElement("p",null,"Every inline-relation is a valid expression and thus can be used at any position a",o.createElement("i",null,"EXPRESSION")," is expected."),o.createElement("p",null,"The inline-relation is defined by a header, that specifies the schema of the relation and the rows containing the values and is surrounded by curly braces."),o.createElement("div",null,"The header is defined by a sequence of",o.createElement("code",null,o.createElement("i",null,"QUALIFIER.COLUMN_NAME"),":",o.createElement("i",null,"COLUMN_TYPE"))," ",o.createElement("b",null,"separated by any whitespace, comma or semicolon."),"The ",o.createElement("i",null,"QUALIFIER")," is optional. Also the ",o.createElement("i",null,"COLUMN_TYPE")," can be omitted if the type is well defined by the values of that column. The first non null value of a column defines its type.",o.createElement("br",null),"True and false (case insensitive without quotes) are reserved for a boolean type. They can be used as a simple string but they do not define the type of the column as string.",o.createElement("br",null),"The ",o.createElement("i",null,"COLUMN_TYPE")," can be one of the following",o.createElement("ul",null,o.createElement("li",null,"string"),o.createElement("li",null,"number"),o.createElement("li",null,"date"),o.createElement("li",null,"boolean")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("qualifier"),".")),Object(Wn.NonTerminal)("column-name"),Object(Wn.Optional)(Object(Wn.Sequence)(":",Object(Wn.Choice)(0,"string","number","date","boolean"))))}))),o.createElement("p",null,"The rows of the relation are defined by a list of values per row with the type of the corresponding column. The values are ",o.createElement("b",null,"separated by whitespace comma or semicolon."),o.createElement("br",null),"Simple strings only containing letters, numbers, hyphens, underlines, dots or periods ([0-9a-zA-Z\\-_\\.]+) can be written without single quotes. ",o.createElement("i",null,"NULL")," and ",o.createElement("i",null,"null")," are constant values. If null, true or false should be used as string they have te be quoted.",o.createElement("br",null),"More complex strings must be surrounded by single quotes: ",o.createElement("i",null,"'content'")," or ",o.createElement("i",null,"content"),"but '' or 'long content containing spaces and special characters like !' or 'null'.",o.createElement("br",null),"Dates are written in ISO-format: YYYY-MM-DD without single quotes",o.createElement("br",null),"A null-value can be written as ",o.createElement("i",null,"null")," or ",o.createElement("i",null,"NULL")," (without single quotes).",o.createElement("br",null),"Numbers could be integers in the form (-?[0-9]+) or floats in the form (-?[0-9]+\\.[0-9]+).",o.createElement("br",null),"Numbers in single quotes are recognized as numbers if the column type is defined as number or has been detected to be number from a previous value; otherwise it will be a string value..",o.createElement("br",null),"A boolean value is denoted as either ",o.createElement("i",null,"true")," or ",o.createElement("i",null,"false")," (case insensitive)."),o.createElement("p",null,"The header and rows can be indented if needed."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- type for column b is defined by the first value\n\t\t\t\trho A {\n\t\t\t\t\ta:number, b\n\t\t\t\t\t1, 2\n\t\t\t\t\t3, 4\n\t\t\t\t}\n\t\t\t\tcross join\n\t\t\t\t{\n\t\t\t\t\ta:string X.b:date c:number\n\t\t\t\t\tAlpha 1970-01-01 1\n\t\t\t\t\t'Beta 2' 1970-01-02 3\n\t\t\t\t\t'' 1970-01-03 4\n\t\t\t\t}")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relalgexpr"},"relational algebra expression"),o.createElement("div",null,o.createElement("p",null,"A valid relational algebra expression is built by connecting ",o.createElement("i",null,"relation-name")," or ",o.createElement("i",null,"inline-relation"),"as atoms with the defined unary and binary operators."),"So a relational algebra expression is recursively defined as follows:",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Choice)(0,Object(Wn.Sequence)("(",Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),")"),Object(Wn.NonTerminal)("relation-name","#relalg-relation-name"),Object(Wn.NonTerminal)("inline-relation","#relalg-inline-relation"),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.NonTerminal)("projection","#relalg-operations-projection"),Object(Wn.NonTerminal)("selection","#relalg-operations-selection"),Object(Wn.NonTerminal)("rename relation","#relalg-operations-renamerelation"),Object(Wn.NonTerminal)("rename column","#relalg-operations-renamecolumn"),Object(Wn.NonTerminal)("order by","#relalg-operations-orderby"),Object(Wn.NonTerminal)("group by","#relalg-operations-groupby")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))),Object(Wn.Choice)(1,Object(Wn.Skip)(),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.NonTerminal)("intersection","#relalg-operations-intersection"),Object(Wn.NonTerminal)("union","#relalg-operations-union"),Object(Wn.NonTerminal)("division","#relalg-operations-division"),Object(Wn.NonTerminal)("subtraction","#relalg-operations-subtraction"),Object(Wn.NonTerminal)("cross product","#relalg-operations-crossjoin"),Object(Wn.NonTerminal)("θ-join","#relalg-operations-innerjoin"),Object(Wn.NonTerminal)("natural join","#relalg-operations-naturaljoin"),Object(Wn.NonTerminal)("left outer join","#relalg-operations-leftjoin"),Object(Wn.NonTerminal)("right outer join","#relalg-operations-rightjoin"),Object(Wn.NonTerminal)("full outer join","#relalg-operations-fulljoin"),Object(Wn.NonTerminal)("left semi join","#relalg-operations-leftsemijoin"),Object(Wn.NonTerminal)("right semi join","#relalg-operations-rightsemijoin"),Object(Wn.NonTerminal)("anti semi join","#relalg-operations-antijoin")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))))})))),o.createElement("h3",{id:"relalg-unary-operations"},"Unary operations"),"Each unary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-projection"},"projection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"π")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"pi a, b ( R )")))))),o.createElement("p",null,"The argument is a subset of columns of the schema of the ",o.createElement("i",null,"CHILD_EXPRESSION")," or a ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("div",{className:"example"},o.createElement("code",null,"π Customer.firstname, surname ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, [1] ( ρ c ( Customer ) )")),"Expressions can be used to create more complex statements using one or more columns of a single row.",o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, lower(username)->user, concat(firstname, concat(' ', lastname))->fullname ( ρ c ( Customer ) )")),"The virtual column ",o.createElement("i",null,"ROWNUM")," used in previous versions is not supported any more but the ",o.createElement("code",null,"rownum()")," expression can be used to get the same information. And it can also be used directly in the boolean condition of a selection or join.",o.createElement("div",{className:"example"},"In this example the top 5 customers with the most orders are selected, where countOrders could be the result of a previous aggregation.",o.createElement("code",null,"pi firstname, lastname sigma rownum() ","<","= 5 tau countOrders desc Customer")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"π","pi"),Object(Wn.OneOrMore)(Object(Wn.NonTerminal)("column","#relalg-column"),",")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-selection"},"selection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"σ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"sigma a > 2 ( R )")))))),o.createElement("p",null,"The argument is a ",o.createElement("a",{href:"#relalg-valueexpr"},"boolean expression")," that each row of ",o.createElement("i",null,"CHILD_EXPRESSION"),"is checked on"),o.createElement("div",{className:"example"},o.createElement("code",null,"σ firstname = 'Bob' or firstname = 'Alice' ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"σ (id > 10 and id ","<"," 100) or id = 42 ( Customer )")),o.createElement("div",{className:"example"},"Selecting all customers with a firstname that has an even length.",o.createElement("code",null,"σ mod(length(firstname),2) = 0 ( Customer )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"σ","sigma"),Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamerelation"},"rename relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"( R ) join R.a = X.b (rho X ( R ))")))))),o.createElement("div",null,"The argument is the new name for the Relation returned by ",o.createElement("i",null,"CHILD_EXPRESSION"),o.createElement("div",{className:"example"},'rename the Relation from "Customer" to "a":',o.createElement("code",null,"π a.id, a.firstname ( ρ a ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"ρ","rho"),Object(Wn.NonTerminal)("new relation name")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamecolumn"},"rename column"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,"the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("code",{className:"relalg block"},"pi x, b rho a->x {a, b\n\t\t\t\t\t\t1, 2\n\t\t\t\t\t\t3, 4\n\t\t\t\t\t}")))))),o.createElement("div",null,"The argument is the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("div",{className:"example"},"rename the columns id and firstname to myId and foobar:",o.createElement("code",null,"ρ myId←id, foobar←firstname (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"ρ","rho"),Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("new name"),Object(Wn.Choice)(0,"←","<-"),Object(Wn.NonTerminal)("column","#relalg-column")),Object(Wn.Sequence)(Object(Wn.NonTerminal)("column","#relalg-column"),Object(Wn.Choice)(0,"→","->"),Object(Wn.NonTerminal)("new name"))),",")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-orderby"},"order by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"τ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"tau a asc, b desc ( R )")))))),o.createElement("div",null,"The argument is a list of columns by which the relation should be ordered (see examples)",o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"τ [1], firstname desc (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"τ","tau"),Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("column","#relalg-column"),Object(Wn.Choice)(0,Object(Wn.Skip)(),"asc","desc")),",")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-groupby"},"group by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"γ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"gamma a, count(*)->x ( R )")))))),o.createElement("div",null,"The argument is a list of columns to group by, separated by commas followed by a semicolon",o.createElement("br",null),"and a list of aggregate functions to apply with their new name in form ",o.createElement("span",null,"AGG( COLUMN ) -> NEW_NAME"),o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"γ a, b ; sum(c)->x ( Customer )")),o.createElement("p",null,"If no grouping columns are provided the entire relation is the group."),o.createElement("div",null,"supported aggregate functions by type:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("td",null," "),o.createElement("th",null,"number"),o.createElement("th",null,"string"),o.createElement("th",null,"date"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"COUNT( * )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"COUNT( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MIN( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MAX( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"SUM( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")),o.createElement("tr",null,o.createElement("th",null,"AVG( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")))))),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"γ","gamma"),Object(Wn.Sequence)(Object(Wn.ZeroOrMore)(Object(Wn.NonTerminal)("column","#relalg-column"),","),";",Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"COUNT(*)",Object(Wn.Sequence)(Object(Wn.Choice)(0,"COUNT","MIN","MAX","SUM","AVG"),"(",Object(Wn.NonTerminal)("column","#relalg-column"),")")),Object(Wn.Choice)(0,"→","->"),Object(Wn.NonTerminal)("new name")),","))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-binary-operations"},"Binary operations"),"Each binary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")")," ",o.createElement("strong",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-intersection"},"intersection - ∩"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∩")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"intersect"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∩ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"∩","intersect")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-union"},"union - ∪"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"union"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∪ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"∪","union")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-division"},"division"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"÷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"/"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ÷ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"÷","/")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-subtraction"},"subtraction / set-difference"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"-"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"\\",o.createElement("br",null),"except"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( pi firstname ( Customer ) ) - ( rho test","<","-lastname ( pi lastname ( Customer ) ) )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"-","\\","except")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-crossjoin"},"cross product"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⨯")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"cross join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⨯",Object(Wn.Sequence)("cross","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-innerjoin"},"Theta-join / θ-join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"inner join"))))),o.createElement("div",null,"join condition",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋈",Object(Wn.Sequence)(Object(Wn.Optional)("inner"),"join")),Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))}))),o.createElement("p",null,"Special case:",o.createElement("br",null),"The name of a single boolean column (like ",o.createElement("code",null,"R join a S"),") can not be used directly as a join condition due to ambiguities in the relational algebra syntax.",o.createElement("br",null),"The column must either be specified with its qualifier (",o.createElement("code",null,"R join R.a S"),") or wrapped in parentheses (",o.createElement("code",null,"R join (a) S"),").",o.createElement("br",null),"This is not necessary for more complex boolean expressions. The problem is only that the single column name can not be distinguished from a relation name: the expression ",o.createElement("code",null,"X=R join S X")," could be interpreted as ",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".")),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-naturaljoin"},"natural join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"natural join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",{className:"block"},"ρ a ( Customer )",o.createElement("span",{className:"math"},"⋈")," a.name ","<"," b.name ( ρ b ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋈",Object(Wn.Sequence)("natural","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftjoin"},"left outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟕")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left outer join",o.createElement("br",null),"left join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural left outer join",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⟕",Object(Wn.Sequence)("left",Object(Wn.Optional)("outer"),"join")),Object(Wn.Optional)(Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightjoin"},"right outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟖")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right outer join",o.createElement("br",null),"right join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural right outer join",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⟖",Object(Wn.Sequence)("right",Object(Wn.Optional)("outer"),"join")),Object(Wn.Optional)(Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-fulljoin"},"full outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟗")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"full outer join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural full outer join",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⟗",Object(Wn.Sequence)("full","outer","join")),Object(Wn.Optional)(Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftsemijoin"},"left semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋉")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋉",Object(Wn.Sequence)("left","semi","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightsemijoin"},"right semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋊")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋊",Object(Wn.Sequence)("right","semi","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-antijoin"},"anti semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"▷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"anti semi join",o.createElement("br",null),"anti join"))))),o.createElement("div",null,"no argument",o.createElement("br",null),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"▷",Object(Wn.Sequence)("anti",Object(Wn.Optional)("semi"),"join")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-operator-precedence"},"Operator precedence"),o.createElement("p",null,"The operator precedence allows to obmit most of braces.",o.createElement("br",null),"The used precedence is shown in the table below.",o.createElement("br",null),"All operators are left associative."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operator"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,o.createElement("a",{href:"#relalg-relation-name"},"relation-name"),",",o.createElement("a",{href:"#relalg-inline-relation"},"inline-relation"))),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-projection"},"projection"),",",o.createElement("a",{href:"#relalg-operations-selection"},"selection"),",",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename (columns)"),",",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename (relations)"),",",o.createElement("a",{href:"#relalg-operations-groupby"},"group"),",",o.createElement("a",{href:"#relalg-operations-orderby"},"order by"))),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross product"),",",o.createElement("a",{href:"#relalg-operations-innerjoin"},"theta join"),",",o.createElement("a",{href:"#relalg-operations-naturaljoin"},"natural join"),",",o.createElement("a",{href:"#relalg-operations-leftjoin"},"left outer join"),",",o.createElement("a",{href:"#relalg-operations-rightjoin"},"right outer join"),",",o.createElement("a",{href:"#relalg-operations-fulljoin"},"full outer join"),",",o.createElement("a",{href:"#relalg-operations-leftsemijoin"},"left semi-join"),",",o.createElement("a",{href:"#relalg-operations-rightsemijoin"},"right semi-join"),",",o.createElement("a",{href:"#relalg-operations-antijoin"},"anti semi-join"),",",o.createElement("a",{href:"#relalg-operations-division"},"division"))),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-intersection"},"intersection"))),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-union"},"union"),",",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction")))))),o.createElement("div",{className:"example"},o.createElement("code",null,"A join B x C"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"((A join B) x C)"),o.createElement("br",null),"because the cross product and the natural join are in the same precedence className."),o.createElement("div",{className:"example"},o.createElement("code",null,"sigma true A join sigma true B"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"(sigma true (A)) join (sigma true (B))"),o.createElement("br",null),"because the unary operators have a higher precedence than the binary operators."),o.createElement("h3",{id:"relalg-misc"},"Misc"),o.createElement("h4",{id:"relalg-column"},"Column"),"column is either",o.createElement("ul",null,o.createElement("li",null,'the name of a column: "columnName"'),o.createElement("li",null,'the number of the column (starting with 1): "[column-number]"'),o.createElement("li",null,'a full qualified column: "qualifier.columnName"'),o.createElement("li",null,"a value expression (if allowed for the specific operation)")),"the qualifier is optional if the column is unique in its schema.",o.createElement("h4",{id:"relalg-valueexpr"},"Value expressions"),"With most operators you can use a value-expression which connects one or more columns of a single row to calculate a new value. This is possible for:",o.createElement("ul",null,o.createElement("li",null,"the projection creating a new column (make sure to give the column a name)"),o.createElement("li",null,"the selection any expression evaluating to boolean can be used"),o.createElement("li",null,"for the joins any expression evaluating to boolean can be used; note that the ",o.createElement("code",null,"rownum()")," expression always represents the index of the lefthand relation")),"The expressions always operate on a single row/tuple of a table/relation.",o.createElement("br",null),"If you want to calculate values vertically over all values of a specific column/attribute you need to use group by with an aggregate function. The following table lists all functions and operators that can be used in an expression. They can be combined and nested in any arbitrary order but note that they do evaluate to a single type defined by the outer most expression. The following operators can be used:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("th",null,"returns type"),o.createElement("th",null,"description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a AND b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical and")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a OR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a XOR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical exclusive or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"NOT b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical not")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a = b a != b a ","<"," b a > b a ","<","= b a >= b a != b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"compares two values of the same type")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string LIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"returns true if expression evaluating to a string ",o.createElement("code",null,"a")," matches the pattern given as the second operand.",o.createElement("br",null),"The pattern has to be given as a string literal;",o.createElement("p",null,"An underscore (",o.createElement("code",null,"_"),") in the pattern stands for any single character and any percent sign (",o.createElement("code",null,"%"),") stands for any sequence of zero or more characters."))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string ILIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"same as ",o.createElement("code",null,"LIKE")," but matches case-insensitive.",o.createElement("br",null),"This is not in the SQL standard but is a PostgreSQL extension.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a + b a - b a * b a / b a % b")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, subtraction, multiplication, division, modulo")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rand()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns a random number in the interval [0, 1]")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rownum()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the index of the current row (starting with 0).",o.createElement("br",null),"If the function is used in a binary relational algebra expression (e.g. a join) it always represents the index of the left operand.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"length(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the length of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"date(a:string)")),o.createElement("td",null,"date"),o.createElement("td",null,"parses the given string to a date object. The string must be in the form YYYY-MM-DD")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"adddate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"adds the given number of days to date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"subdate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"subtracts the given number of days from date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"now() transaction_timestamp() statement_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns a timestamp representing the start of the query execution",o.createElement("br",null),"transaction- and statement start are the very same value due to the lack of a transaction concept")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"clock_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns the current timestamp while executing the query")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"year(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the year component of a given date")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"month(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the month component of a given date as a number. (1 = Sunday, 2 = Monday, ..., 7 = Saturday)")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"day(a:date) dayofmonth(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the day component of a given date as a number in the range 1 to 31")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"hour(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the hour component of a given date as a number in the range 0 to 23")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"minute(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the minute component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"second(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the second component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"concat(a:string [, ...])")),o.createElement("td",null,"string"),o.createElement("td",null,"concatenates the given strings")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"upper(a:string) ucase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to upper-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"lower(a:string) lcase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to lower-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"strlen(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"number of characters of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"abs(a:number)")),o.createElement("td",null,"number"),o.createElement("td",null,"the absolute value of the given number")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"add(a, b) sub(a, b) mul(a, b) div(a, b) mod(a, b)")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, ",o.createElement("br",null),"subtraction, ",o.createElement("br",null),"multiplication, ",o.createElement("br",null),"division or ",o.createElement("br",null),"modulo of the given numbers")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"round(a) floor(a) ceil(a)")),o.createElement("td",null,"number"),o.createElement("td",null,"round to nearest integer, ",o.createElement("br",null),"largest integer not greater than the argument or",o.createElement("br",null),"smallest integer not less than the argument")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"coalesce(",o.createElement("strong",null,"value")," [, ...])")),o.createElement("td",null,"type of ",o.createElement("strong",null,"value")),o.createElement("td",null,"returns the first of its arguments that is not null or null if all arguments are null. Note that all arguments must have the same datatype.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"CASE WHEN ",o.createElement("strong",null,"condition")," THEN result [WHEN ...] [ELSE ",o.createElement("strong",null,"result"),"] END")),o.createElement("td",null,"type of ",o.createElement("strong",null,"result")),o.createElement("td",null,"returns the first result where the condition evaluates to true. If all conditions are false the else part is executed or null is returnt if the else part is missing. Note that all results must have the same datatype."))))),"The operator precedence is the same as used in ",o.createElement("a",{href:"https://dev.mysql.com/doc/refman/5.7/en/operator-precedence.html"},"MySQL")," (from strong to weak):",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operators"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,"functions, constants, columns")),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,"! (boolean not)")),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,"- (unary minus)")),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,"*, /, %")),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,"-, +")),o.createElement("tr",null,o.createElement("td",null,"5"),o.createElement("td",null,"= (comparison), >=, >, ","<","=, ","<",", ","<",">, !=, LIKE, ILIKE")),o.createElement("tr",null,o.createElement("td",null,"6"),o.createElement("td",null,"CASE, WHEN, THEN, ELSE")),o.createElement("tr",null,o.createElement("td",null,"7"),o.createElement("td",null,"AND")),o.createElement("tr",null,o.createElement("td",null,"8"),o.createElement("td",null,"XOR")),o.createElement("tr",null,o.createElement("td",null,"9"),o.createElement("td",null,"OR, ||"))))),o.createElement("h2",{id:"sql-reference"},"Reference - SQL"),o.createElement("p",null,"The goal of the SQL mode of the relational algebra calculator is to provide a translation from SQL to relational algebra to show how they are related. It does not support all features a real database system like ",o.createElement("a",{href:"http://www.postgresql.org",target:"_blank"},"PostgreSQL")," or ",o.createElement("a",{href:"https://www.mysql.com/",target:"_blank"},"MySQL"),' does because the goal is to provide a translation into relational algebra. This means that many features like correlated-substatements are not supported because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h3",{id:"sql-syntax"},"General syntax"),o.createElement("p",null,"All keywords are case insensitv."),o.createElement("p",null,"The following Synopsis is a adapted version of ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html",target:"_blank"},"PostgreSQL")," and shows the general syntax of the supported SQL. Brackets indicate optional parts. Braces and vertical lines indicate that one of the alternatives has to be chosen. Dots mean that the preceding element can be repeated."),o.createElement("code",{className:"block sql"},"[ ",o.createElement("a",{href:"#sql-with"},"WITH")," ",o.createElement("strong",null,"with_query")," [, ...] ]",o.createElement("a",{href:"#sql-select"},"SELECT")," [ DISTINCT ] * | ",o.createElement("strong",null,"expression")," [ [ AS ] ",o.createElement("strong",null,"output_name")," ] [, ...]",o.createElement("a",{href:"#sql-from"},"FROM")," ",o.createElement("strong",null,"from_item")," [, ...] [ ",o.createElement("a",{href:"#sql-where"},"WHERE")," ",o.createElement("strong",null,"condition")," ] [ ",o.createElement("a",{href:"#sql-groupby"},"GROUP BY")," ",o.createElement("strong",null,"column")," [, ...] ] [ ",o.createElement("a",{href:"#sql-having"},"HAVING")," ",o.createElement("strong",null,"condition")," ] [ ","{"," ",o.createElement("a",{href:"#sql-setoperators"},"UNION")," | ",o.createElement("a",{href:"#sql-setoperators"},"INTERSECT")," | ",o.createElement("a",{href:"#sql-setoperators"},"EXCEPT")," } [ ALL | DISTINCT ] ",o.createElement("strong",null,"select")," ] [ ",o.createElement("a",{href:"#sql-orderby"},"ORDER BY")," ",o.createElement("strong",null,"column")," [ ASC | DESC ] [, ...] ] [ ",o.createElement("a",{href:"#sql-limit"},"LIMIT")," ","{"," ",o.createElement("strong",null,"count")," | ALL } ] [ ",o.createElement("a",{href:"#sql-limit"},"OFFSET")," ",o.createElement("strong",null,"start")," [ ROW | ROWS ] ] [ ",o.createElement("a",{href:"#sql-limit"},"FETCH")," ","{"," FIRST | NEXT } [ ",o.createElement("strong",null,"count")," ] ","{"," ROW | ROWS } ONLY ] where ",o.createElement("strong",null,"from_item")," can be one of:",o.createElement("strong",null,"table_name")," [ AS ",o.createElement("strong",null,"alias")," ]",o.createElement("strong",null,"with_query_name")," [ AS ",o.createElement("strong",null,"alias")," ] ( ",o.createElement("strong",null,"select")," ) AS ",o.createElement("strong",null,"alias"),o.createElement("strong",null,"from_item")," CROSS JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," NATURAL JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," ON join_condition",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," NATURAL",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," USING ( join_column [, ...] )",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN ON join_condition",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN NATURAL ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN USING ( join_column [, ...] ) ",o.createElement("strong",null,"from_item"),"and ",o.createElement("strong",null,"with_query")," is:",o.createElement("strong",null,"with_query_name")," AS ( ",o.createElement("strong",null,"select")," )"),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("WITH","#sql-with"),Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("name"),"AS","(",Object(Wn.NonTerminal)("select","#sql-select"),")"),",")),"skip"),Object(Wn.Sequence)(Object(Wn.Terminal)("SELECT","#sql-select"),Object(Wn.Optional)("DISTINCT","skip"),Object(Wn.Choice)(0,"*",Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("column"),Object(Wn.Optional)(Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("output_name")))),Object(Wn.Sequence)(Object(Wn.NonTerminal)("expression","#sql-valueexpr"),Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("output_name")))),",")),Object(Wn.Terminal)("FROM","#sql-from"),Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("table_name"),Object(Wn.Optional)(Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias")))),Object(Wn.Sequence)("(",Object(Wn.NonTerminal)("select"),")",Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias")))),",")),Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Skip)(),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.Sequence)(",",Object(Wn.Comment)("old syntax for cross join")),Object(Wn.Sequence)(Object(Wn.Choice)(0,"CROSS","NATURAL"),"JOIN"),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.Optional)("INNER"),"JOIN"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"LEFT","RIGHT","FULL"),Object(Wn.Optional)("OUTER"),"JOIN")),Object(Wn.Choice)(0,Object(Wn.Sequence)("ON",Object(Wn.NonTerminal)("condition")),Object(Wn.Sequence)("USING","(",Object(Wn.OneOrMore)(Object(Wn.NonTerminal)("join_column"),","),")"),Object(Wn.Sequence)("NATURAL")))),Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("table_name"),Object(Wn.Optional)(Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias")))),Object(Wn.Sequence)("(",Object(Wn.NonTerminal)("select"),")",Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias"))))))),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("WHERE","#sql-where"),Object(Wn.NonTerminal)("condition")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("GROUP BY","#sql-groupby"),Object(Wn.NonTerminal)("expression","#sql-valueexpr")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("HAVING","#sql-having"),Object(Wn.NonTerminal)("condition")),"skip")),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"UNION","INTERSECT","EXCEPT"),Object(Wn.Choice)(0,Object(Wn.Skip)(),"DISTINCT","ALL"),Object(Wn.NonTerminal)("select")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("ORDER BY","#sql-orderby"),Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("expression","#sql-valueexpr"),Object(Wn.Choice)(0,"ASC","DESC")),",")),"skip")),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("LIMIT","#sql-limit"),Object(Wn.Choice)(0,Object(Wn.NonTerminal)("count"),"ALL")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("OFFSET","#sql-limit"),Object(Wn.NonTerminal)("start"),Object(Wn.Optional)("ROWS")),"skip")),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("FETCH FIRST","#sql-limit"),Object(Wn.NonTerminal)("count"),Object(Wn.Optional)("ROWS"),"ONLY"),"skip"))))})),o.createElement("h3",{id:"sql-translation"},"Semantic and Translation to relational algebra"),o.createElement("h4",{id:"sql-translation-sequence"},"Sequence of execution"),o.createElement("p",null,'The SQL statement is translated directly into relational algebra. To understand some of the effects of the tool it might be helpful to understand the steps of the translation process. As mentioned before, real database systems might take a different (more complex) aproach but this should help to get an idea of how SQL could be translated into "classNameical" relational algebra.'),o.createElement("p",null,"The following list shows the translation from SQL into relational algebra starting with the inner most relational algebra expression at the top."),o.createElement("ol",null,o.createElement("li",null,"replace all usages of the temporary-tables defined in the WITH-clause with their definitions"),o.createElement("li",null,"FROM-clause is translated left associative with all joins having the same precedence (",o.createElement("code",null,","),"is a cross join)"),o.createElement("li",null,"selection with condition from where-clause is added"),o.createElement("li",null,"group by"),o.createElement("li",null,"selection with condition from having-clause"),o.createElement("li",null,"union/intersect/except"),o.createElement("li",null,"projection is added to choose the requested columns of the SELECT-clause"),o.createElement("li",null,"the columns are renamed to get the requested output-name specified in the SELECT-clause"),o.createElement("li",null,"order by"),o.createElement("li",null,"limit/offset is mapped to a selection")),o.createElement("h4",{id:"sql-select"},"SELECT"),o.createElement("p",null,"The direct translation into relational algebra with implicit duplication elimination requires the ",o.createElement("code",null,"distinct"),"keyword to be equivalent. A warning is shown if you omit it."),o.createElement("p",null,"The select-clause is translated into up to two relalg operators."),o.createElement("ul",null,o.createElement("li",null,"The most basic case is ",o.createElement("code",null,"select ",o.createElement("strong",null,"*")," ...")," where no changes are made to the schema of the result. Therefore no projection is needed. You can use the optional table-alias-prefix if the columns of a single table/relation should be returned only: ",o.createElement("code",{className:"sql"},"select distinct R.* from R inner join S")),o.createElement("li",null,"When a subset of the columns are selected and/or reordered (",o.createElement("code",null," select a, b from ..."),") then a single ",o.createElement("a",{href:"#relalg-operations-projection"},"projection")," is used."),o.createElement("li",null,"Additionally to the previous case a ",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename-column operator")," is added after the projection if new output-names are given with ",o.createElement("code",null,"as foo"),". e.g. ",o.createElement("code",null,"select a ",o.createElement("strong",null,"as foo")," from ..."))),o.createElement("p",null,"The allowed expressions are the same as for the ",o.createElement("a",{href:"#relalg-operations-projection"},"projection"),". So it can be either the name of the column (with optional renaming using ",o.createElement("code",null,"as"),") or a complex",o.createElement("a",{href:"#sql-valueexpr"},"value expression"),". In the latter case a output-name must be given using",o.createElement("code",null,"as")," because the tool requires every column to have a name."),o.createElement("h4",{id:"sql-from"},"FROM"),o.createElement("p",null,"In its simplest form the from-clause holds a single table/relation name that is used directly in the relalg statement. If the optional table-alias is specified with ",o.createElement("code",null,"table as foo")," this is reflected by wrapping the relation in a ",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename-relation operator")," with the given output-name."),o.createElement("code",{className:"example sql"},"select distinct x.a, x.b from R as x"),o.createElement("p",null,"Joins can be expressed using the ANSI join syntax"),o.createElement("code",{className:"example sql"},"select distinct * from A, B inner join C on ... inner join D natural natural join E left outer join F on ... left outer join G natural right outer join H on ... right outer join I natural full outer join J on ... full outer join K natural where ..."),o.createElement("p",null,"The comma is part of the old join syntax and is translated into a ",o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross join"),"."),o.createElement("code",{className:"example sql"},"select distinct * from R, S as s, T where s.a = R.a"),o.createElement("p",null,"Instead of the name of relation a non-correlated substatement can be used. A table alias must be provided with ",o.createElement("code",null,"(...) as foo"),".",o.createElement("br",null),"A non-correlated substatement can be directly translated into relational algebra by just translate the sub-statement into relational algebra and use the resulting operator tree instead of the relation."),o.createElement("p",null,"Non-correlated means that it must not reference/use any columns of tables defined in the outer scope.",o.createElement("br",null),'This limitation is intentionally because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("code",{className:"example sql"},"select distinct * from R, (select * from S where a > 0) as x where x.a = R.a"),o.createElement("h4",{id:"sql-where"},"WHERE"),o.createElement("p",null,"The boolean condition in the where-clause can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The where clause is directly translated to an ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," with the very same condition. This selection is applied after joining relations of the from-clause therefore has to use the original column names."),o.createElement("p",null,"Subquery Expressions like ",o.createElement("code",null,"EXISTS"),", ",o.createElement("code",null,"IN"),", ",o.createElement("code",null,"ANY/SOME")," or ",o.createElement("code",null,"ALL"),"are ",o.createElement("strong",null,"not supported"),' because their translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h4",{id:"sql-groupby"},"GROUP BY"),o.createElement("p",null,"The GROUP-BY-clause takes a list of column names only argument."),o.createElement("p",null,"The GROUP-BY-clause is directly translated to the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," and is executed directly after the selection built from the WHERE-clause and before the projection/renaming build from the SELECT-clause. Therefore the column names that can be used are the ones available after all joining all tables."),o.createElement("p",null,"The aggregations used in the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," are taken from the SELECT-clause and an output-name must be given using ",o.createElement("code",null,"as"),"because the tool requires every column to have a name."),o.createElement("p",null,"If no aggregations are present in the SELECT-clause a projection is used instead of the group-by operation because ",o.createElement("a",{href:"#relalg-operations-groupby"},"sigma")," without aggregation has the very same effect."),o.createElement("p",null,"Every non-aggregation-column in the SELECT-clause must be present in the group by clause because the would not be available after the grouping."),o.createElement("h4",{id:"sql-having"},"HAVING"),o.createElement("p",null,"The HAVING-Clause represents an optional ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection"),". The boolean condition can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The resulting selection is executed directly after the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation"),"."),o.createElement("p",null,"Unlike ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html#SQL-HAVING",target:"_blank"},"PostgreSQL"),"the HAVING-clause is only allowed when either a aggregation or grouping is present."),o.createElement("h4",{id:"sql-orderby"},"ORDER BY"),o.createElement("p",null,"Order by takes a list of column names or indices of columns (starting with 1) as its argument."),o.createElement("p",null,"It is directly translated to the ",o.createElement("a",{href:"#relalg-operations-orderby"},"extended relational algebra operation order by (tau)"),"."),o.createElement("h4",{id:"sql-limit"},"LIMIT"),o.createElement("p",null,"The LIMIT-clause can be either specified with the LIMIT-OFFSET syntax used by PostgreSQL and MySQL or the FETCH-FIRST syntax introduced in SQL:2008."),o.createElement("p",null,"It is translated into a ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," using the",o.createElement("code",null,"rownum()"),"-function to limit the number of rows returned."),o.createElement("h4",{id:"sql-setoperators"},"UNION / INTERSECT / EXCEPT"),o.createElement("p",null,"The Set-Operators UNION, INTERSECT and EXCEPT directly map to the relational algebra operators ",o.createElement("a",{href:"#relalg-operations-union"},"union"),", ",o.createElement("a",{href:"#relalg-operations-intersection"},"intersection")," and ",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction"),"."),o.createElement("p",null,"The keyword ",o.createElement("code",null,"DISTINCT")," is optional because it represents the default behavior. The keyword",o.createElement("code",null,"ALL")," is ignored and a warning is shown because the targeted relational algebra has a implicit elimination duplicate rows."),o.createElement("p",null,"Parentheses can be used to create more complex statements:",o.createElement("br",null),o.createElement("code",{className:"example sql"},"( select distinct * from S union select distinct * from T ) except select distinct * from T order by 1 limit 1")),o.createElement("h4",{id:"sql-with"},"WITH"),o.createElement("p",null,"The WITH-clause (also known as ",o.createElement("i",null,"common table expressions"),") provides a way to define subqueries for single or multiple use in a statement. This can be thought as defining a temporary table for that query in SQL terminology or ",o.createElement("a",{href:"#relalg-assignment"},"creating variables in relational algebra"),". Recursive evaluation is not supported."),o.createElement("p",null,"Each subquery can be referenced by the name from the WITH-clause. The subquery is automatically renamed to the name used in the WITH-clause."),o.createElement("h4",{id:"sql-valueexpr"},"Value expressions"),o.createElement("p",null,"Value expressions are used for boolean expressions for WHERE- and HAVING-clause, the boolean conditions of joins and calculated values in the SELECT-clause. The type of a expression is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean")," and is determined by the used operations and columns."),o.createElement("p",null,"The supported functions and operations are the same for SQL and relational algebra: ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("h2",{id:"license-help"},"Licence"),o.createElement("p",null,o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},o.createElement("img",{alt:"Creative Commons License",style:{borderWidth:0},src:"https://i.creativecommons.org/l/by-sa/4.0/88x31.png"})),o.createElement("br",null),"This document by Johannes Kessler is licensed under a ",o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},"Creative Commons Attribution-ShareAlike 4.0 International License"),".")))))}}n("./src/calc2/views/landing.css");class Vn extends o.Component{componentDidMount(){Fn("#exec1").click((function(){Fn(this).addClass("hidden"),Fn(this).next().removeClass("hidden")}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Un,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-12"},o.createElement("div",{className:"jumbotron",id:"landing-header-bar"},o.createElement("div",{className:"col-md-12 ct",id:"logos"},o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_blue_large.png",alt:"Databases and Information Systems (DBIS)",width:"159",height:"120"})),o.createElement("a",{href:"http://www.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_uni_uni_2017_rgb_transparent.png",alt:"University of Innsbruck",width:"300",height:"120"}))),o.createElement("div",{className:"col-md-12 ct"},o.createElement("h1",{id:"heading"},"RelaX - relational algebra calculator"),o.createElement("p",null,"calculates any relational algebra statement like ",o.createElement("code",null,o.createElement("span",null,"( σ ",o.createElement("sub",null,"a > 42")," ( A ) ) ",o.createElement("span",{className:"math"},"⋈")," ( π ",o.createElement("sub",null,"a,b")," ( B ) )"))," on a set of relations.")),o.createElement("div",{className:"col-md-12 ct"},o.createElement(Xe,{className:"btn btn-primary btn-lg getStartedBtn",role:"button",to:"/relax/calc"},"Get Started"))),o.createElement("h2",null,"What is the relational algebra calculator?"),o.createElement("p",null,"If you want to learn SQL you take a database system and try some queries.",o.createElement("br",null),"But if you want to learn relational algebra what do you use? Pen and paper?"),o.createElement("p",null,"The relational algebra calculator helps you learn relational algebra (RelAlg) by executing it."),o.createElement("div",{className:"example"},"Subjects =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"Maths"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"English"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")))))),"Students =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"stId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"John"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"Mike"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"Julia")))))),"Marks =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"stId"),o.createElement("th",null,"mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"B"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"C")))))),o.createElement("br",null),o.createElement("div",null,o.createElement("span",null,o.createElement("span",{className:"math"}," π "),o.createElement("sub",null," studentName, subjectName, mark "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," studentName←st.name, subjectName←su.name "),"( ",o.createElement("span",null,"( ",o.createElement("span",null,"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," su "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Subjects"))," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," σ "),o.createElement("sub",null,"mark≥'C' "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," m "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Marks"))," )")," )")," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," m.stId=st.stId "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null,"st "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Students"))," )")," )")," )")," )")),"=",o.createElement("button",{type:"button",className:"btn",id:"exec1"},"execute"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline hidden"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"st.studentName"),o.createElement("th",null,"su.subjectName"),o.createElement("th",null,"m.mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Mike")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))))))),o.createElement("h2",null,"Calculator features:"),o.createElement("ul",null,o.createElement("li",null,"supports most common operators",o.createElement("ul",null,o.createElement("li",null,"projection"),o.createElement("li",null,"selection"),o.createElement("li",null,"rename relations"),o.createElement("li",null,"rename columns"),o.createElement("li",null,"group by"),o.createElement("li",null,"intersect"),o.createElement("li",null,"union"),o.createElement("li",null,"set difference"),o.createElement("li",null,"cross join"),o.createElement("li",null,"theta join"),o.createElement("li",null,"natural join"),o.createElement("li",null,"natural left outer join"),o.createElement("li",null,"natural right outer join"),o.createElement("li",null,"natural full outer join"),o.createElement("li",null,"theta left outer join"),o.createElement("li",null,"theta right outer join"),o.createElement("li",null,"theta full outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"right semi join"),o.createElement("li",null,"anti join join"),o.createElement("li",null,"order by"))),o.createElement("li",null,"runs in any modern browser. no plugins needed"),o.createElement("li",null,"text based approach. lets you write RelAlg as easy as SQL"),o.createElement("li",null,"code editor with syntax highlighting and code completion"),o.createElement("li",null,"pre defined sets of relations"),o.createElement("li",null,"visualize statement in a operator tree"),o.createElement("li",null,"plain text alternatives for special symbols like σ or ",o.createElement("span",{className:"math"},"⋈")),o.createElement("li",null,"variables can be used to simplify expressions"),o.createElement("li",null,"new temporal relations can be declared in the statement"),o.createElement("li",null,"sql like comments"),o.createElement("li",null,"arbitrary boolean expressions in conditions"),o.createElement("li",null,"operations keep original order for better traceability"),o.createElement("li",null,"translates simple SQL-statements to RelAlg",o.createElement("ul",null,o.createElement("li",null,"no support for correlated sub-statements")))),o.createElement("h2",null,"Available data"),"You can either use one of the following datasets or create a new one.",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Name"),o.createElement("th",null,"Source"),o.createElement("th",null,"Language"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"Kemper Datenbanksysteme"),o.createElement("td",null,o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/"},"Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage"),", Seite 84, Abbildung 3.8"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - KursDB"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - R, S, T"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.1"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 52-55"),o.createElement("td",null,"en")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.3"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 55-57"),o.createElement("td",null,"en"))))),o.createElement("h2",null,"What it is not:"),o.createElement("p",null,"The tool is not meant to be a full database system. The goal of the implementation was to create a tool to support people to learn RelAlg."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null," "),o.createElement("th",null,"Pen and Paper"),o.createElement("th",null,"relational algebra calculator"),o.createElement("th",null,"MySQL"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"SQL support"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes :-)"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," basic SQL"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"relational algebra"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"use variables for RelAlg"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"large datasets"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"query plan"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"intermediate results"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"iterative working"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"))))),o.createElement("h2",{id:"changelog"},"Changelog"),o.createElement("ul",null,o.createElement("li",null,"0.20",o.createElement("ul",null,o.createElement("li",null,"added option to automatically replace operators in relational algebra: all plaintext-syntax operators get replaced with the equivalent mathematical symbol or vice versa."))),o.createElement("li",null,"0.19",o.createElement("ul",null,o.createElement("li",null,"added datepicker to quickly insert a date literal"))),o.createElement("li",null,"0.18",o.createElement("ul",null,o.createElement("li",null,"added support for the ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"LIKE-operator")," for SQL and relational algebra",o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi 'abc' like 'a%'->x R")),o.createElement("li",null,"added translation support for the calculator using ",o.createElement("a",{href:"http://i18next.com/",target:"_blank"},"i18next"),". This allows easy translation of the main calculator into other languages."),o.createElement("li",null,"calculator is now available in ",o.createElement("a",{href:"calc.htm?lang=de"},"german")),o.createElement("li",null,"ported project to ES2015 (it now gets transpiled to ES5 and packed using ",o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel.js"),"and ",o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify"),")"))),o.createElement("li",null,"0.17",o.createElement("ul",null,o.createElement("li",null,"fixed bug: inline-table-editor not working"),o.createElement("li",null,"fixed bug: formula for !a was not working"))),o.createElement("li",null,"0.16",o.createElement("ul",null,o.createElement("li",null,"disallow relational algebra keywords as column-/relation-names"),o.createElement("li",null,"fixed precedence for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE-WHEN-expressions")),o.createElement("li",null,"added support for the SQL-92 ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},o.createElement("code",null,"||"),"-concat operator")),o.createElement("li",null,"added ",o.createElement("code",null,"except")," as alternative syntax for the ",o.createElement("a",{href:"/relax/help#relalg-operations-subtraction"},"relational algebra set-difference operator")),o.createElement("li",null,"fixed bug where ",o.createElement("code",null,"A=R join S A")," was interpreted as",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".",o.createElement("br",null),"see ",o.createElement("a",{href:"/relax/help#relalg-operations-innerjoin"},"help page")," for more information"))),o.createElement("li",null,"0.15",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"hour(), minute() and second()")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"now()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi hour(now())->x, minute(now())->y, second(now())->z ( R )")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"n-ary concat"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi concat(b, '_', c)->x R")),o.createElement("li",null,"added support for WITH-clauses for SQL"))),o.createElement("li",null,"0.14",o.createElement("ul",null,o.createElement("li",null,"improve error message for theta-joins with conflicting columns"),o.createElement("li",null,"improve error message and added example for assignments without query error"),o.createElement("li",null,"bugfix: calculator-tour did not work correctly for Edge on Windows 10"))),o.createElement("li",null,"0.13",o.createElement("ul",null,o.createElement("li",null,'updated to CodeMirror version 5.1 with "experimental mobile support"'),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"COALESCE()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi coalesce(a, b, 1)->x R"),", ",o.createElement("code",null,"select coalesce(a, b, 1) as x from R")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE WHEN"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"select case when a > 3 then a+1 else a end as x from R")),o.createElement("li",null,"added support for complex union/intersect/except statements for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"(select * from S union ( select * from T except select * from T )) order by 1")))),o.createElement("li",null,"0.12",o.createElement("ul",null,o.createElement("li",null,"added support for more complex FROM-clauses for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct * from R, (S natural join T)")),o.createElement("li",null,"simplify and link the syntax diagrams at the help page"))),o.createElement("li",null,"0.11",o.createElement("ul",null,o.createElement("li",null,"added a tour to explain the main features of the tool to new users (using ",o.createElement("a",{href:"http://bootstraptour.com/",target:"_blank"},"Bootstrap Tour"),")"),o.createElement("li",null,"added ",o.createElement("a",{href:"/relax/help#sql-reference"},"reference for SQL in the help section")),o.createElement("li",null,"added support for USING clause for joins for SQL"),o.createElement("li",null,"added support FETCH FIRST syntax (SQL:2008) for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select * from R offset 2 rows fetch first 10 rows only")),o.createElement("li",null,"allow DISTINCT on set operators for SQL"),o.createElement("li",null,"bugfix: having should be allowed without group by if aggregation is used"))),o.createElement("li",null,"0.10",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"arithmetic expressions and functions")," for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct a+2 as x from R where length(b) > 2")),o.createElement("li",null,"show warnings instead of errors when not using distinct or using all on set operators in SQL"))),o.createElement("li",null,"0.9",o.createElement("ul",null,o.createElement("li",null,"added support for arithmetic operators and functions in ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"(e.g boolean) expressions")," for relational algebra"),o.createElement("li",null,"projection supports ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"expressions")),o.createElement("li",null,"removed magic ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"ROWNUM")," column; ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"ROWNUM()")," is now a function"),o.createElement("li",null,"tutorials for ",o.createElement("a",{href:"/relax/help#tutorial-user"},"users")," and ",o.createElement("a",{href:"/relax/help#tutorial-maintainer"},"maintainers")),o.createElement("li",null,"new braces handling in formula generation (braces are only placed if necessary)"),o.createElement("li",null,"bugfix: rename not existent column was silently ignored"),o.createElement("li",null,"syntax of dates has changed ",o.createElement("code",null,"1970-01-01")," could not be used any more because it is ambiguous (arithmetic operaton or date). The SQL notation (",o.createElement("code",null,"date('1970-01-01')"),") is now used for the relational algebra mode."))),o.createElement("li",null,"0.8",o.createElement("ul",null,o.createElement("li",null,"grid editor for inline relations"),o.createElement("li",null,"sql-dump import (beta)"),o.createElement("li",null,"group editor"),o.createElement("li",null,"changed the basic structure of the editors (internally)"),o.createElement("li",null,"duplicate rows are removed in every step")))),o.createElement("h2",null,"Who?"),o.createElement("p",null,"The relational algebra calculator was created by Johannes Kessler BSc at ",o.createElement("a",{href:"https://dbis-informatik.uibk.ac.at/1-1-Home.html"},"Databases and Information Systems Group")," at the ",o.createElement("a",{href:"http://informatik.uibk.ac.at/"},"Institute of Computer Science")," at the ",o.createElement("a",{href:"http://www.uibk.ac.at/index.html.en"},"University of Innsbruck")," under supervision of Michael Tschuggnall PhD and Prof. Dr. Günther Specht"),o.createElement("h2",null,"External resources"),o.createElement("p",null,"This tool was not written from scratch but many different external resources/frameworks/projects/libs are used."),o.createElement("p",null,"This is a list of resources/frameworks/projects/libs used for this tool (in alphabetical order) to give credit where credit is due and guide anyone interested to them without having to look through the code."),o.createElement("ul",null,o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel JavaScript compiler")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://blanketjs.org/"},"blanket.js")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://botmonster.com/jquery-bootpag/"},"bootpag")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://getbootstrap.com/"},"Bootstrap")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://bootstrap-datepicker.readthedocs.org"},"bootstrap-datepicker")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://bootstraptour.com/"},"Bootstrap Tour")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codemirror.net/"},"CodeMirror")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codepen.io/Pestov/pen/BLpgm"},"CSS3 family tree by Ilya Pestov")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://www.gnu.org/software/freefont/"},"FreeSans by GNU FreeFont")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://gruntjs.com/"},"Grunt")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handlebarsjs.com/"},"handlebars")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handsontable.com/"},"Handsontable")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://i18next.com/"},"i18next")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://jquery.com/"},"jQuery")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/chjj/marked"},"marked - a markdown parser")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://pegjs.org/"},"PEG.js - Parser Generator for JavaScript")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://qunitjs.com/"},"QUnit - js unit testing")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/tabatkins/railroad-diagrams"},"tabatkins/railroad-diagrams"))))))))}}class qn extends o.Component{componentDidMount(){}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Un,null),o.createElement("div",{className:"view-min"},"Databases and Information System",o.createElement("br",null),"Universität Innsbruck",o.createElement("br",null),"ICT - building, second floor",o.createElement("br",null),"Technikerstrasse 21a",o.createElement("br",null),"A-6020 Innsbruck",o.createElement("br",null)))}}n("./src/calc2/style/index.scss");class Gn extends o.Component{constructor(e){super(e),this.state={isNavbarOpen:!0}}componentDidMount(){var e;const t=document.getElementById("loadingScreen");null===(e=null==t?void 0:t.parentNode)||void 0===e||e.removeChild(t)}render(){const{store:e}=this.props,{isNavbarOpen:t}=this.state;return o.createElement(Ue,null,o.createElement(f,{store:e},o.createElement(r.a,null,o.createElement(Be,null,o.createElement(Le,{exact:!0,from:"/",to:"/relax/landing"}),o.createElement(Le,{exact:!0,from:"/relax",to:"/relax/landing"}),o.createElement(Pe,{path:"/relax/landing",component:Vn}),o.createElement(Pe,{path:"/relax/help",component:zn}),o.createElement(Pe,{path:"/relax/imprint",component:qn}),o.createElement(Le,{from:"/relax/calc",to:"/relax/calc/local/uibk/local/0",exact:!0,strict:!0}),o.createElement(Pe,{path:"/relax/calc/:source/:id/:filename/:index",component:Yn}),o.createElement(Pe,{path:"/relax/calc/:source/:id",component:Yn}),o.createElement(Pe,{path:"/relax/calc/:source/:id/:filename/:index",component:Yn}),o.createElement(Pe,{path:"/relax/api/:source/:id",component:Yn}),o.createElement(Pe,{render:e=>o.createElement("div",{className:"view-min"},o.createElement("h1",null,"404"),o.createElement("p",null,"This route doesn't exist"),o.createElement("span",null,JSON.stringify(e)))})))))}}},"./src/calc2/style/index.scss":function(e,t,n){},"./src/calc2/utils/groupUtils.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n("./src/db/relalg.ts"),o=n("./node_modules/jquery/dist/jquery.js");const i=n("./src/calc2/data/uibk.txt"),a={uibk:i.default?i.default:""};function s(e,t,n){return u(Object(r.c)(e),t,n)}function l(e,t,n){if(0===(e=e.filter(({name:e})=>e===t)).length)return{fallback:n};let r=null;const o={};for(let t=0;t{switch(e){case"gist":o.ajax({url:`https://api.github.com/gists/${t}`,dataType:"json",success:function(o){const a=[];for(const u in o.files){if(!o.files.hasOwnProperty(u))continue;const c=null===o.owner?"anonymous":o.owner.login,d=null===o.owner?void 0:o.owner.html_url,h={source:e,id:o.id,filename:u,index:-1,maintainer:n,maintainerGroup:r},f={author:c,authorUrl:d,lastModified:new Date(o.updated_at),url:o.url};try{a.push(...s(o.files[u].content,h,f)),i(a)}catch(e){const n='could not parse given group from gist with id "'+t+'": '+e;console.error(n,t,e,u,o),l(new Error(n))}}},crossDomain:!0,statusCode:{404:function(){l(new Error("gist "+t+" not found"))}},async:!0});break;case"local":try{const o=s(a[t],{source:e,id:t,filename:"local",index:-1,maintainer:n,maintainerGroup:r},{});i(o)}catch(e){let t="cannot parse groups file: "+e.message;t+="
        see log for more information",console.error(t,e),l(new Error(t))}break;case"http":{const e="parsing groups from arbitrary urls is no longer supported; use github gists instead.";window.alert(e),l(new Error(e));break}default:l(new Error("unknown source "+e))}})}},"./src/calc2/views/help.css":function(e,t,n){},"./src/calc2/views/landing.css":function(e,t,n){},"./src/db/exec/Column.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{constructor(e,t,n="null"){this._type="null",this._name=e,this._relAlias=t,this._type=n}getName(){return this._name}getRelAlias(){return this._relAlias}getType(){return this._type}setRelAlias(e){this._relAlias=e}toString(){return r.printColumn(this._name,this._relAlias)}equals(e){return this._name===e._name&&this._relAlias===e._relAlias}static printColumn(e,t){let n;return n="number"==typeof e?`[${e}]`:e,null===t?n:`${t}.${n}`}}},"./src/db/exec/ExecutionError.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r extends Error{constructor(e,t){super(e),this.codeInfo=t||void 0}}},"./src/db/exec/RANode.ts":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n("./src/db/exec/ExecutionError.ts");class o{constructor(e=""){this._codeInfo=null,this._metaData={},this._resultNumRows=-1,this._wrappedInParentheses=!1,this._warnings=[],this._functionName=e}setCodeInfoObject(e){return this._codeInfo=e,this}addWarning(e,t){const n={message:e,codeInfo:void 0};t&&(n.codeInfo=t),this._warnings||(this._warnings=[]),this._warnings.push(n)}setWrappedInParentheses(e=!0){this._wrappedInParentheses=e}throwExecutionError(e){throw new r.a(e,this._codeInfo)}setMetaData(e,t){this._metaData[e]=t}hasMetaData(e){return void 0!==this._metaData[e]}getMetaData(e){return this._metaData[e]}getResultNumRows(){if(void 0===this._resultNumRows||-1===this._resultNumRows)throw new Error("result num rows not set! call only after getResult");return this._resultNumRows}setResultNumRows(e){this._resultNumRows=e}_returnOrCreateSession(e){return void 0===e?{statement_timestamp:new Date}:e}getArgumentHtml(){return""}static foreachRecursive(e,t){t(e),e instanceof a?t(e.getChild()):e instanceof s&&(t(e.getChild()),t(e.getChild2()))}}class i extends o{getWarnings(e){return this._warnings}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class a extends o{constructor(e,t){super(e),this._child=t}getChild(){return this._child}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class s extends o{constructor(e,t,n){super(e),this._child=t,this._child2=n}getChild(){return this._child}getChild2(){return this._child2}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0),...this.getChild2().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses||!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild2().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}},"./src/db/exec/Relation.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./src/db/exec/RANode.ts"),o=n("./src/db/exec/Table.ts");class i extends r.b{constructor(e,t){super(e),this._schema=null,void 0===t?this._table=new o.a:(t.check(),this._schema=t.getSchema(),this._table=t.getResult())}setSchema(e,t=!1){return this._schema=e.copy(),!0!==t&&this._schema.setRelAlias(this._functionName),this._table.setSchema(this._schema),this}addRow(e){this._table.addRow(e)}addRows(e){this._table.addRows(e)}getResultNumRows(){return this._resultNumRows}getResult(e){this._returnOrCreateSession(e);const t=this._table.copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}getSchema(){return this._table.getSchema()}getName(){return this._functionName}check(){}hasChild(){return!1}copy(){if(null===this._schema)throw new Error("check not called");const e=new i(this._functionName);return e.setSchema(this._schema),e._table=this._table.copy(),e}}},"./src/db/exec/Schema.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./src/db/exec/Column.ts");class i{constructor(){this._names=[],this._relAliases=[],this._types=[],this._size=0,this._colIndexPerName={}}getSize(){return this._size}addColumn(e,t,n){if("string"!==n&&"date"!==n&&"number"!==n&&"boolean"!==n)throw new Error("unknown type! "+n);this._names.push(e),this._relAliases.push(t),this._types.push(n);const o=this._size;if(!1===this.isUnique(o))throw new Error(r.a("db.messages.exec.error-column-not-unique",{column:t+"."+e}));return this._addColToIndex(e,o),this._size++,this}addColumn2(e){return this.addColumn(e.getName(),e.getRelAlias(),e.getType())}_addColToIndex(e,t){void 0===this._colIndexPerName[e]?this._colIndexPerName[e]=[t]:this._colIndexPerName[e].push(t)}_removeColFromIndex(e){const t=this._names[e],n=this._colIndexPerName[t];n.splice(n.indexOf(e,0),1),0===n.length&&delete this._colIndexPerName[t]}removeColumn(e){this._names.splice(e,1),this._relAliases.splice(e,1),this._types.splice(e,1),this._size--;for(let t=e;tthis._size)throw new Error(r.a("db.messages.exec.error-column-index-out-of-range",{column:o.a.printColumn(e,t),schema:this.toString()}));if(null===t)return[n];if(this._relAliases[n]===t)return[n]}return[]}getType(e){return this._types[e]}equals(e){if(!1===this.equalsTypeOnly(e))return!1;for(let t=0;t1}getName(e){return this._names[e]}getFullName(e){return(this._relAliases[e]?this._relAliases[e]+".":"")+this._names[e]}toString(){const e=[];for(let t=0;t'+Object(r.d)(n,o)+"
        "}getRows(e=0,t){if(0===e&&void 0===t)return this._rows;{const n=this._rows.length;let r=n;t&&t>0&&(r=Math.min(n,e+t)),this._rows.slice(e,r);const o=[];for(let t=e;t"+n.getName()+"":""+n.toString()+""}o+="";let i="";const a=this.getNumRows();let s=a;t&&t>0&&(s=Math.min(a,n+t));for(let e=n;e"+this.getValueHtmlAt(e,n)+"";i+=t+""}return""+o+i+"
        "}equals(e){if(e instanceof a==!1)throw new Error("can not compare");if(!1===this._schema.equals(e._schema))return!1;if(this._rows.length!==e._rows.length)return!1;for(let t=0;tn)throw new Error("invalid sort cols");for(let e=0;e=n||r[e]<0)throw new Error("invalid sort cols");const i=r.length;if(i!==o.length)throw new Error("invalid sort cols");const a=r.map(e=>this._schema.getType(e)),s=function(e,t,n,r,o){const i=e[n],a=t[n];if(null===i&&null===a)return 0;if(null===i&&null!==a)return 1*r;if(null!==i&&null===a)return-1*r;switch(o){case"number":case"date":case"boolean":return r*(i-a);case"string":return r*i.localeCompare(a);case"null":return 0}};this._rows.sort((function(e,t){let n=0;for(let l=0;l=e.length?t[this._index-e.length]:e[this._index]}toString(){return o.a.printColumn(this._name,this._relAlias)}getFormulaHtml(){const e=o.a.printColumn(this._name,this._relAlias);return!0===this._wrappedInParentheses?"("+e+")":e}static _getColumnIndex(e,t,n,r){if(!t||null===t)return e.getColumnIndex(n,r,!0);const o=e.getColumnIndex(n,r,!1);return-1===o?t.getColumnIndex(n,r,!0)+e.getSize():(t.getColumnIndex(n,r,!1),o)}static _getType(e,t,n){return n>=e.getSize()?t.getType(n-e.getSize()):e.getType(n)}}class u extends s{constructor(e,t,n){super(),this._func=t,this._dataType=e,this._dataTypeCalculated=null,this._args=n||[]}evaluate(e,t,n,r){switch(this._dataType){case"string":return this._evaluateString(e,t,n,r);case"number":return this._evaluateNumber(e,t,n,r);case"boolean":return this._evaluateBoolean(e,t,n,r);case"date":return this._evaluateDate(e,t,n,r);case"null":return this._evaluateNull(e,t,n,r);default:throw new Error("this should not happen!")}}_parseIsoDate(e){const t=/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$/.exec(e);if(null===t)throw new r.a(i.a("db.messages.exec.error-invalid-date-format",{str:e}),this._codeInfo);const n=parseInt(t[1],10),o=parseInt(t[2],10)-1,a=parseInt(t[3],10),s=new Date(n,o,a);return s.getFullYear()===n&&s.getMonth()===o&&s.getDate()===a||this.throwExecutionError(i.a("db.messages.exec.error-invalid-date-format",{str:e})),s}_evaluateNull(e,t,n,r){switch(this._func){case"constant":return null;case"coalesce":for(let o=0;o1&&this._args[1].evaluate(e,t,n,r),null===o||this._args.length>1&&null===i)return null;switch(this._func){case"date":return this._parseIsoDate(o);case"adddate":return new Date(o.getTime()+864e5*i);case"subdate":return new Date(o.getTime()-864e5*i);default:throw new Error("this should not happen!")}}_checkDate(e,t){switch(this._func){case"transaction_timestamp":case"statement_timestamp":case"clock_timestamp":case"now":return!0;case"date":return this._checkArgsDataType(e,t,["string"]);case"adddate":case"subdate":return this._checkArgsDataType(e,t,["date","number"]);default:throw new Error("this should not happen!")}}_evaluateBoolean(e,t,n,r){let o,i,a;if("constant"===this._func)return this._args[0];switch(o=this._args[0].evaluate(e,t,n,r),i=this._args.length>1&&this._args[1].evaluate(e,t,n,r),this._func){case"not":return"unknown"===o?o:!o;case"and":return!1!==o&&!1!==i&&(!0===o&&!0===i||"unknown");case"or":return!0===o||!0===i||(!1!==o||!1!==i)&&"unknown";case"xor":return"unknown"===o||"unknown"===i?"unknown":o!==i;case"=":case">=":case"<=":case">":case"<":case"!=":return a=this._args[0].getDataType(),u._condition_compare(o,i,a,this._func);case"like":case"ilike":if(!this._regex)throw new Error("regex should have been set by check");return this._regex.test(o);default:throw new Error("this should not happen!")}}static _condition_compare(e,t,n,r){if(null===e||null===t)switch(r){case"=":case">=":case"<=":return e===t||"unknown";case"<":case">":return e!==t&&"unknown";case"!=":return e!==t;default:throw new Error("unknown operator")}switch(n){case"number":case"string":switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}case"date":switch(r){case"=":return e.getTime()===t.getTime();case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e.getTime()!==t.getTime();default:throw new Error("unknown operator")}case"boolean":if("boolean"!=typeof e||"boolean"!=typeof t)throw new Error("operands have different type");switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}default:throw new Error("unknown type "+n)}}_checkBoolean(e,t){let n,r;switch(this._func){case"constant":return!0;case"not":return this._checkArgsDataType(e,t,["boolean"]);case"and":case"or":case"xor":return this._checkArgsDataType(e,t,["boolean","boolean"]);case"=":case">=":case"<=":case">":case"<":case"!=":return this._args[0].check(e,t),this._args[1].check(e,t),n=this._args[0].getDataType(),r=this._args[1].getDataType(),"null"===n||"null"===r?!0:n===r||(this.throwExecutionError(i.a("db.messages.exec.error-could-not-compare-different-types",{typeA:n,typeB:r})),this._checkArgsDataType(e,t,["boolean","boolean"]));case"like":case"ilike":if(this._args[0].check(e,t),"string"!==this._args[1].getDataType()||"constant"!==this._args[1]._func)return!1;const o=this._args[1]._args[0];let a=String(o).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");a=a.replace(/([^\\]?)_/g,"$1."),a=a.replace(/([^\\]?)%/g,"$1.*");const s="ilike"===this._func?"i":"";this._regex=new RegExp("^"+a+"$",s);break;default:throw new Error("this should not happen!")}}_evaluateString(e,t,n,r){switch(this._func){case"constant":return this._args[0];case"lower":case"upper":const o=this._args[0].evaluate(e,t,n,r);return null===o?null:"lower"===this._func?o.toLowerCase():o.toUpperCase();case"concat":let i="";for(let o=0;o0?this._args[0].evaluate(e,t,n,r):void 0,i=this._args.length>1?this._args[1].evaluate(e,t,n,r):void 0;switch(this._func){case"add":return null===o||null===i?null:o+i;case"sub":return null===o||null===i?null:o-i;case"mul":return null===o||null===i?null:o*i;case"div":return null===o||null===i?null:o/i;case"mod":return null===o||null===i?null:o%i;case"abs":return null===o?null:Math.abs(o);case"floor":return null===o?null:Math.floor(o);case"ceil":return null===o?null:Math.ceil(o);case"round":return null===o?null:Math.round(o);case"minus":return null===o?null:-o;case"rand":return Math.random();case"rownum":return n+1;case"strlen":return null===o?null:o.length;case"year":return null===o?null:o.getFullYear();case"month":return null===o?null:o.getMonth()+1;case"dayofmonth":return null===o?null:o.getDate();case"hour":return null===o?null:o.getHours();case"minute":return null===o?null:o.getMinutes();case"second":return null===o?null:o.getSeconds();default:throw new Error("this should not happen!")}}_checkArgsDataType(e,t,n){const r=[];if(this._args.length!==n.length)throw new Error("this should not happen: #args != #types");for(let o=0;o{let t=(e||this._func)+"(";for(let e=0;e{let t="CASE";for(let n=0;n{let t="";return t+=` ${e||this._func} `,t=this._args[0].getFormulaHtml()+t,t+=this._args[1].getFormulaHtml(),`${t}`};function r(){const{_func:r}=this;switch(r){case"constant":return a(this._args[0],this._dataTypeCalculated||this._dataType);case"rand":case"rownum":case"abs":case"ceil":case"floor":case"round":case"year":case"month":case"dayofmonth":case"hour":case"minute":case"second":case"adddate":case"subdate":case"concat":case"upper":case"lower":case"date":case"strlen":return e.call(this,"length");case"minus":return e.call(this,"-");case"not":return e.call(this,"!");case"caseWhen":case"caseWhenElse":return t.call(this,"caseWhenElse"===this._func);case"add":return n.call(this,"+");case"sub":return n.call(this,"-");case"mul":return n.call(this,"*");case"div":return n.call(this,"/");case"mod":return n.call(this,"%");case"and":case"or":case"xor":case"like":case"ilike":case"=":return n.call(this,r);case">=":return n.call(this,"≥");case"<=":return n.call(this,"≤");case">":return n.call(this,">");case"<":return n.call(this,"<");case"!=":return n.call(this,"≠")}return this.toString()}return!0===this._wrappedInParentheses?`(${r.call(this)})`:r.call(this).toString()}}},"./src/db/parser/grammar_ra.pegjs":function(e,t,n){"use strict";function r(e,t,n,o){this.message=e,this.expected=t,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,n="";for(t=0;t0){for(t=1,r=1;t",!1),re=(pr("ψ",!1),pr("psi",!0),pr("τ",!1)),oe=function(){return ri("tau")},ie=pr("tau",!0),ae=pr("γ",!1),se=function(){return ri("gamma")},le=pr("gamma",!0),ue=pr("∪",!1),ce=function(){return ri("unionOperator")},de=pr("union",!0),he=pr("∩",!1),fe=function(){return ri("intersectOperator")},me=pr("intersect",!0),pe=pr("÷",!1),ge=pr("/",!1),ye=pr("\\",!1),be=function(){return ri("differenceOperator")},ve=pr("except",!0),_e=pr("⨯",!1),we=pr("x",!1),Ee=function(){return ri("crossJoinOperator")},je=pr("cross",!0),Ce=pr("join",!0),Se=pr("⨝",!1),Oe=pr("⋈",!1),ke=function(){return ri("innerJoinOperator")},Te=pr("inner",!0),Me=function(){return ri("naturalJoinOperator")},xe=pr("natural",!0),Re=pr("⋉",!1),Le=function(){return ri("leftSemiJoinOperator")},Ae=pr("left",!0),De=pr("semi",!0),Ne=pr("⋊",!1),Pe=function(){return ri("rightSemiJoinOperator")},Ie=pr("right",!0),He=pr("▷",!1),Ye=function(){return ri("antiJoinOperator")},Fe=pr("anti",!0),We=pr("⟕",!1),Be=function(){return ri("leftOuterJoinOperator")},Ue=pr("outer",!0),ze=pr("⟖",!1),Ve=function(){return ri("rightOuterJoinOperator")},qe=pr("⟗",!1),Ge=function(){return ri("fullOuterJoinOperator")},Ke=pr("full",!0),Xe=pr(",",!1),$e=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Je=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Qe=pr("asc",!0),Ze=pr("desc",!0),et=pr("sum",!0),tt=pr("count",!0),nt=pr("avg",!0),rt=pr("min",!0),ot=pr("max",!0),it=pr("(",!1),at=pr(")",!1),st=pr("count(*)",!0),lt=function(e){for(var t=[],n=0;n"group"===e.name);if(!r)continue;const o=r.text;t[o]&&mr(ei("db.messages.parser.error-group-non-unique-group-name",{name:o})),t[o]=!0}}(t),{type:"groupRoot",groups:t,codeInfo:ti()}},ut=pr("en",!1),ct=pr("de",!1),dt=pr("es",!1),ht=/^[a-z@]/,ft=gr([["a","z"],"@"],!1,!1),mt=pr(":",!1),pt=/^[a-z]/,gt=gr([["a","z"]],!1,!1),yt=pr("@",!1),bt=pr("[[",!1),vt=pr("\\]]",!1),_t=pr("]]",!1),wt=function(e,t){return function(e,t){var n,r=t[0];r.child=e,r.codeInfo=ni(r.child.codeInfo,r.codeInfo);for(var o=1;o",!1),kt=pr(">=",!1),Tt=pr("≥",!1),Mt=pr(">",!1),xt=pr("<=",!1),Rt=pr("≤",!1),Lt=pr("<",!1),At=yr("logical AND"),Dt=pr("and",!0),Nt=pr("∧",!1),Pt=yr("logical XOR"),It=pr("xor",!0),Ht=pr("⊻",!1),Yt=pr("⊕",!1),Ft=yr("logical OR"),Wt=pr("or",!0),Bt=pr("∨",!1),Ut=yr("logical NOT"),zt=pr("!",!1),Vt=pr("¬",!1),qt=yr("delimiter"),Gt=pr("string",!0),Kt=pr("number",!0),Xt=pr("date",!0),$t=pr("boolean",!0),Jt=pr("null",!1),Qt=pr("NULL",!1),Zt=pr("}",!1),en=/^[\-_a-z0-9.]/i,tn=gr(["-","_",["a","z"],["0","9"],"."],!1,!0),nn=function(e){return{type:"string",value:e,quoted:!0}},rn=pr('"',!1),on=/^[^"\n]/,an=gr(['"',"\n"],!0,!1),sn=pr("{",!1),ln=yr("boolean expression"),un=pr("||",!1),cn=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:ti()}},dn=pr("like",!0),hn=pr("ilike",!0),fn=pr("+",!1),mn=pr("*",!1),pn=pr("%",!1),gn=pr("coalesce",!0),yn=pr("concat",!0),bn=pr("adddate",!0),vn=pr("subdate",!0),_n=pr("mod",!0),wn=pr("add",!0),En=pr("sub",!0),jn=pr("mul",!0),Cn=pr("div",!0),Sn=pr("upper",!0),On=pr("ucase",!0),kn=pr("lower",!0),Tn=pr("lcase",!0),Mn=pr("length",!0),xn=pr("abs",!0),Rn=pr("floor",!0),Ln=pr("ceil",!0),An=pr("round",!0),Dn=pr("year",!0),Nn=pr("month",!0),Pn=pr("day",!0),In=pr("hour",!0),Hn=pr("minute",!0),Yn=pr("second",!0),Fn=pr("dayofmonth",!0),Wn=pr("rand",!0),Bn=pr("rownum",!0),Un=pr("now",!0),zn=pr("current_timestamp",!0),Vn=pr("transaction_timestamp",!0),qn=pr("statement_timestamp",!0),Gn=pr("clock_timestamp",!0),Kn=pr("sysdate",!0),Xn=pr("null",!0),$n=pr("case",!0),Jn=pr("when",!0),Qn=pr("then",!0),Zn=function(e,t){return{w:e,t:t}},er=pr("else",!0),tr=pr("end",!0),nr=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=ti();for(var o=1;olr&&(lr=ir,ur=[]),ur.push(e))}function wr(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function Er(){var e,t,n=135*ir+0,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=function(){var e,t,n,r,i,a,s=135*ir+57,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o&&(r=Br())!==o&&(i=kr())!==o?(ar=e,t=function(e,t){var n=[t];for(var r in e)n.push(e[r][0]);return oi(n),{type:"relalgRoot",assignments:n,child:null,operatorPositions:si,codeInfo:ti()}}(n,r),e=t):(ir=e,e=o)}else ir=e,e=o;if(e===o)if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?((r=eo())===o&&(r=null),r!==o&&(i=kr())!==o?(ar=e,t=function(e,t){for(var n=[],r=0;rir?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(s)),cr--,n===o?t=void 0:(ir=t,t=o),dr[r]={nextPos:ir,result:t},t)}function Cr(){var t,n=135*ir+3,r=dr[n];return r?(ir=r.nextPos,r.result):("\r\n"===e.substr(ir,2)?(t="\r\n",ir+=2):(t=o,0===cr&&_r(l)),t===o&&(10===e.charCodeAt(ir)?(t="\n",ir++):(t=o,0===cr&&_r(u))),dr[n]={nextPos:ir,result:t},t)}function Sr(){var t,n=135*ir+4,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=135*ir+5,g=dr[p];if(g)return ir=g.nextPos,g.result;cr++,t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d));n!==o?(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o?(i=ir,cr++,(a=Cr())===o&&(a=jr()),cr--,a!==o?(ir=i,i=void 0):i=o,i!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o);if(t===o&&(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o?(r=ir,cr++,(i=Cr())===o&&(i=jr()),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o),t===o))if(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o)if(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o){for(i=ir,a=[],l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);l!==o;)a.push(l),l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);(i=a!==o?e.substring(i,ir):a)!==o?(a=ir,cr++,(l=Cr())===o&&(l=jr()),cr--,l!==o?(ir=a,a=void 0):a=o,a!==o?(ar=t,t=n=i):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;cr--,t===o&&(n=o,0===cr&&_r(c));return dr[p]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u,c=135*ir+6,d=dr[c];if(d)return ir=d.nextPos,d.result;t=ir,"/*"===e.substr(ir,2)?(n="/*",ir+=2):(n=o,0===cr&&_r(m));if(n!==o){for(r=ir,i=[],a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);a!==o;)i.push(a),a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);(r=i!==o?e.substring(r,ir):i)!==o?("*/"===e.substr(ir,2)?(i="*/",ir+=2):(i=o,0===cr&&_r(p)),i!==o?(ar=t,t=n=r):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function Or(){var t,n,r,i,a,s,l,u=135*ir+7,c=dr[u];if(c)return ir=c.nextPos,c.result;for(cr++,t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),cr--,(t=n)===o&&(n=o,0===cr&&_r(g)),dr[u]={nextPos:ir,result:t},t}function kr(){var t,n,r=135*ir+8,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));n!==o;)t.push(n),(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));return cr--,t===o&&(n=o,0===cr&&_r(v)),dr[r]={nextPos:ir,result:t},t}function Tr(){var t,n,r=135*ir+10,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));n!==o;)t.push(n),_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));return cr--,t===o&&(n=o,0===cr&&_r(E)),dr[r]={nextPos:ir,result:t},t}function Mr(){var t,n,r,i=135*ir+12,a=dr[i];if(a)return ir=a.nextPos,a.result;for(t=ir,n=[],(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));r!==o;)n.push(r),(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));return n!==o&&(ar=t,n=""),t=n,dr[i]={nextPos:ir,result:t},t}function xr(){var t,n,r,i,a,s,l=135*ir+14,u=dr[l];if(u)return ir=u.nextPos,u.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseInt(n,10)),t=n,dr[l]={nextPos:ir,result:t},t}function Rr(){var t,n,r,i,a,s,l,u,c=135*ir+15,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;if(a!==o)if(46===e.charCodeAt(ir)?(s=".",ir++):(s=o,0===cr&&_r(x)),s!==o){if(l=[],T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o)for(;u!==o;)l.push(u),T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M));else l=o;l!==o?r=i=[i,a,s,l]:(ir=r,r=o)}else ir=r,r=o;else ir=r,r=o}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseFloat(n)),t=n,dr[c]={nextPos:ir,result:t},t}function Lr(){var t,n,r,i,a,s,l,u,c,d=135*ir+17,h=dr[d];return h?(ir=h.nextPos,h.result):(cr++,t=ir,n=ir,r=ir,T.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(M)),i!==o?(T.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(M)),a!==o?(T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?r=i=[i,a,s,l]:(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o),(n=r!==o?e.substring(n,ir):r)!==o?(45===e.charCodeAt(ir)?(r="-",ir++):(r=o,0===cr&&_r(k)),r!==o?(i=ir,a=ir,T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?a=s=[s,l]:(ir=a,a=o)):(ir=a,a=o),(i=a!==o?e.substring(i,ir):a)!==o?(45===e.charCodeAt(ir)?(a="-",ir++):(a=o,0===cr&&_r(k)),a!==o?(s=ir,l=ir,T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o?(T.test(e.charAt(ir))?(c=e.charAt(ir),ir++):(c=o,0===cr&&_r(M)),c!==o?l=u=[u,c]:(ir=l,l=o)):(ir=l,l=o),(s=l!==o?e.substring(s,ir):l)!==o?(ar=t,t=n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||mr(ei("db.messages.parser.error-invalid-date-format",{str:hr()})),r}(n,i,s)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),cr--,t===o&&(n=o,0===cr&&_r(R)),dr[d]={nextPos:ir,result:t},t)}function Ar(){var t,n,r=135*ir+18,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"true"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(L)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"false"===e.substr(ir,5).toLowerCase()?(n=e.substr(ir,5),ir+=5):(n=o,0===cr&&_r(A)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}function Dr(){var t,n,r,i,a,s,l,u,c=135*ir+20,d=dr[c];if(d)return ir=d.nextPos,d.result;if(cr++,t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return cr--,t===o&&(n=o,0===cr&&_r(N)),dr[c]={nextPos:ir,result:t},t}function Nr(){var t,n,r,i,a,s,l,u,c=135*ir+21,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Pr(){var t,n,r,i,a,s,l,u,c=135*ir+22,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o&&(r=Nr())!==o?(ar=t,u=r,null!=(l=n)&&(l=l[0]),t=n={type:"columnName",name:u,relAlias:l}):(ir=t,t=o),t===o)if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o)if(91===e.charCodeAt(ir)?(r="[",ir++):(r=o,0===cr&&_r(F)),r!==o){if(i=ir,a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;(i=a!==o?e.substring(i,ir):a)!==o?(93===e.charCodeAt(ir)?(a="]",ir++):(a=o,0===cr&&_r(W)),a!==o?(ar=t,t=n=function(e,t){return null!=e&&(e=e[0]),{type:"columnName",name:parseInt(t,10),relAlias:e}}(n,i)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Ir(){var t,n,r,i=135*ir+25,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,961===e.charCodeAt(ir)?(r="ρ",ir++):(r=o,0===cr&&_r(K)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"rho"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r($)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Hr(){var t,n,r,i=135*ir+26,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8592===e.charCodeAt(ir)?(r="←",ir++):(r=o,0===cr&&_r(J)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"<-"===e.substr(ir,2)?(r="<-",ir+=2):(r=o,0===cr&&_r(Z)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Yr(){var t,n,r,i=135*ir+27,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8594===e.charCodeAt(ir)?(r="→",ir++):(r=o,0===cr&&_r(ee)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"->"===e.substr(ir,2)?(r="->",ir+=2):(r=o,0===cr&&_r(ne)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Fr(){var t,n,r,i=135*ir+30,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,947===e.charCodeAt(ir)?(r="γ",ir++):(r=o,0===cr&&_r(ae)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"gamma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(le)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Wr(){var t,n,r,i=135*ir+33,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,247===e.charCodeAt(ir)?(r="÷",ir++):(r=o,0===cr&&_r(pe)),r===o&&(47===e.charCodeAt(ir)?(r="/",ir++):(r=o,0===cr&&_r(ge))),r!==o&&(ar=n,r=ri("divisionOperator")),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),dr[i]={nextPos:ir,result:t},t)}function Br(){var t,n,r,i,a=135*ir+44,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=Dr())!==o?(ar=ir,i=n,(void ai.push(i)?o:void 0)!==o&&function(){var t,n,r,i,a=135*ir+19,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=kr())!==o?(61===e.charCodeAt(ir)?(r="=",ir++):(r=o,0===cr&&_r(D)),r!==o&&(i=kr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}()!==o&&(r=eo())!==o?(ar=t,t=n=function(e,t){return t.assignmentName=e,{type:"assignment",name:e,child:t,codeInfo:ti()}}(n,r)):(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}function Ur(){var e,t,n,r=135*ir+45,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Uo())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t={type:"namedColumnExpr",name:n,relAlias:null,child:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Uo())!==o?(ar=e,e=t=function(e,t){return{type:"namedColumnExpr",name:e,relAlias:null,child:t,codeInfo:ti()}}(t,n)):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&(ar=e,t=t),e=t)),dr[r]={nextPos:ir,result:e},e)}function zr(){var e,t,n,r=135*ir+48,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Pr())!==o?(ar=e,e=t={type:"colAssignment",src:n,dst:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t=function(e,t){return{type:"colAssignment",src:e,dst:t,codeInfo:ti()}}(t,n)):(ir=e,e=o)),dr[r]={nextPos:ir,result:e},e)}function Vr(){var t,n,r,i,a,s,l=135*ir+51,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,(n=Pr())!==o?(r=ir,(i=Or())!==o&&(a=function(){var t,n,r=135*ir+50,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"asc"===e.substr(ir,3).toLowerCase()?(n=e.substr(ir,3),ir+=3):(n=o,0===cr&&_r(Qe)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"desc"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(Ze)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}())!==o?r=i=[i,a]:(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(ir=t,t=o)):(ir=t,t=o),dr[l]={nextPos:ir,result:t},t)}function qr(){var t,n,r,i,a,s,l=135*ir+53,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,n=ir,"sum"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(et)),r===o&&("count"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(tt)),r===o&&("avg"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(nt)),r===o&&("min"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(rt)),r===o&&("max"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ot)))))),(n=r!==o?e.substring(n,ir):r)!==o?(40===e.charCodeAt(ir)?(r="(",ir++):(r=o,0===cr&&_r(it)),r!==o&&kr()!==o&&(i=Pr())!==o&&kr()!==o?(41===e.charCodeAt(ir)?(a=")",ir++):(a=o,0===cr&&_r(at)),a!==o?(ar=t,s=i,t=n={aggFunction:n.toUpperCase(),col:s}):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,"count(*)"===e.substr(ir,8).toLowerCase()?(n=e.substr(ir,8),ir+=8):(n=o,0===cr&&_r(st)),n!==o&&(ar=t,n={aggFunction:"COUNT_ALL",col:null}),t=n),dr[l]={nextPos:ir,result:t},t)}function Gr(){var e,t,n,r,i,a=135*ir+54,s=dr[a];return s?(ir=s.nextPos,s.result):(e=ir,(t=qr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,i=n,(r=t).name=i,e=t=r):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=qr())!==o?(ar=e,e=t=function(e,t){return t.name=e,t}(t,n)):(ir=e,e=o)),dr[a]={nextPos:ir,result:e},e)}function Kr(){var t,n,r,i,a,s,l,u,c=135*ir+55,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Gr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Xr(){var e,t,n=135*ir+56,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=So())!==o&&Or()!==o?(ar=ir,(function(e){if("valueExpr"===e.type&&"columnValue"===e.func&&!e.wrappedInParentheses&&null===e.args[1]){for(var t=0;tir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);c!==o;)u.push(c),c=ir,d=ir,cr++,h=Cr(),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);(l=u!==o?e.substring(l,ir):u)!==o?(ar=t,t=n=function(e,t,n){return{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o;if(t===o){if(t=ir,n=ir,cr++,r=ir,i=[],ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft)),a!==o)for(;a!==o;)i.push(a),ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft));else i=o;if(i!==o?("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),cr--,r!==o?(ir=n,n=void 0):n=o,n!==o){if(r=ir,i=[],pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt)),a!==o)for(;a!==o;)i.push(a),pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt));else i=o;if((r=i!==o?e.substring(r,ir):i)!==o)if(i=ir,64===e.charCodeAt(ir)?(a="@",ir++):(a=o,0===cr&&_r(yt)),a!==o&&(l=Jr())!==o?i=a=[a,l]:(ir=i,i=o),i===o&&(i=null),i!==o)if("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o){for(l=ir,u=[],"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));c!==o;)u.push(c),"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));(l=u!==o?e.substring(l,ir):u)!==o?("]]"===e.substr(ir,2)?(u="]]",ir+=2):(u=o,0===cr&&_r(_t)),u!==o?(ar=t,t=n=function(e,t,n){return n=(n=n.replace(/\\]]/g,"]]")).replace(/\\\\]]/g,"\\]]"),{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o}return dr[f]={nextPos:ir,result:t},t}function Zr(){var e,t,n,r,i,a,s=135*ir+62,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,kr()!==o)if((t=function(){var e,t,n,r,i,a,s,l,u=135*ir+59,c=dr[u];if(c)return ir=c.nextPos,c.result;if(e=ir,(t=Qr())!==o){for(n=[],r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,s=n,(l=[]).push(t),s.map((function(e){var t=e[1];l.push(t)})),e=t=l):(ir=e,e=o)}else ir=e,e=o;return dr[u]={nextPos:ir,result:e},e}())!==o){if(n=[],r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o),r!==o)for(;r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o);else n=o;n!==o?(ar=e,e=function(e,t){for(var n=[],r=0;r"group"===e.name);return void 0===o?mr(ei("db.messages.parser.error-group-header-name-missing")+': "group: ..........\\n"'):0===o.text.trim().length&&mr(ei("error-group-header-name-empty")),{type:"tableGroup",headers:e,assignments:n,codeInfo:ti()}}(t,n)):(ir=e,e=o)}else ir=e,e=o;else ir=e,e=o;return dr[s]={nextPos:ir,result:e},e}function eo(){var e,t,n,r,i=135*ir+63,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=to())!==o){if(n=[],(r=io())===o&&(r=ao()),r!==o)for(;r!==o;)n.push(r),(r=io())===o&&(r=ao());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=to()),dr[i]={nextPos:ir,result:e},e}function to(){var e,t,n,r,i=135*ir+64,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=no())!==o){if(n=[],(r=oo())!==o)for(;r!==o;)n.push(r),r=oo();else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=no()),dr[i]={nextPos:ir,result:e},e}function no(){var e,t,n,r,i=135*ir+65,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=ro())!==o){if(n=[],(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo()),r!==o)for(;r!==o;)n.push(r),(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=ro()),dr[i]={nextPos:ir,result:e},e}function ro(){var t,n=135*ir+66,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a=135*ir+86,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+29,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,964===e.charCodeAt(ir)?(r="τ",ir++):(r=o,0===cr&&_r(re)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"tau"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ie)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+52,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Vr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"orderBy",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+85,c=dr[u];if(c)return ir=c.nextPos,c.result;t=ir,(n=Fr())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+47,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Pr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o&&kr()!==o&&(s=Kr())!==o&&Or()!==o&&(l=ro())!==o?(ar=t,d=n,h=r,f=s,m=l,si.push(d),n={type:"groupBy",child:m,group:h,aggregate:f,codeInfo:ti()},t=n):(ir=t,t=o)):(ir=t,t=o);var d,h,f,m;t===o&&(t=ir,(n=Fr())!==o?(r=ir,(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o&&(i=kr())!==o&&(a=Kr())!==o&&Or()!==o&&(s=ro())!==o?(ar=t,n=function(e,t,n){return si.push(e),{type:"groupBy",child:n,group:[],aggregate:t,codeInfo:ti()}}(n,a,s),t=n):(ir=t,t=o)):(ir=t,t=o));return dr[u]={nextPos:ir,result:t},t}())===o&&(t=function(){var e,t,n,r,i=135*ir+84,a=dr[i];if(a)return ir=a.nextPos,a.result;e=ir,(t=Ir())!==o&&(n=Dr())!==o&&Or()!==o&&(r=ro())!==o?(ar=e,s=t,l=n,u=r,si.push(s),t={type:"renameRelation",child:u,newRelAlias:l,codeInfo:ti()},e=t):(ir=e,e=o);var s,l,u;return dr[i]={nextPos:ir,result:e},e}())===o&&(t=function(){var t,n,r,i,a=135*ir+83,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=Ir())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+49,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=zr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"renameColumns",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+82,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+24,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,963===e.charCodeAt(ir)?(r="σ",ir++):(r=o,0===cr&&_r(V)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"sigma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(G)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=So())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"selection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+81,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+23,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,960===e.charCodeAt(ir)?(r="π",ir++):(r=o,0===cr&&_r(B)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"pi"===e.substr(ir,2).toLowerCase()?(r=e.substr(ir,2),ir+=2):(r=o,0===cr&&_r(z)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+46,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Ur())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"projection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+67,s=dr[a];if(s)return ir=s.nextPos,s.result;(t=function(){var t,n,r,i,a,s,l,u,c,d=135*ir+105,h=dr[d];if(h)return ir=h.nextPos,h.result;t=ir,123===e.charCodeAt(ir)?(n="{",ir++):(n=o,0===cr&&_r(sn));if(n!==o)if(kr()!==o)if((r=function(){var e,t,n,r,i,a,s=135*ir+103,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=Eo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,t=function(e,t){for(var n,r=[e],o=0;o="===e.substr(ir,2)?(n=">=",ir+=2):(n=o,0===cr&&_r(kt));n===o&&(8805===e.charCodeAt(ir)?(n="≥",ir++):(n=o,0===cr&&_r(Tt)));n!==o&&(ar=t,n=">=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r=135*ir+94,i=dr[r];if(i)return ir=i.nextPos,i.result;t=ir,"<="===e.substr(ir,2)?(n="<=",ir+=2):(n=o,0===cr&&_r(xt));n===o&&(8804===e.charCodeAt(ir)?(n="≤",ir++):(n=o,0===cr&&_r(Rt)));n!==o&&(ar=t,n="<=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+93,r=dr[n];if(r)return ir=r.nextPos,r.result;62===e.charCodeAt(ir)?(t=">",ir++):(t=o,0===cr&&_r(Mt));return dr[n]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+95,r=dr[n];if(r)return ir=r.nextPos,r.result;60===e.charCodeAt(ir)?(t="<",ir++):(t=o,0===cr&&_r(Lt));return dr[n]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function vo(){var t,n=135*ir+90,r=dr[n];return r?(ir=r.nextPos,r.result):(61===e.charCodeAt(ir)?(t="=",ir++):(t=o,0===cr&&_r(D)),dr[n]={nextPos:ir,result:t},t)}function _o(){var t,n,r=135*ir+91,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"!="===e.substr(ir,2)?(n="!=",ir+=2):(n=o,0===cr&&_r(Ct)),n===o&&(8800===e.charCodeAt(ir)?(n="≠",ir++):(n=o,0===cr&&_r(St)),n===o&&("<>"===e.substr(ir,2)?(n="<>",ir+=2):(n=o,0===cr&&_r(Ot)))),n!==o&&(ar=t,n="!="),t=n,dr[r]={nextPos:ir,result:t},t)}function wo(){var t,n,r,i,a=135*ir+100,s=dr[a];return s?(ir=s.nextPos,s.result):(cr++,t=ir,(n=Mr())!==o?(44===e.charCodeAt(ir)?(r=",",ir++):(r=o,0===cr&&_r(Xe)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,(n=Mr())!==o?(59===e.charCodeAt(ir)?(r=";",ir++):(r=o,0===cr&&_r(jt)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+11,c=dr[u];if(c)return ir=c.nextPos,c.result;for(t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),t=n,dr[u]={nextPos:ir,result:t},t}())),cr--,t===o&&(n=o,0===cr&&_r(qt)),dr[a]={nextPos:ir,result:t},t)}function Eo(){var t,n,r,i,a,s,l,u=135*ir+101,c=dr[u];return c?(ir=c.nextPos,c.result):(t=ir,(n=Pr())!==o?(r=ir,58===e.charCodeAt(ir)?(i=":",ir++):(i=o,0===cr&&_r(mt)),i!==o?("string"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Gt)),a===o&&("number"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Kt)),a===o&&("date"===e.substr(ir,4).toLowerCase()?(a=e.substr(ir,4),ir+=4):(a=o,0===cr&&_r(Xt)),a===o&&("boolean"===e.substr(ir,7).toLowerCase()?(a=e.substr(ir,7),ir+=7):(a=o,0===cr&&_r($t))))),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,l=r,t=n={name:(s=n).name,relAlias:s.relAlias,type:null===l?null:l[1].toLowerCase()}):(ir=t,t=o)):(ir=t,t=o),dr[u]={nextPos:ir,result:t},t)}function jo(){var t,n,r,i,a,s=135*ir+102,l=dr[s];if(l)return ir=l.nextPos,l.result;if(t=ir,(n=Lr())!==o&&(ar=t,n={type:"date",value:n}),(t=n)===o&&(t=ir,"null"===e.substr(ir,4)?(n="null",ir+=4):(n=o,0===cr&&_r(Jt)),n===o&&("NULL"===e.substr(ir,4)?(n="NULL",ir+=4):(n=o,0===cr&&_r(Qt))),n!==o&&(ar=t,n={type:"null",value:null}),(t=n)===o&&(t=ir,(n=Ar())!==o?(r=ir,cr++,(i=wo())===o&&(i=Cr())===o&&(125===e.charCodeAt(ir)?(i="}",ir++):(i=o,0===cr&&_r(Zt))),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n={type:"boolean",value:n,quoted:!1}):(ir=t,t=o)):(ir=t,t=o),t===o))){if(t=ir,n=ir,r=[],en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn)),i!==o)for(;i!==o;)r.push(i),en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn));else r=o;if((n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=function(e){return{type:"string",value:e,quoted:!1}}(n)),(t=n)===o){if(t=ir,39===e.charCodeAt(ir)?(n="'",ir++):(n=o,0===cr&&_r(C)),n!==o){for(r=ir,i=[],S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));a!==o;)i.push(a),S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));(r=i!==o?e.substring(r,ir):i)!==o?(39===e.charCodeAt(ir)?(i="'",ir++):(i=o,0===cr&&_r(C)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;if(t===o)if(t=ir,34===e.charCodeAt(ir)?(n='"',ir++):(n=o,0===cr&&_r(rn)),n!==o){for(r=ir,i=[],on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));a!==o;)i.push(a),on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));(r=i!==o?e.substring(r,ir):i)!==o?(34===e.charCodeAt(ir)?(i='"',ir++):(i=o,0===cr&&_r(rn)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o}}return dr[s]={nextPos:ir,result:t},t}function Co(){var e,t,n,r,i,a,s=135*ir+104,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=jo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,e=t=function(e,t){for(var n=[e],r=0;r0){for(t=1,r=1;t",!1),qe=Qn("!=",!1),Ge=Qn(">=",!1),Ke=Qn(">",!1),Xe=Qn("<=",!1),$e=Qn("<",!1),Je=er("logical AND"),Qe=Qn("and",!0),Ze=er("logical XOR"),et=Qn("xor",!0),tt=er("logical OR"),nt=Qn("or",!0),rt=er("logical NOT"),ot=Qn("!",!1),it=(Qn("not",!1),Qn("exists",!0)),at=Qn("#",!1),st=/^[^\n]/,lt=Zn(["\n"],!0,!1),ut=Qn("`",!1),ct=Qn("drop",!0),dt=Qn("table",!0),ht=Qn("if",!0),ft=Qn("lock",!0),mt=Qn("tables",!0),pt=Qn("unlock",!0),gt=Qn("use",!0),yt=/^[a-zA-Z_0-9\-]/,bt=Zn([["a","z"],["A","Z"],"_",["0","9"],"-"],!1,!1),vt=Qn("decimal",!0),_t=Qn("tinyint",!0),wt=Qn("smallint",!0),Et=Qn("mediumint",!0),jt=Qn("bigint",!0),Ct=Qn("integer",!0),St=Qn("int",!0),Ot=Qn("float",!0),kt=Qn("double",!0),Tt=Qn("varchar",!0),Mt=Qn("char",!0),xt=Qn("text",!0),Rt=Qn("datetime",!0),Lt=/^[a-zA-Z0-9_=]/,At=Zn([["a","z"],["A","Z"],["0","9"],"_","="],!1,!1),Dt=Qn("create",!0),Nt=Qn("exists",!1),Pt=Qn("null",!0),It=Qn("insert",!0),Ht=Qn("into",!0),Yt=Qn("values",!0),Ft=er("boolean expression"),Wt=Qn("||",!1),Bt=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:No()}},Ut=Qn("like",!0),zt=Qn("ilike",!0),Vt=Qn("+",!1),qt=Qn("/",!1),Gt=Qn("%",!1),Kt=Qn("coalesce",!0),Xt=Qn("concat",!0),$t=Qn("adddate",!0),Jt=Qn("subdate",!0),Qt=Qn("mod",!0),Zt=Qn("add",!0),en=Qn("sub",!0),tn=Qn("mul",!0),nn=Qn("div",!0),rn=Qn("upper",!0),on=Qn("ucase",!0),an=Qn("lower",!0),sn=Qn("lcase",!0),ln=Qn("length",!0),un=Qn("abs",!0),cn=Qn("floor",!0),dn=Qn("ceil",!0),hn=Qn("round",!0),fn=Qn("year",!0),mn=Qn("month",!0),pn=Qn("day",!0),gn=Qn("hour",!0),yn=Qn("minute",!0),bn=Qn("second",!0),vn=Qn("dayofmonth",!0),_n=Qn("rand",!0),wn=Qn("rownum",!0),En=Qn("now",!0),jn=Qn("current_timestamp",!0),Cn=Qn("transaction_timestamp",!0),Sn=Qn("statement_timestamp",!0),On=Qn("clock_timestamp",!0),kn=Qn("sysdate",!0),Tn=Qn("case",!0),Mn=Qn("when",!0),xn=Qn("then",!0),Rn=function(e,t){return{w:e,t:t}},Ln=Qn("else",!0),An=Qn("end",!0),Dn=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=No();for(var o=1;oqn&&(qn=Un,Gn=[]),Gn.push(e))}function or(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function ir(){var e,t,n,r=113*Un+0,i=Xn[r];return i?(Un=i.nextPos,i.result):(e=Un,(t=kr())!==o&&(zn=e,t=t),(e=t)===o&&(e=Un,(t=kr())!==o&&(n=ur())!==o?(zn=e,e=t=t):(Un=e,e=o),e===o&&(e=Un,(t=ur())!==o&&(n=kr())!==o?(zn=e,e=t=n):(Un=e,e=o))),Xn[r]={nextPos:Un,result:e},e)}function ar(){var t,n,r=113*Un+2,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,Kn++,e.length>Un?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(s)),Kn--,n===o?t=void 0:(Un=t,t=o),Xn[r]={nextPos:Un,result:t},t)}function sr(){var t,n=113*Un+3,r=Xn[n];return r?(Un=r.nextPos,r.result):("\r\n"===e.substr(Un,2)?(t="\r\n",Un+=2):(t=o,0===Kn&&rr(l)),t===o&&(10===e.charCodeAt(Un)?(t="\n",Un++):(t=o,0===Kn&&rr(u))),Xn[n]={nextPos:Un,result:t},t)}function lr(){var t,n=113*Un+4,r=Xn[n];return r?(Un=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=113*Un+5,g=Xn[p];if(g)return Un=g.nextPos,g.result;Kn++,t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d));n!==o?(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o?(i=Un,Kn++,(a=sr())===o&&(a=ar()),Kn--,a!==o?(Un=i,i=void 0):i=o,i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);if(t===o&&(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o?(r=Un,Kn++,(i=sr())===o&&(i=ar()),Kn--,i!==o?(Un=r,r=void 0):r=o,r!==o?t=n=[n,r]:(Un=t,t=o)):(Un=t,t=o),t===o))if(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o)if(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o){for(i=Un,a=[],l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);l!==o;)a.push(l),l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);(i=a!==o?e.substring(i,Un):a)!==o?(a=Un,Kn++,(l=sr())===o&&(l=ar()),Kn--,l!==o?(Un=a,a=void 0):a=o,a!==o?t=n=[n,r,i,a]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;Kn--,t===o&&(n=o,0===Kn&&rr(c));return Xn[p]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u=113*Un+6,c=Xn[u];if(c)return Un=c.nextPos,c.result;t=Un,"/*"===e.substr(Un,2)?(n="/*",Un+=2):(n=o,0===Kn&&rr(m));if(n!==o){for(r=[],i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);r!==o?("*/"===e.substr(Un,2)?(i="*/",Un+=2):(i=o,0===Kn&&rr(p)),i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Xn[u]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function ur(){var t,n,r,i,a,s,l,u=113*Un+7,c=Xn[u];if(c)return Un=c.nextPos,c.result;for(Kn++,t=Un,n=[],r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o}else n=o;return n!==o&&(zn=t,n=""),Kn--,(t=n)===o&&(n=o,0===Kn&&rr(g)),Xn[u]={nextPos:Un,result:t},t}function cr(){var t,n,r=113*Un+8,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));n!==o;)t.push(n),(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));return Kn--,t===o&&(n=o,0===Kn&&rr(v)),Xn[r]={nextPos:Un,result:t},t}function dr(){var t,n,r=113*Un+9,i=Xn[r];if(i)return Un=i.nextPos,i.result;if(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E)),n!==o)for(;n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));else t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(_)),Xn[r]={nextPos:Un,result:t},t}function hr(){var t,n,r=113*Un+10,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));return Kn--,t===o&&(n=o,0===Kn&&rr(j)),Xn[r]={nextPos:Un,result:t},t}function fr(){var t,n,r,i,a,s=113*Un+11,l=Xn[s];if(l)return Un=l.nextPos,l.result;if(Kn++,t=Un,34===e.charCodeAt(Un)?(n='"',Un++):(n=o,0===Kn&&rr(S)),n!==o){for(r=[],O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));i!==o;)r.push(i),O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));r!==o?(34===e.charCodeAt(Un)?(i='"',Un++):(i=o,0===Kn&&rr(S)),i!==o?(zn=t,t=n=void Jn(i18n.t("db.messages.parser.error-sql-string-use-single-quotes"))):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;if(t===o)if(t=Un,39===e.charCodeAt(Un)?(n="'",Un++):(n=o,0===Kn&&rr(T)),n!==o){for(r=Un,i=[],M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));a!==o;)i.push(a),M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));(r=i!==o?e.substring(r,Un):i)!==o?(39===e.charCodeAt(Un)?(i="'",Un++):(i=o,0===Kn&&rr(T)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(C)),Xn[s]={nextPos:Un,result:t},t}function mr(){var t,n,r,i,a,s,l=113*Un+12,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(R)),i===o&&(i=null),i!==o){if(a=[],L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseInt(n,10)),t=n,Xn[l]={nextPos:Un,result:t},t}function pr(){var t,n,r,i,a,s,l,u,c=113*Un+13,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(R)),i===o&&(i=null),i!==o){if(a=[],L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;if(a!==o)if(46===e.charCodeAt(Un)?(s=".",Un++):(s=o,0===Kn&&rr(D)),s!==o){if(l=[],L.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o)for(;u!==o;)l.push(u),L.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A));else l=o;l!==o?r=i=[i,a,s,l]:(Un=r,r=o)}else Un=r,r=o;else Un=r,r=o}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseFloat(n)),t=n,Xn[c]={nextPos:Un,result:t},t}function gr(){var e,t=113*Un+14,n=Xn[t];return n?(Un=n.nextPos,n.result):((e=pr())===o&&(e=mr()),Xn[t]={nextPos:Un,result:e},e)}function yr(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+16,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(Kn++,t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-relation-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(I)),Xn[h]={nextPos:Un,result:t},t}function br(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+17,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-column-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Xn[h]={nextPos:Un,result:t},t}function vr(){var t,n,r,i,a,s=113*Un+19,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,"date"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(B)),n!==o?("('"===e.substr(Un,2)?(r="('",Un+=2):(r=o,0===Kn&&rr(U)),r!==o&&(i=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+20,h=Xn[d];if(h)return Un=h.nextPos,h.result;Kn++,t=Un,n=Un,r=Un,L.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));i!==o?(L.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(A)),a!==o?(L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(L.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o);n=r!==o?e.substring(n,Un):r;n!==o?(45===e.charCodeAt(Un)?(r="-",Un++):(r=o,0===Kn&&rr(R)),r!==o?(i=Un,a=Un,L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(L.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),(i=a!==o?e.substring(i,Un):a)!==o?(45===e.charCodeAt(Un)?(a="-",Un++):(a=o,0===Kn&&rr(R)),a!==o?(s=Un,l=Un,L.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o?(L.test(e.charAt(Un))?(c=e.charAt(Un),Un++):(c=o,0===Kn&&rr(A)),c!==o?l=u=[u,c]:(Un=l,l=o)):(Un=l,l=o),(s=l!==o?e.substring(s,Un):l)!==o?(zn=t,n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||Jn(i18n.t("db.messages.parser.error-invalid-date-format",{str:$n()})),r}(n,i,s),t=n):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);Kn--,t===o&&(n=o,0===Kn&&rr(V));return Xn[d]={nextPos:Un,result:t},t}())!==o?("')"===e.substr(Un,2)?(a="')",Un+=2):(a=o,0===Kn&&rr(z)),a!==o?(zn=t,t=n=i):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function _r(){var t,n,r,i,a,s=113*Un+21,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o&&(r=br())!==o?(zn=t,t=n={type:"column",name:r,relAlias:(a=n)?a[0]:null}):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function wr(){var t,n,r,i,a=113*Un+23,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,n=Un,r=[],L.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A)),i!==o)for(;i!==o;)r.push(i),L.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));else r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n={type:"column",name:parseInt(n,10),relAlias:null}),t=n,Xn[a]={nextPos:Un,result:t},t}function Er(){var t,n,r,i,a,s,l,u,c=113*Un+24,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,n=Un,"sum"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(G)),r===o&&("count"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(K)),r===o&&("avg"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(X)),r===o&&("min"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr($)),r===o&&("max"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(J)))))),(n=r!==o?e.substring(n,Un):r)!==o?(40===e.charCodeAt(Un)?(r="(",Un++):(r=o,0===Kn&&rr(Q)),r!==o&&cr()!==o?(i=Un,"all"===e.substr(Un,3).toLowerCase()?(a=e.substr(Un,3),Un+=3):(a=o,0===Kn&&rr(Z)),a!==o&&(s=ur())!==o?i=a=[a,s]:(Un=i,i=o),i===o&&(i=null),i!==o&&(a=_r())!==o&&(s=cr())!==o?(41===e.charCodeAt(Un)?(l=")",Un++):(l=o,0===Kn&&rr(ee)),l!==o?(zn=t,u=a,t=n={type:"aggFunction",aggFunction:n.toUpperCase(),col:u}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,"count(*)"===e.substr(Un,8).toLowerCase()?(n=e.substr(Un,8),Un+=8):(n=o,0===Kn&&rr(te)),n!==o&&(zn=t,n={type:"aggFunction",aggFunction:"COUNT_ALL",col:null}),t=n),Xn[c]={nextPos:Un,result:t},t)}function jr(){var t,n,r,i,a,s,l,u,c=113*Un+25,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=Er())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,s=i,(a=n).name=s,t=n=a):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Er())!==o&&cr()!==o?(zn=t,t=n=void Jn("aggregation columns must be named")):(Un=t,t=o),t===o&&(t=Un,(n=function(){var t,n,r,i,a,s=113*Un+22,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o?(42===e.charCodeAt(Un)?(r="*",Un++):(r=o,0===Kn&&rr(q)),r!==o?(zn=t,t=n={type:"column",name:"*",relAlias:(a=n)?a[0]:null}):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}())!==o&&(zn=t,n=re(n)),(t=n)===o&&(t=Un,(n=_r())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,u=i,(l=n).alias=u,t=n=l):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Co())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,t=n=function(e,t){return{type:"namedColumnExpr",name:t,relAlias:null,child:e,codeInfo:No()}}(n,i)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=_r())!==o&&(zn=t,n=re(n)),t=n))))),Xn[c]={nextPos:Un,result:t},t)}function Cr(){var t,n,r,i,a,s,l=113*Un+29,u=Xn[l];return u?(Un=u.nextPos,u.result):(t=Un,(n=_r())===o&&(n=wr()),n!==o?(r=Un,(i=ur())!==o&&(a=function(){var t,n,r=113*Un+28,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,"asc"===e.substr(Un,3).toLowerCase()?(n=e.substr(Un,3),Un+=3):(n=o,0===Kn&&rr(ie)),n!==o&&(zn=t,n=!0),(t=n)===o&&(t=Un,"desc"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ae)),n!==o&&(zn=t,n=!1),t=n),Xn[r]={nextPos:Un,result:t},t)}())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(Un=t,t=o)):(Un=t,t=o),Xn[l]={nextPos:Un,result:t},t)}function Sr(){var t,n,r,i,a,s,l,u,c=113*Un+30,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,(n=Cr())!==o){for(r=[],i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);r!==o?(zn=t,t=n=function(e,t){var n=[e];if(null!=t)for(var r in t)n.push(t[r][3]);return{value:n,codeInfo:No()}}(n,r)):(Un=t,t=o)}else Un=t,t=o;return Xn[c]={nextPos:Un,result:t},t}function Or(){var t,n,r,i,a,s,l,u,c=113*Un+32,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=yr())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&cr()!==o?(40===e.charCodeAt(Un)?(i="(",Un++):(i=o,0===Kn&&rr(Q)),i!==o&&(a=xr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,l=n,(u=a).wrappedInParentheses=!0,t=n={type:"assignment",name:l,child:{type:"relationFromSubstatement",statement:u,relAlias:l,codeInfo:No()},codeInfo:No()}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function kr(){var t,n,r,i,a=113*Un+33,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,(n=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+34,h=Xn[d];if(h)return Un=h.nextPos,h.result;t=Un,"with"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ue));if(n!==o)if(ur()!==o)if((r=Or())!==o){for(i=[],a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);a!==o;)i.push(a),a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);i!==o?(zn=t,n=function(e,t){for(var n=[e],r=0;r0&&i!=e.arg.length&&null===r&&Jn(i18n.t("db.messages.parser.error-sql-group-by-missing")),o&&!r&&0===i&&Jn(i18n.t("db.messages.parser.error-sql-having-without-group-by")),{type:"statement",select:e,from:t,where:n?n[1]:null,groupBy:r?r[5]:null,having:o?o[1]:null,numAggregationColumns:i,wrappedInParentheses:!1,codeInfo:No()}}(n,i,a,s,l)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&cr()!==o&&(r=xr())!==o&&cr()!==o?(41===e.charCodeAt(Un)?(i=")",Un++):(i=o,0===Kn&&rr(ee)),i!==o?(zn=t,t=n=ye(r)):(Un=t,t=o)):(Un=t,t=o)),Xn[m]={nextPos:Un,result:t},t)}function Dr(){var t,n,r,i,a=113*Un+41,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("union"===e.substr(Un,5).toLowerCase()?(n=e.substr(Un,5),Un+=5):(n=o,0===Kn&&rr(be)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Lr())!==o?(zn=t,t={type:"union",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Nr(){var t,n,r,i,a=113*Un+42,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("except"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(_e)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Lr())!==o?(zn=t,t={type:"except",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Pr(){var t,n,r,i,a=113*Un+43,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("intersect"===e.substr(Un,9).toLowerCase()?(n=e.substr(Un,9),Un+=9):(n=o,0===Kn&&rr(we)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Lr())!==o?(zn=t,t={type:"intersect",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Ir(){var e,t,n,r,i=113*Un+44,a=Xn[i];if(a)return Un=a.nextPos,a.result;if(e=Un,(t=Hr())!==o){if(n=[],(r=Yr())===o&&(r=Fr())===o&&(r=Wr()),r!==o)for(;r!==o;)n.push(r),(r=Yr())===o&&(r=Fr())===o&&(r=Wr());else n=o;n!==o?(zn=e,e=t=me(t,n)):(Un=e,e=o)}else Un=e,e=o;return e===o&&(e=Hr()),Xn[i]={nextPos:Un,result:e},e}function Hr(){var t,n,r,i,a,s,l,u,c,d,h,f=113*Un+45,m=Xn[f];return m?(Un=m.nextPos,m.result):(t=Un,(n=yr())!==o?(r=Un,(i=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ne)),a!==o&&(s=ur())!==o&&(l=yr())!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,d=r,h={type:"relation",name:n,relAlias:null,codeInfo:No()},t=n=null!==d?{type:"renameRelation",child:h,newRelAlias:d[3],codeInfo:No()}:h):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=xr())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o&&(l=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(u=e.substr(Un,2),Un+=2):(u=o,0===Kn&&rr(ne)),u!==o&&ur()!==o&&(c=yr())!==o?(zn=t,t=n=function(e,t){return e.wrappedInParentheses=!0,{type:"relationFromSubstatement",statement:e,relAlias:t,codeInfo:No()}}(i,c)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=Ir())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,t=n=ye(i)):(Un=t,t=o)):(Un=t,t=o))),Xn[f]={nextPos:Un,result:t},t)}function Yr(){var t,n,r,i,a,s,l,u=113*Un+46,c=Xn[u];return c?(Un=c.nextPos,c.result):(t=Un,n=Un,(r=ur())!==o?("cross"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Ee)),i!==o&&(a=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(s=e.substr(Un,4),Un+=4):(s=o,0===Kn&&rr(je)),s!==o&&(l=ur())!==o?n=r=[r,i,a,s,l]:(Un=n,n=o)):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,(r=cr())!==o?(44===e.charCodeAt(Un)?(i=",",Un++):(i=o,0===Kn&&rr(oe)),i!==o&&(a=cr())!==o?n=r=[r,i,a]:(Un=n,n=o)):(Un=n,n=o)),n!==o&&(r=Hr())!==o?(zn=t,t=n={type:"crossJoin",child2:r,cond:null}):(Un=t,t=o),Xn[u]={nextPos:Un,result:t},t)}function Fr(){var t,n,r,i,a=113*Un+47,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("natural"===e.substr(Un,7).toLowerCase()?(n=e.substr(Un,7),Un+=7):(n=o,0===Kn&&rr(Ce)),n!==o&&ur()!==o?("join"===e.substr(Un,4).toLowerCase()?(r=e.substr(Un,4),Un+=4):(r=o,0===Kn&&rr(je)),r!==o&&ur()!==o&&(i=Hr())!==o?(zn=t,t={type:"naturalJoin",child2:i,cond:null}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Wr(){var t,n,r,i,a,s,l,u,c,d,h,f,m,p,g,y=113*Un+48,b=Xn[y];if(b)return Un=b.nextPos,b.result;if(t=Un,ur()!==o)if(n=Un,r=Un,"inner"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Se)),i!==o&&(a=ur())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?("join"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(je)),i!==o?(zn=n,n=r="innerJoin"):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,r=Un,"left"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Oe)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="leftOuterJoin"),(n=r)===o&&(n=Un,r=Un,"right"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Te)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="rightOuterJoin"),(n=r)===o&&(n=Un,r=Un,"full"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Me)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="fullOuterJoin"),n=r))),n!==o)if((r=ur())!==o)if((i=Hr())!==o)if((a=ur())!==o){if(s=Un,"on"===e.substr(Un,2).toLowerCase()?(l=e.substr(Un,2),Un+=2):(l=o,0===Kn&&rr(xe)),l!==o&&ur()!==o&&(u=io())!==o?(zn=s,s=l=u):(Un=s,s=o),s===o){if(s=Un,"using"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(Re)),l!==o)if(cr()!==o)if(40===e.charCodeAt(Un)?(u="(",Un++):(u=o,0===Kn&&rr(Q)),u!==o)if(cr()!==o)if((c=br())!==o){for(d=[],h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);h!==o;)d.push(h),h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);d!==o&&(h=cr())!==o?(41===e.charCodeAt(Un)?(f=")",Un++):(f=o,0===Kn&&rr(ee)),f!==o?(zn=s,s=l=function(e,t,n,r){for(var o=[n],i=0;i"===e.substr(Un,2)?(n="<>",Un+=2):(n=o,0===Kn&&rr(Ve));n===o&&("!="===e.substr(Un,2)?(n="!=",Un+=2):(n=o,0===Kn&&rr(qe)));n!==o&&(zn=t,n="!=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+60,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,">="===e.substr(Un,2)?(n=">=",Un+=2):(n=o,0===Kn&&rr(Ge));n!==o&&(zn=t,n=">=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+62,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,"<="===e.substr(Un,2)?(n="<=",Un+=2):(n=o,0===Kn&&rr(Xe));n!==o&&(zn=t,n="<=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+61,r=Xn[n];if(r)return Un=r.nextPos,r.result;62===e.charCodeAt(Un)?(t=">",Un++):(t=o,0===Kn&&rr(Ke));return Xn[n]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+63,r=Xn[n];if(r)return Un=r.nextPos,r.result;60===e.charCodeAt(Un)?(t="<",Un++):(t=o,0===Kn&&rr($e));return Xn[n]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function qr(){var t,n,r,i,a=113*Un+69,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,(n=hr())!==o&&lr()!==o&&(r=hr())!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i===o&&(i=null),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o),t===o)if(t=Un,35===e.charCodeAt(Un)?(n="#",Un++):(n=o,0===Kn&&rr(at)),n!==o)if(hr()!==o){for(r=[],st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));i!==o;)r.push(i),st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));r!==o?(10===e.charCodeAt(Un)?(i="\n",Un++):(i=o,0===Kn&&rr(u)),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;return Xn[a]={nextPos:Un,result:t},t}function Gr(){var t,n,r,i,a=113*Un+70,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,96===e.charCodeAt(Un)?(n="`",Un++):(n=o,0===Kn&&rr(ut)),n!==o&&(r=yr())!==o?(96===e.charCodeAt(Un)?(i="`",Un++):(i=o,0===Kn&&rr(ut)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=yr())!==o&&(zn=t,n=n),t=n),Xn[a]={nextPos:Un,result:t},t)}function Kr(){var t,n,r,i,a,s,l,u,c=113*Un+71,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,"drop"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ct)),n!==o&&dr()!==o?("table"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(dt)),r!==o&&dr()!==o?(i=Un,"if"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ht)),a!==o&&(s=dr())!==o?("exists"===e.substr(Un,6).toLowerCase()?(l=e.substr(Un,6),Un+=6):(l=o,0===Kn&&rr(it)),l!==o&&(u=dr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o),i===o&&(i=null),i!==o&&(a=Gr())!==o&&(s=hr())!==o?(59===e.charCodeAt(Un)?(l=";",Un++):(l=o,0===Kn&&rr(se)),l!==o?(zn=t,t=n={type:"dropTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function Xr(){var t,n,r,i,a,s,l=113*Un+72,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,"lock"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ft)),n!==o)if(dr()!==o)if("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o)if(dr()!==o)if(Gr()!==o)if(dr()!==o){if(i=[],F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W)),a!==o)for(;a!==o;)i.push(a),F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W));else i=o;i!==o&&(a=hr())!==o?(59===e.charCodeAt(Un)?(s=";",Un++):(s=o,0===Kn&&rr(se)),s!==o?(zn=t,t=n={type:"lockTable"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;return Xn[l]={nextPos:Un,result:t},t}function $r(){var t,n,r,i,a=113*Un+73,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,"unlock"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(pt)),n!==o&&dr()!==o?("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o&&hr()!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i!==o?(zn=t,t=n={type:"unlockTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Jr(){var e,t,n,r,i,a=113*Un+74,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(e=Un,hr()!==o){if(t=[],n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o),n!==o)for(;n!==o;)t.push(n),n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o);else t=o;t!==o&&(n=hr())!==o?(zn=e,e=function(e){var t,n,r,o,i,a,s={},l={},u="";for(n=0;n!0===n.evaluate(e,t,r,o),this._checkSchema(e,t)}_getResult(e,t){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator)throw new Error("check not called");const n=new c.a;return n.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),n,this._isRightJoin,this._isAntiJoin,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),!0===t&&n.eliminateDuplicateRows(),this.setResultNumRows(n.getNumRows()),n}static createNullArray(e){return new Array(e).fill(null)}static getCheckedEvaluatorBooleanExpression(e,t,n,r){if(n.check(e,t),"boolean"!==n.getDataType())throw new m.a("db.messages.exec.error-condition-must-be-boolean",r);return function(e,t,r,o){return!0===n.evaluate(e,t,r,o)}}static getCheckedEvaluatorNaturalJoin(e,t,n,r){}static calcNestedLoopJoin(e,t,n,r,o,i,a,s,l){const u=t.getResult(e),c=n.getResult(e),d=u.getNumRows(),h=c.getNumRows(),f=u.getNumCols();c.getNumCols();if(!1===o){let t;null!==l&&(t=p.createNullArray(r.getSchema().getSize()-f));const n={};for(let o=0;o0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}getArgumentHtml(){return""}}class y extends u.c{constructor(e,t){super("π",e),this._checked=null,this._columns=t}getSchema(){if(null===this._columns)return this._child.getSchema();if(null===this._checked)throw new Error("check has not been called");return this._checked._projectedSchema}getResult(e){if(e=this._returnOrCreateSession(e),null===this._checked)throw new Error("check has not been called");const{_indices:t}=this._checked;if(null===this._columns)return this._child.getResult(e);const n=this._child.getResult(e),r=new c.a;r.setSchema(this.getSchema());const o=r.getNumCols(),i=n.getNumRows();let a,s,l,u;for(a=0;a-1&&o.removeColumn(n)}o.getSize()===n&&this.throwExecutionError(i18n.t("db.messages.exec.error-schema-a-not-part-of-schema-b",{schemaA:t,schemaB:e})),this._delegate=new d(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),new y(new d(new g(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),this._child2).setCodeInfoObject(this._codeInfo),this._child).setCodeInfoObject(this._codeInfo),o.getColumns()).setCodeInfoObject(this._codeInfo)),this._delegate.check()}}class v extends u.c{constructor(e,t,n){super("γ",e),this.checked=null,this.groupByCols=t,this.aggregateFunctions=n}getSchema(){if(null===this.checked)throw new Error("check not called");return this.checked.schema}check(){this._child.check();const e=this._child.getSchema(),t=new Array(this.groupByCols.length),n=Array(this.aggregateFunctions.length);for(let n=0;nl.a.printColumn(e.name,e.relAlias)),t=this.aggregateFunctions.map(e=>`${"COUNT_ALL"===e.aggFunction?"COUNT(*)":`${e.aggFunction}(${l.a.printColumn(e.col.name,e.col.relAlias)})`}→${e.name}`);return`${e.join(", ")}; ${t.join(", ")}`}getResult(e){if(e=this._returnOrCreateSession(e),null===this.checked)throw new Error("check not called");const t=this.getChild().getResult(e),n=new c.a;n.setSchema(this.checked.schema);let r,o=0;if(this.groupByCols.length>0){const e={};for(let n=0;nt?e:t};let s,l,u,d;for(let e=0;e0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator||null===this._rowCreatorMatched||null===this._rowCreatorNotMatched)throw new Error("check not called");const t=new c.a;return t.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!1,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!0,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}}class j extends p{constructor(e,t,n){super(e,t,"⨝",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class C extends p{constructor(e,t,n){super(e,t,"⟕",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class S extends p{constructor(e,t,n){super(e,t,"⟖",n,!0)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!1,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class O extends p{constructor(e,t,n){super(e,t,n?"⋉":"⋊",{type:"natural",restrictToColumns:null},!n)}_checkSchema(e,t){this._isRightJoin?(this._schema=t.copy(),this._rowCreatorMatched=function(e,t){return t}):(this._schema=e.copy(),this._rowCreatorMatched=function(e,t){return e}),this._rowCreatorNotMatched=null}getResult(e){return super._getResult(e,!0)}}class k extends u.c{constructor(e,t,n){if(super("τ",e),this._orderCols=t,this._orderAsc=n,this._orderAsc.length!==this._orderCols.length)throw new Error("order cols not correct");this._orderIndices=null}getSchema(){return this._child.getSchema()}getResult(e){if(e=this._returnOrCreateSession(e),null===this._orderIndices)throw new Error("check not called");const t=this.getChild().getResult(e).copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t.sort(this._orderIndices,this._orderAsc),t}check(){this._child.check();const e=this._child.getSchema();this._orderIndices=[];for(let t=0;t0){const n=[],r=e.groupBy||[];for(let e=0;e0)a=new v(a,r,n);else{const e=[];for(let t=0;t",[new f.c("number","rownum",[]),new f.c("number","constant",[o])]);if(-1===n)a=new R(r(t.child),i);else{const e=new f.c("boolean","<=",[new f.c("number","rownum",[]),new f.c("number","constant",[n+o])]);a=new R(r(t.child),new f.c("boolean","and",[i,e]))}break}default:throw new Error(`type ${e.type} not implemented`)}if(!a)throw new Error("should not happen");return!0===e.wrappedInParentheses&&a.setWrappedInParentheses(!0),n(a,e),a}function o(e,t,n){e.check();const r=new R(e,N(t));return r.setCodeInfoObject(n),r}function i(e){return"column"===e.type&&e.alias}return r(e.child)}function N(e){let t;if("null"===e.datatype&&"columnValue"===e.func)t=new f.b(e.args[0],e.args[1]);else switch(e.datatype){case"string":case"number":case"boolean":case"date":case"null":const n=[];for(let t=0;t{"relation"!==e.type||void 0!==t&&!1!==t.has(e.name)||n.push({name:e.name,line:e.codeInfo.location.start.line,column:e.codeInfo.location.start.column})}),n}function B(e,t){const n=Y.a.isMap(t)?t:Y.a().withMutations(e=>{for(const n of Object.keys(t))e.set(n,t[n])}).asImmutable();if(0===e.assignments.length)return;const r=new Map;Y.c().withMutations(t=>{for(let n=0;n{if(!0===i.get(e))return;if(!0===o.get(e))throw new Error(s.a("db.messages.translate.error-variable-cyclic-usage",{name:e}));o.set(e,!0);const t=r.get(e);if(void 0!==t){const{childRelations:e}=t;for(let t=0;t{if("relation"===e.type&&e.name===t.name){return Object.assign(Object.assign({},t.child),{metaData:Object.assign(Object.assign({},t.child.metaData),{fromVariable:t.name})})}return e});e=Object.assign(Object.assign({},e),{child:n})}r.set(e.name,e)}for(const[,t]of r)e.assignments[t.assignmentIndex].child=t.child;if(("relalgRoot"===e.type||"sqlRoot"===e.type)&&null!==e.child&&void 0!==e.child)for(const[t,n]of r)e.child=Object(F.b)(e.child,e=>"relation"===e.type&&e.name===t?Object.assign(Object.assign({},n.child),{metaData:Object.assign(Object.assign({},n.child.metaData),{fromVariable:t})}):e)}var U=n("./src/db/translate/textFromAst.ts");function z(e,t,n,r){if("none"===r)return{query:e,cursor:n};const o={math2plain:{pi:"pi",sigma:"sigma",rho:"rho",arrowLeft:"<-",arrowRight:"->",psi:"psi",tau:"tau",gamma:"gamma",unionOperator:"union",intersectOperator:"intersect",divisionOperator:"/",differenceOperator:"-",crossJoinOperator:"cross join",innerJoinOperator:"inner join",naturalJoinOperator:"natural join",leftSemiJoinOperator:"left semi join",rightSemiJoinOperator:"right semi join",antiJoinOperator:"anti join",leftOuterJoinOperator:"left outer join",rightOuterJoinOperator:"right outer join",fullOuterJoinOperator:"full outer join"},plain2math:{pi:"π",sigma:"σ",rho:"ρ",arrowLeft:"←",arrowRight:"→",psi:"ψ",tau:"τ",gamma:"γ",unionOperator:"∪",intersectOperator:"∩",divisionOperator:"÷",differenceOperator:"-",crossJoinOperator:"⨯",innerJoinOperator:"⨝",naturalJoinOperator:"⨝",leftSemiJoinOperator:"⋉",rightSemiJoinOperator:"⋊",antiJoinOperator:"▷",leftOuterJoinOperator:"⟕",rightOuterJoinOperator:"⟖",fullOuterJoinOperator:"⟗"}};for(let i=t.length-1;i>=0;i--){const a=t[i],s=a.location,l=e.substr(0,s.start.offset),u=e.substring(s.end.offset),c=o[r][a.name];if(e.substring(s.start.offset,s.end.offset)!==c){if(n)if(n.line>=s.start.line&&n.line<=s.end.line){if(n.column>s.start.column&&n.column=s.end.column){n.line-=s.end.line-s.start.line;const e=a.location.end.offset-a.location.start.offset,t=c.length;n.column-=e-t}}else n.lines.end.line&&(n.line-=s.end.line-s.start.line);e=l+c+u}}return{query:e,cursor:n}}const V=n("./src/db/parser/grammar_sql.pegjs");function q(e){return V.parse(e,{startRule:"start",tracer:void 0,i18n:r.c})}function G(e){return V.parse(e,{startRule:"dbDumpStart",tracer:void 0})}function K(e,t={}){t=t||{};const n=i(e,Object.keys(t));B(n,t);const r=I(n,t);return r.check(),r}},"./src/db/translate/textFromAst.ts":function(e,t,n){"use strict";(function(e){function r(e){if("groupRoot"!==e.type)throw new Error("wrong ast!?");let t="";function n(e){let t="";const{headers:n}=e;for(const e of n){const{name:n,lang:r,text:o}=e;t+=n,null!==r&&(t+="@"+r),t+=":",-1!==e.text.indexOf("\n")?t+=`[[${e.text}]]\n`:t+=e.text+"\n"}t+="\n";for(let n=0;n");if(null!==t&&i.addClass(t),null!==n&&i.append(n),null!==r){const t=e("");t.append(r),i.append(" ").append(t)}return null!==o&&i.append(" ( ").append(o).append(" ) "),i.text()}function r(t,n,r,o,i){const a=e("");if(null!==t&&a.addClass(t),a.append("( ").append(o).append(" ) "),a.append(n),null!==r){const t=e("");t.append(r),a.append(t)}return a.append(" ( ").append(i).append(" ) "),a.text()}function o(e,t){return"number"==typeof e&&(e=`[${e}]`),null===t?e:`${t}.${e}`}function i(e,t){if(null===e||"null"===t)return"null";if(e instanceof Date)return function(e){const t=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,n=e.getDate()<10?"0"+e.getDate():e.getDate();return`${e.getFullYear()}-${t}-${n}`}(e);if("string"==typeof e)return`'${e}'`;if("number"==typeof e)return e.toString();throw new Error("unknown type "+t)}return function e(t){switch(t.type){case"relation":return n(t.type,t.name,null,null);case"table":{const e=[];let n=[];for(let e=0;er[n])&&(r[n]=o)}let o="{\n";for(let i=0;i0){for(let e=0;e{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}else if("sqlRoot"===e.type){let n=!1;const o=e.assignments.map(e=>{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}return t(e)}function o(e,t,n=!0){if(t(e),"statement"===e.type?o(e.from,t,n):"relationFromSubstatement"===e.type&&o(e.statement,t,n),void 0!==e.child&&o(e.child,t,n),void 0!==e.child2&&o(e.child2,t,n),void 0!==e.assignments&&!0===n)for(const r of e.assignments)o(r,t,n)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},"./src/locales/de.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"Variablenname wurde mehrfach definiert: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"mehrfacher header {{name}}","db.messages.parser.error-group-unknown-header":"unbekannter header {{name}}","db.messages.parser.error-group-header-name-missing":"der Name des Datensatzes fehlt (group: ....)","db.messages.parser.error-group-header-name-empty":"der Name des Datensatzes ist leer","db.messages.parser.error-group-non-unique-attribute":"nicht eindeutiges Attribut {{name}} in Spalte {{index}}","db.messages.parser.error-group-non-unique-group-name":"Der Name der Gruppe {{name}} ist nicht eindeutig.","db.messages.parser.error-sql-string-use-single-quotes":"verwenden Sie einfache Anführungszeichen für Zeichenketten","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" darf nicht als name einer Relation verwendet werden","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" darf nicht als name einer Spalte verwendet werden","db.messages.parser.error-sql-group-by-missing":"group-by-Klausel fehlt","db.messages.parser.error-sql-having-without-group-by":"having-Klausel gefunden doch \\"group by\\" or Aggregation fehlt","db.messages.parser.error-sql-negative-limit":"das Limit muss größer oder gleich 0 sein","db.messages.parser.error-sqldump-invalid-column-number":"ungültige Spaltenanzahl in Zeile {{line}}","db.messages.parser.error-sqldump-invalid-type":"ungültiger Typ in Zeile {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"Anzahl der Werte != Anzahl der Spalten","db.messages.parser.error-valueexpr-like-operand-no-string":"der rechte Operand von LIKE muss ein Zeichenkettenliteral sein","db.messages.exec.error-column-not-unique":"Spalte \\"{{column}}\\" kann wegen mehrdeutigkeit nicht hinzugefügt werden","db.messages.exec.error-column-not-found-name":"Spalte \\"{{column}} wurde im Schema {{schema}} nicht gefunden","db.messages.exec.error-column-not-found-index":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-column-ambiguous":"Spalte \\"{{column}}\\" ist mehrdeutig im Schema {{schema}}","db.messages.exec.error-column-index-out-of-range":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"Relations alias \\"{{alias}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden","db.messages.exec.error-could-not-rename-ambiguity":"neuer Name \\"{{newName}}\\" für \\"{{oldName}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden im Schema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"Schema {{schemaA}} ist nicht Teil von {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"Schemas sind nicht unifiable: Typen oder Anzahl der Attribute ist unterschiedlich: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"Spalte \\"{{column}}\\" kann nicht in beiden Schemas des Joins gefunden werden","db.messages.exec.error-condition-must-be-boolean":"Bedingung muss ein boolscher Ausdruck sein","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} ist nicht für Datentyp {{colType}} definiert","db.messages.exec.error-join-would-produce-non-unique-columns":" the following columns appear in both relations: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"Keine Spalten gefunden für \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"Datentype für Spalte {{index}} (\\"{{column}}\\") wurde nicht spezifiziert","db.messages.exec.error-invalid-projection-error":"ungültige Projektion \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"Funktion \\"{{func}}\\" erwartet Argumente vom Typ \\"{{expected}}\\" aber \\"{{given}}\\" gefunden","db.messages.exec.error-could-not-compare-different-types":"Werte mit unterschiedlichen Datentypen können nicht verglichen werden: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"Funktion {{func}} erwartet, dass alle Argumente den selben Datentyp haben.","db.messages.exec.error-case-when-condition-must-be-boolean":"Die Bedingung für ein CASE WHEN muss ein boolscher Ausdruck sein","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END erwartet dass alle results vom selben Typ sind","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"Relation \\"{{name}}\\" nicht gefunden","db.messages.translate.warning-distinct-missing":" relational algebra uses implicit duplicate elimination","db.messages.translate.warning-ignored-all-on-set-operators":" relational algebra uses implicit duplicate elimination","db.messages.translate.error-variable-name-conflict":"Namenskonflikt: eine Relation mit Namen \\"{{name}}\\" existiert bereits","db.messages.translate.error-variable-cyclic-usage":"Zyklische Verwendung von Variable \\"{{name}}\\" erkannt","editor.codemirror-placeholder":"Abfrage ...\\nTastatürkürzel\\n\\tAbfrage ausführen: [CTRL]+[RETURN]\\n\\tMarkierten teil der Abfrage ausführen: [CTRL]+[SHIFT]+[RETURN]\\tAutovervollständigung: [CTRL]+[SPACE]","editor.alert-message-headers.success":"Erfolg","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warnung","editor.alert-message-headers.error":"Fehler","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"abbrechen","editor.inline-relation-editor.placeholder-column-name-and-types":"spaltenName:datenTyp","editor.inline-relation-editor.enter-your-data":"bitte Daten eingeben","editor.inline-relation-editor.error-column-name-missing":"Spaltenname fehlt in Spalte {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"Zeichenketten dürfen keine doppelten oder einfache Anführungszeichen enthalten","editor.error-no-query-found":"keine Abfrage gefunden","editor.pegjs-error.or":"oder","editor.pegjs-error.no-input-found":"keine Eingabe gefunden","editor.pegjs-error.end-of-input":"Ende der Eingabe","editor.pegjs-error.expected-found":"Erwarte {{expected}} aber {{found}} gefunden.","editor.error-at-line-x":"in Zeile {{line}}","calc.messages.error-query-missing":"keine Abfrage gefunden","calc.messages.error-query-missing-assignments-found":"nur Zuweisungen gefunden; die eigentliche Abfrage fehlt Help - Assignments (en)","calc.messages.gist-load-success":"gist erfolgreich geladen","calc.menu.headline":"Datensätze","calc.menu.datasets":"Datensätze","calc.menu.load-gist-headline":"Datensatz aus gist laden","calc.menu.load-gist-button":"laden","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Eigenen Datensatz erstellen","calc.menu.create-own-dataset-text":"Sie können Ihren eigenen Datensatz erstellen und ihn mit anderen teilen. Lernen Sie mehr darüber im Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial (en)","calc.menu.create-own-dataset-button-new":"neuen Datensatz erstellen","calc.menu.create-own-dataset-button-modify":"aktuellen Datensatz abändern","calc.navigation.take-a-tour":"Tour starten","calc.navigation.feedback":"Feedback","calc.navigation.help":"Hilfe (en)","calc.navigation.calc":"Rechner","calc.navigation.language":"Sprache","calc.maintainer-groups.misc":"Diverse","calc.maintainer-groups.temp":"Ungespeichert","calc.maintainer-groups.uibk":"Universität Innsbruck","calc.maintainer-groups.saarland":"Universität Saarland","calc.editors.button-history":"Verlauf","calc.editors.insert-relation-title":"Einfügen","calc.editors.insert-relation-tooltip":"Beziehungs- oder Spaltennamen einfügen","calc.editors.group.tab-name":"Datensatz Editor","calc.editors.group.tab-name-short":"DS","calc.editors.group.toolbar.import-sql":"SQL-dump importieren","calc.editors.group.toolbar.import-sql-content":"SQL-dump importieren","calc.editors.group.toolbar.add-new-relation":"neue Relation hinzufügen","calc.editors.group.toolbar.add-new-relation-content":"Relationseditor öffnen","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"Vorschau","calc.editors.group.button-use":"Datensatz im Editor verwenden","calc.editors.group.button-use_plural":"Datensatz im Editor verwenden","calc.editors.group.sql-import-group-name-placeholder":"Name des Datensatzes (importiert)","calc.editors.group.new-group-example-group":"-- dies ist ein Beispiel\\n\\ngroup: nameDesDatensatzes \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tbeispiel, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump importieren","calc.editors.group.modal-sqldump.button-close":"schließen","calc.editors.group.modal-sqldump.button-cancel":"abbrechen","calc.editors.group.modal-sqldump.button-import-sql":"importieren","calc.editors.group.modal-sqldump.description":"Kopieren Sie den SQL-Dump hier her um einen Datensatz daraus zu erstellen.","calc.editors.ra.tab-name":"Relationale Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"Query ausführen","calc.editors.ra.button-execute-selection":"Markierung ausführen","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"Projektion","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"Selektion","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"Umbenennen (Relationen/Spalten)","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.right-arrow":"Pfeil nach Rechts","calc.editors.ra.toolbar.rename-columns-operator":"Umbenennung von Spalten","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"Sortieren","calc.editors.ra.toolbar.orderBy-content":"","calc.editors.ra.toolbar.groupBy":"Gruppieren","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"Und","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"Xor","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"Oder","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"Verneinung","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )","calc.editors.ra.toolbar.equals":"Gleich","calc.editors.ra.toolbar.equals-content":" a = b ( A )","calc.editors.ra.toolbar.not-equals":"Ungleich","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )","calc.editors.ra.toolbar.greater-or-equals":"Größer-Gleich","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )","calc.editors.ra.toolbar.lesser-or-equals":"Kleiner-Gleich","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )","calc.editors.ra.toolbar.intersect":"Schnittmenge","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"Vereinigung","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"Division (Relationen)","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"Mengendifferenz","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\n ( B )
        ","calc.editors.ra.toolbar.cross-join":"cross join (Kreuzprodukt)","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"Zuweisung","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"Kommentar einzeilig","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"Kommentar mehrzeilig","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-Relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"inline-Relation (Editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"eine neue inline-Relation mit dem Editor erstellen","calc.editors.ra.toolbar.insert-date":"Datum einfügen","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"Operatoren ersetzen","calc.editors.ra.toolbar.autoreplace-operators.header":"Operatoren automatisch ersetzen","calc.editors.ra.toolbar.autoreplace-operators.none":"keine Ersetzung","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Query ausführen","calc.editors.sql.button-execute-selection":"Markierung ausführen","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select-Klausel","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"from-Klausel","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"where-Klausel","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group-b-Klausel","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"having-Klausel","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"order-by-Klausel","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"limit-Klausel","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"Datum einfügen","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Ergebnis","calc.result.modal.close":"Schließen","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"CSV downloaden","calc.editors.ra.inline-editor.button-upload-csv":"CSV uploaden","calc.editors.ra.inline-editor.button-cancel":"Abbrechen","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Typ","calc.editors.ra.inline-editor.input-relation-name":"Relations Name","calc.navigation.imprint":"Impressum"}')},"./src/locales/en.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"duplicate variable name: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"duplicate header {{name}}","db.messages.parser.error-group-unknown-header":"unknown header {{name}}","db.messages.parser.error-group-header-name-missing":"the name of the group is missing (group: ....)","db.messages.parser.error-group-header-name-empty":"the name of the group must not be empty","db.messages.parser.error-group-non-unique-attribute":"non unique attribute {{name{{ in column }}index}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use single quotes for strings","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" must not be used as a relation-name","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" must not be used as a column-name","db.messages.parser.error-sql-group-by-missing":"group by is missing","db.messages.parser.error-sql-having-without-group-by":"having found but missing \\"group by\\" or aggregation","db.messages.parser.error-sql-negative-limit":"the limit given must be >= 0","db.messages.parser.error-sqldump-invalid-column-number":"invalid number of columns in line {{line}}","db.messages.parser.error-sqldump-invalid-type":"invalid type in line {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"number of values != number of columns","db.messages.parser.error-valueexpr-like-operand-no-string":"right operand of LIKE must be a string literal","db.messages.exec.error-column-not-unique":"could not add column \\"{{column}}\\" because of ambiguity","db.messages.exec.error-column-not-found-name":"could not find column \\"{{column}}\\" in schema {{schema}}","db.messages.exec.error-column-not-found-index":"column index \\"{{column}}\\" is out of range in schema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"column \\"{{column}}\\" is ambiguous in {{schema}}","db.messages.exec.error-column-index-out-of-range":"column index \\"{{column}}\\" is out of range in {{schema}}; index starts at 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"could not set relation alias \\"{{alias}}\\" because of ambiguity","db.messages.exec.error-could-not-rename-ambiguity":"could not set new name \\"{{newName}}\\" for \\"{{oldName}}\\" because of ambiguity in {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"schema {{schemaA}} is not part of {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"schemas are not unifiable: types are different or size is different: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"column \\"{{column}}\\" can not be found in both schemas of join","db.messages.exec.error-condition-must-be-boolean":"condition must be a boolean expression","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} not defined for type {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"join would result in non unique column names","db.messages.exec.error-no-columns-match-alias-star":"no columns match \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"datatype for column {{index}} (\\"{{column}}\\") is not specified","db.messages.exec.error-invalid-projection-error":"invalid projection \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"function \\"{{func}}\\" expects arguments of type \\"{{expected}}\\" but \\"{{given}}\\" given","db.messages.exec.error-could-not-compare-different-types":"could not compare value if types are different: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} expects all arguments to be of the same type","db.messages.exec.error-case-when-condition-must-be-boolean":"the condition of a CASE WHEN must be of type boolean","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END expects all results to be of the same type","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"could not find relation \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT is missing","db.messages.translate.warning-ignored-all-on-set-operators":"ignored ALL on set operation","db.messages.translate.error-variable-name-conflict":"name conflict: relation name \\"{{name}}\\" already exists","db.messages.translate.error-variable-cyclic-usage":"cyclic usage of variable \\"{{name}}\\" detected","editor.codemirror-placeholder":"your query goes here ...\\n\\nkeyboard shortcuts:\\n\\texecute statement: [CTRL]+[RETURN]\\n\\texecute selection: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocomplete: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Success","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warning","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancel","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"please enter your data","editor.inline-relation-editor.error-column-name-missing":"column name missing in column {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string must not contain single and double quotes","editor.error-no-query-found":"no query found","editor.pegjs-error.or":"or","editor.pegjs-error.no-input-found":"no input found","editor.pegjs-error.end-of-input":"end of input","editor.pegjs-error.expected-found":"Expected {{expected}} but {{found}} found.","editor.error-at-line-x":"at line {{line}}","calc.messages.error-query-missing":"no query found","calc.messages.error-query-missing-assignments-found":"only assignments found; query is missing Help - Assignments","calc.messages.gist-load-success":"gist loaded successfully","calc.menu.headline":"load a Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Load dataset stored in a gist","calc.menu.load-gist-button":"load","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Create your own Dataset","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"create new Dataset","calc.menu.create-own-dataset-button-modify":"modify current Dataset","calc.navigation.take-a-tour":"Take a Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Help","calc.navigation.calc":"Calculate","calc.navigation.language":"Language","calc.maintainer-groups.misc":"Miscellaneous","calc.maintainer-groups.temp":"Temporary","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"history","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"Group Editor","calc.editors.group.tab-name-short":"GE","calc.editors.group.toolbar.import-sql":"import SQL-dump","calc.editors.group.toolbar.import-sql-content":"import SQL-dump","calc.editors.group.toolbar.add-new-relation":"add new relation","calc.editors.group.toolbar.add-new-relation-content":"open relation editor","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"use Group in editor","calc.editors.group.button-use_plural":"use first Group in editor","calc.editors.group.sql-import-group-name-placeholder":"Name of the group (imported from SQL)","calc.editors.group.new-group-example-group":"-- this is an example\\n\\ngroup: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Import SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Close","calc.editors.group.modal-sqldump.button-cancel":"cancel","calc.editors.group.modal-sqldump.button-import-sql":"import SQL","calc.editors.group.modal-sqldump.description":"Put your SQL-Dump here to create a group.","calc.editors.ra.tab-name":"Relational Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"execute query","calc.editors.ra.button-execute-selection":"execute selection","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"projection","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"selection","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"rename relation / rename columns","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.right-arrow":"Right arrow","calc.editors.ra.toolbar.rename-columns-operator":"rename columns operator","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"order by","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"group by","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"and","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"or","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"not","calc.editors.ra.toolbar.not-content":"
        &sigma","calc.editors.ra.toolbar.equals":"equals","calc.editors.ra.toolbar.equals-content":"
        &sigma","calc.editors.ra.toolbar.not-equals":"not equals","calc.editors.ra.toolbar.not-equals-content":"
        &sigma","calc.editors.ra.toolbar.greater-or-equals":"greater or equals","calc.editors.ra.toolbar.greater-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.lesser-or-equals":"lesser or equals","calc.editors.ra.toolbar.lesser-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.intersect":"intersect","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"union","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"division","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"subtraction","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\n ( B )
        ","calc.editors.ra.toolbar.cross-join":"cross join","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"assignment","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"single-line comment","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"multi-line comment","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"insert date","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"execute query","calc.editors.sql.button-execute-selection":"execute selection","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select clause","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"from clause","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"where clause","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by clause","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"order by clause","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"limit clause","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/es.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nombre de variable duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"header duplicado {{name}}","db.messages.parser.error-group-unknown-header":"header desconocido {{name}}","db.messages.parser.error-group-header-name-missing":"el nombre del grupo no se ha encontrado (group: ....)","db.messages.parser.error-group-header-name-empty":"el nombre del grupo debe ser rellenado","db.messages.parser.error-group-non-unique-attribute":"atributo no único {{name}} en columna {{index}}","db.messages.parser.error-group-non-unique-group-name":"El nombre del grupo no es único.","db.messages.parser.error-sql-string-use-single-quotes":"utiliza comillas simples para cadenas de caracteres","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" no debe ser utilizado como nombre de relacion","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" no debe ser utilizado como nombre de columna","db.messages.parser.error-sql-group-by-missing":"group by no se encuentra","db.messages.parser.error-sql-having-without-group-by":"se ha encontrado pero no se encuentra \\"group by\\" ó agregación","db.messages.parser.error-sql-negative-limit":"el límite dado debe ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de columnas en línea {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido en línea {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de columnas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando derecho de LIKE debe ser una cadena literal","db.messages.exec.error-column-not-unique":"no se pude agregar columna \\"{{column}}\\" por ambiguedad","db.messages.exec.error-column-not-found-name":"no se pude encontrar columna \\"{{column}}\\" en esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"columna \\"{{column}}\\" es ambigua en esquema {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; índice comienza en 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"no se pudo establecer relación alias \\"{{alias}}\\" por ambiguedad","db.messages.exec.error-could-not-rename-ambiguity":"no se pudo establecer nuevo nombre \\"{{newName}}\\" para \\"{{oldName}}\\" por ambiguedad en el equema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} no es parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"esquemas no son unificables: los tipos son diferentes ó los tamaño son diferentes: {{schemaA}} y {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"columna \\"{{column}}\\" no se puede encontrar en ambos esquemas del join","db.messages.exec.error-condition-must-be-boolean":"condición debe ser una expresión booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} no está definido para {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"Join würde nicht eindeutige Spaltennamen erzeugen","db.messages.exec.error-no-columns-match-alias-star":"las columnas no coinciden \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dato para columna {{index}} (\\"{{column}}\\") no está especificado","db.messages.exec.error-invalid-projection-error":"proyección inválida \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"función \\"{{func}}\\" espera argumentos de tipo \\"{{expected}}\\" pero \\"{{given}}\\" fue dado","db.messages.exec.error-could-not-compare-different-types":"no se pudo comparar valor si tipos son diferentes: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos los argumentos sean del mismo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"la condición de un CASE WHEN debe ser de tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END espera todos results ser del mismo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válido; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"no se pudo encontrar relación \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT fehlt","db.messages.translate.warning-ignored-all-on-set-operators":"ALL bei Mengenoperatoren wurde ignoriert","db.messages.translate.error-variable-name-conflict":"conflicto de nombre: nombre de relación \\"{{name}}\\" ya existe","db.messages.translate.error-variable-cyclic-usage":"uso de variable cíclico \\"{{name}}\\" detectado","editor.codemirror-placeholder":"tu consulta va aquí ...\\n\\natajos de teclado:\\n\\tejecutar declaración: [CTRL]+[RETURN]\\n\\ttejecutar selección: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Éxito","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Advertencia","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"nombreColumna:tipo","editor.inline-relation-editor.enter-your-data":"por favor ingrese los datos","editor.inline-relation-editor.error-column-name-missing":"nombre de columna ausente en columna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"cadena de caracteres no debe contener comillas simples y dobles","editor.error-no-query-found":"no se encontró la consulta","editor.pegjs-error.or":"ó","editor.pegjs-error.no-input-found":"no se encontró la entrada","editor.pegjs-error.end-of-input":"fin de entrada","editor.pegjs-error.expected-found":"Se esperaba {{expected}} pero se encontró {{found}} .","editor.error-at-line-x":"en la línea {{line}}","calc.messages.error-query-missing":"no se encontró la consulta","calc.messages.error-query-missing-assignments-found":"solo se encontraron asignaciones; a la consulta le falta Help - Assignments","calc.messages.gist-load-success":"gist fue cargado con éxito","calc.menu.headline":"cargar un Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"cargar dataset guardado en un gist","calc.menu.load-gist-button":"cargar","calc.menu.load-gist-insert-placeholder":"ID de gist","calc.menu.create-own-dataset-headline":"Crear tu propio Dataset","calc.menu.create-own-dataset-text":"Puedes crear tu propio dataset y compartirlo con otras personas. \\nAprende más acerca de ésto en Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Tutorial de mantenimiento (en)","calc.menu.create-own-dataset-button-new":"crear nuevo Dataset","calc.menu.create-own-dataset-button-modify":"modificar Dataset actual","calc.navigation.take-a-tour":"Haz un recorrido","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ayuda (en)","calc.navigation.calc":"Calculadora","calc.navigation.language":"Lenguaje","calc.maintainer-groups.misc":"Misceláneo","calc.maintainer-groups.temp":"Temporal","calc.maintainer-groups.uibk":"Universidad de Innsbruck","calc.maintainer-groups.saarland":"Universidad de Saarland","calc.editors.button-history":"historia","calc.editors.insert-relation-title":"Insertar","calc.editors.insert-relation-tooltip":"Insertar nombres de relaciones o columnas","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"agregar nueva relación","calc.editors.group.toolbar.add-new-relation-content":"abrir editor de relaciones","calc.editors.group.button-download":"descargar","calc.editors.group.button-exec":"vista previa","calc.editors.group.button-use":"utilizar Grupo en editor","calc.editors.group.button-use_plural":"utilizar Grupos en editor","calc.editors.group.sql-import-group-name-placeholder":"Nombre del grupo (importado de SQL)","calc.editors.group.new-group-example-group":"-- éste es un ejemplo\\n\\ngroup: nombreDeNuevoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tejemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Cerrar","calc.editors.group.modal-sqldump.button-cancel":"cancelar","calc.editors.group.modal-sqldump.button-import-sql":"importar SQL","calc.editors.group.modal-sqldump.description":"Ponga su SQL-Dump aquí para crear un grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"ÁlgRel","calc.editors.ra.button-execute-query":"executar consulta","calc.editors.ra.button-execute-selection":"executar selección","calc.editors.ra.button-download":"descargar","calc.editors.ra.toolbar.projection":"proyección","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"selección","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renombrar relación / renombrar columnas","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.right-arrow":"flecha derecha","calc.editors.ra.toolbar.rename-columns-operator":"renombrar operador de columnas","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"ordenar por","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"agrupar por","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"y","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"ó","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"no","calc.editors.ra.toolbar.not-content":"
        &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
        &sigma","calc.editors.ra.toolbar.not-equals":"no es igual","calc.editors.ra.toolbar.not-equals-content":"
        &sigma","calc.editors.ra.toolbar.greater-or-equals":"mayor ó igual","calc.editors.ra.toolbar.greater-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ó igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.intersect":"intersecta","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"unión","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"división","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"resta","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\\\ ( B )
        \\n","calc.editors.ra.toolbar.cross-join":"cross join (cruzado)","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"asignación","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"comentario de una línea","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"comentario de múltiples líneas","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"crear nuevo inline-relation utilizando editor incorporado","calc.editors.ra.toolbar.insert-date":"insertar fecha","calc.editors.ra.toolbar.insert-date-content":"","calc.editors.ra.toolbar.autoreplace-operators.title":"","calc.editors.ra.toolbar.autoreplace-operators.header":"","calc.editors.ra.toolbar.autoreplace-operators.none":"","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"ejecutar consulta","calc.editors.sql.button-execute-selection":"ejecutar selección","calc.editors.sql.button-download":"descargar","calc.editors.sql.toolbar.select":"seleccionar cláusula","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"cláusula from (desde)","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"cláusula where (donde)","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula agrupar por","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"teniendo cláusula","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula ordenar por","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"cláusula límite","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insertar fecha","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Cerrar","calc.editors.ra.inline-editor.title":"Editor de relaciones","calc.editors.ra.inline-editor.button-download-csv":"Descargar CSV","calc.editors.ra.inline-editor.button-upload-csv":"Subir CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nombre","calc.editors.ra.inline-editor.row-type":"Escriba","calc.editors.ra.inline-editor.input-relation-name":"Nombre de la relación","calc.navigation.imprint":"Imprimir"}')},"./src/locales/kr.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"변수 이름 중복: {{name}}","db.messages.parser.error-invalid-date-format":"\\"__str__\\" 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":" 헤더 중복: {{name}}","db.messages.parser.error-group-unknown-header":"알 수 없는 헤더: {{name}}","db.messages.parser.error-group-header-name-missing":"그룹 이름이 없음(group: ....)","db.messages.parser.error-group-header-name-empty":"그룹 이름은 비어있으면 안됨","db.messages.parser.error-group-non-unique-attribute":"__index__ 열에서 고유하지 않은 속성 {{name}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"문자열에 작은 따음표 사용","db.messages.parser.error-sql-invalid-relation-name":"\\"__str__\\"은 관계 이름으로 사용 할 수 없음","db.messages.parser.error-sql-invalid-column-name":"\\"__str__\\"은 열 이름으로 사용할 수 없음","db.messages.parser.error-sql-group-by-missing":"group by 없음","db.messages.parser.error-sql-having-without-group-by":"\\"group by\\" 또는 집계 없음","db.messages.parser.error-sql-negative-limit":"0 이상이어야 함","db.messages.parser.error-sqldump-invalid-column-number":"__line__ 에서 유효하지 않은 열","db.messages.parser.error-sqldump-invalid-type":"__line__ 에서 유효하지 않은 타입","db.messages.parser.error-sqldump-insert-wrong-number-columns":"값의 숫자 != 열의 숫자","db.messages.parser.error-valueexpr-like-operand-no-string":"LIKE의 오른쪽 피연산자는 문자열 리터럴이어야 함","db.messages.exec.error-column-not-unique":"모호성 때문에 열 \\"__column__\\" 을 추가할 수 없음","db.messages.exec.error-column-not-found-name":"스키마 __schema__ 에서 열 \\"__column__\\" 을 찾을 수 없음","db.messages.exec.error-column-not-found-index":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-column-ambiguous":"열 \\"__column__\\" 는 스키마 __schema__ 에서 모호함","db.messages.exec.error-column-index-out-of-range":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"모호성 때문에 릴레이션 가명 \\"__alias__\\"을 사용할 수 없음 ","db.messages.exec.error-could-not-rename-ambiguity":"스키마 __schema__ 에서의 모호성 때문에 \\"__oldName__\\"을 위한 새로운 이름 \\"__newName__\\" 을 설정 할 수 없음","db.messages.exec.error-schema-a-not-part-of-schema-b":"스키마 __schemaA__ 는 __schemaB__ 의 부분이 아님","db.messages.exec.error-schemas-not-unifiable":"스키마들은 통합될 수 없음: 타입들은 다르거나 사이즈들이 다르다: __schemaA__ 와 __schemaB__","db.messages.exec.error-column-not-in-both-schemas":"열 \\"__column__\\"은 두 스키마의 조인에서 찾을 수 없음","db.messages.exec.error-condition-must-be-boolean":"조건은 불린 대수여야만 함","db.messages.exec.error-func-not-defined-for-column-type":"__func_ _은 타입 __colType__ 을 위해 정의될 수 없음","db.messages.exec.error-join-would-produce-non-unique-columns":" Die folgenden Spalten sind teil beider Relationen: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"\\"__alias__.*\\"와 일치하는 열이 없음","db.messages.exec.error-datatype-not-specified-for-col":"열 __index__의 데이터 타입 (\\"__column__\\")이 구체화되지 않음","db.messages.exec.error-invalid-projection-error":"유효하지 않은 프로젝션 \\"__argument__\\": __error__","db.messages.exec.error-function-expects-type":"함수 \\"__func__\\"는 인자 타입 \\"__expected__\\" 으로 기대하지만 \\"__given__\\" 이 주어짐","db.messages.exec.error-could-not-compare-different-types":"타입이 다르면 비교할 수 없음: __typeA__ != __typeB__","db.messages.exec.error-function-expects-arguments-of-same-type":"__func__ 는 모든 인자가 같은 타입으로 기대함","db.messages.exec.error-case-when-condition-must-be-boolean":"CASE WHEN 조건은 불린 타입이어야 함","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END는 모든 결과가 같은 타입으로 기대함","db.messages.exec.error-invalid-date-format":"\\"__str__\\" 는 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"릴레이션 \\"{{name}}\\"을 찾을 수 없음","db.messages.translate.warning-distinct-missing":" Duplikate werden in relationaler Algebra automatisch entfernt","db.messages.translate.warning-ignored-all-on-set-operators":" Duplikate werden in relationaler Algebra automatisch entfernt","db.messages.translate.error-variable-name-conflict":"이름 충돌: 릴레이션 이름 \\"{{name}}\\" 은 이미 존재함","db.messages.translate.error-variable-cyclic-usage":"변수 \\"{{name}}\\"의 순환 사용이 감지됨","editor.codemirror-placeholder":"쿼리는 이곳에 표시된다 ...\\n\\n키보드 단축키:\\n\\tstatement 실행: [CTRL]+[RETURN]\\n\\tselection 실행: [CTRL]+[SHIFT]+[RETURN]\\n\\t자동 완성: [CTRL]+[SPACE]","editor.alert-message-headers.success":"성공","editor.alert-message-headers.info":"정보","editor.alert-message-headers.warning":"경고","editor.alert-message-headers.error":" 에러 ","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"취소","editor.inline-relation-editor.placeholder-column-name-and-types":"열 이름:타입","editor.inline-relation-editor.enter-your-data":"데이터를 입력하라","editor.inline-relation-editor.error-column-name-missing":"열 이름이 열 __index__에 없다","editor.inline-relation-editor.error-wrong-quoted-string":"문자열은 작은따음표와 큰따음표를 포함할 수 없다.","editor.error-no-query-found":"쿼리를 찾을 수 없다","editor.pegjs-error.or":"또는","editor.pegjs-error.no-input-found":"입력을 찾을 수 없음","editor.pegjs-error.end-of-input":"입력의 끝","editor.pegjs-error.expected-found":"예상 된 __expected__이지만 __found__이 발견됨.","editor.error-at-line-x":"__line__ 줄에서","calc.messages.error-query-missing":"쿼리를 찾을 수 없음","calc.messages.error-query-missing-assignments-found":"쿼리를 찾을 수 없음 Help - Assignments","calc.messages.gist-load-success":"gist 불러오기 완료","calc.menu.headline":"데이터셋 불러오기","calc.menu.datasets":"데이터셋 불러오기","calc.menu.load-gist-headline":"gist에 저장된 데이터셋 불러오기","calc.menu.load-gist-button":"불러오기","calc.menu.load-gist-insert-placeholder":"gist 아이디","calc.menu.create-own-dataset-headline":"데이터셋 생성하기","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"새로운 데이터셋 생성","calc.menu.create-own-dataset-button-modify":"현재 데이터셋 수정","calc.navigation.take-a-tour":"둘러보기","calc.navigation.feedback":"피드백","calc.navigation.help":"도움말","calc.navigation.calc":"Calculate","calc.navigation.language":"언어","calc.maintainer-groups.misc":"다른 종류","calc.maintainer-groups.temp":"임시","calc.maintainer-groups.uibk":"Innsbruck 대학교","calc.maintainer-groups.saarland":"Saarland 대학교","calc.editors.button-history":"기록","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"그룹 에디터","calc.editors.group.tab-name-short":"그룹 에디터","calc.editors.group.toolbar.import-sql":"SQL-덤프 가져오기","calc.editors.group.toolbar.import-sql-content":"SQL-컨텐트 가져오기","calc.editors.group.toolbar.add-new-relation":"새로운 릴레이션 추가","calc.editors.group.toolbar.add-new-relation-content":"릴레이션 에디터 열기","calc.editors.group.button-download":"다운로드","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"에디터에서 그룹 사용하기","calc.editors.group.button-use_plural":"에디터에서 여러 그룹 사용하기","calc.editors.group.sql-import-group-name-placeholder":"그룹 이름(SQL로부터 불러옴)","calc.editors.group.new-group-example-group":"-- 예시입니다\\n\\n그룹: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump 가져오기","calc.editors.group.modal-sqldump.button-close":"닫기","calc.editors.group.modal-sqldump.button-cancel":"취소","calc.editors.group.modal-sqldump.button-import-sql":"SQL 가져오기","calc.editors.group.modal-sqldump.description":"그룹을 생성하려면 SQL-Dump 이곳에 가져와라","calc.editors.ra.tab-name":"관계 대수","calc.editors.ra.tab-name-short":"관계 대수","calc.editors.ra.button-execute-query":"쿼리 실행","calc.editors.ra.button-execute-selection":"셀렉션 실행","calc.editors.ra.button-download":"다운로드","calc.editors.ra.toolbar.projection":"프로젝션","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"셀렉션","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"릴레이션 이름 변경 / 열 이름 변경","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.right-arrow":"오른쪽 화살표","calc.editors.ra.toolbar.rename-columns-operator":"열 연산자 변경","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"정렬","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"그룹화","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"논리곱","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"배타적 논리","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"논리합","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"논리적 부정","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )
        ","calc.editors.ra.toolbar.equals":"등호","calc.editors.ra.toolbar.equals-content":" a = b ( A )
        ","calc.editors.ra.toolbar.not-equals":"부등호","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )
        ","calc.editors.ra.toolbar.greater-or-equals":"크거나 같다","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )
        ","calc.editors.ra.toolbar.lesser-or-equals":"작거나 같다","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )
        ","calc.editors.ra.toolbar.intersect":"교집합","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"합집합","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"디비전","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"차집합","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\\\ ( B )
        \\n","calc.editors.ra.toolbar.cross-join":"카디션 프로덕트","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"자연 조인 / θ-조인","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"왼쪽 외부 조인","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.right-outer-join":"오른쪽 외부 조인","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        ","calc.editors.ra.toolbar.full-outer-join":"완전 외부 조인","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"왼쪽 세미 조인","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"오른쪽 세미 조인","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"안티 조인","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"할당","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"한 줄 주석","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"여러 줄 주석","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
        very long comment */

        π a, b A","calc.editors.ra.toolbar.inline-relation":"인라인-릴레이션","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"인라인-릴레이션 (에디터)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"날짜 삽입","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"쿼리 실행","calc.editors.sql.button-execute-selection":"셀렉션 실행","calc.editors.sql.button-download":"다운로드","calc.editors.sql.toolbar.select":"select 문","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"from 문","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"where 문","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by 문","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"having 문","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"order by 문","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"limit 문","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/pt.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nome de variável duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"cabeçalho duplicado {{name}}","db.messages.parser.error-group-unknown-header":"cabeçalho desconhecido {{name}}","db.messages.parser.error-group-header-name-missing":"o nome do grupo está faltando (group: ....)","db.messages.parser.error-group-header-name-empty":"o nome do grupo não pode ser vazio","db.messages.parser.error-group-non-unique-attribute":"atributo não único {{name}} na coluna {{index}}","db.messages.parser.error-group-non-unique-group-name":"nome de grupo duplicado: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use aspas simples para strings (caracteres/texto)","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" não pode ser usado como nome de relação","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" não pode ser usado como nome de coluna","db.messages.parser.error-sql-group-by-missing":"group by está faltando","db.messages.parser.error-sql-having-without-group-by":"“having” encontrado, mas sem \\"group by\\" ou agregação","db.messages.parser.error-sql-negative-limit":"o limite dado precisa ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de colunas na linha {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido na linha {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de colunas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando direito de LIKE deve ser uma string literal","db.messages.exec.error-column-not-unique":"não foi possível adicionar a coluna \\"{{column}}\\" devido a ambiguidade","db.messages.exec.error-column-not-found-name":"não foi possível encontrar a coluna \\"{{column}}\\" no esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-column-ambiguous":"coluna\\"{{column}}\\" é ambígua em {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"não foi possível definir o ”alias” da relação “{{alias}}” por causa da ambiguidade","db.messages.exec.error-could-not-rename-ambiguity":"não foi possível definir o novo nome \\"{{newName}}\\" para \\"{{oldName}}\\" devido a ambiguidade em {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} não é parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"os esquemas não são unificáveis: os tipos ou o tamanho diferem: {{schemaA}} e {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"coluna \\"{{column}}\\" não pode ser encontrada em ambos os esquemas de junção","db.messages.exec.error-condition-must-be-boolean":"condição deve ser uma expressão booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} não definida para o tipo {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"a junção resultaria em nomes de coluna não únicos","db.messages.exec.error-no-columns-match-alias-star":"nenhuma coluna corresponde a \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dados para a coluna {{index}} (\\"{{column}}\\") não foi especificado","db.messages.exec.error-invalid-projection-error":"projeção inválida \\"{{argument}}\\": {{erro}}","db.messages.exec.error-function-expects-type":"a função \\"{{func}}\\" espera argumentos do tipo \\"{{expected}}\\" mas \\"{{given}}\\" foi dado","db.messages.exec.error-could-not-compare-different-types":"não foi possível comparar o valor se os tipos forem diferentes: {{typeA}}! = {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos os argumentos sejam do mesmo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"a condição de um CASE WHEN deve ser do tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":" CASE WHEN condição THEN resultado END espera que todos os resultados sejam do mesmo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"não foi possível encontrar relação \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT está faltando","db.messages.translate.warning-ignored-all-on-set-operators":"ignorou ALL na operação definida","db.messages.translate.error-variable-name-conflict":"conflito de nomes: o nome da relação \\"{{name}}\\" já existe","db.messages.translate.error-variable-cyclic-usage":"uso cíclico da variável \\"{{name}}\\" detectado","editor.codemirror-placeholder":"Digite sua consulta aqui\\n\\nAtalhos do teclado:\\n\\texecutar declaraçãot: [CTRL]+[RETURN]\\n\\texecutar seleção: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Sucesso","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Perigo","editor.alert-message-headers.error":"Erro","editor.inline-relation-editor.button-ok":"Ok","editor.inline-relation-editor.button-cancel":"Cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"por favor, insira seus dados","editor.inline-relation-editor.error-column-name-missing":"nome da coluna ausente na coluna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string não deve conter aspas simples e duplas","editor.error-no-query-found":"nenhuma consulta encontrada","editor.pegjs-error.or":"ou","editor.pegjs-error.no-input-found":"nenhuma entrada encontrada","editor.pegjs-error.end-of-input":"fim da entrada","editor.pegjs-error.expected-found":"esperado {{expected}}, mas {{found}} encontrado.","editor.error-at-line-x":"na linha {{line}}","calc.messages.error-query-missing":"nenhuma consulta encontrada","calc.messages.error-query-missing-assignments-found":"apenas atribuições encontradas; falta a consulta Ajuda - Tarefas ","calc.messages.gist-load-success":"gist carregado com sucesso","calc.menu.headline":"Carregue um Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Carregar Dataset armazenado em um gist","calc.menu.load-gist-button":"Carregar","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Crie seu próprio Dataset","calc.menu.create-own-dataset-text":"Você pode criar seu próprio conjunto de dados e compartilhá-lo com outras pessoas. Saiba mais sobre isso no ","calc.menu.create-own-dataset-text-link":"Tutorial de manutenção","calc.menu.create-own-dataset-button-new":"Criar novo Dataset","calc.menu.create-own-dataset-button-modify":"Modificar Dataset","calc.navigation.take-a-tour":"Faça um Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ajuda","calc.navigation.calc":"Calcular","calc.navigation.language":"Linguagem","calc.maintainer-groups.misc":"Diversos","calc.maintainer-groups.temp":"Temporário","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"Histórico","calc.editors.insert-relation-title":"Inserir","calc.editors.insert-relation-tooltip":"Inserir relação ou nomes de coluna","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"Importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"Importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"+ nova relação","calc.editors.group.toolbar.add-new-relation-content":"Abrir editor de relações","calc.editors.group.button-download":"Download","calc.editors.group.button-exec":"Visualizar","calc.editors.group.button-use":"Use Grupo no Editor","calc.editors.group.button-use_plural":"Use o primeiro Grupo no Editor","calc.editors.group.sql-import-group-name-placeholder":"Nome do grupo (importado de SQL)","calc.editors.group.new-group-example-group":"– este é um exemplo\\n\\ngroup: nomeDoNovoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-dump","calc.editors.group.modal-sqldump.button-close":"Fechar","calc.editors.group.modal-sqldump.button-cancel":"Cancelar","calc.editors.group.modal-sqldump.button-import-sql":"Importar SQL","calc.editors.group.modal-sqldump.description":"Coloque seu SQL-Dump aqui para criar um grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"AlgRel","calc.editors.ra.button-execute-query":"Executar consulta","calc.editors.ra.button-execute-selection":"Executar seleção","calc.editors.ra.button-download":"Download","calc.editors.ra.toolbar.projection":"Projeção","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
        pi a, b A","calc.editors.ra.toolbar.selection":"Seleção","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
        sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renomear relação / renomear colunas","calc.editors.ra.toolbar.rename-content":"
        σ x.a > 1 ( ρ x ( A ) )
        \\n
        σ A.y > 2 ( rho ya ( A ) )
        ","calc.editors.ra.toolbar.right-arrow":"flecha derecha","calc.editors.ra.toolbar.rename-columns-operator":"operador renomear colunas","calc.editors.ra.toolbar.rename-columns-operator-content":"
        σ A.y > 2 ( ρ ya ( A ) )
        ","calc.editors.ra.toolbar.orderBy":"ordenar (order by)","calc.editors.ra.toolbar.orderBy-content":"
        τ a asc, [2] desc ( A )
        tau a asc, [2] desc ( A )
        ","calc.editors.ra.toolbar.groupBy":"agrupar (group by)","calc.editors.ra.toolbar.groupBy-content":"
        γ a, b; count(c)→c ( A )
        \\n
        gamma count(a)->x, sum(b)->y ( A )
        ","calc.editors.ra.toolbar.and":"e","calc.editors.ra.toolbar.and-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.xor":"ou exclusivo (xor)","calc.editors.ra.toolbar.xor-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.or":"ou","calc.editors.ra.toolbar.or-content":"
        σ a < b b c ( A )
        ","calc.editors.ra.toolbar.not":"não","calc.editors.ra.toolbar.not-content":"
        &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
        &sigma","calc.editors.ra.toolbar.not-equals":"não igual","calc.editors.ra.toolbar.not-equals-content":"
        &sigma","calc.editors.ra.toolbar.greater-or-equals":"maior ou igual","calc.editors.ra.toolbar.greater-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ou igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
        &sigma","calc.editors.ra.toolbar.intersect":"intersecção","calc.editors.ra.toolbar.intersect-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.union":"união","calc.editors.ra.toolbar.union-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.division":"divisão","calc.editors.ra.toolbar.division-content":"
        ( A ) ÷ ( B )
        ","calc.editors.ra.toolbar.subtraction":"subtração","calc.editors.ra.toolbar.subtraction-content":"
        ( A ) - ( B )
        \\n
        ( A ) \\n ( B )
        ","calc.editors.ra.toolbar.cross-join":"junção cruzada (cross join)","calc.editors.ra.toolbar.cross-join-content":"
        ( A ) ( B )
        ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
        ( A ) ( B )
        \\n
        ( A ) ⋈ A.a ≥ B.a ( B )
        ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
        ( A ) ⟕ ( B )
        \\n
        ( A ) ⟕ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
        ( A ) ⟖ ( B )
        \\n
        ( A ) ⟖ A.a < B.a ( B )
        \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
        ( A ) ⟗ ( B )
        \\n
        ( A ) ⟗ A.a != B.a ( B )
        ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
        ( A ) ⋉ ( B )
        ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
        ( A ) ⋊ ( B )
        ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
        ( A ) ▷ ( B )
        ","calc.editors.ra.toolbar.assignment":"atribuição","calc.editors.ra.toolbar.assignment-content":"
        X = pi a ( A )\\n
        Y = pi b ( b )\\n
        ( X ) ( Y )
        ","calc.editors.ra.toolbar.single-line-comment":"comentário em linha","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- comentário útil","calc.editors.ra.toolbar.multi-line-comment":"comentário multilinha","calc.editors.ra.toolbar.multi-line-comment-content":"/* este é um comentário longo,
        muito longo*/

        π a, b A","calc.editors.ra.toolbar.inline-relation":"relação aninhada","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
        a:string, b:number, X.c:date
        a, 1, 1970-01-01
        }
        )","calc.editors.ra.toolbar.inline-relation-editor":"relação aninhada (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"criar uma nova relação aninhada usando o editor","calc.editors.ra.toolbar.insert-date":"inserir data","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"substituição de operador","calc.editors.ra.toolbar.autoreplace-operators.header":"substituir operadores automaticamente","calc.editors.ra.toolbar.autoreplace-operators.none":"sem substituição","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Executar consulta","calc.editors.sql.button-execute-selection":"Executar seleção","calc.editors.sql.button-download":"Download","calc.editors.sql.toolbar.select":"cláusula select","calc.editors.sql.toolbar.select-content":"

        SELECT * FROM A

        SELECT a, A.b, A.c FROM A
        ","calc.editors.sql.toolbar.from":"cláusula from","calc.editors.sql.toolbar.from-content":"
        SELECT *
        FROM A, B as b
        INNER JOIN C NATURAL
        ","calc.editors.sql.toolbar.where":"cláusula where","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
        where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula group by","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
        FROM A
        GROUP BY a","calc.editors.sql.toolbar.having":"cáusula having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
        FROM A
        GROUP BY a
        having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula order by","calc.editors.sql.toolbar.order-by-content":"

        SELECT * FROM A ORDER BY a asc, b desc

        SELECT * FROM A ORDER BY 1, 2, 3
        ","calc.editors.sql.toolbar.limit":"cláusula limit","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
        LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"inserir data","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Fechar","calc.editors.ra.inline-editor.title":"Editor de Relação","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nome","calc.editors.ra.inline-editor.row-type":"Tipo","calc.editors.ra.inline-editor.input-relation-name":"Nome da Relação","calc.navigation.imprint":"Impressão"}')},0:function(e,t,n){e.exports=n("./src/calc2/calculator.entry.tsx")}}); \ No newline at end of file + */var r,o,i,a,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var l=null,u=null,c=function(){if(null!==l)try{var e=t.unstable_now();l(!0,e),l=null}catch(e){throw setTimeout(c,0),e}},d=Date.now();t.unstable_now=function(){return Date.now()-d},r=function(e){null!==l?setTimeout(r,0,e):(l=e,setTimeout(c,0))},o=function(e,t){u=setTimeout(e,t)},i=function(){clearTimeout(u)},a=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var h=window.performance,f=window.Date,m=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var g=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof h&&"function"==typeof h.now)t.unstable_now=function(){return h.now()};else{var y=f.now();t.unstable_now=function(){return f.now()-y}}var b=!1,v=null,_=-1,w=5,E=0;a=function(){return t.unstable_now()>=E},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(!(void 0!==o&&0T(a,n))void 0!==l&&0>T(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else{if(!(void 0!==l&&0>T(l,n)))break e;e[r]=l,e[s]=n,r=s}}}return t}return null}function T(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var M=[],x=[],R=1,L=null,A=3,D=!1,N=!1,P=!1;function I(e){for(var t=O(x);null!==t;){if(null===t.callback)k(x);else{if(!(t.startTime<=e))break;k(x),t.sortIndex=t.expirationTime,S(M,t)}t=O(x)}}function H(e){if(P=!1,I(e),!N)if(null!==O(M))N=!0,r(Y);else{var t=O(x);null!==t&&o(H,t.startTime-e)}}function Y(e,n){N=!1,P&&(P=!1,i()),D=!0;var r=A;try{for(I(n),L=O(M);null!==L&&(!(L.expirationTime>n)||e&&!a());){var s=L.callback;if(null!==s){L.callback=null,A=L.priorityLevel;var l=s(L.expirationTime<=n);n=t.unstable_now(),"function"==typeof l?L.callback=l:L===O(M)&&k(M),I(n)}else k(M);L=O(M)}if(null!==L)var u=!0;else{var c=O(x);null!==c&&o(H,c.startTime-n),u=!1}return u}finally{L=null,A=r,D=!1}}function F(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var W=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||D||(N=!0,r(Y))},t.unstable_getCurrentPriorityLevel=function(){return A},t.unstable_getFirstCallbackNode=function(){return O(M)},t.unstable_next=function(e){switch(A){case 1:case 2:case 3:var t=3;break;default:t=A}var n=A;A=t;try{return e()}finally{A=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=W,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=A;A=e;try{return t()}finally{A=n}},t.unstable_scheduleCallback=function(e,n,a){var s=t.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0s?(e.sortIndex=l,S(x,e),null===O(M)&&e===O(x)&&(P?i():P=!0,o(H,l-s))):(e.sortIndex=a,S(M,e),N||D||(N=!0,r(Y))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();I(e);var n=O(M);return n!==L&&null!==L&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},"./node_modules/strict-uri-encode/index.js":function(e,t,n){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},"./node_modules/symbol-observable/es/index.js":function(e,t,n){"use strict";(function(e,r){var o,i=n("./node_modules/symbol-observable/es/ponyfill.js");o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var a=Object(i.a)(o);t.a=a}).call(this,n("./node_modules/webpack/buildin/global.js"),n("./node_modules/webpack/buildin/harmony-module.js")(e))},"./node_modules/symbol-observable/es/ponyfill.js":function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},"./node_modules/timers-browserify/main.js":function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(o.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(o.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n("./node_modules/setimmediate/setImmediate.js"),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n("./node_modules/webpack/buildin/global.js"))},"./node_modules/warning/warning.js":function(e,t,n){"use strict";var r=function(){};e.exports=r},"./node_modules/webpack/buildin/global.js":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},"./node_modules/webpack/buildin/harmony-module.js":function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},"./node_modules/webpack/buildin/module.js":function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./src/calc2/calculator.entry.tsx":function(e,t,n){"use strict";n.r(t);var r=n("./src/calc2/i18n.tsx"),o=n("./src/calc2/utils/groupUtils.ts"),i=n("./node_modules/immutable/dist/immutable.es.js"),a=function(e){return"@@redux-saga/"+e},s=a("CANCEL_PROMISE"),l=a("CHANNEL_END"),u=a("IO"),c=a("MATCH"),d=a("MULTICAST"),h=a("SAGA_ACTION"),f=a("SELF_CANCELLATION"),m=a("TASK"),p=a("TASK_CANCEL"),g=a("TERMINATE"),y=a("LOCATION"),b=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),v=function(e){return null==e},_=function(e){return null!=e},w=function(e){return"function"==typeof e},E=function(e){return"string"==typeof e},j=Array.isArray,C=function(e){return e&&w(e.then)},S=function(e){return e&&w(e.next)&&w(e.throw)},O=function e(t){return t&&(E(t)||M(t)||w(t)||j(t)&&t.every(e))},k=function(e){return e&&w(e.take)&&w(e.close)},T=function(e){return w(e)&&e.hasOwnProperty("toString")},M=function(e){return Boolean(e)&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype};var x=function(e){return function(){return e}}(!0),R=function(){};var L=function(e){return e};"function"==typeof Symbol&&Symbol.asyncIterator&&Symbol.asyncIterator;var A=function(e,t){Object(b.a)(e,t),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach((function(n){e[n]=t[n]}))};function D(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}function N(e){var t=!1;return function(){t||(t=!0,e())}}var P=function(e){throw e},I=function(e){return{value:e,done:!0}};function H(e,t,n){void 0===t&&(t=P),void 0===n&&(n="iterator");var r={meta:{name:n},next:e,throw:t,return:I,isSagaIterator:!0};return"undefined"!=typeof Symbol&&(r[Symbol.iterator]=function(){return r}),r}function Y(e,t){var n=t.sagaStack;console.error(e),console.error(n)}var F=function(e){return Array.apply(null,new Array(e))},W=function(e){return function(t){return e(Object.defineProperty(t,h,{value:!0}))}},B=function(e){return e===g},U=function(e){return e===p},z=function(e){return B(e)||U(e)};function V(e,t){var n=Object.keys(e),r=n.length;var o,i=0,a=j(e)?F(r):{},s={};return n.forEach((function(e){var n=function(n,s){o||(s||z(n)?(t.cancel(),t(n,s)):(a[e]=n,++i===r&&(o=!0,t(a))))};n.cancel=R,s[e]=n})),t.cancel=function(){o||(o=!0,n.forEach((function(e){return s[e].cancel()})))},s}function q(e){return{name:e.name||"anonymous",location:G(e)}}function G(e){return e[y]}function K(e,t){void 0===e&&(e=10);var n=new Array(e),r=0,o=0,i=0,a=function(t){n[o]=t,o=(o+1)%e,r++},s=function(){if(0!=r){var t=n[i];return n[i]=null,r--,i=(i+1)%e,t}},l=function(){for(var e=[];r;)e.push(s());return e};return{isEmpty:function(){return 0==r},put:function(s){var u;if(r1?t-1:0),r=1;r1?t-1:0),r=1;r2?n-2:0),o=2;oe.groupInfo.source===n&&e.groupInfo.id===r&&e.groupInfo.filename===o&&e.groupInfo.index===i);return a?Object.assign(Object.assign({},e),{current:Object.assign(Object.assign({},e.current),{group:a})}):(console.error("could not find group ",a),e)}case"GROUPS_LOAD_SUCCESS":{const{loadedGroups:n}=t;let r=e;for(const e of n)r=Object.assign(Object.assign({},r),{groups:r.groups.set(le(e),e)});return r}case"GROUP_SET_DRAFT":{let{draft:n}=t;n=Object.assign(Object.assign({},n),{isDraft:!0}),e=Object.assign(Object.assign({},e),{groups:e.groups.set(le(n),n),current:Object.assign(Object.assign({},e.current),{group:n})})}default:return e}}function le(e){const{source:t,id:n,filename:r,index:o}=e.groupInfo;return`${t}/${n}/${r}/${o}`}n("./node_modules/custom-event-polyfill/polyfill.js");var ue=n("./node_modules/react/index.js"),ce=n("./node_modules/react-dom/index.js"),de=n("./node_modules/react-hot-loader/index.js"),he=(n.p,n("./src/calc2/main.hot.tsx")),fe=n("./node_modules/redux/es/redux.js"),me=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js");function pe(){var e={};return e.promise=new Promise((function(t,n){e.resolve=t,e.reject=n})),e}var ge=pe,ye=[],be=0;function ve(e){try{Ee(),e()}finally{je()}}function _e(e){ye.push(e),be||(Ee(),Ce())}function we(e){try{return Ee(),e()}finally{Ce()}}function Ee(){be++}function je(){be--}function Ce(){var e;for(je();!be&&void 0!==(e=ye.shift());)ve(e)}var Se=function(e){return function(t){return e.some((function(e){return xe(e)(t)}))}},Oe=function(e){return function(t){return e(t)}},ke=function(e){return function(t){return t.type===String(e)}},Te=function(e){return function(t){return t.type===e}},Me=function(){return x};function xe(e){var t="*"===e?Me:E(e)?ke:j(e)?Se:T(e)?ke:w(e)?Oe:M(e)?Te:null;if(null===t)throw new Error("invalid pattern: "+e);return t(e)}var Re={type:l},Le=function(e){return e&&e.type===l};function Ae(e){void 0===e&&(e=X());var t=!1,n=[];return{take:function(r){t&&e.isEmpty()?r(Re):e.isEmpty()?(n.push(r),r.cancel=function(){D(n,r)}):r(e.take())},put:function(r){if(!t){if(0===n.length)return e.put(r);n.shift()(r)}},flush:function(n){t&&e.isEmpty()?n(Re):n(e.flush())},close:function(){if(!t){t=!0;var e=n;n=[];for(var r=0,o=e.length;r2?h-2:0),m=2;m2?n-2:0),o=2;o1?t-1:0),r=1;r!(e.groupInfo.source!==t||e.groupInfo.id!==n||!r||"first"!==r&&r.filename!==e.groupInfo.filename||!r||"first"!==r&&r.index!==e.groupInfo.index));if(s){const{source:e,id:t,filename:n,index:r}=s.groupInfo,o={type:"GROUP_SET_CURRENT",source:e,id:t,filename:n,index:r};yield Q(o)}else try{if("local"!==t&&"gist"!==t)throw new Error(`unsupported source-type ${t}`);const e=yield ee(o.b,t,n,i,a),s={type:"GROUPS_LOAD_SUCCESS",loadedGroups:e};if(yield Q(s),void 0!==r&&e.length>0){const{source:t,id:n,filename:r}=e[0].groupInfo,o={type:"GROUP_SET_CURRENT",source:t,id:n,filename:r,index:0};yield Q(o)}}catch(e){console.error("could not fetch group",e),window.alert("Could not fetch group!\nDefault group loaded.\n"+e)}}))})),ce.render(ue.createElement(de.AppContainer,null,ue.createElement(he.a,{store:et})),document.getElementById("root"));{const e={type:"SET_LOCALE",locale:r.c.language};et.dispatch(e)}for(const e of function(){const e=[{maintainerGroup:Object(r.d)("calc.maintainer-groups.misc"),maintainer:"",source:"local",id:"uibk"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'mtschu',source:"gist",id:"2923a30a474fdcb46bee"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.uibk"),maintainer:'Wolfgang Gassler',source:"gist",id:"7d1871f79a8bcb4788de"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.karlsruhe"),maintainer:'Jan Stoess',source:"gist",id:"4f7866c17624ca9dfa85ed2482078be8"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.karlsruhe"),maintainer:'Jan Stoess',source:"gist",id:"a287f5ad991c08a74f55c06789c95508"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"41cf5ce652756d9331eec7562644e074"},{maintainerGroup:Object(r.d)("calc.maintainer-groups.saarland"),maintainer:'Jens Dittrich',source:"gist",id:"c306ecf21c6e6d175508d3ac6b4355e7"}];let t=!0;return e.map(({source:e,id:n,maintainer:r,maintainerGroup:o})=>{const i={type:"GROUPS_LOAD_REQUEST",source:e,id:n,setCurrent:t?"first":void 0,maintainer:r,maintainerGroup:o};return t=!1,i})}())et.dispatch(e)},"./src/calc2/components/calculator.scss":function(e,t,n){},"./src/calc2/components/dropdownList.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var r=n("./node_modules/react/index.js"),o=n("./node_modules/reactstrap/lib/Dropdown.js"),i=n.n(o),a=n("./node_modules/reactstrap/lib/DropdownItem.js"),s=n.n(a),l=n("./node_modules/reactstrap/lib/DropdownMenu.js"),u=n.n(l),c=n("./node_modules/reactstrap/lib/DropdownToggle.js"),d=n.n(c);class h extends r.Component{constructor(e){super(e),this.id=`dropdown-${Math.random().toString(36).substr(2,10)}`,this.state={isOpen:!1},this.toggle=this.toggle.bind(this)}toggle(){this.setState({isOpen:!this.state.isOpen})}render(){const{label:e,elements:t,value:n,onChange:o,disabled:a=!1}=this.props,{isOpen:l}=this.state;return r.createElement(i.a,{isOpen:l,toggle:this.toggle},r.createElement(d.a,{color:"",disabled:a||0===t.length},e),r.createElement(u.a,null,t.map((e,t)=>"separator"===e.type?r.createElement(s.a,{key:t,divider:!0}):"header"===e.type?r.createElement(s.a,{key:t,header:!0},e.label):r.createElement(s.a,{key:t,onClick:t=>{t.preventDefault(),o&&o(e.value)},active:e.active||e.value===n},e.label))))}}},"./src/calc2/components/editorBase.tsx":function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return k})),n.d(t,"c",(function(){return T}));var r=n("./node_modules/@fortawesome/free-solid-svg-icons/index.es.js"),o=n("./node_modules/@fortawesome/react-fontawesome/index.es.js"),i=n("./src/calc2/components/dropdownList.tsx"),a=n("./src/calc2/components/toolbar.tsx"),s=n("./src/calc2/i18n.tsx"),l=n("./node_modules/classnames/index.js"),u=n("./node_modules/codemirror/lib/codemirror.js"),c=(n("./node_modules/codemirror/addon/hint/show-hint.js"),n("./src/db/exec/RANode.ts")),d=n("./src/db/translate/utils.ts"),h=n("./node_modules/react/index.js"),f=n("./node_modules/react-dom/index.js"),m=n("./node_modules/react-toastify/esm/react-toastify.js"),p=n("./node_modules/reactstrap/es/Button.js"),g=n("./node_modules/reactstrap/es/Modal.js"),y=n("./node_modules/reactstrap/es/ModalHeader.js"),b=n("./node_modules/reactstrap/es/ModalBody.js"),v=n("./node_modules/reactstrap/es/ModalFooter.js"),_=n("./node_modules/reactstrap/es/Input.js"),w=n("./node_modules/@handsontable/react/es/react-handsontable.js");n("./node_modules/codemirror/lib/codemirror.css"),n("./node_modules/codemirror/theme/eclipse.css"),n("./node_modules/codemirror/addon/hint/show-hint.css"),n("./node_modules/codemirror/addon/lint/lint.js"),n("./node_modules/codemirror/addon/lint/lint.css"),n("./node_modules/codemirror/addon/display/placeholder.js"),n("./node_modules/codemirror/addon/display/autorefresh.js"),n("./node_modules/codemirror/mode/sql/sql.js"),n("./node_modules/handsontable/dist/handsontable.full.css"),u.defineMode("relalg",(function(){const e=["pi","sigma","rho","tau","<-","->","intersect","union","except","/","-","\\\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","left semi join","right semi join","anti join","anti semi join","and","or","xor"],t=["π","σ","ρ","τ","←","→","∩","∪","÷","-","⨯","⨝","⟕","⟖","⟗","⋉","⋊","▷"],n=["<-","->",">=","<=","=","∧","∨","⊻","⊕","≠","=","¬",">","<","≥","≤"],r=(e,t,n,r="")=>{for(let o=0;o({inBlockComment:!1}),token:(o,i)=>i.inBlockComment?(o.match(/.*?\*\//,!0)?i.inBlockComment=!1:o.match(/.*/,!0),"comment"):o.match(/\/\*.*?\*\//,!0)?"comment":!i.inBlockComment&&o.match(/^\/\*.*/,!0)?(i.inBlockComment=!0,"comment"):i.inInlineRelation?(o.match(/.*?}/,!0)?i.inInlineRelation=!1:o.match(/.*/,!0),"inlineRelation"):o.match(/^{/,!0)?(i.inInlineRelation=!0,"inlineRelation"):o.match(/^--[\t ]/,!0)?(o.skipToEnd(),"comment"):o.match(/^\/\*.*?$/,!0)?"comment":r(o,t,!0)?"keyword math":r(o,e,!0,"([\\(\\)[\\]{\\}, \\.\\t]|$)")?"keyword":r(o,n,!0)?"operator math":o.match(/^\[[0-9]+]/,!0)?"attribute":o.match(/^[0-9]+(\.[0-9]+)?/,!0)?"number":o.match(/\^'[^']*'/i,!0)?"string":o.match(/\^[a-z]+\.[a-z]*/i,!0)?"qualified-column":o.match(/^[\(\)\[]\{},]/i,!0)?"bracket":o.match(/^[a-z][a-z0-9\.]*/i,!0)?"word":(o.next(),"else")}}));const E=e=>{const{editor:t}=e,{type:n,message:r,position:o}=e.alert,i={error:Object(s.d)("editor.alert-message-headers.error"),warning:Object(s.d)("editor.alert-message-headers.warning")}[n];return h.createElement("div",{className:l("alert ",{"alert-danger":"error"===n,"alert-warning":"warning"===n})},o?h.createElement("strong",null,i,": ",h.createElement("a",{onClick:e=>{if(t)return t.focus(),t.getDoc().setCursor(o),t.scrollIntoView(null,42),e.preventDefault(),!1;console.warn("editor not initialized yet")},href:"#"},Object(s.d)("editor.error-at-line-x",{line:o.line+1})),": ",r):h.createElement("strong",null,i,": ",r))};class j{constructor(){this.name="",this.type="",this.data=[]}}class C{constructor(){this.name="",this.attributes=[]}toString(e){let t="";t=!1===e?this.name+" = {\n":"{ ";const n=new Array;for(let e=0;e<1+this.attributes[0].data.length;e++)n.push("");return this.attributes.forEach((e,t)=>{t>0&&(n[0]+=", "),n[0]+=e.name,e.data.forEach((r,o)=>{t>0&&(n[o+1]+=", "),"number"===e.type?n[o+1]+=r:n[o+1]+="'"+r+"'"})}),t+=n.join("\n"),t+="\n}\n",t}fromTableData(e){if(null==e)return;const t=new Array;t.push([]),t.push([]),e.columns.forEach(e=>{t[0].push(e.name),t[1].push(e.type)}),e.rows.forEach(e=>{t.push(e)}),this.fromData(t)}toData(){const e=new Array;if(0===this.attributes.length)return[[]];for(let t=0;t<2+this.attributes[0].data.length;t++)e.push([]);return this.attributes.forEach(t=>{e[0].push(t.name),e[1].push(t.type),t.data.forEach((t,n)=>{e[n+2].push(t)})}),e}fromData(e){for(let t=0;t{const r=new Array,i=e.split(t);-1===o&&(o=i.length),i.length===o&&(i.forEach(e=>{r.push(e)}),n.push(r))}),this.fromData(n)}toCSV(e=";"){let t="";return this.toData().forEach(n=>{t+=n.join(e)+"\n"}),t}}const S="CodeMirror-table-edit-markers";class O extends h.Component{constructor(e){super(e);const t=Object.assign({theme:"eclipse",smartdent:!0,tabSize:2,indentWithTabs:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,autoCloseBrackets:!0,smartIndent:!0,autofocus:!1,autoRefresh:!0,enableInlineRelationEditor:!0,gutters:["CodeMirror-lint-markers",S],mode:e.mode,viewportMargin:1/0,extraKeys:{"Shift-Tab":"indentLess","Ctrl-Enter":e=>{this.exec(!1)},"Shift-Ctrl-Enter":e=>{const{editor:t}=this.state;t&&t.getDoc().somethingSelected()&&this.exec(!0)},"Ctrl-S":e=>{this.downloadEditorText()},"Ctrl-Space":e=>{u.showHint(e,e=>this.genericHint(e),{closeOnUnfocus:!0})}},placeholder:Object(s.d)("editor.codemirror-placeholder"),textChange:null},e.codeMirrorOptions);this.hotTableSettings={colHeaders:!1,rowHeaders:function(e){return 0===e?Object(s.d)("calc.editors.ra.inline-editor.row-name"):1===e?Object(s.d)("calc.editors.ra.inline-editor.row-type"):e-1},height:function(){return.7*document.body.clientHeight},fixedRowsTop:2,minRows:2,minCols:1,minSpareRows:1,minSpareCols:1,colWidths:"100px",contextMenu:!0,cells:function(e,t){return 1===e?{type:"dropdown",source:["number","string","date"]}:{}}},this.state={editor:null,codeMirrorOptions:t,history:[],isSelectionSelected:!1,execSuccessful:!1,execErrors:[],isExecutionDisabled:!1,execResult:null,modal:!1,inlineRelationModal:!1,relationEditorName:"",replSelStart:null,replSelEnd:null},this.toggle=this.toggle.bind(this),this.inlineRelationEditorOk=this.inlineRelationEditorOk.bind(this),this.toggleInlineRelationEditor=this.toggleInlineRelationEditor.bind(this),this.inlineRelationEditorClose=this.inlineRelationEditorClose.bind(this),this.inlineRelationEditorUpload=this.inlineRelationEditorUpload.bind(this),this.inlineRelationEditorDownload=this.inlineRelationEditorDownload.bind(this),this.hinterCache={hints:[],hintsFromLinter:[],changed:!0},this.linter=this.linter.bind(this),this.exec=this.exec.bind(this),this.applyHistory=this.applyHistory.bind(this),this.downloadEditorText=this.downloadEditorText.bind(this),this.uploadCSVRef=h.createRef()}getInlineRelationData(){return this.hotTableSettings.data}setInlineRelationData(e){this.hotTableSettings.datta=e}inlineRelationEditorOpen(e){const t=new C,{editor:n}=this.state;if(n){let r=n.getDoc().getCursor(),o=n.getDoc().getCursor();e?(t.name=e.assignmentName,t.fromTableData(e.content),r=u.Pos(e.line-1,0),o=u.Pos(e.end.line,e.end.column)):(t.attributes.push(new j),t.attributes.push(new j)),this.setState({inlineRelationModal:!0,relationEditorName:t.name,replSelStart:r,replSelEnd:o},()=>{this.hotTableSettings.data=t.toData()})}}inlineRelationEditorOk(){const e=new C;e.name=this.state.relationEditorName,e.fromData(this.getInlineRelationData());const{editor:t,replSelStart:n,replSelEnd:r}=this.state;t&&t.getDoc().replaceRange(e.toString("relalg"===this.props.tab),n,r),this.inlineRelationEditorClose()}inlineRelationEditorClose(){this.setState({inlineRelationModal:!1})}inlineRelationEditorUpload(e){const t=e.target.files;if(t.length>0){const e=new FileReader;e.onload=e=>{const n=e.target.result,r=new C;r.fromCSV(n),r.name=t[0].name.replace(".csv",""),this.setInlineRelationData(r.toData())},e.readAsText(t[0])}}inlineRelationEditorDownload(){const e=new C;e.fromData(this.getInlineRelationData());const t=e.toCSV(),n=(document.createElement("a"),document.createElement("a"));n.href=window.URL.createObjectURL(new Blob([t],{type:"text/csv"})),n.download=this.state.relationEditorName+".csv",n.click()}componentDidMount(){const e=Object(f.findDOMNode)(this).querySelector("textarea");if(!e)throw new Error("could not fid textarea");const t=u.fromTextArea(e,this.state.codeMirrorOptions);this.setState({editor:t,relationEditorName:""}),null!=this.props.linterFunction&&t.setOption("lint",{getAnnotations:this.linter}),t.on("cursorActivity",e=>{this.setState({isSelectionSelected:e.getDoc().somethingSelected()})}),t.on("change",e=>{this.props.textChange(e)})}render(){const{execErrors:e,isSelectionSelected:t,editor:n,history:u,execSuccessful:c,isExecutionDisabled:d,execResult:f}=this.state,{toolbar:m,disableHistory:j=!1,execButtonLabel:C}=this.props;return h.createElement("div",null,h.createElement("div",{className:"editor-base"},h.createElement(a.a,{groups:m}),h.createElement("textarea",null),h.createElement("div",{className:"exec-errors"},e.map((e,t)=>h.createElement(E,{key:t,alert:e,editor:n}))),h.createElement("div",{className:"input-buttons"},h.createElement("button",{type:"button",disabled:d,className:l("btn btn-primary exec-button selection",{"selection-selected":t,"btn-danger":e.length>0,"btn-success":c,disabled:d}),onClick:()=>{n?this.exec(n.getDoc().somethingSelected()):console.warn("editor not initialized yet")}},C?h.createElement("span",null,h.createElement(o.a,{icon:r.o})," ",h.createElement(s.b,{id:C})):h.createElement(h.Fragment,null,h.createElement("span",{className:"glyphicon glyphicon-play"})," ",h.createElement("span",{className:"query"},h.createElement(o.a,{icon:r.n})," ",h.createElement(s.b,{id:"calc.editors.ra.button-execute-query"})),h.createElement("span",{className:"selection"},h.createElement(s.b,{id:"calc.editors.ra.button-execute-selection"})))),h.createElement("div",{style:{float:"right"}},h.createElement(p.a,{color:"Link",type:"button",className:"hideOnSM",onClick:this.downloadEditorText},h.createElement(o.a,{icon:r.h})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.ra.button-download"}))),j?null:h.createElement("div",{className:"btn-group history-container"},h.createElement(i.a,{label:h.createElement("span",null,h.createElement(o.a,{icon:r.k})," ",h.createElement("span",{className:"hideOnSM"},h.createElement(s.b,{id:"calc.editors.button-history"}))),elements:u.map(e=>({label:h.createElement(h.Fragment,null,h.createElement("small",{className:"muted text-muted"},e.time.toLocaleTimeString()),h.createElement("div",null,e.code)),value:e})),onChange:this.applyHistory})))),h.createElement("div",{className:"exec-result"},f),h.createElement(g.a,{isOpen:this.state.modal,toggle:this.toggle,className:"showOnSM"},h.createElement(y.a,{toggle:this.toggle},Object(s.d)("calc.result.modal.title")),h.createElement(b.a,null,h.createElement("div",null,f)),h.createElement(v.a,null,h.createElement("span",null),h.createElement(p.a,{color:"secondary",onClick:this.toggle},Object(s.d)("calc.result.modal.close")))),h.createElement(g.a,{isOpen:this.state.inlineRelationModal,toggle:this.toggleInlineRelationEditor},h.createElement(y.a,{toggle:this.toggleInlineRelationEditor},Object(s.d)("calc.editors.ra.inline-editor.title")),h.createElement(b.a,null,h.createElement("div",null,"group"===this.props.tab?h.createElement("div",null,h.createElement(_.a,{placeholder:Object(s.d)("calc.editors.ra.inline-editor.input-relation-name"),value:this.state.relationEditorName,onChange:e=>{this.setState({relationEditorName:e.target.value})}}),h.createElement("br",null)):null,h.createElement(w.a,{settings:this.hotTableSettings,licenseKey:"non-commercial-and-evaluation"}))),h.createElement(v.a,null,h.createElement(p.a,{color:"light",onClick:this.inlineRelationEditorDownload},h.createElement(o.a,{icon:r.h})," ",Object(s.d)("calc.editors.ra.inline-editor.button-download-csv")),h.createElement(p.a,{color:"light",onClick:()=>{var e;null===(e=this.uploadCSVRef.current)||void 0===e||e.click()}},h.createElement(o.a,{icon:r.s})," ",Object(s.d)("calc.editors.ra.inline-editor.button-upload-csv")),h.createElement("input",{className:"hidden",ref:this.uploadCSVRef,onChange:this.inlineRelationEditorUpload,type:"file"}),h.createElement("span",{className:"flexSpan"}),h.createElement(p.a,{color:"primary",onClick:this.inlineRelationEditorOk},h.createElement(o.a,{icon:r.e})," ",Object(s.d)("calc.editors.ra.inline-editor.button-ok")),h.createElement(p.a,{color:"secondary",onClick:this.inlineRelationEditorClose},h.createElement(o.a,{icon:r.r})," ",Object(s.d)("calc.editors.ra.inline-editor.button-cancel"))))))}isMobile(){return window.innerWidth<=992}toggleInlineRelationEditor(){this.setState({inlineRelationModal:!this.state.inlineRelationModal})}toggle(){this.isMobile()&&this.setState({modal:!this.state.modal})}applyHistory(e){this.replaceAll(e.code)}forceLinterRun(){const{editor:e}=this.state;if(!e)return void console.warn("editor not initialized yet");const t=e.getValue();e.setValue(""),e.setValue(t)}historyAddEntry(e){const{historyMaxEntries:t=10,historyMaxLabelLength:n=20}=this.props,r={time:new Date,label:e.length>n?e.substr(0,n-4)+" ...":e,code:e};this.setState({history:[r,...this.state.history].slice(-t)})}clearExecutionAlerts(){this.state.execErrors.splice(0,this.state.execErrors.length),m.b.dismiss()}addExecutionWarning(e,t){this._addExecutionAlert(e,t,"warning"),this.isMobile()&&m.b.warn(e,{className:"fancyToastWarning"})}addExecutionError(e,t){this._addExecutionAlert(e,t,"error"),this.isMobile()&&m.b.error(e,{className:"fancyToastError"})}_addExecutionAlert(e,t,n){this.isMobile();const{editor:r}=this.state,o={type:n,message:e,position:t},i=this.state.execErrors;i.push(o),this.setState({execErrors:i})}setText(e,t){const{editor:n}=this.state;n?("selection"===t?n.getDoc().replaceSelection(e,"end"):n.setValue(e),this.clearExecutionAlerts(),this.setState({execSuccessful:!1})):console.warn("editor not initialized yet")}getText(){const{editor:e}=this.state;if(e)return e.getValue();console.warn("editor not initialized yet")}focus(){const{editor:e}=this.state;e?e.focus():console.warn("editor not initialized yet")}refresh(){const{editor:e}=this.state;e?e.refresh():console.warn("editor not initialized yet")}downloadEditorText(){let e="query";const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");switch(t.getOption("mode")){case"sql":case"text/x-mysql":e+=".sql";break;case"ra":default:e+=".txt"}((e,t)=>{const n=document.createElement("a");n.href=window.URL.createObjectURL(new Blob([t],{type:"text/plain"})),n.download=e,n.click()})(e,t.getValue())}resetHinter(){this.hinterCache={hints:[],hintsFromLinter:[],changed:!0}}linter(t){const{editor:n}=this.state;if(!n)return console.warn("editor not initialized yet"),[];if(0===t.length||!this.props.linterFunction)return[];try{const e=this.props.linterFunction(this,n,t);return 0===e.length&&0===this.hinterCache.hintsFromLinter.length||(this.hinterCache.hintsFromLinter=e,this.hinterCache.changed=!0),[]}catch(t){const r=[];console.log(t);const o=O._generateErrorFromException(t,0,0),i=e("").append(o.message).text();if(!o.codemirrorPositions)return this.clearExecutionAlerts(),this.addExecutionError(i),[];const a=o.codemirrorPositions.from;let s=o.codemirrorPositions.to;const l=n.getTokenAt({line:a.line,ch:a.ch+1},!0),u=n.getDoc().getRange(a,s);return void 0!==l.string&&l.string.length>u.length&&(s=n.getDoc().posFromIndex(n.getDoc().indexFromPos(a)+l.string.length)),r.push({from:a,to:s,message:i,severity:"error"}),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers(),r}}genericHint(e){const{getHintsFunction:t}=this.props,n=e.getDoc().getCursor(),r=e.getTokenAt(n),o=(e,t="unknown")=>({text:e,displayText:e,className:`hint-${t}`});let i=[];if(!0===this.hinterCache.changed){const e={},n=t?t():[];for(let t=0;t0)for(let e=0;es.length&&0===t.indexOf(s)&&a.push(i[e])}else a=i;return{list:a,from:u.Pos(n.line,r.start),to:u.Pos(n.line,r.end)}}exec(e){const{editor:t}=this.state;if(!t)throw new Error("editor not initialized yet");this.setState({execResult:h.createElement("div",{className:"spinner"},h.createElement("div",{className:"rect1"}),h.createElement("div",{className:"rect2"}),h.createElement("div",{className:"rect3"}),h.createElement("div",{className:"rect4"}),h.createElement("div",{className:"rect5"}))},()=>{this.clearExecutionAlerts();let n="",r={line:0,ch:0};!0!==e?n=t.getValue():(n=t.getDoc().getSelection(),r=t.getDoc().getCursor("from")),0===n.length&&(this.clearExecutionAlerts(),this.addExecutionError(Object(s.d)("editor.error-no-query-found"))),this.clearExecutionAlerts();try{const{result:e}=this.props.execFunction(this,n,r);this.setState({execResult:e});const t=new CustomEvent("editor.execSuccessful",{detail:{editor:this}});return document.dispatchEvent(t),this.toggle(),!0}catch(e){console.error(e,e.stack);const t=O._generateErrorFromException(e,r.line,r.ch);this.addExecutionError(t.message,t.codemirrorPositions?t.codemirrorPositions.from:void 0),this.props.enableInlineRelationEditor&&this.clearInlineRelationMarkers()}})}static _generateErrorFromException(e,t,n){let r=void 0!==e.message?e.message:e;r=r.replace(/(\\(u|x)[0-9A-F]+)/g,(e,t)=>`${String.fromCharCode(parseInt(t.substr(2),16))}`);let o=null;void 0!==e.codeInfo&&void 0!==e.codeInfo.location?o=e.codeInfo.location:void 0!==e.location&&(o=e.location);let i=null;return null!==o&&(i={from:{line:o.start.line+(t||0)-1,ch:o.start.column+(n||0)-1},to:{line:o.end.line+(t||0)-1,ch:o.end.column+(n||0)-1}}),{message:r,location:o,codemirrorPositions:i}}static buildTranslatedPegJsMessage(e,t){return null!==e&&function(e){let t=1;for(e.sort((e,t)=>e.descriptiont.description?1:0);t1?`${n.slice(0,-1).join(", ")} ${Object(s.d)("editor.pegjs-error.or")} ${n[e.length-1]}`:n[0],o=t?`"${function(e){function t(e){return e.charCodeAt(0).toString(16).toUpperCase()}return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(e){return"\\x0"+t(e)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(e){return"\\x"+t(e)})).replace(/[\u0180-\u0FFF]/g,(function(e){return"\\u0"+t(e)})).replace(/[\u1080-\uFFFF]/g,(function(e){return"\\u"+t(e)}))}(t)}"`:Object(s.d)("editor.pegjs-error.end-of-input");return Object(s.d)("editor.pegjs-error.expected-found",{expected:r,found:o})}(e,t)}setExecutionDisabled(e){this.setState({isExecutionDisabled:e})}replaceText(e,t){const n="string"==typeof e.label?e.label:"";this.replaceSelection(n,t)}replaceSelection(e,t){this.setText(t||e,"selection"),this.focus()}replaceAll(e,t){this.setText(t||e,"all"),this.focus()}setReadOnly(t){const{editor:n}=this.state;if(!n)throw new Error("editor not initialized yet");const r=e(n.getWrapperElement());!1===t?(n.setOption("readOnly",!1),r.removeClass("readonly")):(n.setOption("readOnly","nocursor"),r.addClass("readonly"))}addInlineRelationMarkers(e){const{editor:t}=this.state;if(!t)return void console.warn("editor not initialized yet");const n=function(e){const t=[];return Object(d.a)(e,e=>{const n=e;if(n&&"table"===n.type){const e={name:n.name,line:n.codeInfo.location.start.line-1,column:n.codeInfo.location.start.column-1,length:n.codeInfo.text.length,assignmentName:n.assignmentName?n.assignmentName:"",content:{columns:n.columns,rows:n.rows},start:n.codeInfo.location.start,end:n.codeInfo.location.end};t.push(e)}}),t}(e);this.clearInlineRelationMarkers();for(let e=0;e{this.inlineRelationEditorOpen(n[e])},f.render(h.createElement(o.a,{icon:r.q}),i,()=>{i.style.marginLeft="-15px",t.setGutterMarker(n[e].line++,S,i)})}}clearInlineRelationMarkers(){const{editor:e}=this.state;e?e.clearGutter(S):console.warn("editor not initialized yet")}}function k(e){const t=[],n=function(e){const r=e.getSchema();for(let e=0;e-1&&!this.props.autohide&&(this._hideTimeout&&this.clearHideTimeout(),this.state.isOpen&&!this.props.isOpen&&this.toggle())},n.onMouseLeaveTooltipContent=function(e){this.props.trigger.indexOf("hover")>-1&&!this.props.autohide&&(this._showTimeout&&this.clearShowTimeout(),e.persist(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide")))},n.onEscKeyDown=function(e){"Escape"===e.key&&this.hide(e)},n.getRef=function(e){var t=this.props.innerRef;t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),this._popover=e},n.getDelay=function(e){var t=this.props.delay;return"object"==typeof t?isNaN(t[e])?S[e]:t[e]:t},n.show=function(e){if(!this.props.isOpen){if(this.clearShowTimeout(),this.currentTargetElement=e?e.currentTarget||e.target:null,e&&e.composedPath&&"function"==typeof e.composedPath){var t=e.composedPath();this.currentTargetElement=t&&t[0]||this.currentTargetElement}this.toggle(e)}},n.showWithDelay=function(e){this._hideTimeout&&this.clearHideTimeout(),this._showTimeout=setTimeout(this.show.bind(this,e),this.getDelay("show"))},n.hide=function(e){this.props.isOpen&&(this.clearHideTimeout(),this.currentTargetElement=null,this.toggle(e))},n.hideWithDelay=function(e){this._showTimeout&&this.clearShowTimeout(),this._hideTimeout=setTimeout(this.hide.bind(this,e),this.getDelay("hide"))},n.clearShowTimeout=function(){clearTimeout(this._showTimeout),this._showTimeout=void 0},n.clearHideTimeout=function(){clearTimeout(this._hideTimeout),this._hideTimeout=void 0},n.handleDocumentClick=function(e){var t=this.props.trigger.split(" ");t.indexOf("legacy")>-1&&(this.props.isOpen||T(e.target,this._targets))?(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen&&!k(e.target,this._popover)?this.hideWithDelay(e):this.props.isOpen||this.showWithDelay(e)):t.indexOf("click")>-1&&T(e.target,this._targets)&&(this._hideTimeout&&this.clearHideTimeout(),this.props.isOpen?this.hideWithDelay(e):this.showWithDelay(e))},n.addEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.addEventListener(e,t,n)}))},n.removeEventOnTargets=function(e,t,n){this._targets.forEach((function(r){r.removeEventListener(e,t,n)}))},n.addTargetEvents=function(){if(this.props.trigger){var e=this.props.trigger.split(" ");-1===e.indexOf("manual")&&((e.indexOf("click")>-1||e.indexOf("legacy")>-1)&&document.addEventListener("click",this.handleDocumentClick,!0),this._targets&&this._targets.length&&(e.indexOf("hover")>-1&&(this.addEventOnTargets("mouseover",this.showWithDelay,!0),this.addEventOnTargets("mouseout",this.hideWithDelay,!0)),e.indexOf("focus")>-1&&(this.addEventOnTargets("focusin",this.show,!0),this.addEventOnTargets("focusout",this.hide,!0)),this.addEventOnTargets("keydown",this.onEscKeyDown,!0)))}},n.removeTargetEvents=function(){this._targets&&(this.removeEventOnTargets("mouseover",this.showWithDelay,!0),this.removeEventOnTargets("mouseout",this.hideWithDelay,!0),this.removeEventOnTargets("keydown",this.onEscKeyDown,!0),this.removeEventOnTargets("focusin",this.show,!0),this.removeEventOnTargets("focusout",this.hide,!0)),document.removeEventListener("click",this.handleDocumentClick,!0)},n.updateTarget=function(){var e=Object(b.i)(this.props.target,!0);e!==this._targets&&(this.removeTargetEvents(),this._targets=e?Array.from(e):[],this.currentTargetElement=this.currentTargetElement||this._targets[0],this.addTargetEvents())},n.toggle=function(e){return this.props.disabled||!this._isMounted?e&&e.preventDefault():this.props.toggle(e)},n.render=function(){if(!this.props.isOpen)return null;this.updateTarget();var e=this.props,t=e.className,n=e.cssModule,r=e.innerClassName,o=e.isOpen,s=e.hideArrow,l=e.boundariesElement,u=e.placement,c=e.placementPrefix,d=e.arrowClassName,h=e.popperClassName,f=e.container,m=e.modifiers,p=e.offset,g=e.fade,y=e.flip,v=Object(b.l)(this.props,Object.keys(C)),_=Object(b.k)(h,n),w=Object(b.k)(r,n);return i.a.createElement(j,{className:t,target:this.currentTargetElement||this._targets[0],isOpen:o,hideArrow:s,boundariesElement:l,placement:u,placementPrefix:c,arrowClassName:d,popperClassName:_,container:f,modifiers:m,offset:p,cssModule:n,fade:g,flip:y},i.a.createElement("div",Object(a.a)({},v,{ref:this.getRef,className:w,role:"tooltip",onMouseOver:this.onMouseOverTooltipContent,onMouseLeave:this.onMouseLeaveTooltipContent,onKeyDown:this.onEscKeyDown})))},t}(i.a.Component);M.propTypes=C,M.defaultProps=O;var x=M,R=function(e){var t=l()("popover","show",e.popperClassName),n=l()("popover-inner",e.innerClassName);return i.a.createElement(x,Object(a.a)({},e,{popperClassName:t,innerClassName:n}))};R.propTypes=C,R.defaultProps={placement:"right",placementPrefix:"bs-popover",trigger:"click"};var L=R,A={tag:b.o,className:h.a.string,cssModule:h.a.object},D=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-header"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};D.propTypes=A,D.defaultProps={tag:"h3"};var N=D,P={tag:b.o,className:h.a.string,cssModule:h.a.object},I=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(f.a)(e,["className","cssModule","tag"]),s=Object(b.k)(l()(t,"popover-body"),n);return i.a.createElement(r,Object(a.a)({},o,{className:s}))};I.propTypes=P,I.defaultProps={tag:"div"};var H=I;class Y extends o.Component{constructor(e){super(e),this.body=Object(r.a)((e,t)=>!1===t?null:"function"==typeof e?e():e),this.state={id:"popWrapper_"+Math.random().toString(36).substr(2),isOpen:!1},this.hoverOpen=this.hoverOpen.bind(this),this.hoverClose=this.hoverClose.bind(this),this.handleClick=this.handleClick.bind(this),this.open=this.open.bind(this),this.close=this.close.bind(this)}componentWillUnmount(){this.close()}open(){this.setState({isOpen:!0}),document.addEventListener("click",this.close)}close(e){if(e){const{target:t}=e;if(t instanceof Element&&null!==t.closest(".popover__inside"))return}this.setState({isOpen:!1}),document.removeEventListener("click",this.close)}hoverOpen(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.open()}hoverClose(){const{trigger:e}=this.props;("hover"===e||Array.isArray(e)&&e.includes("hover"))&&this.close()}handleClick(e){const{trigger:t,onClick:n}=this.props;if(n&&n(e),"click"===t||Array.isArray(t)&&t.includes("click")){const{isOpen:e}=this.state;e?this.close():this.open()}}render(){const{id:e,isOpen:t}=this.state,{title:n,className:r=""}=this.props,i=this.body(this.props.body,t);return o.createElement(o.Fragment,null,o.createElement("div",{onMouseEnter:this.hoverOpen,onMouseLeave:this.hoverClose,onFocus:this.hoverOpen,onBlur:this.hoverClose,onClick:this.handleClick,id:e,className:`popover__outside ${r}`},o.Children.only(this.props.children),o.createElement(L,{target:`#${e}`,isOpen:t,className:`popover__inside ${r}`},o.createElement(N,null,n),o.createElement(H,null,i))))}}},"./src/calc2/components/raTree.scss":function(e,t,n){},"./src/calc2/components/result.scss":function(e,t,n){},"./src/calc2/components/toolbar.scss":function(e,t,n){},"./src/calc2/components/toolbar.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n("./src/calc2/components/dropdownList.tsx"),o=n("./src/calc2/components/popover.tsx"),i=n("./src/calc2/i18n.tsx"),a=n("./node_modules/react/index.js");n("./src/calc2/components/toolbar.scss");class s extends a.Component{render(){const{groups:e}=this.props;return a.createElement("div",{className:"toolbar codemirror-toolbar"},e.map((e,t)=>e.items.map((e,t)=>a.createElement(o.a,{key:t,trigger:["hover","focus"],placement:"dropdown"===e.type?"top":"bottom",title:e.tooltipTitle?String(Object(i.d)(e.tooltipTitle)):"",body:a.createElement(i.b,{id:e.tooltip,html:!0}),className:("dropdown"===e.type?"toolbar__popover__dropdown":"toolbar__popover")+" "+(void 0===e.className?"":e.className)},"dropdown"===e.type?a.createElement(r.a,{label:e.label,elements:e.elements,onChange:e.onChange,value:e.value}):a.createElement("span",{onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onClick(e)}},e.label)))))}}},"./src/calc2/data/uibk.txt":function(e,t,n){"use strict";n.r(t),t.default="group: UIBK - R, S, T\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \ncategory@de:Universität Innsbruck\ncategory@en:University of Innsbruck\n\nR = {\na, b, c\n\n1, 'a', 'd'\n3, 'c', 'c'\n4, 'd', 'f'\n5, 'd', 'b'\n6, 'e', 'f'\n}\n\nS = {\nb, d\n\n'a', 100\n'b', 300\n'c', 400\n'd', 200\n'e', 150\n}\n\nT = {\nb, d\n\n'a', 100\n'd', 200\n'f', 400\n'g', 120\n}\n\ngroup: Kemper Datenbanksysteme\ndescription: Source: [Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage](http://www3.in.tum.de/teaching/bookDBMSeinf/), Seite 84, Abbildung 3.8\n\nProfessoren = {\nPersNr:number\tName:string\tRang:string\tRaum:number\n2125\tSokrates\tC4\t226\n2126\tRussel\tC4\t232\n2127\tKopernikus\tC3\t310\n2133\tPopper\tC3\t52\n2134\tAugustinus\tC3\t309\n2136\tCurie\tC4\t36\n2137\tKant\tC4\t7\n}\n\nStudenten = {\nMatrNr:number\tName:string\tSemester:number\n24002\tXenokrates\t18\n25403\tJonas\t12\n26120\tFichte\t10\n26830\tAristoxenos\t8\n27550\tSchopenhauer\t6\n28106\tCarnap\t3\n29120\tTheophrastos\t2\n29555\tFeuerbach\t2\n}\n\n\nVorlesungen = {\nVorlNr:number\tTitel:string\tSWS:number\tgelesenVon:number\n5001\tGrundzuege\t4\t2137\n5041\tEthik\t4\t2125\n5043\tErkenntnistheorie\t3\t2126\n5049\tMaeeutik\t2\t2125\n4052\tLogik\t4\t2125\n5052\tWissenschaftstheorie\t3\t2126\n5216\tBioethik\t2\t2126\n5259\t'Der Wiener Kreis'\t2\t2133\n5022\t'Glaube und wissen'\t2\t2134\n4630\t'Glaube und wissen'\t4\t2137\n}\n\nvoraussetzen = {\nVorgaenger:number\tNachfolger:number\n5001\t5041\n5001\t5043\n5001\t5049\n5041\t5216\n5043\t5052\n5041\t5052\n5052\t5259\n}\n\nhoeren = {\nMatrNr:number\tVorlNr:number\n26120\t5001\n27550\t5001\n27550\t4052\n28106\t5041\n28106\t5052\n28106\t5216\n28106\t5259\n29120\t5001\n29120\t5041\n29120\t5049\n29555\t5022\n25403\t5022\n29555\t5001\n}\n\nAssistenten = {\nPersNr:number\tName:string\tFachgebiet:string\tBoss:number\n3002\tPlaton\tIdeenlehre\t2125\n3003\tAristoteles\tSyllogistik\t2125\n3004\tWittgenstein\tSprachtheorie\t2126\n3005\tRhetikus\tPlanetenbewegung\t2127\n3006\tNewton\t'Keplersche Gesetze'\t2127\n3007\tSpinoza\t'Gott und Natur'\t2134\n}\n\npruefen = {\nMatrNr:number\tVorlNr:number\tPersNr:number\tNote:number\n28106\t5001\t2126\t1\n25403\t5041\t2125\t2\n27550\t4630\t2137\t2\n}\n\n\n\ngroup: UIBK - KursDB\ndescription: Tables from and for the lecture [Databases: Foundations, Data Models and System Concepts - University of Innsbruck](http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html) chapter 3 \n\nKurs = {\nKursNr, Titel\n\nG08, 'Grundlagen I'\nG10, 'Grundlagen II'\nP13, 'C-Programmierung'\nI09, Datenbanken\n}\n\nKursleiter = {\nPersNr, Name, Gehalt\n\n27183, 'Meier, I.', 4300.50\n29594, 'Schulze, H.', 3890.20\n38197, 'Huber, L.', 4200.10\n43325, 'Müller, K.', 3400.80\n}\n\nVorauss = {\nVorNr, KursNr\nG08, P13\nG10, P13\nG08, I09\nG10, I09\nP13, I09\n}\n\nFuehrt_durch = {\nAngNr\tKursNr\tPersNr\n1\tG08\t38197\n2\tG08\t38197\n1\tG10\t43325\n2\tG10\t29594\n1\tP13\t27183\n2\tP13\t27183\n1\tI09\t29594\n2\tI09\t29594\n3\tI09\t29594\n}\n\nTeilnehmer = {\nTnNr, Name, Ort \n143, 'Schmidt, M.', Bremen \n145, 'Huber, Chr.', Augsburg \n146, 'Abele, I.', Senden \n149, 'Kircher, B.', Bochum \n155, 'Meier, W.', Stuttgart \n171, 'Möller, H.', Innsbruck \n173, 'Schulze, B.', Stuttgart \n177, 'Mons, F.', Essen \n185, 'Meier, K.', Heidelberg \n187, 'Karstens, L.', Hamburg \n194, 'Gerstner, M.', Innsbruck \n}\n\nNimmt_teil = {\nAngNr\tKursNr\tTnNr\n2\tG08\t143\n2\tP13\t143\n1\tG08\t145\n1\tP13\t146\n1\tI09\t146\n2\tP13\t149\n1\tI09\t155\n1\tI09\t171\n1\tI09\t173\n2\tP13\t177\n1\tI09\t185\n2\tI09\t187\n1\tP13\t194\n}\n\nAngebot = {\nAngNr\tKursNr\tDatum\tOrt\n1\tG08\t2000-10-13\t'München'\n2\tG08\t2000-11-24\tBremen\n1\tG10\t2000-12-01\t'München'\n2\tG10\t2001-02-15\tHamburg\n1\tP13\t2001-05-28\tInnsbruck\n2\tP13\t2001-07-01\tEssen\n1\tI09\t2001-03-27\tStuttgart\n2\tI09\t2001-04-23\tHamburg\n3\tI09\t2001-05-29\t'München'\n}\n\n\n\ngroup:Database Systems The Complete Book - Exercise 2.4.1\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 52-55 ]]\n\nProduct = {\nmaker\tmodel\ttype\nA\t1001\tpc\nA\t1002\tpc\nA\t1003\tpc\nA\t2004\tlaptop\nA\t2005\tlaptop\nA\t2006\tlaptop\nB\t1004\tpc\nB\t1005\tpc\nB\t1006\tpc\nB\t2007\tlaptop\nC\t1007\tpc\nD\t1008\tpc\nD\t1009\tpc\nD\t1010\tpc\nD\t3004\tprinter\nD\t3005\tprinter\nE\t1011\tpc\nE\t1012\tpc\nE\t1013\tpc\nE\t2001\tlaptop\nE\t2002\tlaptop\nE\t2003\tlaptop\nE\t3001\tprinter\nE\t3002\tprinter\nE\t3003\tprinter\nF\t2008\tlaptop\nF\t2009\tlaptop\nG\t2010\tlaptop\nH\t3006\tprinter\nH\t3007\tprinter\n}\n\nPC = {\nmodel\tspeed\tram\thd\tprice\n1001\t2.66\t1024\t250\t2114\n1002\t2.1\t512\t250\t995\n1003\t1.42\t512\t80\t478\n1004\t2.8\t1024\t250\t649\n1005\t3.2\t512\t250\t630\n1006\t3.2\t1024\t320\t1049\n1007\t2.2\t1024\t200\t510\n1008\t2.2\t2048\t250\t770\n1009\t2\t1024\t250\t650\n1010\t2.8\t2048\t300\t770\n1011\t1.86\t2048\t160\t959\n1012\t2.8\t1024\t160\t649\n1013\t3.06\t512\t80\t529\n}\n\nLaptop = {\nmodel\tspeed\tram\thd\tscreen\tprice\n2001\t2\t2048\t240\t20.1\t3673\n2002\t1.73\t1024\t80\t17\t949\n2003\t1.8\t512\t60\t15.4\t549\n2004\t2\t512\t60\t13.3\t1150\n2005\t2.16\t1024\t120\t17\t2500\n2006\t2\t2048\t80\t15.4\t1700\n2007\t1.83\t1024\t120\t13.3\t1429\n2008\t1.6\t1024\t100\t15.4\t900\n2009\t1.6\t512\t80\t14.1\t680\n2010\t2\t2048\t160\t15.4\t2300\n}\n\nPrinter = {\nmodel\tcolor\ttype\tprice\n3001\ttrue\tink-jet\t99\n3002\tfalse\tlaser\t239\n3003\ttrue\tlaser\t899\n3004\ttrue\tink-jet\t120\n3005\tfalse\tlaser\t120\n3006\ttrue\tink-jet\t100\n3007\ttrue\tlaser\t200\n}\n\ngroup:Database Systems The Complete Book - Exercise 2.4.3\ndescription[[ Sample Data from [Database Systems The Complete Book 2nd Edition](http://infolab.stanford.edu/~ullman/dscb.html) Exercise 2.4.1 Page 55-57 ]]\n\nClasses = {\nclass\ttype\tcountry\tnumGuns\tbore\tdisplacement\nBismarck\tbb\tGermany\t8\t15\t42000\nIowa\tbb\tUSA\t9\t16\t46000\nKongo\tbc\tJapan\t8\t14\t32000\n'North Carolina'\tbb\tUSA\t9\t16\t37000\nRenown\tbc\t'Gt. Britan'\t6\t15\t23000\nRevenge\tbb\t'Gt. Britan'\t8\t15\t29000\nTennessee\tbb\tUSA\t12\t14\t32000\nYamato\tbb\tJapan\t9\t18\t65000\n}\n\nBattles = {\nname\tdate\n'Denmark Strait'\t1941-05-24\nGuadalcanal\t1942-11-15\n'North Cape'\t1943-12-26\n'Surigao Strait'\t1944-10-25\n}\n\nOutcomes = {\nship\tbattle\tresult\nArizona\t'Pearl Harbor'\tsunk\nBismarck\t'Denmark Strait'\tsunk\nCalifornia\t'Surigao Strait'\tok\n'Duke of York'\t'North Cape'\tok\nFuso\t'Surigao Strait'\tsunk\nHood\t'Denmark Strait'\tsunk\n'King George V'\t'Denmark Strait'\tok\nKirishima\tGuadalcanal\tsunk\n'Prince of Wales'\t'Denmark Strait'\tdamaged\nRodney\t'Denmark Strait'\tok\nScharnhorst\t'North Cape'\tsunk\n'South Dakota'\tGuadalcanal\tdamaged\nTennessee\t'Surigao Strait'\tok\nWashington\tGuadalcanal\tok\n'West Virginia'\t'Surigao Strait'\tok\nYamashiro\t'Surigao Strait'\tsunk\n}\n\nShips = {\nname\tclass\tlaunched\nCalifornia\tTennessee\t1921\nHaruna\tKongo\t1915\nHiei\tKongo\t1914\nIowa\tIowa\t1943\nKirishima\tKongo\t1915\nKongo\tKongo\t1913\nMissouri\tIowa\t1944\nMusashi\tYamato\t1942\n'New Jersey'\tIowa\t1943\n'North Carolina'\t'North Carolina'\t1941\nRamillies\tRevenge\t1917\nRenown\tRenown\t1916\nRepulse\tRenown\t1916\nResolution\tRevenge\t1916\nRevenge\tRevenge\t1916\n'Royal Oak'\tRevenge\t1916\n'Royal Sovereign'\tRevenge\t1916\nTennessee\tTennessee\t1920\nWashington\t'North Carolina'\t1941\nWisconsin\tIowa\t1944\nYamato\tYamato\t1941\n}\n\n\ngroup:Wikipedia - Relational algebra (en)\ndescription[[This are the tables from [Relational algebra - Wikipedia The Free Encyclopedia](http://en.wikipedia.org/wiki/Relational_algebra)\n\nlicense: [CC BY-SA](http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License)]]\n\nEmployee = {\n\tName:string, EmpId:number, DeptName:string\n\t'Harry' , 3415 , 'Finance' \n\t'Sally' , 2241 , 'Sales' \n\t'George' , 3401 , 'Finance' \n\t'Harriet' , 2202 , 'Sales' \n\t'Tim' , 1123 , 'Executive' \n}\n\nDept = {\n\tDeptName:string, Manager:string\n\t'Sales' , 'Harriet' \n\t'Production' , 'Charles' \n}\n\nCompleted = {\n\tStudent:string, Task:string\n\t'Fred' , 'Database1'\n\t'Fred' , 'Database2'\n\t'Fred' , 'Compiler1'\n\t'Eugene' , 'Database1'\n\t'Eugene' , 'Compiler1'\n\t'Sarah' , 'Database1'\n\t'Sarah' , 'Database2'\n}\n\nDBProject = {\n\tTask:string\n\t'Database1'\n\t'Database2'\n}\n\nCar = {\n\tCarModel:string, CarPrice:number\n\t'CarA' , 20000 \n\t'CarB' , 30000 \n\t'CarC' , 50000 \n}\n\nBoat = {\n\tBoatModel:string, BoatPrice:number\n\t'Boat1' , 10000 \n\t'Boat2' , 40000 \n\t'Boat3' , 60000 \n}"},"./src/calc2/i18n.tsx":function(e,t,n){"use strict";n.d(t,"c",(function(){return d})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return g}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./node_modules/i18next-browser-languagedetector/index.js"),i=n("./node_modules/react/index.js"),a=n("./src/locales/de.json"),s=n("./src/locales/en.json"),l=n("./src/locales/es.json"),u=n("./src/locales/kr.json"),c=n("./src/locales/pt.json");const d=r.b(o).init({resources:{en:{translations:s},de:{translations:a},es:{translations:l},kr:{translations:u},pt:{translations:c}},fallbackLng:"en",nsSeparator:":",keySeparator:!1,defaultNS:"translations",debug:!0});function h(e,t){return String(d.t(e,t))}const{Provider:f,Consumer:m}=i.createContext(d),p=e=>i.createElement(f,{value:d},e.children),g=({id:e,html:t=!1})=>i.createElement(m,null,n=>t?i.createElement("span",{dangerouslySetInnerHTML:{__html:String(n.t(e,{interpolation:{escapeValue:!1}}))}}):i.createElement("span",null,String(n.t(e))))},"./src/calc2/main.hot.tsx":function(e,t,n){"use strict";(function(e){var r=n("./src/calc2/main.tsx"),o=n("./node_modules/react-hot-loader/index.js");t.a=Object(o.hot)(e)(r.a)}).call(this,n("./node_modules/webpack/buildin/harmony-module.js")(e))},"./src/calc2/main.tsx":function(e,t,n){"use strict";n.d(t,"a",(function(){return Gn}));n("./node_modules/bootstrap/dist/css/bootstrap.css");var r=n("./src/calc2/i18n.tsx"),o=n("./node_modules/react/index.js"),i=n.n(o),a=n("./node_modules/prop-types/index.js"),s=n.n(a),l=i.a.createContext(null);var u=function(e){e()},c={notify:function(){}};function d(){var e=u,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var h=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=d())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();var f=function(e){var t=e.store,n=e.context,r=e.children,a=Object(o.useMemo)((function(){var e=new h(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),s=Object(o.useMemo)((function(){return t.getState()}),[t]);Object(o.useEffect)((function(){var e=a.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[a,s]);var u=n||l;return i.a.createElement(u.Provider,{value:a},r)},m=n("./node_modules/@babel/runtime/helpers/esm/extends.js"),p=n("./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js"),g=n("./node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js"),y=n.n(g),b=n("./node_modules/react-is/index.js"),v="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?o.useLayoutEffect:o.useEffect,_=[],w=[null,null];function E(e,t){var n=e[1];return[t.payload,n+1]}function j(e,t,n){v((function(){return e.apply(void 0,t)}),n)}function C(e,t,n,r,o,i,a){e.current=r,t.current=o,n.current=!1,i.current&&(i.current=null,a())}function S(e,t,n,r,o,i,a,s,l,u){if(e){var c=!1,d=null,h=function(){if(!c){var e,n,h=t.getState();try{e=r(h,o.current)}catch(e){n=e,d=e}n||(d=null),e===i.current?a.current||l():(i.current=e,s.current=e,a.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=h,n.trySubscribe(),h();return function(){if(c=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var O=function(){return[null,0]};function k(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,a=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,s=n.methodName,u=void 0===s?"connectAdvanced":s,c=n.renderCountProp,d=void 0===c?void 0:c,f=n.shouldHandleStateChanges,g=void 0===f||f,v=n.storeKey,k=void 0===v?"store":v,T=(n.withRef,n.forwardRef),M=void 0!==T&&T,x=n.context,R=void 0===x?l:x,L=Object(p.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),A=R;return function(t){var n=t.displayName||t.name||"Component",r=a(n),s=Object(m.a)({},L,{getDisplayName:a,methodName:u,renderCountProp:d,shouldHandleStateChanges:g,storeKey:k,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=L.pure;var c=l?o.useMemo:function(e){return e()};function f(n){var r=Object(o.useMemo)((function(){var e=n.forwardedRef,t=Object(p.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),a=r[0],l=r[1],u=r[2],d=Object(o.useMemo)((function(){return a&&a.Consumer&&Object(b.isContextConsumer)(i.a.createElement(a.Consumer,null))?a:A}),[a,A]),f=Object(o.useContext)(d),y=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var v=y?n.store:f.store,k=Object(o.useMemo)((function(){return function(t){return e(t.dispatch,s)}(v)}),[v]),T=Object(o.useMemo)((function(){if(!g)return w;var e=new h(v,y?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[v,y,f]),M=T[0],x=T[1],R=Object(o.useMemo)((function(){return y?f:Object(m.a)({},f,{subscription:M})}),[y,f,M]),L=Object(o.useReducer)(E,_,O),D=L[0][0],N=L[1];if(D&&D.error)throw D.error;var P=Object(o.useRef)(),I=Object(o.useRef)(u),H=Object(o.useRef)(),Y=Object(o.useRef)(!1),F=c((function(){return H.current&&u===I.current?H.current:k(v.getState(),u)}),[v,D,u]);j(C,[I,P,Y,u,F,H,x]),j(S,[g,v,M,k,I,P,Y,H,x,N],[v,M,k]);var W=Object(o.useMemo)((function(){return i.a.createElement(t,Object(m.a)({},F,{ref:l}))}),[l,t,F]);return Object(o.useMemo)((function(){return g?i.a.createElement(d.Provider,{value:R},W):W}),[d,W,R])}var v=l?i.a.memo(f):f;if(v.WrappedComponent=t,v.displayName=r,M){var T=i.a.forwardRef((function(e,t){return i.a.createElement(v,Object(m.a)({},e,{forwardedRef:t}))}));return T.displayName=r,T.WrappedComponent=t,y()(T,t)}return y()(v,t)}}function T(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function M(e,t){if(T(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function B(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?k:n,o=t.mapStateToPropsFactories,i=void 0===o?N:o,a=t.mapDispatchToPropsFactories,s=void 0===a?D:a,l=t.mergePropsFactories,u=void 0===l?I:l,c=t.selectorFactory,d=void 0===c?F:c;return function(e,t,n,o){void 0===o&&(o={});var a=o,l=a.pure,c=void 0===l||l,h=a.areStatesEqual,f=void 0===h?B:h,g=a.areOwnPropsEqual,y=void 0===g?M:g,b=a.areStatePropsEqual,v=void 0===b?M:b,_=a.areMergedPropsEqual,w=void 0===_?M:_,E=Object(p.a)(a,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),j=W(e,i,"mapStateToProps"),C=W(t,s,"mapDispatchToProps"),S=W(n,u,"mergeProps");return r(d,Object(m.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:j,initMapDispatchToProps:C,initMergeProps:S,pure:c,areStatesEqual:f,areOwnPropsEqual:y,areStatePropsEqual:v,areMergedPropsEqual:w},E))}}var z=U();var V,q=n("./node_modules/react-dom/index.js");V=q.unstable_batchedUpdates,u=V;var G=n("./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js");function K(e){return"/"===e.charAt(0)}function X(e,t){for(var n=t,r=n+1,o=e.length;r=0;c--){var d=o[c];"."===d?X(o,c):".."===d?(X(o,c),u++):u&&(X(o,c),u--)}if(!s)for(;u--;u)o.unshift("..");!s||""===o[0]||o[0]&&K(o[0])||o.unshift("");var h=o.join("/");return n&&"/"!==h.substr(-1)&&(h+="/"),h};function J(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var Q=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=J(t),o=J(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1};var Z=function(e,t){if(!e)throw new Error("Invariant failed")};function ee(e){return"/"===e.charAt(0)?e:"/"+e}function te(e){return"/"===e.charAt(0)?e.substr(1):e}function ne(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function re(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function oe(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function ie(e,t,n,r){var o;"string"==typeof e?(o=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var i=t.indexOf("?");return-1!==i&&(n=t.substr(i),t=t.substr(0,i)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(o=Object(m.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==t&&void 0===o.state&&(o.state=t));try{o.pathname=decodeURI(o.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(o.key=n),r?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=$(o.pathname,r.pathname)):o.pathname=r.pathname:o.pathname||(o.pathname="/"),o}function ae(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var i="function"==typeof e?e(t,n):e;"string"==typeof i?"function"==typeof r?r(i,o):o(!0):o(!1!==i)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,r):n.push(r),c({action:"PUSH",location:r,index:t,entries:n})}}))},replace:function(e,t){var r=ie(e,t,d(),y.location);u.confirmTransitionTo(r,"REPLACE",n,(function(e){e&&(y.entries[y.index]=r,c({action:"REPLACE",location:r}))}))},go:g,goBack:function(){g(-1)},goForward:function(){g(1)},canGo:function(e){var t=y.index+e;return t>=0&&t=0&&t<=r),active:e===t},o.createElement(ct,{onClick:()=>this.setPage(t)},t+1)));return o.createElement("ul",{className:"pagination"},o.createElement(st,{disabled:0===e},o.createElement(ct,{previous:!0,onClick:()=>this.setPage(e-1)})),i,o.createElement(st,{disabled:e+1>=r},o.createElement(ct,{next:!0,onClick:()=>this.setPage(e+1)})))}}var ht=n("./src/db/exec/ValueExpr.ts");n("./src/calc2/components/pagedTable.scss");class ft extends o.Component{constructor(e){super(e),this.state={page:0}}render(){const{table:e,maxLinesPerPage:t,showPagination:n=!0,className:r=""}=this.props,{page:i}=this.state,a=e.getSchema();return o.createElement("div",{className:"result-table pagedTable"},o.createElement("table",{className:r},o.createElement("thead",null,o.createElement("tr",null,a.getColumns().map((e,t)=>o.createElement("th",{key:t},e.toString())))),o.createElement("tbody",null,e.getRows(i*t,t).map((e,t)=>o.createElement("tr",{key:`row ${t}`},e.map((e,t)=>{const n=a.getType(t);return o.createElement("td",{key:`value ${t}`,className:`${n} ${null===e?"null":""}`},Object(ht.d)(e,n))}))))),n?o.createElement("div",{className:"pagination"},o.createElement(dt,{total:e.getNumRows(),maxLinesPerPage:t,pageChanged:e=>this.setState({page:e}),currentPage:i})):null)}}var mt=n("./src/calc2/components/popover.tsx"),pt=n("./src/db/exec/RANode.ts");n("./src/calc2/components/raTree.scss");class gt extends o.Component{constructor(e){super(e)}render(){const{root:e,numTreeLabelColors:t=0,activeNode:n,setActiveNode:r}=this.props;let i=0;const a=new Map,s=e=>{const l=e instanceof pt.c||e instanceof pt.a?s(e.getChild()):null,u=e instanceof pt.a?s(e.getChild2()):null;let c="";if(e.hasMetaData("fromVariable")){const n=e.getMetaData("fromVariable");!1===a.has(n)&&a.set(n,i++);const r=a.get(n)%t;c=o.createElement("span",null," ",o.createElement("span",{className:`label label-info label-info-${r}`},n," =")," ")}return o.createElement("li",null,o.createElement("div",{className:nt({node:!0,active:e===n}),onClick:()=>r&&r(e)},o.createElement(mt.a,{title:o.createElement("div",null,c,o.createElement("div",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!0,!1)}})),body:()=>{e.check(),e.getResult();const t=e.getSchema(),n=e.getResultNumRows();return o.createElement("div",null,"columns:",o.createElement("ul",null,t.getColumns().map((e,n)=>o.createElement("li",{key:n},e.toString()," ",o.createElement("small",{className:"muted text-muted"},t.getType(n))))),e.hasMetaData("naturalJoinConditions")?o.createElement("div",null,"natural join conditions:",o.createElement("ul",null,e.getMetaData("naturalJoinConditions").map(e=>o.createElement("li",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml()}})))):null,o.createElement("p",null,`${n} row${1===n?"":"s"}`),!0===e.getMetaData("isInlineRelation")&&e.hasMetaData("inlineRelationDefinition")?o.createElement("pre",null,e.getMetaData("inlineRelationDefinition")):null)},placement:"right",trigger:"hover"},o.createElement("a",{className:"formula"},c,o.createElement("span",{dangerouslySetInnerHTML:{__html:e.getFormulaHtml(!1,!1)}}),o.createElement("br",null),o.createElement("span",{className:"resultCountLabel"},`${e.getResultNumRows()} row${1===e.getResultNumRows()?"":"s"}`)))),l||u?o.createElement("ul",null,l,u):null)};return o.createElement("div",{className:"ra-tree"},o.createElement("div",{className:"tree"},o.createElement("ul",null,s(e))))}}var yt=n("./node_modules/memoize-one/dist/memoize-one.esm.js");n("./src/calc2/components/result.scss");class bt extends o.Component{constructor(e){super(e),this.result=Object(yt.a)(e=>{try{return e.check(),e.getResult()}catch(e){return console.error(e),null}}),this.state={activeNode:e.root,result:null},this.setActiveNode=this.setActiveNode.bind(this)}setActiveNode(e){this.setState({activeNode:e})}render(){const{root:e,numTreeLabelColors:t}=this.props,{activeNode:n}=this.state,r=this.result(n);return o.createElement("div",{className:"ra-result clearfix"},o.createElement("div",null,o.createElement(gt,{root:e,activeNode:n,numTreeLabelColors:t,setActiveNode:this.setActiveNode})),o.createElement("div",{className:"result"},o.createElement("div",null,o.createElement("h4",{className:"result-formula",dangerouslySetInnerHTML:{__html:n.getFormulaHtml(!0,!1)}}),o.createElement("div",{className:"result-table"},r?o.createElement(ft,{className:"table table-condensed",maxLinesPerPage:10,table:r,showPagination:!0}):null))))}}var vt=n("./src/db/relalg.ts");const _t=["pi","sigma","rho","tau","<-","intersect","union","/","-","\\","x","cross join","join","inner join","natural join","left join","right join","left outer join","right outer join","full outer join","left semi join","right semi join","anti join","and","or","xor","||"];class wt extends o.Component{constructor(e){super(e),this.editorBase=null,this.state={autoreplaceOperatorsMode:"none"},this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,{autoreplaceOperatorsMode:t}=this.state,n={};return e.tables.forEach(e=>{n[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",execFunction:(e,t,i)=>{const a=Object(vt.b)(t,Object.keys(n));if(Object(vt.j)(a,n),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.h)(a,n);return s.check(),e.historyAddEntry(t),e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(a),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"relalg",linterFunction:(e,o,i)=>{const a=[],s=Object(vt.b)(i,Object.keys(n));Object(vt.j)(s,n);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const l=Object(vt.h)(s,n);if(l.check(),!1===o.getDoc().somethingSelected()){const e=o.getDoc().getCursor(),{query:n,cursor:r}=Object(vt.f)(i,s.operatorPositions,{line:e.line+1,column:e.ch+1},t);n!==i&&(o.setValue(n),o.getDoc().setCursor({line:r.line-1,ch:r.column-1}))}return e.props.enableInlineRelationEditor&&e.addInlineRelationMarkers(s),a.concat(Object(tt.b)(l))},getHintsFunction:()=>[..._t,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!0,items:[{label:"π",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.projection",tooltip:"calc.editors.ra.toolbar.projection-content"},{label:"σ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.selection",tooltip:"calc.editors.ra.toolbar.selection-content"},{label:"ρ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename",tooltip:"calc.editors.ra.toolbar.rename-content"},{label:"←",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.rename-columns-operator",tooltip:"calc.editors.ra.toolbar.rename-columns-operator-content"},{label:"→",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-arrow",tooltip:"calc.editors.ra.toolbar.right-arrow"},{label:"τ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.orderBy",tooltip:"calc.editors.ra.toolbar.orderBy-content"},{label:"γ",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.groupBy",tooltip:"calc.editors.ra.toolbar.groupBy-content"}]},{math:!0,items:[{label:"∧",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.and",tooltip:"calc.editors.ra.toolbar.and-content"},{label:"∨",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.or",tooltip:"calc.editors.ra.toolbar.or-content"},{label:"¬",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not",tooltip:"calc.editors.ra.toolbar.not-content"},{label:"=",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.equals",tooltip:"calc.editors.ra.toolbar.equals-content"},{label:"≠",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.not-equals",tooltip:"calc.editors.ra.toolbar.not-equals-content"},{label:"≥",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.greater-or-equals",tooltip:"calc.editors.ra.toolbar.greater-or-equals-content"},{label:"≤",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.lesser-or-equals",tooltip:"calc.editors.ra.toolbar.lesser-or-equals-content"}]},{math:!0,items:[{label:"∩",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.intersect",tooltip:"calc.editors.ra.toolbar.intersect-content"},{label:"∪",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.union",tooltip:"calc.editors.ra.toolbar.union-content"},{label:"÷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.division",tooltip:"calc.editors.ra.toolbar.division-content"},{label:"-",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.subtraction",tooltip:"calc.editors.ra.toolbar.subtraction-content"}]},{math:!0,items:[{label:"⨯",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.cross-join",tooltip:"calc.editors.ra.toolbar.cross-join-content"},{label:"⨝",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.natural-join",tooltip:"calc.editors.ra.toolbar.natural-join-content"},{label:"⟕",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-outer-join",tooltip:"calc.editors.ra.toolbar.left-outer-join-content"},{label:"⟖",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-outer-join",tooltip:"calc.editors.ra.toolbar.right-outer-join-content"},{label:"⟗",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.full-outer-join",tooltip:"calc.editors.ra.toolbar.full-outer-join-content"},{label:"⋉",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.left-semi-join",tooltip:"calc.editors.ra.toolbar.left-semi-join-content"},{label:"⋊",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.right-semi-join",tooltip:"calc.editors.ra.toolbar.right-semi-join-content"},{label:"▷",onClick:this.replaceText,tooltipTitle:"calc.editors.ra.toolbar.anti-join",tooltip:"calc.editors.ra.toolbar.anti-join-content"}]},{math:!0,items:[{label:"=",onClick:e=>this.replaceText(e,"= "),tooltipTitle:"calc.editors.ra.toolbar.assignment",tooltip:"calc.editors.ra.toolbar.assignment-content"},{label:"--",onClick:e=>this.replaceText(e,"-- "),tooltipTitle:"calc.editors.ra.toolbar.single-line-comment",tooltip:"calc.editors.ra.toolbar.single-line-comment-content"},{label:"/*",onClick:e=>this.replaceText(e,"/* */"),tooltipTitle:"calc.editors.ra.toolbar.multi-line-comment",tooltip:"calc.editors.ra.toolbar.multi-line-comment-content"},{label:"{}",onClick:e=>this.replaceText(e,"{a:string, b:number, X.c:date\n\ta, 1, 1970-01-01\n}"),tooltipTitle:"calc.editors.ra.toolbar.inline-relation",tooltip:"calc.editors.ra.toolbar.inline-relation-content"}]},{items:[{label:o.createElement(et.a,{icon:Ze.q}),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.ra.toolbar.inline-relation-editor",tooltip:"calc.editors.ra.toolbar.inline-relation-editor-content"},{label:o.createElement(et.a,{icon:Ze.d}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.ra.toolbar.insert-date",tooltip:"calc.editors.ra.toolbar.insert-date-content"},{className:"showOnSM",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.m}),onClick:()=>{this.props.relInsertModalToggle()},tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{items:[{className:"dropdownToolbarButton",type:"dropdown",label:o.createElement(et.a,{className:"editorButtonOnSM",icon:Ze.l}),tooltipTitle:"calc.editors.ra.toolbar.autoreplace-operators.title",tooltip:"calc.editors.ra.toolbar.autoreplace-operators.header",elements:[{type:"header",label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.header"})},{type:"separator"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.none"}),value:"none"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.plain2math"}),value:"plain2math"},{label:o.createElement(r.b,{id:"calc.editors.ra.toolbar.autoreplace-operators.math2plain"}),value:"math2plain"}],value:t,onChange:e=>{this.setState({autoreplaceOperatorsMode:e},()=>{this.editorBase&&this.editorBase.forceLinterRun()})}}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}var Et=n("./src/calc2/utils/groupUtils.ts"),jt=n("./node_modules/reactstrap/lib/Button.js"),Ct=n.n(jt);class St extends o.Component{constructor(e){super(e),this.editorBase=null,this.autoParsingTimeout=null,this.replaceSelection=this.replaceSelection.bind(this)}static generateInfo(e){return{groupInfo:{source:"local",id:"draft",filename:"draft",index:0,maintainer:"",maintainerGroup:""},sourceInfo:{}}}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"relalg",disableHistory:!0,execButtonLabel:"calc.editors.group.button-exec",execFunction:(e,t,n)=>{const i=Object(vt.c)(t),{groupInfo:a,sourceInfo:s}=St.generateInfo(i),l=Object(Et.a)(i,a,s),u=o.createElement(o.Fragment,null,l.map((e,t)=>o.createElement("div",{key:t},o.createElement("h4",null,e.groupName.fallback," ",o.createElement(Ct.a,{color:"link",onClick:()=>{this.props.setDraft(e)}},o.createElement(r.b,{id:"calc.editors.group.button-use"}))),o.createElement("ul",{className:"table-list"},e.tables.map((e,n)=>{const r=l[t].tables[n].relation.getResult().getHtml();return o.createElement("li",{key:n},o.createElement("h5",null,e.tableName),o.createElement("div",{dangerouslySetInnerHTML:{__html:r}}))})))));return i.groups.forEach(t=>{e.addInlineRelationMarkers(t)}),{result:u}},tab:"group",linterFunction:(e,t,n)=>{const r=Object(vt.c)(n);r.groups.forEach(t=>{e.addInlineRelationMarkers(t)});const{groupInfo:o,sourceInfo:i}=St.generateInfo(r);return Object(Et.a)(r,o,i),[]},getHintsFunction:()=>[..._t,"group","group@de","group@en","group@es","description","description@de","description@en","description@es","category","category@de","category@en","category@es",...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:o.createElement("span",null,o.createElement(et.a,{icon:Ze.q})," ",o.createElement(r.b,{id:"calc.editors.group.toolbar.add-new-relation"})),onClick:()=>{this.editorBase&&this.editorBase.inlineRelationEditorOpen(null)},tooltipTitle:"calc.editors.group.toolbar.add-new-relation",tooltip:"calc.editors.group.toolbar.add-new-relation-content"}]}]})}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}const Ot=["distinct","select distinct","from","where","order by","asc","desc","inner join","inner","join","natural","union","intersect","outer join","natural join","left join","right join","left outer join","right outer join","full outer join","group by","having","limit","offset","and","or","xor","||"];class kt extends o.Component{constructor(e){super(e),this.editorBase=null,this.replaceText=this.replaceText.bind(this)}render(){const{group:e}=this.props,t={};return e.tables.forEach(e=>{t[e.tableName]=e.relation}),o.createElement(tt.a,{textChange:e=>{},ref:e=>{e&&(this.editorBase=e)},mode:"text/x-mysql",execFunction:(e,n,i)=>{const a=Object(vt.e)(n);if(Object(vt.j)(a,t),null===a.child)throw a.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),e.historyAddEntry(n),{result:o.createElement(bt,{root:s,numTreeLabelColors:6})}},tab:"sql",linterFunction:(e,n,o)=>{const i=[],a=Object(vt.e)(o);Object(vt.j)(a,t);for(let e=0;e0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const s=Object(vt.i)(a,t);return s.check(),i.concat(Object(tt.b)(s))},getHintsFunction:()=>[...Ot,...Object(tt.c)(e)],enableInlineRelationEditor:!0,toolbar:[{math:!1,items:[{label:"select",tooltipTitle:"calc.editors.sql.toolbar.select",tooltip:"calc.editors.sql.toolbar.select",onClick:e=>this.replaceText(e,"select distinct")},{label:"from",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.from",tooltip:"calc.editors.sql.toolbar.from"},{label:"where",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.where",tooltip:"calc.editors.sql.toolbar.where"},{label:"group",tooltipTitle:"calc.editors.sql.toolbar.group-by",tooltip:"calc.editors.sql.toolbar.group-by",onClick:e=>this.replaceText(e,"group by")},{label:"having",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.having",tooltip:"calc.editors.sql.toolbar.having"},{label:"order",tooltipTitle:"calc.editors.sql.toolbar.order-by",tooltip:"calc.editors.sql.toolbar.order-by",onClick:e=>this.replaceText(e,"order by")},{label:"limit",onClick:this.replaceText,tooltipTitle:"calc.editors.sql.toolbar.limit",tooltip:"calc.editors.sql.toolbar.limit"},{label:o.createElement(et.a,{className:"showOnSM",icon:Ze.i}),onClick:e=>this.props.relInsertModalToggle,tooltipTitle:"calc.editors.insert-relation-title",tooltip:"calc.editors.insert-relation-tooltip"}]},{math:!0,items:[{label:o.createElement("i",{className:"fa fa-calendar"}),onClick:e=>this.replaceText(e,"date('1970-01-01')"),tooltipTitle:"calc.editors.sql.toolbar.insert-date",tooltip:"calc.editors.sql.toolbar.insert-date-content"}]}]})}replaceText(e,t){this.editorBase&&this.editorBase.replaceText(e,t)}replaceSelection(e,t){this.editorBase&&this.editorBase.replaceSelection(e,t)}}function Tt(e,t){return e[t]?e[t]:e.fallback}var Mt=n("./node_modules/react-toastify/esm/react-toastify.js"),xt=(n("./node_modules/react-toastify/dist/ReactToastify.css"),{tabs:s.a.bool,pills:s.a.bool,vertical:s.a.oneOfType([s.a.bool,s.a.string]),horizontal:s.a.string,justified:s.a.bool,fill:s.a.bool,navbar:s.a.bool,card:s.a.bool,tag:ot.o,className:s.a.string,cssModule:s.a.object}),Rt=function(e){var t=e.className,n=e.cssModule,r=e.tabs,o=e.pills,a=e.vertical,s=e.horizontal,l=e.justified,u=e.fill,c=e.navbar,d=e.card,h=e.tag,f=Object(p.a)(e,["className","cssModule","tabs","pills","vertical","horizontal","justified","fill","navbar","card","tag"]),g=Object(ot.k)(rt()(t,c?"navbar-nav":"nav",!!s&&"justify-content-"+s,function(e){return!1!==e&&(!0===e||"xs"===e?"flex-column":"flex-"+e+"-column")}(a),{"nav-tabs":r,"card-header-tabs":d&&r,"nav-pills":o,"card-header-pills":d&&o,"nav-justified":l,"nav-fill":u}),n);return i.a.createElement(h,Object(m.a)({},f,{className:g}))};Rt.propTypes=xt,Rt.defaultProps={tag:"ul",vertical:!1};var Lt=Rt,At=n("./node_modules/@babel/runtime/helpers/esm/objectSpread.js"),Dt=n("./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js"),Nt=n("./node_modules/react-popper/lib/esm/Manager.js"),Pt=i.a.createContext({}),It={a11y:s.a.bool,disabled:s.a.bool,direction:s.a.oneOf(["up","down","left","right"]),group:s.a.bool,isOpen:s.a.bool,nav:s.a.bool,active:s.a.bool,addonType:s.a.oneOfType([s.a.bool,s.a.oneOf(["prepend","append"])]),size:s.a.string,tag:ot.o,toggle:s.a.func,children:s.a.node,className:s.a.string,cssModule:s.a.object,inNavbar:s.a.bool,setActiveFromChild:s.a.bool},Ht=[ot.j.space,ot.j.enter,ot.j.up,ot.j.down,ot.j.end,ot.j.home],Yt=function(e){function t(t){var n;return(n=e.call(this,t)||this).addEvents=n.addEvents.bind(Object(Dt.a)(n)),n.handleDocumentClick=n.handleDocumentClick.bind(Object(Dt.a)(n)),n.handleKeyDown=n.handleKeyDown.bind(Object(Dt.a)(n)),n.removeEvents=n.removeEvents.bind(Object(Dt.a)(n)),n.toggle=n.toggle.bind(Object(Dt.a)(n)),n.containerRef=i.a.createRef(),n}Object(G.a)(t,e);var n=t.prototype;return n.getContextValue=function(){return{toggle:this.toggle,isOpen:this.props.isOpen,direction:"down"===this.props.direction&&this.props.dropup?"up":this.props.direction,inNavbar:this.props.inNavbar,disabled:this.props.disabled}},n.componentDidMount=function(){this.handleProps()},n.componentDidUpdate=function(e){this.props.isOpen!==e.isOpen&&this.handleProps()},n.componentWillUnmount=function(){this.removeEvents()},n.getContainer=function(){return this.containerRef.current},n.getMenuCtrl=function(){return this._$menuCtrl||(this._$menuCtrl=this.getContainer().querySelector("[aria-expanded]")),this._$menuCtrl},n.getMenuItems=function(){return[].slice.call(this.getContainer().querySelectorAll('[role="menuitem"]'))},n.addEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.addEventListener(t,e.handleDocumentClick,!0)}))},n.removeEvents=function(){var e=this;["click","touchstart","keyup"].forEach((function(t){return document.removeEventListener(t,e.handleDocumentClick,!0)}))},n.handleDocumentClick=function(e){if(!e||3!==e.which&&("keyup"!==e.type||e.which===ot.j.tab)){var t=this.getContainer();(!t.contains(e.target)||t===e.target||"keyup"===e.type&&e.which!==ot.j.tab)&&this.toggle(e)}},n.handleKeyDown=function(e){var t=this;if(!/input|textarea/i.test(e.target.tagName)&&(ot.j.tab!==e.which||"menuitem"===e.target.getAttribute("role")&&this.props.a11y)&&((-1!==Ht.indexOf(e.which)||e.which>=48&&e.which<=90)&&e.preventDefault(),!this.props.disabled&&(this.getMenuCtrl()===e.target&&(!this.props.isOpen&&[ot.j.space,ot.j.enter,ot.j.up,ot.j.down].indexOf(e.which)>-1?(this.toggle(e),setTimeout((function(){return t.getMenuItems()[0].focus()}))):this.props.isOpen&&e.which===ot.j.esc&&this.toggle(e)),this.props.isOpen&&"menuitem"===e.target.getAttribute("role"))))if([ot.j.tab,ot.j.esc].indexOf(e.which)>-1)this.toggle(e),this.getMenuCtrl().focus();else if([ot.j.space,ot.j.enter].indexOf(e.which)>-1)e.target.click(),this.getMenuCtrl().focus();else if([ot.j.down,ot.j.up].indexOf(e.which)>-1||[ot.j.n,ot.j.p].indexOf(e.which)>-1&&e.ctrlKey){var n=this.getMenuItems(),r=n.indexOf(e.target);ot.j.up===e.which||ot.j.p===e.which&&e.ctrlKey?r=0!==r?r-1:n.length-1:(ot.j.down===e.which||ot.j.n===e.which&&e.ctrlKey)&&(r=r===n.length-1?0:r+1),n[r].focus()}else if(ot.j.end===e.which){var o=this.getMenuItems();o[o.length-1].focus()}else if(ot.j.home===e.which){this.getMenuItems()[0].focus()}else if(e.which>=48&&e.which<=90)for(var i=this.getMenuItems(),a=String.fromCharCode(e.which).toLowerCase(),s=0;s-1?"menuitem":void 0,n=Object(ot.l)(this.props,["toggle"]),r=n.className,o=n.cssModule,a=n.divider,s=n.tag,l=n.header,u=n.active,c=Object(p.a)(n,["className","cssModule","divider","tag","header","active"]),d=Object(ot.k)(rt()(r,{disabled:c.disabled,"dropdown-item":!a&&!l,active:u,"dropdown-header":l,"dropdown-divider":a}),o);return"button"===s&&(l?s="h6":a?s="div":c.href&&(s="a")),i.a.createElement(s,Object(m.a)({type:"button"===s&&(c.onClick||this.props.toggle)?"button":void 0},c,{tabIndex:e,role:t,className:d,onClick:this.onClick}))},t}(i.a.Component);tn.propTypes=en,tn.defaultProps={tag:"button",toggle:!0},tn.contextType=Pt;var nn=tn,rn={tag:ot.o,active:s.a.bool,className:s.a.string,cssModule:s.a.object},on=function(e){var t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=Object(p.a)(e,["className","cssModule","active","tag"]),s=Object(ot.k)(rt()(t,"nav-item",!!r&&"active"),n);return i.a.createElement(o,Object(m.a)({},a,{className:s}))};on.propTypes=rn,on.defaultProps={tag:"li"};var an=on,sn={tag:ot.o,innerRef:s.a.oneOfType([s.a.object,s.a.func,s.a.string]),disabled:s.a.bool,active:s.a.bool,className:s.a.string,cssModule:s.a.object,onClick:s.a.func,href:s.a.any},ln=function(e){function t(t){var n;return(n=e.call(this,t)||this).onClick=n.onClick.bind(Object(Dt.a)(n)),n}Object(G.a)(t,e);var n=t.prototype;return n.onClick=function(e){this.props.disabled?e.preventDefault():("#"===this.props.href&&e.preventDefault(),this.props.onClick&&this.props.onClick(e))},n.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.active,o=e.tag,a=e.innerRef,s=Object(p.a)(e,["className","cssModule","active","tag","innerRef"]),l=Object(ot.k)(rt()(t,"nav-link",{disabled:s.disabled,active:r}),n);return i.a.createElement(o,Object(m.a)({},s,{ref:a,onClick:this.onClick,className:l}))},t}(i.a.Component);ln.propTypes=sn,ln.defaultProps={tag:"a"};var un=ln,cn=n("./node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js"),dn=i.a.createContext({}),hn={tag:ot.o,activeTab:s.a.any,className:s.a.string,cssModule:s.a.object},fn=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={activeTab:n.props.activeTab},n}return Object(G.a)(t,e),t.getDerivedStateFromProps=function(e,t){return t.activeTab!==e.activeTab?{activeTab:e.activeTab}:null},t.prototype.render=function(){var e=this.props,t=e.className,n=e.cssModule,r=e.tag,o=Object(ot.l)(this.props,Object.keys(hn)),a=Object(ot.k)(rt()("tab-content",t),n);return i.a.createElement(dn.Provider,{value:{activeTabId:this.state.activeTab}},i.a.createElement(r,Object(m.a)({},o,{className:a})))},t}(o.Component);Object(cn.polyfill)(fn);var mn=fn;fn.propTypes=hn,fn.defaultProps={tag:"div"};var pn={tag:ot.o,className:s.a.string,cssModule:s.a.object,tabId:s.a.any};function gn(e){var t=e.className,n=e.cssModule,r=e.tabId,o=e.tag,a=Object(p.a)(e,["className","cssModule","tabId","tag"]),s=function(e){return Object(ot.k)(rt()("tab-pane",t,{active:r===e}),n)};return i.a.createElement(dn.Consumer,null,(function(e){var t=e.activeTabId;return i.a.createElement(o,Object(m.a)({},a,{className:s(t)}))}))}gn.propTypes=pn,gn.defaultProps={tag:"div"};var yn=n("./node_modules/reactstrap/es/Modal.js"),bn=n("./node_modules/reactstrap/es/ModalHeader.js"),vn=n("./node_modules/reactstrap/es/ModalBody.js"),_n=n("./node_modules/reactstrap/es/ModalFooter.js");n("./src/calc2/components/groupRelationList.scss");const wn=({tables:e,replace:t,onElementClick:n})=>o.createElement("div",{className:"groupRelationList"},o.createElement("ul",null,e.map(e=>{const{columnNames:r,columnTypes:i,tableName:a}=e;return o.createElement("li",{key:a},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(a),n&&n()}},a),o.createElement("ul",null,e.columnNames.map((e,r)=>o.createElement("li",{key:e},o.createElement("span",{className:"clickable",onClick:()=>{t&&t(e),n&&n()}},e," ",o.createElement("small",{className:"muted text-muted"},i[r]))," "))))})));var En=n("./node_modules/immutable/dist/immutable.es.js");class jn extends o.Component{constructor(e){super(e),this.getGroupsByHeadlineName=Object(yt.a)((e,t)=>{let n=En.b();const o=e=>Tt(e,t);for(const t of e.values()){let e=null;!0===t.isDraft?e=r.c.t("calc.maintainer-groups.temp"):t.category&&(e=o({lang:"",fallback:t.groupInfo.maintainerGroup}));const i=[...n.get(e)||[],t];i.sort((e,t)=>o(e.groupName).localeCompare(o(t.groupName))),n=n.set(e,i)}return n}),this.gistLink=""}render(){const{current:e,locale:t}=this.props,n=this.getGroupsByHeadlineName(this.props.groups,t);return o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-6"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.headline"})),o.createElement("ul",{id:"groups-selector-list"},n.map((n,i)=>o.createElement("li",{key:`${i}`},i||o.createElement(r.b,{id:"calc.maintainer-groups.misc"}),o.createElement("ul",null,n.map((n,r)=>{const{groupName:i,groupInfo:a}=n,s=`/relax/calc/${a.source}/${a.id}/${a.filename}/${a.index}`;return o.createElement("li",{key:s,className:nt({active:e&&e.group.groupInfo===n.groupInfo})},o.createElement(Qe,{to:s,onClick:()=>{this.props.datasetLoaded()}},Tt(i,t)))})))).valueSeq().toArray())),o.createElement("div",{className:"col-md-6 align-text-top align-top"},o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.load-gist-headline"})),o.createElement("input",{type:"text",className:"form-control gist-load-input",placeholder:"","data-i18n":"[placeholder]calc.menu.load-gist-insert-placeholder",size:32,onChange:e=>{this.gistLink="/relax/calc/gist/"+e.target.value}}),o.createElement("button",{onClick:()=>{document.location.href=this.gistLink,this.props.datasetLoaded()},type:"button",className:"fullWidthBtn btn btn-secondary gist-load-btn"},o.createElement(r.b,{id:"calc.menu.load-gist-button"})),o.createElement("hr",null),o.createElement("h4",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-headline"})),o.createElement("p",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-text"})," ",o.createElement(Xe,{to:"/help#tutorial-maintainer"},o.createElement(r.b,{id:"calc.menu.create-own-dataset-text-link"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-new-btn",onClick:()=>{this.props.loadGroupTab(!1)}},o.createElement("i",{className:"fa fa-plus-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-new"}))),o.createElement("button",{type:"button",className:"fullWidthBtn btn btn-secondary open-group-current-btn",onClick:()=>{this.props.loadGroupTab(!0)}},o.createElement("i",{className:"fa fa-pencil-square-o fa-lg"})," ",o.createElement("span",null,o.createElement(r.b,{id:"calc.menu.create-own-dataset-button-modify"}))))))}}const Cn=z(e=>({groups:e.groups.groups,current:e.groups.current,locale:e.session.locale}))(jn);var Sn={light:s.a.bool,dark:s.a.bool,full:s.a.bool,fixed:s.a.string,sticky:s.a.string,color:s.a.string,role:s.a.string,tag:ot.o,className:s.a.string,cssModule:s.a.object,expand:s.a.oneOfType([s.a.bool,s.a.string])},On=function(e){var t,n=e.expand,r=e.className,o=e.cssModule,a=e.light,s=e.dark,l=e.fixed,u=e.sticky,c=e.color,d=e.tag,h=Object(p.a)(e,["expand","className","cssModule","light","dark","fixed","sticky","color","tag"]),f=Object(ot.k)(rt()(r,"navbar",function(e){return!1!==e&&(!0===e||"xs"===e?"navbar-expand":"navbar-expand-"+e)}(n),((t={"navbar-light":a,"navbar-dark":s})["bg-"+c]=c,t["fixed-"+l]=l,t["sticky-"+u]=u,t)),o);return i.a.createElement(d,Object(m.a)({},h,{className:f}))};On.propTypes=Sn,On.defaultProps={tag:"nav",expand:!1};var kn=On,Tn={tag:ot.o,className:s.a.string,cssModule:s.a.object},Mn=function(e){var t=e.className,n=e.cssModule,r=e.tag,o=Object(p.a)(e,["className","cssModule","tag"]),a=Object(ot.k)(rt()(t,"navbar-brand"),n);return i.a.createElement(r,Object(m.a)({},o,{className:a}))};Mn.propTypes=Tn,Mn.defaultProps={tag:"a"};var xn=Mn,Rn=n("./node_modules/reactstrap/lib/NavLink.js"),Ln=n.n(Rn);class An extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"desktopNavbar"},o.createElement(xn,{href:"/"},"RelaX"),o.createElement(Lt,{className:"ml-auto",navbar:!0},o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," Calculator")),o.createElement(Bt,{nav:!0,inNavbar:!0,className:"navItemSpace"},o.createElement(Gt,{nav:!0,caret:!0},o.createElement(et.a,{icon:Ze.j})," ",o.createElement(r.b,{id:"calc.navigation.language"})),o.createElement(Zt,{right:!0},o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"),o.createElement(nn,{onClick:()=>this.changeLocale("pt")},"pt"))),o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.feedback"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.help"}))),o.createElement(an,{className:"navItemSpace"},o.createElement(Ln.a,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})))))}}n("./src/calc2/components/calculator.scss");class Dn extends o.Component{constructor(e){super(e),this.refEditorRelalg=o.createRef(),this.refEditorSql=o.createRef(),this.refEditorGroup=o.createRef(),Mt.b.configure(),this.state={activeTab:"relalg",datasetModal:!1,relationModal:!1},this.getCurrentEditor=this.getCurrentEditor.bind(this),this.toggleDatasetModal=this.toggleDatasetModal.bind(this),this.insertRelationToggle=this.insertRelationToggle.bind(this),this.loadGroupEditor=this.loadGroupEditor.bind(this)}toggleDatasetModal(){this.setState({datasetModal:!this.state.datasetModal})}insertRelationToggle(){this.setState({relationModal:!this.state.relationModal})}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}getCurrentEditor(){switch(this.state.activeTab){case"sql":return this.refEditorSql;case"relalg":return this.refEditorRelalg;case"group":return this.refEditorGroup}}loadGroupEditor(e){let t="-- this is an example\ngroup: nameOfTheNewGroup \n\nA = {\na:string, b:number\nexample, 42\n}";!0===e&&(t=this.props.group.definition),this.setState({activeTab:"group"},()=>{const e=this.getCurrentEditor().current;e&&e.editorBase.state.editor.setValue(t),this.toggleDatasetModal()})}render(){const{group:e,locale:t}=this.props,{activeTab:n}=this.state;return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement("div",{className:"calculator"},o.createElement(Mt.a,{enableMultiContainer:!0,position:Mt.b.POSITION.TOP_RIGHT}),o.createElement("div",{className:"row"},o.createElement("div",{className:"d-none d-xs-block d-sm-block d-md-block col-lg-1 col-xl-2"}),o.createElement("div",{className:"groups-container col-xs-2 col-sm-2 col-md-2 col-lg-2 col-xl-2"},o.createElement("button",{className:"btn btn-default dropdown-toggle",type:"button",id:"dropdownMenu1",onClick:this.toggleDatasetModal,style:{width:"100%",textAlign:"left",textOverflow:"ellipsis",overflow:"hidden"}},o.createElement("span",null,"Select DB (",Tt(e.groupName,t),")"),o.createElement("span",{className:"caret",style:{display:"block",position:"absolute",top:"50%",right:"10px"}})),o.createElement("div",null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:null}))),o.createElement("div",{className:"calculator-container col-xs-12 col-sm-12 col-md-12 col-lg-8 col-xl-6"},o.createElement(Lt,{tabs:!0},o.createElement(Bt,{nav:!0,inNavbar:!0,className:"showOnSM"},o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{onClick:this.toggleDatasetModal},o.createElement(et.a,{icon:Ze.g})," ",o.createElement(r.b,{id:"calc.menu.datasets"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(an,null,o.createElement(un,{className:nt({active:"relalg"===n}),onClick:()=>{this.setState({activeTab:"relalg"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.ra.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"sql"===n}),onClick:()=>{this.setState({activeTab:"sql"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.sql.tab-name-short"})))),o.createElement(an,null,o.createElement(un,{className:nt({active:"group"===n}),onClick:()=>{this.setState({activeTab:"group"})}},o.createElement("span",{className:"hideOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name"})),o.createElement("span",{className:"showOnSM"},o.createElement(r.b,{id:"calc.editors.group.tab-name-short"}))))),o.createElement(mn,{activeTab:this.state.activeTab,className:"tab-content-border"},o.createElement(gn,{tabId:"relalg"},o.createElement(wt,{group:e,ref:this.refEditorRelalg,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"sql"},o.createElement(kt,{group:e,ref:this.refEditorSql,relInsertModalToggle:this.insertRelationToggle})),o.createElement(gn,{tabId:"group"},o.createElement(St,{group:e,ref:this.refEditorGroup,setDraft:this.props.setDraft}))))),o.createElement(yn.a,{isOpen:this.state.datasetModal,toggle:this.toggleDatasetModal},o.createElement(bn.a,{toggle:this.toggleDatasetModal},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement("div",null,o.createElement(Cn,{datasetLoaded:()=>{this.setState({datasetModal:!1})},loadGroupTab:e=>{this.loadGroupEditor(e)}}))),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.toggleDatasetModal},Object(r.d)("calc.result.modal.close")))),o.createElement(yn.a,{isOpen:this.state.relationModal,toggle:this.insertRelationToggle},o.createElement(bn.a,{toggle:this.insertRelationToggle},Tt(e.groupName,t)),o.createElement(vn.a,null,o.createElement(wn,{tables:e.tables,replace:e=>{const t=this.getCurrentEditor();t&&t.current&&t.current.replaceSelection(e)},onElementClick:this.insertRelationToggle})),o.createElement(_n.a,null,o.createElement(zt.a,{color:"secondary",onClick:this.insertRelationToggle},Object(r.d)("calc.result.modal.close"))))))}}class Nn extends o.Component{constructor(e){super(e),this.query="",this.success="",this.result="",this.state={},this.query=atob(e.params.query)}componentDidMount(){this.runQuery(this.query)}runQuery(e){try{const{group:t}=this.props,n={};t.tables.forEach(e=>{n[e.tableName]=e.relation});const o=Object(vt.b)(e,Object.keys(n));if(Object(vt.j)(o,n),null===o.child)throw o.assignments.length>0?new Error(Object(r.d)("calc.messages.error-query-missing-assignments-found")):new Error(Object(r.d)("calc.messages.error-query-missing"));const i=Object(vt.h)(o,n);i.check(),this.result=JSON.stringify(i.getResult()),this.success="true"}catch(e){this.success="false",this.result=e.toString()}}render(){return o.createElement("div",{id:"apiContainer"},o.createElement("div",{id:"success"},this.success),o.createElement("div",{id:"query"},this.query),o.createElement("div",{id:"result"},this.result))}}var Pn=n("./node_modules/query-string/index.js"),In=n.n(Pn);class Hn extends o.Component{constructor(e){super(e),this.apiView=!1,this.params={},this.init=!1}componentDidMount(){this.apiView="api"==this.props.location.pathname.split("/")[2],this.params=In.a.parse(this.props.location.search)}componentDidUpdate(e){const{params:t}=this.props.match,{params:n}=e.match;!1!==this.init&&t.source===n.source&&t.id===n.id&&t.filename===n.filename&&t.index===n.index||(this.init=!0,this.loadGroup(this.props))}loadGroup(e){const{source:t,id:n,filename:r,index:o}=e.match.params;this.props.loadGroup(t,n,r,Number.parseInt(o,10),"","")}componentWillReceiveProps(e){const{params:t}=this.props.match,{params:n}=e.match;n.source!==t.source||n.id!==t.id||n.filename!==t.filename||(n.index,t.index)}render(){const{locale:e}=this.props,{current:t}=this.props.groups;return null!==t?1==this.apiView?o.createElement(Nn,{group:t.group,locale:e,params:this.params}):o.createElement(Dn,{group:t.group,locale:e,setDraft:this.props.setDraft}):o.createElement("div",null,"loading ...")}}const Yn=z(e=>({groups:e.groups,locale:e.session.locale}),e=>({loadGroup:(t,n,r,o,i,a)=>{e({type:"GROUPS_LOAD_REQUEST",source:t,id:n,maintainer:i,maintainerGroup:a,setCurrent:{filename:r,index:o}})},setDraft:t=>{e({type:"GROUP_SET_DRAFT",draft:t})}}))(Hn);var Fn=n("./node_modules/jquery/dist/jquery.js"),Wn=n("./node_modules/railroad-diagrams/railroad-diagrams.js");n("./node_modules/railroad-diagrams/railroad-diagrams.css");class Bn extends o.Component{componentDidMount(){const e=q.findDOMNode(this);if(!e)throw new Error("could not find node");this.props.diagram.addTo(e)}shouldComponentUpdate(e){return this.props.diagram!==e.diagram}render(){return o.createElement("div",null)}}n("./src/calc2/views/help.css");class Un extends o.Component{constructor(e){super(e),this.state={},this.changeLocale=this.changeLocale.bind(this)}changeLocale(e){r.c.language!==e&&window.confirm("Reload page to change language?")&&(r.c.changeLanguage(e),window.location.reload())}render(){return o.createElement(kn,{color:"light",light:!0,expand:"md",className:"mobileNavbar"},o.createElement(Bt,null,o.createElement(Gt,{nav:!0},o.createElement(et.a,{icon:Ze.b})),o.createElement(Zt,null,o.createElement(nn,{href:"/relax/calc"},o.createElement(et.a,{icon:Ze.c})," ",o.createElement(r.b,{id:"calc.navigation.calc"})),o.createElement(nn,{href:"/relax/help"},o.createElement(et.a,{icon:Ze.f})," ",o.createElement(r.b,{id:"calc.navigation.help"})),o.createElement(nn,{href:"/relax/imprint"},o.createElement(et.a,{icon:Ze.a})," ",o.createElement(r.b,{id:"calc.navigation.imprint"})),o.createElement(nn,{href:"https://github.com/dbis-uibk/relax/issues"},o.createElement(et.a,{icon:Ze.p})," ",o.createElement(r.b,{id:"calc.navigation.feedback"})),o.createElement(nn,{divider:!0}),o.createElement(nn,{onClick:()=>this.changeLocale("en")},"en"),o.createElement(nn,{onClick:()=>this.changeLocale("de")},"de"),o.createElement(nn,{onClick:()=>this.changeLocale("es")},"es"),o.createElement(nn,{onClick:()=>this.changeLocale("kr")},"kr"))),o.createElement(xn,{href:"/"},"RelaX"))}}class zn extends o.Component{componentDidMount(){const e=Fn("#toc");let t=0,n=null,r=null,o=null;Fn("h2, h3, h4, h5, h6").each((function(){const i=Fn(this),a=i.attr("name")||i.attr("id")||"tocId"+t++;i.attr("name",a),i.attr("id",a);const s=''+i.text()+"";if(i.is("h2"))e.append(Fn(`
        ${s}
          `)),n=e.find("ul:last");else if(i.is("h3")){if(!n)throw new Error("malformed headings");n.append(Fn(`
        • ${s}
          • `)),r=n.find("ul:last")}else if(i.is("h4")){if(!r)throw new Error("malformed headings");r.append(Fn(`
          • ${s}
            • `)),o=r.find("ul:last")}else{if(!o)throw new Error("malformed headings");o.append(`
            • ${s}
            • `)}})),Fn("h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]").each((function(){Fn(this).append(` `)}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Un,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("h1",{id:"help"},"RelaX - Help"),o.createElement("div",{id:"toc"}),o.createElement("h2",{id:"tutorial-user"},"Tutorial - user"),o.createElement("h3",{id:"tutorial-user-coreconcepts"},"The core concepts"),o.createElement("p",null,"The goal of this tutorial is to give a quick introduction how to use the relational algebra calculator and its concepts. It assumes that you already know the relational algebra or are learning it from other sources."),o.createElement("p",null,"There is no real standard for the relational algebra like there is for SQL. So every book or teacher might have its slightly different interpretation and notation.",o.createElement("br",null),'The goal of this progam was to support the most commonly used "mathematical" notation used by ',o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),", ",o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/",lang:"de"},"Datenbanksysteme: Eine Einführung by Alfons Kemper and André Eickler")," and ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Relational_algebra"},"Wikipedia - Relational Algebra")," and others."),o.createElement("h4",{id:"tutorial-user-relations"},"relations"),o.createElement("p",null,"The core element of the calculator is the relation (or table) which consists of a fixed number of attributes (or columns) in a fixed order (this is called the schema of the relation) and a set of tuples or rows containing the specific values."),o.createElement("p",null,"Each attribute has three distinct properties: its type, its position and its name."),o.createElement("p",null,"The type or domain of an attribute is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean"),".",o.createElement("br",null),"The type is used for example to determine if two values can be compared in a boolean expression or if two schemas are union compatible. In most cases the type of the attributes are obvious if you look at the values."),o.createElement("p",null,"The position of each attribute in a schema is fixed and can be used to adress the attributes.",o.createElement("br",null),"An example would be the projection of the first and third attribute or column of an arbitrary relation R: ",o.createElement("code",{className:"example block"},"π [1], [3] ( R )")),o.createElement("p",null,"The full qualified name of the attribute is a unique identifier of the attribute within the schema of its relation. It consists of the name itself and a relation qualifier and are written like in SQL as ",o.createElement("code",null,"R.a"),"where a is the name and R is the relation qualifier.",o.createElement("br",null),"An example would be the projectoin of the attributes a, b from a relation R: ",o.createElement("code",{className:"example block"},"π R.a, R.b ( R )"),o.createElement("br",null),"The default relation qualifier of each attribute is the name of its relation.",o.createElement("br",null),"If the attributes name without the qualifier is unique within the relation's schema, it also can be used to address a specific attribute.",o.createElement("br",null),"The previous example could also be written as ",o.createElement("code",null,"π a, b ( R )"),"."),o.createElement("p",null,"Each relation has a set of tuples (or rows). This means that there are no duplicate tuples within one relation and the duplicate-elimination is implicitly executed after every single step of the calculation.",o.createElement("br",null),"The tuples in the calculator have a defined order and unlike a normal database system all operations are implemented to preserve that order. This should help the users to see what has changed from one step to the next."),o.createElement("p",null,"so far we covered that"),o.createElement("ul",null,o.createElement("li",null,"relations are the core elements,"),o.createElement("li",null,"relations have a schema and a set of tuples,"),o.createElement("li",null,"each attribute in the schema has",o.createElement("ul",null,o.createElement("li",null,"data-type"),o.createElement("li",null,"a position"),o.createElement("li",null,"a fully qualified name (RELATION.attributename)"))),o.createElement("li",null,"and that each attribute can be addressed within an operation using",o.createElement("ul",null,o.createElement("li",null,"its position e.g. ",o.createElement("code",{className:""},"π [1], [2] ( R )"),","),o.createElement("li",null,"the attribute name e.g. ",o.createElement("code",{className:""},"π a, b ( R )")),o.createElement("li",null,"or its full quallified name if the unqualified is not unique e.g. ",o.createElement("code",{className:""},"π R.a, S.a ( R x S )"))))),o.createElement("h3",{id:"tutorial-user-plain-text-notation"},"Alternative plain text notation"),o.createElement("p",null,"Before we introduce how to use the operators this should be a quick introduction of a very handy feature of the relational algebra calculator: the alternative plain text notation"),o.createElement("p",null,'The "classNameic" mathematical notation uses greek letters like π, σ for the unary operations and special symbols like the join symbol ',o.createElement("span",{className:"math"},"⋈")," or the union symbol ",o.createElement("span",{className:"math"},"∪"),"for some binary operations.",o.createElement("br",null),"This symbols can be entered using the toolbar at the top of the editor."),o.createElement("p",null,'This calculator also supports a alternative syntax for all this symbols that follows two very simple rules: Every greek letter can be substituted with its name spelled out ("pi" for π, "gamma" for γ) and every other symbol has an equivalent name that is borrowed from SQL, programming languages like C and ',o.createElement("a",{href:"http://en.wikipedia.org/wiki/Set_theory"},"Set theory"),"."),o.createElement("p",null,"This substitutions should be easy to read and much more important very easy to write because you don't need any toolbar or mouse. The calculator also supports autocomplete: just press [CTRL]+[SPACE] to complete the current keyword.",o.createElement("br",null),"This feature should help you to write your statements more quickly and fluently."),o.createElement("code",{className:"example block"},"π R.a, S.a, S.b σ R.a = S.a ∧ ( R.a > 5 ∨ R.a ","<"," 0 ) ( R ⨯ S )"),"is equivalent to:",o.createElement("code",{className:"example block"},"pi R.a, S.a, S.b sigma R.a = S.a and ( R.a > 5 or R.a ","<"," 0 ) ( R cross join S )"),"In the following table you can see a list of all supported substitutions:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"classNameical notation"),o.createElement("th",null,"alternative notation"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",{className:"math"},"π"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("td",{className:"math"},"σ"),o.createElement("td",null,"sigma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"ρ"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("td",{className:"math"},"τ"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("td",{className:"math"},"γ"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∩"),o.createElement("td",null,"intersect")),o.createElement("tr",null,o.createElement("td",{className:"math"},"∪"),o.createElement("td",null,"union")),o.createElement("tr",null,o.createElement("td",{className:"math"},"-"),o.createElement("td",null,"\\")),o.createElement("tr",null,o.createElement("td",{className:"math"},"÷"),o.createElement("td",null,"/")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⨯"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"x"),o.createElement("li",null,"cross join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋈"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"join"),o.createElement("li",null,"inner join"),o.createElement("li",null,"natural join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟕"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"left join"),o.createElement("li",null,"left outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟖"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"right join"),o.createElement("li",null,"right outer join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"⟗"),o.createElement("td",null,"full outer join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋉"),o.createElement("td",null,"left semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"⋊"),o.createElement("td",null,"right semi join")),o.createElement("tr",null,o.createElement("td",{className:"math"},"▷"),o.createElement("td",null,o.createElement("ul",null,o.createElement("li",null,"anti semi join"),o.createElement("li",null,"anti join")))),o.createElement("tr",null,o.createElement("td",{className:"math"},"←"),o.createElement("td",null,"<","-",o.createElement("code",{className:"example block"},"pi new_name ","<","- a ( R )"))),o.createElement("tr",null,o.createElement("td",{className:"math"},"→"),o.createElement("td",null,"->",o.createElement("code",{className:"example block"},"pi a -> new_name ( R )")))))),o.createElement("ul",null,o.createElement("li",null,"schema preserving operations - operations where the resulting relation has the same schema as its first argument-relation:",o.createElement("ul",null,o.createElement("li",null,"selection"),o.createElement("li",null,"union"),o.createElement("li",null,"intersection"),o.createElement("li",null,"subtraction"),o.createElement("li",null,"orderby"),o.createElement("li",null,"left outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"anti join")))),o.createElement("h3",{id:"tutorial-user-relalg"},"Relational algebra"),o.createElement("p",null,"For this Part we use the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset')," with 3 relations: ",o.createElement("i",null,"Customers"),", ",o.createElement("i",null,"Accounts")," and ",o.createElement("i",null,"PremiumCustomers"),". By convention relations start with a uppercase letter and attributes with a lower case letter."),o.createElement("h4",null,"Open and inspect dataset"),o.createElement("p",null,"Open the dataset used in this tutorial using the following link to the ",o.createElement("a",{href:"calc.htm?data=gist:2cfb981fbc5676182d64"},'"bank example" Dataset'),"."),o.createElement("p",null,"You find the relations and their attributes listed on the side and if you hover a relations name a preview of the first view tuples is displayed."),o.createElement("h4",{id:"tutorial-user-basic-query"},"The most basic query"),o.createElement("p",null,"After you have found the Dataset you can formulate the very first and most basic query in relational algebra: a relation without any further manipulation."),o.createElement("p",null,"Just enter the name of a relation into the code editor or click on the relation/attribute names to insert them into the code editor.",o.createElement("br",null),"Note that the editor supports auto completing the relation/attribute names of the current dataset and the operators with [CTRL]+[SPACE]"),o.createElement("p",null,"So if you want all tuples of the relation ",o.createElement("i",null,"Customer")," you should have the following statement: ",o.createElement("code",null,"Customer"),". And get all the tuples if you press the execute button or press [CTRL]+[RETURN]."),o.createElement("h4",{id:"tutorial-user-unary-operations"},"Unary operations"),o.createElement("p",null,"All unary operations have the same basic syntax ",o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")")),"."),o.createElement("p",{className:"hint"},"The braces around the ",o.createElement("code",null,"CHILD_EXPRESSION")," can be omitted. In this case the predefined ",o.createElement("a",{href:"#relalg-operator-precedence"},"operator precedence for relational algebra")," applies."),o.createElement("p",null,"A complete list of the supported relalg operations can be found here: ",o.createElement("a",{href:"#relalg-syntax"},"general syntax"),", ",o.createElement("a",{href:"#relalg-unary-operations"},"unary operations")," and ",o.createElement("a",{href:"#relalg-binary-operations"},"binary operations"),"."),o.createElement("p",null,"The projection is one of the basic operations that allow to choose which of the attributes of the parent relations should be included in the new one and in which order they should be."),o.createElement("p",null,"Renaming a relation (ρ) changes the qualifiers of all the relations attributes but does not touch the tuples."),o.createElement("p",null,"Renaming an attribute (ρ) only changes the name of a specific attribute (and leaves his relation-qualifier unchanged)."),o.createElement("p",null,"The statement ",o.createElement("code",null,"pi balance ( Accounts )")," returns a new relation with only the balance attribute."),o.createElement("p",null,"The next statement gets the balance with the account-id after renaming the relation to ",o.createElement("i",null,"A")," and renames one of the attributes."),o.createElement("code",{className:"example block"},"rho account_number ","<","- aid ( pi aid, A.balance ( rho A ( Accounts ) ) )"),o.createElement("p",{className:"hint"},"Like in SQL or most programming languages you can format your statement and use SQL like comments (with ",o.createElement("code",null,"-- ...")," or ",o.createElement("code",null,"/* ... */"),") to increase the readability."),o.createElement("p",null,"The next statement uses a selection to filter the tuples of a relation based on a boolean expression. The calculator supports complex boolean expression with functions and built in operator precedence.",o.createElement("br",null),"The attributes in the boolean expression can be given as name or numeric position like with the projection."),o.createElement("p",null,"The next statement selects all customers-ids of customers who have the same value for their firstname and lastname."),o.createElement("code",{className:"example block"},"-- this should return an relation with no tuples: pi cid ( sigma firstname=lastname ( Customers ) )"),o.createElement("p",null,"The next example uses a more complex expression to get all accounts with a balance over 100 or under -100."),o.createElement("code",{className:"example block"},"sigma balance > 100 or (balance*-1 > 100) ( Accounts ) -- (balance ","<"," -100) would also be correct"),o.createElement("p",null,"As a shorter alternative you can use a ",o.createElement("a",{href:"#relalg-valueexpr"},"function in your expression")," to get the same result:"),o.createElement("code",{className:"example block"},"sigma abs(balance) > 100 ( Accounts )"),o.createElement("h2",{id:"tutorial-maintainer"},"Tutorial - maintainer"),o.createElement("p",null,"Everybody can provide datasets that can be used in the relational algebra calculator and share them with others.",o.createElement("br",null),"We assume the scenario of a teacher wanting to provide a dataset for his/her students for this short tutorial."),o.createElement("p",null,"The datasets are specified in a simple text format and can be shared with others via ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gists")," (a simple and free platform to share snippets).",o.createElement("br",null),"The shared gist gets an unique ID and the relational algebra calculator can load the dataset directly using this ID."),o.createElement("h3",{id:"tutorial-maintainer-create-dataset"},"Creating a dataset"),o.createElement("p",null,"The fist step is the creation of the dataset which is actually only a group of relation definitions with some additional information and is therefore refered as group in the specified format.",o.createElement("br",null),"The relations can then be used by the students to formulate the there statements.",o.createElement("br",null),"Lets assume we want to create a dataset of employees of a company."),"Every group definition starts with a simple header which (at least) contains the name of the group:",o.createElement("code",{className:"example block"},"group: bank example"),"every header field starts with the name of the field and is followed by a colon for single line values. The next (optional) header field we should specify is the description. It should contain information like who is maintaining this dataset or where to find additional information.",o.createElement("br",null),"In the description ",o.createElement("a",{href:"http://en.wikipedia.org/wiki/Markdown"},"Markdown")," can be used to format the text or set links to external resources.",o.createElement("p",null,"In our example we add a description that takes more than a single line and therefore we enclose the value in double brackets instead of using the colon."),o.createElement("code",{className:"example block"},"group: bank example description[[ the data for this dataset was generated using ","<","http://www.generatedata.com/> * the relation _Customers_ contains basic information about the customers of the bank. The relation _Accounts_ contains the basic information of a single account. Note that a customer can have any number of accounts. * the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over 1000 ]]"),o.createElement("p",null,"The next step is to actually add the relations the students can use for their queries.",o.createElement("br",null),"The relation definitions are use the relational algebra syntax that can be used in this tool.",o.createElement("br",null),"Every relation is defined by a single variable assignment where the name of the variable is used as the relations name and the result of the expression defines the relation.",o.createElement("br",null),"The relalg expression can use all features that can be used in the tool and can also use other relations defined within the same dataset.",o.createElement("br",null),"Note that the name of the relation is used as the qualifier of each attribute/column."),o.createElement("p",null,"For the relation ",o.createElement("code",null,"Customers")," relation we use the ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation")," syntax as the most basic method to define the relation and can also be edited using the relation editor ",o.createElement("i",{className:"fa fa-table",title:"relation editor"})," which is a simple spread-sheet like editor. ",o.createElement("br",null),"The inline relations in combination with the editor should be very easy to use if you enter the data directly or if you have them as a csv/spread-sheet file."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\t\t\t\t"),o.createElement("p",null,"As we can see the name of the relations are defined by the assignments.",o.createElement("br",null),"The inline-relations are enclosed by curly braces and contain the names of the attributes/columns in the first line and then a tuple/row per line where the values are simply separated by whitespace. You can also other seperators and can define the types explicitly as we can see at the Accounts relation. For further information can be found at ",o.createElement("a",{href:"#relalg-inline-relation"},"inline relation description"),"."),o.createElement("p",null,"Note that, unlike the variables used in a query, the definition of a new relation implicitly sets the attribute qualifier to the name of the relation. So the schema of the account relation is ",o.createElement("code",null,"(Accounts.aid, Accounts.cid, Accounts.balance)"),". This allows each attribute to be accessible with this name."),o.createElement("p",null,"The last relation we need to add in this example is the relation containing the banks premium Customers.",o.createElement("br",null),"They are specified by using the other two relations in a simple relational algebra statement that selects all customers with a total balance over 1000."),o.createElement("code",{className:"example block"},"group: bank example\n\t\t\t\tdescription[[ the data for this dataset was generated using {'<'}http://www.generatedata.com/>\n\n\t\t\t\t* the relation _Customers_ contains basic information about the customers of the bank.\n\t\t\t\t* the relation _Accounts_ contains the basic information of a single account. Note that a customer can\n\t\t\t\thave any number of accounts.\n\t\t\t\t* the relation _PremiumCustomers_ contains the customer-ids of all customers with a total balance over\n\t\t\t\t1000\n\t\t\t\t]]\n\n\t\t\t\tCustomers = { cid firstname lastname\n\t\t\t\t1 Dexter Simpson\n\t\t\t\t2 Kaseem Gallagher\n\t\t\t\t3 Kuame Hamilton\n\t\t\t\t4 Robert Thompson\n\t\t\t\t5 Rhiannon Valentine\n\t\t\t\t6 Calvin Mays\n\t\t\t\t}\n\n\t\t\t\tAccounts = {\n\t\t\t\taid, cid, balance:number\n\t\t\t\t1, 1, 66\n\t\t\t\t2, 1, -304\n\t\t\t\t3, 2, 272\n\t\t\t\t4, 3, 3472\n\t\t\t\t5, 4, 975.7\n\t\t\t\t6, 4, 93\n\t\t\t\t7, 5, 534\n\t\t\t\t8, 5, -75.5\n\t\t\t\t}\n\n\t\t\t\tPremiumCustomers =\n\t\t\t\t\tpi cid (\n\t\t\t\t\t\tsigma sum > 1000 (\n\t\t\t\t\t\t\tgamma cid; sum(balance)->sum (\n\t\t\t\t\t\t\t\tAccounts\n\t\t\t\t\t\t\t\tjoin Customers\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t"),o.createElement("p",null,"We have now seen how to define a dataset with its header containing the name and the description followed by relational algebra assignments defining the relations of the dataset."),o.createElement("p",null,"We can paste this definition directly in the ",o.createElement("i",null,"Group Editor")," to load and use it.",o.createElement("br",null),"In the next section we want to look at how we can publish this definition so that we give our students a single url or id to directly load the dataset."),o.createElement("h3",{id:"tutorial-maintainer-share-dataset"},"Share a dataset"),o.createElement("p",null,"If we want to share the definition of a dataset with other people we could simply give them the definition and they load it using the ",o.createElement("i",null,"group editor"),", but that would not be that practical for most cases."),o.createElement("p",null,"The simpler solution (for the users) is to publish the definition as a ",o.createElement("a",{href:"https://gist.github.com/"},"GitHub Gist")," and share the ID of the gist with others."),o.createElement("p",null,"Just create a gist with the definition as its content (the filename does not matter) and publish it. The ID of the Gist can now be found at the top of the page as ",o.createElement("i",null,"gist:xxxxxxxxxxxx")," or in the url after the last slash."),o.createElement("p",null,"This ID can then be shared and loaded in the interface or the calculator can be called directly with a specific ID by using using the parameter ",o.createElement("code",null,"?data=gist:xxxxxxxxxxxxxx"),"."),o.createElement("p",null,"For example the simple bank definition of this tutorial has been published as a ",o.createElement("a",{href:"https://gist.github.com/ragtime/2cfb981fbc5676182d64"},"Gist with the ID 2cfb981fbc5676182d64")," and can therefore be loaded directly with modifying the url by replacing all after ",o.createElement("code",null,"DOMAIN/relax/calc/")," with ",o.createElement("code",null,"/gist/2cfb981fbc5676182d64"),"."),o.createElement("h2",{id:"relalg-reference"},"Reference - relational algebra"),o.createElement("h3",{id:"relalg-syntax"},"General syntax"),o.createElement("div",null,o.createElement("h4",{id:"relalg-assignment"},"assignment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"NAME")," ",o.createElement("strong",null,"=")," ",o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"Defines a new local variable with the name ",o.createElement("i",null,"NAME"),"; its content is defined by",o.createElement("i",null,"EXPRESSION")),o.createElement("p",null,"The name of the new relation must be unique."),o.createElement("p",null,"The definition has to be executed with the statement."),o.createElement("div",{className:"example"},o.createElement("code",null,"TestA = π a,b R TestB = σ d > 0 S -- statement using the variable TestA join TestB")),o.createElement("p",null,"An assignment (= definition of a variable) is no valid relational algebra expression on its own. If you miss the acutal query a error is thrown (",o.createElement("i",null,"Error: only assignments found; query is missing"),")."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- this is the definition of the variable Test = π Customer.firstname, surname ( Customer ) -- this is the actual query/statement using the variable Test")),o.createElement("p",null,"The defined variable can be used like the assigned expression could be used because every usage of the variable gets replaced with its definition before the query gets executed.",o.createElement("br",null),"This also means that the variable-name has no influence on the schema of the expression and the names of the attributes/columns are not affected by assignment:",o.createElement("code",{className:"block example"},"X = R X join S"),"The attributes of the relation R are only accessible with its original names (R.a, R.b, ..), and are not affected by the assignment."),o.createElement("p",null,"There is a known problem when the last assignment ends with a natural join and the query consists of a single relation:"),o.createElement("code",null,"A = S join R A -- this is the query"),o.createElement("p",null,"The statement is ambiguous and the parser interprets it as ",o.createElement("code",null,"A = (S join R A)"),"where R is interpreted as a column argument for the theta-join and therefore detects a cyclic usage of the variable A."),o.createElement("p",null,"Solution: To get the expected behaviour you have to set braces around the assigned expression like ",o.createElement("code",null,"A = (S join R) A")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-sl"},"single-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"-- "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"the '--' must be followed by at least one whitespace charater! inserts a comment; its text goes until the end of the line"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,"Test =",o.createElement("b",null,"-- This is the expression that is assigned to Test:"),"π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relation-name"},"pre defined relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("i",null,"RELATION_NAME"))))))),o.createElement("div",null,o.createElement("p",null,"Uses a pre defined relation with the name ",o.createElement("i",null,"RELATION_NAME")),o.createElement("p",null,"The code completion only works for this relations."),o.createElement("div",{className:"example"},o.createElement("code",null,"( Customers ) cross join ( Accounts )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-comment-ml"},"multi-line comment"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("strong",null,"/* "),o.createElement("i",null,"COMMENT_TEXT"),o.createElement("strong",null," */"),o.createElement("i",null,"EXPRESSION"))))))),o.createElement("div",null,o.createElement("p",null,"inserts a comment that can span multiple lines"),o.createElement("p",null,"comments are recognized as whitespace"),o.createElement("div",{className:"example"},o.createElement("code",null,o.createElement("b",null,"/* This is a very very long comment */"),"Test = π Customer.firstname, surname ( Customer )")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-inline-relation"},"inline-relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("td",null,o.createElement("code",null,o.createElement("b",null,"{"),o.createElement("i",null,"COLUMN_NAME_1"),":",o.createElement("i",null,"COLUMN_TYPE_1")," ...",o.createElement("i",null,"ROW_1"),o.createElement("i",null,"ROW_2"),"...",o.createElement("b",null,"}"))))))),o.createElement("div",null,o.createElement("p",null,"The inline-relation is a temporary relation that can be defined directly in the statement. It is only valid in the defining statement"),o.createElement("p",null,"Every inline-relation is a valid expression and thus can be used at any position a",o.createElement("i",null,"EXPRESSION")," is expected."),o.createElement("p",null,"The inline-relation is defined by a header, that specifies the schema of the relation and the rows containing the values and is surrounded by curly braces."),o.createElement("div",null,"The header is defined by a sequence of",o.createElement("code",null,o.createElement("i",null,"QUALIFIER.COLUMN_NAME"),":",o.createElement("i",null,"COLUMN_TYPE"))," ",o.createElement("b",null,"separated by any whitespace, comma or semicolon."),"The ",o.createElement("i",null,"QUALIFIER")," is optional. Also the ",o.createElement("i",null,"COLUMN_TYPE")," can be omitted if the type is well defined by the values of that column. The first non null value of a column defines its type.",o.createElement("br",null),"True and false (case insensitive without quotes) are reserved for a boolean type. They can be used as a simple string but they do not define the type of the column as string.",o.createElement("br",null),"The ",o.createElement("i",null,"COLUMN_TYPE")," can be one of the following",o.createElement("ul",null,o.createElement("li",null,"string"),o.createElement("li",null,"number"),o.createElement("li",null,"date"),o.createElement("li",null,"boolean")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("qualifier"),".")),Object(Wn.NonTerminal)("column-name"),Object(Wn.Optional)(Object(Wn.Sequence)(":",Object(Wn.Choice)(0,"string","number","date","boolean"))))}))),o.createElement("p",null,"The rows of the relation are defined by a list of values per row with the type of the corresponding column. The values are ",o.createElement("b",null,"separated by whitespace comma or semicolon."),o.createElement("br",null),"Simple strings only containing letters, numbers, hyphens, underlines, dots or periods ([0-9a-zA-Z\\-_\\.]+) can be written without single quotes. ",o.createElement("i",null,"NULL")," and ",o.createElement("i",null,"null")," are constant values. If null, true or false should be used as string they have te be quoted.",o.createElement("br",null),"More complex strings must be surrounded by single quotes: ",o.createElement("i",null,"'content'")," or ",o.createElement("i",null,"content"),"but '' or 'long content containing spaces and special characters like !' or 'null'.",o.createElement("br",null),"Dates are written in ISO-format: YYYY-MM-DD without single quotes",o.createElement("br",null),"A null-value can be written as ",o.createElement("i",null,"null")," or ",o.createElement("i",null,"NULL")," (without single quotes).",o.createElement("br",null),"Numbers could be integers in the form (-?[0-9]+) or floats in the form (-?[0-9]+\\.[0-9]+).",o.createElement("br",null),"Numbers in single quotes are recognized as numbers if the column type is defined as number or has been detected to be number from a previous value; otherwise it will be a string value..",o.createElement("br",null),"A boolean value is denoted as either ",o.createElement("i",null,"true")," or ",o.createElement("i",null,"false")," (case insensitive)."),o.createElement("p",null,"The header and rows can be indented if needed."),o.createElement("div",{className:"example"},o.createElement("code",null,"-- type for column b is defined by the first value\n\t\t\t\trho A {\n\t\t\t\t\ta:number, b\n\t\t\t\t\t1, 2\n\t\t\t\t\t3, 4\n\t\t\t\t}\n\t\t\t\tcross join\n\t\t\t\t{\n\t\t\t\t\ta:string X.b:date c:number\n\t\t\t\t\tAlpha 1970-01-01 1\n\t\t\t\t\t'Beta 2' 1970-01-02 3\n\t\t\t\t\t'' 1970-01-03 4\n\t\t\t\t}")))),o.createElement("div",null,o.createElement("h4",{id:"relalg-relalgexpr"},"relational algebra expression"),o.createElement("div",null,o.createElement("p",null,"A valid relational algebra expression is built by connecting ",o.createElement("i",null,"relation-name")," or ",o.createElement("i",null,"inline-relation"),"as atoms with the defined unary and binary operators."),"So a relational algebra expression is recursively defined as follows:",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Choice)(0,Object(Wn.Sequence)("(",Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),")"),Object(Wn.NonTerminal)("relation-name","#relalg-relation-name"),Object(Wn.NonTerminal)("inline-relation","#relalg-inline-relation"),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.NonTerminal)("projection","#relalg-operations-projection"),Object(Wn.NonTerminal)("selection","#relalg-operations-selection"),Object(Wn.NonTerminal)("rename relation","#relalg-operations-renamerelation"),Object(Wn.NonTerminal)("rename column","#relalg-operations-renamecolumn"),Object(Wn.NonTerminal)("order by","#relalg-operations-orderby"),Object(Wn.NonTerminal)("group by","#relalg-operations-groupby")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))),Object(Wn.Choice)(1,Object(Wn.Skip)(),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.NonTerminal)("intersection","#relalg-operations-intersection"),Object(Wn.NonTerminal)("union","#relalg-operations-union"),Object(Wn.NonTerminal)("division","#relalg-operations-division"),Object(Wn.NonTerminal)("subtraction","#relalg-operations-subtraction"),Object(Wn.NonTerminal)("cross product","#relalg-operations-crossjoin"),Object(Wn.NonTerminal)("θ-join","#relalg-operations-innerjoin"),Object(Wn.NonTerminal)("natural join","#relalg-operations-naturaljoin"),Object(Wn.NonTerminal)("left outer join","#relalg-operations-leftjoin"),Object(Wn.NonTerminal)("right outer join","#relalg-operations-rightjoin"),Object(Wn.NonTerminal)("full outer join","#relalg-operations-fulljoin"),Object(Wn.NonTerminal)("left semi join","#relalg-operations-leftsemijoin"),Object(Wn.NonTerminal)("right semi join","#relalg-operations-rightsemijoin"),Object(Wn.NonTerminal)("anti semi join","#relalg-operations-antijoin")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))))})))),o.createElement("h3",{id:"relalg-unary-operations"},"Unary operations"),"Each unary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("i",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-projection"},"projection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"π")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"pi a, b ( R )")))))),o.createElement("p",null,"The argument is a subset of columns of the schema of the ",o.createElement("i",null,"CHILD_EXPRESSION")," or a ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("div",{className:"example"},o.createElement("code",null,"π Customer.firstname, surname ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, [1] ( ρ c ( Customer ) )")),"Expressions can be used to create more complex statements using one or more columns of a single row.",o.createElement("div",{className:"example"},o.createElement("code",null,"pi c.id, lower(username)->user, concat(firstname, concat(' ', lastname))->fullname ( ρ c ( Customer ) )")),"The virtual column ",o.createElement("i",null,"ROWNUM")," used in previous versions is not supported any more but the ",o.createElement("code",null,"rownum()")," expression can be used to get the same information. And it can also be used directly in the boolean condition of a selection or join.",o.createElement("div",{className:"example"},"In this example the top 5 customers with the most orders are selected, where countOrders could be the result of a previous aggregation.",o.createElement("code",null,"pi firstname, lastname sigma rownum() ","<","= 5 tau countOrders desc Customer")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"π","pi"),Object(Wn.OneOrMore)(Object(Wn.NonTerminal)("column","#relalg-column"),",")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-selection"},"selection"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"σ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"pi")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"sigma a > 2 ( R )")))))),o.createElement("p",null,"The argument is a ",o.createElement("a",{href:"#relalg-valueexpr"},"boolean expression")," that each row of ",o.createElement("i",null,"CHILD_EXPRESSION"),"is checked on"),o.createElement("div",{className:"example"},o.createElement("code",null,"σ firstname = 'Bob' or firstname = 'Alice' ( Customer )")),o.createElement("div",{className:"example"},o.createElement("code",null,"σ (id > 10 and id ","<"," 100) or id = 42 ( Customer )")),o.createElement("div",{className:"example"},"Selecting all customers with a firstname that has an even length.",o.createElement("code",null,"σ mod(length(firstname),2) = 0 ( Customer )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"σ","sigma"),Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamerelation"},"rename relation"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"( R ) join R.a = X.b (rho X ( R ))")))))),o.createElement("div",null,"The argument is the new name for the Relation returned by ",o.createElement("i",null,"CHILD_EXPRESSION"),o.createElement("div",{className:"example"},'rename the Relation from "Customer" to "a":',o.createElement("code",null,"π a.id, a.firstname ( ρ a ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"ρ","rho"),Object(Wn.NonTerminal)("new relation name")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-renamecolumn"},"rename column"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"ρ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"rho")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,"the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("code",{className:"relalg block"},"pi x, b rho a->x {a, b\n\t\t\t\t\t\t1, 2\n\t\t\t\t\t\t3, 4\n\t\t\t\t\t}")))))),o.createElement("div",null,"The argument is the old and the new column names in a list (see example) ",o.createElement("br",null),'"←" can be substituted with "',"<",'-"',o.createElement("div",{className:"example"},"rename the columns id and firstname to myId and foobar:",o.createElement("code",null,"ρ myId←id, foobar←firstname (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"ρ","rho"),Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("new name"),Object(Wn.Choice)(0,"←","<-"),Object(Wn.NonTerminal)("column","#relalg-column")),Object(Wn.Sequence)(Object(Wn.NonTerminal)("column","#relalg-column"),Object(Wn.Choice)(0,"→","->"),Object(Wn.NonTerminal)("new name"))),",")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-orderby"},"order by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"τ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"tau")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"tau a asc, b desc ( R )")))))),o.createElement("div",null,"The argument is a list of columns by which the relation should be ordered (see examples)",o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"τ [1], firstname desc (π id, firstname ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"τ","tau"),Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("column","#relalg-column"),Object(Wn.Choice)(0,Object(Wn.Skip)(),"asc","desc")),",")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-groupby"},"group by"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"γ")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"gamma")),o.createElement("tr",null,o.createElement("th",null,"example"),o.createElement("td",null,o.createElement("code",{className:"relalg"},"gamma a, count(*)->x ( R )")))))),o.createElement("div",null,"The argument is a list of columns to group by, separated by commas followed by a semicolon",o.createElement("br",null),"and a list of aggregate functions to apply with their new name in form ",o.createElement("span",null,"AGG( COLUMN ) -> NEW_NAME"),o.createElement("div",{className:"example"},"order the result by the first column (default is ascending) and the second column descending:",o.createElement("code",null,"γ a, b ; sum(c)->x ( Customer )")),o.createElement("p",null,"If no grouping columns are provided the entire relation is the group."),o.createElement("div",null,"supported aggregate functions by type:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("td",null," "),o.createElement("th",null,"number"),o.createElement("th",null,"string"),o.createElement("th",null,"date"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"COUNT( * )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"COUNT( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MIN( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"MAX( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes"),o.createElement("td",null,"yes")),o.createElement("tr",null,o.createElement("th",null,"SUM( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")),o.createElement("tr",null,o.createElement("th",null,"AVG( column )"),o.createElement("td",null,"yes"),o.createElement("td",null,"no"),o.createElement("td",null,"no")))))),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"γ","gamma"),Object(Wn.Sequence)(Object(Wn.ZeroOrMore)(Object(Wn.NonTerminal)("column","#relalg-column"),","),";",Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"COUNT(*)",Object(Wn.Sequence)(Object(Wn.Choice)(0,"COUNT","MIN","MAX","SUM","AVG"),"(",Object(Wn.NonTerminal)("column","#relalg-column"),")")),Object(Wn.Choice)(0,"→","->"),Object(Wn.NonTerminal)("new name")),","))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-binary-operations"},"Binary operations"),"Each binary operation follows the following syntax:",o.createElement("div",{className:"b-syntax"},o.createElement("code",null,o.createElement("strong",null,"(")," CHILD_EXPRESSION ",o.createElement("strong",null,")")," ",o.createElement("strong",null,"FUNCTION")," ARGUMENT ",o.createElement("strong",null,"("),"CHILD_EXPRESSION ",o.createElement("strong",null,")"))),"The parentheses are Optional.",o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-intersection"},"intersection - ∩"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∩")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"intersect"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∩ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"∩","intersect")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-union"},"union - ∪"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"union"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ∪ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"∪","union")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-division"},"division"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"÷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"/"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( Customer ) ÷ ( Customer )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"÷","/")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-subtraction"},"subtraction / set-difference"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"-"),o.createElement("td",{className:"math"},"∪")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"\\",o.createElement("br",null),"except"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",null,"( pi firstname ( Customer ) ) - ( rho test","<","-lastname ( pi lastname ( Customer ) ) )")),"the schemas must be unifiable",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"-","\\","except")),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-crossjoin"},"cross product"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⨯")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"cross join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⨯",Object(Wn.Sequence)("cross","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-innerjoin"},"Theta-join / θ-join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"inner join"))))),o.createElement("div",null,"join condition",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋈",Object(Wn.Sequence)(Object(Wn.Optional)("inner"),"join")),Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))}))),o.createElement("p",null,"Special case:",o.createElement("br",null),"The name of a single boolean column (like ",o.createElement("code",null,"R join a S"),") can not be used directly as a join condition due to ambiguities in the relational algebra syntax.",o.createElement("br",null),"The column must either be specified with its qualifier (",o.createElement("code",null,"R join R.a S"),") or wrapped in parentheses (",o.createElement("code",null,"R join (a) S"),").",o.createElement("br",null),"This is not necessary for more complex boolean expressions. The problem is only that the single column name can not be distinguished from a relation name: the expression ",o.createElement("code",null,"X=R join S X")," could be interpreted as ",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".")),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-naturaljoin"},"natural join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋈")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"join",o.createElement("br",null),"natural join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"example"},o.createElement("code",{className:"block"},"ρ a ( Customer )",o.createElement("span",{className:"math"},"⋈")," a.name ","<"," b.name ( ρ b ( Customer ) )")),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋈",Object(Wn.Sequence)("natural","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftjoin"},"left outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟕")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left outer join",o.createElement("br",null),"left join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural left outer join",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⟕",Object(Wn.Sequence)("left",Object(Wn.Optional)("outer"),"join")),Object(Wn.Optional)(Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightjoin"},"right outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟖")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right outer join",o.createElement("br",null),"right join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural right outer join",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⟖",Object(Wn.Sequence)("right",Object(Wn.Optional)("outer"),"join")),Object(Wn.Optional)(Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-fulljoin"},"full outer join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⟗")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"full outer join"))))),o.createElement("div",null,"optional join condition; if no join condition is given it acts as a natural full outer join",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⟗",Object(Wn.Sequence)("full","outer","join")),Object(Wn.Optional)(Object(Wn.NonTerminal)("boolean-expression","#relalg-valueexpr")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-leftsemijoin"},"left semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋉")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"left semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋉",Object(Wn.Sequence)("left","semi","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))}))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-rightsemijoin"},"right semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"⋊")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"right semi join"))))),o.createElement("div",null,"no argument",o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"⋊",Object(Wn.Sequence)("right","semi","join"))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"))})))),o.createElement("div",null,o.createElement("h4",{id:"relalg-operations-antijoin"},"anti semi join"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-nonfluid"},o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"symbol"),o.createElement("td",{className:"math"},"▷")),o.createElement("tr",null,o.createElement("th",null,"alternative syntax"),o.createElement("td",null,"anti semi join",o.createElement("br",null),"anti join"))))),o.createElement("div",null,"no argument",o.createElement("br",null),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"▷",Object(Wn.Sequence)("anti",Object(Wn.Optional)("semi"),"join")))),Object(Wn.NonTerminal)("RA-expression","#relalg-relalgexpr")))})))),o.createElement("h3",{id:"relalg-operator-precedence"},"Operator precedence"),o.createElement("p",null,"The operator precedence allows to obmit most of braces.",o.createElement("br",null),"The used precedence is shown in the table below.",o.createElement("br",null),"All operators are left associative."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operator"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,o.createElement("a",{href:"#relalg-relation-name"},"relation-name"),",",o.createElement("a",{href:"#relalg-inline-relation"},"inline-relation"))),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-projection"},"projection"),",",o.createElement("a",{href:"#relalg-operations-selection"},"selection"),",",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename (columns)"),",",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename (relations)"),",",o.createElement("a",{href:"#relalg-operations-groupby"},"group"),",",o.createElement("a",{href:"#relalg-operations-orderby"},"order by"))),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross product"),",",o.createElement("a",{href:"#relalg-operations-innerjoin"},"theta join"),",",o.createElement("a",{href:"#relalg-operations-naturaljoin"},"natural join"),",",o.createElement("a",{href:"#relalg-operations-leftjoin"},"left outer join"),",",o.createElement("a",{href:"#relalg-operations-rightjoin"},"right outer join"),",",o.createElement("a",{href:"#relalg-operations-fulljoin"},"full outer join"),",",o.createElement("a",{href:"#relalg-operations-leftsemijoin"},"left semi-join"),",",o.createElement("a",{href:"#relalg-operations-rightsemijoin"},"right semi-join"),",",o.createElement("a",{href:"#relalg-operations-antijoin"},"anti semi-join"),",",o.createElement("a",{href:"#relalg-operations-division"},"division"))),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-intersection"},"intersection"))),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,o.createElement("a",{href:"#relalg-operations-union"},"union"),",",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction")))))),o.createElement("div",{className:"example"},o.createElement("code",null,"A join B x C"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"((A join B) x C)"),o.createElement("br",null),"because the cross product and the natural join are in the same precedence className."),o.createElement("div",{className:"example"},o.createElement("code",null,"sigma true A join sigma true B"),o.createElement("br",null),"is equal to",o.createElement("br",null),o.createElement("code",null,"(sigma true (A)) join (sigma true (B))"),o.createElement("br",null),"because the unary operators have a higher precedence than the binary operators."),o.createElement("h3",{id:"relalg-misc"},"Misc"),o.createElement("h4",{id:"relalg-column"},"Column"),"column is either",o.createElement("ul",null,o.createElement("li",null,'the name of a column: "columnName"'),o.createElement("li",null,'the number of the column (starting with 1): "[column-number]"'),o.createElement("li",null,'a full qualified column: "qualifier.columnName"'),o.createElement("li",null,"a value expression (if allowed for the specific operation)")),"the qualifier is optional if the column is unique in its schema.",o.createElement("h4",{id:"relalg-valueexpr"},"Value expressions"),"With most operators you can use a value-expression which connects one or more columns of a single row to calculate a new value. This is possible for:",o.createElement("ul",null,o.createElement("li",null,"the projection creating a new column (make sure to give the column a name)"),o.createElement("li",null,"the selection any expression evaluating to boolean can be used"),o.createElement("li",null,"for the joins any expression evaluating to boolean can be used; note that the ",o.createElement("code",null,"rownum()")," expression always represents the index of the lefthand relation")),"The expressions always operate on a single row/tuple of a table/relation.",o.createElement("br",null),"If you want to calculate values vertically over all values of a specific column/attribute you need to use group by with an aggregate function. The following table lists all functions and operators that can be used in an expression. They can be combined and nested in any arbitrary order but note that they do evaluate to a single type defined by the outer most expression. The following operators can be used:",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"syntax"),o.createElement("th",null,"returns type"),o.createElement("th",null,"description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a AND b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical and")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a OR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a XOR b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical exclusive or")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"NOT b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"logical not")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a = b a != b a ","<"," b a > b a ","<","= b a >= b a != b")),o.createElement("td",null,"boolean"),o.createElement("td",null,"compares two values of the same type")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string LIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"returns true if expression evaluating to a string ",o.createElement("code",null,"a")," matches the pattern given as the second operand.",o.createElement("br",null),"The pattern has to be given as a string literal;",o.createElement("p",null,"An underscore (",o.createElement("code",null,"_"),") in the pattern stands for any single character and any percent sign (",o.createElement("code",null,"%"),") stands for any sequence of zero or more characters."))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a:string ILIKE 'PATTERN'")),o.createElement("td",null,"boolean"),o.createElement("td",null,"same as ",o.createElement("code",null,"LIKE")," but matches case-insensitive.",o.createElement("br",null),"This is not in the SQL standard but is a PostgreSQL extension.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"a + b a - b a * b a / b a % b")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, subtraction, multiplication, division, modulo")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rand()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns a random number in the interval [0, 1]")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"rownum()")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the index of the current row (starting with 0).",o.createElement("br",null),"If the function is used in a binary relational algebra expression (e.g. a join) it always represents the index of the left operand.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"length(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the length of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"date(a:string)")),o.createElement("td",null,"date"),o.createElement("td",null,"parses the given string to a date object. The string must be in the form YYYY-MM-DD")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"adddate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"adds the given number of days to date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"subdate(a:date, b:number)")),o.createElement("td",null,"date"),o.createElement("td",null,"subtracts the given number of days from date ",o.createElement("code",null,"a"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"now() transaction_timestamp() statement_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns a timestamp representing the start of the query execution",o.createElement("br",null),"transaction- and statement start are the very same value due to the lack of a transaction concept")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"clock_timestamp()")),o.createElement("td",null,"date"),o.createElement("td",null,"returns the current timestamp while executing the query")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"year(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the year component of a given date")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"month(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the month component of a given date as a number. (1 = Sunday, 2 = Monday, ..., 7 = Saturday)")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"day(a:date) dayofmonth(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the day component of a given date as a number in the range 1 to 31")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"hour(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the hour component of a given date as a number in the range 0 to 23")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"minute(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the minute component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"second(a:date)")),o.createElement("td",null,"number"),o.createElement("td",null,"returns the second component of a given date as a number in the range 0 to 59")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"concat(a:string [, ...])")),o.createElement("td",null,"string"),o.createElement("td",null,"concatenates the given strings")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"upper(a:string) ucase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to upper-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"lower(a:string) lcase(a:string)")),o.createElement("td",null,"string"),o.createElement("td",null,"converts the given string to lower-case")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"strlen(a:string)")),o.createElement("td",null,"number"),o.createElement("td",null,"number of characters of the string")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"abs(a:number)")),o.createElement("td",null,"number"),o.createElement("td",null,"the absolute value of the given number")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"add(a, b) sub(a, b) mul(a, b) div(a, b) mod(a, b)")),o.createElement("td",null,"number"),o.createElement("td",null,"arithmetic addition, ",o.createElement("br",null),"subtraction, ",o.createElement("br",null),"multiplication, ",o.createElement("br",null),"division or ",o.createElement("br",null),"modulo of the given numbers")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",null,"round(a) floor(a) ceil(a)")),o.createElement("td",null,"number"),o.createElement("td",null,"round to nearest integer, ",o.createElement("br",null),"largest integer not greater than the argument or",o.createElement("br",null),"smallest integer not less than the argument")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"coalesce(",o.createElement("strong",null,"value")," [, ...])")),o.createElement("td",null,"type of ",o.createElement("strong",null,"value")),o.createElement("td",null,"returns the first of its arguments that is not null or null if all arguments are null. Note that all arguments must have the same datatype.")),o.createElement("tr",null,o.createElement("td",null,o.createElement("code",{className:"sql"},"CASE WHEN ",o.createElement("strong",null,"condition")," THEN result [WHEN ...] [ELSE ",o.createElement("strong",null,"result"),"] END")),o.createElement("td",null,"type of ",o.createElement("strong",null,"result")),o.createElement("td",null,"returns the first result where the condition evaluates to true. If all conditions are false the else part is executed or null is returnt if the else part is missing. Note that all results must have the same datatype."))))),"The operator precedence is the same as used in ",o.createElement("a",{href:"https://dev.mysql.com/doc/refman/5.7/en/operator-precedence.html"},"MySQL")," (from strong to weak):",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"order of precedence"),o.createElement("th",null,"Operators"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"0"),o.createElement("td",null,"functions, constants, columns")),o.createElement("tr",null,o.createElement("td",null,"1"),o.createElement("td",null,"! (boolean not)")),o.createElement("tr",null,o.createElement("td",null,"2"),o.createElement("td",null,"- (unary minus)")),o.createElement("tr",null,o.createElement("td",null,"3"),o.createElement("td",null,"*, /, %")),o.createElement("tr",null,o.createElement("td",null,"4"),o.createElement("td",null,"-, +")),o.createElement("tr",null,o.createElement("td",null,"5"),o.createElement("td",null,"= (comparison), >=, >, ","<","=, ","<",", ","<",">, !=, LIKE, ILIKE")),o.createElement("tr",null,o.createElement("td",null,"6"),o.createElement("td",null,"CASE, WHEN, THEN, ELSE")),o.createElement("tr",null,o.createElement("td",null,"7"),o.createElement("td",null,"AND")),o.createElement("tr",null,o.createElement("td",null,"8"),o.createElement("td",null,"XOR")),o.createElement("tr",null,o.createElement("td",null,"9"),o.createElement("td",null,"OR, ||"))))),o.createElement("h2",{id:"sql-reference"},"Reference - SQL"),o.createElement("p",null,"The goal of the SQL mode of the relational algebra calculator is to provide a translation from SQL to relational algebra to show how they are related. It does not support all features a real database system like ",o.createElement("a",{href:"http://www.postgresql.org",target:"_blank"},"PostgreSQL")," or ",o.createElement("a",{href:"https://www.mysql.com/",target:"_blank"},"MySQL"),' does because the goal is to provide a translation into relational algebra. This means that many features like correlated-substatements are not supported because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h3",{id:"sql-syntax"},"General syntax"),o.createElement("p",null,"All keywords are case insensitv."),o.createElement("p",null,"The following Synopsis is a adapted version of ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html",target:"_blank"},"PostgreSQL")," and shows the general syntax of the supported SQL. Brackets indicate optional parts. Braces and vertical lines indicate that one of the alternatives has to be chosen. Dots mean that the preceding element can be repeated."),o.createElement("code",{className:"block sql"},"[ ",o.createElement("a",{href:"#sql-with"},"WITH")," ",o.createElement("strong",null,"with_query")," [, ...] ]",o.createElement("a",{href:"#sql-select"},"SELECT")," [ DISTINCT ] * | ",o.createElement("strong",null,"expression")," [ [ AS ] ",o.createElement("strong",null,"output_name")," ] [, ...]",o.createElement("a",{href:"#sql-from"},"FROM")," ",o.createElement("strong",null,"from_item")," [, ...] [ ",o.createElement("a",{href:"#sql-where"},"WHERE")," ",o.createElement("strong",null,"condition")," ] [ ",o.createElement("a",{href:"#sql-groupby"},"GROUP BY")," ",o.createElement("strong",null,"column")," [, ...] ] [ ",o.createElement("a",{href:"#sql-having"},"HAVING")," ",o.createElement("strong",null,"condition")," ] [ ","{"," ",o.createElement("a",{href:"#sql-setoperators"},"UNION")," | ",o.createElement("a",{href:"#sql-setoperators"},"INTERSECT")," | ",o.createElement("a",{href:"#sql-setoperators"},"EXCEPT")," } [ ALL | DISTINCT ] ",o.createElement("strong",null,"select")," ] [ ",o.createElement("a",{href:"#sql-orderby"},"ORDER BY")," ",o.createElement("strong",null,"column")," [ ASC | DESC ] [, ...] ] [ ",o.createElement("a",{href:"#sql-limit"},"LIMIT")," ","{"," ",o.createElement("strong",null,"count")," | ALL } ] [ ",o.createElement("a",{href:"#sql-limit"},"OFFSET")," ",o.createElement("strong",null,"start")," [ ROW | ROWS ] ] [ ",o.createElement("a",{href:"#sql-limit"},"FETCH")," ","{"," FIRST | NEXT } [ ",o.createElement("strong",null,"count")," ] ","{"," ROW | ROWS } ONLY ] where ",o.createElement("strong",null,"from_item")," can be one of:",o.createElement("strong",null,"table_name")," [ AS ",o.createElement("strong",null,"alias")," ]",o.createElement("strong",null,"with_query_name")," [ AS ",o.createElement("strong",null,"alias")," ] ( ",o.createElement("strong",null,"select")," ) AS ",o.createElement("strong",null,"alias"),o.createElement("strong",null,"from_item")," CROSS JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," NATURAL JOIN ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," ON join_condition",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," NATURAL",o.createElement("strong",null,"from_item")," [ INNER ] JOIN ",o.createElement("strong",null,"from_item")," USING ( join_column [, ...] )",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN ON join_condition",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN NATURAL ",o.createElement("strong",null,"from_item"),o.createElement("strong",null,"from_item")," ","{"," LEFT | RIGHT | FULL } [ OUTER ] JOIN USING ( join_column [, ...] ) ",o.createElement("strong",null,"from_item"),"and ",o.createElement("strong",null,"with_query")," is:",o.createElement("strong",null,"with_query_name")," AS ( ",o.createElement("strong",null,"select")," )"),o.createElement("div",{className:"too-wide"},o.createElement(Bn,{diagram:Object(Wn.Diagram)(Object(Wn.Stack)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("WITH","#sql-with"),Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("name"),"AS","(",Object(Wn.NonTerminal)("select","#sql-select"),")"),",")),"skip"),Object(Wn.Sequence)(Object(Wn.Terminal)("SELECT","#sql-select"),Object(Wn.Optional)("DISTINCT","skip"),Object(Wn.Choice)(0,"*",Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("column"),Object(Wn.Optional)(Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("output_name")))),Object(Wn.Sequence)(Object(Wn.NonTerminal)("expression","#sql-valueexpr"),Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("output_name")))),",")),Object(Wn.Terminal)("FROM","#sql-from"),Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("table_name"),Object(Wn.Optional)(Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias")))),Object(Wn.Sequence)("(",Object(Wn.NonTerminal)("select"),")",Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias")))),",")),Object(Wn.OneOrMore)(Object(Wn.Choice)(0,Object(Wn.Skip)(),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.Sequence)(",",Object(Wn.Comment)("old syntax for cross join")),Object(Wn.Sequence)(Object(Wn.Choice)(0,"CROSS","NATURAL"),"JOIN"),Object(Wn.Sequence)(Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.Optional)("INNER"),"JOIN"),Object(Wn.Sequence)(Object(Wn.Choice)(0,"LEFT","RIGHT","FULL"),Object(Wn.Optional)("OUTER"),"JOIN")),Object(Wn.Choice)(0,Object(Wn.Sequence)("ON",Object(Wn.NonTerminal)("condition")),Object(Wn.Sequence)("USING","(",Object(Wn.OneOrMore)(Object(Wn.NonTerminal)("join_column"),","),")"),Object(Wn.Sequence)("NATURAL")))),Object(Wn.Choice)(0,Object(Wn.Sequence)(Object(Wn.NonTerminal)("table_name"),Object(Wn.Optional)(Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias")))),Object(Wn.Sequence)("(",Object(Wn.NonTerminal)("select"),")",Object(Wn.Sequence)("AS",Object(Wn.NonTerminal)("alias"))))))),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("WHERE","#sql-where"),Object(Wn.NonTerminal)("condition")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("GROUP BY","#sql-groupby"),Object(Wn.NonTerminal)("expression","#sql-valueexpr")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("HAVING","#sql-having"),Object(Wn.NonTerminal)("condition")),"skip")),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Choice)(0,"UNION","INTERSECT","EXCEPT"),Object(Wn.Choice)(0,Object(Wn.Skip)(),"DISTINCT","ALL"),Object(Wn.NonTerminal)("select")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("ORDER BY","#sql-orderby"),Object(Wn.OneOrMore)(Object(Wn.Sequence)(Object(Wn.NonTerminal)("expression","#sql-valueexpr"),Object(Wn.Choice)(0,"ASC","DESC")),",")),"skip")),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("LIMIT","#sql-limit"),Object(Wn.Choice)(0,Object(Wn.NonTerminal)("count"),"ALL")),"skip"),Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("OFFSET","#sql-limit"),Object(Wn.NonTerminal)("start"),Object(Wn.Optional)("ROWS")),"skip")),Object(Wn.Sequence)(Object(Wn.Optional)(Object(Wn.Sequence)(Object(Wn.Terminal)("FETCH FIRST","#sql-limit"),Object(Wn.NonTerminal)("count"),Object(Wn.Optional)("ROWS"),"ONLY"),"skip"))))})),o.createElement("h3",{id:"sql-translation"},"Semantic and Translation to relational algebra"),o.createElement("h4",{id:"sql-translation-sequence"},"Sequence of execution"),o.createElement("p",null,'The SQL statement is translated directly into relational algebra. To understand some of the effects of the tool it might be helpful to understand the steps of the translation process. As mentioned before, real database systems might take a different (more complex) aproach but this should help to get an idea of how SQL could be translated into "classNameical" relational algebra.'),o.createElement("p",null,"The following list shows the translation from SQL into relational algebra starting with the inner most relational algebra expression at the top."),o.createElement("ol",null,o.createElement("li",null,"replace all usages of the temporary-tables defined in the WITH-clause with their definitions"),o.createElement("li",null,"FROM-clause is translated left associative with all joins having the same precedence (",o.createElement("code",null,","),"is a cross join)"),o.createElement("li",null,"selection with condition from where-clause is added"),o.createElement("li",null,"group by"),o.createElement("li",null,"selection with condition from having-clause"),o.createElement("li",null,"union/intersect/except"),o.createElement("li",null,"projection is added to choose the requested columns of the SELECT-clause"),o.createElement("li",null,"the columns are renamed to get the requested output-name specified in the SELECT-clause"),o.createElement("li",null,"order by"),o.createElement("li",null,"limit/offset is mapped to a selection")),o.createElement("h4",{id:"sql-select"},"SELECT"),o.createElement("p",null,"The direct translation into relational algebra with implicit duplication elimination requires the ",o.createElement("code",null,"distinct"),"keyword to be equivalent. A warning is shown if you omit it."),o.createElement("p",null,"The select-clause is translated into up to two relalg operators."),o.createElement("ul",null,o.createElement("li",null,"The most basic case is ",o.createElement("code",null,"select ",o.createElement("strong",null,"*")," ...")," where no changes are made to the schema of the result. Therefore no projection is needed. You can use the optional table-alias-prefix if the columns of a single table/relation should be returned only: ",o.createElement("code",{className:"sql"},"select distinct R.* from R inner join S")),o.createElement("li",null,"When a subset of the columns are selected and/or reordered (",o.createElement("code",null," select a, b from ..."),") then a single ",o.createElement("a",{href:"#relalg-operations-projection"},"projection")," is used."),o.createElement("li",null,"Additionally to the previous case a ",o.createElement("a",{href:"#relalg-operations-renamecolumn"},"rename-column operator")," is added after the projection if new output-names are given with ",o.createElement("code",null,"as foo"),". e.g. ",o.createElement("code",null,"select a ",o.createElement("strong",null,"as foo")," from ..."))),o.createElement("p",null,"The allowed expressions are the same as for the ",o.createElement("a",{href:"#relalg-operations-projection"},"projection"),". So it can be either the name of the column (with optional renaming using ",o.createElement("code",null,"as"),") or a complex",o.createElement("a",{href:"#sql-valueexpr"},"value expression"),". In the latter case a output-name must be given using",o.createElement("code",null,"as")," because the tool requires every column to have a name."),o.createElement("h4",{id:"sql-from"},"FROM"),o.createElement("p",null,"In its simplest form the from-clause holds a single table/relation name that is used directly in the relalg statement. If the optional table-alias is specified with ",o.createElement("code",null,"table as foo")," this is reflected by wrapping the relation in a ",o.createElement("a",{href:"#relalg-operations-renamerelation"},"rename-relation operator")," with the given output-name."),o.createElement("code",{className:"example sql"},"select distinct x.a, x.b from R as x"),o.createElement("p",null,"Joins can be expressed using the ANSI join syntax"),o.createElement("code",{className:"example sql"},"select distinct * from A, B inner join C on ... inner join D natural natural join E left outer join F on ... left outer join G natural right outer join H on ... right outer join I natural full outer join J on ... full outer join K natural where ..."),o.createElement("p",null,"The comma is part of the old join syntax and is translated into a ",o.createElement("a",{href:"#relalg-operations-crossjoin"},"cross join"),"."),o.createElement("code",{className:"example sql"},"select distinct * from R, S as s, T where s.a = R.a"),o.createElement("p",null,"Instead of the name of relation a non-correlated substatement can be used. A table alias must be provided with ",o.createElement("code",null,"(...) as foo"),".",o.createElement("br",null),"A non-correlated substatement can be directly translated into relational algebra by just translate the sub-statement into relational algebra and use the resulting operator tree instead of the relation."),o.createElement("p",null,"Non-correlated means that it must not reference/use any columns of tables defined in the outer scope.",o.createElement("br",null),'This limitation is intentionally because the translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("code",{className:"example sql"},"select distinct * from R, (select * from S where a > 0) as x where x.a = R.a"),o.createElement("h4",{id:"sql-where"},"WHERE"),o.createElement("p",null,"The boolean condition in the where-clause can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The where clause is directly translated to an ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," with the very same condition. This selection is applied after joining relations of the from-clause therefore has to use the original column names."),o.createElement("p",null,"Subquery Expressions like ",o.createElement("code",null,"EXISTS"),", ",o.createElement("code",null,"IN"),", ",o.createElement("code",null,"ANY/SOME")," or ",o.createElement("code",null,"ALL"),"are ",o.createElement("strong",null,"not supported"),' because their translation into relational algebra is not trivial and modern database systems use an extended set of operators internally that do not require a one-to-one translation into "classNameical" relational algebra. Therefore the learning effect for users of this tool would not be that big.'),o.createElement("h4",{id:"sql-groupby"},"GROUP BY"),o.createElement("p",null,"The GROUP-BY-clause takes a list of column names only argument."),o.createElement("p",null,"The GROUP-BY-clause is directly translated to the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," and is executed directly after the selection built from the WHERE-clause and before the projection/renaming build from the SELECT-clause. Therefore the column names that can be used are the ones available after all joining all tables."),o.createElement("p",null,"The aggregations used in the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation")," are taken from the SELECT-clause and an output-name must be given using ",o.createElement("code",null,"as"),"because the tool requires every column to have a name."),o.createElement("p",null,"If no aggregations are present in the SELECT-clause a projection is used instead of the group-by operation because ",o.createElement("a",{href:"#relalg-operations-groupby"},"sigma")," without aggregation has the very same effect."),o.createElement("p",null,"Every non-aggregation-column in the SELECT-clause must be present in the group by clause because the would not be available after the grouping."),o.createElement("h4",{id:"sql-having"},"HAVING"),o.createElement("p",null,"The HAVING-Clause represents an optional ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection"),". The boolean condition can be any ",o.createElement("a",{href:"#sql-valueexpr"},"expression")," evaluating to boolean."),o.createElement("p",null,"The resulting selection is executed directly after the ",o.createElement("a",{href:"#relalg-operations-groupby"},"relational algebra group-by operation"),"."),o.createElement("p",null,"Unlike ",o.createElement("a",{href:"http://www.postgresql.org/docs/9.4/static/sql-select.html#SQL-HAVING",target:"_blank"},"PostgreSQL"),"the HAVING-clause is only allowed when either a aggregation or grouping is present."),o.createElement("h4",{id:"sql-orderby"},"ORDER BY"),o.createElement("p",null,"Order by takes a list of column names or indices of columns (starting with 1) as its argument."),o.createElement("p",null,"It is directly translated to the ",o.createElement("a",{href:"#relalg-operations-orderby"},"extended relational algebra operation order by (tau)"),"."),o.createElement("h4",{id:"sql-limit"},"LIMIT"),o.createElement("p",null,"The LIMIT-clause can be either specified with the LIMIT-OFFSET syntax used by PostgreSQL and MySQL or the FETCH-FIRST syntax introduced in SQL:2008."),o.createElement("p",null,"It is translated into a ",o.createElement("a",{href:"#relalg-operations-selection"},"relational algebra selection")," using the",o.createElement("code",null,"rownum()"),"-function to limit the number of rows returned."),o.createElement("h4",{id:"sql-setoperators"},"UNION / INTERSECT / EXCEPT"),o.createElement("p",null,"The Set-Operators UNION, INTERSECT and EXCEPT directly map to the relational algebra operators ",o.createElement("a",{href:"#relalg-operations-union"},"union"),", ",o.createElement("a",{href:"#relalg-operations-intersection"},"intersection")," and ",o.createElement("a",{href:"#relalg-operations-subtraction"},"subtraction"),"."),o.createElement("p",null,"The keyword ",o.createElement("code",null,"DISTINCT")," is optional because it represents the default behavior. The keyword",o.createElement("code",null,"ALL")," is ignored and a warning is shown because the targeted relational algebra has a implicit elimination duplicate rows."),o.createElement("p",null,"Parentheses can be used to create more complex statements:",o.createElement("br",null),o.createElement("code",{className:"example sql"},"( select distinct * from S union select distinct * from T ) except select distinct * from T order by 1 limit 1")),o.createElement("h4",{id:"sql-with"},"WITH"),o.createElement("p",null,"The WITH-clause (also known as ",o.createElement("i",null,"common table expressions"),") provides a way to define subqueries for single or multiple use in a statement. This can be thought as defining a temporary table for that query in SQL terminology or ",o.createElement("a",{href:"#relalg-assignment"},"creating variables in relational algebra"),". Recursive evaluation is not supported."),o.createElement("p",null,"Each subquery can be referenced by the name from the WITH-clause. The subquery is automatically renamed to the name used in the WITH-clause."),o.createElement("h4",{id:"sql-valueexpr"},"Value expressions"),o.createElement("p",null,"Value expressions are used for boolean expressions for WHERE- and HAVING-clause, the boolean conditions of joins and calculated values in the SELECT-clause. The type of a expression is either ",o.createElement("i",null,"string"),", ",o.createElement("i",null,"number"),", ",o.createElement("i",null,"date")," or ",o.createElement("i",null,"boolean")," and is determined by the used operations and columns."),o.createElement("p",null,"The supported functions and operations are the same for SQL and relational algebra: ",o.createElement("a",{href:"#relalg-valueexpr"},"value expression")),o.createElement("h2",{id:"license-help"},"Licence"),o.createElement("p",null,o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},o.createElement("img",{alt:"Creative Commons License",style:{borderWidth:0},src:"https://i.creativecommons.org/l/by-sa/4.0/88x31.png"})),o.createElement("br",null),"This document by Johannes Kessler is licensed under a ",o.createElement("a",{rel:"license",href:"http://creativecommons.org/licenses/by-sa/4.0/"},"Creative Commons Attribution-ShareAlike 4.0 International License"),".")))))}}n("./src/calc2/views/landing.css");class Vn extends o.Component{componentDidMount(){Fn("#exec1").click((function(){Fn(this).addClass("hidden"),Fn(this).next().removeClass("hidden")}))}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Un,null),o.createElement("div",{className:"view-content"},o.createElement("div",{className:"container"},o.createElement("div",{className:"row"},o.createElement("div",{className:"col-md-12"},o.createElement("div",{className:"jumbotron",id:"landing-header-bar"},o.createElement("div",{className:"col-md-12 ct",id:"logos"},o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_blue_large.png",alt:"Databases and Information Systems (DBIS)",width:"159",height:"120"})),o.createElement("a",{href:"http://www.uibk.ac.at/",target:"_blank"},o.createElement("img",{src:"assets/logos/Logos_uni_uni_2017_rgb_transparent.png",alt:"University of Innsbruck",width:"300",height:"120"}))),o.createElement("div",{className:"col-md-12 ct"},o.createElement("h1",{id:"heading"},"RelaX - relational algebra calculator"),o.createElement("p",null,"calculates any relational algebra statement like ",o.createElement("code",null,o.createElement("span",null,"( σ ",o.createElement("sub",null,"a > 42")," ( A ) ) ",o.createElement("span",{className:"math"},"⋈")," ( π ",o.createElement("sub",null,"a,b")," ( B ) )"))," on a set of relations.")),o.createElement("div",{className:"col-md-12 ct"},o.createElement(Xe,{className:"btn btn-primary btn-lg getStartedBtn",role:"button",to:"/relax/calc"},"Get Started"))),o.createElement("h2",null,"What is the relational algebra calculator?"),o.createElement("p",null,"If you want to learn SQL you take a database system and try some queries.",o.createElement("br",null),"But if you want to learn relational algebra what do you use? Pen and paper?"),o.createElement("p",null,"The relational algebra calculator helps you learn relational algebra (RelAlg) by executing it."),o.createElement("div",{className:"example"},"Subjects =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"Maths"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"English"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")))))),"Students =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"stId"),o.createElement("th",null,"name"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"John"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"Mike"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"Julia")))))),"Marks =",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"suId"),o.createElement("th",null,"stId"),o.createElement("th",null,"mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"B"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"0")),o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"A"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"3")),o.createElement("td",null,o.createElement("span",{className:"number"},"2")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"number"},"4")),o.createElement("td",null,o.createElement("span",{className:"number"},"1")),o.createElement("td",null,o.createElement("span",{className:"string"},"C")))))),o.createElement("br",null),o.createElement("div",null,o.createElement("span",null,o.createElement("span",{className:"math"}," π "),o.createElement("sub",null," studentName, subjectName, mark "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," studentName←st.name, subjectName←su.name "),"( ",o.createElement("span",null,"( ",o.createElement("span",null,"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," su "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Subjects"))," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," σ "),o.createElement("sub",null,"mark≥'C' "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null," m "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Marks"))," )")," )")," )")," )",o.createElement("span",{className:"math"}," ⨝ "),o.createElement("sub",null," m.stId=st.stId "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"}," ρ "),o.createElement("sub",null,"st "),"( ",o.createElement("span",null,o.createElement("span",{className:"math"},"Students"))," )")," )")," )")," )")),"=",o.createElement("button",{type:"button",className:"btn",id:"exec1"},"execute"),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed table-inline hidden"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"st.studentName"),o.createElement("th",null,"su.subjectName"),o.createElement("th",null,"m.mark"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Lisa")),o.createElement("td",null,o.createElement("span",{className:"string"},"Computing")),o.createElement("td",null,o.createElement("span",{className:"string"},"C"))),o.createElement("tr",null,o.createElement("td",null,o.createElement("span",{className:"string"},"Mike")),o.createElement("td",null,o.createElement("span",{className:"string"},"History")),o.createElement("td",null,o.createElement("span",{className:"string"},"F"))))))),o.createElement("h2",null,"Calculator features:"),o.createElement("ul",null,o.createElement("li",null,"supports most common operators",o.createElement("ul",null,o.createElement("li",null,"projection"),o.createElement("li",null,"selection"),o.createElement("li",null,"rename relations"),o.createElement("li",null,"rename columns"),o.createElement("li",null,"group by"),o.createElement("li",null,"intersect"),o.createElement("li",null,"union"),o.createElement("li",null,"set difference"),o.createElement("li",null,"cross join"),o.createElement("li",null,"theta join"),o.createElement("li",null,"natural join"),o.createElement("li",null,"natural left outer join"),o.createElement("li",null,"natural right outer join"),o.createElement("li",null,"natural full outer join"),o.createElement("li",null,"theta left outer join"),o.createElement("li",null,"theta right outer join"),o.createElement("li",null,"theta full outer join"),o.createElement("li",null,"left semi join"),o.createElement("li",null,"right semi join"),o.createElement("li",null,"anti join join"),o.createElement("li",null,"order by"))),o.createElement("li",null,"runs in any modern browser. no plugins needed"),o.createElement("li",null,"text based approach. lets you write RelAlg as easy as SQL"),o.createElement("li",null,"code editor with syntax highlighting and code completion"),o.createElement("li",null,"pre defined sets of relations"),o.createElement("li",null,"visualize statement in a operator tree"),o.createElement("li",null,"plain text alternatives for special symbols like σ or ",o.createElement("span",{className:"math"},"⋈")),o.createElement("li",null,"variables can be used to simplify expressions"),o.createElement("li",null,"new temporal relations can be declared in the statement"),o.createElement("li",null,"sql like comments"),o.createElement("li",null,"arbitrary boolean expressions in conditions"),o.createElement("li",null,"operations keep original order for better traceability"),o.createElement("li",null,"translates simple SQL-statements to RelAlg",o.createElement("ul",null,o.createElement("li",null,"no support for correlated sub-statements")))),o.createElement("h2",null,"Available data"),"You can either use one of the following datasets or create a new one.",o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Name"),o.createElement("th",null,"Source"),o.createElement("th",null,"Language"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"Kemper Datenbanksysteme"),o.createElement("td",null,o.createElement("a",{href:"http://www3.in.tum.de/teaching/bookDBMSeinf/"},"Alfons Kemper, André Eickler: Datenbanksysteme: Eine Einführung 8. Auflage"),", Seite 84, Abbildung 3.8"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - KursDB"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"UIBK - R, S, T"),o.createElement("td",null,"Tables from and for the lecture ",o.createElement("a",{href:"http://dbis-informatik.uibk.ac.at/249-0-VO-Datenbanksysteme.html",target:"_blank"},"Databases: Foundations, Data Models and System Concepts - University of Innsbruck")," chapter 3"),o.createElement("td",null,"de")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.1"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 52-55"),o.createElement("td",null,"en")),o.createElement("tr",null,o.createElement("td",null,"The Complete Book - Exercise 2.4.3"),o.createElement("td",null,"Sample Data from",o.createElement("a",{href:"http://infolab.stanford.edu/~ullman/dscb.html"},"Database Systems The Complete Book 2nd Edition by Hector Garcia-Molina, Jeff Ullman, and Jennifer Widom"),": Exercise 2.4.1 Page 55-57"),o.createElement("td",null,"en"))))),o.createElement("h2",null,"What it is not:"),o.createElement("p",null,"The tool is not meant to be a full database system. The goal of the implementation was to create a tool to support people to learn RelAlg."),o.createElement("div",{className:"scroll-x"},o.createElement("table",{className:"table table-condensed"},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null," "),o.createElement("th",null,"Pen and Paper"),o.createElement("th",null,"relational algebra calculator"),o.createElement("th",null,"MySQL"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("th",null,"SQL support"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes :-)"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," basic SQL"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"relational algebra"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"use variables for RelAlg"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"large datasets"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes")),o.createElement("tr",null,o.createElement("th",null,"query plan"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"intermediate results"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no")),o.createElement("tr",null,o.createElement("th",null,"iterative working"),o.createElement("td",null,o.createElement("span",{className:"fa fa-times"})," no"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"),o.createElement("td",null,o.createElement("span",{className:"fa fa-check"})," yes"))))),o.createElement("h2",{id:"changelog"},"Changelog"),o.createElement("ul",null,o.createElement("li",null,"0.20",o.createElement("ul",null,o.createElement("li",null,"added option to automatically replace operators in relational algebra: all plaintext-syntax operators get replaced with the equivalent mathematical symbol or vice versa."))),o.createElement("li",null,"0.19",o.createElement("ul",null,o.createElement("li",null,"added datepicker to quickly insert a date literal"))),o.createElement("li",null,"0.18",o.createElement("ul",null,o.createElement("li",null,"added support for the ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"LIKE-operator")," for SQL and relational algebra",o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi 'abc' like 'a%'->x R")),o.createElement("li",null,"added translation support for the calculator using ",o.createElement("a",{href:"http://i18next.com/",target:"_blank"},"i18next"),". This allows easy translation of the main calculator into other languages."),o.createElement("li",null,"calculator is now available in ",o.createElement("a",{href:"calc.htm?lang=de"},"german")),o.createElement("li",null,"ported project to ES2015 (it now gets transpiled to ES5 and packed using ",o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel.js"),"and ",o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify"),")"))),o.createElement("li",null,"0.17",o.createElement("ul",null,o.createElement("li",null,"fixed bug: inline-table-editor not working"),o.createElement("li",null,"fixed bug: formula for !a was not working"))),o.createElement("li",null,"0.16",o.createElement("ul",null,o.createElement("li",null,"disallow relational algebra keywords as column-/relation-names"),o.createElement("li",null,"fixed precedence for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE-WHEN-expressions")),o.createElement("li",null,"added support for the SQL-92 ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},o.createElement("code",null,"||"),"-concat operator")),o.createElement("li",null,"added ",o.createElement("code",null,"except")," as alternative syntax for the ",o.createElement("a",{href:"/relax/help#relalg-operations-subtraction"},"relational algebra set-difference operator")),o.createElement("li",null,"fixed bug where ",o.createElement("code",null,"A=R join S A")," was interpreted as",o.createElement("code",null,"A=(R join S A)")," instead of ",o.createElement("code",null,"A=(R join S) A"),".",o.createElement("br",null),"see ",o.createElement("a",{href:"/relax/help#relalg-operations-innerjoin"},"help page")," for more information"))),o.createElement("li",null,"0.15",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"hour(), minute() and second()")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"now()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi hour(now())->x, minute(now())->y, second(now())->z ( R )")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"n-ary concat"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi concat(b, '_', c)->x R")),o.createElement("li",null,"added support for WITH-clauses for SQL"))),o.createElement("li",null,"0.14",o.createElement("ul",null,o.createElement("li",null,"improve error message for theta-joins with conflicting columns"),o.createElement("li",null,"improve error message and added example for assignments without query error"),o.createElement("li",null,"bugfix: calculator-tour did not work correctly for Edge on Windows 10"))),o.createElement("li",null,"0.13",o.createElement("ul",null,o.createElement("li",null,'updated to CodeMirror version 5.1 with "experimental mobile support"'),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"COALESCE()"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"pi coalesce(a, b, 1)->x R"),", ",o.createElement("code",null,"select coalesce(a, b, 1) as x from R")),o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"CASE WHEN"),o.createElement("br",null),"e.g. ",o.createElement("code",null,"select case when a > 3 then a+1 else a end as x from R")),o.createElement("li",null,"added support for complex union/intersect/except statements for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"(select * from S union ( select * from T except select * from T )) order by 1")))),o.createElement("li",null,"0.12",o.createElement("ul",null,o.createElement("li",null,"added support for more complex FROM-clauses for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct * from R, (S natural join T)")),o.createElement("li",null,"simplify and link the syntax diagrams at the help page"))),o.createElement("li",null,"0.11",o.createElement("ul",null,o.createElement("li",null,"added a tour to explain the main features of the tool to new users (using ",o.createElement("a",{href:"http://bootstraptour.com/",target:"_blank"},"Bootstrap Tour"),")"),o.createElement("li",null,"added ",o.createElement("a",{href:"/relax/help#sql-reference"},"reference for SQL in the help section")),o.createElement("li",null,"added support for USING clause for joins for SQL"),o.createElement("li",null,"added support FETCH FIRST syntax (SQL:2008) for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select * from R offset 2 rows fetch first 10 rows only")),o.createElement("li",null,"allow DISTINCT on set operators for SQL"),o.createElement("li",null,"bugfix: having should be allowed without group by if aggregation is used"))),o.createElement("li",null,"0.10",o.createElement("ul",null,o.createElement("li",null,"added support for ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"arithmetic expressions and functions")," for SQL",o.createElement("br",null),"e.g. ",o.createElement("code",null,"select distinct a+2 as x from R where length(b) > 2")),o.createElement("li",null,"show warnings instead of errors when not using distinct or using all on set operators in SQL"))),o.createElement("li",null,"0.9",o.createElement("ul",null,o.createElement("li",null,"added support for arithmetic operators and functions in ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"(e.g boolean) expressions")," for relational algebra"),o.createElement("li",null,"projection supports ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"expressions")),o.createElement("li",null,"removed magic ",o.createElement("a",{href:"/relax/help#relalg-operations-projection"},"ROWNUM")," column; ",o.createElement("a",{href:"/relax/help#relalg-valueexpr"},"ROWNUM()")," is now a function"),o.createElement("li",null,"tutorials for ",o.createElement("a",{href:"/relax/help#tutorial-user"},"users")," and ",o.createElement("a",{href:"/relax/help#tutorial-maintainer"},"maintainers")),o.createElement("li",null,"new braces handling in formula generation (braces are only placed if necessary)"),o.createElement("li",null,"bugfix: rename not existent column was silently ignored"),o.createElement("li",null,"syntax of dates has changed ",o.createElement("code",null,"1970-01-01")," could not be used any more because it is ambiguous (arithmetic operaton or date). The SQL notation (",o.createElement("code",null,"date('1970-01-01')"),") is now used for the relational algebra mode."))),o.createElement("li",null,"0.8",o.createElement("ul",null,o.createElement("li",null,"grid editor for inline relations"),o.createElement("li",null,"sql-dump import (beta)"),o.createElement("li",null,"group editor"),o.createElement("li",null,"changed the basic structure of the editors (internally)"),o.createElement("li",null,"duplicate rows are removed in every step")))),o.createElement("h2",null,"Who?"),o.createElement("p",null,"The relational algebra calculator was created by Johannes Kessler BSc at ",o.createElement("a",{href:"https://dbis-informatik.uibk.ac.at/1-1-Home.html"},"Databases and Information Systems Group")," at the ",o.createElement("a",{href:"http://informatik.uibk.ac.at/"},"Institute of Computer Science")," at the ",o.createElement("a",{href:"http://www.uibk.ac.at/index.html.en"},"University of Innsbruck")," under supervision of Michael Tschuggnall PhD and Prof. Dr. Günther Specht"),o.createElement("h2",null,"External resources"),o.createElement("p",null,"This tool was not written from scratch but many different external resources/frameworks/projects/libs are used."),o.createElement("p",null,"This is a list of resources/frameworks/projects/libs used for this tool (in alphabetical order) to give credit where credit is due and guide anyone interested to them without having to look through the code."),o.createElement("ul",null,o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://babeljs.io/"},"Babel JavaScript compiler")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://blanketjs.org/"},"blanket.js")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://botmonster.com/jquery-bootpag/"},"bootpag")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://getbootstrap.com/"},"Bootstrap")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://bootstrap-datepicker.readthedocs.org"},"bootstrap-datepicker")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://bootstraptour.com/"},"Bootstrap Tour")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://browserify.org/"},"Browserify")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codemirror.net/"},"CodeMirror")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://codepen.io/Pestov/pen/BLpgm"},"CSS3 family tree by Ilya Pestov")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://www.gnu.org/software/freefont/"},"FreeSans by GNU FreeFont")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://gruntjs.com/"},"Grunt")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handlebarsjs.com/"},"handlebars")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://handsontable.com/"},"Handsontable")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://i18next.com/"},"i18next")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://jquery.com/"},"jQuery")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/chjj/marked"},"marked - a markdown parser")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://pegjs.org/"},"PEG.js - Parser Generator for JavaScript")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"http://qunitjs.com/"},"QUnit - js unit testing")),o.createElement("li",null,o.createElement("a",{target:"_blank",href:"https://github.com/tabatkins/railroad-diagrams"},"tabatkins/railroad-diagrams"))))))))}}class qn extends o.Component{componentDidMount(){}render(){return o.createElement("div",{className:"view-max"},o.createElement(An,null),o.createElement(Un,null),o.createElement("div",{className:"view-min"},"Databases and Information System",o.createElement("br",null),"Universität Innsbruck",o.createElement("br",null),"ICT - building, second floor",o.createElement("br",null),"Technikerstrasse 21a",o.createElement("br",null),"A-6020 Innsbruck",o.createElement("br",null)))}}n("./src/calc2/style/index.scss");class Gn extends o.Component{constructor(e){super(e),this.state={isNavbarOpen:!0}}componentDidMount(){var e;const t=document.getElementById("loadingScreen");null===(e=null==t?void 0:t.parentNode)||void 0===e||e.removeChild(t)}render(){const{store:e}=this.props,{isNavbarOpen:t}=this.state;return o.createElement(Ue,null,o.createElement(f,{store:e},o.createElement(r.a,null,o.createElement(Be,null,o.createElement(Le,{exact:!0,from:"/",to:"/relax/landing"}),o.createElement(Le,{exact:!0,from:"/relax",to:"/relax/landing"}),o.createElement(Pe,{path:"/relax/landing",component:Vn}),o.createElement(Pe,{path:"/relax/help",component:zn}),o.createElement(Pe,{path:"/relax/imprint",component:qn}),o.createElement(Le,{from:"/relax/calc",to:"/relax/calc/local/uibk/local/0",exact:!0,strict:!0}),o.createElement(Pe,{path:"/relax/calc/:source/:id/:filename/:index",component:Yn}),o.createElement(Pe,{path:"/relax/calc/:source/:id",component:Yn}),o.createElement(Pe,{path:"/relax/calc/:source/:id/:filename/:index",component:Yn}),o.createElement(Pe,{path:"/relax/api/:source/:id",component:Yn}),o.createElement(Pe,{render:e=>o.createElement("div",{className:"view-min"},o.createElement("h1",null,"404"),o.createElement("p",null,"This route doesn't exist"),o.createElement("span",null,JSON.stringify(e)))})))))}}},"./src/calc2/style/index.scss":function(e,t,n){},"./src/calc2/utils/groupUtils.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return c}));var r=n("./src/db/relalg.ts"),o=n("./node_modules/jquery/dist/jquery.js");const i=n("./src/calc2/data/uibk.txt"),a={uibk:i.default?i.default:""};function s(e,t,n){return u(Object(r.c)(e),t,n)}function l(e,t,n){if(0===(e=e.filter(({name:e})=>e===t)).length)return{fallback:n};let r=null;const o={};for(let t=0;t{switch(e){case"gist":o.ajax({url:`https://api.github.com/gists/${t}`,dataType:"json",success:function(o){const a=[];for(const u in o.files){if(!o.files.hasOwnProperty(u))continue;const c=null===o.owner?"anonymous":o.owner.login,d=null===o.owner?void 0:o.owner.html_url,h={source:e,id:o.id,filename:u,index:-1,maintainer:n,maintainerGroup:r},f={author:c,authorUrl:d,lastModified:new Date(o.updated_at),url:o.url};try{a.push(...s(o.files[u].content,h,f)),i(a)}catch(e){const n='could not parse given group from gist with id "'+t+'": '+e;console.error(n,t,e,u,o),l(new Error(n))}}},crossDomain:!0,statusCode:{404:function(){l(new Error("gist "+t+" not found"))}},async:!0});break;case"local":try{const o=s(a[t],{source:e,id:t,filename:"local",index:-1,maintainer:n,maintainerGroup:r},{});i(o)}catch(e){let t="cannot parse groups file: "+e.message;t+="
              see log for more information",console.error(t,e),l(new Error(t))}break;case"http":{const e="parsing groups from arbitrary urls is no longer supported; use github gists instead.";window.alert(e),l(new Error(e));break}default:l(new Error("unknown source "+e))}})}},"./src/calc2/views/help.css":function(e,t,n){},"./src/calc2/views/landing.css":function(e,t,n){},"./src/db/exec/Column.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r{constructor(e,t,n="null"){this._type="null",this._name=e,this._relAlias=t,this._type=n}getName(){return this._name}getRelAlias(){return this._relAlias}getType(){return this._type}setRelAlias(e){this._relAlias=e}toString(){return r.printColumn(this._name,this._relAlias)}equals(e){return this._name===e._name&&this._relAlias===e._relAlias}static printColumn(e,t){let n;return n="number"==typeof e?`[${e}]`:e,null===t?n:`${t}.${n}`}}},"./src/db/exec/ExecutionError.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));class r extends Error{constructor(e,t){super(e),this.codeInfo=t||void 0}}},"./src/db/exec/RANode.ts":function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n("./src/db/exec/ExecutionError.ts");class o{constructor(e=""){this._codeInfo=null,this._metaData={},this._resultNumRows=-1,this._wrappedInParentheses=!1,this._warnings=[],this._functionName=e}setCodeInfoObject(e){return this._codeInfo=e,this}addWarning(e,t){const n={message:e,codeInfo:void 0};t&&(n.codeInfo=t),this._warnings||(this._warnings=[]),this._warnings.push(n)}setWrappedInParentheses(e=!0){this._wrappedInParentheses=e}throwExecutionError(e){throw new r.a(e,this._codeInfo)}setMetaData(e,t){this._metaData[e]=t}hasMetaData(e){return void 0!==this._metaData[e]}getMetaData(e){return this._metaData[e]}getResultNumRows(){if(void 0===this._resultNumRows||-1===this._resultNumRows)throw new Error("result num rows not set! call only after getResult");return this._resultNumRows}setResultNumRows(e){this._resultNumRows=e}_returnOrCreateSession(e){return void 0===e?{statement_timestamp:new Date}:e}getArgumentHtml(){return""}static foreachRecursive(e,t){t(e),e instanceof a?t(e.getChild()):e instanceof s&&(t(e.getChild()),t(e.getChild2()))}}class i extends o{getWarnings(e){return this._warnings}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class a extends o{constructor(e,t){super(e),this._child=t}getChild(){return this._child}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses&&!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}class s extends o{constructor(e,t,n){super(e),this._child=t,this._child2=n}getChild(){return this._child}getChild2(){return this._child2}getWarnings(e){return!0===e?[...this._warnings,...this.getChild().getWarnings(!0),...this.getChild2().getWarnings(!0)]:[...this._warnings]}getFormulaHtml(e=!0,t=!0){const n=!0===this._wrappedInParentheses||!0===t;return`${n?"(":""}\n\n\t\t\t\t\n\t\t\t\t\t${!0===e?this.getChild().getFormulaHtml(e,!0):""}\n\t\t\t\t\t${this._functionName}\n\t\t\t\t\t${this.getArgumentHtml()}\n\t\t\t\t\t${!0===e?this.getChild2().getFormulaHtml(e,!0):""}\n\t\t\t\t\n\t\t\t${n?")":""}`}}},"./src/db/exec/Relation.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./src/db/exec/RANode.ts"),o=n("./src/db/exec/Table.ts");class i extends r.b{constructor(e,t){super(e),this._schema=null,void 0===t?this._table=new o.a:(t.check(),this._schema=t.getSchema(),this._table=t.getResult())}setSchema(e,t=!1){return this._schema=e.copy(),!0!==t&&this._schema.setRelAlias(this._functionName),this._table.setSchema(this._schema),this}addRow(e){this._table.addRow(e)}addRows(e){this._table.addRows(e)}getResultNumRows(){return this._resultNumRows}getResult(e){this._returnOrCreateSession(e);const t=this._table.copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}getSchema(){return this._table.getSchema()}getName(){return this._functionName}check(){}hasChild(){return!1}copy(){if(null===this._schema)throw new Error("check not called");const e=new i(this._functionName);return e.setSchema(this._schema),e._table=this._table.copy(),e}}},"./src/db/exec/Schema.ts":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n("./node_modules/i18next/dist/es/index.js"),o=n("./src/db/exec/Column.ts");class i{constructor(){this._names=[],this._relAliases=[],this._types=[],this._size=0,this._colIndexPerName={}}getSize(){return this._size}addColumn(e,t,n){if("string"!==n&&"date"!==n&&"number"!==n&&"boolean"!==n)throw new Error("unknown type! "+n);this._names.push(e),this._relAliases.push(t),this._types.push(n);const o=this._size;if(!1===this.isUnique(o))throw new Error(r.a("db.messages.exec.error-column-not-unique",{column:t+"."+e}));return this._addColToIndex(e,o),this._size++,this}addColumn2(e){return this.addColumn(e.getName(),e.getRelAlias(),e.getType())}_addColToIndex(e,t){void 0===this._colIndexPerName[e]?this._colIndexPerName[e]=[t]:this._colIndexPerName[e].push(t)}_removeColFromIndex(e){const t=this._names[e],n=this._colIndexPerName[t];n.splice(n.indexOf(e,0),1),0===n.length&&delete this._colIndexPerName[t]}removeColumn(e){this._names.splice(e,1),this._relAliases.splice(e,1),this._types.splice(e,1),this._size--;for(let t=e;tthis._size)throw new Error(r.a("db.messages.exec.error-column-index-out-of-range",{column:o.a.printColumn(e,t),schema:this.toString()}));if(null===t)return[n];if(this._relAliases[n]===t)return[n]}return[]}getType(e){return this._types[e]}equals(e){if(!1===this.equalsTypeOnly(e))return!1;for(let t=0;t1}getName(e){return this._names[e]}getFullName(e){return(this._relAliases[e]?this._relAliases[e]+".":"")+this._names[e]}toString(){const e=[];for(let t=0;t'+Object(r.d)(n,o)+"
              "}getRows(e=0,t){if(0===e&&void 0===t)return this._rows;{const n=this._rows.length;let r=n;t&&t>0&&(r=Math.min(n,e+t)),this._rows.slice(e,r);const o=[];for(let t=e;t"+n.getName()+"":""+n.toString()+""}o+="";let i="";const a=this.getNumRows();let s=a;t&&t>0&&(s=Math.min(a,n+t));for(let e=n;e"+this.getValueHtmlAt(e,n)+"";i+=t+""}return""+o+i+"
              "}equals(e){if(e instanceof a==!1)throw new Error("can not compare");if(!1===this._schema.equals(e._schema))return!1;if(this._rows.length!==e._rows.length)return!1;for(let t=0;tn)throw new Error("invalid sort cols");for(let e=0;e=n||r[e]<0)throw new Error("invalid sort cols");const i=r.length;if(i!==o.length)throw new Error("invalid sort cols");const a=r.map(e=>this._schema.getType(e)),s=function(e,t,n,r,o){const i=e[n],a=t[n];if(null===i&&null===a)return 0;if(null===i&&null!==a)return 1*r;if(null!==i&&null===a)return-1*r;switch(o){case"number":case"date":case"boolean":return r*(i-a);case"string":return r*i.localeCompare(a);case"null":return 0}};this._rows.sort((function(e,t){let n=0;for(let l=0;l=e.length?t[this._index-e.length]:e[this._index]}toString(){return o.a.printColumn(this._name,this._relAlias)}getFormulaHtml(){const e=o.a.printColumn(this._name,this._relAlias);return!0===this._wrappedInParentheses?"("+e+")":e}static _getColumnIndex(e,t,n,r){if(!t||null===t)return e.getColumnIndex(n,r,!0);const o=e.getColumnIndex(n,r,!1);return-1===o?t.getColumnIndex(n,r,!0)+e.getSize():(t.getColumnIndex(n,r,!1),o)}static _getType(e,t,n){return n>=e.getSize()?t.getType(n-e.getSize()):e.getType(n)}}class u extends s{constructor(e,t,n){super(),this._func=t,this._dataType=e,this._dataTypeCalculated=null,this._args=n||[]}evaluate(e,t,n,r){switch(this._dataType){case"string":return this._evaluateString(e,t,n,r);case"number":return this._evaluateNumber(e,t,n,r);case"boolean":return this._evaluateBoolean(e,t,n,r);case"date":return this._evaluateDate(e,t,n,r);case"null":return this._evaluateNull(e,t,n,r);default:throw new Error("this should not happen!")}}_parseIsoDate(e){const t=/^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$/.exec(e);if(null===t)throw new r.a(i.a("db.messages.exec.error-invalid-date-format",{str:e}),this._codeInfo);const n=parseInt(t[1],10),o=parseInt(t[2],10)-1,a=parseInt(t[3],10),s=new Date(n,o,a);return s.getFullYear()===n&&s.getMonth()===o&&s.getDate()===a||this.throwExecutionError(i.a("db.messages.exec.error-invalid-date-format",{str:e})),s}_evaluateNull(e,t,n,r){switch(this._func){case"constant":return null;case"coalesce":for(let o=0;o1&&this._args[1].evaluate(e,t,n,r),null===o||this._args.length>1&&null===i)return null;switch(this._func){case"date":return this._parseIsoDate(o);case"adddate":return new Date(o.getTime()+864e5*i);case"subdate":return new Date(o.getTime()-864e5*i);default:throw new Error("this should not happen!")}}_checkDate(e,t){switch(this._func){case"transaction_timestamp":case"statement_timestamp":case"clock_timestamp":case"now":return!0;case"date":return this._checkArgsDataType(e,t,["string"]);case"adddate":case"subdate":return this._checkArgsDataType(e,t,["date","number"]);default:throw new Error("this should not happen!")}}_evaluateBoolean(e,t,n,r){let o,i,a;if("constant"===this._func)return this._args[0];switch(o=this._args[0].evaluate(e,t,n,r),i=this._args.length>1&&this._args[1].evaluate(e,t,n,r),this._func){case"not":return"unknown"===o?o:!o;case"and":return!1!==o&&!1!==i&&(!0===o&&!0===i||"unknown");case"or":return!0===o||!0===i||(!1!==o||!1!==i)&&"unknown";case"xor":return"unknown"===o||"unknown"===i?"unknown":o!==i;case"=":case">=":case"<=":case">":case"<":case"!=":return a=this._args[0].getDataType(),u._condition_compare(o,i,a,this._func);case"like":case"ilike":if(!this._regex)throw new Error("regex should have been set by check");return this._regex.test(o);default:throw new Error("this should not happen!")}}static _condition_compare(e,t,n,r){if(null===e||null===t)switch(r){case"=":case">=":case"<=":return e===t||"unknown";case"<":case">":return e!==t&&"unknown";case"!=":return e!==t;default:throw new Error("unknown operator")}switch(n){case"number":case"string":switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}case"date":switch(r){case"=":return e.getTime()===t.getTime();case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e.getTime()!==t.getTime();default:throw new Error("unknown operator")}case"boolean":if("boolean"!=typeof e||"boolean"!=typeof t)throw new Error("operands have different type");switch(r){case"=":return e===t;case">":return e>t;case"<":return e=":return e>=t;case"<=":return e<=t;case"!=":return e!==t;default:throw new Error("unknown operator")}default:throw new Error("unknown type "+n)}}_checkBoolean(e,t){let n,r;switch(this._func){case"constant":return!0;case"not":return this._checkArgsDataType(e,t,["boolean"]);case"and":case"or":case"xor":return this._checkArgsDataType(e,t,["boolean","boolean"]);case"=":case">=":case"<=":case">":case"<":case"!=":return this._args[0].check(e,t),this._args[1].check(e,t),n=this._args[0].getDataType(),r=this._args[1].getDataType(),"null"===n||"null"===r?!0:n===r||(this.throwExecutionError(i.a("db.messages.exec.error-could-not-compare-different-types",{typeA:n,typeB:r})),this._checkArgsDataType(e,t,["boolean","boolean"]));case"like":case"ilike":if(this._args[0].check(e,t),"string"!==this._args[1].getDataType()||"constant"!==this._args[1]._func)return!1;const o=this._args[1]._args[0];let a=String(o).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");a=a.replace(/([^\\]?)_/g,"$1."),a=a.replace(/([^\\]?)%/g,"$1.*");const s="ilike"===this._func?"i":"";this._regex=new RegExp("^"+a+"$",s);break;default:throw new Error("this should not happen!")}}_evaluateString(e,t,n,r){switch(this._func){case"constant":return this._args[0];case"lower":case"upper":const o=this._args[0].evaluate(e,t,n,r);return null===o?null:"lower"===this._func?o.toLowerCase():o.toUpperCase();case"concat":let i="";for(let o=0;o0?this._args[0].evaluate(e,t,n,r):void 0,i=this._args.length>1?this._args[1].evaluate(e,t,n,r):void 0;switch(this._func){case"add":return null===o||null===i?null:o+i;case"sub":return null===o||null===i?null:o-i;case"mul":return null===o||null===i?null:o*i;case"div":return null===o||null===i?null:o/i;case"mod":return null===o||null===i?null:o%i;case"abs":return null===o?null:Math.abs(o);case"floor":return null===o?null:Math.floor(o);case"ceil":return null===o?null:Math.ceil(o);case"round":return null===o?null:Math.round(o);case"minus":return null===o?null:-o;case"rand":return Math.random();case"rownum":return n+1;case"strlen":return null===o?null:o.length;case"year":return null===o?null:o.getFullYear();case"month":return null===o?null:o.getMonth()+1;case"dayofmonth":return null===o?null:o.getDate();case"hour":return null===o?null:o.getHours();case"minute":return null===o?null:o.getMinutes();case"second":return null===o?null:o.getSeconds();default:throw new Error("this should not happen!")}}_checkArgsDataType(e,t,n){const r=[];if(this._args.length!==n.length)throw new Error("this should not happen: #args != #types");for(let o=0;o{let t=(e||this._func)+"(";for(let e=0;e{let t="CASE";for(let n=0;n{let t="";return t+=` ${e||this._func} `,t=this._args[0].getFormulaHtml()+t,t+=this._args[1].getFormulaHtml(),`${t}`};function r(){const{_func:r}=this;switch(r){case"constant":return a(this._args[0],this._dataTypeCalculated||this._dataType);case"rand":case"rownum":case"abs":case"ceil":case"floor":case"round":case"year":case"month":case"dayofmonth":case"hour":case"minute":case"second":case"adddate":case"subdate":case"concat":case"upper":case"lower":case"date":case"strlen":return e.call(this,"length");case"minus":return e.call(this,"-");case"not":return e.call(this,"!");case"caseWhen":case"caseWhenElse":return t.call(this,"caseWhenElse"===this._func);case"add":return n.call(this,"+");case"sub":return n.call(this,"-");case"mul":return n.call(this,"*");case"div":return n.call(this,"/");case"mod":return n.call(this,"%");case"and":case"or":case"xor":case"like":case"ilike":case"=":return n.call(this,r);case">=":return n.call(this,"≥");case"<=":return n.call(this,"≤");case">":return n.call(this,">");case"<":return n.call(this,"<");case"!=":return n.call(this,"≠")}return this.toString()}return!0===this._wrappedInParentheses?`(${r.call(this)})`:r.call(this).toString()}}},"./src/db/parser/grammar_ra.pegjs":function(e,t,n){"use strict";function r(e,t,n,o){this.message=e,this.expected=t,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)}!function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(r,Error),r.buildMessage=function(e,t){var n={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,n="";for(t=0;t0){for(t=1,r=1;t",!1),re=(pr("ψ",!1),pr("psi",!0),pr("τ",!1)),oe=function(){return ri("tau")},ie=pr("tau",!0),ae=pr("γ",!1),se=function(){return ri("gamma")},le=pr("gamma",!0),ue=pr("∪",!1),ce=function(){return ri("unionOperator")},de=pr("union",!0),he=pr("∩",!1),fe=function(){return ri("intersectOperator")},me=pr("intersect",!0),pe=pr("÷",!1),ge=pr("/",!1),ye=pr("\\",!1),be=function(){return ri("differenceOperator")},ve=pr("except",!0),_e=pr("⨯",!1),we=pr("x",!1),Ee=function(){return ri("crossJoinOperator")},je=pr("cross",!0),Ce=pr("join",!0),Se=pr("⨝",!1),Oe=pr("⋈",!1),ke=function(){return ri("innerJoinOperator")},Te=pr("inner",!0),Me=function(){return ri("naturalJoinOperator")},xe=pr("natural",!0),Re=pr("⋉",!1),Le=function(){return ri("leftSemiJoinOperator")},Ae=pr("left",!0),De=pr("semi",!0),Ne=pr("⋊",!1),Pe=function(){return ri("rightSemiJoinOperator")},Ie=pr("right",!0),He=pr("▷",!1),Ye=function(){return ri("antiJoinOperator")},Fe=pr("anti",!0),We=pr("⟕",!1),Be=function(){return ri("leftOuterJoinOperator")},Ue=pr("outer",!0),ze=pr("⟖",!1),Ve=function(){return ri("rightOuterJoinOperator")},qe=pr("⟗",!1),Ge=function(){return ri("fullOuterJoinOperator")},Ke=pr("full",!0),Xe=pr(",",!1),$e=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Je=function(e,t){var n=[e];if(null!==t)for(var r in t)n.push(t[r][3]);return n},Qe=pr("asc",!0),Ze=pr("desc",!0),et=pr("sum",!0),tt=pr("count",!0),nt=pr("avg",!0),rt=pr("min",!0),ot=pr("max",!0),it=pr("(",!1),at=pr(")",!1),st=pr("count(*)",!0),lt=function(e){for(var t=[],n=0;n"group"===e.name);if(!r)continue;const o=r.text;t[o]&&mr(ei("db.messages.parser.error-group-non-unique-group-name",{name:o})),t[o]=!0}}(t),{type:"groupRoot",groups:t,codeInfo:ti()}},ut=pr("en",!1),ct=pr("de",!1),dt=pr("es",!1),ht=/^[a-z@]/,ft=gr([["a","z"],"@"],!1,!1),mt=pr(":",!1),pt=/^[a-z]/,gt=gr([["a","z"]],!1,!1),yt=pr("@",!1),bt=pr("[[",!1),vt=pr("\\]]",!1),_t=pr("]]",!1),wt=function(e,t){return function(e,t){var n,r=t[0];r.child=e,r.codeInfo=ni(r.child.codeInfo,r.codeInfo);for(var o=1;o",!1),kt=pr(">=",!1),Tt=pr("≥",!1),Mt=pr(">",!1),xt=pr("<=",!1),Rt=pr("≤",!1),Lt=pr("<",!1),At=yr("logical AND"),Dt=pr("and",!0),Nt=pr("∧",!1),Pt=yr("logical XOR"),It=pr("xor",!0),Ht=pr("⊻",!1),Yt=pr("⊕",!1),Ft=yr("logical OR"),Wt=pr("or",!0),Bt=pr("∨",!1),Ut=yr("logical NOT"),zt=pr("!",!1),Vt=pr("¬",!1),qt=yr("delimiter"),Gt=pr("string",!0),Kt=pr("number",!0),Xt=pr("date",!0),$t=pr("boolean",!0),Jt=pr("null",!1),Qt=pr("NULL",!1),Zt=pr("}",!1),en=/^[\-_a-z0-9.]/i,tn=gr(["-","_",["a","z"],["0","9"],"."],!1,!0),nn=function(e){return{type:"string",value:e,quoted:!0}},rn=pr('"',!1),on=/^[^"\n]/,an=gr(['"',"\n"],!0,!1),sn=pr("{",!1),ln=yr("boolean expression"),un=pr("||",!1),cn=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:ti()}},dn=pr("like",!0),hn=pr("ilike",!0),fn=pr("+",!1),mn=pr("*",!1),pn=pr("%",!1),gn=pr("coalesce",!0),yn=pr("concat",!0),bn=pr("adddate",!0),vn=pr("subdate",!0),_n=pr("mod",!0),wn=pr("add",!0),En=pr("sub",!0),jn=pr("mul",!0),Cn=pr("div",!0),Sn=pr("upper",!0),On=pr("ucase",!0),kn=pr("lower",!0),Tn=pr("lcase",!0),Mn=pr("length",!0),xn=pr("abs",!0),Rn=pr("floor",!0),Ln=pr("ceil",!0),An=pr("round",!0),Dn=pr("year",!0),Nn=pr("month",!0),Pn=pr("day",!0),In=pr("hour",!0),Hn=pr("minute",!0),Yn=pr("second",!0),Fn=pr("dayofmonth",!0),Wn=pr("rand",!0),Bn=pr("rownum",!0),Un=pr("now",!0),zn=pr("current_timestamp",!0),Vn=pr("transaction_timestamp",!0),qn=pr("statement_timestamp",!0),Gn=pr("clock_timestamp",!0),Kn=pr("sysdate",!0),Xn=pr("null",!0),$n=pr("case",!0),Jn=pr("when",!0),Qn=pr("then",!0),Zn=function(e,t){return{w:e,t:t}},er=pr("else",!0),tr=pr("end",!0),nr=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=ti();for(var o=1;olr&&(lr=ir,ur=[]),ur.push(e))}function wr(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function Er(){var e,t,n=135*ir+0,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=function(){var e,t,n,r,i,a,s=135*ir+57,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o&&(r=Br())!==o&&(i=kr())!==o?(ar=e,t=function(e,t){var n=[t];for(var r in e)n.push(e[r][0]);return oi(n),{type:"relalgRoot",assignments:n,child:null,operatorPositions:si,codeInfo:ti()}}(n,r),e=t):(ir=e,e=o)}else ir=e,e=o;if(e===o)if(e=ir,(t=kr())!==o){for(n=[],r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Br())!==o&&(a=Or())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?((r=eo())===o&&(r=null),r!==o&&(i=kr())!==o?(ar=e,t=function(e,t){for(var n=[],r=0;rir?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(s)),cr--,n===o?t=void 0:(ir=t,t=o),dr[r]={nextPos:ir,result:t},t)}function Cr(){var t,n=135*ir+3,r=dr[n];return r?(ir=r.nextPos,r.result):("\r\n"===e.substr(ir,2)?(t="\r\n",ir+=2):(t=o,0===cr&&_r(l)),t===o&&(10===e.charCodeAt(ir)?(t="\n",ir++):(t=o,0===cr&&_r(u))),dr[n]={nextPos:ir,result:t},t)}function Sr(){var t,n=135*ir+4,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=135*ir+5,g=dr[p];if(g)return ir=g.nextPos,g.result;cr++,t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d));n!==o?(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o?(i=ir,cr++,(a=Cr())===o&&(a=jr()),cr--,a!==o?(ir=i,i=void 0):i=o,i!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o);if(t===o&&(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o?(r=ir,cr++,(i=Cr())===o&&(i=jr()),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n=""):(ir=t,t=o)):(ir=t,t=o),t===o))if(t=ir,"--"===e.substr(ir,2)?(n="--",ir+=2):(n=o,0===cr&&_r(d)),n!==o)if(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)),r!==o){for(i=ir,a=[],l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);l!==o;)a.push(l),l=ir,u=ir,cr++,m=Cr(),cr--,m===o?u=void 0:(ir=u,u=o),u!==o?(e.length>ir?(m=e.charAt(ir),ir++):(m=o,0===cr&&_r(s)),m!==o?l=u=[u,m]:(ir=l,l=o)):(ir=l,l=o);(i=a!==o?e.substring(i,ir):a)!==o?(a=ir,cr++,(l=Cr())===o&&(l=jr()),cr--,l!==o?(ir=a,a=void 0):a=o,a!==o?(ar=t,t=n=i):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;cr--,t===o&&(n=o,0===cr&&_r(c));return dr[p]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u,c=135*ir+6,d=dr[c];if(d)return ir=d.nextPos,d.result;t=ir,"/*"===e.substr(ir,2)?(n="/*",ir+=2):(n=o,0===cr&&_r(m));if(n!==o){for(r=ir,i=[],a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);a!==o;)i.push(a),a=ir,l=ir,cr++,"*/"===e.substr(ir,2)?(u="*/",ir+=2):(u=o,0===cr&&_r(p)),cr--,u===o?l=void 0:(ir=l,l=o),l!==o?(e.length>ir?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(s)),u!==o?a=l=[l,u]:(ir=a,a=o)):(ir=a,a=o);(r=i!==o?e.substring(r,ir):i)!==o?("*/"===e.substr(ir,2)?(i="*/",ir+=2):(i=o,0===cr&&_r(p)),i!==o?(ar=t,t=n=r):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function Or(){var t,n,r,i,a,s,l,u=135*ir+7,c=dr[u];if(c)return ir=c.nextPos,c.result;for(cr++,t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(b));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),cr--,(t=n)===o&&(n=o,0===cr&&_r(g)),dr[u]={nextPos:ir,result:t},t}function kr(){var t,n,r=135*ir+8,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));n!==o;)t.push(n),(n=Sr())===o&&(y.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(b)));return cr--,t===o&&(n=o,0===cr&&_r(v)),dr[r]={nextPos:ir,result:t},t}function Tr(){var t,n,r=135*ir+10,i=dr[r];if(i)return ir=i.nextPos,i.result;for(cr++,t=[],_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));n!==o;)t.push(n),_.test(e.charAt(ir))?(n=e.charAt(ir),ir++):(n=o,0===cr&&_r(w));return cr--,t===o&&(n=o,0===cr&&_r(E)),dr[r]={nextPos:ir,result:t},t}function Mr(){var t,n,r,i=135*ir+12,a=dr[i];if(a)return ir=a.nextPos,a.result;for(t=ir,n=[],(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));r!==o;)n.push(r),(r=Sr())===o&&(h.test(e.charAt(ir))?(r=e.charAt(ir),ir++):(r=o,0===cr&&_r(f)));return n!==o&&(ar=t,n=""),t=n,dr[i]={nextPos:ir,result:t},t}function xr(){var t,n,r,i,a,s,l=135*ir+14,u=dr[l];if(u)return ir=u.nextPos,u.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseInt(n,10)),t=n,dr[l]={nextPos:ir,result:t},t}function Rr(){var t,n,r,i,a,s,l,u,c=135*ir+15,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,r=ir,45===e.charCodeAt(ir)?(i="-",ir++):(i=o,0===cr&&_r(k)),i===o&&(i=null),i!==o){if(a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;if(a!==o)if(46===e.charCodeAt(ir)?(s=".",ir++):(s=o,0===cr&&_r(x)),s!==o){if(l=[],T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o)for(;u!==o;)l.push(u),T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M));else l=o;l!==o?r=i=[i,a,s,l]:(ir=r,r=o)}else ir=r,r=o;else ir=r,r=o}else ir=r,r=o;return(n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=parseFloat(n)),t=n,dr[c]={nextPos:ir,result:t},t}function Lr(){var t,n,r,i,a,s,l,u,c,d=135*ir+17,h=dr[d];return h?(ir=h.nextPos,h.result):(cr++,t=ir,n=ir,r=ir,T.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(M)),i!==o?(T.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(M)),a!==o?(T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?r=i=[i,a,s,l]:(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o)):(ir=r,r=o),(n=r!==o?e.substring(n,ir):r)!==o?(45===e.charCodeAt(ir)?(r="-",ir++):(r=o,0===cr&&_r(k)),r!==o?(i=ir,a=ir,T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o?(T.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(M)),l!==o?a=s=[s,l]:(ir=a,a=o)):(ir=a,a=o),(i=a!==o?e.substring(i,ir):a)!==o?(45===e.charCodeAt(ir)?(a="-",ir++):(a=o,0===cr&&_r(k)),a!==o?(s=ir,l=ir,T.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(M)),u!==o?(T.test(e.charAt(ir))?(c=e.charAt(ir),ir++):(c=o,0===cr&&_r(M)),c!==o?l=u=[u,c]:(ir=l,l=o)):(ir=l,l=o),(s=l!==o?e.substring(s,ir):l)!==o?(ar=t,t=n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||mr(ei("db.messages.parser.error-invalid-date-format",{str:hr()})),r}(n,i,s)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),cr--,t===o&&(n=o,0===cr&&_r(R)),dr[d]={nextPos:ir,result:t},t)}function Ar(){var t,n,r=135*ir+18,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"true"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(L)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"false"===e.substr(ir,5).toLowerCase()?(n=e.substr(ir,5),ir+=5):(n=o,0===cr&&_r(A)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}function Dr(){var t,n,r,i,a,s,l,u,c=135*ir+20,d=dr[c];if(d)return ir=d.nextPos,d.result;if(cr++,t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return cr--,t===o&&(n=o,0===cr&&_r(N)),dr[c]={nextPos:ir,result:t},t}function Nr(){var t,n,r,i,a,s,l,u,c=135*ir+21,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,cr++,r=ir,(i=Zo())!==o){if(a=ir,cr++,s=[],P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I)),l!==o)for(;l!==o;)s.push(l),P.test(e.charAt(ir))?(l=e.charAt(ir),ir++):(l=o,0===cr&&_r(I));else s=o;cr--,s===o?a=void 0:(ir=a,a=o),a!==o?r=i=[i,a]:(ir=r,r=o)}else ir=r,r=o;if(cr--,r===o?n=void 0:(ir=n,n=o),n!==o){if(r=ir,i=ir,a=[],H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y)),s!==o)for(;s!==o;)a.push(s),H.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(Y));else a=o;if(a!==o){for(s=ir,l=[],P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));u!==o;)l.push(u),P.test(e.charAt(ir))?(u=e.charAt(ir),ir++):(u=o,0===cr&&_r(I));(s=l!==o?e.substring(s,ir):l)!==o?i=a=[a,s]:(ir=i,i=o)}else ir=i,i=o;(r=i!==o?e.substring(r,ir):i)!==o?(ar=t,t=n=r):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Pr(){var t,n,r,i,a,s,l,u,c=135*ir+22,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o&&(r=Nr())!==o?(ar=t,u=r,null!=(l=n)&&(l=l[0]),t=n={type:"columnName",name:u,relAlias:l}):(ir=t,t=o),t===o)if(t=ir,n=ir,(r=Dr())!==o?(46===e.charCodeAt(ir)?(i=".",ir++):(i=o,0===cr&&_r(x)),i!==o?n=r=[r,i]:(ir=n,n=o)):(ir=n,n=o),n===o&&(n=null),n!==o)if(91===e.charCodeAt(ir)?(r="[",ir++):(r=o,0===cr&&_r(F)),r!==o){if(i=ir,a=[],T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M)),s!==o)for(;s!==o;)a.push(s),T.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(M));else a=o;(i=a!==o?e.substring(i,ir):a)!==o?(93===e.charCodeAt(ir)?(a="]",ir++):(a=o,0===cr&&_r(W)),a!==o?(ar=t,t=n=function(e,t){return null!=e&&(e=e[0]),{type:"columnName",name:parseInt(t,10),relAlias:e}}(n,i)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Ir(){var t,n,r,i=135*ir+25,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,961===e.charCodeAt(ir)?(r="ρ",ir++):(r=o,0===cr&&_r(K)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"rho"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r($)),r!==o&&(ar=n,r=X()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Hr(){var t,n,r,i=135*ir+26,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8592===e.charCodeAt(ir)?(r="←",ir++):(r=o,0===cr&&_r(J)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"<-"===e.substr(ir,2)?(r="<-",ir+=2):(r=o,0===cr&&_r(Z)),r!==o&&(ar=n,r=Q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Yr(){var t,n,r,i=135*ir+27,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,8594===e.charCodeAt(ir)?(r="→",ir++):(r=o,0===cr&&_r(ee)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"->"===e.substr(ir,2)?(r="->",ir+=2):(r=o,0===cr&&_r(ne)),r!==o&&(ar=n,r=te()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Fr(){var t,n,r,i=135*ir+30,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,947===e.charCodeAt(ir)?(r="γ",ir++):(r=o,0===cr&&_r(ae)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"gamma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(le)),r!==o&&(ar=n,r=se()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}function Wr(){var t,n,r,i=135*ir+33,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,247===e.charCodeAt(ir)?(r="÷",ir++):(r=o,0===cr&&_r(pe)),r===o&&(47===e.charCodeAt(ir)?(r="/",ir++):(r=o,0===cr&&_r(ge))),r!==o&&(ar=n,r=ri("divisionOperator")),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),dr[i]={nextPos:ir,result:t},t)}function Br(){var t,n,r,i,a=135*ir+44,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=Dr())!==o?(ar=ir,i=n,(void ai.push(i)?o:void 0)!==o&&function(){var t,n,r,i,a=135*ir+19,s=dr[a];return s?(ir=s.nextPos,s.result):(t=ir,(n=kr())!==o?(61===e.charCodeAt(ir)?(r="=",ir++):(r=o,0===cr&&_r(D)),r!==o&&(i=kr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}()!==o&&(r=eo())!==o?(ar=t,t=n=function(e,t){return t.assignmentName=e,{type:"assignment",name:e,child:t,codeInfo:ti()}}(n,r)):(ir=t,t=o)):(ir=t,t=o),dr[a]={nextPos:ir,result:t},t)}function Ur(){var e,t,n,r=135*ir+45,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Uo())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t={type:"namedColumnExpr",name:n,relAlias:null,child:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Uo())!==o?(ar=e,e=t=function(e,t){return{type:"namedColumnExpr",name:e,relAlias:null,child:t,codeInfo:ti()}}(t,n)):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&(ar=e,t=t),e=t)),dr[r]={nextPos:ir,result:e},e)}function zr(){var e,t,n,r=135*ir+48,i=dr[r];return i?(ir=i.nextPos,i.result):(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=Pr())!==o?(ar=e,e=t={type:"colAssignment",src:n,dst:t,codeInfo:ti()}):(ir=e,e=o),e===o&&(e=ir,(t=Pr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,e=t=function(e,t){return{type:"colAssignment",src:e,dst:t,codeInfo:ti()}}(t,n)):(ir=e,e=o)),dr[r]={nextPos:ir,result:e},e)}function Vr(){var t,n,r,i,a,s,l=135*ir+51,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,(n=Pr())!==o?(r=ir,(i=Or())!==o&&(a=function(){var t,n,r=135*ir+50,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"asc"===e.substr(ir,3).toLowerCase()?(n=e.substr(ir,3),ir+=3):(n=o,0===cr&&_r(Qe)),n!==o&&(ar=t,n=!0),(t=n)===o&&(t=ir,"desc"===e.substr(ir,4).toLowerCase()?(n=e.substr(ir,4),ir+=4):(n=o,0===cr&&_r(Ze)),n!==o&&(ar=t,n=!1),t=n),dr[r]={nextPos:ir,result:t},t)}())!==o?r=i=[i,a]:(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(ir=t,t=o)):(ir=t,t=o),dr[l]={nextPos:ir,result:t},t)}function qr(){var t,n,r,i,a,s,l=135*ir+53,u=dr[l];return u?(ir=u.nextPos,u.result):(t=ir,n=ir,"sum"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(et)),r===o&&("count"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(tt)),r===o&&("avg"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(nt)),r===o&&("min"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(rt)),r===o&&("max"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ot)))))),(n=r!==o?e.substring(n,ir):r)!==o?(40===e.charCodeAt(ir)?(r="(",ir++):(r=o,0===cr&&_r(it)),r!==o&&kr()!==o&&(i=Pr())!==o&&kr()!==o?(41===e.charCodeAt(ir)?(a=")",ir++):(a=o,0===cr&&_r(at)),a!==o?(ar=t,s=i,t=n={aggFunction:n.toUpperCase(),col:s}):(ir=t,t=o)):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,"count(*)"===e.substr(ir,8).toLowerCase()?(n=e.substr(ir,8),ir+=8):(n=o,0===cr&&_r(st)),n!==o&&(ar=t,n={aggFunction:"COUNT_ALL",col:null}),t=n),dr[l]={nextPos:ir,result:t},t)}function Gr(){var e,t,n,r,i,a=135*ir+54,s=dr[a];return s?(ir=s.nextPos,s.result):(e=ir,(t=qr())!==o&&Yr()!==o&&(n=Nr())!==o?(ar=e,i=n,(r=t).name=i,e=t=r):(ir=e,e=o),e===o&&(e=ir,(t=Nr())!==o&&Hr()!==o&&(n=qr())!==o?(ar=e,e=t=function(e,t){return t.name=e,t}(t,n)):(ir=e,e=o)),dr[a]={nextPos:ir,result:e},e)}function Kr(){var t,n,r,i,a,s,l,u,c=135*ir+55,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Gr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Gr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}function Xr(){var e,t,n=135*ir+56,r=dr[n];return r?(ir=r.nextPos,r.result):(e=ir,(t=So())!==o&&Or()!==o?(ar=ir,(function(e){if("valueExpr"===e.type&&"columnValue"===e.func&&!e.wrappedInParentheses&&null===e.args[1]){for(var t=0;tir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);c!==o;)u.push(c),c=ir,d=ir,cr++,h=Cr(),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o);(l=u!==o?e.substring(l,ir):u)!==o?(ar=t,t=n=function(e,t,n){return{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o;if(t===o){if(t=ir,n=ir,cr++,r=ir,i=[],ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft)),a!==o)for(;a!==o;)i.push(a),ht.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(ft));else i=o;if(i!==o?("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),cr--,r!==o?(ir=n,n=void 0):n=o,n!==o){if(r=ir,i=[],pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt)),a!==o)for(;a!==o;)i.push(a),pt.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(gt));else i=o;if((r=i!==o?e.substring(r,ir):i)!==o)if(i=ir,64===e.charCodeAt(ir)?(a="@",ir++):(a=o,0===cr&&_r(yt)),a!==o&&(l=Jr())!==o?i=a=[a,l]:(ir=i,i=o),i===o&&(i=null),i!==o)if("[["===e.substr(ir,2)?(a="[[",ir+=2):(a=o,0===cr&&_r(bt)),a!==o){for(l=ir,u=[],"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));c!==o;)u.push(c),"\\]]"===e.substr(ir,3)?(c="\\]]",ir+=3):(c=o,0===cr&&_r(vt)),c===o&&(c=ir,d=ir,cr++,"]]"===e.substr(ir,2)?(h="]]",ir+=2):(h=o,0===cr&&_r(_t)),cr--,h===o?d=void 0:(ir=d,d=o),d!==o?(e.length>ir?(h=e.charAt(ir),ir++):(h=o,0===cr&&_r(s)),h!==o?c=d=[d,h]:(ir=c,c=o)):(ir=c,c=o));(l=u!==o?e.substring(l,ir):u)!==o?("]]"===e.substr(ir,2)?(u="]]",ir+=2):(u=o,0===cr&&_r(_t)),u!==o?(ar=t,t=n=function(e,t,n){return n=(n=n.replace(/\\]]/g,"]]")).replace(/\\\\]]/g,"\\]]"),{name:e,lang:t?t[1]:null,text:n}}(r,i,l)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;else ir=t,t=o;else ir=t,t=o}else ir=t,t=o}return dr[f]={nextPos:ir,result:t},t}function Zr(){var e,t,n,r,i,a,s=135*ir+62,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,kr()!==o)if((t=function(){var e,t,n,r,i,a,s,l,u=135*ir+59,c=dr[u];if(c)return ir=c.nextPos,c.result;if(e=ir,(t=Qr())!==o){for(n=[],r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Qr())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,s=n,(l=[]).push(t),s.map((function(e){var t=e[1];l.push(t)})),e=t=l):(ir=e,e=o)}else ir=e,e=o;return dr[u]={nextPos:ir,result:e},e}())!==o){if(n=[],r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o),r!==o)for(;r!==o;)n.push(r),r=ir,(i=Or())!==o&&(a=Br())!==o?r=i=[i,a]:(ir=r,r=o);else n=o;n!==o?(ar=e,e=function(e,t){for(var n=[],r=0;r"group"===e.name);return void 0===o?mr(ei("db.messages.parser.error-group-header-name-missing")+': "group: ..........\\n"'):0===o.text.trim().length&&mr(ei("error-group-header-name-empty")),{type:"tableGroup",headers:e,assignments:n,codeInfo:ti()}}(t,n)):(ir=e,e=o)}else ir=e,e=o;else ir=e,e=o;return dr[s]={nextPos:ir,result:e},e}function eo(){var e,t,n,r,i=135*ir+63,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=to())!==o){if(n=[],(r=io())===o&&(r=ao()),r!==o)for(;r!==o;)n.push(r),(r=io())===o&&(r=ao());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=to()),dr[i]={nextPos:ir,result:e},e}function to(){var e,t,n,r,i=135*ir+64,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=no())!==o){if(n=[],(r=oo())!==o)for(;r!==o;)n.push(r),r=oo();else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=no()),dr[i]={nextPos:ir,result:e},e}function no(){var e,t,n,r,i=135*ir+65,a=dr[i];if(a)return ir=a.nextPos,a.result;if(e=ir,(t=ro())!==o){if(n=[],(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo()),r!==o)for(;r!==o;)n.push(r),(r=so())===o&&(r=lo())===o&&(r=uo())===o&&(r=co())===o&&(r=ho())===o&&(r=fo())===o&&(r=mo())===o&&(r=po())===o&&(r=go())===o&&(r=yo());else n=o;n!==o?(ar=e,e=t=wt(t,n)):(ir=e,e=o)}else ir=e,e=o;return e===o&&(e=ro()),dr[i]={nextPos:ir,result:e},e}function ro(){var t,n=135*ir+66,r=dr[n];return r?(ir=r.nextPos,r.result):((t=function(){var t,n,r,i,a=135*ir+86,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+29,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,964===e.charCodeAt(ir)?(r="τ",ir++):(r=o,0===cr&&_r(re)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"tau"===e.substr(ir,3).toLowerCase()?(r=e.substr(ir,3),ir+=3):(r=o,0===cr&&_r(ie)),r!==o&&(ar=n,r=oe()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+52,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Vr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Vr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"orderBy",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+85,c=dr[u];if(c)return ir=c.nextPos,c.result;t=ir,(n=Fr())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+47,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Pr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Pr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o&&kr()!==o&&(s=Kr())!==o&&Or()!==o&&(l=ro())!==o?(ar=t,d=n,h=r,f=s,m=l,si.push(d),n={type:"groupBy",child:m,group:h,aggregate:f,codeInfo:ti()},t=n):(ir=t,t=o)):(ir=t,t=o);var d,h,f,m;t===o&&(t=ir,(n=Fr())!==o?(r=ir,(i=kr())!==o?(59===e.charCodeAt(ir)?(a=";",ir++):(a=o,0===cr&&_r(jt)),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o&&(i=kr())!==o&&(a=Kr())!==o&&Or()!==o&&(s=ro())!==o?(ar=t,n=function(e,t,n){return si.push(e),{type:"groupBy",child:n,group:[],aggregate:t,codeInfo:ti()}}(n,a,s),t=n):(ir=t,t=o)):(ir=t,t=o));return dr[u]={nextPos:ir,result:t},t}())===o&&(t=function(){var e,t,n,r,i=135*ir+84,a=dr[i];if(a)return ir=a.nextPos,a.result;e=ir,(t=Ir())!==o&&(n=Dr())!==o&&Or()!==o&&(r=ro())!==o?(ar=e,s=t,l=n,u=r,si.push(s),t={type:"renameRelation",child:u,newRelAlias:l,codeInfo:ti()},e=t):(ir=e,e=o);var s,l,u;return dr[i]={nextPos:ir,result:e},e}())===o&&(t=function(){var t,n,r,i,a=135*ir+83,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=Ir())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+49,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=zr())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=zr())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=Je(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"renameColumns",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+82,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+24,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,963===e.charCodeAt(ir)?(r="σ",ir++):(r=o,0===cr&&_r(V)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"sigma"===e.substr(ir,5).toLowerCase()?(r=e.substr(ir,5),ir+=5):(r=o,0===cr&&_r(G)),r!==o&&(ar=n,r=q()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=So())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"selection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+81,s=dr[a];if(s)return ir=s.nextPos,s.result;t=ir,(n=function(){var t,n,r,i=135*ir+23,a=dr[i];return a?(ir=a.nextPos,a.result):(t=ir,kr()!==o?(n=ir,960===e.charCodeAt(ir)?(r="π",ir++):(r=o,0===cr&&_r(B)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=kr())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,kr()!==o?(n=ir,"pi"===e.substr(ir,2).toLowerCase()?(r=e.substr(ir,2),ir+=2):(r=o,0===cr&&_r(z)),r!==o&&(ar=n,r=U()),(n=r)!==o&&(r=Or())!==o?(ar=t,t=n):(ir=t,t=o)):(ir=t,t=o)),dr[i]={nextPos:ir,result:t},t)}())!==o&&(r=function(){var t,n,r,i,a,s,l,u,c=135*ir+46,d=dr[c];if(d)return ir=d.nextPos,d.result;if(t=ir,(n=Ur())!==o){for(r=[],i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);i!==o;)r.push(i),i=ir,(a=kr())!==o?(44===e.charCodeAt(ir)?(s=",",ir++):(s=o,0===cr&&_r(Xe)),s!==o&&(l=kr())!==o&&(u=Ur())!==o?i=a=[a,s,l,u]:(ir=i,i=o)):(ir=i,i=o);r!==o?(ar=t,t=n=$e(n,r)):(ir=t,t=o)}else ir=t,t=o;return dr[c]={nextPos:ir,result:t},t}())!==o&&Or()!==o&&(i=ro())!==o?(ar=t,l=n,u=r,c=i,si.push(l),n={type:"projection",child:c,arg:u,codeInfo:ti()},t=n):(ir=t,t=o);var l,u,c;return dr[a]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r,i,a=135*ir+67,s=dr[a];if(s)return ir=s.nextPos,s.result;(t=function(){var t,n,r,i,a,s,l,u,c,d=135*ir+105,h=dr[d];if(h)return ir=h.nextPos,h.result;t=ir,123===e.charCodeAt(ir)?(n="{",ir++):(n=o,0===cr&&_r(sn));if(n!==o)if(kr()!==o)if((r=function(){var e,t,n,r,i,a,s=135*ir+103,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=Eo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=Eo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,t=function(e,t){for(var n,r=[e],o=0;o="===e.substr(ir,2)?(n=">=",ir+=2):(n=o,0===cr&&_r(kt));n===o&&(8805===e.charCodeAt(ir)?(n="≥",ir++):(n=o,0===cr&&_r(Tt)));n!==o&&(ar=t,n=">=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n,r=135*ir+94,i=dr[r];if(i)return ir=i.nextPos,i.result;t=ir,"<="===e.substr(ir,2)?(n="<=",ir+=2):(n=o,0===cr&&_r(xt));n===o&&(8804===e.charCodeAt(ir)?(n="≤",ir++):(n=o,0===cr&&_r(Rt)));n!==o&&(ar=t,n="<=");return t=n,dr[r]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+93,r=dr[n];if(r)return ir=r.nextPos,r.result;62===e.charCodeAt(ir)?(t=">",ir++):(t=o,0===cr&&_r(Mt));return dr[n]={nextPos:ir,result:t},t}())===o&&(t=function(){var t,n=135*ir+95,r=dr[n];if(r)return ir=r.nextPos,r.result;60===e.charCodeAt(ir)?(t="<",ir++):(t=o,0===cr&&_r(Lt));return dr[n]={nextPos:ir,result:t},t}()),dr[n]={nextPos:ir,result:t},t)}function vo(){var t,n=135*ir+90,r=dr[n];return r?(ir=r.nextPos,r.result):(61===e.charCodeAt(ir)?(t="=",ir++):(t=o,0===cr&&_r(D)),dr[n]={nextPos:ir,result:t},t)}function _o(){var t,n,r=135*ir+91,i=dr[r];return i?(ir=i.nextPos,i.result):(t=ir,"!="===e.substr(ir,2)?(n="!=",ir+=2):(n=o,0===cr&&_r(Ct)),n===o&&(8800===e.charCodeAt(ir)?(n="≠",ir++):(n=o,0===cr&&_r(St)),n===o&&("<>"===e.substr(ir,2)?(n="<>",ir+=2):(n=o,0===cr&&_r(Ot)))),n!==o&&(ar=t,n="!="),t=n,dr[r]={nextPos:ir,result:t},t)}function wo(){var t,n,r,i,a=135*ir+100,s=dr[a];return s?(ir=s.nextPos,s.result):(cr++,t=ir,(n=Mr())!==o?(44===e.charCodeAt(ir)?(r=",",ir++):(r=o,0===cr&&_r(Xe)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=ir,(n=Mr())!==o?(59===e.charCodeAt(ir)?(r=";",ir++):(r=o,0===cr&&_r(jt)),r!==o&&(i=Mr())!==o?t=n=[n,r,i]:(ir=t,t=o)):(ir=t,t=o),t===o&&(t=function(){var t,n,r,i,a,s,l,u=135*ir+11,c=dr[u];if(c)return ir=c.nextPos,c.result;for(t=ir,n=[],r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=ir,i=[],a=Sr();a!==o;)i.push(a),a=Sr();if(i!==o){if(a=[],h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f)),s!==o)for(;s!==o;)a.push(s),h.test(e.charAt(ir))?(s=e.charAt(ir),ir++):(s=o,0===cr&&_r(f));else a=o;if(a!==o){for(s=[],l=Sr();l!==o;)s.push(l),l=Sr();s!==o?r=i=[i,a,s]:(ir=r,r=o)}else ir=r,r=o}else ir=r,r=o}else n=o;return n!==o&&(ar=t,n=""),t=n,dr[u]={nextPos:ir,result:t},t}())),cr--,t===o&&(n=o,0===cr&&_r(qt)),dr[a]={nextPos:ir,result:t},t)}function Eo(){var t,n,r,i,a,s,l,u=135*ir+101,c=dr[u];return c?(ir=c.nextPos,c.result):(t=ir,(n=Pr())!==o?(r=ir,58===e.charCodeAt(ir)?(i=":",ir++):(i=o,0===cr&&_r(mt)),i!==o?("string"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Gt)),a===o&&("number"===e.substr(ir,6).toLowerCase()?(a=e.substr(ir,6),ir+=6):(a=o,0===cr&&_r(Kt)),a===o&&("date"===e.substr(ir,4).toLowerCase()?(a=e.substr(ir,4),ir+=4):(a=o,0===cr&&_r(Xt)),a===o&&("boolean"===e.substr(ir,7).toLowerCase()?(a=e.substr(ir,7),ir+=7):(a=o,0===cr&&_r($t))))),a!==o?r=i=[i,a]:(ir=r,r=o)):(ir=r,r=o),r===o&&(r=null),r!==o?(ar=t,l=r,t=n={name:(s=n).name,relAlias:s.relAlias,type:null===l?null:l[1].toLowerCase()}):(ir=t,t=o)):(ir=t,t=o),dr[u]={nextPos:ir,result:t},t)}function jo(){var t,n,r,i,a,s=135*ir+102,l=dr[s];if(l)return ir=l.nextPos,l.result;if(t=ir,(n=Lr())!==o&&(ar=t,n={type:"date",value:n}),(t=n)===o&&(t=ir,"null"===e.substr(ir,4)?(n="null",ir+=4):(n=o,0===cr&&_r(Jt)),n===o&&("NULL"===e.substr(ir,4)?(n="NULL",ir+=4):(n=o,0===cr&&_r(Qt))),n!==o&&(ar=t,n={type:"null",value:null}),(t=n)===o&&(t=ir,(n=Ar())!==o?(r=ir,cr++,(i=wo())===o&&(i=Cr())===o&&(125===e.charCodeAt(ir)?(i="}",ir++):(i=o,0===cr&&_r(Zt))),cr--,i!==o?(ir=r,r=void 0):r=o,r!==o?(ar=t,t=n={type:"boolean",value:n,quoted:!1}):(ir=t,t=o)):(ir=t,t=o),t===o))){if(t=ir,n=ir,r=[],en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn)),i!==o)for(;i!==o;)r.push(i),en.test(e.charAt(ir))?(i=e.charAt(ir),ir++):(i=o,0===cr&&_r(tn));else r=o;if((n=r!==o?e.substring(n,ir):r)!==o&&(ar=t,n=function(e){return{type:"string",value:e,quoted:!1}}(n)),(t=n)===o){if(t=ir,39===e.charCodeAt(ir)?(n="'",ir++):(n=o,0===cr&&_r(C)),n!==o){for(r=ir,i=[],S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));a!==o;)i.push(a),S.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(O));(r=i!==o?e.substring(r,ir):i)!==o?(39===e.charCodeAt(ir)?(i="'",ir++):(i=o,0===cr&&_r(C)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o;if(t===o)if(t=ir,34===e.charCodeAt(ir)?(n='"',ir++):(n=o,0===cr&&_r(rn)),n!==o){for(r=ir,i=[],on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));a!==o;)i.push(a),on.test(e.charAt(ir))?(a=e.charAt(ir),ir++):(a=o,0===cr&&_r(an));(r=i!==o?e.substring(r,ir):i)!==o?(34===e.charCodeAt(ir)?(i='"',ir++):(i=o,0===cr&&_r(rn)),i!==o?(ar=t,t=n=nn(r)):(ir=t,t=o)):(ir=t,t=o)}else ir=t,t=o}}return dr[s]={nextPos:ir,result:t},t}function Co(){var e,t,n,r,i,a,s=135*ir+104,l=dr[s];if(l)return ir=l.nextPos,l.result;if(e=ir,(t=jo())!==o){for(n=[],r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);r!==o;)n.push(r),r=ir,(i=wo())!==o&&(a=jo())!==o?r=i=[i,a]:(ir=r,r=o);n!==o?(ar=e,e=t=function(e,t){for(var n=[e],r=0;r0){for(t=1,r=1;t",!1),qe=Qn("!=",!1),Ge=Qn(">=",!1),Ke=Qn(">",!1),Xe=Qn("<=",!1),$e=Qn("<",!1),Je=er("logical AND"),Qe=Qn("and",!0),Ze=er("logical XOR"),et=Qn("xor",!0),tt=er("logical OR"),nt=Qn("or",!0),rt=er("logical NOT"),ot=Qn("!",!1),it=(Qn("not",!1),Qn("exists",!0)),at=Qn("#",!1),st=/^[^\n]/,lt=Zn(["\n"],!0,!1),ut=Qn("`",!1),ct=Qn("drop",!0),dt=Qn("table",!0),ht=Qn("if",!0),ft=Qn("lock",!0),mt=Qn("tables",!0),pt=Qn("unlock",!0),gt=Qn("use",!0),yt=/^[a-zA-Z_0-9\-]/,bt=Zn([["a","z"],["A","Z"],"_",["0","9"],"-"],!1,!1),vt=Qn("decimal",!0),_t=Qn("tinyint",!0),wt=Qn("smallint",!0),Et=Qn("mediumint",!0),jt=Qn("bigint",!0),Ct=Qn("integer",!0),St=Qn("int",!0),Ot=Qn("float",!0),kt=Qn("double",!0),Tt=Qn("varchar",!0),Mt=Qn("char",!0),xt=Qn("text",!0),Rt=Qn("datetime",!0),Lt=/^[a-zA-Z0-9_=]/,At=Zn([["a","z"],["A","Z"],["0","9"],"_","="],!1,!1),Dt=Qn("create",!0),Nt=Qn("exists",!1),Pt=Qn("null",!0),It=Qn("insert",!0),Ht=Qn("into",!0),Yt=Qn("values",!0),Ft=er("boolean expression"),Wt=Qn("||",!1),Bt=function(e,t){return{type:"valueExpr",datatype:"boolean",func:e,args:[void 0,t],codeInfo:No()}},Ut=Qn("like",!0),zt=Qn("ilike",!0),Vt=Qn("+",!1),qt=Qn("/",!1),Gt=Qn("%",!1),Kt=Qn("coalesce",!0),Xt=Qn("concat",!0),$t=Qn("adddate",!0),Jt=Qn("subdate",!0),Qt=Qn("mod",!0),Zt=Qn("add",!0),en=Qn("sub",!0),tn=Qn("mul",!0),nn=Qn("div",!0),rn=Qn("upper",!0),on=Qn("ucase",!0),an=Qn("lower",!0),sn=Qn("lcase",!0),ln=Qn("length",!0),un=Qn("abs",!0),cn=Qn("floor",!0),dn=Qn("ceil",!0),hn=Qn("round",!0),fn=Qn("year",!0),mn=Qn("month",!0),pn=Qn("day",!0),gn=Qn("hour",!0),yn=Qn("minute",!0),bn=Qn("second",!0),vn=Qn("dayofmonth",!0),_n=Qn("rand",!0),wn=Qn("rownum",!0),En=Qn("now",!0),jn=Qn("current_timestamp",!0),Cn=Qn("transaction_timestamp",!0),Sn=Qn("statement_timestamp",!0),On=Qn("clock_timestamp",!0),kn=Qn("sysdate",!0),Tn=Qn("case",!0),Mn=Qn("when",!0),xn=Qn("then",!0),Rn=function(e,t){return{w:e,t:t}},Ln=Qn("else",!0),An=Qn("end",!0),Dn=function(e,t){return function(e,t){var n,r=t[0];r.args[0]=e,r.codeInfo=No();for(var o=1;oqn&&(qn=Un,Gn=[]),Gn.push(e))}function or(e,t,n){return new r(r.buildMessage(e,t),e,t,n)}function ir(){var e,t,n,r=113*Un+0,i=Xn[r];return i?(Un=i.nextPos,i.result):(e=Un,(t=kr())!==o&&(zn=e,t=t),(e=t)===o&&(e=Un,(t=kr())!==o&&(n=ur())!==o?(zn=e,e=t=t):(Un=e,e=o),e===o&&(e=Un,(t=ur())!==o&&(n=kr())!==o?(zn=e,e=t=n):(Un=e,e=o))),Xn[r]={nextPos:Un,result:e},e)}function ar(){var t,n,r=113*Un+2,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,Kn++,e.length>Un?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(s)),Kn--,n===o?t=void 0:(Un=t,t=o),Xn[r]={nextPos:Un,result:t},t)}function sr(){var t,n=113*Un+3,r=Xn[n];return r?(Un=r.nextPos,r.result):("\r\n"===e.substr(Un,2)?(t="\r\n",Un+=2):(t=o,0===Kn&&rr(l)),t===o&&(10===e.charCodeAt(Un)?(t="\n",Un++):(t=o,0===Kn&&rr(u))),Xn[n]={nextPos:Un,result:t},t)}function lr(){var t,n=113*Un+4,r=Xn[n];return r?(Un=r.nextPos,r.result):((t=function(){var t,n,r,i,a,l,u,m,p=113*Un+5,g=Xn[p];if(g)return Un=g.nextPos,g.result;Kn++,t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d));n!==o?(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o?(i=Un,Kn++,(a=sr())===o&&(a=ar()),Kn--,a!==o?(Un=i,i=void 0):i=o,i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);if(t===o&&(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o?(r=Un,Kn++,(i=sr())===o&&(i=ar()),Kn--,i!==o?(Un=r,r=void 0):r=o,r!==o?t=n=[n,r]:(Un=t,t=o)):(Un=t,t=o),t===o))if(t=Un,"--"===e.substr(Un,2)?(n="--",Un+=2):(n=o,0===Kn&&rr(d)),n!==o)if(h.test(e.charAt(Un))?(r=e.charAt(Un),Un++):(r=o,0===Kn&&rr(f)),r!==o){for(i=Un,a=[],l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);l!==o;)a.push(l),l=Un,u=Un,Kn++,m=sr(),Kn--,m===o?u=void 0:(Un=u,u=o),u!==o?(e.length>Un?(m=e.charAt(Un),Un++):(m=o,0===Kn&&rr(s)),m!==o?l=u=[u,m]:(Un=l,l=o)):(Un=l,l=o);(i=a!==o?e.substring(i,Un):a)!==o?(a=Un,Kn++,(l=sr())===o&&(l=ar()),Kn--,l!==o?(Un=a,a=void 0):a=o,a!==o?t=n=[n,r,i,a]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;Kn--,t===o&&(n=o,0===Kn&&rr(c));return Xn[p]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r,i,a,l,u=113*Un+6,c=Xn[u];if(c)return Un=c.nextPos,c.result;t=Un,"/*"===e.substr(Un,2)?(n="/*",Un+=2):(n=o,0===Kn&&rr(m));if(n!==o){for(r=[],i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,a=Un,Kn++,"*/"===e.substr(Un,2)?(l="*/",Un+=2):(l=o,0===Kn&&rr(p)),Kn--,l===o?a=void 0:(Un=a,a=o),a!==o?(e.length>Un?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(s)),l!==o?i=a=[a,l]:(Un=i,i=o)):(Un=i,i=o);r!==o?("*/"===e.substr(Un,2)?(i="*/",Un+=2):(i=o,0===Kn&&rr(p)),i!==o?t=n=[n,r,i]:(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Xn[u]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function ur(){var t,n,r,i,a,s,l,u=113*Un+7,c=Xn[u];if(c)return Un=c.nextPos,c.result;for(Kn++,t=Un,n=[],r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o;if(r!==o)for(;r!==o;){for(n.push(r),r=Un,i=[],a=lr();a!==o;)i.push(a),a=lr();if(i!==o){if(a=[],y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b)),s!==o)for(;s!==o;)a.push(s),y.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(b));else a=o;if(a!==o){for(s=[],l=lr();l!==o;)s.push(l),l=lr();s!==o?r=i=[i,a,s]:(Un=r,r=o)}else Un=r,r=o}else Un=r,r=o}else n=o;return n!==o&&(zn=t,n=""),Kn--,(t=n)===o&&(n=o,0===Kn&&rr(g)),Xn[u]={nextPos:Un,result:t},t}function cr(){var t,n,r=113*Un+8,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));n!==o;)t.push(n),(n=lr())===o&&(y.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(b)));return Kn--,t===o&&(n=o,0===Kn&&rr(v)),Xn[r]={nextPos:Un,result:t},t}function dr(){var t,n,r=113*Un+9,i=Xn[r];if(i)return Un=i.nextPos,i.result;if(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E)),n!==o)for(;n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));else t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(_)),Xn[r]={nextPos:Un,result:t},t}function hr(){var t,n,r=113*Un+10,i=Xn[r];if(i)return Un=i.nextPos,i.result;for(Kn++,t=[],w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));n!==o;)t.push(n),w.test(e.charAt(Un))?(n=e.charAt(Un),Un++):(n=o,0===Kn&&rr(E));return Kn--,t===o&&(n=o,0===Kn&&rr(j)),Xn[r]={nextPos:Un,result:t},t}function fr(){var t,n,r,i,a,s=113*Un+11,l=Xn[s];if(l)return Un=l.nextPos,l.result;if(Kn++,t=Un,34===e.charCodeAt(Un)?(n='"',Un++):(n=o,0===Kn&&rr(S)),n!==o){for(r=[],O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));i!==o;)r.push(i),O.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(k));r!==o?(34===e.charCodeAt(Un)?(i='"',Un++):(i=o,0===Kn&&rr(S)),i!==o?(zn=t,t=n=void Jn(i18n.t("db.messages.parser.error-sql-string-use-single-quotes"))):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;if(t===o)if(t=Un,39===e.charCodeAt(Un)?(n="'",Un++):(n=o,0===Kn&&rr(T)),n!==o){for(r=Un,i=[],M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));a!==o;)i.push(a),M.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(x));(r=i!==o?e.substring(r,Un):i)!==o?(39===e.charCodeAt(Un)?(i="'",Un++):(i=o,0===Kn&&rr(T)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(C)),Xn[s]={nextPos:Un,result:t},t}function mr(){var t,n,r,i,a,s,l=113*Un+12,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(R)),i===o&&(i=null),i!==o){if(a=[],L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseInt(n,10)),t=n,Xn[l]={nextPos:Un,result:t},t}function pr(){var t,n,r,i,a,s,l,u,c=113*Un+13,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,n=Un,r=Un,45===e.charCodeAt(Un)?(i="-",Un++):(i=o,0===Kn&&rr(R)),i===o&&(i=null),i!==o){if(a=[],L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o)for(;s!==o;)a.push(s),L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A));else a=o;if(a!==o)if(46===e.charCodeAt(Un)?(s=".",Un++):(s=o,0===Kn&&rr(D)),s!==o){if(l=[],L.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o)for(;u!==o;)l.push(u),L.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A));else l=o;l!==o?r=i=[i,a,s,l]:(Un=r,r=o)}else Un=r,r=o;else Un=r,r=o}else Un=r,r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n=parseFloat(n)),t=n,Xn[c]={nextPos:Un,result:t},t}function gr(){var e,t=113*Un+14,n=Xn[t];return n?(Un=n.nextPos,n.result):((e=pr())===o&&(e=mr()),Xn[t]={nextPos:Un,result:e},e)}function yr(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+16,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(Kn++,t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-relation-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Kn--,t===o&&(n=o,0===Kn&&rr(I)),Xn[h]={nextPos:Un,result:t},t}function br(){var t,n,r,i,a,s,l,u,c,d,h=113*Un+17,f=Xn[h];if(f)return Un=f.nextPos,f.result;if(t=Un,n=Un,Kn++,r=Un,(i=Do())!==o){if(a=Un,Kn++,s=[],H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y)),l!==o)for(;l!==o;)s.push(l),H.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(Y));else s=o;Kn--,s===o?a=void 0:(Un=a,a=o),a!==o?r=i=[i,a]:(Un=r,r=o)}else Un=r,r=o;if(Kn--,r===o?n=void 0:(Un=n,n=o),n!==o){if(r=Un,i=Un,a=[],F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W)),s!==o)for(;s!==o;)a.push(s),F.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(W));else a=o;if(a!==o){for(s=Un,l=[],H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));u!==o;)l.push(u),H.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(Y));(s=l!==o?e.substring(s,Un):l)!==o?i=a=[a,s]:(Un=i,i=o)}else Un=i,i=o;(r=i!==o?e.substring(r,Un):i)!==o?(zn=t,"true"!==(d=(c=r).toLowerCase())&&"false"!==d||Jn(i18n.t("db.messages.parser.error-sql-invalid-column-name",{str:c})),t=n=c):(Un=t,t=o)}else Un=t,t=o;return Xn[h]={nextPos:Un,result:t},t}function vr(){var t,n,r,i,a,s=113*Un+19,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,"date"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(B)),n!==o?("('"===e.substr(Un,2)?(r="('",Un+=2):(r=o,0===Kn&&rr(U)),r!==o&&(i=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+20,h=Xn[d];if(h)return Un=h.nextPos,h.result;Kn++,t=Un,n=Un,r=Un,L.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));i!==o?(L.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(A)),a!==o?(L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(L.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o);n=r!==o?e.substring(n,Un):r;n!==o?(45===e.charCodeAt(Un)?(r="-",Un++):(r=o,0===Kn&&rr(R)),r!==o?(i=Un,a=Un,L.test(e.charAt(Un))?(s=e.charAt(Un),Un++):(s=o,0===Kn&&rr(A)),s!==o?(L.test(e.charAt(Un))?(l=e.charAt(Un),Un++):(l=o,0===Kn&&rr(A)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),(i=a!==o?e.substring(i,Un):a)!==o?(45===e.charCodeAt(Un)?(a="-",Un++):(a=o,0===Kn&&rr(R)),a!==o?(s=Un,l=Un,L.test(e.charAt(Un))?(u=e.charAt(Un),Un++):(u=o,0===Kn&&rr(A)),u!==o?(L.test(e.charAt(Un))?(c=e.charAt(Un),Un++):(c=o,0===Kn&&rr(A)),c!==o?l=u=[u,c]:(Un=l,l=o)):(Un=l,l=o),(s=l!==o?e.substring(s,Un):l)!==o?(zn=t,n=function(e,t,n){e=parseInt(e,10),t=parseInt(t,10)-1,n=parseInt(n,10);var r=new Date(e,t,n);return r.getFullYear()==e&&r.getMonth()==t&&r.getDate()==n||Jn(i18n.t("db.messages.parser.error-invalid-date-format",{str:$n()})),r}(n,i,s),t=n):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o);Kn--,t===o&&(n=o,0===Kn&&rr(V));return Xn[d]={nextPos:Un,result:t},t}())!==o?("')"===e.substr(Un,2)?(a="')",Un+=2):(a=o,0===Kn&&rr(z)),a!==o?(zn=t,t=n=i):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function _r(){var t,n,r,i,a,s=113*Un+21,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o&&(r=br())!==o?(zn=t,t=n={type:"column",name:r,relAlias:(a=n)?a[0]:null}):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}function wr(){var t,n,r,i,a=113*Un+23,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,n=Un,r=[],L.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A)),i!==o)for(;i!==o;)r.push(i),L.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(A));else r=o;return(n=r!==o?e.substring(n,Un):r)!==o&&(zn=t,n={type:"column",name:parseInt(n,10),relAlias:null}),t=n,Xn[a]={nextPos:Un,result:t},t}function Er(){var t,n,r,i,a,s,l,u,c=113*Un+24,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,n=Un,"sum"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(G)),r===o&&("count"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(K)),r===o&&("avg"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(X)),r===o&&("min"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr($)),r===o&&("max"===e.substr(Un,3).toLowerCase()?(r=e.substr(Un,3),Un+=3):(r=o,0===Kn&&rr(J)))))),(n=r!==o?e.substring(n,Un):r)!==o?(40===e.charCodeAt(Un)?(r="(",Un++):(r=o,0===Kn&&rr(Q)),r!==o&&cr()!==o?(i=Un,"all"===e.substr(Un,3).toLowerCase()?(a=e.substr(Un,3),Un+=3):(a=o,0===Kn&&rr(Z)),a!==o&&(s=ur())!==o?i=a=[a,s]:(Un=i,i=o),i===o&&(i=null),i!==o&&(a=_r())!==o&&(s=cr())!==o?(41===e.charCodeAt(Un)?(l=")",Un++):(l=o,0===Kn&&rr(ee)),l!==o?(zn=t,u=a,t=n={type:"aggFunction",aggFunction:n.toUpperCase(),col:u}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,"count(*)"===e.substr(Un,8).toLowerCase()?(n=e.substr(Un,8),Un+=8):(n=o,0===Kn&&rr(te)),n!==o&&(zn=t,n={type:"aggFunction",aggFunction:"COUNT_ALL",col:null}),t=n),Xn[c]={nextPos:Un,result:t},t)}function jr(){var t,n,r,i,a,s,l,u,c=113*Un+25,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=Er())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,s=i,(a=n).name=s,t=n=a):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Er())!==o&&cr()!==o?(zn=t,t=n=void Jn("aggregation columns must be named")):(Un=t,t=o),t===o&&(t=Un,(n=function(){var t,n,r,i,a,s=113*Un+22,l=Xn[s];return l?(Un=l.nextPos,l.result):(t=Un,n=Un,(r=yr())!==o?(46===e.charCodeAt(Un)?(i=".",Un++):(i=o,0===Kn&&rr(D)),i!==o?n=r=[r,i]:(Un=n,n=o)):(Un=n,n=o),n===o&&(n=null),n!==o?(42===e.charCodeAt(Un)?(r="*",Un++):(r=o,0===Kn&&rr(q)),r!==o?(zn=t,t=n={type:"column",name:"*",relAlias:(a=n)?a[0]:null}):(Un=t,t=o)):(Un=t,t=o),Xn[s]={nextPos:Un,result:t},t)}())!==o&&(zn=t,n=re(n)),(t=n)===o&&(t=Un,(n=_r())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,u=i,(l=n).alias=u,t=n=l):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=Co())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&ur()!==o&&(i=br())!==o?(zn=t,t=n=function(e,t){return{type:"namedColumnExpr",name:t,relAlias:null,child:e,codeInfo:No()}}(n,i)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=_r())!==o&&(zn=t,n=re(n)),t=n))))),Xn[c]={nextPos:Un,result:t},t)}function Cr(){var t,n,r,i,a,s,l=113*Un+29,u=Xn[l];return u?(Un=u.nextPos,u.result):(t=Un,(n=_r())===o&&(n=wr()),n!==o?(r=Un,(i=ur())!==o&&(a=function(){var t,n,r=113*Un+28,i=Xn[r];return i?(Un=i.nextPos,i.result):(t=Un,"asc"===e.substr(Un,3).toLowerCase()?(n=e.substr(Un,3),Un+=3):(n=o,0===Kn&&rr(ie)),n!==o&&(zn=t,n=!0),(t=n)===o&&(t=Un,"desc"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ae)),n!==o&&(zn=t,n=!1),t=n),Xn[r]={nextPos:Un,result:t},t)}())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,t=n={col:n,asc:s=null==(s=r)||s[1]}):(Un=t,t=o)):(Un=t,t=o),Xn[l]={nextPos:Un,result:t},t)}function Sr(){var t,n,r,i,a,s,l,u,c=113*Un+30,d=Xn[c];if(d)return Un=d.nextPos,d.result;if(t=Un,(n=Cr())!==o){for(r=[],i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);i!==o;)r.push(i),i=Un,(a=cr())!==o?(44===e.charCodeAt(Un)?(s=",",Un++):(s=o,0===Kn&&rr(oe)),s!==o&&(l=cr())!==o&&(u=Cr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o);r!==o?(zn=t,t=n=function(e,t){var n=[e];if(null!=t)for(var r in t)n.push(t[r][3]);return{value:n,codeInfo:No()}}(n,r)):(Un=t,t=o)}else Un=t,t=o;return Xn[c]={nextPos:Un,result:t},t}function Or(){var t,n,r,i,a,s,l,u,c=113*Un+32,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,(n=yr())!==o&&ur()!==o?("as"===e.substr(Un,2).toLowerCase()?(r=e.substr(Un,2),Un+=2):(r=o,0===Kn&&rr(ne)),r!==o&&cr()!==o?(40===e.charCodeAt(Un)?(i="(",Un++):(i=o,0===Kn&&rr(Q)),i!==o&&(a=xr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,l=n,(u=a).wrappedInParentheses=!0,t=n={type:"assignment",name:l,child:{type:"relationFromSubstatement",statement:u,relAlias:l,codeInfo:No()},codeInfo:No()}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function kr(){var t,n,r,i,a=113*Un+33,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,(n=function(){var t,n,r,i,a,s,l,u,c,d=113*Un+34,h=Xn[d];if(h)return Un=h.nextPos,h.result;t=Un,"with"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ue));if(n!==o)if(ur()!==o)if((r=Or())!==o){for(i=[],a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);a!==o;)i.push(a),a=Un,(s=cr())!==o?(44===e.charCodeAt(Un)?(l=",",Un++):(l=o,0===Kn&&rr(oe)),l!==o&&(u=cr())!==o&&(c=Or())!==o?a=s=[s,l,u,c]:(Un=a,a=o)):(Un=a,a=o);i!==o?(zn=t,n=function(e,t){for(var n=[e],r=0;r0&&i!=e.arg.length&&null===r&&Jn(i18n.t("db.messages.parser.error-sql-group-by-missing")),o&&!r&&0===i&&Jn(i18n.t("db.messages.parser.error-sql-having-without-group-by")),{type:"statement",select:e,from:t,where:n?n[1]:null,groupBy:r?r[5]:null,having:o?o[1]:null,numAggregationColumns:i,wrappedInParentheses:!1,codeInfo:No()}}(n,i,a,s,l)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&cr()!==o&&(r=xr())!==o&&cr()!==o?(41===e.charCodeAt(Un)?(i=")",Un++):(i=o,0===Kn&&rr(ee)),i!==o?(zn=t,t=n=ye(r)):(Un=t,t=o)):(Un=t,t=o)),Xn[m]={nextPos:Un,result:t},t)}function Dr(){var t,n,r,i,a=113*Un+41,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("union"===e.substr(Un,5).toLowerCase()?(n=e.substr(Un,5),Un+=5):(n=o,0===Kn&&rr(be)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Lr())!==o?(zn=t,t={type:"union",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Nr(){var t,n,r,i,a=113*Un+42,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("except"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(_e)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Lr())!==o?(zn=t,t={type:"except",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Pr(){var t,n,r,i,a=113*Un+43,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("intersect"===e.substr(Un,9).toLowerCase()?(n=e.substr(Un,9),Un+=9):(n=o,0===Kn&&rr(we)),n!==o&&ur()!==o?(r=Un,"all"===e.substr(Un,3).toLowerCase()?(i=e.substr(Un,3),Un+=3):(i=o,0===Kn&&rr(ve)),i!==o&&ur()!==o?(zn=r,r=i=!0):(Un=r,r=o),r===o&&(r=Un,"distinct"===e.substr(Un,8).toLowerCase()?(i=e.substr(Un,8),Un+=8):(i=o,0===Kn&&rr(de)),i!==o&&ur()!==o?(zn=r,r=i=!1):(Un=r,r=o)),r===o&&(r=null),r!==o&&(i=Lr())!==o?(zn=t,t={type:"intersect",child2:i,all:r}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Ir(){var e,t,n,r,i=113*Un+44,a=Xn[i];if(a)return Un=a.nextPos,a.result;if(e=Un,(t=Hr())!==o){if(n=[],(r=Yr())===o&&(r=Fr())===o&&(r=Wr()),r!==o)for(;r!==o;)n.push(r),(r=Yr())===o&&(r=Fr())===o&&(r=Wr());else n=o;n!==o?(zn=e,e=t=me(t,n)):(Un=e,e=o)}else Un=e,e=o;return e===o&&(e=Hr()),Xn[i]={nextPos:Un,result:e},e}function Hr(){var t,n,r,i,a,s,l,u,c,d,h,f=113*Un+45,m=Xn[f];return m?(Un=m.nextPos,m.result):(t=Un,(n=yr())!==o?(r=Un,(i=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ne)),a!==o&&(s=ur())!==o&&(l=yr())!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o),r===o&&(r=null),r!==o?(zn=t,d=r,h={type:"relation",name:n,relAlias:null,codeInfo:No()},t=n=null!==d?{type:"renameRelation",child:h,newRelAlias:d[3],codeInfo:No()}:h):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=xr())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o&&(l=ur())!==o?("as"===e.substr(Un,2).toLowerCase()?(u=e.substr(Un,2),Un+=2):(u=o,0===Kn&&rr(ne)),u!==o&&ur()!==o&&(c=yr())!==o?(zn=t,t=n=function(e,t){return e.wrappedInParentheses=!0,{type:"relationFromSubstatement",statement:e,relAlias:t,codeInfo:No()}}(i,c)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,40===e.charCodeAt(Un)?(n="(",Un++):(n=o,0===Kn&&rr(Q)),n!==o&&(r=cr())!==o&&(i=Ir())!==o&&(a=cr())!==o?(41===e.charCodeAt(Un)?(s=")",Un++):(s=o,0===Kn&&rr(ee)),s!==o?(zn=t,t=n=ye(i)):(Un=t,t=o)):(Un=t,t=o))),Xn[f]={nextPos:Un,result:t},t)}function Yr(){var t,n,r,i,a,s,l,u=113*Un+46,c=Xn[u];return c?(Un=c.nextPos,c.result):(t=Un,n=Un,(r=ur())!==o?("cross"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Ee)),i!==o&&(a=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(s=e.substr(Un,4),Un+=4):(s=o,0===Kn&&rr(je)),s!==o&&(l=ur())!==o?n=r=[r,i,a,s,l]:(Un=n,n=o)):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,(r=cr())!==o?(44===e.charCodeAt(Un)?(i=",",Un++):(i=o,0===Kn&&rr(oe)),i!==o&&(a=cr())!==o?n=r=[r,i,a]:(Un=n,n=o)):(Un=n,n=o)),n!==o&&(r=Hr())!==o?(zn=t,t=n={type:"crossJoin",child2:r,cond:null}):(Un=t,t=o),Xn[u]={nextPos:Un,result:t},t)}function Fr(){var t,n,r,i,a=113*Un+47,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,ur()!==o?("natural"===e.substr(Un,7).toLowerCase()?(n=e.substr(Un,7),Un+=7):(n=o,0===Kn&&rr(Ce)),n!==o&&ur()!==o?("join"===e.substr(Un,4).toLowerCase()?(r=e.substr(Un,4),Un+=4):(r=o,0===Kn&&rr(je)),r!==o&&ur()!==o&&(i=Hr())!==o?(zn=t,t={type:"naturalJoin",child2:i,cond:null}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Wr(){var t,n,r,i,a,s,l,u,c,d,h,f,m,p,g,y=113*Un+48,b=Xn[y];if(b)return Un=b.nextPos,b.result;if(t=Un,ur()!==o)if(n=Un,r=Un,"inner"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Se)),i!==o&&(a=ur())!==o?r=i=[i,a]:(Un=r,r=o),r===o&&(r=null),r!==o?("join"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(je)),i!==o?(zn=n,n=r="innerJoin"):(Un=n,n=o)):(Un=n,n=o),n===o&&(n=Un,r=Un,"left"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Oe)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="leftOuterJoin"),(n=r)===o&&(n=Un,r=Un,"right"===e.substr(Un,5).toLowerCase()?(i=e.substr(Un,5),Un+=5):(i=o,0===Kn&&rr(Te)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="rightOuterJoin"),(n=r)===o&&(n=Un,r=Un,"full"===e.substr(Un,4).toLowerCase()?(i=e.substr(Un,4),Un+=4):(i=o,0===Kn&&rr(Me)),i!==o?(a=Un,(s=ur())!==o?("outer"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(ke)),l!==o?a=s=[s,l]:(Un=a,a=o)):(Un=a,a=o),a===o&&(a=null),a!==o&&(s=ur())!==o?("join"===e.substr(Un,4).toLowerCase()?(l=e.substr(Un,4),Un+=4):(l=o,0===Kn&&rr(je)),l!==o?r=i=[i,a,s,l]:(Un=r,r=o)):(Un=r,r=o)):(Un=r,r=o),r!==o&&(zn=n,r="fullOuterJoin"),n=r))),n!==o)if((r=ur())!==o)if((i=Hr())!==o)if((a=ur())!==o){if(s=Un,"on"===e.substr(Un,2).toLowerCase()?(l=e.substr(Un,2),Un+=2):(l=o,0===Kn&&rr(xe)),l!==o&&ur()!==o&&(u=io())!==o?(zn=s,s=l=u):(Un=s,s=o),s===o){if(s=Un,"using"===e.substr(Un,5).toLowerCase()?(l=e.substr(Un,5),Un+=5):(l=o,0===Kn&&rr(Re)),l!==o)if(cr()!==o)if(40===e.charCodeAt(Un)?(u="(",Un++):(u=o,0===Kn&&rr(Q)),u!==o)if(cr()!==o)if((c=br())!==o){for(d=[],h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);h!==o;)d.push(h),h=Un,(f=cr())!==o?(44===e.charCodeAt(Un)?(m=",",Un++):(m=o,0===Kn&&rr(oe)),m!==o&&(p=cr())!==o&&(g=br())!==o?h=f=[f,m,p,g]:(Un=h,h=o)):(Un=h,h=o);d!==o&&(h=cr())!==o?(41===e.charCodeAt(Un)?(f=")",Un++):(f=o,0===Kn&&rr(ee)),f!==o?(zn=s,s=l=function(e,t,n,r){for(var o=[n],i=0;i"===e.substr(Un,2)?(n="<>",Un+=2):(n=o,0===Kn&&rr(Ve));n===o&&("!="===e.substr(Un,2)?(n="!=",Un+=2):(n=o,0===Kn&&rr(qe)));n!==o&&(zn=t,n="!=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+60,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,">="===e.substr(Un,2)?(n=">=",Un+=2):(n=o,0===Kn&&rr(Ge));n!==o&&(zn=t,n=">=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n,r=113*Un+62,i=Xn[r];if(i)return Un=i.nextPos,i.result;t=Un,"<="===e.substr(Un,2)?(n="<=",Un+=2):(n=o,0===Kn&&rr(Xe));n!==o&&(zn=t,n="<=");return t=n,Xn[r]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+61,r=Xn[n];if(r)return Un=r.nextPos,r.result;62===e.charCodeAt(Un)?(t=">",Un++):(t=o,0===Kn&&rr(Ke));return Xn[n]={nextPos:Un,result:t},t}())===o&&(t=function(){var t,n=113*Un+63,r=Xn[n];if(r)return Un=r.nextPos,r.result;60===e.charCodeAt(Un)?(t="<",Un++):(t=o,0===Kn&&rr($e));return Xn[n]={nextPos:Un,result:t},t}()),Xn[n]={nextPos:Un,result:t},t)}function qr(){var t,n,r,i,a=113*Un+69,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(t=Un,(n=hr())!==o&&lr()!==o&&(r=hr())!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i===o&&(i=null),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o),t===o)if(t=Un,35===e.charCodeAt(Un)?(n="#",Un++):(n=o,0===Kn&&rr(at)),n!==o)if(hr()!==o){for(r=[],st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));i!==o;)r.push(i),st.test(e.charAt(Un))?(i=e.charAt(Un),Un++):(i=o,0===Kn&&rr(lt));r!==o?(10===e.charCodeAt(Un)?(i="\n",Un++):(i=o,0===Kn&&rr(u)),i!==o?(zn=t,t=n={type:"comment"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;return Xn[a]={nextPos:Un,result:t},t}function Gr(){var t,n,r,i,a=113*Un+70,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,96===e.charCodeAt(Un)?(n="`",Un++):(n=o,0===Kn&&rr(ut)),n!==o&&(r=yr())!==o?(96===e.charCodeAt(Un)?(i="`",Un++):(i=o,0===Kn&&rr(ut)),i!==o?(zn=t,t=n=r):(Un=t,t=o)):(Un=t,t=o),t===o&&(t=Un,(n=yr())!==o&&(zn=t,n=n),t=n),Xn[a]={nextPos:Un,result:t},t)}function Kr(){var t,n,r,i,a,s,l,u,c=113*Un+71,d=Xn[c];return d?(Un=d.nextPos,d.result):(t=Un,"drop"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ct)),n!==o&&dr()!==o?("table"===e.substr(Un,5).toLowerCase()?(r=e.substr(Un,5),Un+=5):(r=o,0===Kn&&rr(dt)),r!==o&&dr()!==o?(i=Un,"if"===e.substr(Un,2).toLowerCase()?(a=e.substr(Un,2),Un+=2):(a=o,0===Kn&&rr(ht)),a!==o&&(s=dr())!==o?("exists"===e.substr(Un,6).toLowerCase()?(l=e.substr(Un,6),Un+=6):(l=o,0===Kn&&rr(it)),l!==o&&(u=dr())!==o?i=a=[a,s,l,u]:(Un=i,i=o)):(Un=i,i=o),i===o&&(i=null),i!==o&&(a=Gr())!==o&&(s=hr())!==o?(59===e.charCodeAt(Un)?(l=";",Un++):(l=o,0===Kn&&rr(se)),l!==o?(zn=t,t=n={type:"dropTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[c]={nextPos:Un,result:t},t)}function Xr(){var t,n,r,i,a,s,l=113*Un+72,u=Xn[l];if(u)return Un=u.nextPos,u.result;if(t=Un,"lock"===e.substr(Un,4).toLowerCase()?(n=e.substr(Un,4),Un+=4):(n=o,0===Kn&&rr(ft)),n!==o)if(dr()!==o)if("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o)if(dr()!==o)if(Gr()!==o)if(dr()!==o){if(i=[],F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W)),a!==o)for(;a!==o;)i.push(a),F.test(e.charAt(Un))?(a=e.charAt(Un),Un++):(a=o,0===Kn&&rr(W));else i=o;i!==o&&(a=hr())!==o?(59===e.charCodeAt(Un)?(s=";",Un++):(s=o,0===Kn&&rr(se)),s!==o?(zn=t,t=n={type:"lockTable"}):(Un=t,t=o)):(Un=t,t=o)}else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;else Un=t,t=o;return Xn[l]={nextPos:Un,result:t},t}function $r(){var t,n,r,i,a=113*Un+73,s=Xn[a];return s?(Un=s.nextPos,s.result):(t=Un,"unlock"===e.substr(Un,6).toLowerCase()?(n=e.substr(Un,6),Un+=6):(n=o,0===Kn&&rr(pt)),n!==o&&dr()!==o?("tables"===e.substr(Un,6).toLowerCase()?(r=e.substr(Un,6),Un+=6):(r=o,0===Kn&&rr(mt)),r!==o&&hr()!==o?(59===e.charCodeAt(Un)?(i=";",Un++):(i=o,0===Kn&&rr(se)),i!==o?(zn=t,t=n={type:"unlockTable"}):(Un=t,t=o)):(Un=t,t=o)):(Un=t,t=o),Xn[a]={nextPos:Un,result:t},t)}function Jr(){var e,t,n,r,i,a=113*Un+74,s=Xn[a];if(s)return Un=s.nextPos,s.result;if(e=Un,hr()!==o){if(t=[],n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o),n!==o)for(;n!==o;)t.push(n),n=Un,(r=Qr())===o&&(r=Xr())===o&&(r=$r())===o&&(r=qr())===o&&(r=Kr())===o&&(r=to())===o&&(r=oo()),r!==o&&(i=hr())!==o?n=r=[r,i]:(Un=n,n=o);else t=o;t!==o&&(n=hr())!==o?(zn=e,e=function(e){var t,n,r,o,i,a,s={},l={},u="";for(n=0;n!0===n.evaluate(e,t,r,o),this._checkSchema(e,t)}_getResult(e,t){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator)throw new Error("check not called");const n=new c.a;return n.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),n,this._isRightJoin,this._isAntiJoin,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),!0===t&&n.eliminateDuplicateRows(),this.setResultNumRows(n.getNumRows()),n}static createNullArray(e){return new Array(e).fill(null)}static getCheckedEvaluatorBooleanExpression(e,t,n,r){if(n.check(e,t),"boolean"!==n.getDataType())throw new m.a("db.messages.exec.error-condition-must-be-boolean",r);return function(e,t,r,o){return!0===n.evaluate(e,t,r,o)}}static getCheckedEvaluatorNaturalJoin(e,t,n,r){}static calcNestedLoopJoin(e,t,n,r,o,i,a,s,l){const u=t.getResult(e),c=n.getResult(e),d=u.getNumRows(),h=c.getNumRows(),f=u.getNumCols();c.getNumCols();if(!1===o){let t;null!==l&&(t=p.createNullArray(r.getSchema().getSize()-f));const n={};for(let o=0;o0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}getArgumentHtml(){return""}}class y extends u.c{constructor(e,t){super("π",e),this._checked=null,this._columns=t}getSchema(){if(null===this._columns)return this._child.getSchema();if(null===this._checked)throw new Error("check has not been called");return this._checked._projectedSchema}getResult(e){if(e=this._returnOrCreateSession(e),null===this._checked)throw new Error("check has not been called");const{_indices:t}=this._checked;if(null===this._columns)return this._child.getResult(e);const n=this._child.getResult(e),r=new c.a;r.setSchema(this.getSchema());const o=r.getNumCols(),i=n.getNumRows();let a,s,l,u;for(a=0;a-1&&o.removeColumn(n)}o.getSize()===n&&this.throwExecutionError(i18n.t("db.messages.exec.error-schema-a-not-part-of-schema-b",{schemaA:t,schemaB:e})),this._delegate=new d(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),new y(new d(new g(new y(this._child,o.getColumns()).setCodeInfoObject(this._codeInfo),this._child2).setCodeInfoObject(this._codeInfo),this._child).setCodeInfoObject(this._codeInfo),o.getColumns()).setCodeInfoObject(this._codeInfo)),this._delegate.check()}}class v extends u.c{constructor(e,t,n){super("γ",e),this.checked=null,this.groupByCols=t,this.aggregateFunctions=n}getSchema(){if(null===this.checked)throw new Error("check not called");return this.checked.schema}check(){this._child.check();const e=this._child.getSchema(),t=new Array(this.groupByCols.length),n=Array(this.aggregateFunctions.length);for(let n=0;nl.a.printColumn(e.name,e.relAlias)),t=this.aggregateFunctions.map(e=>`${"COUNT_ALL"===e.aggFunction?"COUNT(*)":`${e.aggFunction}(${l.a.printColumn(e.col.name,e.col.relAlias)})`}→${e.name}`);return`${e.join(", ")}; ${t.join(", ")}`}getResult(e){if(e=this._returnOrCreateSession(e),null===this.checked)throw new Error("check not called");const t=this.getChild().getResult(e),n=new c.a;n.setSchema(this.checked.schema);let r,o=0;if(this.groupByCols.length>0){const e={};for(let n=0;nt?e:t};let s,l,u,d;for(let e=0;e0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)},this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){if(e=this._returnOrCreateSession(e),null===this._joinConditionEvaluator||null===this._rowCreatorMatched||null===this._rowCreatorNotMatched)throw new Error("check not called");const t=new c.a;return t.setSchema(this.getSchema()),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!1,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),p.calcNestedLoopJoin(e,this.getChild(),this.getChild2(),t,!0,!1,this._joinConditionEvaluator,this._rowCreatorMatched,this._rowCreatorNotMatched),t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t}}class j extends p{constructor(e,t,n){super(e,t,"⨝",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=null}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class C extends p{constructor(e,t,n){super(e,t,"⟕",n,!1)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!0,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class S extends p{constructor(e,t,n){super(e,t,"⟖",n,!0)}_checkSchema(e,t){try{if("natural"===this._joinConditionOptions.type){const n=h.a.concatNatural(e,t,!1,this._joinConditionOptions.restrictToColumns),r=n.keep;this._schema=n.schema,this._rowCreatorMatched=function(e,t){return p.createNaturalRowArray(e,t,r.size,r.keepIndicesA,r.keepIndicesB)}}else{const n=e.getConflictingColumnsArray(t);n.length>0&&this.throwExecutionError(s.a("db.messages.exec.error-join-would-produce-non-unique-columns",{conflicts:n.join(", ")})),this._schema=h.a.concat(this._child.getSchema(),this._child2.getSchema()),this._rowCreatorMatched=function(e,t){return e.concat(t)}}this._rowCreatorNotMatched=function(e,t){return e.concat(t)}}catch(e){this.throwExecutionError(e.message)}}getResult(e){return super._getResult(e,!0)}}class O extends p{constructor(e,t,n){super(e,t,n?"⋉":"⋊",{type:"natural",restrictToColumns:null},!n)}_checkSchema(e,t){this._isRightJoin?(this._schema=t.copy(),this._rowCreatorMatched=function(e,t){return t}):(this._schema=e.copy(),this._rowCreatorMatched=function(e,t){return e}),this._rowCreatorNotMatched=null}getResult(e){return super._getResult(e,!0)}}class k extends u.c{constructor(e,t,n){if(super("τ",e),this._orderCols=t,this._orderAsc=n,this._orderAsc.length!==this._orderCols.length)throw new Error("order cols not correct");this._orderIndices=null}getSchema(){return this._child.getSchema()}getResult(e){if(e=this._returnOrCreateSession(e),null===this._orderIndices)throw new Error("check not called");const t=this.getChild().getResult(e).copy();return t.eliminateDuplicateRows(),this.setResultNumRows(t.getNumRows()),t.sort(this._orderIndices,this._orderAsc),t}check(){this._child.check();const e=this._child.getSchema();this._orderIndices=[];for(let t=0;t0){const n=[],r=e.groupBy||[];for(let e=0;e0)a=new v(a,r,n);else{const e=[];for(let t=0;t",[new f.c("number","rownum",[]),new f.c("number","constant",[o])]);if(-1===n)a=new R(r(t.child),i);else{const e=new f.c("boolean","<=",[new f.c("number","rownum",[]),new f.c("number","constant",[n+o])]);a=new R(r(t.child),new f.c("boolean","and",[i,e]))}break}default:throw new Error(`type ${e.type} not implemented`)}if(!a)throw new Error("should not happen");return!0===e.wrappedInParentheses&&a.setWrappedInParentheses(!0),n(a,e),a}function o(e,t,n){e.check();const r=new R(e,N(t));return r.setCodeInfoObject(n),r}function i(e){return"column"===e.type&&e.alias}return r(e.child)}function N(e){let t;if("null"===e.datatype&&"columnValue"===e.func)t=new f.b(e.args[0],e.args[1]);else switch(e.datatype){case"string":case"number":case"boolean":case"date":case"null":const n=[];for(let t=0;t{"relation"!==e.type||void 0!==t&&!1!==t.has(e.name)||n.push({name:e.name,line:e.codeInfo.location.start.line,column:e.codeInfo.location.start.column})}),n}function B(e,t){const n=Y.a.isMap(t)?t:Y.a().withMutations(e=>{for(const n of Object.keys(t))e.set(n,t[n])}).asImmutable();if(0===e.assignments.length)return;const r=new Map;Y.c().withMutations(t=>{for(let n=0;n{if(!0===i.get(e))return;if(!0===o.get(e))throw new Error(s.a("db.messages.translate.error-variable-cyclic-usage",{name:e}));o.set(e,!0);const t=r.get(e);if(void 0!==t){const{childRelations:e}=t;for(let t=0;t{if("relation"===e.type&&e.name===t.name){return Object.assign(Object.assign({},t.child),{metaData:Object.assign(Object.assign({},t.child.metaData),{fromVariable:t.name})})}return e});e=Object.assign(Object.assign({},e),{child:n})}r.set(e.name,e)}for(const[,t]of r)e.assignments[t.assignmentIndex].child=t.child;if(("relalgRoot"===e.type||"sqlRoot"===e.type)&&null!==e.child&&void 0!==e.child)for(const[t,n]of r)e.child=Object(F.b)(e.child,e=>"relation"===e.type&&e.name===t?Object.assign(Object.assign({},n.child),{metaData:Object.assign(Object.assign({},n.child.metaData),{fromVariable:t})}):e)}var U=n("./src/db/translate/textFromAst.ts");function z(e,t,n,r){if("none"===r)return{query:e,cursor:n};const o={math2plain:{pi:"pi",sigma:"sigma",rho:"rho",arrowLeft:"<-",arrowRight:"->",psi:"psi",tau:"tau",gamma:"gamma",unionOperator:"union",intersectOperator:"intersect",divisionOperator:"/",differenceOperator:"-",crossJoinOperator:"cross join",innerJoinOperator:"inner join",naturalJoinOperator:"natural join",leftSemiJoinOperator:"left semi join",rightSemiJoinOperator:"right semi join",antiJoinOperator:"anti join",leftOuterJoinOperator:"left outer join",rightOuterJoinOperator:"right outer join",fullOuterJoinOperator:"full outer join"},plain2math:{pi:"π",sigma:"σ",rho:"ρ",arrowLeft:"←",arrowRight:"→",psi:"ψ",tau:"τ",gamma:"γ",unionOperator:"∪",intersectOperator:"∩",divisionOperator:"÷",differenceOperator:"-",crossJoinOperator:"⨯",innerJoinOperator:"⨝",naturalJoinOperator:"⨝",leftSemiJoinOperator:"⋉",rightSemiJoinOperator:"⋊",antiJoinOperator:"▷",leftOuterJoinOperator:"⟕",rightOuterJoinOperator:"⟖",fullOuterJoinOperator:"⟗"}};for(let i=t.length-1;i>=0;i--){const a=t[i],s=a.location,l=e.substr(0,s.start.offset),u=e.substring(s.end.offset),c=o[r][a.name];if(e.substring(s.start.offset,s.end.offset)!==c){if(n)if(n.line>=s.start.line&&n.line<=s.end.line){if(n.column>s.start.column&&n.column=s.end.column){n.line-=s.end.line-s.start.line;const e=a.location.end.offset-a.location.start.offset,t=c.length;n.column-=e-t}}else n.lines.end.line&&(n.line-=s.end.line-s.start.line);e=l+c+u}}return{query:e,cursor:n}}const V=n("./src/db/parser/grammar_sql.pegjs");function q(e){return V.parse(e,{startRule:"start",tracer:void 0,i18n:r.c})}function G(e){return V.parse(e,{startRule:"dbDumpStart",tracer:void 0})}function K(e,t={}){t=t||{};const n=i(e,Object.keys(t));B(n,t);const r=I(n,t);return r.check(),r}},"./src/db/translate/textFromAst.ts":function(e,t,n){"use strict";(function(e){function r(e){if("groupRoot"!==e.type)throw new Error("wrong ast!?");let t="";function n(e){let t="";const{headers:n}=e;for(const e of n){const{name:n,lang:r,text:o}=e;t+=n,null!==r&&(t+="@"+r),t+=":",-1!==e.text.indexOf("\n")?t+=`[[${e.text}]]\n`:t+=e.text+"\n"}t+="\n";for(let n=0;n");if(null!==t&&i.addClass(t),null!==n&&i.append(n),null!==r){const t=e("");t.append(r),i.append(" ").append(t)}return null!==o&&i.append(" ( ").append(o).append(" ) "),i.text()}function r(t,n,r,o,i){const a=e("");if(null!==t&&a.addClass(t),a.append("( ").append(o).append(" ) "),a.append(n),null!==r){const t=e("");t.append(r),a.append(t)}return a.append(" ( ").append(i).append(" ) "),a.text()}function o(e,t){return"number"==typeof e&&(e=`[${e}]`),null===t?e:`${t}.${e}`}function i(e,t){if(null===e||"null"===t)return"null";if(e instanceof Date)return function(e){const t=e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1,n=e.getDate()<10?"0"+e.getDate():e.getDate();return`${e.getFullYear()}-${t}-${n}`}(e);if("string"==typeof e)return`'${e}'`;if("number"==typeof e)return e.toString();throw new Error("unknown type "+t)}return function e(t){switch(t.type){case"relation":return n(t.type,t.name,null,null);case"table":{const e=[];let n=[];for(let e=0;er[n])&&(r[n]=o)}let o="{\n";for(let i=0;i0){for(let e=0;e{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}else if("sqlRoot"===e.type){let n=!1;const o=e.assignments.map(e=>{const o=r(e.child,t);return o!==e.child?(n=!0,Object.assign(Object.assign({},e),{child:o})):e});n&&(e=Object.assign({},e,{assignments:o}))}return t(e)}function o(e,t,n=!0){if(t(e),"statement"===e.type?o(e.from,t,n):"relationFromSubstatement"===e.type&&o(e.statement,t,n),void 0!==e.child&&o(e.child,t,n),void 0!==e.child2&&o(e.child2,t,n),void 0!==e.assignments&&!0===n)for(const r of e.assignments)o(r,t,n)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},"./src/locales/de.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"Variablenname wurde mehrfach definiert: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"mehrfacher header {{name}}","db.messages.parser.error-group-unknown-header":"unbekannter header {{name}}","db.messages.parser.error-group-header-name-missing":"der Name des Datensatzes fehlt (group: ....)","db.messages.parser.error-group-header-name-empty":"der Name des Datensatzes ist leer","db.messages.parser.error-group-non-unique-attribute":"nicht eindeutiges Attribut {{name}} in Spalte {{index}}","db.messages.parser.error-group-non-unique-group-name":"Der Name der Gruppe {{name}} ist nicht eindeutig.","db.messages.parser.error-sql-string-use-single-quotes":"verwenden Sie einfache Anführungszeichen für Zeichenketten","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" darf nicht als name einer Relation verwendet werden","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" darf nicht als name einer Spalte verwendet werden","db.messages.parser.error-sql-group-by-missing":"group-by-Klausel fehlt","db.messages.parser.error-sql-having-without-group-by":"having-Klausel gefunden doch \\"group by\\" or Aggregation fehlt","db.messages.parser.error-sql-negative-limit":"das Limit muss größer oder gleich 0 sein","db.messages.parser.error-sqldump-invalid-column-number":"ungültige Spaltenanzahl in Zeile {{line}}","db.messages.parser.error-sqldump-invalid-type":"ungültiger Typ in Zeile {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"Anzahl der Werte != Anzahl der Spalten","db.messages.parser.error-valueexpr-like-operand-no-string":"der rechte Operand von LIKE muss ein Zeichenkettenliteral sein","db.messages.exec.error-column-not-unique":"Spalte \\"{{column}}\\" kann wegen mehrdeutigkeit nicht hinzugefügt werden","db.messages.exec.error-column-not-found-name":"Spalte \\"{{column}} wurde im Schema {{schema}} nicht gefunden","db.messages.exec.error-column-not-found-index":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-column-ambiguous":"Spalte \\"{{column}}\\" ist mehrdeutig im Schema {{schema}}","db.messages.exec.error-column-index-out-of-range":"Spaltenindex \\"{{column}}\\" ist ausserhalb des Gültigkeitsbereichs für Schema {{schema}}; Indizes starten mit 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"Relations alias \\"{{alias}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden","db.messages.exec.error-could-not-rename-ambiguity":"neuer Name \\"{{newName}}\\" für \\"{{oldName}}\\" kann wegen Mehrdeutigkeit nicht gesetzt werden im Schema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"Schema {{schemaA}} ist nicht Teil von {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"Schemas sind nicht unifiable: Typen oder Anzahl der Attribute ist unterschiedlich: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"Spalte \\"{{column}}\\" kann nicht in beiden Schemas des Joins gefunden werden","db.messages.exec.error-condition-must-be-boolean":"Bedingung muss ein boolscher Ausdruck sein","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} ist nicht für Datentyp {{colType}} definiert","db.messages.exec.error-join-would-produce-non-unique-columns":"Die folgenden Spalten sind teil beider Relationen: {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"Keine Spalten gefunden für \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"Datentype für Spalte {{index}} (\\"{{column}}\\") wurde nicht spezifiziert","db.messages.exec.error-invalid-projection-error":"ungültige Projektion \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"Funktion \\"{{func}}\\" erwartet Argumente vom Typ \\"{{expected}}\\" aber \\"{{given}}\\" gefunden","db.messages.exec.error-could-not-compare-different-types":"Werte mit unterschiedlichen Datentypen können nicht verglichen werden: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"Funktion {{func}} erwartet, dass alle Argumente den selben Datentyp haben.","db.messages.exec.error-case-when-condition-must-be-boolean":"Die Bedingung für ein CASE WHEN muss ein boolscher Ausdruck sein","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END erwartet dass alle results vom selben Typ sind","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" ist kein gültiges Datum; erwartetes Format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"Relation \\"{{name}}\\" nicht gefunden","db.messages.translate.warning-distinct-missing":"Distinct fehlt","db.messages.translate.warning-ignored-all-on-set-operators":"ALL bei Mengenoperatoren wurde ignoriert","db.messages.translate.error-variable-name-conflict":"Namenskonflikt: eine Relation mit Namen \\"{{name}}\\" existiert bereits","db.messages.translate.error-variable-cyclic-usage":"Zyklische Verwendung von Variable \\"{{name}}\\" erkannt","editor.codemirror-placeholder":"Abfrage ...\\nTastatürkürzel\\n\\tAbfrage ausführen: [CTRL]+[RETURN]\\n\\tMarkierten teil der Abfrage ausführen: [CTRL]+[SHIFT]+[RETURN]\\tAutovervollständigung: [CTRL]+[SPACE]","editor.alert-message-headers.success":"Erfolg","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warnung","editor.alert-message-headers.error":"Fehler","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"abbrechen","editor.inline-relation-editor.placeholder-column-name-and-types":"spaltenName:datenTyp","editor.inline-relation-editor.enter-your-data":"bitte Daten eingeben","editor.inline-relation-editor.error-column-name-missing":"Spaltenname fehlt in Spalte {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"Zeichenketten dürfen keine doppelten oder einfache Anführungszeichen enthalten","editor.error-no-query-found":"keine Abfrage gefunden","editor.pegjs-error.or":"oder","editor.pegjs-error.no-input-found":"keine Eingabe gefunden","editor.pegjs-error.end-of-input":"Ende der Eingabe","editor.pegjs-error.expected-found":"Erwarte {{expected}} aber {{found}} gefunden.","editor.error-at-line-x":"in Zeile {{line}}","calc.messages.error-query-missing":"keine Abfrage gefunden","calc.messages.error-query-missing-assignments-found":"nur Zuweisungen gefunden; die eigentliche Abfrage fehlt Help - Assignments (en)","calc.messages.gist-load-success":"gist erfolgreich geladen","calc.menu.headline":"Datensätze","calc.menu.datasets":"Datensätze","calc.menu.load-gist-headline":"Datensatz aus gist laden","calc.menu.load-gist-button":"laden","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Eigenen Datensatz erstellen","calc.menu.create-own-dataset-text":"Sie können Ihren eigenen Datensatz erstellen und ihn mit anderen teilen. Lernen Sie mehr darüber im Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial (en)","calc.menu.create-own-dataset-button-new":"neuen Datensatz erstellen","calc.menu.create-own-dataset-button-modify":"aktuellen Datensatz abändern","calc.navigation.take-a-tour":"Tour starten","calc.navigation.feedback":"Feedback","calc.navigation.help":"Hilfe (en)","calc.navigation.calc":"Rechner","calc.navigation.language":"Sprache","calc.maintainer-groups.misc":"Diverse","calc.maintainer-groups.temp":"Ungespeichert","calc.maintainer-groups.uibk":"Universität Innsbruck","calc.maintainer-groups.karlsruhe":"Universität Karlsruhe","calc.maintainer-groups.saarland":"Universität Saarland","calc.editors.button-history":"Verlauf","calc.editors.insert-relation-title":"Einfügen","calc.editors.insert-relation-tooltip":"Beziehungs- oder Spaltennamen einfügen","calc.editors.group.tab-name":"Datensatz Editor","calc.editors.group.tab-name-short":"DS","calc.editors.group.toolbar.import-sql":"SQL-dump importieren","calc.editors.group.toolbar.import-sql-content":"SQL-dump importieren","calc.editors.group.toolbar.add-new-relation":"neue Relation hinzufügen","calc.editors.group.toolbar.add-new-relation-content":"Relationseditor öffnen","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"Vorschau","calc.editors.group.button-use":"Datensatz im Editor verwenden","calc.editors.group.button-use_plural":"Datensatz im Editor verwenden","calc.editors.group.sql-import-group-name-placeholder":"Name des Datensatzes (importiert)","calc.editors.group.new-group-example-group":"-- dies ist ein Beispiel\\n\\ngroup: nameDesDatensatzes \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tbeispiel, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump importieren","calc.editors.group.modal-sqldump.button-close":"schließen","calc.editors.group.modal-sqldump.button-cancel":"abbrechen","calc.editors.group.modal-sqldump.button-import-sql":"importieren","calc.editors.group.modal-sqldump.description":"Kopieren Sie den SQL-Dump hier her um einen Datensatz daraus zu erstellen.","calc.editors.ra.tab-name":"Relationale Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"Query ausführen","calc.editors.ra.button-execute-selection":"Markierung ausführen","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"Projektion","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"Selektion","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"Umbenennen (Relationen/Spalten)","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.right-arrow":"Pfeil nach Rechts","calc.editors.ra.toolbar.rename-columns-operator":"Umbenennung von Spalten","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"Sortieren","calc.editors.ra.toolbar.orderBy-content":"","calc.editors.ra.toolbar.groupBy":"Gruppieren","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"Und","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"Xor","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"Oder","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"Verneinung","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )
              ","calc.editors.ra.toolbar.equals":"Gleich","calc.editors.ra.toolbar.equals-content":" a = b ( A )
              ","calc.editors.ra.toolbar.not-equals":"Ungleich","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )
              ","calc.editors.ra.toolbar.greater-or-equals":"Größer-Gleich","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.lesser-or-equals":"Kleiner-Gleich","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.intersect":"Schnittmenge","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"Vereinigung","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"Division (Relationen)","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"Mengendifferenz","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\n ( B )
              ","calc.editors.ra.toolbar.cross-join":"cross join (Kreuzprodukt)","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"Zuweisung","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"Kommentar einzeilig","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"Kommentar mehrzeilig","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-Relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"inline-Relation (Editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"eine neue inline-Relation mit dem Editor erstellen","calc.editors.ra.toolbar.insert-date":"Datum einfügen","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"Operatoren ersetzen","calc.editors.ra.toolbar.autoreplace-operators.header":"Operatoren automatisch ersetzen","calc.editors.ra.toolbar.autoreplace-operators.none":"keine Ersetzung","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Query ausführen","calc.editors.sql.button-execute-selection":"Markierung ausführen","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select-Klausel","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"from-Klausel","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"where-Klausel","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group-b-Klausel","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"having-Klausel","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"order-by-Klausel","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"limit-Klausel","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"Datum einfügen","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Ergebnis","calc.result.modal.close":"Schließen","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"CSV downloaden","calc.editors.ra.inline-editor.button-upload-csv":"CSV uploaden","calc.editors.ra.inline-editor.button-cancel":"Abbrechen","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Typ","calc.editors.ra.inline-editor.input-relation-name":"Relations Name","calc.navigation.imprint":"Impressum"}')},"./src/locales/en.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"duplicate variable name: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"duplicate header {{name}}","db.messages.parser.error-group-unknown-header":"unknown header {{name}}","db.messages.parser.error-group-header-name-missing":"the name of the group is missing (group: ....)","db.messages.parser.error-group-header-name-empty":"the name of the group must not be empty","db.messages.parser.error-group-non-unique-attribute":"non unique attribute {{name{{ in column }}index}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use single quotes for strings","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" must not be used as a relation-name","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" must not be used as a column-name","db.messages.parser.error-sql-group-by-missing":"group by is missing","db.messages.parser.error-sql-having-without-group-by":"having found but missing \\"group by\\" or aggregation","db.messages.parser.error-sql-negative-limit":"the limit given must be >= 0","db.messages.parser.error-sqldump-invalid-column-number":"invalid number of columns in line {{line}}","db.messages.parser.error-sqldump-invalid-type":"invalid type in line {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"number of values != number of columns","db.messages.parser.error-valueexpr-like-operand-no-string":"right operand of LIKE must be a string literal","db.messages.exec.error-column-not-unique":"could not add column \\"{{column}}\\" because of ambiguity","db.messages.exec.error-column-not-found-name":"could not find column \\"{{column}}\\" in schema {{schema}}","db.messages.exec.error-column-not-found-index":"column index \\"{{column}}\\" is out of range in schema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"column \\"{{column}}\\" is ambiguous in {{schema}}","db.messages.exec.error-column-index-out-of-range":"column index \\"{{column}}\\" is out of range in {{schema}}; index starts at 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"could not set relation alias \\"{{alias}}\\" because of ambiguity","db.messages.exec.error-could-not-rename-ambiguity":"could not set new name \\"{{newName}}\\" for \\"{{oldName}}\\" because of ambiguity in {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"schema {{schemaA}} is not part of {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"schemas are not unifiable: types are different or size is different: {{schemaA}} and {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"column \\"{{column}}\\" can not be found in both schemas of join","db.messages.exec.error-condition-must-be-boolean":"condition must be a boolean expression","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} not defined for type {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"join would result in non unique column names {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"no columns match \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"datatype for column {{index}} (\\"{{column}}\\") is not specified","db.messages.exec.error-invalid-projection-error":"invalid projection \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"function \\"{{func}}\\" expects arguments of type \\"{{expected}}\\" but \\"{{given}}\\" given","db.messages.exec.error-could-not-compare-different-types":"could not compare value if types are different: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} expects all arguments to be of the same type","db.messages.exec.error-case-when-condition-must-be-boolean":"the condition of a CASE WHEN must be of type boolean","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END expects all results to be of the same type","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" is not a valid date; expected format: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"could not find relation \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT is missing","db.messages.translate.warning-ignored-all-on-set-operators":"ignored ALL on set operation","db.messages.translate.error-variable-name-conflict":"name conflict: relation name \\"{{name}}\\" already exists","db.messages.translate.error-variable-cyclic-usage":"cyclic usage of variable \\"{{name}}\\" detected","editor.codemirror-placeholder":"your query goes here ...\\n\\nkeyboard shortcuts:\\n\\texecute statement: [CTRL]+[RETURN]\\n\\texecute selection: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocomplete: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Success","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Warning","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancel","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"please enter your data","editor.inline-relation-editor.error-column-name-missing":"column name missing in column {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string must not contain single and double quotes","editor.error-no-query-found":"no query found","editor.pegjs-error.or":"or","editor.pegjs-error.no-input-found":"no input found","editor.pegjs-error.end-of-input":"end of input","editor.pegjs-error.expected-found":"Expected {{expected}} but {{found}} found.","editor.error-at-line-x":"at line {{line}}","calc.messages.error-query-missing":"no query found","calc.messages.error-query-missing-assignments-found":"only assignments found; query is missing Help - Assignments","calc.messages.gist-load-success":"gist loaded successfully","calc.menu.headline":"load a Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Load dataset stored in a gist","calc.menu.load-gist-button":"load","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Create your own Dataset","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"create new Dataset","calc.menu.create-own-dataset-button-modify":"modify current Dataset","calc.navigation.take-a-tour":"Take a Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Help","calc.navigation.calc":"Calculate","calc.navigation.language":"Language","calc.maintainer-groups.misc":"Miscellaneous","calc.maintainer-groups.temp":"Temporary","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.karlsruhe":"University of Karlsruhe","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"history","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"Group Editor","calc.editors.group.tab-name-short":"GE","calc.editors.group.toolbar.import-sql":"import SQL-dump","calc.editors.group.toolbar.import-sql-content":"import SQL-dump","calc.editors.group.toolbar.add-new-relation":"add new relation","calc.editors.group.toolbar.add-new-relation-content":"open relation editor","calc.editors.group.button-download":"download","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"use Group in editor","calc.editors.group.button-use_plural":"use first Group in editor","calc.editors.group.sql-import-group-name-placeholder":"Name of the group (imported from SQL)","calc.editors.group.new-group-example-group":"-- this is an example\\n\\ngroup: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Import SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Close","calc.editors.group.modal-sqldump.button-cancel":"cancel","calc.editors.group.modal-sqldump.button-import-sql":"import SQL","calc.editors.group.modal-sqldump.description":"Put your SQL-Dump here to create a group.","calc.editors.ra.tab-name":"Relational Algebra","calc.editors.ra.tab-name-short":"RelAlg","calc.editors.ra.button-execute-query":"execute query","calc.editors.ra.button-execute-selection":"execute selection","calc.editors.ra.button-download":"download","calc.editors.ra.toolbar.projection":"projection","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"selection","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"rename relation / rename columns","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.right-arrow":"Right arrow","calc.editors.ra.toolbar.rename-columns-operator":"rename columns operator","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"order by","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"group by","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"and","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"or","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"not","calc.editors.ra.toolbar.not-content":"
              &sigma","calc.editors.ra.toolbar.equals":"equals","calc.editors.ra.toolbar.equals-content":"
              &sigma","calc.editors.ra.toolbar.not-equals":"not equals","calc.editors.ra.toolbar.not-equals-content":"
              &sigma","calc.editors.ra.toolbar.greater-or-equals":"greater or equals","calc.editors.ra.toolbar.greater-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.lesser-or-equals":"lesser or equals","calc.editors.ra.toolbar.lesser-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.intersect":"intersect","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"union","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"division","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"subtraction","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\n ( B )
              ","calc.editors.ra.toolbar.cross-join":"cross join","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"assignment","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"single-line comment","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"multi-line comment","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"insert date","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"execute query","calc.editors.sql.button-execute-selection":"execute selection","calc.editors.sql.button-download":"download","calc.editors.sql.toolbar.select":"select clause","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"from clause","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"where clause","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by clause","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"order by clause","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"limit clause","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/es.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nombre de variable duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"header duplicado {{name}}","db.messages.parser.error-group-unknown-header":"header desconocido {{name}}","db.messages.parser.error-group-header-name-missing":"el nombre del grupo no se ha encontrado (group: ....)","db.messages.parser.error-group-header-name-empty":"el nombre del grupo debe ser rellenado","db.messages.parser.error-group-non-unique-attribute":"atributo no único {{name}} en columna {{index}}","db.messages.parser.error-group-non-unique-group-name":"El nombre del grupo no es único.","db.messages.parser.error-sql-string-use-single-quotes":"utiliza comillas simples para cadenas de caracteres","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" no debe ser utilizado como nombre de relacion","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" no debe ser utilizado como nombre de columna","db.messages.parser.error-sql-group-by-missing":"group by no se encuentra","db.messages.parser.error-sql-having-without-group-by":"se ha encontrado pero no se encuentra \\"group by\\" ó agregación","db.messages.parser.error-sql-negative-limit":"el límite dado debe ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de columnas en línea {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido en línea {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de columnas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando derecho de LIKE debe ser una cadena literal","db.messages.exec.error-column-not-unique":"no se pude agregar columna \\"{{column}}\\" por ambiguedad","db.messages.exec.error-column-not-found-name":"no se pude encontrar columna \\"{{column}}\\" en esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; index starts at 1","db.messages.exec.error-column-ambiguous":"columna \\"{{column}}\\" es ambigua en esquema {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice de columna \\"{{column}}\\" está fuera de rango en equema {{schema}}; índice comienza en 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"no se pudo establecer relación alias \\"{{alias}}\\" por ambiguedad","db.messages.exec.error-could-not-rename-ambiguity":"no se pudo establecer nuevo nombre \\"{{newName}}\\" para \\"{{oldName}}\\" por ambiguedad en el equema {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} no es parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"esquemas no son unificables: los tipos son diferentes ó los tamaño son diferentes: {{schemaA}} y {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"columna \\"{{column}}\\" no se puede encontrar en ambos esquemas del join","db.messages.exec.error-condition-must-be-boolean":"condición debe ser una expresión booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} no está definido para {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"Join würde nicht eindeutige Spaltennamen erzeugen","db.messages.exec.error-no-columns-match-alias-star":" las siguientes columnas aparecen en ambas relaciones: {{conflicts}}","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dato para columna {{index}} (\\"{{column}}\\") no está especificado","db.messages.exec.error-invalid-projection-error":"proyección inválida \\"{{argument}}\\": {{error}}","db.messages.exec.error-function-expects-type":"función \\"{{func}}\\" espera argumentos de tipo \\"{{expected}}\\" pero \\"{{given}}\\" fue dado","db.messages.exec.error-could-not-compare-different-types":"no se pudo comparar valor si tipos son diferentes: {{typeA}} != {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos los argumentos sean del mismo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"la condición de un CASE WHEN debe ser de tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END espera todos results ser del mismo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" no es una fecha válido; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"no se pudo encontrar relación \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT fehlt","db.messages.translate.warning-ignored-all-on-set-operators":"TODOS los operadores de cantidad fueron ignorados","db.messages.translate.error-variable-name-conflict":"conflicto de nombre: nombre de relación \\"{{name}}\\" ya existe","db.messages.translate.error-variable-cyclic-usage":"uso de variable cíclico \\"{{name}}\\" detectado","editor.codemirror-placeholder":"tu consulta va aquí ...\\n\\natajos de teclado:\\n\\tejecutar declaración: [CTRL]+[RETURN]\\n\\ttejecutar selección: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Éxito","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Advertencia","editor.alert-message-headers.error":"Error","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"nombreColumna:tipo","editor.inline-relation-editor.enter-your-data":"por favor ingrese los datos","editor.inline-relation-editor.error-column-name-missing":"nombre de columna ausente en columna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"cadena de caracteres no debe contener comillas simples y dobles","editor.error-no-query-found":"no se encontró la consulta","editor.pegjs-error.or":"ó","editor.pegjs-error.no-input-found":"no se encontró la entrada","editor.pegjs-error.end-of-input":"fin de entrada","editor.pegjs-error.expected-found":"Se esperaba {{expected}} pero se encontró {{found}} .","editor.error-at-line-x":"en la línea {{line}}","calc.messages.error-query-missing":"no se encontró la consulta","calc.messages.error-query-missing-assignments-found":"solo se encontraron asignaciones; a la consulta le falta Help - Assignments","calc.messages.gist-load-success":"gist fue cargado con éxito","calc.menu.headline":"cargar un Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"cargar dataset guardado en un gist","calc.menu.load-gist-button":"cargar","calc.menu.load-gist-insert-placeholder":"ID de gist","calc.menu.create-own-dataset-headline":"Crear tu propio Dataset","calc.menu.create-own-dataset-text":"Puedes crear tu propio dataset y compartirlo con otras personas. \\nAprende más acerca de ésto en Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Tutorial de mantenimiento (en)","calc.menu.create-own-dataset-button-new":"crear nuevo Dataset","calc.menu.create-own-dataset-button-modify":"modificar Dataset actual","calc.navigation.take-a-tour":"Haz un recorrido","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ayuda (en)","calc.navigation.calc":"Calculadora","calc.navigation.language":"Lenguaje","calc.maintainer-groups.misc":"Misceláneo","calc.maintainer-groups.temp":"Temporal","calc.maintainer-groups.uibk":"Universidad de Innsbruck","calc.maintainer-groups.karlsruhe":"Universidad de Karlsruhe","calc.maintainer-groups.saarland":"Universidad de Saarland","calc.editors.button-history":"historia","calc.editors.insert-relation-title":"Insertar","calc.editors.insert-relation-tooltip":"Insertar nombres de relaciones o columnas","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"agregar nueva relación","calc.editors.group.toolbar.add-new-relation-content":"abrir editor de relaciones","calc.editors.group.button-download":"descargar","calc.editors.group.button-exec":"vista previa","calc.editors.group.button-use":"utilizar Grupo en editor","calc.editors.group.button-use_plural":"utilizar Grupos en editor","calc.editors.group.sql-import-group-name-placeholder":"Nombre del grupo (importado de SQL)","calc.editors.group.new-group-example-group":"-- éste es un ejemplo\\n\\ngroup: nombreDeNuevoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\tejemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-Dump","calc.editors.group.modal-sqldump.button-close":"Cerrar","calc.editors.group.modal-sqldump.button-cancel":"cancelar","calc.editors.group.modal-sqldump.button-import-sql":"importar SQL","calc.editors.group.modal-sqldump.description":"Ponga su SQL-Dump aquí para crear un grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"ÁlgRel","calc.editors.ra.button-execute-query":"executar consulta","calc.editors.ra.button-execute-selection":"executar selección","calc.editors.ra.button-download":"descargar","calc.editors.ra.toolbar.projection":"proyección","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"selección","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renombrar relación / renombrar columnas","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.right-arrow":"flecha derecha","calc.editors.ra.toolbar.rename-columns-operator":"renombrar operador de columnas","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"ordenar por","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"agrupar por","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"y","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"xor","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"ó","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"no","calc.editors.ra.toolbar.not-content":"
              &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
              &sigma","calc.editors.ra.toolbar.not-equals":"no es igual","calc.editors.ra.toolbar.not-equals-content":"
              &sigma","calc.editors.ra.toolbar.greater-or-equals":"mayor ó igual","calc.editors.ra.toolbar.greater-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ó igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.intersect":"intersecta","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"unión","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"división","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"resta","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\\\ ( B )
              \\n","calc.editors.ra.toolbar.cross-join":"cross join (cruzado)","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"asignación","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"comentario de una línea","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"comentario de múltiples líneas","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"inline-relation","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"inline-relation (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"crear nuevo inline-relation utilizando editor incorporado","calc.editors.ra.toolbar.insert-date":"insertar fecha","calc.editors.ra.toolbar.insert-date-content":"","calc.editors.ra.toolbar.autoreplace-operators.title":"","calc.editors.ra.toolbar.autoreplace-operators.header":"","calc.editors.ra.toolbar.autoreplace-operators.none":"","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"ejecutar consulta","calc.editors.sql.button-execute-selection":"ejecutar selección","calc.editors.sql.button-download":"descargar","calc.editors.sql.toolbar.select":"seleccionar cláusula","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"cláusula from (desde)","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"cláusula where (donde)","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula agrupar por","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"teniendo cláusula","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula ordenar por","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"cláusula límite","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insertar fecha","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Cerrar","calc.editors.ra.inline-editor.title":"Editor de relaciones","calc.editors.ra.inline-editor.button-download-csv":"Descargar CSV","calc.editors.ra.inline-editor.button-upload-csv":"Subir CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nombre","calc.editors.ra.inline-editor.row-type":"Escriba","calc.editors.ra.inline-editor.input-relation-name":"Nombre de la relación","calc.navigation.imprint":"Imprimir"}')},"./src/locales/kr.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"변수 이름 중복: {{name}}","db.messages.parser.error-invalid-date-format":"\\"__str__\\" 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":" 헤더 중복: {{name}}","db.messages.parser.error-group-unknown-header":"알 수 없는 헤더: {{name}}","db.messages.parser.error-group-header-name-missing":"그룹 이름이 없음(group: ....)","db.messages.parser.error-group-header-name-empty":"그룹 이름은 비어있으면 안됨","db.messages.parser.error-group-non-unique-attribute":"__index__ 열에서 고유하지 않은 속성 {{name}}","db.messages.parser.error-group-non-unique-group-name":"duplicate group name: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"문자열에 작은 따음표 사용","db.messages.parser.error-sql-invalid-relation-name":"\\"__str__\\"은 관계 이름으로 사용 할 수 없음","db.messages.parser.error-sql-invalid-column-name":"\\"__str__\\"은 열 이름으로 사용할 수 없음","db.messages.parser.error-sql-group-by-missing":"group by 없음","db.messages.parser.error-sql-having-without-group-by":"\\"group by\\" 또는 집계 없음","db.messages.parser.error-sql-negative-limit":"0 이상이어야 함","db.messages.parser.error-sqldump-invalid-column-number":"__line__ 에서 유효하지 않은 열","db.messages.parser.error-sqldump-invalid-type":"__line__ 에서 유효하지 않은 타입","db.messages.parser.error-sqldump-insert-wrong-number-columns":"값의 숫자 != 열의 숫자","db.messages.parser.error-valueexpr-like-operand-no-string":"LIKE의 오른쪽 피연산자는 문자열 리터럴이어야 함","db.messages.exec.error-column-not-unique":"모호성 때문에 열 \\"__column__\\" 을 추가할 수 없음","db.messages.exec.error-column-not-found-name":"스키마 __schema__ 에서 열 \\"__column__\\" 을 찾을 수 없음","db.messages.exec.error-column-not-found-index":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-column-ambiguous":"열 \\"__column__\\" 는 스키마 __schema__ 에서 모호함","db.messages.exec.error-column-index-out-of-range":"열 인덱스 \\"__column__\\" 는 범위를 벗어남; 인덱스는 1에서 시작","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"모호성 때문에 릴레이션 가명 \\"__alias__\\"을 사용할 수 없음 ","db.messages.exec.error-could-not-rename-ambiguity":"스키마 __schema__ 에서의 모호성 때문에 \\"__oldName__\\"을 위한 새로운 이름 \\"__newName__\\" 을 설정 할 수 없음","db.messages.exec.error-schema-a-not-part-of-schema-b":"스키마 __schemaA__ 는 __schemaB__ 의 부분이 아님","db.messages.exec.error-schemas-not-unifiable":"스키마들은 통합될 수 없음: 타입들은 다르거나 사이즈들이 다르다: __schemaA__ 와 __schemaB__","db.messages.exec.error-column-not-in-both-schemas":"열 \\"__column__\\"은 두 스키마의 조인에서 찾을 수 없음","db.messages.exec.error-condition-must-be-boolean":"조건은 불린 대수여야만 함","db.messages.exec.error-func-not-defined-for-column-type":"__func_ _은 타입 __colType__ 을 위해 정의될 수 없음","db.messages.exec.error-join-would-produce-non-unique-columns":"조인은 고유하지 않은 열 이름에서 결과를 냄 조인은 고유하지 않은 열 이름에서 결과를 냄 이 열들은 두 릴레이션 사이에서 나타남: __conflicts__","db.messages.exec.error-no-columns-match-alias-star":"\\"__alias__.*\\"와 일치하는 열이 없음","db.messages.exec.error-datatype-not-specified-for-col":"열 __index__의 데이터 타입 (\\"__column__\\")이 구체화되지 않음","db.messages.exec.error-invalid-projection-error":"유효하지 않은 프로젝션 \\"__argument__\\": __error__","db.messages.exec.error-function-expects-type":"함수 \\"__func__\\"는 인자 타입 \\"__expected__\\" 으로 기대하지만 \\"__given__\\" 이 주어짐","db.messages.exec.error-could-not-compare-different-types":"타입이 다르면 비교할 수 없음: __typeA__ != __typeB__","db.messages.exec.error-function-expects-arguments-of-same-type":"__func__ 는 모든 인자가 같은 타입으로 기대함","db.messages.exec.error-case-when-condition-must-be-boolean":"CASE WHEN 조건은 불린 타입이어야 함","db.messages.exec.error-case-when-expects-results-of-same-type":"CASE WHEN condition THEN result END는 모든 결과가 같은 타입으로 기대함","db.messages.exec.error-invalid-date-format":"\\"__str__\\" 는 유효하지 않은 날짜; 형식: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"릴레이션 \\"{{name}}\\"을 찾을 수 없음","db.messages.translate.warning-distinct-missing":"DISTINCT 없음","db.messages.translate.warning-ignored-all-on-set-operators":"집합 연산에서 무시된 ALL","db.messages.translate.error-variable-name-conflict":"이름 충돌: 릴레이션 이름 \\"{{name}}\\" 은 이미 존재함","db.messages.translate.error-variable-cyclic-usage":"변수 \\"{{name}}\\"의 순환 사용이 감지됨","editor.codemirror-placeholder":"쿼리는 이곳에 표시된다 ...\\n\\n키보드 단축키:\\n\\tstatement 실행: [CTRL]+[RETURN]\\n\\tselection 실행: [CTRL]+[SHIFT]+[RETURN]\\n\\t자동 완성: [CTRL]+[SPACE]","editor.alert-message-headers.success":"성공","editor.alert-message-headers.info":"정보","editor.alert-message-headers.warning":"경고","editor.alert-message-headers.error":" 에러 ","editor.inline-relation-editor.button-ok":"ok","editor.inline-relation-editor.button-cancel":"취소","editor.inline-relation-editor.placeholder-column-name-and-types":"열 이름:타입","editor.inline-relation-editor.enter-your-data":"데이터를 입력하라","editor.inline-relation-editor.error-column-name-missing":"열 이름이 열 __index__에 없다","editor.inline-relation-editor.error-wrong-quoted-string":"문자열은 작은따음표와 큰따음표를 포함할 수 없다.","editor.error-no-query-found":"쿼리를 찾을 수 없다","editor.pegjs-error.or":"또는","editor.pegjs-error.no-input-found":"입력을 찾을 수 없음","editor.pegjs-error.end-of-input":"입력의 끝","editor.pegjs-error.expected-found":"예상 된 __expected__이지만 __found__이 발견됨.","editor.error-at-line-x":"__line__ 줄에서","calc.messages.error-query-missing":"쿼리를 찾을 수 없음","calc.messages.error-query-missing-assignments-found":"쿼리를 찾을 수 없음 Help - Assignments","calc.messages.gist-load-success":"gist 불러오기 완료","calc.menu.headline":"데이터셋 불러오기","calc.menu.datasets":"데이터셋 불러오기","calc.menu.load-gist-headline":"gist에 저장된 데이터셋 불러오기","calc.menu.load-gist-button":"불러오기","calc.menu.load-gist-insert-placeholder":"gist 아이디","calc.menu.create-own-dataset-headline":"데이터셋 생성하기","calc.menu.create-own-dataset-text":"You can create your own dataset and share it with others. Learn more about it in the Maintainer Tutorial","calc.menu.create-own-dataset-text-link":"Maintainer Tutorial","calc.menu.create-own-dataset-button-new":"새로운 데이터셋 생성","calc.menu.create-own-dataset-button-modify":"현재 데이터셋 수정","calc.navigation.take-a-tour":"둘러보기","calc.navigation.feedback":"피드백","calc.navigation.help":"도움말","calc.navigation.calc":"Calculate","calc.navigation.language":"언어","calc.maintainer-groups.misc":"다른 종류","calc.maintainer-groups.temp":"임시","calc.maintainer-groups.uibk":"Innsbruck 대학교","calc.maintainer-groups.karlsruhe":"Karlsruhe 대학교","calc.maintainer-groups.saarland":"Saarland 대학교","calc.editors.button-history":"기록","calc.editors.insert-relation-title":"Insert","calc.editors.insert-relation-tooltip":"Insert relation or column names","calc.editors.group.tab-name":"그룹 에디터","calc.editors.group.tab-name-short":"그룹 에디터","calc.editors.group.toolbar.import-sql":"SQL-덤프 가져오기","calc.editors.group.toolbar.import-sql-content":"SQL-컨텐트 가져오기","calc.editors.group.toolbar.add-new-relation":"새로운 릴레이션 추가","calc.editors.group.toolbar.add-new-relation-content":"릴레이션 에디터 열기","calc.editors.group.button-download":"다운로드","calc.editors.group.button-exec":"preview","calc.editors.group.button-use":"에디터에서 그룹 사용하기","calc.editors.group.button-use_plural":"에디터에서 여러 그룹 사용하기","calc.editors.group.sql-import-group-name-placeholder":"그룹 이름(SQL로부터 불러옴)","calc.editors.group.new-group-example-group":"-- 예시입니다\\n\\n그룹: nameOfTheNewGroup \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texample, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"SQL-Dump 가져오기","calc.editors.group.modal-sqldump.button-close":"닫기","calc.editors.group.modal-sqldump.button-cancel":"취소","calc.editors.group.modal-sqldump.button-import-sql":"SQL 가져오기","calc.editors.group.modal-sqldump.description":"그룹을 생성하려면 SQL-Dump 이곳에 가져와라","calc.editors.ra.tab-name":"관계 대수","calc.editors.ra.tab-name-short":"관계 대수","calc.editors.ra.button-execute-query":"쿼리 실행","calc.editors.ra.button-execute-selection":"셀렉션 실행","calc.editors.ra.button-download":"다운로드","calc.editors.ra.toolbar.projection":"프로젝션","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"셀렉션","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"릴레이션 이름 변경 / 열 이름 변경","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.right-arrow":"오른쪽 화살표","calc.editors.ra.toolbar.rename-columns-operator":"열 연산자 변경","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"정렬","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"그룹화","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"논리곱","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"배타적 논리","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"논리합","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"논리적 부정","calc.editors.ra.toolbar.not-content":" ¬(a < b) ( A )
              ","calc.editors.ra.toolbar.equals":"등호","calc.editors.ra.toolbar.equals-content":" a = b ( A )
              ","calc.editors.ra.toolbar.not-equals":"부등호","calc.editors.ra.toolbar.not-equals-content":" a \'text\' ( A )
              ","calc.editors.ra.toolbar.greater-or-equals":"크거나 같다","calc.editors.ra.toolbar.greater-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.lesser-or-equals":"작거나 같다","calc.editors.ra.toolbar.lesser-or-equals-content":" a 42 ( A )
              ","calc.editors.ra.toolbar.intersect":"교집합","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"합집합","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"디비전","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"차집합","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\\\ ( B )
              \\n","calc.editors.ra.toolbar.cross-join":"카디션 프로덕트","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"자연 조인 / θ-조인","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"왼쪽 외부 조인","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.right-outer-join":"오른쪽 외부 조인","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              ","calc.editors.ra.toolbar.full-outer-join":"완전 외부 조인","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"왼쪽 세미 조인","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"오른쪽 세미 조인","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"안티 조인","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"할당","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"한 줄 주석","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- useful comment","calc.editors.ra.toolbar.multi-line-comment":"여러 줄 주석","calc.editors.ra.toolbar.multi-line-comment-content":"/* this is a very,
              very long comment */

              π a, b A","calc.editors.ra.toolbar.inline-relation":"인라인-릴레이션","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"인라인-릴레이션 (에디터)","calc.editors.ra.toolbar.inline-relation-editor-content":"create a new inline-relation using a built in editor","calc.editors.ra.toolbar.insert-date":"날짜 삽입","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"operator replacement","calc.editors.ra.toolbar.autoreplace-operators.header":"automatically replace operators","calc.editors.ra.toolbar.autoreplace-operators.none":"no replacement","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"쿼리 실행","calc.editors.sql.button-execute-selection":"셀렉션 실행","calc.editors.sql.button-download":"다운로드","calc.editors.sql.toolbar.select":"select 문","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"from 문","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"where 문","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"group by 문","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"having 문","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"order by 문","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"limit 문","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"insert date","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Result","calc.result.modal.close":"Close","calc.editors.ra.inline-editor.title":"Relation Editor","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancel","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Name","calc.editors.ra.inline-editor.row-type":"Type","calc.editors.ra.inline-editor.input-relation-name":"Relation Name","calc.navigation.imprint":"Imprint"}')},"./src/locales/pt.json":function(e){e.exports=JSON.parse('{"db.messages.parser.error-duplicate-variable":"nome de variável duplicado: {{name}}","db.messages.parser.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.parser.error-group-duplicate-header":"cabeçalho duplicado {{name}}","db.messages.parser.error-group-unknown-header":"cabeçalho desconhecido {{name}}","db.messages.parser.error-group-header-name-missing":"o nome do grupo está faltando (group: ....)","db.messages.parser.error-group-header-name-empty":"o nome do grupo não pode ser vazio","db.messages.parser.error-group-non-unique-attribute":"atributo não único {{name}} na coluna {{index}}","db.messages.parser.error-group-non-unique-group-name":"nome de grupo duplicado: {{name}}","db.messages.parser.error-sql-string-use-single-quotes":"use aspas simples para strings (caracteres/texto)","db.messages.parser.error-sql-invalid-relation-name":"\\"{{str}}\\" não pode ser usado como nome de relação","db.messages.parser.error-sql-invalid-column-name":"\\"{{str}}\\" não pode ser usado como nome de coluna","db.messages.parser.error-sql-group-by-missing":"group by está faltando","db.messages.parser.error-sql-having-without-group-by":"“having” encontrado, mas sem \\"group by\\" ou agregação","db.messages.parser.error-sql-negative-limit":"o limite dado precisa ser >= 0","db.messages.parser.error-sqldump-invalid-column-number":"número inválido de colunas na linha {{line}}","db.messages.parser.error-sqldump-invalid-type":"tipo inválido na linha {{line}}","db.messages.parser.error-sqldump-insert-wrong-number-columns":"número de valores != número de colunas","db.messages.parser.error-valueexpr-like-operand-no-string":"operando direito de LIKE deve ser uma string literal","db.messages.exec.error-column-not-unique":"não foi possível adicionar a coluna \\"{{column}}\\" devido a ambiguidade","db.messages.exec.error-column-not-found-name":"não foi possível encontrar a coluna \\"{{column}}\\" no esquema {{schema}}","db.messages.exec.error-column-not-found-index":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-column-ambiguous":"coluna\\"{{column}}\\" é ambígua em {{schema}}","db.messages.exec.error-column-index-out-of-range":"índice da coluna \\"{{column}}\\" está fora do intervalo no esquema {{schema}}; índice começa em 1","db.messages.exec.error-could-not-change-rel-alias-ambiguity":"não foi possível definir o ”alias” da relação “{{alias}}” por causa da ambiguidade","db.messages.exec.error-could-not-rename-ambiguity":"não foi possível definir o novo nome \\"{{newName}}\\" para \\"{{oldName}}\\" devido a ambiguidade em {{schema}}","db.messages.exec.error-schema-a-not-part-of-schema-b":"esquema {{schemaA}} não é parte de {{schemaB}}","db.messages.exec.error-schemas-not-unifiable":"os esquemas não são unificáveis: os tipos ou o tamanho diferem: {{schemaA}} e {{schemaB}}","db.messages.exec.error-column-not-in-both-schemas":"coluna \\"{{column}}\\" não pode ser encontrada em ambos os esquemas de junção","db.messages.exec.error-condition-must-be-boolean":"condição deve ser uma expressão booleana","db.messages.exec.error-func-not-defined-for-column-type":"{{func}} não definida para o tipo {{colType}}","db.messages.exec.error-join-would-produce-non-unique-columns":"a junção resultaria em nomes de coluna não únicos {{conflicts}}","db.messages.exec.error-no-columns-match-alias-star":"nenhuma coluna corresponde a \\"{{alias}}.*\\"","db.messages.exec.error-datatype-not-specified-for-col":"tipo de dados para a coluna {{index}} (\\"{{column}}\\") não foi especificado","db.messages.exec.error-invalid-projection-error":"projeção inválida \\"{{argument}}\\": {{erro}}","db.messages.exec.error-function-expects-type":"a função \\"{{func}}\\" espera argumentos do tipo \\"{{expected}}\\" mas \\"{{given}}\\" foi dado","db.messages.exec.error-could-not-compare-different-types":"não foi possível comparar o valor se os tipos forem diferentes: {{typeA}}! = {{typeB}}","db.messages.exec.error-function-expects-arguments-of-same-type":"{{func}} espera que todos os argumentos sejam do mesmo tipo","db.messages.exec.error-case-when-condition-must-be-boolean":"a condição de um CASE WHEN deve ser do tipo booleano","db.messages.exec.error-case-when-expects-results-of-same-type":" CASE WHEN condição THEN resultado END espera que todos os resultados sejam do mesmo tipo","db.messages.exec.error-invalid-date-format":"\\"{{str}}\\" não é uma data válida; formato esperado: YYYY-MM-DD","db.messages.translate.error-relation-not-found":"não foi possível encontrar relação \\"{{name}}\\"","db.messages.translate.warning-distinct-missing":"DISTINCT está faltando","db.messages.translate.warning-ignored-all-on-set-operators":"ignorou ALL na operação definida","db.messages.translate.error-variable-name-conflict":"conflito de nomes: o nome da relação \\"{{name}}\\" já existe","db.messages.translate.error-variable-cyclic-usage":"uso cíclico da variável \\"{{name}}\\" detectado","editor.codemirror-placeholder":"Digite sua consulta aqui\\n\\nAtalhos do teclado:\\n\\texecutar declaraçãot: [CTRL]+[RETURN]\\n\\texecutar seleção: [CTRL]+[SHIFT]+[RETURN]\\n\\tautocompletar: [CTRL]+[SPACE]\\n","editor.alert-message-headers.success":"Sucesso","editor.alert-message-headers.info":"Info","editor.alert-message-headers.warning":"Perigo","editor.alert-message-headers.error":"Erro","editor.inline-relation-editor.button-ok":"Ok","editor.inline-relation-editor.button-cancel":"Cancelar","editor.inline-relation-editor.placeholder-column-name-and-types":"columnName:type","editor.inline-relation-editor.enter-your-data":"por favor, insira seus dados","editor.inline-relation-editor.error-column-name-missing":"nome da coluna ausente na coluna {{index}}","editor.inline-relation-editor.error-wrong-quoted-string":"string não deve conter aspas simples e duplas","editor.error-no-query-found":"nenhuma consulta encontrada","editor.pegjs-error.or":"ou","editor.pegjs-error.no-input-found":"nenhuma entrada encontrada","editor.pegjs-error.end-of-input":"fim da entrada","editor.pegjs-error.expected-found":"esperado {{expected}}, mas {{found}} encontrado.","editor.error-at-line-x":"na linha {{line}}","calc.messages.error-query-missing":"nenhuma consulta encontrada","calc.messages.error-query-missing-assignments-found":"apenas atribuições encontradas; falta a consulta Ajuda - Tarefas ","calc.messages.gist-load-success":"gist carregado com sucesso","calc.menu.headline":"Carregue um Dataset","calc.menu.datasets":"Datasets","calc.menu.load-gist-headline":"Carregar Dataset armazenado em um gist","calc.menu.load-gist-button":"Carregar","calc.menu.load-gist-insert-placeholder":"gist ID","calc.menu.create-own-dataset-headline":"Crie seu próprio Dataset","calc.menu.create-own-dataset-text":"Você pode criar seu próprio conjunto de dados e compartilhá-lo com outras pessoas. Saiba mais sobre isso no ","calc.menu.create-own-dataset-text-link":"Tutorial de manutenção","calc.menu.create-own-dataset-button-new":"Criar novo Dataset","calc.menu.create-own-dataset-button-modify":"Modificar Dataset","calc.navigation.take-a-tour":"Faça um Tour","calc.navigation.feedback":"Feedback","calc.navigation.help":"Ajuda","calc.navigation.calc":"Calcular","calc.navigation.language":"Linguagem","calc.maintainer-groups.misc":"Diversos","calc.maintainer-groups.temp":"Temporário","calc.maintainer-groups.uibk":"University of Innsbruck","calc.maintainer-groups.karlsruhe":"Universidade de Karlsruhe","calc.maintainer-groups.saarland":"University of Saarland","calc.editors.button-history":"Histórico","calc.editors.insert-relation-title":"Inserir","calc.editors.insert-relation-tooltip":"Inserir relação ou nomes de coluna","calc.editors.group.tab-name":"Editor de Grupo","calc.editors.group.tab-name-short":"EG","calc.editors.group.toolbar.import-sql":"Importar SQL-dump","calc.editors.group.toolbar.import-sql-content":"Importar SQL-dump","calc.editors.group.toolbar.add-new-relation":"+ nova relação","calc.editors.group.toolbar.add-new-relation-content":"Abrir editor de relações","calc.editors.group.button-download":"Download","calc.editors.group.button-exec":"Visualizar","calc.editors.group.button-use":"Use Grupo no Editor","calc.editors.group.button-use_plural":"Use o primeiro Grupo no Editor","calc.editors.group.sql-import-group-name-placeholder":"Nome do grupo (importado de SQL)","calc.editors.group.new-group-example-group":"– este é um exemplo\\n\\ngroup: nomeDoNovoGrupo \\n\\n\\nA = {\\n\\ta:string, b:number\\n\\texemplo, 42\\n}","calc.editors.group.modal-sqldump.modal-title":"Importar SQL-dump","calc.editors.group.modal-sqldump.button-close":"Fechar","calc.editors.group.modal-sqldump.button-cancel":"Cancelar","calc.editors.group.modal-sqldump.button-import-sql":"Importar SQL","calc.editors.group.modal-sqldump.description":"Coloque seu SQL-Dump aqui para criar um grupo.","calc.editors.ra.tab-name":"Álgebra Relacional","calc.editors.ra.tab-name-short":"AlgRel","calc.editors.ra.button-execute-query":"Executar consulta","calc.editors.ra.button-execute-selection":"Executar seleção","calc.editors.ra.button-download":"Download","calc.editors.ra.toolbar.projection":"Projeção","calc.editors.ra.toolbar.projection-content":"π a, b ( A )\\n
              pi a, b A","calc.editors.ra.toolbar.selection":"Seleção","calc.editors.ra.toolbar.selection-content":"σ a < b ∧ b c ( A )\\n
              sigma a < b and b != c A","calc.editors.ra.toolbar.rename":"renomear relação / renomear colunas","calc.editors.ra.toolbar.rename-content":"
              σ x.a > 1 ( ρ x ( A ) )
              \\n
              σ A.y > 2 ( rho ya ( A ) )
              ","calc.editors.ra.toolbar.right-arrow":"flecha derecha","calc.editors.ra.toolbar.rename-columns-operator":"operador renomear colunas","calc.editors.ra.toolbar.rename-columns-operator-content":"
              σ A.y > 2 ( ρ ya ( A ) )
              ","calc.editors.ra.toolbar.orderBy":"ordenar (order by)","calc.editors.ra.toolbar.orderBy-content":"
              τ a asc, [2] desc ( A )
              tau a asc, [2] desc ( A )
              ","calc.editors.ra.toolbar.groupBy":"agrupar (group by)","calc.editors.ra.toolbar.groupBy-content":"
              γ a, b; count(c)→c ( A )
              \\n
              gamma count(a)->x, sum(b)->y ( A )
              ","calc.editors.ra.toolbar.and":"e","calc.editors.ra.toolbar.and-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.xor":"ou exclusivo (xor)","calc.editors.ra.toolbar.xor-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.or":"ou","calc.editors.ra.toolbar.or-content":"
              σ a < b b c ( A )
              ","calc.editors.ra.toolbar.not":"não","calc.editors.ra.toolbar.not-content":"
              &sigma","calc.editors.ra.toolbar.equals":"igual","calc.editors.ra.toolbar.equals-content":"
              &sigma","calc.editors.ra.toolbar.not-equals":"não igual","calc.editors.ra.toolbar.not-equals-content":"
              &sigma","calc.editors.ra.toolbar.greater-or-equals":"maior ou igual","calc.editors.ra.toolbar.greater-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.lesser-or-equals":"menor ou igual","calc.editors.ra.toolbar.lesser-or-equals-content":"
              &sigma","calc.editors.ra.toolbar.intersect":"intersecção","calc.editors.ra.toolbar.intersect-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.union":"união","calc.editors.ra.toolbar.union-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.division":"divisão","calc.editors.ra.toolbar.division-content":"
              ( A ) ÷ ( B )
              ","calc.editors.ra.toolbar.subtraction":"subtração","calc.editors.ra.toolbar.subtraction-content":"
              ( A ) - ( B )
              \\n
              ( A ) \\n ( B )
              ","calc.editors.ra.toolbar.cross-join":"junção cruzada (cross join)","calc.editors.ra.toolbar.cross-join-content":"
              ( A ) ( B )
              ","calc.editors.ra.toolbar.natural-join":"natural join / θ-join","calc.editors.ra.toolbar.natural-join-content":"
              ( A ) ( B )
              \\n
              ( A ) ⋈ A.a ≥ B.a ( B )
              ","calc.editors.ra.toolbar.left-outer-join":"left outer join","calc.editors.ra.toolbar.left-outer-join-content":"
              ( A ) ⟕ ( B )
              \\n
              ( A ) ⟕ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.right-outer-join":"right outer join","calc.editors.ra.toolbar.right-outer-join-content":"
              ( A ) ⟖ ( B )
              \\n
              ( A ) ⟖ A.a < B.a ( B )
              \\n","calc.editors.ra.toolbar.full-outer-join":"full outer join","calc.editors.ra.toolbar.full-outer-join-content":"
              ( A ) ⟗ ( B )
              \\n
              ( A ) ⟗ A.a != B.a ( B )
              ","calc.editors.ra.toolbar.left-semi-join":"left semi join","calc.editors.ra.toolbar.left-semi-join-content":"
              ( A ) ⋉ ( B )
              ","calc.editors.ra.toolbar.right-semi-join":"right semi join","calc.editors.ra.toolbar.right-semi-join-content":"
              ( A ) ⋊ ( B )
              ","calc.editors.ra.toolbar.anti-join":"anti join","calc.editors.ra.toolbar.anti-join-content":"
              ( A ) ▷ ( B )
              ","calc.editors.ra.toolbar.assignment":"atribuição","calc.editors.ra.toolbar.assignment-content":"
              X = pi a ( A )\\n
              Y = pi b ( b )\\n
              ( X ) ( Y )
              ","calc.editors.ra.toolbar.single-line-comment":"comentário em linha","calc.editors.ra.toolbar.single-line-comment-content":"π a, b A -- comentário útil","calc.editors.ra.toolbar.multi-line-comment":"comentário multilinha","calc.editors.ra.toolbar.multi-line-comment-content":"/* este é um comentário longo,
              muito longo*/

              π a, b A","calc.editors.ra.toolbar.inline-relation":"relação aninhada","calc.editors.ra.toolbar.inline-relation-content":"σ a = \'test\' ({
              a:string, b:number, X.c:date
              a, 1, 1970-01-01
              }
              )","calc.editors.ra.toolbar.inline-relation-editor":"relação aninhada (editor)","calc.editors.ra.toolbar.inline-relation-editor-content":"criar uma nova relação aninhada usando o editor","calc.editors.ra.toolbar.insert-date":"inserir data","calc.editors.ra.toolbar.insert-date-content":"σ a < date(\'1970-01-01\') ( A )","calc.editors.ra.toolbar.autoreplace-operators.title":"substituição de operador","calc.editors.ra.toolbar.autoreplace-operators.header":"substituir operadores automaticamente","calc.editors.ra.toolbar.autoreplace-operators.none":"sem substituição","calc.editors.ra.toolbar.autoreplace-operators.plain2math":"pi => π","calc.editors.ra.toolbar.autoreplace-operators.math2plain":"π => pi","calc.editors.sql.tab-name":"SQL","calc.editors.sql.tab-name-short":"SQL","calc.editors.sql.button-execute-query":"Executar consulta","calc.editors.sql.button-execute-selection":"Executar seleção","calc.editors.sql.button-download":"Download","calc.editors.sql.toolbar.select":"cláusula select","calc.editors.sql.toolbar.select-content":"

              SELECT * FROM A

              SELECT a, A.b, A.c FROM A
              ","calc.editors.sql.toolbar.from":"cláusula from","calc.editors.sql.toolbar.from-content":"
              SELECT *
              FROM A, B as b
              INNER JOIN C NATURAL
              ","calc.editors.sql.toolbar.where":"cláusula where","calc.editors.sql.toolbar.where-content":"SELECT * FROM A, B
              where A.a = B.a or false","calc.editors.sql.toolbar.group-by":"cláusula group by","calc.editors.sql.toolbar.group-by-content":"SELECT a, COUNT(b) as num
              FROM A
              GROUP BY a","calc.editors.sql.toolbar.having":"cáusula having clause","calc.editors.sql.toolbar.having-content":"SELECT a, SUM(b) as sum
              FROM A
              GROUP BY a
              having sum > 10","calc.editors.sql.toolbar.order-by":"cláusula order by","calc.editors.sql.toolbar.order-by-content":"

              SELECT * FROM A ORDER BY a asc, b desc

              SELECT * FROM A ORDER BY 1, 2, 3
              ","calc.editors.sql.toolbar.limit":"cláusula limit","calc.editors.sql.toolbar.limit-content":"SELECT * FROM A
              LIMIT 10 OFFSET 0","calc.editors.sql.toolbar.insert-date":"inserir data","calc.editors.sql.toolbar.insert-date-content":"select * from A\\nwhere a < date(\\"1970-01-01\\")","calc.result.modal.title":"Resultado","calc.result.modal.close":"Fechar","calc.editors.ra.inline-editor.title":"Editor de Relação","calc.editors.ra.inline-editor.button-download-csv":"Download CSV","calc.editors.ra.inline-editor.button-upload-csv":"Upload CSV","calc.editors.ra.inline-editor.button-cancel":"Cancelar","calc.editors.ra.inline-editor.button-ok":"Ok","calc.editors.ra.inline-editor.row-name":"Nome","calc.editors.ra.inline-editor.row-type":"Tipo","calc.editors.ra.inline-editor.input-relation-name":"Nome da Relação","calc.navigation.imprint":"Impressão"}')},0:function(e,t,n){e.exports=n("./src/calc2/calculator.entry.tsx")}}); \ No newline at end of file diff --git a/js/calc.e900012b8e502c240f6c.bundle.js.gz b/js/calc.5f5c7fd49bb7b3aea41e.bundle.js.gz similarity index 84% rename from js/calc.e900012b8e502c240f6c.bundle.js.gz rename to js/calc.5f5c7fd49bb7b3aea41e.bundle.js.gz index 692140479..dd13f5c29 100644 Binary files a/js/calc.e900012b8e502c240f6c.bundle.js.gz and b/js/calc.5f5c7fd49bb7b3aea41e.bundle.js.gz differ diff --git a/js/tests.e900012b8e502c240f6c.bundle.js b/js/tests.5f5c7fd49bb7b3aea41e.bundle.js similarity index 84% rename from js/tests.e900012b8e502c240f6c.bundle.js rename to js/tests.5f5c7fd49bb7b3aea41e.bundle.js index bf8f4bacb..a705668d2 100644 --- a/js/tests.e900012b8e502c240f6c.bundle.js +++ b/js/tests.5f5c7fd49bb7b3aea41e.bundle.js @@ -1,4 +1,4 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/relax/",n(n.s=1)}({"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/cookie.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t,n,r){var o=void 0;if(n){var s=new Date;s.setTime(s.getTime()+60*n*1e3),o="; expires="+s.toGMTString()}else o="";r=r?"domain="+r+";":"",document.cookie=e+"="+t+o+";"+r+"path=/"},o=function(e){for(var t=e+"=",n=document.cookie.split(";"),r=0;r0?t:void 0}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/path.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"path",lookup:function(e){var t=void 0;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/querystring.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"querystring",lookup:function(e){var t=void 0;if("undefined"!=typeof window)for(var n=window.location.search.substring(1).split("&"),r=0;r0)n[r].substring(0,o)===e.lookupQuerystring&&(t=n[r].substring(o+1))}return t}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/subdomain.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"subdomain",lookup:function(e){var t=void 0;if("undefined"!=typeof window){var n=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);n instanceof Array&&(t="number"==typeof e.lookupFromSubdomainIndex?n[e.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n[0].replace("http://","").replace("https://","").replace(".",""))}return t}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/index.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};h(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return r(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=o.defaults(t,this.options||{},{order:["querystring","cookie","localStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(s.default),this.addDetector(a.default),this.addDetector(i.default),this.addDetector(u.default),this.addDetector(l.default),this.addDetector(c.default),this.addDetector(d.default)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}}));var r=void 0;if(n.forEach((function(e){if(!r){var n=t.services.languageUtils.formatLanguageCode(e);t.services.languageUtils.isWhitelisted(n)&&(r=n)}})),!r){var o=this.i18nOptions.fallbackLng;"string"==typeof o&&(o=[o]),o||(o=[]),r="[object Array]"===Object.prototype.toString.apply(o)?o[0]:o[0]||o.default&&o.default[0]}return r}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();p.type="languageDetector",t.default=p},"./node_modules/i18next-browser-languagedetector/dist/commonjs/utils.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=function(e){return o.call(s.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e},t.extend=function(e){return o.call(s.call(arguments,1),(function(t){if(t)for(var n in t)e[n]=t[n]})),e};var r=[],o=r.forEach,s=r.slice},"./node_modules/i18next-browser-languagedetector/index.js":function(e,t,n){e.exports=n("./node_modules/i18next-browser-languagedetector/dist/commonjs/index.js").default},"./node_modules/i18next/dist/es/index.js":function(e,t,n){"use strict";n.d(t,"a",(function(){return Z})),n.d(t,"b",(function(){return ee}));var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.init(t,n)}return e.prototype.init=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||s,this.options=t,this.debug=t.debug},e.prototype.setDebug=function(e){this.debug=e},e.prototype.log=function(){for(var e=arguments.length,t=Array(e),n=0;n-1&&n.observers[e].splice(r,1)}else delete n.observers[e]}))},e.prototype.emit=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var s="string"!=typeof t?[].concat(t):t.split(".");s.length>1;){if(o())return{};var a=r(s.shift());!e[a]&&n&&(e[a]=new n),e=e[a]}return o()?{}:{obj:e,k:r(s.shift())}}function d(e,t,n){var r=c(e,t,Object);r.obj[r.k]=n}function f(e,t){var n=c(e,t),r=n.obj,o=n.k;if(r)return r[o]}function h(e,t,n){for(var r in t)r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):h(e[r],t[r],n):e[r]=t[r];return e}function p(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function g(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return m[e]})):e}var b=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};v(this,t);var o=y(this,e.call(this));return o.data=n||{},o.options=r,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o}return w(t,e),t.prototype.addNamespaces=function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)},t.prototype.removeNamespaces=function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)},t.prototype.getResource=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=[e,t];return n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(s=e.split(".")),f(this.data,s)},t.prototype.addResource=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[e,t];n&&(a=a.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),d(this.data,a,r),o.silent||this.emit("added",e,t,n,r)},t.prototype.addResources=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"==typeof n[o]&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)},t.prototype.addResourceBundle=function(e,t,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var i=f(this.data,a)||{};r?h(i,n,o):i=b({},i,n),d(this.data,a,i),s.silent||this.emit("added",e,t,n)},t.prototype.removeResourceBundle=function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)},t.prototype.hasResourceBundle=function(e,t){return void 0!==this.getResource(e,t)},t.prototype.getResourceBundle=function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?b({},this.getResource(e,t)):this.getResource(e,t)},t.prototype.getDataByLanguage=function(e){return this.data[e]},t.prototype.toJSON=function(){return this.data},t}(i),_={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var s=this;return e.forEach((function(e){s.processors[e]&&(t=s.processors[e].process(t,n,r,o))})),t}},A=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};R(this,t);var o=S(this,e.call(this));return l(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"],n,o),o.options=r,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o.logger=a.create("translator"),o}return E(t,e),t.prototype.changeLanguage=function(e){e&&(this.language=e)},t.prototype.exists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res},t.prototype.extractFromKey=function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),e=s.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}},t.prototype.translate=function(e,t){var n=this;if("object"!==(void 0===t?"undefined":C(t))&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e||""===e)return"";"number"==typeof e&&(e=String(e)),"string"==typeof e&&(e=[e]);var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],t),s=o.key,a=o.namespaces,i=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){var c=t.nsSeparator||this.options.nsSeparator;return i+c+s}return s}var d=this.resolve(e,t),f=d&&d.res,h=d&&d.usedKey||s,p=Object.prototype.toString.apply(f),m=["[object Number]","[object Function]","[object RegExp]"],g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(b&&f&&v&&m.indexOf(p)<0&&(!g||"[object Array]"!==p)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,t):"key '"+s+" ("+this.language+")' returned an object instead of string.";if(r){var y="[object Array]"===p?[]:{};for(var w in f)if(Object.prototype.hasOwnProperty.call(f,w)){var x=""+h+r+w;y[w]=this.translate(x,A({},t,{joinArrays:!1,ns:a})),y[w]===x&&(y[w]=f[w])}f=y}}else if(b&&g&&"[object Array]"===p)(f=f.join(g))&&(f=this.extendTranslation(f,e,t));else{var _=!1,R=!1;if(!this.isValidLookup(f)&&void 0!==t.defaultValue){if(_=!0,void 0!==t.count){var S=this.pluralResolver.getSuffix(u,t.count);f=t["defaultValue"+S]}f||(f=t.defaultValue)}this.isValidLookup(f)||(R=!0,f=s);var E=t.defaultValue&&t.defaultValue!==f&&this.options.updateMissing;if(R||_||E){this.logger.log(E?"updateKey":"missingKey",u,i,s,E?t.defaultValue:f);var k=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&j&&j[0])for(var T=0;T1&&void 0!==arguments[1]?arguments[1]:{},r=void 0,o=void 0,s=void 0,a=void 0;return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!t.isValidLookup(r)){var i=t.extractFromKey(e,n),u=i.key;o=u;var l=i.namespaces;t.options.fallbackNS&&(l=l.concat(t.options.fallbackNS));var c=void 0!==n.count&&"string"!=typeof n.count,d=void 0!==n.context&&"string"==typeof n.context&&""!==n.context,f=n.lngs?n.lngs:t.languageUtils.toResolveHierarchy(n.lng||t.language,n.fallbackLng);l.forEach((function(e){t.isValidLookup(r)||(a=e,f.forEach((function(o){if(!t.isValidLookup(r)){s=o;var a=u,i=[a];if(t.i18nFormat&&t.i18nFormat.addLookupKeys)t.i18nFormat.addLookupKeys(i,u,o,e,n);else{var l=void 0;c&&(l=t.pluralResolver.getSuffix(o,n.count)),c&&d&&i.push(a+l),d&&i.push(a+=""+t.options.contextSeparator+n.context),c&&i.push(a+=l)}for(var f=void 0;f=i.pop();)t.isValidLookup(r)||(r=t.getResource(o,e,f,n))}})))}))}})),{res:r,usedKey:o,usedLng:s,usedNS:a}},t.prototype.isValidLookup=function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)},t.prototype.getResource=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)},t}(i);function j(e){return e.charAt(0).toUpperCase()+e.slice(1)}var T=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=a.create("languageUtils")}return e.prototype.getScriptPartFromCode=function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))},e.prototype.getLanguagePartFromCode=function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])},e.prototype.formatLanguageCode=function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=j(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=j(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=j(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e},e.prototype.isWhitelisted=function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1},e.prototype.getFallbackCodes=function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]},e.prototype.toResolveHierarchy=function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],s=function(e){e&&(n.isWhitelisted(e)?o.push(e):n.logger.warn("rejecting non-whitelisted language code: "+e))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&s(n.formatLanguageCode(e))})),o},e}();function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var P=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","he","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21}],L={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};function O(){var e={};return P.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:L[t.fc]}}))})),e}var I=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};q(this,e),this.languageUtils=t,this.options=n,this.logger=a.create("pluralResolver"),this.rules=O()}return e.prototype.addRule=function(e,t){this.rules[e]=t},e.prototype.getRule=function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]},e.prototype.needsPlural=function(e){var t=this.getRule(e);return t&&t.numbers.length>1},e.prototype.getPluralFormsOfKey=function(e,t){var n=this,r=[],o=this.getRule(e);return o?(o.numbers.forEach((function(o){var s=n.getSuffix(e,o);r.push(""+t+s)})),r):r},e.prototype.getSuffix=function(e,t){var n=this,r=this.getRule(e);if(r){var o=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),s=r.numbers[o];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===s?s="plural":1===s&&(s=""));var a=function(){return n.options.prepend&&s.toString()?n.options.prepend+s.toString():s.toString()};return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?"_plural_"+s.toString():a():"v2"===this.options.compatibilityJSON&&2===r.numbers.length&&1===r.numbers[0]||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: "+e),""},e}(),N=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};D(this,e),this.logger=a.create("interpolator"),this.init(t,!0)}return e.prototype.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];t&&(this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e}),e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=void 0!==n.escape?n.escape:g,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?p(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?p(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?p(n.nestingPrefix):n.nestingPrefixEscaped||p("$t("),this.nestingSuffix=n.nestingSuffix?p(n.nestingSuffix):n.nestingSuffixEscaped||p(")"),this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.resetRegExp()},e.prototype.reset=function(){this.options&&this.init(this.options)},e.prototype.resetRegExp=function(){var e=this.prefix+"(.+?)"+this.suffix;this.regexp=new RegExp(e,"g");var t=""+this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(t,"g");var n=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(n,"g")},e.prototype.interpolate=function(e,t,n,r){var o=this,s=void 0,a=void 0,i=void 0;function l(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(o.formatSeparator)<0)return f(t,e);var r=e.split(o.formatSeparator),s=r.shift().trim(),a=r.join(o.formatSeparator).trim();return o.format(f(t,s),a,n)};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler;for(i=0;(s=this.regexpUnescape.exec(e))&&(a=c(s[1].trim()),e=e.replace(s[0],a),this.regexpUnescape.lastIndex=0,!(++i>=this.maxReplaces)););for(i=0;s=this.regexp.exec(e);){if(void 0===(a=c(s[1].trim())))if("function"==typeof d){var h=d(e,s);a="string"==typeof h?h:""}else this.logger.warn("missed to pass in variable "+s[1]+" for interpolating "+e),a="";else"string"==typeof a||this.useRawValueToEscape||(a=u(a));if(a=this.escapeValue?l(this.escape(a)):l(a),e=e.replace(s[0],a),this.regexp.lastIndex=0,++i>=this.maxReplaces)break}return e},e.prototype.nest=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=void 0,o=void 0,s=N({},n);function a(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var r=n.join(",");r=(r=this.interpolate(r,s)).replace(/'/g,'"');try{s=JSON.parse(r),t&&(s=N({},t,s))}catch(t){this.logger.error("failed parsing options string in nesting for key "+e,t)}return e}for(s.applyPostProcessor=!1;r=this.nestingRegexp.exec(e);){if((o=t(a.call(this,r[1].trim(),s),s))&&r[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=u(o)),o||(this.logger.warn("missed to resolve "+r[1]+" for nesting "+e),o=""),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e},e}(),B=Object.assign||function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};z(this,t);var i=F(this,e.call(this));return i.backend=n,i.store=r,i.languageUtils=o.languageUtils,i.options=s,i.logger=a.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,s.backend,s),i}return H(t,e),t.prototype.queueLoad=function(e,t,n,r){var o=this,s=[],a=[],i=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var i=e+"|"+t;!n.reload&&o.store.hasResourceBundle(e,t)?o.state[i]=2:o.state[i]<0||(1===o.state[i]?a.indexOf(i)<0&&a.push(i):(o.state[i]=1,r=!1,a.indexOf(i)<0&&a.push(i),s.indexOf(i)<0&&s.push(i),u.indexOf(t)<0&&u.push(t)))})),r||i.push(e)})),(s.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:s,pending:a,toLoadLanguages:i,toLoadNamespaces:u}},t.prototype.loaded=function(e,t,n){var r=e.split("|"),o=U(r,2),s=o[0],a=o[1];t&&this.emit("failedLoading",s,a,t),n&&this.store.addResourceBundle(s,a,n),this.state[e]=t?-1:2;var i={};this.queue.forEach((function(n){var r,o,u,l,d,f;r=n.loaded,o=a,l=c(r,[s],Object),d=l.obj,f=l.k,d[f]=d[f]||[],u&&(d[f]=d[f].concat(o)),u||d[f].push(o),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){i[e]||(i[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){i[e].indexOf(t)<0&&i[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((function(e){return!e.done}))},t.prototype.read=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=this,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,a=arguments[5];return e.length?this.backend[n](e,t,(function(i,u){i&&u&&r<5?setTimeout((function(){o.read.call(o,e,t,n,r+1,2*s,a)}),s):a(i,u)})):a(null,{})},t.prototype.prepareLoading=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var s=this.queueLoad(e,t,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach((function(e){n.loadOne(e)}))},t.prototype.load=function(e,t,n){this.prepareLoading(e,t,{},n)},t.prototype.reload=function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)},t.prototype.loadOne=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=U(r,2),s=o[0],a=o[1];this.read(s,a,"read",null,null,(function(r,o){r&&t.logger.warn(n+"loading namespace "+a+" for language "+s+" failed",r),!r&&o&&t.logger.log(n+"loaded namespace "+a+" for language "+s,o),t.loaded(e,r,o)}))},t.prototype.saveMissing=function(e,t,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,B({},s,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r)},t}(i);function $(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}var J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];Y(this,t);var o=V(this,e.call(this));if(o.options=$(n),o.services={},o.logger=a,o.modules={external:[]},r&&!o.isInitialized&&!n.isClone){var s;if(!o.options.initImmediate)return s=o.init(n,r),V(o,s);setTimeout((function(){o.init(n,r)}),0)}return o}return K(t,e),t.prototype.init=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),this.options=W({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};return e[1]&&(t.defaultValue=e[1]),e[2]&&(t.tDescription=e[2]),t},interpolation:{escapeValue:!0,format:function(e,t,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,$(t)),this.format=this.options.interpolation.format,n||(n=G),!this.options.isClone){this.modules.logger?a.init(r(this.modules.logger),this.options):a.init(null,this.options);var o=new T(this.options);this.store=new x(this.options.resources,this.options);var s=this.services;s.logger=a,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new I(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new M(this.options),s.backendConnector=new Q(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:G;if(this.options.resources)t(null);else{if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],r=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){n.indexOf(e)<0&&n.push(e)}))};if(this.language)r(this.language);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach((function(e){return r(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return r(e)})),this.services.backendConnector.load(n,this.options.ns,t)}},t.prototype.reloadResources=function(e,t,n){e||(e=this.languages),t||(t=this.options.ns),n||(n=function(){}),this.services.backendConnector.reload(e,t,n)},t.prototype.use=function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&_.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this},t.prototype.changeLanguage=function(e,t){var n=this,r=function(e){e&&(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources((function(r){!function(e,r){n.translator.changeLanguage(r),r&&(n.emit("languageChanged",r),n.logger.log("languageChanged",r)),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(r,e)}))};e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect())},t.prototype.getFixedT=function(e,t){var n=this,r=function e(t,r){for(var o=arguments.length,s=Array(o>2?o-2:0),a=2;a0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"},t.prototype.createInstance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];return new t(e,n)},t.prototype.cloneInstance=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,o=W({},this.options,n,{isClone:!0}),s=new t(o),a=["store","services","language"];return a.forEach((function(t){s[t]=e[t]})),s.translator=new k(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?a(e)+t:t}function u(){return!0}function l(e,t,n){return(0===e&&!h(e)||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function c(e,t){return f(e,t,0)}function d(e,t){return f(e,t,t)}function f(e,t,n){return void 0===e?n:h(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function h(e){return e<0||0===e&&1/e==-1/0}function p(e){return Boolean(e&&e["@@__IMMUTABLE_ITERABLE__@@"])}function m(e){return Boolean(e&&e["@@__IMMUTABLE_KEYED__@@"])}function g(e){return Boolean(e&&e["@@__IMMUTABLE_INDEXED__@@"])}function b(e){return m(e)||g(e)}var v=function(e){return p(e)?e:M(e)},y=function(e){function t(e){return m(e)?e:B(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(v),w=function(e){function t(e){return g(e)?e:U(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(v),x=function(e){function t(e){return p(e)&&!b(e)?e:z(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(v);v.Keyed=y,v.Indexed=w,v.Set=x;function _(e){return Boolean(e&&e["@@__IMMUTABLE_SEQ__@@"])}function A(e){return Boolean(e&&e["@@__IMMUTABLE_RECORD__@@"])}function C(e){return p(e)||A(e)}var R="@@__IMMUTABLE_ORDERED__@@";function S(e){return Boolean(e&&e[R])}var E="function"==typeof Symbol&&Symbol.iterator,k=E||"@@iterator",j=function(e){this.next=e};function T(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function P(e){return!!I(e)}function L(e){return e&&"function"==typeof e.next}function O(e){var t=I(e);return t&&t.call(e)}function I(e){var t=e&&(E&&e[E]||e["@@iterator"]);if("function"==typeof t)return t}j.prototype.toString=function(){return"[Iterator]"},j.KEYS=0,j.VALUES=1,j.ENTRIES=2,j.prototype.inspect=j.prototype.toSource=function(){return this.toString()},j.prototype[k]=function(){return this};var N=Object.prototype.hasOwnProperty;function D(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var M=function(e){function t(e){return null==e?J():C(e)?e.toSeq():function(e){var t=V(e);if(t)return t;if("object"==typeof e)return new H(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var n=this._cache;if(n){for(var r=n.length,o=0;o!==r;){var s=n[t?r-++o:o++];if(!1===e(s[1],s[0],this))break}return o}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var n=this._cache;if(n){var r=n.length,o=0;return new j((function(){if(o===r)return{value:void 0,done:!0};var s=n[t?r-++o:o++];return T(e,s[0],s[1])}))}return this.__iteratorUncached(e,t)},t}(v),B=function(e){function t(e){return null==e?J().toKeyedSeq():p(e)?m(e)?e.toSeq():e.fromEntrySeq():A(e)?e.toSeq():W(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(M),U=function(e){function t(e){return null==e?J():p(e)?m(e)?e.entrySeq():e.toIndexedSeq():A(e)?e.toSeq().entrySeq():Y(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(M),z=function(e){function t(e){return(p(e)&&!b(e)?e:U(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(M);M.isSeq=_,M.Keyed=B,M.Set=z,M.Indexed=U,M.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var F=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[i(this,e)]:t},t.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length,o=0;o!==r;){var s=t?r-++o:o++;if(!1===e(n[s],s,this))break}return o},t.prototype.__iterator=function(e,t){var n=this._array,r=n.length,o=0;return new j((function(){if(o===r)return{value:void 0,done:!0};var s=t?r-++o:o++;return T(e,s,n[s])}))},t}(U),H=function(e){function t(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return N.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length,s=0;s!==o;){var a=r[t?o-++s:s++];if(!1===e(n[a],a,this))break}return s},t.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length,s=0;return new j((function(){if(s===o)return{value:void 0,done:!0};var a=r[t?o-++s:s++];return T(e,a,n[a])}))},t}(B);H.prototype[R]=!0;var Q,$=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=O(this._collection),r=0;if(L(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=O(this._collection);if(!L(n))return new j(q);var r=0;return new j((function(){var t=n.next();return t.done?t:T(e,r++,t.value)}))},t}(U);function J(){return Q||(Q=new F([]))}function W(e){var t=Array.isArray(e)?new F(e):P(e)?new $(e):void 0;if(t)return t.fromEntrySeq();if("object"==typeof e)return new H(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Y(e){var t=V(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function V(e){return D(e)?new F(e):P(e)?new $(e):void 0}function K(e){return Boolean(e&&e["@@__IMMUTABLE_MAP__@@"])}function G(e){return K(e)&&S(e)}function X(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function Z(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(X(e)&&X(t)&&e.equals(t))}var ee="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function te(e){return e>>>1&1073741824|3221225471&e}var ne=Object.prototype.valueOf;function re(e){switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return te(t)}(e);case"string":return e.length>de?function(e){var t=pe[e];void 0===t&&(t=oe(e),he===fe&&(he=0,pe={}),he++,pe[e]=t);return t}(e):oe(e);case"object":case"function":return null===e?1108378658:"function"==typeof e.hashCode?te(e.hashCode(e)):(e.valueOf!==ne&&"function"==typeof e.valueOf&&(e=e.valueOf(e)),function(e){var t;if(ue&&void 0!==(t=ie.get(e)))return t;if(void 0!==(t=e[ce]))return t;if(!ae){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[ce]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}t=++le,1073741824&le&&(le=0);if(ue)ie.set(e,t);else{if(void 0!==se&&!1===se(e))throw new Error("Non-extensible objects are not allowed as keys.");if(ae)Object.defineProperty(e,ce,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[ce]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[ce]=t}}return t}(e));case"undefined":return 1108378659;default:if("function"==typeof e.toString)return oe(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function oe(e){for(var t=0,n=0;n=0&&(h.get=function(t,n){return(t=i(this,t))>=0&&tu)return{value:void 0,done:!0};var e=o.next();return r||1===t||e.done?e:T(t,i-1,0===t?void 0:e.value[1],e)}))},h}function Ce(e,t,n,r){var o=Oe(e);return o.__iterateUncached=function(o,s){var a=this;if(s)return this.cacheResult().__iterate(o,s);var i=!0,u=0;return e.__iterate((function(e,s,l){if(!i||!(i=t.call(n,e,s,l)))return u++,o(e,r?s:u-1,a)})),u},o.__iteratorUncached=function(o,s){var a=this;if(s)return this.cacheResult().__iterator(o,s);var i=e.__iterator(2,s),u=!0,l=0;return new j((function(){var e,s,c;do{if((e=i.next()).done)return r||1===o?e:T(o,l++,0===o?void 0:e.value[1],e);var d=e.value;s=d[0],c=d[1],u&&(u=t.call(n,c,s,a))}while(u);return 2===o?e:T(o,s,c,e)}))},o}function Re(e,t){var n=m(e),r=[e].concat(t).map((function(e){return p(e)?n&&(e=y(e)):e=n?W(e):Y(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===r.length)return e;if(1===r.length){var o=r[0];if(o===e||n&&m(o)||g(e)&&g(o))return o}var s=new F(r);return n?s=s.toKeyedSeq():g(e)||(s=s.toSetSeq()),(s=s.flatten(!0)).size=r.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),s}function Se(e,t,n){var r=Oe(e);return r.__iterateUncached=function(o,s){if(s)return this.cacheResult().__iterate(o,s);var a=0,i=!1;return function e(u,l){u.__iterate((function(s,u){return(!t||l0}function Te(e,t,n,r){var o=Oe(e),s=new F(n).map((function(e){return e.size}));return o.size=r?s.max():s.min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var s=n.map((function(e){return e=v(e),O(o?e.reverse():e)})),a=0,i=!1;return new j((function(){var n;return i||(n=s.map((function(e){return e.next()})),i=r?n.every((function(e){return e.done})):n.some((function(e){return e.done}))),i?{value:void 0,done:!0}:T(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function qe(e,t){return e===t?e:_(e)?t:e.constructor(t)}function Pe(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Le(e){return m(e)?y:g(e)?w:x}function Oe(e){return Object.create((m(e)?B:g(e)?U:z).prototype)}function Ie(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):M.prototype.cacheResult.call(this)}function Ne(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[n]=arguments[n+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return st(this,t,e)}function st(e,t,n){for(var o=[],s=0;s0;)t[n]=arguments[n+1];return at(this,t,e)}function ct(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ve(this,e,kt(),(function(e){return it(e,t)}))}function dt(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ve(this,e,kt(),(function(e){return at(e,t)}))}function ft(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function ht(){return this.__ownerID?this:this.__ensureOwner(new s)}function pt(){return this.__ensureOwner()}function mt(){return this.__altered}ge.prototype.cacheResult=me.prototype.cacheResult=be.prototype.cacheResult=ve.prototype.cacheResult=Ie;var gt=function(e){function t(t){return null==t?kt():K(t)&&!S(t)?t:kt().withMutations((function(n){var r=e(t);Be(r.size),r.forEach((function(e,t){return n.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return kt().withMutations((function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return jt(this,e,t)},t.prototype.remove=function(e){return jt(this,e,r)},t.prototype.deleteAll=function(e){var t=v(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):kt()},t.prototype.sort=function(e){return Zt(Ee(this,e))},t.prototype.sortBy=function(e,t){return Zt(Ee(this,t,e))},t.prototype.map=function(e,t){return this.withMutations((function(n){n.forEach((function(r,o){n.set(o,e.call(t,r,o,n))}))}))},t.prototype.__iterator=function(e,t){return new Ct(this,e,t)},t.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Et(this.size,this._root,e,this.__hash):0===this.size?kt():(this.__ownerID=e,this.__altered=!1,this)},t}(y);gt.isMap=K;var bt=gt.prototype;bt["@@__IMMUTABLE_MAP__@@"]=!0,bt.delete=bt.remove,bt.removeAll=bt.deleteAll,bt.setIn=Ge,bt.removeIn=bt.deleteIn=Ze,bt.update=tt,bt.updateIn=nt,bt.merge=bt.concat=rt,bt.mergeWith=ot,bt.mergeDeep=ut,bt.mergeDeepWith=lt,bt.mergeIn=ct,bt.mergeDeepIn=dt,bt.withMutations=ft,bt.wasAltered=mt,bt.asImmutable=pt,bt["@@transducer/init"]=bt.asMutable=ht,bt["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},bt["@@transducer/result"]=function(e){return e.asImmutable()};var vt=function(e,t){this.ownerID=e,this.entries=t};vt.prototype.get=function(e,t,n,r){for(var o=this.entries,s=0,a=o.length;s=It)return function(e,t,n,r){e||(e=new s);for(var o=new _t(e,re(n),[n,r]),a=0;a>>e)),s=this.bitmap;return 0==(s&o)?r:this.nodes[Lt(s&o-1)].get(e+5,t,n,r)},yt.prototype.update=function(e,t,n,o,s,a,i){void 0===n&&(n=re(o));var u=31&(0===t?n:n>>>t),l=1<=Nt)return function(e,t,n,r,o){for(var s=0,a=new Array(32),i=0;0!==n;i++,n>>>=1)a[i]=1&n?t[s++]:void 0;return a[r]=o,new wt(e,s+1,a)}(e,h,c,u,m);if(d&&!m&&2===h.length&&qt(h[1^f]))return h[1^f];if(d&&m&&1===h.length&&qt(m))return m;var g=e&&e===this.ownerID,b=d?m?c:c^l:c|l,v=d?m?Ot(h,f,m,g):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),s=0,a=0;a>>e),s=this.nodes[o];return s?s.get(e+5,t,n,r):r},wt.prototype.update=function(e,t,n,o,s,a,i){void 0===n&&(n=re(o));var u=31&(0===t?n:n>>>t),l=s===r,c=this.nodes,d=c[u];if(l&&!d)return this;var f=Tt(d,e,t+5,n,o,s,a,i);if(f===d)return this;var h=this.count;if(d){if(!f&&--h>>n),i=31&(0===n?r:r>>>n),u=a===i?[Pt(e,t,n+5,r,o)]:(s=new _t(t,r,o),a>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Ot(e,t,n,r){var o=r?e:De(e);return o[t]=n,o}var It=8,Nt=16,Dt=8;function Mt(e){return Boolean(e&&e["@@__IMMUTABLE_LIST__@@"])}var Bt=function(e){function t(t){var n=Jt();if(null==t)return n;if(Mt(t))return t;var r=e(t),o=r.size;return 0===o?n:(Be(o),o>0&&o<32?$t(0,o,5,null,new zt(r.toArray())):n.withMutations((function(e){e.setSize(o),r.forEach((function(t,n){return e.set(n,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=i(this,e))>=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?Kt(e,t).set(0,n):Kt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,s={value:!1};t>=Gt(e._capacity)?r=Wt(r,e.__ownerID,0,t,n,s):o=Wt(o,e.__ownerID,e._level,t,n,s);if(!s.value)return e;if(e.__ownerID)return e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e;return $t(e._origin,e._capacity,e._level,o,r)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Jt()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Kt(n,0,t+e.length);for(var r=0;r>>t&31;if(r>=this.array.length)return new zt([],e);var o,s=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-5,n))===a&&s)return this}if(s&&!o)return this;var i=Yt(this,e);if(!s)for(var u=0;u>>t&31;if(o>=this.array.length)return this;if(t>0){var s=this.array[o];if((r=s&&s.removeAfter(e,t-5,n))===s&&o===this.array.length-1)return this}var a=Yt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var Ft,Ht={};function Qt(e,t){var n=e._origin,r=e._capacity,o=Gt(r),s=e._tail;return a(e._root,e._level,0);function a(e,i,u){return 0===i?function(e,a){var i=a===o?s&&s.array:e&&e.array,u=a>n?0:n-a,l=r-a;l>32&&(l=32);return function(){if(u===l)return Ht;var e=t?--l:u++;return i&&i[e]}}(e,u):function(e,o,s){var i,u=e&&e.array,l=s>n?0:n-s>>o,c=1+(r-s>>o);c>32&&(c=32);return function(){for(;;){if(i){var e=i();if(e!==Ht)return e;i=null}if(l===c)return Ht;var n=t?--c:l++;i=a(u&&u[n],o-5,s+(n<>>n&31,l=e&&u0){var c=e&&e.array[u],d=Wt(c,t,n-5,r,s,a);return d===c?e:((i=Yt(e,t)).array[u]=d,i)}return l&&e.array[u]===s?e:(a&&o(a),i=Yt(e,t),void 0===s&&u===i.array.length-1?i.array.pop():i.array[u]=s,i)}function Yt(e,t){return t&&e&&t===e.ownerID?e:new zt(e?e.array.slice():[],t)}function Vt(e,t){if(t>=Gt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&31],r-=5;return n}}function Kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new s,o=e._origin,a=e._capacity,i=o+t,u=void 0===n?a:n<0?a+n:o+n;if(i===o&&u===a)return e;if(i>=u)return e.clear();for(var l=e._level,c=e._root,d=0;i+d<0;)c=new zt(c&&c.array.length?[void 0,c]:[],r),d+=1<<(l+=5);d&&(i+=d,o+=d,u+=d,a+=d);for(var f=Gt(a),h=Gt(u);h>=1<f?new zt([],r):p;if(p&&h>f&&i5;b-=5){var v=f>>>b&31;g=g.array[v]=Yt(g.array[v],r)}g.array[f>>>5&31]=p}if(u=h)i-=h,u-=h,l=5,c=null,m=m&&m.removeBefore(r,0,i);else if(i>o||h>>l&31;if(y!==h>>>l&31)break;y&&(d+=(1<o&&(c=c.removeBefore(r,l,i-d)),c&&h>>5<<5}var Xt,Zt=function(e){function t(e){return null==e?tn():G(e)?e:tn().withMutations((function(t){var n=y(e);Be(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tn()},t.prototype.set=function(e,t){return nn(this,e,t)},t.prototype.remove=function(e){return nn(this,e,r)},t.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},t.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?en(t,n,e,this.__hash):0===this.size?tn():(this.__ownerID=e,this._map=t,this._list=n,this)},t}(gt);function en(e,t,n,r){var o=Object.create(Zt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function tn(){return Xt||(Xt=en(kt(),Jt()))}function nn(e,t,n){var o,s,a=e._map,i=e._list,u=a.get(t),l=void 0!==u;if(n===r){if(!l)return e;i.size>=32&&i.size>=2*a.size?(o=(s=i.filter((function(e,t){return void 0!==e&&u!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(o.__ownerID=s.__ownerID=e.__ownerID)):(o=a.remove(t),s=u===i.size-1?i.pop():i.set(u,void 0))}else if(l){if(n===i.get(u)[1])return e;o=a,s=i.set(u,[t,n])}else o=a.set(t,i.size),s=i.set(i.size,[t,n]);return e.__ownerID?(e.size=o.size,e._map=o,e._list=s,e.__hash=void 0,e):en(o,s)}Zt.isOrderedMap=G,Zt.prototype[R]=!0,Zt.prototype.delete=Zt.prototype.remove;function rn(e){return Boolean(e&&e["@@__IMMUTABLE_STACK__@@"])}var on=function(e){function t(e){return null==e?ln():rn(e)?e:ln().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var n=this._head;for(e=i(this,e);n&&e--;)n=n.next;return n?n.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:e[r],next:n};return this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):un(t,n)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&rn(t))return t;Be(t.size);var n=this.size,r=this._head;return t.__iterate((function(e){n++,r={value:e,next:r}}),!0),this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):un(n,r)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ln()},t.prototype.slice=function(t,n){if(l(t,n,this.size))return this;var r=c(t,this.size);if(d(n,this.size)!==this.size)return e.prototype.slice.call(this,t,n);for(var o=this.size-r,s=this._head;r--;)s=s.next;return this.__ownerID?(this.size=o,this._head=s,this.__hash=void 0,this.__altered=!0,this):un(o,s)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?un(this.size,this._head,e,this.__hash):0===this.size?ln():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var n=this;if(t)return new F(this.toArray()).__iterate((function(t,r){return e(t,r,n)}),t);for(var r=0,o=this._head;o&&!1!==e(o.value,r++,this);)o=o.next;return r},t.prototype.__iterator=function(e,t){if(t)return new F(this.toArray()).__iterator(e,t);var n=0,r=this._head;return new j((function(){if(r){var t=r.value;return r=r.next,T(e,n++,t)}return{value:void 0,done:!0}}))},t}(w);on.isStack=rn;var sn,an=on.prototype;function un(e,t,n,r){var o=Object.create(an);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function ln(){return sn||(sn=un(0))}an["@@__IMMUTABLE_STACK__@@"]=!0,an.shift=an.pop,an.unshift=an.push,an.unshiftAll=an.pushAll,an.withMutations=ft,an.wasAltered=mt,an.asImmutable=pt,an["@@transducer/init"]=an.asMutable=ht,an["@@transducer/step"]=function(e,t){return e.unshift(t)},an["@@transducer/result"]=function(e){return e.asImmutable()};function cn(e){return Boolean(e&&e["@@__IMMUTABLE_SET__@@"])}function dn(e){return cn(e)&&S(e)}function fn(e,t){if(e===t)return!0;if(!p(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||m(e)!==m(t)||g(e)!==g(t)||S(e)!==S(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!b(e);if(S(e)){var o=e.entries();return t.every((function(e,t){var r=o.next().value;return r&&Z(r[1],e)&&(n||Z(r[0],t))}))&&o.next().done}var s=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{s=!0;var a=e;e=t,t=a}var i=!0,u=t.__iterate((function(t,o){if(n?!e.has(t):s?!Z(t,e.get(o,r)):!Z(e.get(o,r),t))return i=!1,!1}));return i&&e.size===u}function hn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function pn(e){if(!e||"object"!=typeof e)return e;if(!p(e)){if(!Fe(e))return e;e=M(e)}if(m(e)){var t={};return e.__iterate((function(e,n){t[n]=pn(e)})),t}var n=[];return e.__iterate((function(e){n.push(pn(e))})),n}var mn=function(e){function t(t){return null==t?wn():cn(t)&&!S(t)?t:wn().withMutations((function(n){var r=e(t);Be(r.size),r.forEach((function(e){return n.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(y(e).keySeq())},t.intersect=function(e){return(e=v(e).toArray()).length?bn.intersect.apply(t(e.pop()),e):wn()},t.union=function(e){return(e=v(e).toArray()).length?bn.union.apply(t(e.pop()),e):wn()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return vn(this,this._map.set(e,e))},t.prototype.remove=function(e){return vn(this,this._map.remove(e))},t.prototype.clear=function(){return vn(this,this._map.clear())},t.prototype.map=function(e,t){var n=this,r=[],o=[];return this.forEach((function(s){var a=e.call(t,s,s,n);a!==s&&(r.push(s),o.push(a))})),this.withMutations((function(e){r.forEach((function(t){return e.remove(t)})),o.forEach((function(t){return e.add(t)}))}))},t.prototype.union=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(n){for(var r=0;r=0&&t=0&&n>>-15,461845907),t=ee(t<<13|t>>>-13,5),t=ee((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=te((t=ee(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Dn(re(e),re(t))|0}:function(e,t){r=r+Dn(re(e),re(t))|0}:t?function(e){r=31*r+re(e)|0}:function(e){r=r+re(e)|0}),r)}(this))}});var En=v.prototype;En["@@__IMMUTABLE_ITERABLE__@@"]=!0,En[k]=En.values,En.toJSON=En.toArray,En.__toStringMapper=He,En.inspect=En.toSource=function(){return this.toString()},En.chain=En.flatMap,En.contains=En.includes,hn(y,{flip:function(){return qe(this,ye(this))},mapEntries:function(e,t){var n=this,r=0;return qe(this,this.toSeq().map((function(o,s){return e.call(t,[s,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return qe(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var kn=y.prototype;kn["@@__IMMUTABLE_KEYED__@@"]=!0,kn[k]=En.entries,kn.toJSON=Sn,kn.__toStringMapper=function(e,t){return He(t)+": "+He(e)},hn(w,{toKeyedSeq:function(){return new me(this,!1)},filter:function(e,t){return qe(this,_e(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return qe(this,xe(this,!1))},slice:function(e,t){return qe(this,Ae(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(t||0,0),0===n||2===n&&!t)return this;e=c(e,e<0?this.count():this.size);var r=this.slice(0,e);return qe(this,1===n?r:r.concat(De(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return qe(this,Se(this,e,!1))},get:function(e,t){return(e=i(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=i(this,e))>=0&&(void 0!==this.size?this.size===1/0||et?-1:0}function Dn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}jn["@@__IMMUTABLE_INDEXED__@@"]=!0,jn[R]=!0,hn(x,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),x.prototype.has=En.includes,x.prototype.contains=x.prototype.includes,hn(B,y.prototype),hn(U,w.prototype),hn(z,x.prototype);var Mn=function(e){function t(e){return null==e?Fn():dn(e)?e:Fn().withMutations((function(t){var n=x(e);Be(n.size),n.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(y(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(mn);Mn.isOrderedSet=dn;var Bn,Un=Mn.prototype;function zn(e,t){var n=Object.create(Un);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Fn(){return Bn||(Bn=zn(tn()))}Un[R]=!0,Un.zip=jn.zip,Un.zipWith=jn.zipWith,Un.__empty=Fn,Un.__make=zn;var Hn=function(e,t){var n,r=function(s){var a=this;if(s instanceof r)return s;if(!(this instanceof r))return new r(s);if(!n){n=!0;var i=Object.keys(e),u=o._indices={};o._name=t,o._keys=i,o._defaultValues=e;for(var l=0;l0?t:void 0}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/path.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"path",lookup:function(e){var t=void 0;if("undefined"!=typeof window){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if("number"==typeof e.lookupFromPathIndex){if("string"!=typeof n[e.lookupFromPathIndex])return;t=n[e.lookupFromPathIndex].replace("/","")}else t=n[0].replace("/","")}return t}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/querystring.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"querystring",lookup:function(e){var t=void 0;if("undefined"!=typeof window)for(var n=window.location.search.substring(1).split("&"),r=0;r0)n[r].substring(0,o)===e.lookupQuerystring&&(t=n[r].substring(o+1))}return t}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/browserLookups/subdomain.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"subdomain",lookup:function(e){var t=void 0;if("undefined"!=typeof window){var n=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);n instanceof Array&&(t="number"==typeof e.lookupFromSubdomainIndex?n[e.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n[0].replace("http://","").replace("https://","").replace(".",""))}return t}}},"./node_modules/i18next-browser-languagedetector/dist/commonjs/index.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};h(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return r(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=o.defaults(t,this.options||{},{order:["querystring","cookie","localStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=n,this.addDetector(s.default),this.addDetector(a.default),this.addDetector(i.default),this.addDetector(u.default),this.addDetector(l.default),this.addDetector(c.default),this.addDetector(d.default)}},{key:"addDetector",value:function(e){this.detectors[e.name]=e}},{key:"detect",value:function(e){var t=this;e||(e=this.options.order);var n=[];e.forEach((function(e){if(t.detectors[e]){var r=t.detectors[e].lookup(t.options);r&&"string"==typeof r&&(r=[r]),r&&(n=n.concat(r))}}));var r=void 0;if(n.forEach((function(e){if(!r){var n=t.services.languageUtils.formatLanguageCode(e);t.services.languageUtils.isWhitelisted(n)&&(r=n)}})),!r){var o=this.i18nOptions.fallbackLng;"string"==typeof o&&(o=[o]),o||(o=[]),r="[object Array]"===Object.prototype.toString.apply(o)?o[0]:o[0]||o.default&&o.default[0]}return r}},{key:"cacheUserLanguage",value:function(e,t){var n=this;t||(t=this.options.caches),t&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||t.forEach((function(t){n.detectors[t]&&n.detectors[t].cacheUserLanguage(e,n.options)})))}}]),e}();p.type="languageDetector",t.default=p},"./node_modules/i18next-browser-languagedetector/dist/commonjs/utils.js":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=function(e){return o.call(s.call(arguments,1),(function(t){if(t)for(var n in t)void 0===e[n]&&(e[n]=t[n])})),e},t.extend=function(e){return o.call(s.call(arguments,1),(function(t){if(t)for(var n in t)e[n]=t[n]})),e};var r=[],o=r.forEach,s=r.slice},"./node_modules/i18next-browser-languagedetector/index.js":function(e,t,n){e.exports=n("./node_modules/i18next-browser-languagedetector/dist/commonjs/index.js").default},"./node_modules/i18next/dist/es/index.js":function(e,t,n){"use strict";n.d(t,"a",(function(){return Z})),n.d(t,"b",(function(){return ee}));var r=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),this.init(t,n)}return e.prototype.init=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||s,this.options=t,this.debug=t.debug},e.prototype.setDebug=function(e){this.debug=e},e.prototype.log=function(){for(var e=arguments.length,t=Array(e),n=0;n-1&&n.observers[e].splice(r,1)}else delete n.observers[e]}))},e.prototype.emit=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var s="string"!=typeof t?[].concat(t):t.split(".");s.length>1;){if(o())return{};var a=r(s.shift());!e[a]&&n&&(e[a]=new n),e=e[a]}return o()?{}:{obj:e,k:r(s.shift())}}function d(e,t,n){var r=c(e,t,Object);r.obj[r.k]=n}function f(e,t){var n=c(e,t),r=n.obj,o=n.k;if(r)return r[o]}function h(e,t,n){for(var r in t)r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):h(e[r],t[r],n):e[r]=t[r];return e}function p(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var m={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function g(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return m[e]})):e}var b=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};v(this,t);var o=y(this,e.call(this));return o.data=n||{},o.options=r,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o}return w(t,e),t.prototype.addNamespaces=function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)},t.prototype.removeNamespaces=function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)},t.prototype.getResource=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=[e,t];return n&&"string"!=typeof n&&(s=s.concat(n)),n&&"string"==typeof n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(s=e.split(".")),f(this.data,s)},t.prototype.addResource=function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=this.options.keySeparator;void 0===s&&(s=".");var a=[e,t];n&&(a=a.concat(s?n.split(s):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),d(this.data,a,r),o.silent||this.emit("added",e,t,n,r)},t.prototype.addResources=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"==typeof n[o]&&this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)},t.prototype.addResourceBundle=function(e,t,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var i=f(this.data,a)||{};r?h(i,n,o):i=b({},i,n),d(this.data,a,i),s.silent||this.emit("added",e,t,n)},t.prototype.removeResourceBundle=function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)},t.prototype.hasResourceBundle=function(e,t){return void 0!==this.getResource(e,t)},t.prototype.getResourceBundle=function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?b({},this.getResource(e,t)):this.getResource(e,t)},t.prototype.getDataByLanguage=function(e){return this.data[e]},t.prototype.toJSON=function(){return this.data},t}(i),_={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var s=this;return e.forEach((function(e){s.processors[e]&&(t=s.processors[e].process(t,n,r,o))})),t}},A=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};R(this,t);var o=S(this,e.call(this));return l(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat"],n,o),o.options=r,void 0===o.options.keySeparator&&(o.options.keySeparator="."),o.logger=a.create("translator"),o}return E(t,e),t.prototype.changeLanguage=function(e){e&&(this.language=e)},t.prototype.exists=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res},t.prototype.extractFromKey=function(e,t){var n=t.nsSeparator||this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),e=s.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}},t.prototype.translate=function(e,t){var n=this;if("object"!==(void 0===t?"undefined":C(t))&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e||""===e)return"";"number"==typeof e&&(e=String(e)),"string"==typeof e&&(e=[e]);var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=this.extractFromKey(e[e.length-1],t),s=o.key,a=o.namespaces,i=a[a.length-1],u=t.lng||this.language,l=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&"cimode"===u.toLowerCase()){if(l){var c=t.nsSeparator||this.options.nsSeparator;return i+c+s}return s}var d=this.resolve(e,t),f=d&&d.res,h=d&&d.usedKey||s,p=Object.prototype.toString.apply(f),m=["[object Number]","[object Function]","[object RegExp]"],g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(b&&f&&v&&m.indexOf(p)<0&&(!g||"[object Array]"!==p)){if(!t.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,f,t):"key '"+s+" ("+this.language+")' returned an object instead of string.";if(r){var y="[object Array]"===p?[]:{};for(var w in f)if(Object.prototype.hasOwnProperty.call(f,w)){var x=""+h+r+w;y[w]=this.translate(x,A({},t,{joinArrays:!1,ns:a})),y[w]===x&&(y[w]=f[w])}f=y}}else if(b&&g&&"[object Array]"===p)(f=f.join(g))&&(f=this.extendTranslation(f,e,t));else{var _=!1,R=!1;if(!this.isValidLookup(f)&&void 0!==t.defaultValue){if(_=!0,void 0!==t.count){var S=this.pluralResolver.getSuffix(u,t.count);f=t["defaultValue"+S]}f||(f=t.defaultValue)}this.isValidLookup(f)||(R=!0,f=s);var E=t.defaultValue&&t.defaultValue!==f&&this.options.updateMissing;if(R||_||E){this.logger.log(E?"updateKey":"missingKey",u,i,s,E?t.defaultValue:f);var k=[],j=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&j&&j[0])for(var T=0;T1&&void 0!==arguments[1]?arguments[1]:{},r=void 0,o=void 0,s=void 0,a=void 0;return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!t.isValidLookup(r)){var i=t.extractFromKey(e,n),u=i.key;o=u;var l=i.namespaces;t.options.fallbackNS&&(l=l.concat(t.options.fallbackNS));var c=void 0!==n.count&&"string"!=typeof n.count,d=void 0!==n.context&&"string"==typeof n.context&&""!==n.context,f=n.lngs?n.lngs:t.languageUtils.toResolveHierarchy(n.lng||t.language,n.fallbackLng);l.forEach((function(e){t.isValidLookup(r)||(a=e,f.forEach((function(o){if(!t.isValidLookup(r)){s=o;var a=u,i=[a];if(t.i18nFormat&&t.i18nFormat.addLookupKeys)t.i18nFormat.addLookupKeys(i,u,o,e,n);else{var l=void 0;c&&(l=t.pluralResolver.getSuffix(o,n.count)),c&&d&&i.push(a+l),d&&i.push(a+=""+t.options.contextSeparator+n.context),c&&i.push(a+=l)}for(var f=void 0;f=i.pop();)t.isValidLookup(r)||(r=t.getResource(o,e,f,n))}})))}))}})),{res:r,usedKey:o,usedLng:s,usedNS:a}},t.prototype.isValidLookup=function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)},t.prototype.getResource=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)},t}(i);function j(e){return e.charAt(0).toUpperCase()+e.slice(1)}var T=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options=t,this.whitelist=this.options.whitelist||!1,this.logger=a.create("languageUtils")}return e.prototype.getScriptPartFromCode=function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),this.formatLanguageCode(t.join("-")))},e.prototype.getLanguagePartFromCode=function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])},e.prototype.formatLanguageCode=function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=j(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=j(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=j(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e},e.prototype.isWhitelisted=function(e){return("languageOnly"===this.options.load||this.options.nonExplicitWhitelist)&&(e=this.getLanguagePartFromCode(e)),!this.whitelist||!this.whitelist.length||this.whitelist.indexOf(e)>-1},e.prototype.getFallbackCodes=function(e,t){if(!e)return[];if("string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e.default),n||[]},e.prototype.toResolveHierarchy=function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],s=function(e){e&&(n.isWhitelisted(e)?o.push(e):n.logger.warn("rejecting non-whitelisted language code: "+e))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&s(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&s(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&s(this.getLanguagePartFromCode(e))):"string"==typeof e&&s(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&s(n.formatLanguageCode(e))})),o},e}();function q(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var P=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","he","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21}],L={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0===e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0===e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0===e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1===e?0:2===e?1:(e<0||e>10)&&e%10==0?2:3)}};function O(){var e={};return P.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:L[t.fc]}}))})),e}var I=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};q(this,e),this.languageUtils=t,this.options=n,this.logger=a.create("pluralResolver"),this.rules=O()}return e.prototype.addRule=function(e,t){this.rules[e]=t},e.prototype.getRule=function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]},e.prototype.needsPlural=function(e){var t=this.getRule(e);return t&&t.numbers.length>1},e.prototype.getPluralFormsOfKey=function(e,t){var n=this,r=[],o=this.getRule(e);return o?(o.numbers.forEach((function(o){var s=n.getSuffix(e,o);r.push(""+t+s)})),r):r},e.prototype.getSuffix=function(e,t){var n=this,r=this.getRule(e);if(r){var o=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),s=r.numbers[o];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===s?s="plural":1===s&&(s=""));var a=function(){return n.options.prepend&&s.toString()?n.options.prepend+s.toString():s.toString()};return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?"_plural_"+s.toString():a():"v2"===this.options.compatibilityJSON&&2===r.numbers.length&&1===r.numbers[0]||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}return this.logger.warn("no plural rule found for: "+e),""},e}(),N=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};D(this,e),this.logger=a.create("interpolator"),this.init(t,!0)}return e.prototype.init=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];t&&(this.options=e,this.format=e.interpolation&&e.interpolation.format||function(e){return e}),e.interpolation||(e.interpolation={escapeValue:!0});var n=e.interpolation;this.escape=void 0!==n.escape?n.escape:g,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?p(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?p(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?p(n.nestingPrefix):n.nestingPrefixEscaped||p("$t("),this.nestingSuffix=n.nestingSuffix?p(n.nestingSuffix):n.nestingSuffixEscaped||p(")"),this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.resetRegExp()},e.prototype.reset=function(){this.options&&this.init(this.options)},e.prototype.resetRegExp=function(){var e=this.prefix+"(.+?)"+this.suffix;this.regexp=new RegExp(e,"g");var t=""+this.prefix+this.unescapePrefix+"(.+?)"+this.unescapeSuffix+this.suffix;this.regexpUnescape=new RegExp(t,"g");var n=this.nestingPrefix+"(.+?)"+this.nestingSuffix;this.nestingRegexp=new RegExp(n,"g")},e.prototype.interpolate=function(e,t,n,r){var o=this,s=void 0,a=void 0,i=void 0;function l(e){return e.replace(/\$/g,"$$$$")}var c=function(e){if(e.indexOf(o.formatSeparator)<0)return f(t,e);var r=e.split(o.formatSeparator),s=r.shift().trim(),a=r.join(o.formatSeparator).trim();return o.format(f(t,s),a,n)};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler;for(i=0;(s=this.regexpUnescape.exec(e))&&(a=c(s[1].trim()),e=e.replace(s[0],a),this.regexpUnescape.lastIndex=0,!(++i>=this.maxReplaces)););for(i=0;s=this.regexp.exec(e);){if(void 0===(a=c(s[1].trim())))if("function"==typeof d){var h=d(e,s);a="string"==typeof h?h:""}else this.logger.warn("missed to pass in variable "+s[1]+" for interpolating "+e),a="";else"string"==typeof a||this.useRawValueToEscape||(a=u(a));if(a=this.escapeValue?l(this.escape(a)):l(a),e=e.replace(s[0],a),this.regexp.lastIndex=0,++i>=this.maxReplaces)break}return e},e.prototype.nest=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=void 0,o=void 0,s=N({},n);function a(e,t){if(e.indexOf(",")<0)return e;var n=e.split(",");e=n.shift();var r=n.join(",");r=(r=this.interpolate(r,s)).replace(/'/g,'"');try{s=JSON.parse(r),t&&(s=N({},t,s))}catch(t){this.logger.error("failed parsing options string in nesting for key "+e,t)}return e}for(s.applyPostProcessor=!1;r=this.nestingRegexp.exec(e);){if((o=t(a.call(this,r[1].trim(),s),s))&&r[0]===e&&"string"!=typeof o)return o;"string"!=typeof o&&(o=u(o)),o||(this.logger.warn("missed to resolve "+r[1]+" for nesting "+e),o=""),e=e.replace(r[0],o),this.regexp.lastIndex=0}return e},e}(),U=Object.assign||function(e){for(var t=1;t3&&void 0!==arguments[3]?arguments[3]:{};z(this,t);var i=F(this,e.call(this));return i.backend=n,i.store=r,i.languageUtils=o.languageUtils,i.options=s,i.logger=a.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(o,s.backend,s),i}return H(t,e),t.prototype.queueLoad=function(e,t,n,r){var o=this,s=[],a=[],i=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var i=e+"|"+t;!n.reload&&o.store.hasResourceBundle(e,t)?o.state[i]=2:o.state[i]<0||(1===o.state[i]?a.indexOf(i)<0&&a.push(i):(o.state[i]=1,r=!1,a.indexOf(i)<0&&a.push(i),s.indexOf(i)<0&&s.push(i),u.indexOf(t)<0&&u.push(t)))})),r||i.push(e)})),(s.length||a.length)&&this.queue.push({pending:a,loaded:{},errors:[],callback:r}),{toLoad:s,pending:a,toLoadLanguages:i,toLoadNamespaces:u}},t.prototype.loaded=function(e,t,n){var r=e.split("|"),o=B(r,2),s=o[0],a=o[1];t&&this.emit("failedLoading",s,a,t),n&&this.store.addResourceBundle(s,a,n),this.state[e]=t?-1:2;var i={};this.queue.forEach((function(n){var r,o,u,l,d,f;r=n.loaded,o=a,l=c(r,[s],Object),d=l.obj,f=l.k,d[f]=d[f]||[],u&&(d[f]=d[f].concat(o)),u||d[f].push(o),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){i[e]||(i[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){i[e].indexOf(t)<0&&i[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((function(e){return!e.done}))},t.prototype.read=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=this,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:250,a=arguments[5];return e.length?this.backend[n](e,t,(function(i,u){i&&u&&r<5?setTimeout((function(){o.read.call(o,e,t,n,r+1,2*s,a)}),s):a(i,u)})):a(null,{})},t.prototype.prepareLoading=function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments[3];if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var s=this.queueLoad(e,t,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach((function(e){n.loadOne(e)}))},t.prototype.load=function(e,t,n){this.prepareLoading(e,t,{},n)},t.prototype.reload=function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)},t.prototype.loadOne=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=B(r,2),s=o[0],a=o[1];this.read(s,a,"read",null,null,(function(r,o){r&&t.logger.warn(n+"loading namespace "+a+" for language "+s+" failed",r),!r&&o&&t.logger.log(n+"loaded namespace "+a+" for language "+s,o),t.loaded(e,r,o)}))},t.prototype.saveMissing=function(e,t,n,r,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,U({},s,{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r)},t}(i);function $(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e}var J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},r=arguments[1];Y(this,t);var o=V(this,e.call(this));if(o.options=$(n),o.services={},o.logger=a,o.modules={external:[]},r&&!o.isInitialized&&!n.isClone){var s;if(!o.options.initImmediate)return s=o.init(n,r),V(o,s);setTimeout((function(){o.init(n,r)}),0)}return o}return K(t,e),t.prototype.init=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];function r(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),this.options=W({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:function(){},parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};return e[1]&&(t.defaultValue=e[1]),e[2]&&(t.tDescription=e[2]),t},interpolation:{escapeValue:!0,format:function(e,t,n){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",maxReplaces:1e3}},this.options,$(t)),this.format=this.options.interpolation.format,n||(n=G),!this.options.isClone){this.modules.logger?a.init(r(this.modules.logger),this.options):a.init(null,this.options);var o=new T(this.options);this.store=new x(this.options.resources,this.options);var s=this.services;s.logger=a,s.resourceStore=this.store,s.languageUtils=o,s.pluralResolver=new I(o,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),s.interpolator=new M(this.options),s.backendConnector=new Q(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:G;if(this.options.resources)t(null);else{if(this.language&&"cimode"===this.language.toLowerCase())return t();var n=[],r=function(t){t&&e.services.languageUtils.toResolveHierarchy(t).forEach((function(e){n.indexOf(e)<0&&n.push(e)}))};if(this.language)r(this.language);else{var o=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);o.forEach((function(e){return r(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return r(e)})),this.services.backendConnector.load(n,this.options.ns,t)}},t.prototype.reloadResources=function(e,t,n){e||(e=this.languages),t||(t=this.options.ns),n||(n=function(){}),this.services.backendConnector.reload(e,t,n)},t.prototype.use=function(e){return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&_.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this},t.prototype.changeLanguage=function(e,t){var n=this,r=function(e){e&&(n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.translator.language||n.translator.changeLanguage(e),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(e)),n.loadResources((function(r){!function(e,r){n.translator.changeLanguage(r),r&&(n.emit("languageChanged",r),n.logger.log("languageChanged",r)),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(r,e)}))};e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect())},t.prototype.getFixedT=function(e,t){var n=this,r=function e(t,r){for(var o=arguments.length,s=Array(o>2?o-2:0),a=2;a0?this.languages[0]:this.language),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr"},t.prototype.createInstance=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];return new t(e,n)},t.prototype.cloneInstance=function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G,o=W({},this.options,n,{isClone:!0}),s=new t(o),a=["store","services","language"];return a.forEach((function(t){s[t]=e[t]})),s.translator=new k(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?a(e)+t:t}function u(){return!0}function l(e,t,n){return(0===e&&!h(e)||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function c(e,t){return f(e,t,0)}function d(e,t){return f(e,t,t)}function f(e,t,n){return void 0===e?n:h(e)?t===1/0?t:0|Math.max(0,t+e):void 0===t||t===e?e:0|Math.min(t,e)}function h(e){return e<0||0===e&&1/e==-1/0}function p(e){return Boolean(e&&e["@@__IMMUTABLE_ITERABLE__@@"])}function m(e){return Boolean(e&&e["@@__IMMUTABLE_KEYED__@@"])}function g(e){return Boolean(e&&e["@@__IMMUTABLE_INDEXED__@@"])}function b(e){return m(e)||g(e)}var v=function(e){return p(e)?e:M(e)},y=function(e){function t(e){return m(e)?e:U(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(v),w=function(e){function t(e){return g(e)?e:B(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(v),x=function(e){function t(e){return p(e)&&!b(e)?e:z(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(v);v.Keyed=y,v.Indexed=w,v.Set=x;function _(e){return Boolean(e&&e["@@__IMMUTABLE_SEQ__@@"])}function A(e){return Boolean(e&&e["@@__IMMUTABLE_RECORD__@@"])}function C(e){return p(e)||A(e)}var R="@@__IMMUTABLE_ORDERED__@@";function S(e){return Boolean(e&&e[R])}var E="function"==typeof Symbol&&Symbol.iterator,k=E||"@@iterator",j=function(e){this.next=e};function T(e,t,n,r){var o=0===e?t:1===e?n:[t,n];return r?r.value=o:r={value:o,done:!1},r}function q(){return{value:void 0,done:!0}}function P(e){return!!I(e)}function L(e){return e&&"function"==typeof e.next}function O(e){var t=I(e);return t&&t.call(e)}function I(e){var t=e&&(E&&e[E]||e["@@iterator"]);if("function"==typeof t)return t}j.prototype.toString=function(){return"[Iterator]"},j.KEYS=0,j.VALUES=1,j.ENTRIES=2,j.prototype.inspect=j.prototype.toSource=function(){return this.toString()},j.prototype[k]=function(){return this};var N=Object.prototype.hasOwnProperty;function D(e){return!(!Array.isArray(e)&&"string"!=typeof e)||e&&"object"==typeof e&&Number.isInteger(e.length)&&e.length>=0&&(0===e.length?1===Object.keys(e).length:e.hasOwnProperty(e.length-1))}var M=function(e){function t(e){return null==e?J():C(e)?e.toSeq():function(e){var t=V(e);if(t)return t;if("object"==typeof e)return new H(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(e,t){var n=this._cache;if(n){for(var r=n.length,o=0;o!==r;){var s=n[t?r-++o:o++];if(!1===e(s[1],s[0],this))break}return o}return this.__iterateUncached(e,t)},t.prototype.__iterator=function(e,t){var n=this._cache;if(n){var r=n.length,o=0;return new j((function(){if(o===r)return{value:void 0,done:!0};var s=n[t?r-++o:o++];return T(e,s[0],s[1])}))}return this.__iteratorUncached(e,t)},t}(v),U=function(e){function t(e){return null==e?J().toKeyedSeq():p(e)?m(e)?e.toSeq():e.fromEntrySeq():A(e)?e.toSeq():W(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(M),B=function(e){function t(e){return null==e?J():p(e)?m(e)?e.entrySeq():e.toIndexedSeq():A(e)?e.toSeq().entrySeq():Y(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(M),z=function(e){function t(e){return(p(e)&&!b(e)?e:B(e)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(M);M.isSeq=_,M.Keyed=U,M.Set=z,M.Indexed=B,M.prototype["@@__IMMUTABLE_SEQ__@@"]=!0;var F=function(e){function t(e){this._array=e,this.size=e.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return this.has(e)?this._array[i(this,e)]:t},t.prototype.__iterate=function(e,t){for(var n=this._array,r=n.length,o=0;o!==r;){var s=t?r-++o:o++;if(!1===e(n[s],s,this))break}return o},t.prototype.__iterator=function(e,t){var n=this._array,r=n.length,o=0;return new j((function(){if(o===r)return{value:void 0,done:!0};var s=t?r-++o:o++;return T(e,s,n[s])}))},t}(B),H=function(e){function t(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},t.prototype.has=function(e){return N.call(this._object,e)},t.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,o=r.length,s=0;s!==o;){var a=r[t?o-++s:s++];if(!1===e(n[a],a,this))break}return s},t.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,o=r.length,s=0;return new j((function(){if(s===o)return{value:void 0,done:!0};var a=r[t?o-++s:s++];return T(e,a,n[a])}))},t}(U);H.prototype[R]=!0;var Q,$=function(e){function t(e){this._collection=e,this.size=e.length||e.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=O(this._collection),r=0;if(L(n))for(var o;!(o=n.next()).done&&!1!==e(o.value,r++,this););return r},t.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=O(this._collection);if(!L(n))return new j(q);var r=0;return new j((function(){var t=n.next();return t.done?t:T(e,r++,t.value)}))},t}(B);function J(){return Q||(Q=new F([]))}function W(e){var t=Array.isArray(e)?new F(e):P(e)?new $(e):void 0;if(t)return t.fromEntrySeq();if("object"==typeof e)return new H(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Y(e){var t=V(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function V(e){return D(e)?new F(e):P(e)?new $(e):void 0}function K(e){return Boolean(e&&e["@@__IMMUTABLE_MAP__@@"])}function G(e){return K(e)&&S(e)}function X(e){return Boolean(e&&"function"==typeof e.equals&&"function"==typeof e.hashCode)}function Z(e,t){if(e===t||e!=e&&t!=t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if((e=e.valueOf())===(t=t.valueOf())||e!=e&&t!=t)return!0;if(!e||!t)return!1}return!!(X(e)&&X(t)&&e.equals(t))}var ee="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){var n=65535&(e|=0),r=65535&(t|=0);return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0};function te(e){return e>>>1&1073741824|3221225471&e}var ne=Object.prototype.valueOf;function re(e){switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return function(e){if(e!=e||e===1/0)return 0;var t=0|e;t!==e&&(t^=4294967295*e);for(;e>4294967295;)t^=e/=4294967295;return te(t)}(e);case"string":return e.length>de?function(e){var t=pe[e];void 0===t&&(t=oe(e),he===fe&&(he=0,pe={}),he++,pe[e]=t);return t}(e):oe(e);case"object":case"function":return null===e?1108378658:"function"==typeof e.hashCode?te(e.hashCode(e)):(e.valueOf!==ne&&"function"==typeof e.valueOf&&(e=e.valueOf(e)),function(e){var t;if(ue&&void 0!==(t=ie.get(e)))return t;if(void 0!==(t=e[ce]))return t;if(!ae){if(void 0!==(t=e.propertyIsEnumerable&&e.propertyIsEnumerable[ce]))return t;if(void 0!==(t=function(e){if(e&&e.nodeType>0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}(e)))return t}t=++le,1073741824&le&&(le=0);if(ue)ie.set(e,t);else{if(void 0!==se&&!1===se(e))throw new Error("Non-extensible objects are not allowed as keys.");if(ae)Object.defineProperty(e,ce,{enumerable:!1,configurable:!1,writable:!1,value:t});else if(void 0!==e.propertyIsEnumerable&&e.propertyIsEnumerable===e.constructor.prototype.propertyIsEnumerable)e.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},e.propertyIsEnumerable[ce]=t;else{if(void 0===e.nodeType)throw new Error("Unable to set a non-enumerable property on object.");e[ce]=t}}return t}(e));case"undefined":return 1108378659;default:if("function"==typeof e.toString)return oe(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function oe(e){for(var t=0,n=0;n=0&&(h.get=function(t,n){return(t=i(this,t))>=0&&tu)return{value:void 0,done:!0};var e=o.next();return r||1===t||e.done?e:T(t,i-1,0===t?void 0:e.value[1],e)}))},h}function Ce(e,t,n,r){var o=Oe(e);return o.__iterateUncached=function(o,s){var a=this;if(s)return this.cacheResult().__iterate(o,s);var i=!0,u=0;return e.__iterate((function(e,s,l){if(!i||!(i=t.call(n,e,s,l)))return u++,o(e,r?s:u-1,a)})),u},o.__iteratorUncached=function(o,s){var a=this;if(s)return this.cacheResult().__iterator(o,s);var i=e.__iterator(2,s),u=!0,l=0;return new j((function(){var e,s,c;do{if((e=i.next()).done)return r||1===o?e:T(o,l++,0===o?void 0:e.value[1],e);var d=e.value;s=d[0],c=d[1],u&&(u=t.call(n,c,s,a))}while(u);return 2===o?e:T(o,s,c,e)}))},o}function Re(e,t){var n=m(e),r=[e].concat(t).map((function(e){return p(e)?n&&(e=y(e)):e=n?W(e):Y(Array.isArray(e)?e:[e]),e})).filter((function(e){return 0!==e.size}));if(0===r.length)return e;if(1===r.length){var o=r[0];if(o===e||n&&m(o)||g(e)&&g(o))return o}var s=new F(r);return n?s=s.toKeyedSeq():g(e)||(s=s.toSetSeq()),(s=s.flatten(!0)).size=r.reduce((function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}}),0),s}function Se(e,t,n){var r=Oe(e);return r.__iterateUncached=function(o,s){if(s)return this.cacheResult().__iterate(o,s);var a=0,i=!1;return function e(u,l){u.__iterate((function(s,u){return(!t||l0}function Te(e,t,n,r){var o=Oe(e),s=new F(n).map((function(e){return e.size}));return o.size=r?s.max():s.min(),o.__iterate=function(e,t){for(var n,r=this.__iterator(1,t),o=0;!(n=r.next()).done&&!1!==e(n.value,o++,this););return o},o.__iteratorUncached=function(e,o){var s=n.map((function(e){return e=v(e),O(o?e.reverse():e)})),a=0,i=!1;return new j((function(){var n;return i||(n=s.map((function(e){return e.next()})),i=r?n.every((function(e){return e.done})):n.some((function(e){return e.done}))),i?{value:void 0,done:!0}:T(e,a++,t.apply(null,n.map((function(e){return e.value}))))}))},o}function qe(e,t){return e===t?e:_(e)?t:e.constructor(t)}function Pe(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Le(e){return m(e)?y:g(e)?w:x}function Oe(e){return Object.create((m(e)?U:g(e)?B:z).prototype)}function Ie(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):M.prototype.cacheResult.call(this)}function Ne(e,t){return void 0===e&&void 0===t?0:void 0===e?1:void 0===t?-1:e>t?1:e0;)t[n]=arguments[n+1];if("function"!=typeof e)throw new TypeError("Invalid merger function: "+e);return st(this,t,e)}function st(e,t,n){for(var o=[],s=0;s0;)t[n]=arguments[n+1];return at(this,t,e)}function ct(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ve(this,e,kt(),(function(e){return it(e,t)}))}function dt(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return Ve(this,e,kt(),(function(e){return at(e,t)}))}function ft(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function ht(){return this.__ownerID?this:this.__ensureOwner(new s)}function pt(){return this.__ensureOwner()}function mt(){return this.__altered}ge.prototype.cacheResult=me.prototype.cacheResult=be.prototype.cacheResult=ve.prototype.cacheResult=Ie;var gt=function(e){function t(t){return null==t?kt():K(t)&&!S(t)?t:kt().withMutations((function(n){var r=e(t);Ue(r.size),r.forEach((function(e,t){return n.set(t,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return kt().withMutations((function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}}))},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},t.prototype.set=function(e,t){return jt(this,e,t)},t.prototype.remove=function(e){return jt(this,e,r)},t.prototype.deleteAll=function(e){var t=v(e);return 0===t.size?this:this.withMutations((function(e){t.forEach((function(t){return e.remove(t)}))}))},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):kt()},t.prototype.sort=function(e){return Zt(Ee(this,e))},t.prototype.sortBy=function(e,t){return Zt(Ee(this,t,e))},t.prototype.map=function(e,t){return this.withMutations((function(n){n.forEach((function(r,o){n.set(o,e.call(t,r,o,n))}))}))},t.prototype.__iterator=function(e,t){return new Ct(this,e,t)},t.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate((function(t){return r++,e(t[1],t[0],n)}),t),r},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Et(this.size,this._root,e,this.__hash):0===this.size?kt():(this.__ownerID=e,this.__altered=!1,this)},t}(y);gt.isMap=K;var bt=gt.prototype;bt["@@__IMMUTABLE_MAP__@@"]=!0,bt.delete=bt.remove,bt.removeAll=bt.deleteAll,bt.setIn=Ge,bt.removeIn=bt.deleteIn=Ze,bt.update=tt,bt.updateIn=nt,bt.merge=bt.concat=rt,bt.mergeWith=ot,bt.mergeDeep=ut,bt.mergeDeepWith=lt,bt.mergeIn=ct,bt.mergeDeepIn=dt,bt.withMutations=ft,bt.wasAltered=mt,bt.asImmutable=pt,bt["@@transducer/init"]=bt.asMutable=ht,bt["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])},bt["@@transducer/result"]=function(e){return e.asImmutable()};var vt=function(e,t){this.ownerID=e,this.entries=t};vt.prototype.get=function(e,t,n,r){for(var o=this.entries,s=0,a=o.length;s=It)return function(e,t,n,r){e||(e=new s);for(var o=new _t(e,re(n),[n,r]),a=0;a>>e)),s=this.bitmap;return 0==(s&o)?r:this.nodes[Lt(s&o-1)].get(e+5,t,n,r)},yt.prototype.update=function(e,t,n,o,s,a,i){void 0===n&&(n=re(o));var u=31&(0===t?n:n>>>t),l=1<=Nt)return function(e,t,n,r,o){for(var s=0,a=new Array(32),i=0;0!==n;i++,n>>>=1)a[i]=1&n?t[s++]:void 0;return a[r]=o,new wt(e,s+1,a)}(e,h,c,u,m);if(d&&!m&&2===h.length&&qt(h[1^f]))return h[1^f];if(d&&m&&1===h.length&&qt(m))return m;var g=e&&e===this.ownerID,b=d?m?c:c^l:c|l,v=d?m?Ot(h,f,m,g):function(e,t,n){var r=e.length-1;if(n&&t===r)return e.pop(),e;for(var o=new Array(r),s=0,a=0;a>>e),s=this.nodes[o];return s?s.get(e+5,t,n,r):r},wt.prototype.update=function(e,t,n,o,s,a,i){void 0===n&&(n=re(o));var u=31&(0===t?n:n>>>t),l=s===r,c=this.nodes,d=c[u];if(l&&!d)return this;var f=Tt(d,e,t+5,n,o,s,a,i);if(f===d)return this;var h=this.count;if(d){if(!f&&--h>>n),i=31&(0===n?r:r>>>n),u=a===i?[Pt(e,t,n+5,r,o)]:(s=new _t(t,r,o),a>1&1431655765))+(e>>2&858993459))+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function Ot(e,t,n,r){var o=r?e:De(e);return o[t]=n,o}var It=8,Nt=16,Dt=8;function Mt(e){return Boolean(e&&e["@@__IMMUTABLE_LIST__@@"])}var Ut=function(e){function t(t){var n=Jt();if(null==t)return n;if(Mt(t))return t;var r=e(t),o=r.size;return 0===o?n:(Ue(o),o>0&&o<32?$t(0,o,5,null,new zt(r.toArray())):n.withMutations((function(e){e.setSize(o),r.forEach((function(t,n){return e.set(n,t)}))})))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("List [","]")},t.prototype.get=function(e,t){if((e=i(this,e))>=0&&e=e.size||t<0)return e.withMutations((function(e){t<0?Kt(e,t).set(0,n):Kt(e,0,t+1).set(t,n)}));t+=e._origin;var r=e._tail,o=e._root,s={value:!1};t>=Gt(e._capacity)?r=Wt(r,e.__ownerID,0,t,n,s):o=Wt(o,e.__ownerID,e._level,t,n,s);if(!s.value)return e;if(e.__ownerID)return e._root=o,e._tail=r,e.__hash=void 0,e.__altered=!0,e;return $t(e._origin,e._capacity,e._level,o,r)}(this,e,t)},t.prototype.remove=function(e){return this.has(e)?0===e?this.shift():e===this.size-1?this.pop():this.splice(e,1):this},t.prototype.insert=function(e,t){return this.splice(e,0,t)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=5,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Jt()},t.prototype.push=function(){var e=arguments,t=this.size;return this.withMutations((function(n){Kt(n,0,t+e.length);for(var r=0;r>>t&31;if(r>=this.array.length)return new zt([],e);var o,s=0===r;if(t>0){var a=this.array[r];if((o=a&&a.removeBefore(e,t-5,n))===a&&s)return this}if(s&&!o)return this;var i=Yt(this,e);if(!s)for(var u=0;u>>t&31;if(o>=this.array.length)return this;if(t>0){var s=this.array[o];if((r=s&&s.removeAfter(e,t-5,n))===s&&o===this.array.length-1)return this}var a=Yt(this,e);return a.array.splice(o+1),r&&(a.array[o]=r),a};var Ft,Ht={};function Qt(e,t){var n=e._origin,r=e._capacity,o=Gt(r),s=e._tail;return a(e._root,e._level,0);function a(e,i,u){return 0===i?function(e,a){var i=a===o?s&&s.array:e&&e.array,u=a>n?0:n-a,l=r-a;l>32&&(l=32);return function(){if(u===l)return Ht;var e=t?--l:u++;return i&&i[e]}}(e,u):function(e,o,s){var i,u=e&&e.array,l=s>n?0:n-s>>o,c=1+(r-s>>o);c>32&&(c=32);return function(){for(;;){if(i){var e=i();if(e!==Ht)return e;i=null}if(l===c)return Ht;var n=t?--c:l++;i=a(u&&u[n],o-5,s+(n<>>n&31,l=e&&u0){var c=e&&e.array[u],d=Wt(c,t,n-5,r,s,a);return d===c?e:((i=Yt(e,t)).array[u]=d,i)}return l&&e.array[u]===s?e:(a&&o(a),i=Yt(e,t),void 0===s&&u===i.array.length-1?i.array.pop():i.array[u]=s,i)}function Yt(e,t){return t&&e&&t===e.ownerID?e:new zt(e?e.array.slice():[],t)}function Vt(e,t){if(t>=Gt(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&31],r-=5;return n}}function Kt(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new s,o=e._origin,a=e._capacity,i=o+t,u=void 0===n?a:n<0?a+n:o+n;if(i===o&&u===a)return e;if(i>=u)return e.clear();for(var l=e._level,c=e._root,d=0;i+d<0;)c=new zt(c&&c.array.length?[void 0,c]:[],r),d+=1<<(l+=5);d&&(i+=d,o+=d,u+=d,a+=d);for(var f=Gt(a),h=Gt(u);h>=1<f?new zt([],r):p;if(p&&h>f&&i5;b-=5){var v=f>>>b&31;g=g.array[v]=Yt(g.array[v],r)}g.array[f>>>5&31]=p}if(u=h)i-=h,u-=h,l=5,c=null,m=m&&m.removeBefore(r,0,i);else if(i>o||h>>l&31;if(y!==h>>>l&31)break;y&&(d+=(1<o&&(c=c.removeBefore(r,l,i-d)),c&&h>>5<<5}var Xt,Zt=function(e){function t(e){return null==e?tn():G(e)?e:tn().withMutations((function(t){var n=y(e);Ue(n.size),n.forEach((function(e,n){return t.set(n,e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("OrderedMap {","}")},t.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tn()},t.prototype.set=function(e,t){return nn(this,e,t)},t.prototype.remove=function(e){return nn(this,e,r)},t.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},t.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate((function(t){return t&&e(t[1],t[0],n)}),t)},t.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},t.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?en(t,n,e,this.__hash):0===this.size?tn():(this.__ownerID=e,this._map=t,this._list=n,this)},t}(gt);function en(e,t,n,r){var o=Object.create(Zt.prototype);return o.size=e?e.size:0,o._map=e,o._list=t,o.__ownerID=n,o.__hash=r,o}function tn(){return Xt||(Xt=en(kt(),Jt()))}function nn(e,t,n){var o,s,a=e._map,i=e._list,u=a.get(t),l=void 0!==u;if(n===r){if(!l)return e;i.size>=32&&i.size>=2*a.size?(o=(s=i.filter((function(e,t){return void 0!==e&&u!==t}))).toKeyedSeq().map((function(e){return e[0]})).flip().toMap(),e.__ownerID&&(o.__ownerID=s.__ownerID=e.__ownerID)):(o=a.remove(t),s=u===i.size-1?i.pop():i.set(u,void 0))}else if(l){if(n===i.get(u)[1])return e;o=a,s=i.set(u,[t,n])}else o=a.set(t,i.size),s=i.set(i.size,[t,n]);return e.__ownerID?(e.size=o.size,e._map=o,e._list=s,e.__hash=void 0,e):en(o,s)}Zt.isOrderedMap=G,Zt.prototype[R]=!0,Zt.prototype.delete=Zt.prototype.remove;function rn(e){return Boolean(e&&e["@@__IMMUTABLE_STACK__@@"])}var on=function(e){function t(e){return null==e?ln():rn(e)?e:ln().pushAll(e)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(e,t){var n=this._head;for(e=i(this,e);n&&e--;)n=n.next;return n?n.value:t},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var e=arguments;if(0===arguments.length)return this;for(var t=this.size+arguments.length,n=this._head,r=arguments.length-1;r>=0;r--)n={value:e[r],next:n};return this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):un(t,n)},t.prototype.pushAll=function(t){if(0===(t=e(t)).size)return this;if(0===this.size&&rn(t))return t;Ue(t.size);var n=this.size,r=this._head;return t.__iterate((function(e){n++,r={value:e,next:r}}),!0),this.__ownerID?(this.size=n,this._head=r,this.__hash=void 0,this.__altered=!0,this):un(n,r)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ln()},t.prototype.slice=function(t,n){if(l(t,n,this.size))return this;var r=c(t,this.size);if(d(n,this.size)!==this.size)return e.prototype.slice.call(this,t,n);for(var o=this.size-r,s=this._head;r--;)s=s.next;return this.__ownerID?(this.size=o,this._head=s,this.__hash=void 0,this.__altered=!0,this):un(o,s)},t.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?un(this.size,this._head,e,this.__hash):0===this.size?ln():(this.__ownerID=e,this.__altered=!1,this)},t.prototype.__iterate=function(e,t){var n=this;if(t)return new F(this.toArray()).__iterate((function(t,r){return e(t,r,n)}),t);for(var r=0,o=this._head;o&&!1!==e(o.value,r++,this);)o=o.next;return r},t.prototype.__iterator=function(e,t){if(t)return new F(this.toArray()).__iterator(e,t);var n=0,r=this._head;return new j((function(){if(r){var t=r.value;return r=r.next,T(e,n++,t)}return{value:void 0,done:!0}}))},t}(w);on.isStack=rn;var sn,an=on.prototype;function un(e,t,n,r){var o=Object.create(an);return o.size=e,o._head=t,o.__ownerID=n,o.__hash=r,o.__altered=!1,o}function ln(){return sn||(sn=un(0))}an["@@__IMMUTABLE_STACK__@@"]=!0,an.shift=an.pop,an.unshift=an.push,an.unshiftAll=an.pushAll,an.withMutations=ft,an.wasAltered=mt,an.asImmutable=pt,an["@@transducer/init"]=an.asMutable=ht,an["@@transducer/step"]=function(e,t){return e.unshift(t)},an["@@transducer/result"]=function(e){return e.asImmutable()};function cn(e){return Boolean(e&&e["@@__IMMUTABLE_SET__@@"])}function dn(e){return cn(e)&&S(e)}function fn(e,t){if(e===t)return!0;if(!p(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||m(e)!==m(t)||g(e)!==g(t)||S(e)!==S(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!b(e);if(S(e)){var o=e.entries();return t.every((function(e,t){var r=o.next().value;return r&&Z(r[1],e)&&(n||Z(r[0],t))}))&&o.next().done}var s=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{s=!0;var a=e;e=t,t=a}var i=!0,u=t.__iterate((function(t,o){if(n?!e.has(t):s?!Z(t,e.get(o,r)):!Z(e.get(o,r),t))return i=!1,!1}));return i&&e.size===u}function hn(e,t){var n=function(n){e.prototype[n]=t[n]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function pn(e){if(!e||"object"!=typeof e)return e;if(!p(e)){if(!Fe(e))return e;e=M(e)}if(m(e)){var t={};return e.__iterate((function(e,n){t[n]=pn(e)})),t}var n=[];return e.__iterate((function(e){n.push(pn(e))})),n}var mn=function(e){function t(t){return null==t?wn():cn(t)&&!S(t)?t:wn().withMutations((function(n){var r=e(t);Ue(r.size),r.forEach((function(e){return n.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(y(e).keySeq())},t.intersect=function(e){return(e=v(e).toArray()).length?bn.intersect.apply(t(e.pop()),e):wn()},t.union=function(e){return(e=v(e).toArray()).length?bn.union.apply(t(e.pop()),e):wn()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(e){return this._map.has(e)},t.prototype.add=function(e){return vn(this,this._map.set(e,e))},t.prototype.remove=function(e){return vn(this,this._map.remove(e))},t.prototype.clear=function(){return vn(this,this._map.clear())},t.prototype.map=function(e,t){var n=this,r=[],o=[];return this.forEach((function(s){var a=e.call(t,s,s,n);a!==s&&(r.push(s),o.push(a))})),this.withMutations((function(e){r.forEach((function(t){return e.remove(t)})),o.forEach((function(t){return e.add(t)}))}))},t.prototype.union=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return 0===(t=t.filter((function(e){return 0!==e.size}))).length?this:0!==this.size||this.__ownerID||1!==t.length?this.withMutations((function(n){for(var r=0;r=0&&t=0&&n>>-15,461845907),t=ee(t<<13|t>>>-13,5),t=ee((t=(t+3864292196|0)^e)^t>>>16,2246822507),t=te((t=ee(t^t>>>13,3266489909))^t>>>16)}(e.__iterate(n?t?function(e,t){r=31*r+Dn(re(e),re(t))|0}:function(e,t){r=r+Dn(re(e),re(t))|0}:t?function(e){r=31*r+re(e)|0}:function(e){r=r+re(e)|0}),r)}(this))}});var En=v.prototype;En["@@__IMMUTABLE_ITERABLE__@@"]=!0,En[k]=En.values,En.toJSON=En.toArray,En.__toStringMapper=He,En.inspect=En.toSource=function(){return this.toString()},En.chain=En.flatMap,En.contains=En.includes,hn(y,{flip:function(){return qe(this,ye(this))},mapEntries:function(e,t){var n=this,r=0;return qe(this,this.toSeq().map((function(o,s){return e.call(t,[s,o],r++,n)})).fromEntrySeq())},mapKeys:function(e,t){var n=this;return qe(this,this.toSeq().flip().map((function(r,o){return e.call(t,r,o,n)})).flip())}});var kn=y.prototype;kn["@@__IMMUTABLE_KEYED__@@"]=!0,kn[k]=En.entries,kn.toJSON=Sn,kn.__toStringMapper=function(e,t){return He(t)+": "+He(e)},hn(w,{toKeyedSeq:function(){return new me(this,!1)},filter:function(e,t){return qe(this,_e(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return qe(this,xe(this,!1))},slice:function(e,t){return qe(this,Ae(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(t||0,0),0===n||2===n&&!t)return this;e=c(e,e<0?this.count():this.size);var r=this.slice(0,e);return qe(this,1===n?r:r.concat(De(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(e){return this.get(0,e)},flatten:function(e){return qe(this,Se(this,e,!1))},get:function(e,t){return(e=i(this,e))<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find((function(t,n){return n===e}),void 0,t)},has:function(e){return(e=i(this,e))>=0&&(void 0!==this.size?this.size===1/0||et?-1:0}function Dn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}jn["@@__IMMUTABLE_INDEXED__@@"]=!0,jn[R]=!0,hn(x,{get:function(e,t){return this.has(e)?e:t},includes:function(e){return this.has(e)},keySeq:function(){return this.valueSeq()}}),x.prototype.has=En.includes,x.prototype.contains=x.prototype.includes,hn(U,y.prototype),hn(B,w.prototype),hn(z,x.prototype);var Mn=function(e){function t(e){return null==e?Fn():dn(e)?e:Fn().withMutations((function(t){var n=x(e);Ue(n.size),n.forEach((function(e){return t.add(e)}))}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(e){return this(y(e).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(mn);Mn.isOrderedSet=dn;var Un,Bn=Mn.prototype;function zn(e,t){var n=Object.create(Bn);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}function Fn(){return Un||(Un=zn(tn()))}Bn[R]=!0,Bn.zip=jn.zip,Bn.zipWith=jn.zipWith,Bn.__empty=Fn,Bn.__make=zn;var Hn=function(e,t){var n,r=function(s){var a=this;if(s instanceof r)return s;if(!(this instanceof r))return new r(s);if(!n){n=!0;var i=Object.keys(e),u=o._indices={};o._name=t,o._keys=i,o._defaultValues=e;for(var l=0;l+~]|"+D+")"+D+"*"),$=new RegExp(D+"|>"),J=new RegExp(U),W=new RegExp("^"+M+"$"),Y={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M+"|[*])"),ATTR:new RegExp("^"+B),PSEUDO:new RegExp("^"+U),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},V=/HTML$/i,K=/^(?:input|select|textarea|button)$/i,G=/^h\d$/i,X=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,oe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},se=function(){f()},ae=we((function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{L.apply(T=O.call(x.childNodes),x.childNodes),T[x.childNodes.length].nodeType}catch(e){L={apply:T.length?function(e,t){P.apply(e,O.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function ie(e,t,r,o){var s,i,l,c,d,p,b,v=t&&t.ownerDocument,x=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==x&&9!==x&&11!==x)return r;if(!o&&(f(t),t=t||h,m)){if(11!==x&&(d=Z.exec(e)))if(s=d[1]){if(9===x){if(!(l=t.getElementById(s)))return r;if(l.id===s)return r.push(l),r}else if(v&&(l=v.getElementById(s))&&y(t,l)&&l.id===s)return r.push(l),r}else{if(d[2])return L.apply(r,t.getElementsByTagName(e)),r;if((s=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(s)),r}if(n.qsa&&!E[e+" "]&&(!g||!g.test(e))&&(1!==x||"object"!==t.nodeName.toLowerCase())){if(b=e,v=t,1===x&&($.test(e)||Q.test(e))){for((v=ee.test(e)&&be(t.parentNode)||t)===t&&n.scope||((c=t.getAttribute("id"))?c=c.replace(re,oe):t.setAttribute("id",c=w)),i=(p=a(e)).length;i--;)p[i]=(c?"#"+c:":scope")+" "+ye(p[i]);b=p.join(",")}try{return L.apply(r,v.querySelectorAll(b)),r}catch(t){E(e,!0)}finally{c===w&&t.removeAttribute("id")}}}return u(e.replace(F,"$1"),t,r,o)}function ue(){var e=[];return function t(n,o){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=o}}function le(e){return e[w]=!0,e}function ce(e){var t=h.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function de(e,t){for(var n=e.split("|"),o=n.length;o--;)r.attrHandle[n[o]]=t}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function he(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function me(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ae(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ge(e){return le((function(t){return t=+t,le((function(n,r){for(var o,s=e([],n.length,t),a=s.length;a--;)n[o=s[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function be(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in n=ie.support={},s=ie.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!V.test(t||n&&n.nodeName||"HTML")},f=ie.setDocument=function(e){var t,o,a=e?e.ownerDocument||e:x;return a!=h&&9===a.nodeType&&a.documentElement?(p=(h=a).documentElement,m=!s(h),x!=h&&(o=h.defaultView)&&o.top!==o&&(o.addEventListener?o.addEventListener("unload",se,!1):o.attachEvent&&o.attachEvent("onunload",se)),n.scope=ce((function(e){return p.appendChild(e).appendChild(h.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length})),n.attributes=ce((function(e){return e.className="i",!e.getAttribute("className")})),n.getElementsByTagName=ce((function(e){return e.appendChild(h.createComment("")),!e.getElementsByTagName("*").length})),n.getElementsByClassName=X.test(h.getElementsByClassName),n.getById=ce((function(e){return p.appendChild(e).id=w,!h.getElementsByName||!h.getElementsByName(w).length})),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var n,r,o,s=t.getElementById(e);if(s){if((n=s.getAttributeNode("id"))&&n.value===e)return[s];for(o=t.getElementsByName(e),r=0;s=o[r++];)if((n=s.getAttributeNode("id"))&&n.value===e)return[s]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],o=0,s=t.getElementsByTagName(e);if("*"===e){for(;n=s[o++];)1===n.nodeType&&r.push(n);return r}return s},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},b=[],g=[],(n.qsa=X.test(h.querySelectorAll))&&(ce((function(e){var t;p.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+D+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||g.push("\\["+D+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+w+"-]").length||g.push("~="),(t=h.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||g.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||g.push(":checked"),e.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]"),e.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),ce((function(e){e.innerHTML="";var t=h.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&g.push("name"+D+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=X.test(v=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ce((function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),b.push("!=",U)})),g=g.length&&new RegExp(g.join("|")),b=b.length&&new RegExp(b.join("|")),t=X.test(p.compareDocumentPosition),y=t||X.test(p.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},k=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==h||e.ownerDocument==x&&y(x,e)?-1:t==h||t.ownerDocument==x&&y(x,t)?1:c?I(c,e)-I(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,o=e.parentNode,s=t.parentNode,a=[e],i=[t];if(!o||!s)return e==h?-1:t==h?1:o?-1:s?1:c?I(c,e)-I(c,t):0;if(o===s)return fe(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)i.unshift(n);for(;a[r]===i[r];)r++;return r?fe(a[r],i[r]):a[r]==x?-1:i[r]==x?1:0},h):h},ie.matches=function(e,t){return ie(e,null,null,t)},ie.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&m&&!E[t+" "]&&(!b||!b.test(t))&&(!g||!g.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){E(t,!0)}return ie(t,h,null,[e]).length>0},ie.contains=function(e,t){return(e.ownerDocument||e)!=h&&f(e),y(e,t)},ie.attr=function(e,t){(e.ownerDocument||e)!=h&&f(e);var o=r.attrHandle[t.toLowerCase()],s=o&&j.call(r.attrHandle,t.toLowerCase())?o(e,t,!m):void 0;return void 0!==s?s:n.attributes||!m?e.getAttribute(t):(s=e.getAttributeNode(t))&&s.specified?s.value:null},ie.escape=function(e){return(e+"").replace(re,oe)},ie.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ie.uniqueSort=function(e){var t,r=[],o=0,s=0;if(d=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(k),d){for(;t=e[s++];)t===e[s]&&(o=r.push(s));for(;o--;)e.splice(r[o],1)}return c=null,e},o=ie.getText=function(e){var t,n="",r=0,s=e.nodeType;if(s){if(1===s||9===s||11===s){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===s||4===s)return e.nodeValue}else for(;t=e[r++];)n+=o(t);return n},(r=ie.selectors={cacheLength:50,createPseudo:le,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ie.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ie.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return Y.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&J.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=new RegExp("(^|"+D+")"+e+"("+D+"|$)"))&&C(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=ie.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(z," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var s="nth"!==e.slice(0,3),a="last"!==e.slice(-4),i="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,u){var l,c,d,f,h,p,m=s!==a?"nextSibling":"previousSibling",g=t.parentNode,b=i&&t.nodeName.toLowerCase(),v=!u&&!i,y=!1;if(g){if(s){for(;m;){for(f=t;f=f[m];)if(i?f.nodeName.toLowerCase()===b:1===f.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&v){for(y=(h=(l=(c=(d=(f=g)[w]||(f[w]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===_&&l[1])&&l[2],f=h&&g.childNodes[h];f=++h&&f&&f[m]||(y=h=0)||p.pop();)if(1===f.nodeType&&++y&&f===t){c[e]=[_,h,y];break}}else if(v&&(y=h=(l=(c=(d=(f=t)[w]||(f[w]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===_&&l[1]),!1===y)for(;(f=++h&&f&&f[m]||(y=h=0)||p.pop())&&((i?f.nodeName.toLowerCase()!==b:1!==f.nodeType)||!++y||(v&&((c=(d=f[w]||(f[w]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[_,y]),f!==t)););return(y-=o)===r||y%r==0&&y/r>=0}}},PSEUDO:function(e,t){var n,o=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ie.error("unsupported pseudo: "+e);return o[w]?o(t):o.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?le((function(e,n){for(var r,s=o(e,t),a=s.length;a--;)e[r=I(e,s[a])]=!(n[r]=s[a])})):function(e){return o(e,0,n)}):o}},pseudos:{not:le((function(e){var t=[],n=[],r=i(e.replace(F,"$1"));return r[w]?le((function(e,t,n,o){for(var s,a=r(e,null,o,[]),i=e.length;i--;)(s=a[i])&&(e[i]=!(t[i]=s))})):function(e,o,s){return t[0]=e,r(t,null,s,n),t[0]=null,!n.pop()}})),has:le((function(e){return function(t){return ie(e,t).length>0}})),contains:le((function(e){return e=e.replace(te,ne),function(t){return(t.textContent||o(t)).indexOf(e)>-1}})),lang:le((function(e){return W.test(e||"")||ie.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===p},focus:function(e){return e===h.activeElement&&(!h.hasFocus||h.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:me(!1),disabled:me(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return G.test(e.nodeName)},input:function(e){return K.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ge((function(){return[0]})),last:ge((function(e,t){return[t-1]})),eq:ge((function(e,t,n){return[n<0?n+t:n]})),even:ge((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ge((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function _e(e,t,n,r,o){for(var s,a=[],i=0,u=e.length,l=null!=t;i-1&&(s[l]=!(a[l]=d))}}else b=_e(b===a?b.splice(p,b.length):b),o?o(null,a,b,u):L.apply(a,b)}))}function Ce(e){for(var t,n,o,s=e.length,a=r.relative[e[0].type],i=a||r.relative[" "],u=a?1:0,c=we((function(e){return e===t}),i,!0),d=we((function(e){return I(t,e)>-1}),i,!0),f=[function(e,n,r){var o=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):d(e,n,r));return t=null,o}];u1&&xe(f),u>1&&ye(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(F,"$1"),n,u0,o=e.length>0,s=function(s,a,i,u,c){var d,p,g,b=0,v="0",y=s&&[],w=[],x=l,A=s||o&&r.find.TAG("*",c),C=_+=null==x?1:Math.random()||.1,R=A.length;for(c&&(l=a==h||a||c);v!==R&&null!=(d=A[v]);v++){if(o&&d){for(p=0,a||d.ownerDocument==h||(f(d),i=!m);g=e[p++];)if(g(d,a||h,i)){u.push(d);break}c&&(_=C)}n&&((d=!g&&d)&&b--,s&&y.push(d))}if(b+=v,n&&v!==b){for(p=0;g=t[p++];)g(y,w,a,i);if(s){if(b>0)for(;v--;)y[v]||w[v]||(w[v]=q.call(u));w=_e(w)}L.apply(u,w),c&&!s&&w.length>0&&b+t.length>1&&ie.uniqueSort(u)}return c&&(_=C,l=x),y};return n?le(s):s}(s,o))).selector=e}return i},u=ie.select=function(e,t,n,o){var s,u,l,c,d,f="function"==typeof e&&e,h=!o&&a(e=f.selector||e);if(n=n||[],1===h.length){if((u=h[0]=h[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&m&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(u.shift().value.length)}for(s=Y.needsContext.test(e)?0:u.length;s--&&(l=u[s],!r.relative[c=l.type]);)if((d=r.find[c])&&(o=d(l.matches[0].replace(te,ne),ee.test(u[0].type)&&be(t.parentNode)||t))){if(u.splice(s,1),!(e=o.length&&ye(u)))return L.apply(n,o),n;break}}return(f||i(e,h))(o,t,!m,n,!t||ee.test(e)&&be(t.parentNode)||t),n},n.sortStable=w.split("").sort(k).join("")===w,n.detectDuplicates=!!d,f(),n.sortDetached=ce((function(e){return 1&e.compareDocumentPosition(h.createElement("fieldset"))})),ce((function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")}))||de("type|href|height|width",(function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)})),n.attributes&&ce((function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")}))||de("value",(function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue})),ce((function(e){return null==e.getAttribute("disabled")}))||de(N,(function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null})),ie}(n);A.find=R,A.expr=R.selectors,A.expr[":"]=A.expr.pseudos,A.uniqueSort=A.unique=R.uniqueSort,A.text=R.getText,A.isXMLDoc=R.isXML,A.contains=R.contains,A.escapeSelector=R.escape;var S=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&A(e).is(n))break;r.push(e)}return r},E=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=A.expr.match.needsContext;function j(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var T=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function q(e,t,n){return b(t)?A.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?A.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?A.grep(e,(function(e){return c.call(t,e)>-1!==n})):A.filter(t,e,n)}A.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?A.find.matchesSelector(r,e)?[r]:[]:A.find.matches(e,A.grep(t,(function(e){return 1===e.nodeType})))},A.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(A(e).filter((function(){for(t=0;t1?A.uniqueSort(n):n},filter:function(e){return this.pushStack(q(this,e||[],!1))},not:function(e){return this.pushStack(q(this,e||[],!0))},is:function(e){return!!q(this,"string"==typeof e&&k.test(e)?A(e):e||[],!1).length}});var P,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(A.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||P,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof A?t[0]:t,A.merge(this,A.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:y,!0)),T.test(r[1])&&A.isPlainObject(t))for(r in t)b(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=y.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):b(e)?void 0!==n.ready?n.ready(e):e(A):A.makeArray(e,this)}).prototype=A.fn,P=A(y);var O=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};function N(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}A.fn.extend({has:function(e){var t=A(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&A.find.matchesSelector(n,e))){s.push(n);break}return this.pushStack(s.length>1?A.uniqueSort(s):s)},index:function(e){return e?"string"==typeof e?c.call(A(e),this[0]):c.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(A.uniqueSort(A.merge(this.get(),A(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),A.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return S(e,"parentNode")},parentsUntil:function(e,t,n){return S(e,"parentNode",n)},next:function(e){return N(e,"nextSibling")},prev:function(e){return N(e,"previousSibling")},nextAll:function(e){return S(e,"nextSibling")},prevAll:function(e){return S(e,"previousSibling")},nextUntil:function(e,t,n){return S(e,"nextSibling",n)},prevUntil:function(e,t,n){return S(e,"previousSibling",n)},siblings:function(e){return E((e.parentNode||{}).firstChild,e)},children:function(e){return E(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(j(e,"template")&&(e=e.content||e),A.merge([],e.childNodes))}},(function(e,t){A.fn[e]=function(n,r){var o=A.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=A.filter(r,o)),this.length>1&&(I[e]||A.uniqueSort(o),O.test(e)&&o.reverse()),this.pushStack(o)}}));var D=/[^\x20\t\r\n\f]+/g;function M(e){return e}function B(e){throw e}function U(e,t,n,r){var o;try{e&&b(o=e.promise)?o.call(e).done(t).fail(n):e&&b(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}A.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return A.each(e.match(D)||[],(function(e,n){t[n]=!0})),t}(e):A.extend({},e);var t,n,r,o,s=[],a=[],i=-1,u=function(){for(o=o||e.once,r=t=!0;a.length;i=-1)for(n=a.shift();++i-1;)s.splice(n,1),n<=i&&i--})),this},has:function(e){return e?A.inArray(e,s)>-1:s.length>0},empty:function(){return s&&(s=[]),this},disable:function(){return o=a=[],s=n="",this},disabled:function(){return!s},lock:function(){return o=a=[],n||t||(s=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},A.extend({Deferred:function(e){var t=[["notify","progress",A.Callbacks("memory"),A.Callbacks("memory"),2],["resolve","done",A.Callbacks("once memory"),A.Callbacks("once memory"),0,"resolved"],["reject","fail",A.Callbacks("once memory"),A.Callbacks("once memory"),1,"rejected"]],r="pending",o={state:function(){return r},always:function(){return s.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return A.Deferred((function(n){A.each(t,(function(t,r){var o=b(e[r[4]])&&e[r[4]];s[r[1]]((function(){var e=o&&o.apply(this,arguments);e&&b(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)}))})),e=null})).promise()},then:function(e,r,o){var s=0;function a(e,t,r,o){return function(){var i=this,u=arguments,l=function(){var n,l;if(!(e=s&&(r!==B&&(i=void 0,u=[n]),t.rejectWith(i,u))}};e?c():(A.Deferred.getStackHook&&(c.stackTrace=A.Deferred.getStackHook()),n.setTimeout(c))}}return A.Deferred((function(n){t[0][3].add(a(0,n,b(o)?o:M,n.notifyWith)),t[1][3].add(a(0,n,b(e)?e:M)),t[2][3].add(a(0,n,b(r)?r:B))})).promise()},promise:function(e){return null!=e?A.extend(e,o):o}},s={};return A.each(t,(function(e,n){var a=n[2],i=n[5];o[n[1]]=a.add,i&&a.add((function(){r=i}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(n[3].fire),s[n[0]]=function(){return s[n[0]+"With"](this===s?void 0:this,arguments),this},s[n[0]+"With"]=a.fireWith})),o.promise(s),e&&e.call(s,s),s},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),s=A.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||s.resolveWith(r,o)}};if(t<=1&&(U(e,s.done(a(n)).resolve,s.reject,!t),"pending"===s.state()||b(o[n]&&o[n].then)))return s.then();for(;n--;)U(o[n],a(n),s.reject);return s.promise()}});var z=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;A.Deferred.exceptionHook=function(e,t){n.console&&n.console.warn&&e&&z.test(e.name)&&n.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},A.readyException=function(e){n.setTimeout((function(){throw e}))};var F=A.Deferred();function H(){y.removeEventListener("DOMContentLoaded",H),n.removeEventListener("load",H),A.ready()}A.fn.ready=function(e){return F.then(e).catch((function(e){A.readyException(e)})),this},A.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--A.readyWait:A.isReady)||(A.isReady=!0,!0!==e&&--A.readyWait>0||F.resolveWith(y,[A]))}}),A.ready.then=F.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(A.ready):(y.addEventListener("DOMContentLoaded",H),n.addEventListener("load",H));var Q=function(e,t,n,r,o,s,a){var i=0,u=e.length,l=null==n;if("object"===_(n))for(i in o=!0,n)Q(e,t,i,n[i],!0,s,a);else if(void 0!==r&&(o=!0,b(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(A(e),n)})),t))for(;i1,null,!0)},removeData:function(e){return this.each((function(){X.remove(this,e)}))}}),A.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=G.get(e,t),n&&(!r||Array.isArray(n)?r=G.access(e,t,A.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=A.queue(e,t),r=n.length,o=n.shift(),s=A._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete s.stop,o.call(e,(function(){A.dequeue(e,t)}),s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return G.get(e,n)||G.access(e,n,{empty:A.Callbacks("once memory").add((function(){G.remove(e,[t+"queue",n])}))})}}),A.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,be=/^$|^module$|\/(?:java|ecma)script/i;he=y.createDocumentFragment().appendChild(y.createElement("div")),(pe=y.createElement("input")).setAttribute("type","radio"),pe.setAttribute("checked","checked"),pe.setAttribute("name","t"),he.appendChild(pe),g.checkClone=he.cloneNode(!0).cloneNode(!0).lastChild.checked,he.innerHTML="",g.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue,he.innerHTML="",g.option=!!he.lastChild;var ve={thead:[1,"","
              "],col:[2,"","
              "],tr:[2,"","
              "],td:[3,"","
              "],_default:[0,"",""]};function ye(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&j(e,t)?A.merge([e],n):n}function we(e,t){for(var n=0,r=e.length;n",""]);var xe=/<|&#?\w+;/;function _e(e,t,n,r,o){for(var s,a,i,u,l,c,d=t.createDocumentFragment(),f=[],h=0,p=e.length;h-1)o&&o.push(s);else if(l=ae(s),a=ye(d.appendChild(s),"script"),l&&we(a),n)for(c=0;s=a[c++];)be.test(s.type||"")&&n.push(s);return d}var Ae=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Re=/^([^.]*)(?:\.(.+)|)/;function Se(){return!0}function Ee(){return!1}function ke(e,t){return e===function(){try{return y.activeElement}catch(e){}}()==("focus"===t)}function je(e,t,n,r,o,s){var a,i;if("object"==typeof t){for(i in"string"!=typeof n&&(r=r||n,n=void 0),t)je(e,i,n,r,t[i],s);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=Ee;else if(!o)return e;return 1===s&&(a=o,(o=function(e){return A().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=A.guid++)),e.each((function(){A.event.add(this,t,o,r,n)}))}function Te(e,t,n){n?(G.set(e,t,!1),A.event.add(e,t,{namespace:!1,handler:function(e){var r,o,s=G.get(this,t);if(1&e.isTrigger&&this[t]){if(s.length)(A.event.special[t]||{}).delegateType&&e.stopPropagation();else if(s=i.call(arguments),G.set(this,t,s),r=n(this,t),this[t](),s!==(o=G.get(this,t))||r?G.set(this,t,!1):o={},s!==o)return e.stopImmediatePropagation(),e.preventDefault(),o.value}else s.length&&(G.set(this,t,{value:A.event.trigger(A.extend(s[0],A.Event.prototype),s.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===G.get(e,t)&&A.event.add(e,t,Se)}A.event={global:{},add:function(e,t,n,r,o){var s,a,i,u,l,c,d,f,h,p,m,g=G.get(e);if(V(e))for(n.handler&&(n=(s=n).handler,o=s.selector),o&&A.find.matchesSelector(se,o),n.guid||(n.guid=A.guid++),(u=g.events)||(u=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==A&&A.event.triggered!==t.type?A.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(D)||[""]).length;l--;)h=m=(i=Re.exec(t[l])||[])[1],p=(i[2]||"").split(".").sort(),h&&(d=A.event.special[h]||{},h=(o?d.delegateType:d.bindType)||h,d=A.event.special[h]||{},c=A.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&A.expr.match.needsContext.test(o),namespace:p.join(".")},s),(f=u[h])||((f=u[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,p,a)||e.addEventListener&&e.addEventListener(h,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),o?f.splice(f.delegateCount++,0,c):f.push(c),A.event.global[h]=!0)},remove:function(e,t,n,r,o){var s,a,i,u,l,c,d,f,h,p,m,g=G.hasData(e)&&G.get(e);if(g&&(u=g.events)){for(l=(t=(t||"").match(D)||[""]).length;l--;)if(h=m=(i=Re.exec(t[l])||[])[1],p=(i[2]||"").split(".").sort(),h){for(d=A.event.special[h]||{},f=u[h=(r?d.delegateType:d.bindType)||h]||[],i=i[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=s=f.length;s--;)c=f[s],!o&&m!==c.origType||n&&n.guid!==c.guid||i&&!i.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(s,1),c.selector&&f.delegateCount--,d.remove&&d.remove.call(e,c));a&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,p,g.handle)||A.removeEvent(e,h,g.handle),delete u[h])}else for(h in u)A.event.remove(e,h+t[l],n,r,!0);A.isEmptyObject(u)&&G.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,s,a,i=new Array(arguments.length),u=A.event.fix(e),l=(G.get(this,"events")||Object.create(null))[u.type]||[],c=A.event.special[u.type]||{};for(i[0]=u,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(s=[],a={},n=0;n-1:A.find(o,this,null,[l]).length),a[o]&&s.push(r);s.length&&i.push({elem:l,handlers:s})}return l=this,u\s*$/g;function Oe(e,t){return j(e,"table")&&j(11!==t.nodeType?t:t.firstChild,"tr")&&A(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Ne(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function De(e,t){var n,r,o,s,a,i;if(1===t.nodeType){if(G.hasData(e)&&(i=G.get(e).events))for(o in G.remove(t,"handle events"),i)for(n=0,r=i[o].length;n1&&"string"==typeof p&&!g.checkClone&&Pe.test(p))return e.each((function(o){var s=e.eq(o);m&&(t[0]=p.call(this,o,s.html())),Be(s,t,n,r)}));if(f&&(s=(o=_e(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=s),s||r)){for(i=(a=A.map(ye(o,"script"),Ie)).length;d0&&we(a,!u&&ye(e,"script")),i},cleanData:function(e){for(var t,n,r,o=A.event.special,s=0;void 0!==(n=e[s]);s++)if(V(n)){if(t=n[G.expando]){if(t.events)for(r in t.events)o[r]?A.event.remove(n,r):A.removeEvent(n,r,t.handle);n[G.expando]=void 0}n[X.expando]&&(n[X.expando]=void 0)}}}),A.fn.extend({detach:function(e){return Ue(this,e,!0)},remove:function(e){return Ue(this,e)},text:function(e){return Q(this,(function(e){return void 0===e?A.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return Be(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)}))},prepend:function(){return Be(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return Be(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return Be(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(A.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return A.clone(this,e,t)}))},html:function(e){return Q(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ve[(ge.exec(e)||["",""])[1].toLowerCase()]){e=A.htmlPrefilter(e);try{for(;n3,se.removeChild(e)),i}}))}();var We=["Webkit","Moz","ms"],Ye=y.createElement("div").style,Ve={};function Ke(e){var t=A.cssProps[e]||Ve[e];return t||(e in Ye?e:Ve[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=We.length;n--;)if((e=We[n]+t)in Ye)return e}(e)||e)}var Ge=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ze={position:"absolute",visibility:"hidden",display:"block"},et={letterSpacing:"0",fontWeight:"400"};function tt(e,t,n){var r=re.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function nt(e,t,n,r,o,s){var a="width"===t?1:0,i=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=A.css(e,n+oe[a],!0,o)),r?("content"===n&&(u-=A.css(e,"padding"+oe[a],!0,o)),"margin"!==n&&(u-=A.css(e,"border"+oe[a]+"Width",!0,o))):(u+=A.css(e,"padding"+oe[a],!0,o),"padding"!==n?u+=A.css(e,"border"+oe[a]+"Width",!0,o):i+=A.css(e,"border"+oe[a]+"Width",!0,o));return!r&&s>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-s-u-i-.5))||0),u}function rt(e,t,n){var r=Fe(e),o=(!g.boxSizingReliable()||n)&&"border-box"===A.css(e,"boxSizing",!1,r),s=o,a=$e(e,t,r),i="offset"+t[0].toUpperCase()+t.slice(1);if(ze.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&j(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===A.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===A.css(e,"boxSizing",!1,r),(s=i in e)&&(a=e[i])),(a=parseFloat(a)||0)+nt(e,t,n||(o?"border":"content"),s,r,a)+"px"}function ot(e,t,n,r,o){return new ot.prototype.init(e,t,n,r,o)}A.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=$e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,s,a,i=Y(t),u=Xe.test(t),l=e.style;if(u||(t=Ke(i)),a=A.cssHooks[t]||A.cssHooks[i],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:l[t];"string"===(s=typeof n)&&(o=re.exec(n))&&o[1]&&(n=le(e,t,o),s="number"),null!=n&&n==n&&("number"!==s||u||(n+=o&&o[3]||(A.cssNumber[i]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var o,s,a,i=Y(t);return Xe.test(t)||(t=Ke(i)),(a=A.cssHooks[t]||A.cssHooks[i])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=$e(e,t,r)),"normal"===o&&t in et&&(o=et[t]),""===n||n?(s=parseFloat(o),!0===n||isFinite(s)?s||0:o):o}}),A.each(["height","width"],(function(e,t){A.cssHooks[t]={get:function(e,n,r){if(n)return!Ge.test(A.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?rt(e,t,r):He(e,Ze,(function(){return rt(e,t,r)}))},set:function(e,n,r){var o,s=Fe(e),a=!g.scrollboxSize()&&"absolute"===s.position,i=(a||r)&&"border-box"===A.css(e,"boxSizing",!1,s),u=r?nt(e,t,r,i,s):0;return i&&a&&(u-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(s[t])-nt(e,t,"border",!1,s)-.5)),u&&(o=re.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=A.css(e,t)),tt(0,n,u)}}})),A.cssHooks.marginLeft=Je(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat($e(e,"marginLeft"))||e.getBoundingClientRect().left-He(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),A.each({margin:"",padding:"",border:"Width"},(function(e,t){A.cssHooks[e+t]={expand:function(n){for(var r=0,o={},s="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+oe[r]+t]=s[r]||s[r-2]||s[0];return o}},"margin"!==e&&(A.cssHooks[e+t].set=tt)})),A.fn.extend({css:function(e,t){return Q(this,(function(e,t,n){var r,o,s={},a=0;if(Array.isArray(t)){for(r=Fe(e),o=t.length;a1)}}),A.Tween=ot,ot.prototype={constructor:ot,init:function(e,t,n,r,o,s){this.elem=e,this.prop=n,this.easing=o||A.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=s||(A.cssNumber[n]?"":"px")},cur:function(){var e=ot.propHooks[this.prop];return e&&e.get?e.get(this):ot.propHooks._default.get(this)},run:function(e){var t,n=ot.propHooks[this.prop];return this.options.duration?this.pos=t=A.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ot.propHooks._default.set(this),this}},ot.prototype.init.prototype=ot.prototype,ot.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=A.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){A.fx.step[e.prop]?A.fx.step[e.prop](e):1!==e.elem.nodeType||!A.cssHooks[e.prop]&&null==e.elem.style[Ke(e.prop)]?e.elem[e.prop]=e.now:A.style(e.elem,e.prop,e.now+e.unit)}}},ot.propHooks.scrollTop=ot.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},A.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},A.fx=ot.prototype.init,A.fx.step={};var st,at,it=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){at&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(lt):n.setTimeout(lt,A.fx.interval),A.fx.tick())}function ct(){return n.setTimeout((function(){st=void 0})),st=Date.now()}function dt(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=oe[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function ft(e,t,n){for(var r,o=(ht.tweeners[t]||[]).concat(ht.tweeners["*"]),s=0,a=o.length;s1)},removeAttr:function(e){return this.each((function(){A.removeAttr(this,e)}))}}),A.extend({attr:function(e,t,n){var r,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===e.getAttribute?A.prop(e,t,n):(1===s&&A.isXMLDoc(e)||(o=A.attrHooks[t.toLowerCase()]||(A.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void A.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=A.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&j(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(D);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?A.removeAttr(e,n):e.setAttribute(n,n),n}},A.each(A.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=mt[t]||A.find.attr;mt[t]=function(e,t,r){var o,s,a=t.toLowerCase();return r||(s=mt[a],mt[a]=o,o=null!=n(e,t,r)?a:null,mt[a]=s),o}}));var gt=/^(?:input|select|textarea|button)$/i,bt=/^(?:a|area)$/i;function vt(e){return(e.match(D)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function wt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}A.fn.extend({prop:function(e,t){return Q(this,A.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[A.propFix[e]||e]}))}}),A.extend({prop:function(e,t,n){var r,o,s=e.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&A.isXMLDoc(e)||(t=A.propFix[t]||t,o=A.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=A.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||bt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(A.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),A.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){A.propFix[this.toLowerCase()]=this})),A.fn.extend({addClass:function(e){var t,n,r,o,s,a,i,u=0;if(b(e))return this.each((function(t){A(this).addClass(e.call(this,t,yt(this)))}));if((t=wt(e)).length)for(;n=this[u++];)if(o=yt(n),r=1===n.nodeType&&" "+vt(o)+" "){for(a=0;s=t[a++];)r.indexOf(" "+s+" ")<0&&(r+=s+" ");o!==(i=vt(r))&&n.setAttribute("class",i)}return this},removeClass:function(e){var t,n,r,o,s,a,i,u=0;if(b(e))return this.each((function(t){A(this).removeClass(e.call(this,t,yt(this)))}));if(!arguments.length)return this.attr("class","");if((t=wt(e)).length)for(;n=this[u++];)if(o=yt(n),r=1===n.nodeType&&" "+vt(o)+" "){for(a=0;s=t[a++];)for(;r.indexOf(" "+s+" ")>-1;)r=r.replace(" "+s+" "," ");o!==(i=vt(r))&&n.setAttribute("class",i)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):b(e)?this.each((function(n){A(this).toggleClass(e.call(this,n,yt(this),t),t)})):this.each((function(){var t,o,s,a;if(r)for(o=0,s=A(this),a=wt(e);t=a[o++];)s.hasClass(t)?s.removeClass(t):s.addClass(t);else void 0!==e&&"boolean"!==n||((t=yt(this))&&G.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":G.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+vt(yt(n))+" ").indexOf(t)>-1)return!0;return!1}});var xt=/\r/g;A.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=b(e),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,A(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=A.map(o,(function(e){return null==e?"":e+""}))),(t=A.valHooks[this.type]||A.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))}))):o?(t=A.valHooks[o.type]||A.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(xt,""):null==n?"":n:void 0}}),A.extend({valHooks:{option:{get:function(e){var t=A.find.attr(e,"value");return null!=t?t:vt(A.text(e))}},select:{get:function(e){var t,n,r,o=e.options,s=e.selectedIndex,a="select-one"===e.type,i=a?null:[],u=a?s+1:o.length;for(r=s<0?u:a?s:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),s}}}}),A.each(["radio","checkbox"],(function(){A.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=A.inArray(A(e).val(),t)>-1}},g.checkOn||(A.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})})),g.focusin="onfocusin"in n;var _t=/^(?:focusinfocus|focusoutblur)$/,At=function(e){e.stopPropagation()};A.extend(A.event,{trigger:function(e,t,r,o){var s,a,i,u,l,c,d,f,p=[r||y],m=h.call(e,"type")?e.type:e,g=h.call(e,"namespace")?e.namespace.split("."):[];if(a=f=i=r=r||y,3!==r.nodeType&&8!==r.nodeType&&!_t.test(m+A.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),l=m.indexOf(":")<0&&"on"+m,(e=e[A.expando]?e:new A.Event(m,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=r),t=null==t?[e]:A.makeArray(t,[e]),d=A.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(r,t))){if(!o&&!d.noBubble&&!v(r)){for(u=d.delegateType||m,_t.test(u+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),i=a;i===(r.ownerDocument||y)&&p.push(i.defaultView||i.parentWindow||n)}for(s=0;(a=p[s++])&&!e.isPropagationStopped();)f=a,e.type=s>1?u:d.bindType||m,(c=(G.get(a,"events")||Object.create(null))[e.type]&&G.get(a,"handle"))&&c.apply(a,t),(c=l&&a[l])&&c.apply&&V(a)&&(e.result=c.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,o||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!V(r)||l&&b(r[m])&&!v(r)&&((i=r[l])&&(r[l]=null),A.event.triggered=m,e.isPropagationStopped()&&f.addEventListener(m,At),r[m](),e.isPropagationStopped()&&f.removeEventListener(m,At),A.event.triggered=void 0,i&&(r[l]=i)),e.result}},simulate:function(e,t,n){var r=A.extend(new A.Event,n,{type:e,isSimulated:!0});A.event.trigger(r,null,t)}}),A.fn.extend({trigger:function(e,t){return this.each((function(){A.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return A.event.trigger(e,t,n,!0)}}),g.focusin||A.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=function(e){A.event.simulate(t,e.target,A.event.fix(e))};A.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=G.access(r,t);o||r.addEventListener(e,n,!0),G.access(r,t,(o||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=G.access(r,t)-1;o?G.access(r,t,o):(r.removeEventListener(e,n,!0),G.remove(r,t))}}}));var Ct=n.location,Rt={guid:Date.now()},St=/\?/;A.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new n.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||A.error("Invalid XML: "+e),t};var Et=/\[\]$/,kt=/\r?\n/g,jt=/^(?:submit|button|image|reset|file)$/i,Tt=/^(?:input|select|textarea|keygen)/i;function qt(e,t,n,r){var o;if(Array.isArray(t))A.each(t,(function(t,o){n||Et.test(e)?r(e,o):qt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(o in t)qt(e+"["+o+"]",t[o],n,r)}A.param=function(e,t){var n,r=[],o=function(e,t){var n=b(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!A.isPlainObject(e))A.each(e,(function(){o(this.name,this.value)}));else for(n in e)qt(n,e[n],t,o);return r.join("&")},A.fn.extend({serialize:function(){return A.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=A.prop(this,"elements");return e?A.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!A(this).is(":disabled")&&Tt.test(this.nodeName)&&!jt.test(e)&&(this.checked||!me.test(e))})).map((function(e,t){var n=A(this).val();return null==n?null:Array.isArray(n)?A.map(n,(function(e){return{name:t.name,value:e.replace(kt,"\r\n")}})):{name:t.name,value:n.replace(kt,"\r\n")}})).get()}});var Pt=/%20/g,Lt=/#.*$/,Ot=/([?&])_=[^&]*/,It=/^(.*?):[ \t]*([^\r\n]*)$/gm,Nt=/^(?:GET|HEAD)$/,Dt=/^\/\//,Mt={},Bt={},Ut="*/".concat("*"),zt=y.createElement("a");function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,s=t.toLowerCase().match(D)||[];if(b(n))for(;r=s[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Ht(e,t,n,r){var o={},s=e===Bt;function a(i){var u;return o[i]=!0,A.each(e[i]||[],(function(e,i){var l=i(t,n,r);return"string"!=typeof l||s||o[l]?s?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)})),u}return a(t.dataTypes[0])||!o["*"]&&a("*")}function Qt(e,t){var n,r,o=A.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&A.extend(!0,e,r),e}zt.href=Ct.href,A.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ut,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":A.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Qt(Qt(e,A.ajaxSettings),t):Qt(A.ajaxSettings,e)},ajaxPrefilter:Ft(Mt),ajaxTransport:Ft(Bt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var r,o,s,a,i,u,l,c,d,f,h=A.ajaxSetup({},t),p=h.context||h,m=h.context&&(p.nodeType||p.jquery)?A(p):A.event,g=A.Deferred(),b=A.Callbacks("once memory"),v=h.statusCode||{},w={},x={},_="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(l){if(!a)for(a={};t=It.exec(s);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return l?s:null},setRequestHeader:function(e,t){return null==l&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)C.always(e[C.status]);else for(t in e)v[t]=[v[t],e[t]];return this},abort:function(e){var t=e||_;return r&&r.abort(t),R(0,t),this}};if(g.promise(C),h.url=((e||h.url||Ct.href)+"").replace(Dt,Ct.protocol+"//"),h.type=t.method||t.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(D)||[""],null==h.crossDomain){u=y.createElement("a");try{u.href=h.url,u.href=u.href,h.crossDomain=zt.protocol+"//"+zt.host!=u.protocol+"//"+u.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=A.param(h.data,h.traditional)),Ht(Mt,h,t,C),l)return C;for(d in(c=A.event&&h.global)&&0==A.active++&&A.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Nt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Pt,"+")):(f=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(St.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ot,"$1"),f=(St.test(o)?"&":"?")+"_="+Rt.guid+++f),h.url=o+f),h.ifModified&&(A.lastModified[o]&&C.setRequestHeader("If-Modified-Since",A.lastModified[o]),A.etag[o]&&C.setRequestHeader("If-None-Match",A.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||t.contentType)&&C.setRequestHeader("Content-Type",h.contentType),C.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Ut+"; q=0.01":""):h.accepts["*"]),h.headers)C.setRequestHeader(d,h.headers[d]);if(h.beforeSend&&(!1===h.beforeSend.call(p,C,h)||l))return C.abort();if(_="abort",b.add(h.complete),C.done(h.success),C.fail(h.error),r=Ht(Bt,h,t,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,h]),l)return C;h.async&&h.timeout>0&&(i=n.setTimeout((function(){C.abort("timeout")}),h.timeout));try{l=!1,r.send(w,R)}catch(e){if(l)throw e;R(-1,e)}}else R(-1,"No Transport");function R(e,t,a,u){var d,f,y,w,x,_=t;l||(l=!0,i&&n.clearTimeout(i),r=void 0,s=u||"",C.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(w=function(e,t,n){for(var r,o,s,a,i=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in i)if(i[o]&&i[o].test(r)){u.unshift(o);break}if(u[0]in n)s=u[0];else{for(o in n){if(!u[0]||e.converters[o+" "+u[0]]){s=o;break}a||(a=o)}s=s||a}if(s)return s!==u[0]&&u.unshift(s),n[s]}(h,C,a)),!d&&A.inArray("script",h.dataTypes)>-1&&(h.converters["text script"]=function(){}),w=function(e,t,n,r){var o,s,a,i,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(s=c.shift();s;)if(e.responseFields[s]&&(n[e.responseFields[s]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=s,s=c.shift())if("*"===s)s=u;else if("*"!==u&&u!==s){if(!(a=l[u+" "+s]||l["* "+s]))for(o in l)if((i=o.split(" "))[1]===s&&(a=l[u+" "+i[0]]||l["* "+i[0]])){!0===a?a=l[o]:!0!==l[o]&&(s=i[0],c.unshift(i[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+s}}}return{state:"success",data:t}}(h,w,C,d),d?(h.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(A.lastModified[o]=x),(x=C.getResponseHeader("etag"))&&(A.etag[o]=x)),204===e||"HEAD"===h.type?_="nocontent":304===e?_="notmodified":(_=w.state,f=w.data,d=!(y=w.error))):(y=_,!e&&_||(_="error",e<0&&(e=0))),C.status=e,C.statusText=(t||_)+"",d?g.resolveWith(p,[f,_,C]):g.rejectWith(p,[C,_,y]),C.statusCode(v),v=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[C,h,d?f:y]),b.fireWith(p,[C,_]),c&&(m.trigger("ajaxComplete",[C,h]),--A.active||A.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return A.get(e,t,n,"json")},getScript:function(e,t){return A.get(e,void 0,t,"script")}}),A.each(["get","post"],(function(e,t){A[t]=function(e,n,r,o){return b(n)&&(o=o||r,r=n,n=void 0),A.ajax(A.extend({url:e,type:t,dataType:o,data:n,success:r},A.isPlainObject(e)&&e))}})),A.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),A._evalUrl=function(e,t,n){return A.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){A.globalEval(e,t,n)}})},A.fn.extend({wrapAll:function(e){var t;return this[0]&&(b(e)&&(e=e.call(this[0])),t=A(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return b(e)?this.each((function(t){A(this).wrapInner(e.call(this,t))})):this.each((function(){var t=A(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=b(e);return this.each((function(n){A(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){A(this).replaceWith(this.childNodes)})),this}}),A.expr.pseudos.hidden=function(e){return!A.expr.pseudos.visible(e)},A.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},A.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(e){}};var $t={0:200,1223:204},Jt=A.ajaxSettings.xhr();g.cors=!!Jt&&"withCredentials"in Jt,g.ajax=Jt=!!Jt,A.ajaxTransport((function(e){var t,r;if(g.cors||Jt&&!e.crossDomain)return{send:function(o,s){var a,i=e.xhr();if(i.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)i[a]=e.xhrFields[a];for(a in e.mimeType&&i.overrideMimeType&&i.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)i.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=r=i.onload=i.onerror=i.onabort=i.ontimeout=i.onreadystatechange=null,"abort"===e?i.abort():"error"===e?"number"!=typeof i.status?s(0,"error"):s(i.status,i.statusText):s($t[i.status]||i.status,i.statusText,"text"!==(i.responseType||"text")||"string"!=typeof i.responseText?{binary:i.response}:{text:i.responseText},i.getAllResponseHeaders()))}},i.onload=t(),r=i.onerror=i.ontimeout=t("error"),void 0!==i.onabort?i.onabort=r:i.onreadystatechange=function(){4===i.readyState&&n.setTimeout((function(){t&&r()}))},t=t("abort");try{i.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),A.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),A.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return A.globalEval(e),e}}}),A.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),A.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=A(" + diff --git a/test.html.gz b/test.html.gz index 1fbe22203..c3e0e2baf 100644 Binary files a/test.html.gz and b/test.html.gz differ diff --git a/tests.e900012b8e502c240f6c.css b/tests.5f5c7fd49bb7b3aea41e.css similarity index 100% rename from tests.e900012b8e502c240f6c.css rename to tests.5f5c7fd49bb7b3aea41e.css diff --git a/tests.e900012b8e502c240f6c.css.gz b/tests.5f5c7fd49bb7b3aea41e.css.gz similarity index 100% rename from tests.e900012b8e502c240f6c.css.gz rename to tests.5f5c7fd49bb7b3aea41e.css.gz