Commit f3afa31a authored by Miguel Tavares's avatar Miguel Tavares
Browse files

added code

parent 414d1d6f
Pipeline #180 failed with stages
in 0 seconds
FROM node:alpine
ENV ASSET_NAME="efpftempapp"
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . .
RUN npm install
RUN chmod +x entrypoint.sh
EXPOSE 4201
LABEL vf-OS=true
LABEL vf-OS.frontendUri=/efpftempapp/
LABEL vf-OS.icon=img/2.png
LABEL vf-OS.urlprefixReplace=true
LABEL vf-OS.compose.0.depends_on.0="rabbitmq"
ENTRYPOINT ["/usr/src/app/entrypoint.sh"]
var express = require('express');
var path = require('path');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
const os = require("os");
const formData = require("express-form-data");
const expressValidator = require('express-validator');
const recursiveReadSync = require('recursive-readdir-sync')
const contains = require("string-contains")
const cors = require('cors')
const { getRoutes } = require('get-routes')
const app = express();
/**
* Options are the same as multiparty takes.
* But there is a new option "autoClean" to clean all files in "uploadDir" folder after the response.
* By default, it is "false".
*/
const uploadOptions = {
uploadDir: os.tmpdir(),
autoClean: true
};
app.use(cors({origin: '*'}))
app.listen(process.env.PORT || 4201);
app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(expressValidator());
app.use('/',express.static(path.join(path.normalize(__dirname), '../../views')));
// parse data with connect-multiparty.
app.use(formData.parse(uploadOptions));
// clear from the request and delete all empty files (size == 0)
app.use(formData.format());
// change file objects to stream.Readable
app.use(formData.stream());
// union body and files
app.use(formData.union());
try {
recursiveReadSync(path.join(path.normalize(__dirname), '../../logic/processes')).forEach(file => {
if (!contains(file, '.gitkeep') && !contains(file, '.deps')) {
app.use('/api', require(file)(app));
}
});
} catch (err) {
if (err.errno === 34) {
console.log(err);
console.log('Path does not exist');
} else {
console.log(err);
throw err;
}
}
/**
* avoid cors
*/
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
/**
* welcome backend route
*/
app.get('/api/alive', (req, res) => {
res.json({
message : 'vApp backend is running',
data: new Date()
});
});
app.get('/api', (req, res) => {
const routes = getRoutes(app);
res.json({
routes: routes
})
});
// catch 404 and forward to error handler
app.use(function (req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function (err, req, res, next) {
// set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
// render the error page
res.status(err.status || 500);
res.render('error');
});
// This block of code is used to print the provided routes by this vApp
function split (thing) {
if (typeof thing === 'string') {
return thing.split('/')
} else if (thing.fast_slash) {
return ''
} else {
var match = thing.toString()
.replace('\\/?', '')
.replace('(?=\\/|$)', '$')
.match(/^\/\^((?:\\[.*+?^${}()|[\]\\\/]|[^.*+?^${}()|[\]\\\/])*)\$\//)
return match
? match[1].replace(/\\(.)/g, '$1').split('/')
: '<complex:' + thing.toString() + '>'
}
}
// This block of code is used to print the provided routes by this vApp
function print (path, layer) {
if (layer.route) {
layer.route.stack.forEach(print.bind(null, path.concat(split(layer.route.path))))
} else if (layer.name === 'router' && layer.handle.stack) {
layer.handle.stack.forEach(print.bind(null, path.concat(split(layer.regexp))))
} else if (layer.method) {
console.log('%s /%s',
layer.method.toUpperCase(),
path.concat(split(layer.regexp)).filter(Boolean).join('/'))
}
}
// This block of code is used to print the provided routes by this vApp
app._router.stack.forEach(print.bind(null, []));
module.exports = app;
\ No newline at end of file
vfos-sdk @ 8ea39e0f
Subproject commit 8ea39e0fe699478ae960f22954c92ed1e53129e5
#!/bin/sh
node .vfos-deploy-hda.js
sed -i "s/frontend_editor/app/$ASSET_NAME/g" views/index.html
npm start
\ No newline at end of file
[{"productId":"3","name":"vfrelstorage","major":"1.2"}]
\ No newline at end of file
const async = require('async');
const express = require('express');
const router = express.Router();
function main() {
async.waterfall([function database(cbk) {
cbk(null, {});
},
databaseCreator, tableCreator], function(err, result) {
if (err) {
console.log(err);
}
});
}
function databaseCreator(args, cbk) {
const map = (function map(inputs) {
return {
authorization: 'Basic cG9zdGdyZXM6dmZvcw==',
body: {
database_name: 'efpftempapp'
}
};
})(args);
const requestOptions = {
method: 'post',
url: (function() {
return 'http://reverse-proxy/vfrelstorage/vfos/rel/1.0.5/databases';
})(),
headers: {
'authorization': map.authorization,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(map.body)
};
require('request')(requestOptions, function(err, response) {
let responseBody = response ? JSON.parse(response.body || '') : '';
if (!err && (200 <= response.statusCode) && (response.statusCode < 300)) {
cbk(null, {...args, ...responseBody
});
} else {
cbk(err || responseBody || 'error');
}
});
}
function tableCreator(args, cbk) {
const map = (function map(inputs) {
return {
authorization: 'Basic cG9zdGdyZXM6dmZvcw==',
databaseName: 'efpftempapp',
body: {
table_name: 'samples',
columns: [{
name: 'id',
type: 'serial'
}, {
name: 'timestamp',
type: 'timestamp'
}, {
name: 'sensor',
type: 'varchar'
}, {
name: 'temperature',
type: 'int'
}],
constraints: []
}
};
})(args);
const requestOptions = {
method: 'post',
url: (function() {
let url = 'http://reverse-proxy/vfrelstorage/vfos/rel/1.0.5/databases/' + encodeURI(map.databaseName) + '/tables';
return url;
})(),
headers: {
'authorization': map.authorization,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(map.body)
};
require('request')(requestOptions, function(err, response) {
let responseBody = response ? JSON.parse(response.body || '') : '';
if (!err && (200 <= response.statusCode) && (response.statusCode < 300)) {
cbk(null, {...args, ...responseBody
});
} else {
cbk(err || responseBody || 'error');
}
});
}
module.exports = function(app) {
try {
main();
} catch (err) {
console.log(err);
}
return router;
}
\ No newline at end of file
[{"productId":"3","name":"vfrelstorage","major":"1.2"}]
\ No newline at end of file
const async = require('async');
const express = require('express');
const router = express.Router();
function main(req, res) {
async.waterfall([function getAllSamples(cbk) {
cbk(null, {});
},
queryRecords], function(err, result) {
if (err) {
res.status(500).send(err);
} else {
res.status(200).send(result || 1);
}
});
}
function queryRecords(args, cbk) {
const map = (function map(inputs) {
return {
authorization: 'Basic cG9zdGdyZXM6dmZvcw==',
databaseName: 'efpftempapp',
tableName: 'samples',
limit: 30,
order_by: ['timestamp DESC']
};
})(args);
const requestOptions = {
method: 'get',
url: (function() {
let url = 'http://reverse-proxy/vfrelstorage/vfos/rel/1.0.5/databases/' + encodeURI(map.databaseName) + '/tables/' + encodeURI(map.tableName) + '/rows';
let separator = '?';
if (map.query_columns_specification != null) {
url += separator + 'query_columns_specification=' + encodeURI(map.query_columns_specification);
separator = '&';
}
if (map.filter != null) {
url += separator + 'filter=' + encodeURI(map.filter);
separator = '&';
}
if (map.skip != null) {
url += separator + 'skip=' + encodeURI(map.skip);
separator = '&';
}
if (map.limit != null) {
url += separator + 'limit=' + encodeURI(map.limit);
separator = '&';
}
if (map.group_by != null) {
url += separator + 'group_by=' + encodeURI(map.group_by);
separator = '&';
}
if (map.having != null) {
url += separator + 'having=' + encodeURI(map.having);
separator = '&';
}
if (map.order_by != null) {
url += separator + 'order_by=' + encodeURI(map.order_by);
separator = '&';
}
return url;
})(),
headers: {
'authorization': map.authorization,
'Accept': 'application/json',
'Content-Type': 'application/json'
}
};
require('request')(requestOptions, function(err, response) {
let responseBody = response ? JSON.parse(response.body || '') : '';
if (!err && (200 <= response.statusCode) && (response.statusCode < 300)) {
cbk(null, {...args, ...responseBody
});
} else {
cbk(err || responseBody || 'error');
}
});
}
module.exports = function(app) {
router.get('/getAllSamples', main);
return router;
}
\ No newline at end of file
[{"productId":"3","name":"vfrelstorage","major":"1.2"},{"productId":"1","name":"messaging-pubsub","major":"1.0"}]
\ No newline at end of file
const async = require('async');
const express = require('express');
const sdk = require('../../../bin/libs/vfos-sdk/sdk-include');
const router = express.Router();
const Messaging = sdk.messaging;
const broker = "dataspine.efpf.linksmart.eu";
const username = "miguel.tavares@caixamagica.pt";
const password = "kdHmJMSUZzSNzqxs4pPVaWht";
const routingKeys = ["eu.efpf.efpftempsensor"];
const vhost = "cms";
const ssl = true;
function main() {
async.waterfall([function listener(cbk) {
cbk(null, {});
},
receiver], function(err, result) {
if (err) {
console.log(err);
}
});
}
function receiver(args, cbk) {
const pubsub = new Messaging(broker, username, password, routingKeys, vhost, ssl);
pubsub.registerPublicationReceiver(function(msg) {
console.log(msg)
if (msg.routingKey === "eu.efpf.efpftempsensor") {
try {
args.message = JSON.parse(msg.content.toString());
async.waterfall([function(cbkStart) {
cbkStart(null, args);
},
normalization, persist], function(err, result) {
if (err) {
console.log(err);
};
});
} catch (err) {
console.log(err);
}
}
});
}
function normalization(args, cbk) {
function script(inputs, next) {
next(null, {
sample: {
sensor: inputs.message.machine,
timestamp: inputs.message.timestamp,
temperature: inputs.message.temperature
}
});
}
script(args, cbk);
}
function persist(args, cbk) {
const map = (function map(inputs) {
return {
authorization: 'Basic cG9zdGdyZXM6dmZvcw==',
databaseName: 'efpftempapp',
tableName: 'samples',
body: [inputs.sample]
};
})(args);
const requestOptions = {
method: 'post',
url: (function() {
let url = 'http://reverse-proxy/vfrelstorage/vfos/rel/1.0.5/databases/' + encodeURI(map.databaseName) + '/tables/' + encodeURI(map.tableName) + '/rows';
return url;
})(),
headers: {
'authorization': map.authorization,
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(map.body)
};
require('request')(requestOptions, function(err, response) {
let responseBody = response ? JSON.parse(response.body || '') : '';
if (!err && (200 <= response.statusCode) && (response.statusCode < 300)) {
cbk(null, {...args, ...responseBody
});
} else {
cbk(err || responseBody || 'error');
}
});
}
module.exports = function(app) {
try {
main();
} catch (err) {
console.log(err);
}
return router;
}
\ No newline at end of file
{
"name": "efpftempapp",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"get-routes": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/get-routes/-/get-routes-2.1.5.tgz",
"integrity": "sha512-O0bQS1Wd52nsvUSOE2n3CgZVQxpEMt/SuKZkxqEB35WE7iDAanmFvh2JGkIAtX/uSWqgkUQKz+RL8Qxr9rIw6g=="
}
}
}
{
"name": "efpftempapp",
"version": "1.0.0",
"description": "vfos",
"main": "app.js",
"dependencies": {
"archiver": "^3.0.0",
"async": "^2.6.0",
"body-parser": "~1.18.2",
"cookie-parser": "~1.4.3",
"cors": "^2.8.5",
"express": "^4.16.3",
"express-form-data": "^2.0.8",
"express-validator": "^5.0.2",
"extract-zip": "^1.6.7",
"get-routes": "^2.1.5",
"morgan": "~1.9.0",
"node-stream-zip": "^1.8.0",
"recursive-readdir-sync": "^1.0.6",
"request": "^2.83.0",
"string-contains": "^0.1.0",
"unzipper": "^0.9.15",
"yeoman-gen-run": "^1.2.3"
},
"devDependencies": {},
"scripts": {
"start": "PORT=4201 node bin/be/app.js"
},
"author": "vfos",
"license": "ISC"
}
table.svelte-17ee2qa,th.svelte-17ee2qa,tr.svelte-17ee2qa,td.svelte-17ee2qa{border:1px solid black;border-collapse:collapse}thead.svelte-17ee2qa{display:table-header-group;vertical-align:middle;border-color:inherit}tr.svelte-17ee2qa{display:table-row;vertical-align:inherit;border-color:inherit}td.svelte-17ee2qa{display:table-cell;vertical-align:inherit}table.svelte-17ee2qa{width:100%;text-align:center}#data-visualization.svelte-17ee2qa{vertical-align:top;margin:20px}
div.footer_container.svelte-1a30oxp.svelte-1a30oxp{width:100%;height:106px;background:#333;text-align:center;padding-top:10px;position:sticky;bottom:0;left:0}div.footer_container.svelte-1a30oxp img.svelte-1a30oxp{width:48px;opacity:0.5;margin-top:20px}div.footer_container.svelte-1a30oxp div.link_container.svelte-1a30oxp,div.footer_container.svelte-1a30oxp div.link_container a.svelte-1a30oxp{line-height:10px;color:#AAA;font-size:10px}div.footer_container.svelte-1a30oxp div.link_container div.vs.svelte-1a30oxp{display:inline-block;padding-left:5px;border-right:1px solid #FFF;margin-right:5px;height:10px}
.logo.svelte-1b1okkv img.svelte-1b1okkv{width:100px;height:auto;vertical-align:top;position:absolute;margin-left:4px;margin-top:4px;left:0;top:0;cursor:pointer;z-index:9002}.navbar-fixed-top.svelte-1b1okkv.svelte-1b1okkv{background:#FFF;height:106px;border-bottom:1px solid #DDD;z-index:9001;position:absolute;top:0;width:100%}
!function(t){var e={};function n(o){if(e[o])return e[o].exports;var l=e[o]={i:o,l:!1,exports:{}};return t[o].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var l in t)n.d(o,l,function(e){return t[e]}.bind(null,l));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(4)},function(t,e,n){},function(t,e,n){},function(t,e,n){},function(t,e,n){"use strict";function o(){}n.r(e);function l(t){return t()}function r(){return Object.create(null)}function a(t){t.forEach(l)}function i(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}new Set;function c(t,e){t.appendChild(e)}function u(t,e,n){t.insertBefore(e,n||null)}function f(t){t.parentNode.removeChild(t)}function d(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function p(t){return document.createElement(t)}function h(t){return document.createTextNode(t)}function g(){return h(" ")}function m(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function v(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function b(t,e){e=""+e,t.data!==e&&(t.data=e)}function $(t,e){(null!=e||t.value)&&(t.value=e)}function x(t,e,n,o){t.style.setProperty(e,n,o?"important":"")}function y(t,e){for(let n=0;n<t.options.length;n+=1){const o=t.options[n];if(o.__value===e)return void(o.selected=!0)}}new Set;let w;function _(t){w=t}function k(){if(!w)throw new Error("Function called outside component initialization");return w}function T(t){k().$$.on_mount.push(t)}const D=[],S=[],E=[],F=[],O=Promise.resolve();let M=!1;function P(){M||(M=!0,O.then(N))}function A(t){E.push(t)}let q=!1;const C=new Set;function N(){if(!q){q=!0;do{for(let t=0;t<D.length;t+=1){const e=D[t];_(e),j(e.$$)}for(D.length=0;S.length;)S.pop()();for(let t=0;t<E.length;t+=1){const e=E[t];C.has(e)||(C.add(e),e())}E.length=0}while(D.length);for(;F.length;)F.pop()();M=!1,q=!1,C.clear()}}function j(t){if(null!==t.fragment){t.update(),a(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(A)}}const L=new Set;let B;function H(t,e){t&&t.i&&(L.delete(t),t.i(e))}function z(t,e,n,o){if(t&&t.o){if(L.has(t))return;L.add(t),B.c.push(()=>{L.delete(t),o&&(n&&t.d(1),o())}),t.o(e)}}"undefined"!=typeof window?window:global;new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]);let I;function R(t){t&&t.c()}function U(t,e,n){const{fragment:o,on_mount:r,on_destroy:s,after_update:c}=t.$$;o&&o.m(e,n),A(()=>{const e=r.map(l).filter(i);s?s.push(...e):a(e),t.$$.on_mount=[]}),c.forEach(A)}function Y(t,e){const n=t.$$;null!==n.fragment&&(a(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function G(t,e,n,l,i,s,c=[-1]){const u=w;_(t);const d=e.props||{},p=t.$$={fragment:null,ctx:null,props:s,update:o,not_equal:i,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(u?u.$$.context:[]),callbacks:r(),dirty:c};let h=!1;if(p.ctx=n?n(t,d,(e,n,...o)=>{const l=o.length?o[0]:n;return p.ctx&&i(p.ctx[e],p.ctx[e]=l)&&(p.bound[e]&&p.bound[e](l),h&&function(t,e){-1===t.$$.dirty[0]&&(D.push(t),P(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}(t,e)),n}):[],p.update(),h=!0,a(p.before_update),p.fragment=!!l&&l(p.ctx),e.target){if(e.hydrate){const t=(g=e.target,Array.from(g.childNodes));p.fragment&&p.fragment.l(t),t.forEach(f)}else p.fragment&&p.fragment.c();e.intro&&H(t.$$.fragment),U(t,e.target,e.anchor),N()}var g;_(u)}"function"==typeof HTMLElement&&(I=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}$destroy(){Y(this,1),this.$destroy=o}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}});class J{$destroy(){Y(this,1),this.$destroy=o}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}n(3);function V(t,e,n){const o=t.slice();return o[57]=e[n],o}function X(t,e,n){const o=t.slice();return o[54]=e[n],o}function K(t,e,n){const o=t.slice();return o[57]=e[n],o}function Q(t,e,n){const o=t.slice();return o[62]=e[n],o}function W(t){let e,n,o,l=t[8],r=[];for(let e=0;e<l.length;e+=1)r[e]=Z(Q(t,l,e));return{c(){e=p("select"),n=p("optgroup");for(let t=0;t<r.length;t+=1)r[t].c();v(n,"label",t[7]),x(e,"max-width","200px"),x(e,"margin-right","1%"),void 0===t[6]&&A(()=>t[44].call(e))},m(l,i,s){u(l,e,i),c(e,n);for(let t=0;t<r.length;t+=1)r[t].m(n,null);y(e,t[6]),s&&a(o),o=[m(e,"change",t[44]),m(e,"change",t[45])]},p(t,o){if(256&o[0]){let e;for(l=t[8],e=0;e<l.length;e+=1){const a=Q(t,l,e);r[e]?r[e].p(a,o):(r[e]=Z(a),r[e].c(),r[e].m(n,null))}for(;e<r.length;e+=1)r[e].d(1);r.length=l.length}128&o[0]&&v(n,"label",t[7]),64&o[0]&&y(e,t[6])},d(t){t&&f(e),d(r,t),a(o)}}}function Z(t){let e,n,o,l=t[62]+"";return{c(){e=p("option"),n=h(l),e.__value=o=t[62],e.value=e.__value},m(t,o){u(t,e,o),c(e,n)},p(t,r){256&r[0]&&l!==(l=t[62]+"")&&b(n,l),256&r[0]&&o!==(o=t[62])&&(e.__value=o),e.value=e.__value},d(t){t&&f(e)}}}function tt(t){let e,n;return{c(){e=p("input"),x(e,"margin-right","1%"),v(e,"placeholder","Search...")},m(o,l,r){u(o,e,l),$(e,t[9]),r&&a(n),n=[m(e,"keyup",t[46]),m(e,"input",t[47])]},p(t,n){512&n[0]&&e.value!==t[9]&&$(e,t[9])},d(t){t&&f(e),a(n)}}}function et(t){let e,n,o,l;return{c(){e=p("input"),n=g(),o=p("input"),x(e,"margin-right","2%"),v(e,"type","date"),v(e,"id","dateFrom"),v(e,"title","Date From"),e.value=t[12],v(e,"min",t[10]),v(e,"max",t[11]),v(o,"type","date"),v(o,"id","dateTo"),v(o,"title","Date To"),v(o,"min",t[14]),v(o,"max",t[11]),o.value=t[13]},m(r,i,s){u(r,e,i),t[48](e),u(r,n,i),u(r,o,i),t[50](o),s&&a(l),l=[m(e,"change",t[49]),m(o,"change",t[51])]},p(t,n){4096&n[0]&&(e.value=t[12]),1024&n[0]&&v(e,"min",t[10]),2048&n[0]&&v(e,"max",t[11]),16384&n[0]&&v(o,"min",t[14]),2048&n[0]&&v(o,"max",t[11]),8192&n[0]&&(o.value=t[13])},d(r){r&&f(e),t[48](null),r&&f(n),r&&f(o),t[50](null),a(l)}}}function nt(t){let e,n,o,l,r=t[57].charAt(0).toUpperCase()+t[57].slice(1)+"";function a(...e){return t[52](t[57],...e)}return{c(){e=p("th"),n=h(r),o=h("↑↓"),x(e,"cursor","pointer"),v(e,"class","svelte-17ee2qa")},m(t,r,i){u(t,e,r),c(e,n),c(e,o),i&&l(),l=m(e,"click",a)},p(e,o){t=e,8&o[0]&&r!==(r=t[57].charAt(0).toUpperCase()+t[57].slice(1)+"")&&b(n,r)},d(t){t&&f(e),l()}}}function ot(t){let e,n,o=(void 0!==t[54][t[57]]?t[54][t[57]]:"")+"";return{c(){e=p("td"),n=h(o),v(e,"class","svelte-17ee2qa")},m(t,o){u(t,e,o),c(e,n)},p(t,e){262156&e[0]&&o!==(o=(void 0!==t[54][t[57]]?t[54][t[57]]:"")+"")&&b(n,o)},d(t){t&&f(e)}}}function lt(t){let e,n,o=t[3],l=[];for(let e=0;e<o.length;e+=1)l[e]=ot(V(t,o,e));return{c(){e=p("tr");for(let t=0;t<l.length;t+=1)l[t].c();n=g(),v(e,"class","svelte-17ee2qa")},m(t,o){u(t,e,o);for(let t=0;t<l.length;t+=1)l[t].m(e,null);c(e,n)},p(t,r){if(262156&r[0]){let a;for(o=t[3],a=0;a<o.length;a+=1){const i=V(t,o,a);l[a]?l[a].p(i,r):(l[a]=ot(i),l[a].c(),l[a].m(e,n))}for(;a<l.length;a+=1)l[a].d(1);l.length=o.length}},d(t){t&&f(e),d(l,t)}}}function rt(t){let e,n;return{c(){e=p("button"),e.textContent="Load more...",x(e,"width","100%")},m(o,l,r){u(o,e,l),r&&n(),n=m(e,"click",t[25])},p:o,d(t){t&&f(e),n()}}}function at(t){let e;return{c(){e=p("p"),e.textContent="Loading ...",x(e,"text-align","center")},m(t,n){u(t,e,n)},d(t){t&&f(e)}}}function it(t){let e,n,l,r,a