$vars->{page} =~ s/html$/tt/;
}
-
-# my $sess = ();
-# my $se = session->new();
-# $p->{sid} = $cgi->cookie($vars->{cookiename});
if ($cgi->request_method() eq "GET"){
my @params = $cgi->param();
foreach my $pp (@params){
}
-# if ($cgi->request_method() eq "POST"){
-
-# my @params = $cgi->param();
-# foreach my $pp (@params){
-# $p->{$pp} = $cgi->param($pp);
-# }
-# # $vars->{hasposts} = $p;
-# # if (exists($p->{'btnlogin'})){
-# # my $ret = $se->checklogin($p->{login},$p->{password});
-# # if ($ret->{sid} ne ""){
-# # $p->{sid} = $ret->{sid};
-# # $cookie = CGI::Cookie->new(-name=>$vars->{cookiename},-value=>$p->{sid},-httponly => 1);
-# # }else {
-# # $vars->{message} = $ret->{message};
-# # $vars->{messagetype} = $ret->{messagetype};
-# # $vars->{page} = "message.tt";
-# # }
-# # }
-# # if (exists($p->{'btnregister'})){
-
-# # my $ret = $se->registeruser($p);
-
-# # $vars->{message} = $ret->{message};
-# # $vars->{messagetype} = $ret->{messagetype};
-# # $vars->{page} = $ret->{page};
-# # }
-# # if (exists($p->{'btnforgotpassword'})){
-# # my $ret = $se->passwordforgotten($p->{email});
-# # $vars->{message} = $ret->{message};
-# # $vars->{messagetype} = $ret->{messagetype};
-# # $vars->{page} = "message.tt";
-# # }
-# # if (exists($p->{'btnvalidateemail'})){
-# # my $ret = $se->validateaccount($p);
-# # $vars->{message} = $ret->{message};
-# # $vars->{messagetype} = $ret->{messagetype};
-# # $vars->{page} = "message.tt";
-# # }
-# # if (exists($p->{'btnresendcode'})){
-# # my $ret = $se->resendcode($p->{email});
-# # $vars->{message} = $ret->{message};
-# # $vars->{messagetype} = $ret->{messagetype};
-# # $vars->{page} = "message.tt";
-# # }
-
-# # if (exists($p->{logout})){
-# # $se->deletesession($p->{sid});
-# # $p->{sid} = "";
-# # $cookie = CGI::Cookie->new(-name=>$vars->{cookiename},-value=>"",-httponly => 1);
-# # }
-# # if (exists($p->{btndeleteprofile})){
-# # my $ret = $se->deleteprofile($p->{deleteprofile});
-# # $vars->{message} = $ret->{message};
-# # $vars->{messagetype} = $ret->{messagetype};
-# # $vars->{page} = "message.tt";
-# # if (exists($ret->{sid})){
-# # $p->{sid} = "";
-# # }
-# # $cookie = CGI::Cookie->new(-name=>$vars->{cookiename},-value=>"",-httponly => 1);
-# # }
-# }
-
-# # if ($p->{sid} ne ""){
-# # $sess = $se->getsession($p->{sid});
-# # }
-
-# #$vars->{beforex} = $vars->{page};
-# if (!exists($sess->{id}) || (!exists($p->{sid})) || $p->{sid} eq ""){
-# $skl = "skeleton/index.tt";
-# }
-# # if ($vars->{page} eq "deleteprofile.tt") {
-# # $skl = "skeleton/login.tt";
-# # }
-# # my ($appname) = $ENV{REQUEST_URI} =~ /.*\/module\/(\w+)\/.*/;
-# if ($p->{sid} ne ""){
-# $vars->{session} = $sess;
-# }
-# #SESSION - End
-# # #BEGIN - Browser Blocking
-# # if (($ENV{HTTP_USER_AGENT} !~ /Chrome/) || ($ENV{HTTP_USER_AGENT} =~ /Edge/) || ($ENV{HTTP_USER_AGENT} =~ /Firefox/)){
-# # $skl = "skeleton/browser.tt";
-# # }
-# # #END - Browser Blocking
my $ctype = 'text/html';
if ($vars->{suffix} eq ".js"){
$ctype= "text/javascript";
} elsif ($vars->{suffix} eq ".css"){
$ctype = "text/css";
}
-#print $cgi->header(-type=>$ctype, -charset=>"utf-8",-cookie => $cookie);
print $cgi->header(-type=>$ctype, -charset=>"utf-8");
-# print dirname($ENV{"SCRIPT_FILENAME"});
my $template = Template->new({INCLUDE_PATH => [$Bin.'/CGI/tmpl']});
-#}
my @lv = split(/\//,$vars->{filepath});
my $absnum = scalar(@lv)-1;
if ($vars->{page} =~ /module/){
$vars->{module} = basename(dirname($vars->{page}));
}
+# if ($vars->{page} =~ /print\//){
+# $vars->{print} = basename(dirname($vars->{page}));
+# }
$vars->{pagename} = basename($vars->{page});
$vars->{pagename} =~ s/\.tt$//;
# my ($appname) = $ENV{REQUEST_URI} =~ /.*\/apps\/(\w+)\/.*/;
#$skl ne "skeleton/login.tt" &&
if ($vars->{page} =~ /module/){
$skl = "skeleton/module.tt";
- if ($vars->{page} !~ /\.tt$/) {
- $skl = "skeleton/file.tt";
- }
- $vars->{params}= $p;
}elsif ($vars->{page} =~ /^app/){
$skl = "skeleton/app.tt";
- if ($vars->{page} !~ /\.tt$/) {
+}
+if ($vars->{page} !~ /\.tt$/) {
$skl = "skeleton/file.tt";
}
- $vars->{params}= $p;
-}
-
+$vars->{params}= $p;
#END - iFrame - Modules
$template->process($skl,$vars) || die "Template process failed: ", $template->error(), "\n";
enableTime: true,
"locale": "de"
});
+
}
function loadtblaudio() {
"locale": "de",
});
-
+
fillchoices();
inittblinvoices();
inittblbookings();
return false;
}
-function inittblinvoices(){
- tbl = new Tabulator("#tbl_invoices", {
- headerFilterPlaceholder: "filter...",
- height: "92vh",
- layout: "fitData",
- selectable: 1,
- // responsiveLayout:"collapse",
- columns: [
- { title: "Quartal", field: "bquarter", headerFilter: "input" },
- {
- title: "Datum",
- field: "invoicedate",
- formatter: "datetime",
- formatterParams: {
- inputFormat: "YYYY-MM-DD",
- outputFormat: "DD.MM.YYYY",
- invalidPlaceholder: ""
- }
- },
- { title: "Empfänger", field: "receipient", headerFilter: "input", width: 200 },
- { title: "Sender", field: "sender", headerFilter: "input" },
- { title: "Referenz", field: "reference", headerFilter: "input" },
- {
- title: "Status",
- field: "status",
- headerFilter: "input",
- formatter: function(cell, formatterParams) {
- var value = cell.getValue();
- //console.log(value.indexOf("bez"));
- if (value.indexOf("payed") >= 0) {
- return "<span style='color:green;'>" + statuslang[value] + "</span>";
- } else if (value.indexOf("overdue") >= 0) {
- return "<span style='color:red; font-weight: bold;'>" + statuslang[value] + "</span>";
- } else if (value.indexOf("planned") >= 0) {
- return "<span style='color:grey;'>" + statuslang[value] + "</span>";
- } else {
- return "<span style='color:orange;'>" + statuslang[value] + "</span>";
+function inittblinvoices() {
+ tbl = new Tabulator("#tbl_invoices", {
+ headerFilterPlaceholder: "filter...",
+ height: "92vh",
+ layout: "fitData",
+ selectable: 1,
+ // responsiveLayout:"collapse",
+ columns: [
+ { title: "Quartal", field: "bquarter", headerFilter: "input" },
+ {
+ title: "Datum",
+ field: "invoicedate",
+ formatter: "datetime",
+ formatterParams: {
+ inputFormat: "YYYY-MM-DD",
+ outputFormat: "DD.MM.YYYY",
+ invalidPlaceholder: ""
+ }
+ },
+ { title: "Empfänger", field: "receipient", headerFilter: "input", width: 200 },
+ { title: "Sender", field: "sender", headerFilter: "input" },
+ { title: "Referenz", field: "reference", headerFilter: "input" },
+ {
+ title: "Status",
+ field: "status",
+ headerFilter: "input",
+ formatter: function(cell, formatterParams) {
+ var value = cell.getValue();
+ //console.log(value.indexOf("bez"));
+ if (value.indexOf("payed") >= 0) {
+ return "<span style='color:green;'>" + statuslang[value] + "</span>";
+ } else if (value.indexOf("overdue") >= 0) {
+ return "<span style='color:red; font-weight: bold;'>" + statuslang[value] + "</span>";
+ } else if (value.indexOf("planned") >= 0) {
+ return "<span style='color:grey;'>" + statuslang[value] + "</span>";
+ } else {
+ return "<span style='color:orange;'>" + statuslang[value] + "</span>";
+ }
+ }
+ },
+ {
+ title: "Netto",
+ field: "netamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
+ }
+ },
+ {
+ title: "MwSt",
+ field: "vatamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
+ }
+ }, {
+ title: "Brutto",
+ field: "grossamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
+ }
+ }, {
+ title: "Bezahlt",
+ field: "payedamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
}
}
- },
- {
- title: "Netto",
- field: "netamount",
- align: "right",
- formatter: "money",
- formatterParams: {
- decimal: ",",
- thousand: ".",
- symbol: "€",
- symbolAfter: "p",
- precision: 2,
- }
- },
- {
- title: "MwSt",
- field: "vatamount",
- align: "right",
- formatter: "money",
- formatterParams: {
- decimal: ",",
- thousand: ".",
- symbol: "€",
- symbolAfter: "p",
- precision: 2,
- }
- }, {
- title: "Brutto",
- field: "grossamount",
- align: "right",
- formatter: "money",
- formatterParams: {
- decimal: ",",
- thousand: ".",
- symbol: "€",
- symbolAfter: "p",
- precision: 2,
- }
- }, {
- title: "Bezahlt",
- field: "payedamount",
- align: "right",
- formatter: "money",
- formatterParams: {
- decimal: ",",
- thousand: ".",
- symbol: "€",
- symbolAfter: "p",
- precision: 2,
- }
- }
- ]
-});
-gettbldata();
+ ]
+ });
+ gettbldata();
}
function inittblfiles() {
function inittblbookings() {
tblproducts = new Tabulator("#tbl_products", {
height: "80vh",
- layout: "fitData",
+ layout: "fitColumns",
selectable: 1,
columns: [
- { title: "Beschreibung", field: "description" },
- { title: "Anz.", field: "quantity" },
+ { title: "Beschreibung", field: "description", formatter: "textarea", width: "400" },
+ {
+ title: "Anz.",
+ field: "quantity",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "",
+ symbolAfter: "p",
+ precision: 0,
+ }
+ },
{ title: "Einheit", field: "unit" },
- { title: "Einzel-Preis", field: "unitamount" },
- { title: "Netto", field: "netamount" },
- { title: "MwSt.(%)", field: "vatpercent" },
- { title: "MwSt.", field: "vatamount" }
+ {
+ title: "Einzel",
+ field: "unitamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
+ }
+ },
+ {
+ title: "Netto",
+ field: "netamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
+ },
+ download: false
+ },
+ {
+ title: "MwSt.(%)",
+ field: "taxpercent",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "%",
+ symbolAfter: "p",
+ precision: 2,
+ },
+ download: false
+ },
+ {
+ title: "MwSt.",
+ field: "taxamount",
+ align: "right",
+ formatter: "money",
+ formatterParams: {
+ decimal: ",",
+ thousand: ".",
+ symbol: "€",
+ symbolAfter: "p",
+ precision: 2,
+ },
+ download: false
+ }
]
});
return false;
var udata = tbl.getSelectedData();
if (udata[0]) {
console.log(udata[0]);
- req.reqdata("POST", "db.cgi", { "db": parent.app + "/" + mpref.cfg.db, "get": "bookings", "filter": "id_invoice=" + udata[0].id }, loadtblfilesdata);
+ req.reqdata("POST", "db.cgi", { "db": parent.app + "/" + mpref.cfg.db, "get": "bookings", "filter": "id_invoice=" + udata[0].id }, loadtblbookingdata);
}
return false;
}
-function loadtblfilesdata(data) {
+function loadtblbookingdata(data) {
console.log(data);
if (data && data.sqldata) {
- tblfiles.setData(data.sqldata);
+ tblproducts.setData(data.sqldata);
}
+ tblproducts.redraw(true);
return false;
}
}
function add() {
- //cleanform("invoices");
- //TODO Clean form
+ cleanform("invoices");
viewinvoicepanel();
+ tblproducts.clearData();
+ tblproducts.clearData();
return false;
}
function viewinvoicepanel() {
document.getElementById('tbl_invoices').style.display = 'none';
document.getElementById('pnl_invoices').style.display = 'block';
+
return false;
}
}
document.getElementById("tab_" + tabname).style.display = "block";
return false;
+}
+
+function geninvoice() {
+ tblproducts.download("pdf", document.getElementById("reference").value + ".pdf", {
+ orientation: "portrait",
+
+ jsPDF: {
+ unit: "mm",
+ },
+ autoTable(doc) {
+ doc.setFontSize(10);
+ doc.text("DKS s.à r.l.", 160, 10);
+ doc.text("8b, rue du Moulin", 160, 15);
+ doc.text("L-6914 Roodt/Syre", 160, 20);
+ doc.setFontSize(20);
+ doc.text("Invoice", 160, 70);
+
+ // styles: {
+ // fillColor: [100, 255, 255]
+ // },
+ // columnStyles: {
+ // id: {fillColor: 255}
+ // },
+ return {
+ margin: { top: 130, bottom: 10, left: 15, right: 10 },
+ }
+
+ },
+ documentProcessing: function(doc) {
+ //carry out an action on the doc object
+ }
+ });
}
\ No newline at end of file
<div class="w3-bar">
<button class="w3-bar-item w3-button w3-border w3-blue-grey" onclick="viewtable();"><img src="[% abspath%][% staticpath %]img/icons/list_white.svg" style="height: 24px;"/> Journal</button>
-
+ <button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="geninvoice();"><img src="[% abspath%][% staticpath %]img/icons/Adobe_Acrobat.svg" style="height: 24px;"/></button>
<button class="w3-bar-item w3-button w3-border w3-right w3-red" onclick="remove();"><img src="[% abspath%][% staticpath %]img/icons/remove_white.svg" style="height: 24px;"/></button>
<button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="edit();"><img src="[% abspath%][% staticpath %]img/icons/edit_white.svg" style="height: 24px;"/></button>
<button class="w3-bar-item w3-button w3-border w3-right w3-blue-grey" onclick="add();"><img src="[% abspath%][% staticpath %]img/icons/plus_white.svg" style="height: 24px;"/></button>
</div>
<div class="w3-display-container" id="tbl_invoices" style="margin-top: 50px;"></div>
<div class="w3-display-container" id="pnl_invoices" style="display: none; margin-top: 50px;">
- <div class="row">
- <div class="w3-col m6">
- [% fieldhidden('id','invoices','ident') %] [% fieldselectbox('invoicetype','invoices','Typ','w3-half','') %] [% fieldselectbox('template','invoices','Vorlage','w3-half','') %] [% fieldselectbox('status','invoices','Status','w3-half','') %] [% fielddatebox('statusdate','invoices','Status-Datum','w3-half','readonly')
- %] [% fieldselectbox('id_receipient','invoices','Empfänger','w3-half','') %] [% fieldselectbox('id_sender','invoices','Sender','w3-half','') %] [% fieldeditbox('reference','invoices','Referenz','','') %] [% fielddatebox('invoicedate','invoices','Datum','w3-third','')
- %] [% fielddatebox('deadlinedate','invoices','Fälligkeit','w3-third','') %] [% fieldselectbox('bquarter','invoices','G.Quartal','w3-third','') %] [% fieldmoneybox('netamount','invoices','Netto','w3-half','') %] [% fieldmoneybox('vatamount','invoices','MwSt','w3-half','')
- %] [% fieldmoneybox('grossamount','invoices','Brutto','w3-half','') %] [% fieldmoneybox('payedamount','invoices','Bezahlt','w3-half','') %] [% fieldeditbox('statement','invoices','Kontoauszug','w3-quarter','') %] [% fieldtagbox('reminderdates','invoices','Mahnungs-Daten','w3-threequarter','')
+
+
+ <div class="w3-bar w3-border-top w3-border-bottom">
+ <button class="w3-bar-item w3-button" onclick="loadtab('details');"><img src="[% abspath%][% staticpath %]img/icons/list.svg" style="height: 24px;"/> Allgemein</button>
+ <button class="w3-bar-item w3-button" onclick="loadtab('products')"><img src="[% abspath%][% staticpath %]img/icons/list.svg" style="height: 24px;"/> Produkte</button>
+ <button class="w3-bar-item w3-button" onclick="loadtab('files');"><img src="[% abspath%][% staticpath %]img/icons/list.svg" style="height: 24px;"/> Dateien</button>
+
+ </div>
+ <div class="w3-container tabpanel" id="tab_details">
+ [% fieldhidden('id','invoices','ident') %]
+ <div class="w3-cell-row">
+ [% fieldselectbox('invoicetype','invoices','Typ','w3-half','') %] [% fieldselectbox('template','invoices','Vorlage','w3-half','') %]
+ </div>
+ <div class="w3-cell-row">
+ [% fieldselectbox('status','invoices','Status','w3-quarter','') %] [% fielddatebox('statusdate','invoices','Status-Datum','w3-quarter','readonly') %] [% fieldeditbox('statement','invoices','Kontoauszug','w3-quarter','') %] [% fieldselectbox('bquarter','invoices','G.Quartal','w3-quarter','')
%]
</div>
- <div class="w3-col m6">
-
- <div class="w3-bar w3-border-top w3-border-bottom">
- <button class="w3-bar-item w3-button" onclick="loadtab('files');"><img src="[% abspath%][% staticpath %]img/icons/list.svg" style="height: 24px;"/> Dateien</button>
- <button class="w3-bar-item w3-button" onclick="loadtab('products')"><img src="[% abspath%][% staticpath %]img/icons/list.svg" style="height: 24px;"/> Produkte</button>
- </div>
- <div class="w3-container tabpanel" id="tab_products">
- <div id="tbl_products"></div>
- </div>
- <div class="w3-container tabpanel" id="tab_files" style="display: none;">
- <div id="tbl_files"></div>
- </div>
+ <div class="w3-cell-row">
+ [% fieldselectbox('id_receipient','invoices','Empfänger','w3-half','') %] [% fieldselectbox('id_sender','invoices','Sender','w3-half','') %] [% fieldeditbox('reference','invoices','Referenz','','') %]
+ </div>
+ <div class="w3-cell-row">
+ [% fielddatebox('invoicedate','invoices','Datum','w3-fifth','') %] [% fielddatebox('deadlinedate','invoices','Fälligkeit','w3-fifth','') %] [% fieldtagbox('reminderdates','invoices','Mahnungs-Daten','w3-threefifth','') %]
+ </div>
+ <div class="w3-cell-row">
+ [% fieldmoneybox('netamount','invoices','Netto','w3-quarter','') %] [% fieldmoneybox('vatamount','invoices','MwSt','w3-quarter','') %] [% fieldmoneybox('grossamount','invoices','Brutto','w3-quarter','') %] [% fieldmoneybox('payedamount','invoices','Bezahlt','w3-quarter','')
+ %]
</div>
</div>
-
-
-
-</div>
-<!-- <div class="w3-container w3-col l6"> -->
-<!-- <div class="w3-container">
- <form id="frm_documents">
- [% fieldhidden('id','documents','ident') %]
- [% fieldhidden('id_invoice','documents','') %]
- [% fieldfile('filename','documents','Datei-Auswahl','w3-half','') %]
- [% fieldselectbox('type','documents','Typ','w3-quarter','') %]
- [% forminlinesavebutton('documents','hinzufügen','w3-quarter','setinvoicefile') %]
- </form>
- </div> -->
-<!-- <iframe id="moduleframe" src="[% abspath %][% staticpath%]vendor/pdfjs/web/viewer.html" sandbox="allow-forms allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups allow-popups-to-escape-sandbox" style=" bottom: 0px;border: 0px;height: 80vh;width: 100%; overflow-y: scroll;"></iframe> -->
-<!-- </div> -->
-<!-- </div> -->
+ <div class="w3-container tabpanel" id="tab_products" style="display: none;">
+ <div id="tbl_products"></div>
+ </div>
+ <div class="w3-container tabpanel" id="tab_files" style="display: none;">
+ <div id="tbl_files"></div>
+ </div>
</div>
\ No newline at end of file
--- /dev/null
+<div class="sheet padding-10mm">
+ <div class="header" style="height: 40mm;">
+ <div class="w3-row">
+ <div class="w3-container w3-half">
+ <img src="[% abspath %][% staticpath %]img/dks_1000.png" style="width: 200px;" /><br/>
+
+ </div>
+
+ <div class="w3-container w3-half w3-right-align">
+ <span style="font-weight: bold">DKS s.à r.l.</span><br/> 8b, rue du Moulin<br/> L-3770 Tétange<br/><br/>Tel: +352 691 504 574<br/> info@dks.lu / www.dks.lu
+ </div>
+ </div>
+ </div>
+ < <div class="footer" style="height: 20mm;">
+ <div class="w3-container w3-center">
+ <span style="font-weight: bold;">DKS</span>, Société à responsabilité limitée, <span style="font-weight: bold;">RC</span> B168572 - <span style="font-weight: bold;">TVA</span>: LU 25375617 - <span style="font-weight: bold;">No. Aut:</span> 10024550 / 0
+ <br/>IBAN: LU25 0020 1100 2783 8700; BIC: BILLLULL</div>
+</div>
+
+</div>
\ No newline at end of file
--- /dev/null
+< table >
+ <
+ thead > < tr > < td >
+ <
+ div class = "header-space" > & nbsp; < /div> <
+/td></tr > < /thead> <
+tbody > < tr > < td >
+ <
+ div class = "content" > ... < /div> <
+ /td></tr > < /tbody> <
+ tfoot > < tr > < td >
+ <
+ div class = "footer-space" > & nbsp; < /div> <
+/td></tr > < /tfoot> <
+/table> <
+div class = "header" > ... < /div> <
+ div class = "footer" > ... < /div>
\ No newline at end of file
[% USE Dumper %]
[% #USE dksdb = DBI(dsn, dbuser, dbpassword) %]
-[% #USE date %]
+[% USE date %]
[% vstamp=date.format(date.now, '%d%m%Y') %]
<!DOCTYPE html>
<html lang="fr">
<script type="text/javascript" src="[% abspath %][% staticpath %]js/moduleglobal.js?v=[% vstamp %]"></script>
<script type="text/javascript" src="[% abspath %][% staticpath %]js/formsave.js?v=[% vstamp %]"></script>
<script type="text/javascript" src="[% abspath %][% staticpath %]vendor/tabulator/js/tabulator.min.js?v=[% vstamp %]"></script>
+ <script type="text/javascript" src="[% abspath %][% staticpath %]vendor/jspdf/jspdf.min.js?v=[% vstamp %]"></script>
+ <script type="text/javascript" src="[% abspath %][% staticpath %]vendor/jspdf/jspdf.plugin.autotable.min.js?v=[% vstamp %]"></script>
<script type="text/javascript" src="[% abspath %][% staticpath %]vendor/tinymce/js/tinymce/tinymce.min.js?v=[% vstamp %]"></script>
<script type="text/javascript" src="[% abspath %][% staticpath %]vendor/moment/moment.min.js?v=[% vstamp %]"></script>
<script type="text/javascript" src="[% abspath %][% staticpath %]vendor/choices/choices.js?v=[% vstamp %]"></script>
--- /dev/null
+[% USE Dumper %] [% #USE dksdb = DBI(dsn, dbuser, dbpassword) %] [% USE date %] [% vstamp=date.format(date.now, '%d%m%Y') %]
+<!DOCTYPE html>
+<html lang="fr">
+
+<head>
+ <!-- Required meta tags -->
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <title>[% adminname %] - [% module %] - [% pagename %]</title>
+ <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
+ <meta http-equiv="Pragma" content="no-cache" />
+ <meta http-equiv="Expires" content="-1" />
+ <link rel="stylesheet" href="[% abspath %][% staticpath %]vendor/normalize/normalize.css?v=[% vstamp %]">
+ <link rel="stylesheet" href="[% abspath %][% staticpath %]css/w3pro.css?v=[% vstamp %]">
+ <!-- <link rel="stylesheet" href="[% abspath %][% staticpath %]vendor/print/paper.css?v=[% vstamp %]"> -->
+ <style>
+ @page {
+ size: A4
+ }
+
+ .header {
+ margin-top: 0px;
+ }
+
+ .footer {
+ margin-bottom: 0px;
+ }
+ </style>
+</head>
+
+<body>
+
+ [% INCLUDE $page %]
+
+ <script type="text/javascript" src="[% pagename %].js?v=[% vstamp %]"></script>
+ <script>
+ var app = "[% app %]"
+ </script>
+
+</body>
+
+</html>
\ No newline at end of file
--- /dev/null
+#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+
+use strict;
+
+my $cdt = &getunixdatetime(¤t_date()." 00:00:00");
+ my $udf = $cdt;
+ my $udt = $cdt;
+ if (exists($cfg->{playlists}->{datefrom})){
+ $udf = &getunixdatetime($cfg->{playlists}->{datefrom}." 00:00:00");
+ }
+ if (exists($cfg->{playlists}->{dateto})){
+ $udt = &getunixdatetime($cfg->{playlists}->{dateto}." 00:00:00");
+ }
+ $cdt = $udf;
+ my $sname = $cfg->{playlists}->{Stream};
+ &writelog("EXPORT","Start export of playlists from ".substr(&getdatetime($udf),0,10)." to ".substr(&getdatetime($udt),0,10)." for Schedule ".$sname);
+
+ $sname =~ s/\s/\_/g;
+ my $dbname = dirname($configfile).'/'.$sname.'.sqlite';
+ $db = sqlite->new(dirname($configfile).'/'.$sname.'.sqlite');
+ my $ploutpath = dirname($configfile).'/playlists/';
+ while ($cdt <= $udt){
+ my $shortdate = substr(&getdatetime($cdt),0,10);
+ &writelog("EXPORT","Export Playlist for DATE ".$shortdate);
+ my $scheds = $db->dbquerysorted("select distinct(streamname) as schedule from playlist where plistname='".$shortdate."'");
+ foreach my $s (keys(%{$scheds})){
+ if (! -d $ploutpath.'/'.$scheds->{$s}->{schedule}){
+ make_path($ploutpath.'/'.$scheds->{$s}->{schedule});
+ }
+ print "Export for schedule: ".$scheds->{$s}->{schedule}."\n";
+ my $dpl = $db->dbquerysorted("select rm.idmusic,rm.category,rm.filename,rm.duration,rm.artist,rm.title,pl.streamname from playlist pl left join music rm on (pl.idmusic=rm.idmusic) where pl.plistname='".$shortdate."' and pl.streamname='".$scheds->{$s}->{schedule}."' order by pl.plposition");
+ open(PLX,">".$ploutpath.'/'.$scheds->{$s}->{schedule}.'/'.$shortdate.'.m3u');
+ foreach my $r (sort {$a <=> $b} keys(%{$dpl})){
+ print PLX $dpl->{$r}->{category}.'/'.$dpl->{$r}->{filename}.'|'.$dpl->{$r}->{duration}.'|'.$dpl->{$r}->{artist}.'|'.$dpl->{$r}->{title}."\n";
+ }
+ close(PLX);
+ }
+
+ $cdt = $cdt+86400;
+ }
+ print "Playlists exported to: ".$ploutpath."\n";
+
+sub getunixdatetime(){
+ #YYYY-MM-DD HH:MI:SS
+ my $dt = shift;
+ #print $dt."\n";
+ my $y1 = substr($dt,0,4);
+ my $m1 = substr($dt,5,2);
+ my $d1 = substr($dt,8,2);
+ my $h1 = substr($dt,11,2);
+ my $mn1 = substr($dt,14,2);
+ my $s1 = substr($dt,17,2);
+ my $utime = timelocal($s1,$mn1,$h1,$d1,$m1-1,$y1);
+ return $utime;
+}
+#
+sub getdatetime(){
+ my $utime = shift;
+ my @cdate = localtime($utime);
+ $cdate[5] = $cdate[5] +1900;
+ $cdate[4] = $cdate[4] +1;
+ if ($cdate[4] < 10){$cdate[4] = '0'.$cdate[4];}
+ if ($cdate[3] < 10){$cdate[3] = '0'.$cdate[3];}
+ if ($cdate[2] < 10){$cdate[2] = '0'.$cdate[2];}
+ if ($cdate[1] < 10){$cdate[1] = '0'.$cdate[1];}
+ if ($cdate[0] < 10){$cdate[0] = '0'.$cdate[0];}
+ my $cmpdate = $cdate[5].'-'.$cdate[4].'-'.$cdate[3].' '.$cdate[2].':'.$cdate[1].':'.$cdate[0];
+ return $cmpdate;
+}
+
+sub writelog(){
+ my $msg = shift;
+ my $logrow = ¤t_datetime().':'.$msg."\n";
+ print $logrow;
+}
\ No newline at end of file
--- /dev/null
+#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+
+use strict;
+use Getopt::Long;
+use File::Basename;
+use JSON::PP;
+use Time::Local;
+use FindBin qw($RealBin);
+use Data::Dumper;
+use POSIX;
+use DBI;
+use DBD::SQLite;
+use Encode;
+
+
+my $dbfile = "/Users/kilian/Workspace/dksnas/data/coloradio/aral.sqlite";
+my $datefrom = "2020-01-01";
+my $dateto = "2020-12-31";
+my $cschedule="Default";
+my $musiclistlimit=100;
+my $udf = &getunixdatetime($datefrom." 00:00:00");
+my $udt = &getunixdatetime($dateto." 00:00:00");
+my $cdt = $udf;
+my $musiclists= {};
+my $dbh = DBI->connect('DBI:SQLite:dbname='.$dbfile,"","",{PrintError=>1,AutoCommit=>1}) or die "Connection Error!".$!."\n";
+&writelog("Generate ".basename($dbfile)." Playlist from ".$datefrom." to ".$dateto);
+&dbexec("DELETE from playlist where plistname >='".substr(&getdatetime($cdt),0,10)."' and plistname <= '".substr(&getdatetime($udt),0,10)."' and streamname = '".$cschedule."';");
+while ($cdt <= $udt){
+ my $shortdate = substr(&getdatetime($cdt),0,10);
+ &writelog("Create Playlist for DATE ".$shortdate);
+ my $rotationdef = &getdayrotationdef($shortdate,$cschedule);
+ my $mids = ();
+ foreach my $e (sort {$a <=> $b} keys(%{$rotationdef})){
+ my $crot = $rotationdef->{$e};
+ my @cats = @{$crot->{categories}};
+ #print localtime.": Start at ".$crot->{timefrom}."\n";
+ #get first cat
+ my $timetofill = &getunixdatetime($shortdate." ".$crot->{timeend}.':00')-&getunixdatetime($shortdate." ".$crot->{timebegin}.':00');
+ if ($crot->{timeend} <= $crot->{timefrom}){
+ $timetofill += 86400;
+ }
+ my $ctime = 0;
+ my $cpos = 0;
+ my @audiolist = ();
+ while ($ctime < $timetofill){
+ for (my $c=0;$c<scalar(@cats);$c++){
+ #print $c."->".$cats[$c]."\n";
+ if (!exists($musiclists->{$cats[$c]}) || scalar(@{$musiclists->{$cats[$c]}}) == 0){
+ if (scalar(@audiolist) > 0){
+ &dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist));
+ @audiolist=();
+ }
+ #print "get next music category data ".$cats[$c]."\n";
+ &getmusiclist($cats[$c],$shortdate,$musiclistlimit);
+ }
+ my $data = shift(@{$musiclists->{$cats[$c]}});
+ #my $checksql = "select idmusic from playlist where idmusic='".$data->{idmusic}."' and plistname='".$shortdate."' and streamname='".$schedulename."';";
+ #my $rxx = $db->dbquerysorted($checksql);
+ if (!exists($mids->{$data->{idmusic}})){
+ push(@audiolist,"('".$shortdate."',".$cpos.",'".$cschedule."','".$data->{idmusic}."')");
+ $cpos++;
+ $ctime += $data->{duration};
+ $mids->{$data->{idmusic}} = "";
+ }
+ }
+ }
+ &dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist));
+ }
+ $cdt = $cdt+86400;
+ }
+$dbh->disconnect();
+
+
+
+sub getunixdatetime(){
+ #YYYY-MM-DD HH:MI:SS
+ my $dt = shift;
+ #print $dt."\n";
+ my $y1 = substr($dt,0,4);
+ my $m1 = substr($dt,5,2);
+ my $d1 = substr($dt,8,2);
+ my $h1 = substr($dt,11,2);
+ my $mn1 = substr($dt,14,2);
+ my $s1 = substr($dt,17,2);
+ my $utime = timelocal($s1,$mn1,$h1,$d1,$m1-1,$y1);
+ return $utime;
+}
+#
+sub getdatetime(){
+ my $utime = shift;
+ my @cdate = localtime($utime);
+ $cdate[5] = $cdate[5] +1900;
+ $cdate[4] = $cdate[4] +1;
+ if ($cdate[4] < 10){$cdate[4] = '0'.$cdate[4];}
+ if ($cdate[3] < 10){$cdate[3] = '0'.$cdate[3];}
+ if ($cdate[2] < 10){$cdate[2] = '0'.$cdate[2];}
+ if ($cdate[1] < 10){$cdate[1] = '0'.$cdate[1];}
+ if ($cdate[0] < 10){$cdate[0] = '0'.$cdate[0];}
+ my $cmpdate = $cdate[5].'-'.$cdate[4].'-'.$cdate[3].' '.$cdate[2].':'.$cdate[1].':'.$cdate[0];
+ return $cmpdate;
+}
+
+sub current_date(){
+ my @cdate = localtime();
+ $cdate[5] = $cdate[5] +1900;
+ $cdate[4] = $cdate[4] +1;
+ if ($cdate[4] < 10){$cdate[4] = '0'.$cdate[4];}
+ if ($cdate[3] < 10){$cdate[3] = '0'.$cdate[3];}
+ my $cmpdate = $cdate[5].'-'.$cdate[4].'-'.$cdate[3];
+ return $cmpdate;
+}
+
+sub current_datetime(){
+ my @cdate = localtime();
+ $cdate[5] = $cdate[5] +1900;
+ $cdate[4] = $cdate[4] +1;
+ if ($cdate[4] < 10){$cdate[4] = '0'.$cdate[4];}
+ if ($cdate[3] < 10){$cdate[3] = '0'.$cdate[3];}
+ if ($cdate[2] < 10){$cdate[2] = '0'.$cdate[2];}
+ if ($cdate[1] < 10){$cdate[1] = '0'.$cdate[1];}
+ if ($cdate[0] < 10){$cdate[0] = '0'.$cdate[0];}
+ my $cmpdate = $cdate[5].'-'.$cdate[4].'-'.$cdate[3].' '.$cdate[2].':'.$cdate[1].':'.$cdate[0];
+ return $cmpdate;
+}
+#
+sub getweekday(){
+ my $dt = shift; #YYYY-MM-DD
+ my $y1 = substr($dt,0,4);
+ my $m1 = substr($dt,5,2);
+ my $d1 = substr($dt,8,2);
+ my $utime = timelocal(0,0,0,$d1,$m1-1,$y1);
+ my @cdate = localtime($utime);
+ my @awday = qw( Sun Mon Tue Wed Thu Fri Sat );
+ return $awday[$cdate[6]]
+}
+
+sub dbexec(){
+ my $stat = shift;
+ $stat = encode("utf8", $stat);
+ my $rv =$dbh->do($stat) or print "dbexec '".$stat. "\n".$dbh->errstr()." failed!\n";
+
+ return $rv;
+}
+
+sub dbquerysorted(){
+ my $stat = shift;
+ my $retdata = ();
+ my $sth = $dbh->prepare($stat) or print "Failed prepare: ".$stat."\n";
+ $sth->execute() or print "dbquery: ".$sth->errstr."\n";
+ my $count = 0;
+ while(my $data = $sth->fetchrow_hashref()){
+ foreach my $k (keys %{$data}){
+ $retdata->{$count}->{$k} = $data->{$k};
+ }
+ $count++;
+ }
+ $sth->finish();
+ return $retdata;
+}
+
+sub dbqueryarray(){
+ my $stat = shift;
+ my @retdata = ();
+ my $sth = $dbh->prepare($stat) or print "Failed prepare: ".$stat."\n";
+ $sth->execute() or die "dbquery: ".$sth->errstr;
+ my $count = 0;
+ while(my $data = $sth->fetchrow_hashref()){
+ my $ret = {};
+ foreach my $k (keys %{$data}){
+ $ret->{$k} = $data->{$k};
+ }
+ push @retdata,$ret;
+ }
+ $sth->finish();
+ return @retdata;
+}
+
+sub writelog(){
+ my $msg = shift;
+ my $logrow = ¤t_datetime().':'.$msg."\n";
+ print $logrow;
+}
+
+sub getdayrotationdef(){
+ my $strdate = shift;
+ my $schedulename = shift;
+ my $rotdef = ();
+ my $cnt = 0;
+ # do we have a schedule?
+ my $sql = "select * from schedule where weekday = '".&getweekday($strdate)."';";
+ my $dayrot = &dbquerysorted($sql);
+ if (keys(%{$dayrot}) > 0){
+ foreach my $i (sort {$a<=>$b} keys(%{$dayrot})){
+ $sql = "select * from rotation where rotation='".$dayrot->{$i}->{rotation}."' order by position;";
+ my $hrot = &dbquerysorted($sql);
+ my $trange ={"timefrom" => $dayrot->{$i}->{start}, "timeto" => $dayrot->{$i}->{end}};
+ my @rot = ();
+ foreach my $p (sort {$a<=>$b} keys(%{$hrot})){
+ push(@rot,$hrot->{$p}->{owncategory});
+ }
+ $trange->{categories} = \@rot;
+ $rotdef->{$cnt} = $trange;
+ $cnt++;
+ }
+ }
+
+ return $rotdef;
+}
+
+sub getmusiclist(){
+ my $owncat = shift;
+ my $date = shift;
+ my $limit = shift;
+ my $msql = "select rrm.idmusic,rrm.duration from ( select mc.idmusic,bb.lastplayed,random() as rand
+ from music mc left join (select max(maxxx) as lastplayed,idmusic from (select pl.plistname || '_' || pl.plposition as maxxx,pl.idmusic from playlist pl left join music rm on (rm.idmusic=pl.idmusic) where pl.idmusic in (select idmusic from music where owncategory='".$owncat."') and plistname <'".$date."') aa group by idmusic) bb on (mc.idmusic=bb.idmusic) where mc.owncategory='".$owncat."' order by bb.lastplayed ASC LIMIT 100) cc left join music rrm on (rrm.idmusic=cc.idmusic) order by cc.rand;";
+ my @mxdata = &dbqueryarray($msql);
+ $musiclists->{$owncat} = \@mxdata;
+ #
+ #return @data;
+}
\ No newline at end of file
--- /dev/null
+#!/Users/kilian/perl5/perlbrew/perls/perl-5.24.1/bin/perl
+
+use strict;
+use Getopt::Long;
+use File::Basename;
+my $playlistpath = "";
+my $ploutpath = "";
+my
+my $sname = $cfg->{playlists}->{Stream};
+ my $snamepath = $sname;
+ $sname =~ s/\s/\_/g;
+ my $ploutpath = dirname($configfile).'/playlists';
+ # my $dbname = dirname($configfile).'/'.$sname.'.sqlite';
+ # $db = sqlite->new($dbname);
+ # &writelog("PACK","Using Database ".$dbname);
+ #my $scheds = $db->dbquerysorted("select schedulename from schedule;");
+ #foreach my $s (keys(%{$scheds})){
+ &writelog("PACK","Pack playlist schedule ".$sname."");
+ chdir($ploutpath.'/'.$snamepath);
+ my $tar = Archive::Tar->new;
+ my @files = ();
+ opendir(PLDIR,$ploutpath.'/'.$snamepath);
+
+ while (my $m3u = readdir(PLDIR)){
+ print $m3u."\n";
+ if ($m3u =~ /\.m3u$/){
+ push(@files,$m3u);
+ }
+ }
+ print Dumper(@files);
+ closedir(PLDIR);
+ $tar->add_files(@files);
+ foreach my $x (@files){
+ $tar->rename($x,'radio/playlists/'.$x);
+ }
+ my @time = gmtime();
+ my $date = strftime("%Y%m%d",@time);
+ $tar->write( $ploutpath.'/'.$sname.'_'.$date.'.tgz', COMPRESS_GZIP );
+ print $ploutpath.'/'.$sname.'_'.$date.'.tgz created!'."\n";
\ No newline at end of file
my $action = "pack";\r
my $playlistpath = "C:\\Users\\ksaff\\Workspace\\Coloradio\\exports\\playlists";\r
my $exportpath = "C:\\Users\\ksaff\\Workspace\\Coloradio\\exports";\r
-GetOptions ("config|c=s" => \$configfile , "action|a=s" => \$action);\r
+GetOptions ("database|db=s" => \$database , "action|a=s" => \$action ,"output|o=s" => \$output);\r
\r
# if (! -f $configfile){\r
# print "No config found!\n";\r
# $cfg->{playlists}->{dateto} ='2018-12-25';\r
\r
\r
-if ($action eq "checkaudio"){\r
- # my $sname = $cfg->{playlists}->{Stream};\r
- # $sname =~ s/\s/\_/g;\r
- # my $dbname = dirname($configfile).'/'.$sname.'.sqlite';\r
- # my $db = sqlite->new($dbname);\r
- foreach my $cur_au (@{$cfg->{audio}}){\r
- my $outfilename = basename($cur_au->{sourcepath});\r
- $outfilename = substr($outfilename,0,rindex($outfilename,'.')).'.'.$cfg->{converter}->{outputtype};\r
- $outfilename = $cfg->{converter}->{outpath}.$cur_au->{subpath}.'/'.$outfilename;\r
- if (! -e $cur_au->{sourcepath}){\r
- print "Source-File: ".$cur_au->{sourcepath}." does not exist!\n"; \r
- }\r
- if (! -e $outfilename){\r
- print "Out-File: ".$outfilename." does not exist!\n";\r
- }\r
- }\r
-}\r
-elsif ($action eq "updatedb" ){\r
- &update_database();\r
-}\r
-elsif ($action eq "generate"){\r
- #TODO: Create Database if not exists\r
- #UPDATE DATA in database\r
+# if ($action eq "checkaudio"){\r
+# # my $sname = $cfg->{playlists}->{Stream};\r
+# # $sname =~ s/\s/\_/g;\r
+# # my $dbname = dirname($configfile).'/'.$sname.'.sqlite';\r
+# # my $db = sqlite->new($dbname);\r
+# foreach my $cur_au (@{$cfg->{audio}}){\r
+# my $outfilename = basename($cur_au->{sourcepath});\r
+# $outfilename = substr($outfilename,0,rindex($outfilename,'.')).'.'.$cfg->{converter}->{outputtype};\r
+# $outfilename = $cfg->{converter}->{outpath}.$cur_au->{subpath}.'/'.$outfilename;\r
+# if (! -e $cur_au->{sourcepath}){\r
+# print "Source-File: ".$cur_au->{sourcepath}." does not exist!\n"; \r
+# }\r
+# if (! -e $outfilename){\r
+# print "Out-File: ".$outfilename." does not exist!\n";\r
+# }\r
+# }\r
+# }\r
+# elsif ($action eq "updatedb" ){\r
+# &update_database();\r
+# }\r
+# elsif ($action eq "generate"){\r
+# #TODO: Create Database if not exists\r
+# #UPDATE DATA in database\r
\r
- my $sname = $cfg->{playlists}->{Stream};\r
- $sname =~ s/\s/\_/g;\r
- my $dbname = dirname($configfile).'/'.$sname.'.sqlite';\r
- $db = sqlite->new($dbname);\r
- &writelog("PLAYLIST","Using Database ".$dbname);\r
- #my $scheds = $db->dbquerysorted("select schedulename from schedule");\r
+# my $sname = $cfg->{playlists}->{Stream};\r
+# $sname =~ s/\s/\_/g;\r
+# my $dbname = dirname($configfile).'/'.$sname.'.sqlite';\r
+# $db = sqlite->new($dbname);\r
+# &writelog("PLAYLIST","Using Database ".$dbname);\r
+# #my $scheds = $db->dbquerysorted("select schedulename from schedule");\r
\r
- #foreach my $sch (keys(%{$scheds})){\r
- my $cdt = &getunixdatetime(¤t_date()." 00:00:00");\r
- my $udf = $cdt;\r
- my $udt = $cdt;\r
+# #foreach my $sch (keys(%{$scheds})){\r
+# my $cdt = &getunixdatetime(¤t_date()." 00:00:00");\r
+# my $udf = $cdt;\r
+# my $udt = $cdt;\r
\r
- if (exists($cfg->{playlists}->{datefrom})){\r
- $udf = &getunixdatetime($cfg->{playlists}->{datefrom}." 00:00:00");\r
- }\r
- if (exists($cfg->{playlists}->{dateto})){\r
- $udt = &getunixdatetime($cfg->{playlists}->{dateto}." 00:00:00");\r
- }\r
- $cdt = $udf;\r
- my $cschedule = $cfg->{playlists}->{Stream};\r
- &writelog("PLAYLIST","Start Creating playlists from ".substr(&getdatetime($udf),0,10)." to ".substr(&getdatetime($udt),0,10)." for Schedule ".$cschedule);\r
+# if (exists($cfg->{playlists}->{datefrom})){\r
+# $udf = &getunixdatetime($cfg->{playlists}->{datefrom}." 00:00:00");\r
+# }\r
+# if (exists($cfg->{playlists}->{dateto})){\r
+# $udt = &getunixdatetime($cfg->{playlists}->{dateto}." 00:00:00");\r
+# }\r
+# $cdt = $udf;\r
+# my $cschedule = $cfg->{playlists}->{Stream};\r
+# &writelog("PLAYLIST","Start Creating playlists from ".substr(&getdatetime($udf),0,10)." to ".substr(&getdatetime($udt),0,10)." for Schedule ".$cschedule);\r
\r
\r
-# if ($scheds->{$sch}->{datefrom} gt ¤t_date()){\r
-# $cdt = &getunixdatetime($scheds->{$sch}->{datefrom}." 00:00:00");\r
-# }\r
-# if ($scheds->{$sch}->{dateto} lt $cfg->{playlists}->{dateto}){\r
-# $udt = &getunixdatetime($scheds->{$sch}->{dateto}." 00:00:00");\r
-# }\r
- $db->dbexec("DELETE from playlist where plistname >='".substr(&getdatetime($cdt),0,10)."' and plistname <= '".substr(&getdatetime($udt),0,10)."' and streamname = '".$cschedule."';");\r
+# # if ($scheds->{$sch}->{datefrom} gt ¤t_date()){\r
+# # $cdt = &getunixdatetime($scheds->{$sch}->{datefrom}." 00:00:00");\r
+# # }\r
+# # if ($scheds->{$sch}->{dateto} lt $cfg->{playlists}->{dateto}){\r
+# # $udt = &getunixdatetime($scheds->{$sch}->{dateto}." 00:00:00");\r
+# # }\r
+# $db->dbexec("DELETE from playlist where plistname >='".substr(&getdatetime($cdt),0,10)."' and plistname <= '".substr(&getdatetime($udt),0,10)."' and streamname = '".$cschedule."';");\r
\r
- while ($cdt <= $udt){\r
- my $shortdate = substr(&getdatetime($cdt),0,10);\r
- &writelog("PLAYLIST","Create Playlist for DATE ".$shortdate);\r
- $rotationdef = &getdayrotationdef($shortdate,$cschedule);\r
- my $mids = ();\r
- foreach my $e (sort {$a <=> $b} keys(%{$rotationdef})){\r
- my $crot = $rotationdef->{$e};\r
- my @cats = @{$crot->{categories}};\r
- #print localtime.": Start at ".$crot->{timefrom}."\n";\r
- #get first cat\r
- my $timetofill = &getunixdatetime($shortdate." ".$crot->{timeend}.':00')-&getunixdatetime($shortdate." ".$crot->{timebegin}.':00');\r
- if ($crot->{timeend} <= $crot->{timefrom}){\r
- $timetofill += 86400;\r
- }\r
- my $ctime = 0;\r
- my $cpos = 0;\r
- my @audiolist = ();\r
- while ($ctime < $timetofill){\r
- for (my $c=0;$c<scalar(@cats);$c++){\r
- #print $c."->".$cats[$c]."\n";\r
- if (!exists($musiclists->{$cats[$c]}) || scalar(@{$musiclists->{$cats[$c]}}) == 0){\r
- if (scalar(@audiolist) > 0){\r
- $db->dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist));\r
- @audiolist=();\r
- }\r
- #print "get next music category data ".$cats[$c]."\n";\r
- &getmusiclist($cats[$c],$shortdate,$musiclistlimit);\r
- }\r
- my $data = shift(@{$musiclists->{$cats[$c]}});\r
- #my $checksql = "select idmusic from playlist where idmusic='".$data->{idmusic}."' and plistname='".$shortdate."' and streamname='".$schedulename."';";\r
- #my $rxx = $db->dbquerysorted($checksql);\r
- if (!exists($mids->{$data->{idmusic}})){\r
- push(@audiolist,"('".$shortdate."',".$cpos.",'".$cschedule."','".$data->{idmusic}."')");\r
- $cpos++;\r
- $ctime += $data->{duration}; \r
- $mids->{$data->{idmusic}} = "";\r
- }\r
- }\r
- }\r
- $db->dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist));\r
- }\r
+# while ($cdt <= $udt){\r
+# my $shortdate = substr(&getdatetime($cdt),0,10);\r
+# &writelog("PLAYLIST","Create Playlist for DATE ".$shortdate);\r
+# $rotationdef = &getdayrotationdef($shortdate,$cschedule);\r
+# my $mids = ();\r
+# foreach my $e (sort {$a <=> $b} keys(%{$rotationdef})){\r
+# my $crot = $rotationdef->{$e};\r
+# my @cats = @{$crot->{categories}};\r
+# #print localtime.": Start at ".$crot->{timefrom}."\n";\r
+# #get first cat\r
+# my $timetofill = &getunixdatetime($shortdate." ".$crot->{timeend}.':00')-&getunixdatetime($shortdate." ".$crot->{timebegin}.':00');\r
+# if ($crot->{timeend} <= $crot->{timefrom}){\r
+# $timetofill += 86400;\r
+# }\r
+# my $ctime = 0;\r
+# my $cpos = 0;\r
+# my @audiolist = ();\r
+# while ($ctime < $timetofill){\r
+# for (my $c=0;$c<scalar(@cats);$c++){\r
+# #print $c."->".$cats[$c]."\n";\r
+# if (!exists($musiclists->{$cats[$c]}) || scalar(@{$musiclists->{$cats[$c]}}) == 0){\r
+# if (scalar(@audiolist) > 0){\r
+# $db->dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist));\r
+# @audiolist=();\r
+# }\r
+# #print "get next music category data ".$cats[$c]."\n";\r
+# &getmusiclist($cats[$c],$shortdate,$musiclistlimit);\r
+# }\r
+# my $data = shift(@{$musiclists->{$cats[$c]}});\r
+# #my $checksql = "select idmusic from playlist where idmusic='".$data->{idmusic}."' and plistname='".$shortdate."' and streamname='".$schedulename."';";\r
+# #my $rxx = $db->dbquerysorted($checksql);\r
+# if (!exists($mids->{$data->{idmusic}})){\r
+# push(@audiolist,"('".$shortdate."',".$cpos.",'".$cschedule."','".$data->{idmusic}."')");\r
+# $cpos++;\r
+# $ctime += $data->{duration}; \r
+# $mids->{$data->{idmusic}} = "";\r
+# }\r
+# }\r
+# }\r
+# $db->dbexec("INSERT INTO playlist (plistname,plposition,streamname,idmusic) VALUES ".join(",",@audiolist));\r
+# }\r
\r
- #print Dumper($rdef);\r
- $cdt = $cdt+86400;\r
- }\r
-}\r
+# #print Dumper($rdef);\r
+# $cdt = $cdt+86400;\r
+# }\r
+# }\r
elsif ($action eq "export"){\r
my $cdt = &getunixdatetime(¤t_date()." 00:00:00");\r
my $udf = $cdt;\r
my $date = shift;\r
my $limit = shift;\r
\r
- # for Postgresql: \r
- #my $msql = "select rrm.idmusic,rrm.duration from (\r
- #select mc.idmusic,bb.lastplayed,random() as rand from musicowncategory mc left join (select max(maxxx) as lastplayed,idmusic from (select pl.plistname::TEXT || '_' || pl.plposition::TEXT as maxxx,pl.idmusic from playlist pl left join rotationmusic rm on (rm.idmusic=pl.idmusic) where pl.idmusic in (select idmusic from musicowncategory where idowncategory='".$owncat."') and plistname <'".$date."') aa group by idmusic) bb on (mc.idmusic=bb.idmusic) where mc.idowncategory='".$owncat."' order by bb.lastplayed ASC NULLS FIRST LIMIT ".$limit.") cc left join rotationmusic rrm on (rrm.idmusic=cc.idmusic) order by cc.rand;";\r
- #for sqlite\r
+ \r
my $msql = "select rrm.idmusic,rrm.duration from ( select mc.idmusic,bb.lastplayed,random() as rand \r
from music mc left join (select max(maxxx) as lastplayed,idmusic from (select pl.plistname || '_' || pl.plposition as maxxx,pl.idmusic from playlist pl left join music rm on (rm.idmusic=pl.idmusic) where pl.idmusic in (select idmusic from music where owncategory='".$owncat."') and plistname <'".$date."') aa group by idmusic) bb on (mc.idmusic=bb.idmusic) where mc.owncategory='".$owncat."' order by bb.lastplayed ASC LIMIT 100) cc left join music rrm on (rrm.idmusic=cc.idmusic) order by cc.rand;";\r
- # my $msql = "select rrm.idmusic,rrm.duration from (\r
- # select mc.idmusic,bb.lastplayed,random() as rand from musicowncategory mc left join (select max(maxxx) as lastplayed,idmusic from (select pl.plistname || '_' || pl.plposition as maxxx,pl.idmusic from playlist pl left join rotationmusic rm on (rm.idmusic=pl.idmusic) where pl.idmusic in (select idmusic from musicowncategory where idowncategory='".$owncat."') and plistname <'".$date."') aa group by idmusic) bb on (mc.idmusic=bb.idmusic) where mc.idowncategory='".$owncat."' order by bb.lastplayed ASC LIMIT ".$limit.") cc left join rotationmusic rrm on (rrm.idmusic=cc.idmusic) order by cc.rand;";\r
my @mxdata = $db->dbqueryarray($msql);\r
$musiclists->{$owncat} = \@mxdata;\r
#\r
/*!
*
- * jsPDF AutoTable plugin v3.2.4
+ * jsPDF AutoTable plugin v3.2.11
*
* Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
* Licensed under the MIT License.
"use strict";
+var __spreadArrays = (this && this.__spreadArrays) || function () {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+ r[k] = a[j];
+ return r;
+};
Object.defineProperty(exports, "__esModule", { value: true });
var config_1 = __webpack_require__(2);
var state_1 = __webpack_require__(0);
function getStringWidth(text, styles) {
applyStyles(styles);
var textArr = Array.isArray(text) ? text : [text];
- var doc = state_1.default().doc;
var widestLineWidth = textArr
- .map(doc.getStringUnitWidth.bind(doc))
+ .map(function (text) { return state_1.default().doc.getTextWidth(text); })
// Shave off a few digits for potential improvement in width calculation
.map(function (val) { return Math.floor(val * 10000) / 10000; })
- .reduce(Math.max, 0);
+ .reduce(function (a, b) { return Math.max(a, b); }, 0);
var fontSize = styles.fontSize / state_1.default().scaleFactor();
- return widestLineWidth * fontSize;
+ return widestLineWidth;
}
exports.getStringWidth = getStringWidth;
/**
exports.marginOrPadding = marginOrPadding;
function styles(styles) {
styles = Array.isArray(styles) ? styles : [styles];
- return polyfills_1.assign.apply(void 0, [config_1.defaultStyles()].concat(styles));
+ return polyfills_1.assign.apply(void 0, __spreadArrays([config_1.defaultStyles()], styles));
}
exports.styles = styles;
text = content != null ? '' + content : '';
var splitRegex = /\r\n|\r|\n/g;
this.text = text.split(splitRegex);
- this.contentWidth = this.padding('horizontal') + common_1.getStringWidth(this.text, this.styles);
- if (typeof this.styles.cellWidth === 'number') {
- this.minWidth = this.styles.cellWidth;
- this.wrappedWidth = this.styles.cellWidth;
- }
- else if (this.styles.cellWidth === 'wrap') {
- this.minWidth = this.contentWidth;
- this.wrappedWidth = this.contentWidth;
- }
- else { // auto
- var defaultMinWidth = 10 / state_1.default().scaleFactor();
- this.minWidth = this.styles.minCellWidth || defaultMinWidth;
- this.wrappedWidth = this.contentWidth;
- if (this.minWidth > this.wrappedWidth) {
- this.wrappedWidth = this.minWidth;
- }
- }
}
Cell.prototype.getContentHeight = function () {
var lineCount = Array.isArray(this.text) ? this.text.length : 1;
console.error("Column widths too wide and can't fit page");
}
var copy = table.columns.slice(0);
- var diffWidth = table.width - table.wrappedWidth;
- distributeWidth(copy, diffWidth, table.wrappedWidth);
+ distributeWidth(copy, table.width, table.wrappedWidth);
applyColSpans(table);
fitContent(table);
applyRowSpans(table);
rowSpanHeight.count--;
}
}
-function distributeWidth(autoColumns, diffWidth, wrappedAutoColumnsWidth) {
+function distributeWidth(autoColumns, availableSpace, wrappedAutoColumnsWidth) {
+ var diffWidth = availableSpace - wrappedAutoColumnsWidth;
for (var i = 0; i < autoColumns.length; i++) {
var column = autoColumns[i];
var ratio = column.wrappedWidth / wrappedAutoColumnsWidth;
var suggestedChange = diffWidth * ratio;
var suggestedWidth = column.wrappedWidth + suggestedChange;
- if (suggestedWidth >= column.minWidth) {
- column.width = suggestedWidth;
+ var hasCustomWidth = false;
+ for (var _i = 0, _a = state_1.default().table.allRows(); _i < _a.length; _i++) {
+ var row = _a[_i];
+ var cell = row.cells[column.index];
+ if (cell && typeof cell.styles.cellWidth === 'number') {
+ hasCustomWidth = true;
+ break;
+ }
}
- else {
- // We can't reduce the width of this column. Mark as none auto column and start over
+ if (suggestedWidth < column.minWidth || hasCustomWidth) {
// Add 1 to minWidth as linebreaks calc otherwise sometimes made two rows
column.width = column.minWidth + 1 / state_1.default().scaleFactor();
wrappedAutoColumnsWidth -= column.wrappedWidth;
+ availableSpace -= column.width;
autoColumns.splice(i, 1);
- distributeWidth(autoColumns, diffWidth, wrappedAutoColumnsWidth);
+ distributeWidth(autoColumns, availableSpace, wrappedAutoColumnsWidth);
break;
}
+ column.width = suggestedWidth;
}
}
"use strict";
+var __spreadArrays = (this && this.__spreadArrays) || function () {
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
+ r[k] = a[j];
+ return r;
+};
Object.defineProperty(exports, "__esModule", { value: true });
var models_1 = __webpack_require__(4);
var config_1 = __webpack_require__(2);
};
var _loop_1 = function (styleProp) {
var styles = allOptions.map(function (opts) { return opts[styleProp] || {}; });
- table.styles[styleProp] = polyfills_1.assign.apply(void 0, [{}].concat(styles));
+ table.styles[styleProp] = polyfills_1.assign.apply(void 0, __spreadArrays([{}], styles));
};
// Merge styles one level deeper
for (var _i = 0, _a = Object.keys(table.styles); _i < _a.length; _i++) {
}
}
}
- table.settings = polyfills_1.assign.apply(void 0, [{}, config_1.defaultConfig()].concat(allOptions));
+ table.settings = polyfills_1.assign.apply(void 0, __spreadArrays([{}, config_1.defaultConfig()], allOptions));
table.settings.margin = common_1.marginOrPadding(table.settings.margin, config_1.defaultConfig().margin);
if (table.settings.theme === 'auto') {
table.settings.theme = table.settings.useCss ? 'plain' : 'striped';
var sectionName = _a[_i];
_loop_2(sectionName);
}
+ table.allRows().forEach(function (row) {
+ for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {
+ var column = _a[_i];
+ var cell = row.cells[column.index];
+ if (!cell)
+ continue;
+ table.callCellHooks(table.cellHooks.didParseCell, cell, row, column);
+ cell.contentWidth = cell.padding('horizontal') + common_1.getStringWidth(cell.text, cell.styles);
+ if (typeof cell.styles.cellWidth === 'number') {
+ cell.minWidth = cell.styles.cellWidth;
+ cell.wrappedWidth = cell.styles.cellWidth;
+ }
+ else if (cell.styles.cellWidth === 'wrap') {
+ cell.minWidth = cell.contentWidth;
+ cell.wrappedWidth = cell.contentWidth;
+ }
+ else { // auto
+ var defaultMinWidth = 10 / state_1.default().scaleFactor();
+ cell.minWidth = cell.styles.minCellWidth || defaultMinWidth;
+ cell.wrappedWidth = cell.contentWidth;
+ if (cell.minWidth > cell.wrappedWidth) {
+ cell.wrappedWidth = cell.minWidth;
+ }
+ }
+ }
+ });
table.allRows().forEach(function (row) {
for (var _i = 0, _a = table.columns; _i < _a.length; _i++) {
var column = _a[_i];
// not accounted for
var columnStyles = table.styles.columnStyles[column.dataKey] || table.styles.columnStyles[column.index] || {};
var cellWidth = columnStyles.cellWidth;
- if (cellWidth) {
+ if (cellWidth && typeof cellWidth === 'number') {
column.minWidth = cellWidth;
column.wrappedWidth = cellWidth;
}
}
- // Make sure all columns get at least min width even though width calculations are not based on them
- if (cell && cell.colSpan > 1 && !column.minWidth) {
- column.minWidth = cell.minWidth;
- }
- if (cell && cell.colSpan > 1 && !column.wrappedWidth) {
- column.wrappedWidth = cell.minWidth;
+ if (cell) {
+ // Make sure all columns get at least min width even though width calculations are not based on them
+ if (cell.colSpan > 1 && !column.minWidth) {
+ column.minWidth = cell.minWidth;
+ }
+ if (cell.colSpan > 1 && !column.wrappedWidth) {
+ column.wrappedWidth = cell.minWidth;
+ }
+ table.callCellHooks(table.cellHooks.didParseCell, cell, row, column);
}
- table.callCellHooks(table.cellHooks.didParseCell, cell, row, column);
}
});
}
Object.keys(firstRow_1)
.filter(function (key) { return key !== '_element'; })
.forEach(function (key) {
- var colSpan = firstRow_1[key].colSpan || 1;
+ var colSpan = firstRow_1[key] && firstRow_1[key].colSpan ? firstRow_1[key].colSpan : 1;
for (var i = 0; i < colSpan; i++) {
var id = void 0;
if (Array.isArray(firstRow_1)) {
var columnStyles = table.styles.columnStyles[column.dataKey] || table.styles.columnStyles[column.index] || {};
var colStyles = sectionName === 'body' ? columnStyles : {};
var rowStyles = sectionName === 'body' && rowIndex % 2 === 0 ? polyfills_1.assign({}, theme.alternateRow, table.styles.alternateRowStyles) : {};
- return polyfills_1.assign.apply(void 0, [config_1.defaultStyles()].concat(otherStyles.concat([rowStyles, colStyles])));
+ return polyfills_1.assign.apply(void 0, __spreadArrays([config_1.defaultStyles()], __spreadArrays(otherStyles, [rowStyles, colStyles])));
}
/*!
*
- * jsPDF AutoTable plugin v3.2.4
+ * jsPDF AutoTable plugin v3.2.11
*
* Copyright (c) 2014 Simon Bengtsson, https://github.com/simonbengtsson/jsPDF-AutoTable
* Licensed under the MIT License.
* * /if (typeof window === 'object') window.jspdfAutoTableVersion = '" + newVersion + "';/*"
*
*/
-!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jspdf"));else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var n="object"==typeof exports?e(require("jspdf")):e(t.jsPDF);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,function(n){return i={},r.m=o=[function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,r=null,i=null;n.globalDefaults={},n.documentDefaults={},n.default=function(){return i},n.getGlobalOptions=function(){return n.globalDefaults},n.getDocumentOptions=function(){return n.documentDefaults};var l=(a.prototype.pageHeight=function(){return this.pageSize().height},a.prototype.pageWidth=function(){return this.pageSize().width},a.prototype.pageSize=function(){var t=this.doc.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},a.prototype.scaleFactor=function(){return this.doc.internal.scaleFactor},a.prototype.pageNumber=function(){var t=this.doc.internal.getCurrentPageInfo();return t?t.pageNumber:this.doc.internal.getNumberOfPages()},a);function a(t){this.doc=t}n.setupState=function(t){o=i,i=new l(t),t!==r&&(r=t,n.documentDefaults={})},n.resetState=function(){i=o},n.setDefaults=function(t,e){void 0===e&&(e=null),e?(n.documentDefaults=t||{},r=e):n.globalDefaults=t||{}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),a=n(0),r=n(3);function s(t,e){l(e);var n=Array.isArray(t)?t:[t],o=a.default().doc;return n.map(o.getStringUnitWidth.bind(o)).map(function(t){return Math.floor(1e4*t)/1e4}).reduce(Math.max,0)*(e.fontSize/a.default().scaleFactor())}function i(t){var e=0<t.lineWidth,n=t.fillColor||0===t.fillColor;return e&&n?"DF":e?"S":!!n&&"F"}function l(o){var t=a.default().doc,r={fillColor:t.setFillColor,textColor:t.setTextColor,fontStyle:t.setFontStyle,lineColor:t.setDrawColor,lineWidth:t.setLineWidth,font:t.setFont,fontSize:t.setFontSize};Object.keys(r).forEach(function(t){var e=o[t],n=r[t];void 0!==e&&(Array.isArray(e)?n.apply(this,e):n(e))})}e.getStringWidth=s,e.ellipsize=function n(t,o,r,i){if(void 0===i&&(i="..."),Array.isArray(t)){var l=[];return t.forEach(function(t,e){l[e]=n(t,o,r,i)}),l}var e=1e4*a.default().scaleFactor();if((o=Math.ceil(o*e)/e)>=s(t,r))return t;for(;o<s(t+i,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+i},e.addTableBorder=function(){var t=a.default().table,e={lineWidth:t.settings.tableLineWidth,lineColor:t.settings.tableLineColor};l(e);var n=i(e);n&&a.default().doc.rect(t.pageStartX,t.pageStartY,t.width,t.cursor.y-t.pageStartY,n)},e.getFillStyle=i,e.applyUserStyles=function(){l(a.default().table.userStyles)},e.applyStyles=l,e.marginOrPadding=function(t,e){var n={};if(Array.isArray(t))4<=t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?n={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var o=0,r=["top","right","bottom","left"];o<r.length;o++){var i=r[o];n[i]=t[i]||0===t[i]?t[i]:e}}return"number"==typeof t&&(n={top:t,right:t,bottom:t,left:t}),n},e.styles=function(t){return t=Array.isArray(t)?t:[t],r.assign.apply(void 0,[o.defaultStyles()].concat(t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FONT_ROW_RATIO=1.15;var o=n(0);e.defaultConfig=function(){return{html:null,head:null,body:null,foot:null,includeHiddenHtml:!1,startY:null,margin:40/o.default().scaleFactor(),pageBreak:"auto",rowPageBreak:"auto",tableWidth:"auto",showHead:"everyPage",showFoot:"everyPage",tableLineWidth:0,tableLineColor:200,tableId:null,theme:"striped",useCss:!1,styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{},didParseCell:function(t){},willDrawCell:function(t){},didDrawCell:function(t){},didDrawPage:function(t){}}},e.defaultStyles=function(){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/o.default().scaleFactor(),lineColor:200,lineWidth:0/o.default().scaleFactor(),cellWidth:"auto",minCellHeight:0}},e.getTheme=function(t){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[t]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=n(2),a=n(0),s=n(10),d=n(1),u=n(5),o=function(){this.didParseCell=[],this.willDrawCell=[],this.didDrawCell=[],this.didDrawPage=[]},r=(Object.defineProperty(i.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),i.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},i.prototype.callCellHooks=function(t,e,n,o){for(var r=0,i=t;r<i.length;r++)if(!1===(0,i[r])(new s.CellHookData(e,n,o)))return!1;return!0},i.prototype.callEndPageHooks=function(){d.applyUserStyles();for(var t=0,e=this.cellHooks.didDrawPage;t<e.length;t++)(0,e[t])(new s.HookData)},i.prototype.margin=function(t){return d.marginOrPadding(this.settings.margin,l.defaultConfig().margin)[t]},i);function i(){this.columns=[],this.head=[],this.body=[],this.foot=[],this.height=0,this.width=0,this.preferredWidth=0,this.wrappedWidth=0,this.minWidth=0,this.headHeight=0,this.footHeight=0,this.startPageNumber=1,this.pageNumber=1,this.styles={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},this.cellHooks=new o}e.Table=r;var c=(Object.defineProperty(h.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),h.prototype.canEntireRowFit=function(t){return this.maxCellHeight<=t},h.prototype.getMinimumRowHeight=function(){var i=this;return a.default().table.columns.reduce(function(t,e){var n=i.cells[e.index];if(!n)return 0;var o=n.styles.fontSize/a.default().scaleFactor()*l.FONT_ROW_RATIO,r=n.padding("vertical")+o;return t<r?r:t},0)},h);function h(t,e,n){this.cells={},this.height=0,this.maxCellHeight=0,this.pageNumber=1,this.spansMultiplePages=!1,(this.raw=t)._element&&(this.raw=t._element),this.index=e,this.section=n}e.Row=c;var f=(g.prototype.getContentHeight=function(){return(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/a.default().scaleFactor()*l.FONT_ROW_RATIO)+this.padding("vertical")},g.prototype.padding=function(t){var e=d.marginOrPadding(this.styles.cellPadding,d.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},g);function g(t,e,n){var o;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minWidth=0,this.textPos={},this.height=0,this.width=0,this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=u(e,t&&t.styles||{}),this.section=n;var r=t&&null!=t.content?t.content:t;r=r&&null!=r.title?r.title:r,this.raw=t&&t._element?t._element:t,o=null!=r?""+r:"";if(this.text=o.split(/\r\n|\r|\n/g),this.contentWidth=this.padding("horizontal")+d.getStringWidth(this.text,this.styles),"number"==typeof this.styles.cellWidth)this.minWidth=this.styles.cellWidth,this.wrappedWidth=this.styles.cellWidth;else if("wrap"===this.styles.cellWidth)this.minWidth=this.contentWidth,this.wrappedWidth=this.contentWidth;else{var i=10/a.default().scaleFactor();this.minWidth=this.styles.minCellWidth||i,this.wrappedWidth=this.contentWidth,this.minWidth>this.wrappedWidth&&(this.wrappedWidth=this.minWidth)}}e.Cell=f;function p(t,e,n){this.preferredWidth=0,this.minWidth=0,this.wrappedWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}e.Column=p},function(t,e,n){"use strict";
+!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("jspdf"));else if("function"==typeof define&&define.amd)define(["jspdf"],e);else{var n="object"==typeof exports?e(require("jspdf")):e(t.jsPDF);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}(window,function(n){return i={},r.m=o=[function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,r=null,i=null;n.globalDefaults={},n.documentDefaults={},n.default=function(){return i},n.getGlobalOptions=function(){return n.globalDefaults},n.getDocumentOptions=function(){return n.documentDefaults};var l=(a.prototype.pageHeight=function(){return this.pageSize().height},a.prototype.pageWidth=function(){return this.pageSize().width},a.prototype.pageSize=function(){var t=this.doc.internal.pageSize;return null==t.width&&(t={width:t.getWidth(),height:t.getHeight()}),t},a.prototype.scaleFactor=function(){return this.doc.internal.scaleFactor},a.prototype.pageNumber=function(){var t=this.doc.internal.getCurrentPageInfo();return t?t.pageNumber:this.doc.internal.getNumberOfPages()},a);function a(t){this.doc=t}n.setupState=function(t){o=i,i=new l(t),t!==r&&(r=t,n.documentDefaults={})},n.resetState=function(){i=o},n.setDefaults=function(t,e){void 0===e&&(e=null),e?(n.documentDefaults=t||{},r=e):n.globalDefaults=t||{}}},function(t,e,n){"use strict";var o=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],l=0,a=i.length;l<a;l++,r++)o[r]=i[l];return o};Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),a=n(0),i=n(3);function s(t,e){d(e);var n=(Array.isArray(t)?t:[t]).map(function(t){return a.default().doc.getTextWidth(t)}).map(function(t){return Math.floor(1e4*t)/1e4}).reduce(function(t,e){return Math.max(t,e)},0);e.fontSize,a.default().scaleFactor();return n}function l(t){var e=0<t.lineWidth,n=t.fillColor||0===t.fillColor;return e&&n?"DF":e?"S":!!n&&"F"}function d(o){var t=a.default().doc,r={fillColor:t.setFillColor,textColor:t.setTextColor,fontStyle:t.setFontStyle,lineColor:t.setDrawColor,lineWidth:t.setLineWidth,font:t.setFont,fontSize:t.setFontSize};Object.keys(r).forEach(function(t){var e=o[t],n=r[t];void 0!==e&&(Array.isArray(e)?n.apply(this,e):n(e))})}e.getStringWidth=s,e.ellipsize=function n(t,o,r,i){if(void 0===i&&(i="..."),Array.isArray(t)){var l=[];return t.forEach(function(t,e){l[e]=n(t,o,r,i)}),l}var e=1e4*a.default().scaleFactor();if((o=Math.ceil(o*e)/e)>=s(t,r))return t;for(;o<s(t+i,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+i},e.addTableBorder=function(){var t=a.default().table,e={lineWidth:t.settings.tableLineWidth,lineColor:t.settings.tableLineColor};d(e);var n=l(e);n&&a.default().doc.rect(t.pageStartX,t.pageStartY,t.width,t.cursor.y-t.pageStartY,n)},e.getFillStyle=l,e.applyUserStyles=function(){d(a.default().table.userStyles)},e.applyStyles=d,e.marginOrPadding=function(t,e){var n={};if(Array.isArray(t))4<=t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[3]}:3===t.length?n={top:t[0],right:t[1],bottom:t[2],left:t[1]}:2===t.length?n={top:t[0],right:t[1],bottom:t[0],left:t[1]}:t=1===t.length?t[0]:e;else if("object"==typeof t){t.vertical&&(t.top=t.vertical,t.bottom=t.vertical),t.horizontal&&(t.right=t.horizontal,t.left=t.horizontal);for(var o=0,r=["top","right","bottom","left"];o<r.length;o++){var i=r[o];n[i]=t[i]||0===t[i]?t[i]:e}}return"number"==typeof t&&(n={top:t,right:t,bottom:t,left:t}),n},e.styles=function(t){return t=Array.isArray(t)?t:[t],i.assign.apply(void 0,o([r.defaultStyles()],t))}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FONT_ROW_RATIO=1.15;var o=n(0);e.defaultConfig=function(){return{html:null,head:null,body:null,foot:null,includeHiddenHtml:!1,startY:null,margin:40/o.default().scaleFactor(),pageBreak:"auto",rowPageBreak:"auto",tableWidth:"auto",showHead:"everyPage",showFoot:"everyPage",tableLineWidth:0,tableLineColor:200,tableId:null,theme:"striped",useCss:!1,styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{},didParseCell:function(t){},willDrawCell:function(t){},didDrawCell:function(t){},didDrawPage:function(t){}}},e.defaultStyles=function(){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/o.default().scaleFactor(),lineColor:200,lineWidth:0/o.default().scaleFactor(),cellWidth:"auto",minCellHeight:0}},e.getTheme=function(t){return{striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}}[t]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.assign=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(null!=i)for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(o[l]=i[l])}return o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=n(2),a=n(0),s=n(10),o=n(1),i=n(5),r=function(){this.didParseCell=[],this.willDrawCell=[],this.didDrawCell=[],this.didDrawPage=[]},d=(Object.defineProperty(u.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),u.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},u.prototype.callCellHooks=function(t,e,n,o){for(var r=0,i=t;r<i.length;r++)if(!1===(0,i[r])(new s.CellHookData(e,n,o)))return!1;return!0},u.prototype.callEndPageHooks=function(){o.applyUserStyles();for(var t=0,e=this.cellHooks.didDrawPage;t<e.length;t++)(0,e[t])(new s.HookData)},u.prototype.margin=function(t){return o.marginOrPadding(this.settings.margin,l.defaultConfig().margin)[t]},u);function u(){this.columns=[],this.head=[],this.body=[],this.foot=[],this.height=0,this.width=0,this.preferredWidth=0,this.wrappedWidth=0,this.minWidth=0,this.headHeight=0,this.footHeight=0,this.startPageNumber=1,this.pageNumber=1,this.styles={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},this.cellHooks=new r}e.Table=d;var c=(Object.defineProperty(h.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),h.prototype.canEntireRowFit=function(t){return this.maxCellHeight<=t},h.prototype.getMinimumRowHeight=function(){var i=this;return a.default().table.columns.reduce(function(t,e){var n=i.cells[e.index];if(!n)return 0;var o=n.styles.fontSize/a.default().scaleFactor()*l.FONT_ROW_RATIO,r=n.padding("vertical")+o;return t<r?r:t},0)},h);function h(t,e,n){this.cells={},this.height=0,this.maxCellHeight=0,this.pageNumber=1,this.spansMultiplePages=!1,(this.raw=t)._element&&(this.raw=t._element),this.index=e,this.section=n}e.Row=c;var f=(g.prototype.getContentHeight=function(){return(Array.isArray(this.text)?this.text.length:1)*(this.styles.fontSize/a.default().scaleFactor()*l.FONT_ROW_RATIO)+this.padding("vertical")},g.prototype.padding=function(t){var e=o.marginOrPadding(this.styles.cellPadding,o.styles([]).cellPadding);return"vertical"===t?e.top+e.bottom:"horizontal"===t?e.left+e.right:e[t]},g);function g(t,e,n){var o;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minWidth=0,this.textPos={},this.height=0,this.width=0,this.rowSpan=t&&t.rowSpan||1,this.colSpan=t&&t.colSpan||1,this.styles=i(e,t&&t.styles||{}),this.section=n;var r=t&&null!=t.content?t.content:t;r=r&&null!=r.title?r.title:r,this.raw=t&&t._element?t._element:t,o=null!=r?""+r:"";this.text=o.split(/\r\n|\r|\n/g)}e.Cell=f;function p(t,e,n){this.preferredWidth=0,this.minWidth=0,this.wrappedWidth=0,this.width=0,this.dataKey=t,this.raw=e,this.index=n}e.Column=p},function(t,e,n){"use strict";
/*
object-assign
(c) Sindre Sorhus
@license MIT
-*/var s=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,o,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),i=1;i<arguments.length;i++){for(var l in n=Object(arguments[i]))d.call(n,l)&&(r[l]=n[l]);if(s){o=s(n);for(var a=0;a<o.length;a++)u.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var f=n(13),g=n(0);function a(t,e,n,o){var r=[];if(!e)return r;for(var i=0;i<e.rows.length;i++){for(var l=e.rows[i],a=[],s=o?f.parseCss(l,g.default().scaleFactor(),["cellPadding","lineWidth","lineColor"]):{},d=0;d<l.cells.length;d++){var u=l.cells[d],c=t.getComputedStyle(u);if(n||"none"!==c.display){var h=o?f.parseCss(u,g.default().scaleFactor()):{};a.push({rowSpan:u.rowSpan,colSpan:u.colSpan,styles:o?h:null,_element:u,content:p(u)})}}0<a.length&&(n||"none"!==s.display)&&(a._element=l,r.push(a))}return r}function p(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split("<br>").map(function(t){return t.trim()}).join("\n"),e.innerText||e.textContent||""}e.parseHtml=function(t,e,n){var o;if(void 0===e&&(e=!1),void 0===n&&(n=!1),o="string"==typeof t?window.document.querySelector(t):t){for(var r=a(window,o.tHead,e,n),i=[],l=0;l<o.tBodies.length;l++)i=i.concat(a(window,o.tBodies[l],e,n));return{head:r,body:i,foot:a(window,o.tFoot,e,n)}}console.error("Html table could not be found with input: ",t)}},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),r=n(11),i=n(12),l=n(0);n(15);var a=n(1),s=n(6),d=n(7);d.API.autoTable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];l.setupState(this);var n=i.parseInput(t);return r.calculateWidths(n),o.drawTable(n),n.finalY=n.cursor.y,this.previousAutoTable=n,this.lastAutoTable=n,this.autoTable.previous=n,a.applyUserStyles(),l.resetState(),this},d.API.lastAutoTable=!1,d.API.previousAutoTable=!1,d.API.autoTable.previous=!1,d.API.autoTableSetDefaults=function(t){return l.setDefaults(t,this),this},d.autoTableSetDefaults=function(t,e){return l.setDefaults(t,e),this},d.API.autoTableHtmlToJson=function(t,e){if(e=e||!1,!(t&&t instanceof HTMLTableElement))return console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson"),null;var n=s.parseHtml(t,e,!1),o=n.head,r=n.body,i=n.foot;return{columns:o[0]||r[0]||i[0],rows:r,data:r}},d.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.previousAutoTable.finalY instead.");var t=this.previousAutoTable;return t.cursor&&"number"==typeof t.cursor.y?t.cursor.y:0},d.API.autoTableAddPageContent=function(t){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),d.API.autoTable.globalDefaults||(d.API.autoTable.globalDefaults={}),d.API.autoTable.globalDefaults.addPageContent=t,this},d.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var m=n(2),a=n(1),b=n(4),v=n(0),w=n(5);function l(t,e,n){var o,r,i,l,a,s=new b.Row(t.raw,-1,t.section);s.spansMultiplePages=!0,t.spansMultiplePages=!0,t.height=0;for(var d=t.maxCellHeight=0,u=n.columns;d<u.length;d++){var c=u[d];if(y=t.cells[c.index]){Array.isArray(y.text)||(y.text=[y.text]);var h=new b.Cell(y.raw,{},y.section);(h=w(h,y)).textPos=w({},y.textPos),h.text=[];var f=(r=e,void 0,i=(o=y).styles.fontSize/v.default().scaleFactor()*m.FONT_ROW_RATIO,l=o.padding("vertical"),a=Math.floor((r-l)/i),Math.max(0,a));y.text.length>f&&(h.text=y.text.splice(f,y.text.length)),y.contentHeight=y.getContentHeight(),y.contentHeight>t.height&&(t.height=y.contentHeight,t.maxCellHeight=y.contentHeight),h.contentHeight=h.getContentHeight(),h.contentHeight>s.height&&(s.height=h.contentHeight,s.maxCellHeight=h.contentHeight),s.cells[c.index]=h}}for(var g=0,p=n.columns;g<p.length;g++){var y;c=p[g];(h=s.cells[c.index])&&(h.height=s.height),(y=t.cells[c.index])&&(y.height=t.height)}return s}function s(n,t,e){var o=v.default().pageHeight()-(e.margin("top")-e.margin("bottom")),r=n.getMinimumRowHeight()<t;if(n.getMinimumRowHeight()>o)return console.error("Will not be able to print row "+n.index+" correctly since it's minimum height is larger than page height"),!0;var i=0<e.columns.filter(function(t){var e=n.cells[t.index];return!!e&&1<e.rowSpan}).length;return r&&(n.maxCellHeight>o?(i&&console.error("The content of row "+n.index+" will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported."),!0):!i&&"avoid"!==e.settings.rowPageBreak)}function d(t){var e=v.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var n=0,o=e.columns;n<o.length;n++){var r=o[n],i=t.cells[r.index];if(i)if(a.applyStyles(i.styles),i.x=e.cursor.x,i.y=t.y,"top"===i.styles.valign?i.textPos.y=e.cursor.y+i.padding("top"):"bottom"===i.styles.valign?i.textPos.y=e.cursor.y+i.height-i.padding("bottom"):i.textPos.y=e.cursor.y+i.height/2,"right"===i.styles.halign?i.textPos.x=i.x+i.width-i.padding("right"):"center"===i.styles.halign?i.textPos.x=i.x+i.width/2:i.textPos.x=i.x+i.padding("left"),!1!==e.callCellHooks(e.cellHooks.willDrawCell,i,t,r)){var l=a.getFillStyle(i.styles);l&&v.default().doc.rect(i.x,e.cursor.y,i.width,i.height,l),v.default().doc.autoTableText(i.text,i.textPos.x,i.textPos.y,{halign:i.styles.halign,valign:i.styles.valign,maxWidth:Math.ceil(i.width-i.padding("left")-i.padding("right"))}),e.callCellHooks(e.cellHooks.didDrawCell,i,t,r),e.cursor.x+=r.width}else e.cursor.x+=r.width;else e.cursor.x+=r.width}e.cursor.y+=t.height}function u(t){var e=v.default().table,n=e.margin("bottom"),o=e.settings.showFoot;return(!0===o||"everyPage"===o||"lastPage"===o&&t)&&(n+=e.footHeight),v.default().pageHeight()-e.cursor.y-n}function c(){var t=v.default().table;a.applyUserStyles(),!0!==t.settings.showFoot&&"everyPage"!==t.settings.showFoot||t.foot.forEach(function(t){return d(t)}),t.finalY=t.cursor.y,t.callEndPageHooks(),a.addTableBorder(),o(v.default().doc),t.pageNumber++,t.cursor={x:t.margin("left"),y:t.margin("top")},t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,!0!==t.settings.showHead&&"everyPage"!==t.settings.showHead||t.head.forEach(function(t){return d(t)})}function o(t){var e=v.default().pageNumber();t.setPage(e+1),v.default().pageNumber()===e&&t.addPage()}e.drawTable=function(n){var t=n.settings;n.cursor={x:n.margin("left"),y:null==t.startY?n.margin("top"):t.startY};var e=t.startY+n.margin("bottom")+n.headHeight+n.footHeight;"avoid"===t.pageBreak&&(e+=n.height),("always"===t.pageBreak||null!=t.startY&&!1!==t.startY&&e>v.default().pageHeight())&&(o(v.default().doc),n.cursor.y=n.margin("top")),n.pageStartX=n.cursor.x,n.pageStartY=n.cursor.y,n.startPageNumber=v.default().pageNumber(),a.applyUserStyles(),!0!==t.showHead&&"firstPage"!==t.showHead&&"everyPage"!==t.showHead||n.head.forEach(function(t){return d(t)}),a.applyUserStyles(),n.body.forEach(function(t,e){!function t(e,n){var o=v.default().table;var r=u(n);if(e.canEntireRowFit(r))d(e);else if(s(e,r,o)){var i=l(e,r,o);d(e),c(),t(i,n)}else c(),t(e,n)}(t,e===n.body.length-1)}),a.applyUserStyles(),!0!==t.showFoot&&"lastPage"!==t.showFoot&&"everyPage"!==t.showFoot||n.foot.forEach(function(t){return d(t)}),a.addTableBorder(),n.callEndPageHooks()},e.addPage=c},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),l=(Object.defineProperty(a.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),a);function a(){var t=i.default().table;this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=i.default().doc}e.HookData=l;var s,d=(r(u,s=l),u);function u(t,e,n){var o=s.call(this)||this;return o.cell=t,o.row=e,o.column=n,o.section=e.section,o}e.CellHookData=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var c=n(1),h=n(0);e.calculateWidths=function(t){10/h.default().scaleFactor()*t.columns.length>t.width?console.error("Columns could not fit on page"):t.minWidth>t.width&&console.error("Column widths too wide and can't fit page"),function t(e,n,o){for(var r=0;r<e.length;r++){var i=e[r],l=i.wrappedWidth/o,a=n*l,s=i.wrappedWidth+a;if(!(s>=i.minWidth)){i.width=i.minWidth+1/h.default().scaleFactor(),o-=i.wrappedWidth,e.splice(r,1),t(e,n,o);break}i.width=s}}(t.columns.slice(0),t.width-t.wrappedWidth,t.wrappedWidth),function(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var o=e[n],r=null,i=0,l=0,a=0;a<t.columns.length;a++){var s=t.columns[a],d=null;if(1<(l-=1)&&t.columns[a+1])i+=s.width,delete o.cells[s.index];else{if(r)d=r,delete o.cells[s.index],r=null;else{if(!(d=o.cells[s.index]))continue;if(l=d.colSpan,i=0,1<d.colSpan){r=d,i+=s.width;continue}}d.width=s.width+i}}}(t),function(t){for(var e={count:0,height:0},n=0,o=t.allRows();n<o.length;n++){for(var r=o[n],i=0,l=t.columns;i<l.length;i++){var a=l[i],s=r.cells[a.index];if(s){c.applyStyles(s.styles);var d=s.width-s.padding("horizontal");"linebreak"===s.styles.overflow?s.text=h.default().doc.splitTextToSize(s.text,d+1/(h.default().scaleFactor()||1),{fontSize:s.styles.fontSize}):"ellipsize"===s.styles.overflow?s.text=c.ellipsize(s.text,d,s.styles):"hidden"===s.styles.overflow?s.text=c.ellipsize(s.text,d,s.styles,""):"function"==typeof s.styles.overflow&&(s.text=s.styles.overflow(s.text,d)),s.contentHeight=s.getContentHeight(),s.styles.minCellHeight>s.contentHeight&&(s.contentHeight=s.styles.minCellHeight);var u=s.contentHeight/s.rowSpan;1<s.rowSpan&&e.count*e.height<u*s.rowSpan?e={height:u,count:s.rowSpan}:e&&0<e.count&&e.height>u&&(u=e.height),u>r.height&&(r.height=u,r.maxCellHeight=u)}}e.count--}}(t),function(t){for(var e={},n=1,o=t.allRows(),r=0;r<o.length;r++){for(var i=o[r],l=0,a=t.columns;l<a.length;l++){var s=a[l],d=e[s.index];if(1<n)n--,delete i.cells[s.index];else if(d)d.cell.height+=i.height,d.cell.height>i.maxCellHeight&&(d.row.maxCellHeight=d.cell.height),n=d.cell.colSpan,delete i.cells[s.index],d.left--,d.left<=1&&delete e[s.index];else{var u=i.cells[s.index];if(!u)continue;if(u.height=i.height,1<u.rowSpan){var c=o.length-r,h=u.rowSpan>c?c:u.rowSpan;e[s.index]={cell:u,left:h,row:i}}}}"head"===i.section&&(t.headHeight+=i.maxCellHeight),"foot"===i.section&&(t.footHeight+=i.maxCellHeight),t.height+=i.height}}(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var C=n(4),W=n(2),m=n(6),H=n(3),b=n(1),O=n(0),v=n(14);e.parseInput=function(t){var e=function(t){{if(1===t.length)return t[0];var e=t[2]||{};return e.body=t[1],e.columns=t[0],e.columns.forEach(function(t){"object"==typeof t&&null==t.header&&(t.header=t.title)}),e}}(t),n=[O.getGlobalOptions(),O.getDocumentOptions(),e];v.default(n);var o=new C.Table;(O.default().table=o).id=e.tableId;var r=O.default().doc;o.userStyles={textColor:r.getTextColor?r.getTextColor():0,fontSize:r.internal.getFontSize(),fontStyle:r.internal.getFont().fontStyle,font:r.internal.getFont().fontName};for(var i=function(e){var t=n.map(function(t){return t[e]||{}});o.styles[e]=H.assign.apply(void 0,[{}].concat(t))},l=0,a=Object.keys(o.styles);l<a.length;l++){i(a[l])}for(var s=0,d=n;s<d.length;s++)for(var u=d[s],c=0,h=Object.keys(o.cellHooks);c<h.length;c++){var f=h[c];u&&"function"==typeof u[f]&&o.cellHooks[f].push(u[f])}o.settings=H.assign.apply(void 0,[{},W.defaultConfig()].concat(n)),o.settings.margin=b.marginOrPadding(o.settings.margin,W.defaultConfig().margin),"auto"===o.settings.theme&&(o.settings.theme=o.settings.useCss?"plain":"striped"),!1===o.settings.startY&&delete o.settings.startY;var g=O.default().doc.previousAutoTable,p=g&&g.startPageNumber+g.pageNumber-1===O.default().pageNumber();null==o.settings.startY&&p&&(o.settings.startY=g.finalY+20/O.default().scaleFactor());var y={};return o.settings.html&&(y=m.parseHtml(o.settings.html,o.settings.includeHiddenHtml,o.settings.useCss)||{}),o.settings.head=y.head||o.settings.head||[],o.settings.body=y.body||o.settings.body||[],o.settings.foot=y.foot||o.settings.foot||[],function(P){var n=P.settings;P.columns=function(t){{if(t.columns)return t.columns.map(function(t,e){var n=t.dataKey||t.key||e;return new C.Column(n,t,e)});var r=t.head[0]||t.body[0]||t.foot[0]||[],i=[];return Object.keys(r).filter(function(t){return"_element"!==t}).forEach(function(t){for(var e=r[t].colSpan||1,n=0;n<e;n++){var o=void 0;o=Array.isArray(r)?i.length:t+(0<n?"_"+n:""),i.push(new C.Column(o,o,i.length))}}),i}}(n);for(var t=function(x){var S={},t=n[x];if(0===t.length&&n.columns&&"body"!==x){var e=function(t,o){var r={};return t.columns.forEach(function(t){var e=t.raw;if("head"===o){var n=e&&e.header?e.header:e;n&&(r[t.dataKey]=n)}else"foot"===o&&e.footer&&(r[t.dataKey]=e.footer)}),0<Object.keys(r).length?r:null}(P,x);e&&t.push(e)}t.forEach(function(t,e){var n=0,o=new C.Row(t,e,x);P[x].push(o);for(var r,i,l,a,s,d,u,c,h,f=0,g=0,p=0,y=P.columns;p<y.length;p++){var m=y[p];if(null==S[m.index]||0===S[m.index].left)if(0===g){var b=void 0;b=Array.isArray(t)?t[m.index-f-n]:t[m.dataKey];var v=(r=x,i=m,l=e,d=void 0,a=O.default().table,s=W.getTheme(a.settings.theme),d=[s.table,s[r],a.styles.styles,a.styles[r+"Styles"]],u=a.styles.columnStyles[i.dataKey]||a.styles.columnStyles[i.index]||{},c="body"===r?u:{},h="body"===r&&l%2==0?H.assign({},s.alternateRow,a.styles.alternateRowStyles):{},H.assign.apply(void 0,[W.defaultStyles()].concat(d.concat([h,c])))),w=new C.Cell(b,v,x);o.cells[m.dataKey]=w,g=(o.cells[m.index]=w).colSpan-1,S[m.index]={left:w.rowSpan-1,times:g}}else g--,f++;else S[m.index].left--,g=S[m.index].times,n++}})},e=0,o=["head","body","foot"];e<o.length;e++){t(o[e])}P.allRows().forEach(function(t){for(var e=0,n=P.columns;e<n.length;e++){var o=n[e],r=t.cells[o.index];if(r&&1===r.colSpan)r.wrappedWidth>o.wrappedWidth&&(o.wrappedWidth=r.wrappedWidth),r.minWidth>o.minWidth&&(o.minWidth=r.minWidth);else{var i=(P.styles.columnStyles[o.dataKey]||P.styles.columnStyles[o.index]||{}).cellWidth;i&&(o.minWidth=i,o.wrappedWidth=i)}r&&1<r.colSpan&&!o.minWidth&&(o.minWidth=r.minWidth),r&&1<r.colSpan&&!o.wrappedWidth&&(o.wrappedWidth=r.minWidth),P.callCellHooks(P.cellHooks.didParseCell,r,t,o)}})}(o),o.minWidth=o.columns.reduce(function(t,e){return t+e.minWidth},0),o.wrappedWidth=o.columns.reduce(function(t,e){return t+e.wrappedWidth},0),"number"==typeof o.settings.tableWidth?o.width=o.settings.tableWidth:"wrap"===o.settings.tableWidth?o.width=o.wrappedWidth:o.width=O.default().pageWidth()-o.margin("left")-o.margin("right"),o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),s=n(0);function d(t,e){var n=function t(e,n){if(!e)return null;var o=window.getComputedStyle(e)[n];return"rgba(0, 0, 0, 0)"===o||"transparent"===o||"initial"===o||"inherit"===o?t(e.parentElement,n):o}(t,e);if(!n)return null;var o=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!o||!Array.isArray(o))return null;var r=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])];return 0===parseInt(o[4])||isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}e.parseCss=function(t,e,o){void 0===o&&(o=[]);var r={},n=window.getComputedStyle(t);function i(t,e,n){void 0===n&&(n=[]),0!==n.length&&-1===n.indexOf(e)||-1!==o.indexOf(t)||0!==e&&!e||(r[t]=e)}i("fillColor",d(t,"backgroundColor")),i("fontStyle",function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||700<=parseInt(t.fontWeight))&&(e+="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(n)),i("textColor",d(t,"color")),i("halign",n.textAlign,["left","right","center","justify"]),i("valign",n.verticalAlign,["middle","bottom","top"]),i("fontSize",parseInt(n.fontSize||"")/(96/72)),i("cellPadding",function(t,e,n,o){if(!t)return null;var r=96/(72/o),i=(parseInt(n)-parseInt(e))/o/2,l=t.split(" ").map(function(t){return parseInt(t)/r});l=a.marginOrPadding(l,0),i>l.top&&(l.top=i);i>l.bottom&&(l.bottom=i);return l}(n.padding,n.fontSize,n.lineHeight,e)),i("lineWidth",parseInt(n.borderTopWidth||"")/(96/72)/e),i("lineColor",d(t,"borderTopColor"));var l=(n.fontFamily||"").toLowerCase();return s.default().doc.getFontList()[l]&&i("font",l),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=n(1);function a(t){t.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),t.minCellHeight||(t.minCellHeight=t.rowHeight)):t.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),t.cellWidth||(t.cellWidth=t.columnWidth))}e.default=function(t){for(var e=function(o){o&&"object"!=typeof o&&console.error("The options parameter should be of type object, is: "+typeof o),void 0!==o.extendWidth&&(o.tableWidth=o.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==o.margins&&(void 0===o.margin&&(o.margin=o.margins),console.error("Use of deprecated option: margins, use margin instead.")),o.startY&&"number"!=typeof o.startY&&(console.error("Invalid value for startY option",o.startY),delete o.startY),!o.didDrawPage&&(o.afterPageContent||o.beforePageContent||o.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),o.didDrawPage=function(t){l.applyUserStyles(),o.beforePageContent&&o.beforePageContent(t),l.applyUserStyles(),o.afterPageContent&&o.afterPageContent(t),l.applyUserStyles(),o.afterPageAdd&&1<t.pageNumber&&t.afterPageAdd(t),l.applyUserStyles()}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach(function(t){o[t]&&console.error('The "'+t+'" hook has changed in version 3.0, check the changelog for how to migrate.')}),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach(function(t){var e=t[0],n=t[1];o[n]&&(console.error("Use of deprecated option "+n+". Use "+e+" instead"),o[e]=o[n])}),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach(function(t){var e="string"==typeof t?t:t[0],n="string"==typeof t?t:t[1];void 0!==o[e]&&(void 0===o.styles[n]&&(o.styles[n]=o[e]),console.error("Use of deprecated option: "+e+", use the style "+n+" instead."))});for(var t=0,e=["styles","bodyStyles","headStyles","footStyles"];t<e.length;t++){a(o[e[t]]||{})}for(var n=o.columnStyles||{},r=0,i=Object.keys(n);r<i.length;r++){a(n[i[r]]||{})}},n=0,o=t;n<o.length;n++){e(o[n])}}},function(t,e,n){n(7).API.autoTableText=function(t,e,n,o){o=o||{};"number"==typeof e&&"number"==typeof n||console.error("The x and y parameters are required. Missing for text: ",t);var r=this.internal.scaleFactor,i=this.internal.getFontSize()/r,l=null,a=1;if("middle"!==o.valign&&"bottom"!==o.valign&&"center"!==o.halign&&"right"!==o.halign||(a=(l="string"==typeof t?t.split(/\r\n|\r|\n/g):t).length||1),n+=i*(2-1.15),"middle"===o.valign?n-=a/2*i*1.15:"bottom"===o.valign&&(n-=a*i*1.15),"center"===o.halign||"right"===o.halign){var s=i;if("center"===o.halign&&(s*=.5),1<=a){for(var d=0;d<l.length;d++)this.text(l[d],e-this.getStringUnitWidth(l[d])*s,n),n+=1.15*i;return this}e-=this.getStringUnitWidth(t)*s}return"justify"===o.halign?this.text(t,e,n,{maxWidth:o.maxWidth||100,align:"justify"}):this.text(t,e,n),this}}],r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8);function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return o[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}var o,i});
\ No newline at end of file
+*/var s=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable;t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(t){o[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,o,r=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),i=1;i<arguments.length;i++){for(var l in n=Object(arguments[i]))d.call(n,l)&&(r[l]=n[l]);if(s){o=s(n);for(var a=0;a<o.length;a++)u.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var f=n(13),g=n(0);function a(t,e,n,o){var r=[];if(!e)return r;for(var i=0;i<e.rows.length;i++){for(var l=e.rows[i],a=[],s=o?f.parseCss(l,g.default().scaleFactor(),["cellPadding","lineWidth","lineColor"]):{},d=0;d<l.cells.length;d++){var u=l.cells[d],c=t.getComputedStyle(u);if(n||"none"!==c.display){var h=o?f.parseCss(u,g.default().scaleFactor()):{};a.push({rowSpan:u.rowSpan,colSpan:u.colSpan,styles:o?h:null,_element:u,content:p(u)})}}0<a.length&&(n||"none"!==s.display)&&(a._element=l,r.push(a))}return r}function p(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split("<br>").map(function(t){return t.trim()}).join("\n"),e.innerText||e.textContent||""}e.parseHtml=function(t,e,n){var o;if(void 0===e&&(e=!1),void 0===n&&(n=!1),o="string"==typeof t?window.document.querySelector(t):t){for(var r=a(window,o.tHead,e,n),i=[],l=0;l<o.tBodies.length;l++)i=i.concat(a(window,o.tBodies[l],e,n));return{head:r,body:i,foot:a(window,o.tFoot,e,n)}}console.error("Html table could not be found with input: ",t)}},function(t,e){t.exports=n},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=n(9),r=n(11),i=n(12),l=n(0);n(15);var a=n(1),s=n(6),d=n(7);d.API.autoTable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];l.setupState(this);var n=i.parseInput(t);return r.calculateWidths(n),o.drawTable(n),n.finalY=n.cursor.y,this.previousAutoTable=n,this.lastAutoTable=n,this.autoTable.previous=n,a.applyUserStyles(),l.resetState(),this},d.API.lastAutoTable=!1,d.API.previousAutoTable=!1,d.API.autoTable.previous=!1,d.API.autoTableSetDefaults=function(t){return l.setDefaults(t,this),this},d.autoTableSetDefaults=function(t,e){return l.setDefaults(t,e),this},d.API.autoTableHtmlToJson=function(t,e){if(e=e||!1,!(t&&t instanceof HTMLTableElement))return console.error("A HTMLTableElement has to be sent to autoTableHtmlToJson"),null;var n=s.parseHtml(t,e,!1),o=n.head,r=n.body,i=n.foot;return{columns:o[0]||r[0]||i[0],rows:r,data:r}},d.API.autoTableEndPosY=function(){console.error("Use of deprecated function: autoTableEndPosY. Use doc.previousAutoTable.finalY instead.");var t=this.previousAutoTable;return t.cursor&&"number"==typeof t.cursor.y?t.cursor.y:0},d.API.autoTableAddPageContent=function(t){return console.error("Use of deprecated function: autoTableAddPageContent. Use jsPDF.autoTableSetDefaults({didDrawPage: () => {}}) instead."),d.API.autoTable.globalDefaults||(d.API.autoTable.globalDefaults={}),d.API.autoTable.globalDefaults.addPageContent=t,this},d.API.autoTableAddPage=function(){return console.error("Use of deprecated function: autoTableAddPage. Use doc.addPage()"),this.addPage(),this}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var m=n(2),a=n(1),v=n(4),b=n(0),w=n(5);function l(t,e,n){var o,r,i,l,a,s=new v.Row(t.raw,-1,t.section);s.spansMultiplePages=!0,t.spansMultiplePages=!0,t.height=0;for(var d=t.maxCellHeight=0,u=n.columns;d<u.length;d++){var c=u[d];if(y=t.cells[c.index]){Array.isArray(y.text)||(y.text=[y.text]);var h=new v.Cell(y.raw,{},y.section);(h=w(h,y)).textPos=w({},y.textPos),h.text=[];var f=(r=e,void 0,i=(o=y).styles.fontSize/b.default().scaleFactor()*m.FONT_ROW_RATIO,l=o.padding("vertical"),a=Math.floor((r-l)/i),Math.max(0,a));y.text.length>f&&(h.text=y.text.splice(f,y.text.length)),y.contentHeight=y.getContentHeight(),y.contentHeight>t.height&&(t.height=y.contentHeight,t.maxCellHeight=y.contentHeight),h.contentHeight=h.getContentHeight(),h.contentHeight>s.height&&(s.height=h.contentHeight,s.maxCellHeight=h.contentHeight),s.cells[c.index]=h}}for(var g=0,p=n.columns;g<p.length;g++){var y;c=p[g];(h=s.cells[c.index])&&(h.height=s.height),(y=t.cells[c.index])&&(y.height=t.height)}return s}function s(n,t,e){var o=b.default().pageHeight()-(e.margin("top")-e.margin("bottom")),r=n.getMinimumRowHeight()<t;if(n.getMinimumRowHeight()>o)return console.error("Will not be able to print row "+n.index+" correctly since it's minimum height is larger than page height"),!0;var i=0<e.columns.filter(function(t){var e=n.cells[t.index];return!!e&&1<e.rowSpan}).length;return r&&(n.maxCellHeight>o?(i&&console.error("The content of row "+n.index+" will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported."),!0):!i&&"avoid"!==e.settings.rowPageBreak)}function d(t){var e=b.default().table;e.cursor.x=e.margin("left"),t.y=e.cursor.y,t.x=e.cursor.x;for(var n=0,o=e.columns;n<o.length;n++){var r=o[n],i=t.cells[r.index];if(i)if(a.applyStyles(i.styles),i.x=e.cursor.x,i.y=t.y,"top"===i.styles.valign?i.textPos.y=e.cursor.y+i.padding("top"):"bottom"===i.styles.valign?i.textPos.y=e.cursor.y+i.height-i.padding("bottom"):i.textPos.y=e.cursor.y+i.height/2,"right"===i.styles.halign?i.textPos.x=i.x+i.width-i.padding("right"):"center"===i.styles.halign?i.textPos.x=i.x+i.width/2:i.textPos.x=i.x+i.padding("left"),!1!==e.callCellHooks(e.cellHooks.willDrawCell,i,t,r)){var l=a.getFillStyle(i.styles);l&&b.default().doc.rect(i.x,e.cursor.y,i.width,i.height,l),b.default().doc.autoTableText(i.text,i.textPos.x,i.textPos.y,{halign:i.styles.halign,valign:i.styles.valign,maxWidth:Math.ceil(i.width-i.padding("left")-i.padding("right"))}),e.callCellHooks(e.cellHooks.didDrawCell,i,t,r),e.cursor.x+=r.width}else e.cursor.x+=r.width;else e.cursor.x+=r.width}e.cursor.y+=t.height}function u(t){var e=b.default().table,n=e.margin("bottom"),o=e.settings.showFoot;return(!0===o||"everyPage"===o||"lastPage"===o&&t)&&(n+=e.footHeight),b.default().pageHeight()-e.cursor.y-n}function c(){var t=b.default().table;a.applyUserStyles(),!0!==t.settings.showFoot&&"everyPage"!==t.settings.showFoot||t.foot.forEach(function(t){return d(t)}),t.finalY=t.cursor.y,t.callEndPageHooks(),a.addTableBorder(),o(b.default().doc),t.pageNumber++,t.cursor={x:t.margin("left"),y:t.margin("top")},t.pageStartX=t.cursor.x,t.pageStartY=t.cursor.y,!0!==t.settings.showHead&&"everyPage"!==t.settings.showHead||t.head.forEach(function(t){return d(t)})}function o(t){var e=b.default().pageNumber();t.setPage(e+1),b.default().pageNumber()===e&&t.addPage()}e.drawTable=function(n){var t=n.settings;n.cursor={x:n.margin("left"),y:null==t.startY?n.margin("top"):t.startY};var e=t.startY+n.margin("bottom")+n.headHeight+n.footHeight;"avoid"===t.pageBreak&&(e+=n.height),("always"===t.pageBreak||null!=t.startY&&!1!==t.startY&&e>b.default().pageHeight())&&(o(b.default().doc),n.cursor.y=n.margin("top")),n.pageStartX=n.cursor.x,n.pageStartY=n.cursor.y,n.startPageNumber=b.default().pageNumber(),a.applyUserStyles(),!0!==t.showHead&&"firstPage"!==t.showHead&&"everyPage"!==t.showHead||n.head.forEach(function(t){return d(t)}),a.applyUserStyles(),n.body.forEach(function(t,e){!function t(e,n){var o=b.default().table;var r=u(n);if(e.canEntireRowFit(r))d(e);else if(s(e,r,o)){var i=l(e,r,o);d(e),c(),t(i,n)}else c(),t(e,n)}(t,e===n.body.length-1)}),a.applyUserStyles(),!0!==t.showFoot&&"lastPage"!==t.showFoot&&"everyPage"!==t.showFoot||n.foot.forEach(function(t){return d(t)}),a.addTableBorder(),n.callEndPageHooks()},e.addPage=c},function(t,e,n){"use strict";var o,r=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),l=(Object.defineProperty(a.prototype,"pageCount",{get:function(){return this.pageNumber},enumerable:!0,configurable:!0}),a);function a(){var t=i.default().table;this.table=t,this.pageNumber=t.pageNumber,this.settings=t.settings,this.cursor=t.cursor,this.doc=i.default().doc}e.HookData=l;var s,d=(r(u,s=l),u);function u(t,e,n){var o=s.call(this)||this;return o.cell=t,o.row=e,o.column=n,o.section=e.section,o}e.CellHookData=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var c=n(1),p=n(0);e.calculateWidths=function(t){10/p.default().scaleFactor()*t.columns.length>t.width?console.error("Columns could not fit on page"):t.minWidth>t.width&&console.error("Column widths too wide and can't fit page"),function t(e,n,o){var r=n-o;for(var i=0;i<e.length;i++){for(var l=e[i],a=l.wrappedWidth/o,s=r*a,d=l.wrappedWidth+s,u=!1,c=0,h=p.default().table.allRows();c<h.length;c++){var f=h[c],g=f.cells[l.index];if(g&&"number"==typeof g.styles.cellWidth){u=!0;break}}if(d<l.minWidth||u){l.width=l.minWidth+1/p.default().scaleFactor(),o-=l.wrappedWidth,n-=l.width,e.splice(i,1),t(e,n,o);break}l.width=d}}(t.columns.slice(0),t.width,t.wrappedWidth),function(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var o=e[n],r=null,i=0,l=0,a=0;a<t.columns.length;a++){var s=t.columns[a],d=null;if(1<(l-=1)&&t.columns[a+1])i+=s.width,delete o.cells[s.index];else{if(r)d=r,delete o.cells[s.index],r=null;else{if(!(d=o.cells[s.index]))continue;if(l=d.colSpan,i=0,1<d.colSpan){r=d,i+=s.width;continue}}d.width=s.width+i}}}(t),function(t){for(var e={count:0,height:0},n=0,o=t.allRows();n<o.length;n++){for(var r=o[n],i=0,l=t.columns;i<l.length;i++){var a=l[i],s=r.cells[a.index];if(s){c.applyStyles(s.styles);var d=s.width-s.padding("horizontal");"linebreak"===s.styles.overflow?s.text=p.default().doc.splitTextToSize(s.text,d+1/(p.default().scaleFactor()||1),{fontSize:s.styles.fontSize}):"ellipsize"===s.styles.overflow?s.text=c.ellipsize(s.text,d,s.styles):"hidden"===s.styles.overflow?s.text=c.ellipsize(s.text,d,s.styles,""):"function"==typeof s.styles.overflow&&(s.text=s.styles.overflow(s.text,d)),s.contentHeight=s.getContentHeight(),s.styles.minCellHeight>s.contentHeight&&(s.contentHeight=s.styles.minCellHeight);var u=s.contentHeight/s.rowSpan;1<s.rowSpan&&e.count*e.height<u*s.rowSpan?e={height:u,count:s.rowSpan}:e&&0<e.count&&e.height>u&&(u=e.height),u>r.height&&(r.height=u,r.maxCellHeight=u)}}e.count--}}(t),function(t){for(var e={},n=1,o=t.allRows(),r=0;r<o.length;r++){for(var i=o[r],l=0,a=t.columns;l<a.length;l++){var s=a[l],d=e[s.index];if(1<n)n--,delete i.cells[s.index];else if(d)d.cell.height+=i.height,d.cell.height>i.maxCellHeight&&(d.row.maxCellHeight=d.cell.height),n=d.cell.colSpan,delete i.cells[s.index],d.left--,d.left<=1&&delete e[s.index];else{var u=i.cells[s.index];if(!u)continue;if(u.height=i.height,1<u.rowSpan){var c=o.length-r,h=u.rowSpan>c?c:u.rowSpan;e[s.index]={cell:u,left:h,row:i}}}}"head"===i.section&&(t.headHeight+=i.maxCellHeight),"foot"===i.section&&(t.footHeight+=i.maxCellHeight),t.height+=i.height}}(t)}},function(t,e,n){"use strict";var C=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var o=Array(t),r=0;for(e=0;e<n;e++)for(var i=arguments[e],l=0,a=i.length;l<a;l++,r++)o[r]=i[l];return o};Object.defineProperty(e,"__esModule",{value:!0});var W=n(4),H=n(2),m=n(6),O=n(3),v=n(1),T=n(0),b=n(14);e.parseInput=function(t){var e=function(t){{if(1===t.length)return t[0];var e=t[2]||{};return e.body=t[1],e.columns=t[0],e.columns.forEach(function(t){"object"==typeof t&&null==t.header&&(t.header=t.title)}),e}}(t),n=[T.getGlobalOptions(),T.getDocumentOptions(),e];b.default(n);var o=new W.Table;(T.default().table=o).id=e.tableId;var r=T.default().doc;o.userStyles={textColor:r.getTextColor?r.getTextColor():0,fontSize:r.internal.getFontSize(),fontStyle:r.internal.getFont().fontStyle,font:r.internal.getFont().fontName};for(var i=function(e){var t=n.map(function(t){return t[e]||{}});o.styles[e]=O.assign.apply(void 0,C([{}],t))},l=0,a=Object.keys(o.styles);l<a.length;l++){i(a[l])}for(var s=0,d=n;s<d.length;s++)for(var u=d[s],c=0,h=Object.keys(o.cellHooks);c<h.length;c++){var f=h[c];u&&"function"==typeof u[f]&&o.cellHooks[f].push(u[f])}o.settings=O.assign.apply(void 0,C([{},H.defaultConfig()],n)),o.settings.margin=v.marginOrPadding(o.settings.margin,H.defaultConfig().margin),"auto"===o.settings.theme&&(o.settings.theme=o.settings.useCss?"plain":"striped"),!1===o.settings.startY&&delete o.settings.startY;var g=T.default().doc.previousAutoTable,p=g&&g.startPageNumber+g.pageNumber-1===T.default().pageNumber();null==o.settings.startY&&p&&(o.settings.startY=g.finalY+20/T.default().scaleFactor());var y={};return o.settings.html&&(y=m.parseHtml(o.settings.html,o.settings.includeHiddenHtml,o.settings.useCss)||{}),o.settings.head=y.head||o.settings.head||[],o.settings.body=y.body||o.settings.body||[],o.settings.foot=y.foot||o.settings.foot||[],function(P){var n=P.settings;P.columns=function(t){{if(t.columns)return t.columns.map(function(t,e){var n=t.dataKey||t.key||e;return new W.Column(n,t,e)});var r=t.head[0]||t.body[0]||t.foot[0]||[],i=[];return Object.keys(r).filter(function(t){return"_element"!==t}).forEach(function(t){for(var e=r[t]&&r[t].colSpan?r[t].colSpan:1,n=0;n<e;n++){var o=void 0;o=Array.isArray(r)?i.length:t+(0<n?"_"+n:""),i.push(new W.Column(o,o,i.length))}}),i}}(n);for(var t=function(x){var S={},t=n[x];if(0===t.length&&n.columns&&"body"!==x){var e=function(t,o){var r={};return t.columns.forEach(function(t){var e=t.raw;if("head"===o){var n=e&&e.header?e.header:e;n&&(r[t.dataKey]=n)}else"foot"===o&&e.footer&&(r[t.dataKey]=e.footer)}),0<Object.keys(r).length?r:null}(P,x);e&&t.push(e)}t.forEach(function(t,e){var n=0,o=new W.Row(t,e,x);P[x].push(o);for(var r,i,l,a,s,d,u,c,h,f=0,g=0,p=0,y=P.columns;p<y.length;p++){var m=y[p];if(null==S[m.index]||0===S[m.index].left)if(0===g){var v=void 0;v=Array.isArray(t)?t[m.index-f-n]:t[m.dataKey];var b=(r=x,i=m,l=e,void 0,a=T.default().table,s=H.getTheme(a.settings.theme),d=[s.table,s[r],a.styles.styles,a.styles[r+"Styles"]],u=a.styles.columnStyles[i.dataKey]||a.styles.columnStyles[i.index]||{},c="body"===r?u:{},h="body"===r&&l%2==0?O.assign({},s.alternateRow,a.styles.alternateRowStyles):{},O.assign.apply(void 0,C([H.defaultStyles()],C(d,[h,c])))),w=new W.Cell(v,b,x);o.cells[m.dataKey]=w,g=(o.cells[m.index]=w).colSpan-1,S[m.index]={left:w.rowSpan-1,times:g}}else g--,f++;else S[m.index].left--,g=S[m.index].times,n++}})},e=0,o=["head","body","foot"];e<o.length;e++){t(o[e])}P.allRows().forEach(function(t){for(var e=0,n=P.columns;e<n.length;e++){var o=n[e],r=t.cells[o.index];if(r)if(P.callCellHooks(P.cellHooks.didParseCell,r,t,o),r.contentWidth=r.padding("horizontal")+v.getStringWidth(r.text,r.styles),"number"==typeof r.styles.cellWidth)r.minWidth=r.styles.cellWidth,r.wrappedWidth=r.styles.cellWidth;else if("wrap"===r.styles.cellWidth)r.minWidth=r.contentWidth,r.wrappedWidth=r.contentWidth;else{var i=10/T.default().scaleFactor();r.minWidth=r.styles.minCellWidth||i,r.wrappedWidth=r.contentWidth,r.minWidth>r.wrappedWidth&&(r.wrappedWidth=r.minWidth)}}}),P.allRows().forEach(function(t){for(var e=0,n=P.columns;e<n.length;e++){var o=n[e],r=t.cells[o.index];if(r&&1===r.colSpan)r.wrappedWidth>o.wrappedWidth&&(o.wrappedWidth=r.wrappedWidth),r.minWidth>o.minWidth&&(o.minWidth=r.minWidth);else{var i=(P.styles.columnStyles[o.dataKey]||P.styles.columnStyles[o.index]||{}).cellWidth;i&&"number"==typeof i&&(o.minWidth=i,o.wrappedWidth=i)}r&&(1<r.colSpan&&!o.minWidth&&(o.minWidth=r.minWidth),1<r.colSpan&&!o.wrappedWidth&&(o.wrappedWidth=r.minWidth),P.callCellHooks(P.cellHooks.didParseCell,r,t,o))}})}(o),o.minWidth=o.columns.reduce(function(t,e){return t+e.minWidth},0),o.wrappedWidth=o.columns.reduce(function(t,e){return t+e.wrappedWidth},0),"number"==typeof o.settings.tableWidth?o.width=o.settings.tableWidth:"wrap"===o.settings.tableWidth?o.width=o.wrappedWidth:o.width=T.default().pageWidth()-o.margin("left")-o.margin("right"),o}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),s=n(0);function d(t,e){var n=function t(e,n){if(!e)return null;var o=window.getComputedStyle(e)[n];return"rgba(0, 0, 0, 0)"===o||"transparent"===o||"initial"===o||"inherit"===o?t(e.parentElement,n):o}(t,e);if(!n)return null;var o=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!o||!Array.isArray(o))return null;var r=[parseInt(o[1]),parseInt(o[2]),parseInt(o[3])];return 0===parseInt(o[4])||isNaN(r[0])||isNaN(r[1])||isNaN(r[2])?null:r}e.parseCss=function(t,e,o){void 0===o&&(o=[]);var r={},n=window.getComputedStyle(t);function i(t,e,n){void 0===n&&(n=[]),0!==n.length&&-1===n.indexOf(e)||-1!==o.indexOf(t)||0!==e&&!e||(r[t]=e)}i("fillColor",d(t,"backgroundColor")),i("fontStyle",function(t){var e="";("bold"===t.fontWeight||"bolder"===t.fontWeight||700<=parseInt(t.fontWeight))&&(e+="bold");"italic"!==t.fontStyle&&"oblique"!==t.fontStyle||(e+="italic");return e}(n)),i("textColor",d(t,"color")),i("halign",n.textAlign,["left","right","center","justify"]),i("valign",n.verticalAlign,["middle","bottom","top"]),i("fontSize",parseInt(n.fontSize||"")/(96/72)),i("cellPadding",function(t,e,n,o){if(!t)return null;var r=96/(72/o),i=(parseInt(n)-parseInt(e))/o/2,l=t.split(" ").map(function(t){return parseInt(t)/r});l=a.marginOrPadding(l,0),i>l.top&&(l.top=i);i>l.bottom&&(l.bottom=i);return l}(n.padding,n.fontSize,n.lineHeight,e)),i("lineWidth",parseInt(n.borderTopWidth||"")/(96/72)/e),i("lineColor",d(t,"borderTopColor"));var l=(n.fontFamily||"").toLowerCase();return s.default().doc.getFontList()[l]&&i("font",l),r}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var l=n(1);function a(t){t.rowHeight?(console.error("Use of deprecated style rowHeight. It is renamed to minCellHeight."),t.minCellHeight||(t.minCellHeight=t.rowHeight)):t.columnWidth&&(console.error("Use of deprecated style columnWidth. It is renamed to cellWidth."),t.cellWidth||(t.cellWidth=t.columnWidth))}e.default=function(t){for(var e=function(o){o&&"object"!=typeof o&&console.error("The options parameter should be of type object, is: "+typeof o),void 0!==o.extendWidth&&(o.tableWidth=o.extendWidth?"auto":"wrap",console.error("Use of deprecated option: extendWidth, use tableWidth instead.")),void 0!==o.margins&&(void 0===o.margin&&(o.margin=o.margins),console.error("Use of deprecated option: margins, use margin instead.")),o.startY&&"number"!=typeof o.startY&&(console.error("Invalid value for startY option",o.startY),delete o.startY),!o.didDrawPage&&(o.afterPageContent||o.beforePageContent||o.afterPageAdd)&&(console.error("The afterPageContent, beforePageContent and afterPageAdd hooks are deprecated. Use didDrawPage instead"),o.didDrawPage=function(t){l.applyUserStyles(),o.beforePageContent&&o.beforePageContent(t),l.applyUserStyles(),o.afterPageContent&&o.afterPageContent(t),l.applyUserStyles(),o.afterPageAdd&&1<t.pageNumber&&t.afterPageAdd(t),l.applyUserStyles()}),["createdHeaderCell","drawHeaderRow","drawRow","drawHeaderCell"].forEach(function(t){o[t]&&console.error('The "'+t+'" hook has changed in version 3.0, check the changelog for how to migrate.')}),[["showFoot","showFooter"],["showHead","showHeader"],["didDrawPage","addPageContent"],["didParseCell","createdCell"],["headStyles","headerStyles"]].forEach(function(t){var e=t[0],n=t[1];o[n]&&(console.error("Use of deprecated option "+n+". Use "+e+" instead"),o[e]=o[n])}),[["padding","cellPadding"],["lineHeight","rowHeight"],"fontSize","overflow"].forEach(function(t){var e="string"==typeof t?t:t[0],n="string"==typeof t?t:t[1];void 0!==o[e]&&(void 0===o.styles[n]&&(o.styles[n]=o[e]),console.error("Use of deprecated option: "+e+", use the style "+n+" instead."))});for(var t=0,e=["styles","bodyStyles","headStyles","footStyles"];t<e.length;t++){a(o[e[t]]||{})}for(var n=o.columnStyles||{},r=0,i=Object.keys(n);r<i.length;r++){a(n[i[r]]||{})}},n=0,o=t;n<o.length;n++){e(o[n])}}},function(t,e,n){n(7).API.autoTableText=function(t,e,n,o){o=o||{};"number"==typeof e&&"number"==typeof n||console.error("The x and y parameters are required. Missing for text: ",t);var r=this.internal.scaleFactor,i=this.internal.getFontSize()/r,l=null,a=1;if("middle"!==o.valign&&"bottom"!==o.valign&&"center"!==o.halign&&"right"!==o.halign||(a=(l="string"==typeof t?t.split(/\r\n|\r|\n/g):t).length||1),n+=i*(2-1.15),"middle"===o.valign?n-=a/2*i*1.15:"bottom"===o.valign&&(n-=a*i*1.15),"center"===o.halign||"right"===o.halign){var s=i;if("center"===o.halign&&(s*=.5),1<=a){for(var d=0;d<l.length;d++)this.text(l[d],e-this.getStringUnitWidth(l[d])*s,n),n+=1.15*i;return this}e-=this.getStringUnitWidth(t)*s}return"justify"===o.halign?this.text(t,e,n,{maxWidth:o.maxWidth||100,align:"justify"}):this.text(t,e,n),this}}],r.c=i,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8);function r(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return o[t].call(e.exports,e,e.exports,r),e.l=!0,e.exports}var o,i});
\ No newline at end of file
--- /dev/null
+/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
+
+/* Document
+ ========================================================================== */
+
+/**
+ * 1. Correct the line height in all browsers.
+ * 2. Prevent adjustments of font size after orientation changes in iOS.
+ */
+
+html {
+ line-height: 1.15; /* 1 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/* Sections
+ ========================================================================== */
+
+/**
+ * Remove the margin in all browsers.
+ */
+
+body {
+ margin: 0;
+}
+
+/**
+ * Render the `main` element consistently in IE.
+ */
+
+main {
+ display: block;
+}
+
+/**
+ * Correct the font size and margin on `h1` elements within `section` and
+ * `article` contexts in Chrome, Firefox, and Safari.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/* Grouping content
+ ========================================================================== */
+
+/**
+ * 1. Add the correct box sizing in Firefox.
+ * 2. Show the overflow in Edge and IE.
+ */
+
+hr {
+ box-sizing: content-box; /* 1 */
+ height: 0; /* 1 */
+ overflow: visible; /* 2 */
+}
+
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+
+pre {
+ font-family: monospace, monospace; /* 1 */
+ font-size: 1em; /* 2 */
+}
+
+/* Text-level semantics
+ ========================================================================== */
+
+/**
+ * Remove the gray background on active links in IE 10.
+ */
+
+a {
+ background-color: transparent;
+}
+
+/**
+ * 1. Remove the bottom border in Chrome 57-
+ * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
+ */
+
+abbr[title] {
+ border-bottom: none; /* 1 */
+ text-decoration: underline; /* 2 */
+ text-decoration: underline dotted; /* 2 */
+}
+
+/**
+ * Add the correct font weight in Chrome, Edge, and Safari.
+ */
+
+b,
+strong {
+ font-weight: bolder;
+}
+
+/**
+ * 1. Correct the inheritance and scaling of font size in all browsers.
+ * 2. Correct the odd `em` font sizing in all browsers.
+ */
+
+code,
+kbd,
+samp {
+ font-family: monospace, monospace; /* 1 */
+ font-size: 1em; /* 2 */
+}
+
+/**
+ * Add the correct font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` elements from affecting the line height in
+ * all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+sup {
+ top: -0.5em;
+}
+
+/* Embedded content
+ ========================================================================== */
+
+/**
+ * Remove the border on images inside links in IE 10.
+ */
+
+img {
+ border-style: none;
+}
+
+/* Forms
+ ========================================================================== */
+
+/**
+ * 1. Change the font styles in all browsers.
+ * 2. Remove the margin in Firefox and Safari.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ font-family: inherit; /* 1 */
+ font-size: 100%; /* 1 */
+ line-height: 1.15; /* 1 */
+ margin: 0; /* 2 */
+}
+
+/**
+ * Show the overflow in IE.
+ * 1. Show the overflow in Edge.
+ */
+
+button,
+input { /* 1 */
+ overflow: visible;
+}
+
+/**
+ * Remove the inheritance of text transform in Edge, Firefox, and IE.
+ * 1. Remove the inheritance of text transform in Firefox.
+ */
+
+button,
+select { /* 1 */
+ text-transform: none;
+}
+
+/**
+ * Correct the inability to style clickable types in iOS and Safari.
+ */
+
+button,
+[type="button"],
+[type="reset"],
+[type="submit"] {
+ -webkit-appearance: button;
+}
+
+/**
+ * Remove the inner border and padding in Firefox.
+ */
+
+button::-moz-focus-inner,
+[type="button"]::-moz-focus-inner,
+[type="reset"]::-moz-focus-inner,
+[type="submit"]::-moz-focus-inner {
+ border-style: none;
+ padding: 0;
+}
+
+/**
+ * Restore the focus styles unset by the previous rule.
+ */
+
+button:-moz-focusring,
+[type="button"]:-moz-focusring,
+[type="reset"]:-moz-focusring,
+[type="submit"]:-moz-focusring {
+ outline: 1px dotted ButtonText;
+}
+
+/**
+ * Correct the padding in Firefox.
+ */
+
+fieldset {
+ padding: 0.35em 0.75em 0.625em;
+}
+
+/**
+ * 1. Correct the text wrapping in Edge and IE.
+ * 2. Correct the color inheritance from `fieldset` elements in IE.
+ * 3. Remove the padding so developers are not caught out when they zero out
+ * `fieldset` elements in all browsers.
+ */
+
+legend {
+ box-sizing: border-box; /* 1 */
+ color: inherit; /* 2 */
+ display: table; /* 1 */
+ max-width: 100%; /* 1 */
+ padding: 0; /* 3 */
+ white-space: normal; /* 1 */
+}
+
+/**
+ * Add the correct vertical alignment in Chrome, Firefox, and Opera.
+ */
+
+progress {
+ vertical-align: baseline;
+}
+
+/**
+ * Remove the default vertical scrollbar in IE 10+.
+ */
+
+textarea {
+ overflow: auto;
+}
+
+/**
+ * 1. Add the correct box sizing in IE 10.
+ * 2. Remove the padding in IE 10.
+ */
+
+[type="checkbox"],
+[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Correct the cursor style of increment and decrement buttons in Chrome.
+ */
+
+[type="number"]::-webkit-inner-spin-button,
+[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/**
+ * 1. Correct the odd appearance in Chrome and Safari.
+ * 2. Correct the outline style in Safari.
+ */
+
+[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ outline-offset: -2px; /* 2 */
+}
+
+/**
+ * Remove the inner padding in Chrome and Safari on macOS.
+ */
+
+[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * 1. Correct the inability to style clickable types in iOS and Safari.
+ * 2. Change font properties to `inherit` in Safari.
+ */
+
+::-webkit-file-upload-button {
+ -webkit-appearance: button; /* 1 */
+ font: inherit; /* 2 */
+}
+
+/* Interactive
+ ========================================================================== */
+
+/*
+ * Add the correct display in Edge, IE 10+, and Firefox.
+ */
+
+details {
+ display: block;
+}
+
+/*
+ * Add the correct display in all browsers.
+ */
+
+summary {
+ display: list-item;
+}
+
+/* Misc
+ ========================================================================== */
+
+/**
+ * Add the correct display in IE 10+.
+ */
+
+template {
+ display: none;
+}
+
+/**
+ * Add the correct display in IE 10.
+ */
+
+[hidden] {
+ display: none;
+}
--- /dev/null
+@page {
+ margin: 0
+}
+
+body {
+ margin: 0
+}
+
+.sheet {
+ margin: 0;
+ overflow: hidden;
+ position: relative;
+ box-sizing: border-box;
+ page-break-after: always;
+}
+
+
+/** Paper sizes **/
+
+body.A3 .sheet {
+ width: 297mm;
+ height: 419mm
+}
+
+body.A3.landscape .sheet {
+ width: 420mm;
+ height: 296mm
+}
+
+body.A4 .sheet {
+ width: 210mm;
+ height: 296mm
+}
+
+body.A4.landscape .sheet {
+ width: 297mm;
+ height: 209mm
+}
+
+body.A5 .sheet {
+ width: 148mm;
+ height: 209mm
+}
+
+body.A5.landscape .sheet {
+ width: 210mm;
+ height: 147mm
+}
+
+body.letter .sheet {
+ width: 216mm;
+ height: 279mm
+}
+
+body.letter.landscape .sheet {
+ width: 280mm;
+ height: 215mm
+}
+
+body.legal .sheet {
+ width: 216mm;
+ height: 356mm
+}
+
+body.legal.landscape .sheet {
+ width: 357mm;
+ height: 215mm
+}
+
+
+/** Padding area **/
+
+.sheet.padding-10mm {
+ padding: 10mm
+}
+
+.sheet.padding-15mm {
+ padding: 15mm
+}
+
+.sheet.padding-20mm {
+ padding: 20mm
+}
+
+.sheet.padding-25mm {
+ padding: 25mm
+}
+
+
+/** For screen preview **/
+
+@media screen {
+ body {
+ background: #e0e0e0
+ }
+ .sheet {
+ background: white;
+ box-shadow: 0 .5mm 2mm rgba(0, 0, 0, .3);
+ margin: 5mm auto;
+ }
+}
+
+
+/** Fix for Chrome issue #273306 **/
+
+@media print {
+ body.A3.landscape {
+ width: 420mm
+ }
+ body.A3,
+ body.A4.landscape {
+ width: 297mm
+ }
+ body.A4,
+ body.A5.landscape {
+ width: 210mm
+ }
+ body.A5 {
+ width: 148mm
+ }
+ body.letter,
+ body.legal {
+ width: 216mm
+ }
+ body.letter.landscape {
+ width: 280mm
+ }
+ body.legal.landscape {
+ width: 357mm
+ }
+}
\ No newline at end of file
--- /dev/null
+@page{margin:0}body{margin:0}.sheet{margin:0;overflow:hidden;position:relative;box-sizing:border-box;page-break-after:always}body.A3 .sheet{width:297mm;height:419mm}body.A3.landscape .sheet{width:420mm;height:296mm}body.A4 .sheet{width:210mm;height:296mm}body.A4.landscape .sheet{width:297mm;height:209mm}body.A5 .sheet{width:148mm;height:209mm}body.A5.landscape .sheet{width:210mm;height:147mm}body.letter .sheet{width:216mm;height:279mm}body.letter.landscape .sheet{width:280mm;height:215mm}body.legal .sheet{width:216mm;height:356mm}body.legal.landscape .sheet{width:357mm;height:215mm}.sheet.padding-10mm{padding:10mm}.sheet.padding-15mm{padding:15mm}.sheet.padding-20mm{padding:20mm}.sheet.padding-25mm{padding:25mm}@media screen{body{background:#e0e0e0}.sheet{background:#fff;box-shadow:0 .5mm 2mm rgba(0,0,0,.3);margin:5mm auto}}@media print{body.A3.landscape{width:420mm}body.A3,body.A4.landscape{width:297mm}body.A4,body.A5.landscape{width:210mm}body.A5{width:148mm}body.legal,body.letter{width:216mm}body.letter.landscape{width:280mm}body.legal.landscape{width:357mm}}
\ No newline at end of file