From 458ad6588a04bba37878998f8059d2fd2366fdb8 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Mon, 18 Aug 2025 14:49:33 +0300 Subject: [PATCH 1/6] log production dv thanato --- gestion/lib/Controller/PageController.php | 12 +- .../PdfHandler/CareCertificatePdfHandler.php | 2 +- .../PacemakerCertificatePdfHandler.php | 148 ++++++------ .../lib/Service/Devis/Pdf/DevisPdfHandler.php | 214 +++++++++--------- .../InvoiceGroupPdfHandler.php | 2 +- gestion/lib/Service/InvoicePdfHandler.php | 6 +- 6 files changed, 198 insertions(+), 186 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 6afa9d2..0d37a15 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -603,7 +603,7 @@ class PageController extends Controller { $pdf->SetMargins(0,0,0); // logo : 80 de largeur et 55 de hauteur - $pdf->Image($this->src_path."logo.png", 10, 10, 75, 25); + $pdf->Image($this->src_path."logo.png", 4, 2, 50, 35); // adresse du facture $pdf->SetFont('Arial','B',11); $_x = 122 ; $_y = 40; $pdf->SetXY( $_x, $_y ); $pdf->Cell( 100, 8, utf8_decode('Groupe COGF'), 0, 0, ''); $_y += 8; @@ -658,7 +658,7 @@ class PageController extends Controller { $pdf->SetAutoPagebreak(False); $pdf->SetMargins(0,0,0); - $pdf->Image($this->src_path."logo.png", 10, 10, 75, 25); + $pdf->Image($this->src_path."logo.png", 4, 2, 50, 35); // n° page en haute à droite if($nb_page>1){ @@ -865,7 +865,7 @@ class PageController extends Controller { $pdf->SetMargins(0,0,0); // logo : 80 de largeur et 55 de hauteur - $pdf->Image($this->src_path."logo.png", 10, 10, 75, 25); + $pdf->Image($this->src_path."logo.png", 4, 2, 50, 35); // adresse du facture $pdf->SetFont('ComicSans','B',11); $_x = 122 ; $_y = 40; $pdf->SetXY( $_x, $_y ); $pdf->Cell( 100, 8, utf8_decode($current_client), 0, 0, ''); $_y += 8; @@ -920,7 +920,7 @@ class PageController extends Controller { $pdf->SetAutoPagebreak(False); $pdf->SetMargins(0,0,0); - $pdf->Image($this->src_path."logo.png", 10, 10, 75, 25); + $pdf->Image($this->src_path."logo.png", 4, 2, 50, 35); // n° page en haute à droite if($nb_page>1){ @@ -2186,7 +2186,7 @@ class PageController extends Controller { // logo : 80 de largeur et 55 de hauteur $logo = $this->getLogo(); if($logo != 'nothing'){ - $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); + $pdf->Image($this->defaultImagePath."logo.png", 4, 2, 50, 35); } $pdf->setXY(15, 15); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("N : ".$numFacture)), '', 'R'); @@ -2474,7 +2474,7 @@ class PageController extends Controller { // logo : 80 de largeur et 55 de hauteur $logo = $this->getLogo(); if($logo != 'nothing'){ - $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); + $pdf->Image($this->defaultImagePath."logo.png", 4, 2, 50, 35); } $pdf->SetY(45); $pdf->SetFont('ComicSans', 'B', 15); $pdf->Cell(0, 10, utf8_decode(html_entity_decode("ATTESTATION BIJOU(X)")), 0, 0, 'C'); diff --git a/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php b/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php index 0290bbf..09c690f 100644 --- a/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php +++ b/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php @@ -42,7 +42,7 @@ class CareCertificatePdfHandler extends FPDF { function Header() { if($this->logo != "nothing"){ - $this->Image($this->imagePath."logo.png", 10, 10, 75, 25); + $this->Image($this->imagePath."logo.png", 4, 2, 50, 35); } else{ $this->Cell(55,30,''); diff --git a/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php b/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php index b76695c..e68db84 100644 --- a/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php +++ b/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php @@ -32,7 +32,8 @@ use OCA\Gestion\Helpers\DateHelpers; use OCA\Gestion\Helpers\FileExportHelpers; use OCA\Gestion\Helpers\PriceHelpers; -class PacemakerCertificatePdfHandler extends FPDF { +class PacemakerCertificatePdfHandler extends FPDF +{ private $devisOfDefunt = []; private $logo = null; @@ -41,11 +42,10 @@ class PacemakerCertificatePdfHandler extends FPDF { function Header() { - if($this->logo != "nothing"){ - $this->Image($this->imagePath."logo.png", 10, 10, 75, 25); - } - else{ - $this->Cell(55,30,''); + if ($this->logo != "nothing") { + $this->Image($this->imagePath . "logo.png", 4, 2, 50, 35); + } else { + $this->Cell(55, 30, ''); } } function Footer() @@ -53,108 +53,120 @@ class PacemakerCertificatePdfHandler extends FPDF { $this->SetY(-18); $this->SetFont('ComicSans', '', 10); $this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->legal_one)), 0, 'C'); - $this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->adresse)), 0,'C'); + $this->MultiCell(0, 5, utf8_decode(html_entity_decode($this->devisOfDefunt['configuration']->adresse)), 0, 'C'); } - public function SetPacemakerCertificateData(array $devisOfDefunt,$logo = null,$signatureImageExist = false){ + public function SetPacemakerCertificateData(array $devisOfDefunt, $logo = null, $signatureImageExist = false) + { $this->devisOfDefunt = $devisOfDefunt; $this->logo = $logo; $this->signatureImageExist = $signatureImageExist; } - public function SetPacemakerCertificate(){ + public function SetPacemakerCertificate() + { $this->AddPage(); - $this->SetMargins(left:20,top:0,right:20); + $this->SetMargins(left: 20, top: 0, right: 20); $this->SetPacemakerCertificateTitle(); $this->SetPacemakerCertificateContent(); $this->SetSigning(); } - private function SetSigning(){ - $this->SetXY(140,$this->GetY() + 15); - $this->Cell(0,10,'Cachet et signature'); + private function SetSigning() + { + $this->SetXY(140, $this->GetY() + 15); + $this->Cell(0, 10, 'Cachet et signature'); - if($this->signatureImageExist){ - $this->Image($this->imagePath."sign.png", 135, $this->GetY() + 12, 60, 40); + if ($this->signatureImageExist) { + $this->Image($this->imagePath . "sign.png", 135, $this->GetY() + 12, 60, 40); } } - private function SetPacemakerCertificateContent(){ + private function SetPacemakerCertificateContent() + { $this->SetFont('ComicSans', '', 14); - $this->MultiCell(0,7,FileExportHelpers::FormatTextForExport('La Société '. $this->devisOfDefunt['configuration']->entreprise. ' habilitée sous le numéro ' . $this->devisOfDefunt['thanato_reference'] . ', certifie par la présente que : ')); + $this->MultiCell(0, 7, FileExportHelpers::FormatTextForExport('La Société ' . $this->devisOfDefunt['configuration']->entreprise . ' habilitée sous le numéro ' . $this->devisOfDefunt['thanato_reference'] . ', certifie par la présente que : ')); $this->SetFont('ComicSans', 'B', 14); - $this->Cell(0,12, 'Mr/Mme ' . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['thanato_nom'] . ' ' . $this->devisOfDefunt['thanato_prenom']),0,1); + $this->Cell(0, 12, 'Mr/Mme ' . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['thanato_nom'] . ' ' . $this->devisOfDefunt['thanato_prenom']), 0, 1); $this->SetFont('ComicSans', '', 14); - $this->MultiCell(0,7, FileExportHelpers::FormatTextForExport('Employé(e) au sein de notre société et titulaire du diplôme national de Thanatopracteur, a retiré ce jour, la prothèse fonctionnant à pile implantée sur le corps du défunt :')); + $this->MultiCell(0, 7, FileExportHelpers::FormatTextForExport('Employé(e) au sein de notre société et titulaire du diplôme national de Thanatopracteur, a retiré ce jour, la prothèse fonctionnant à pile implantée sur le corps du défunt :')); $this->SetFont('ComicSans', 'B', 14); - $this->Cell(0,12, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_nom']),0,1); + $this->Cell(0, 12, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_nom']), 0, 1); $this->SetFont('ComicSans', '', 14); - $this->Cell(0,12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ' : ',0,1); + $this->Cell(0, 12, FileExportHelpers::FormatTextForExport("Qui reposait à l'adresse suivante") . ' : ', 0, 1); $this->SetFont('ComicSans', 'B', 14); - $this->MultiCell(0,6, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis'])); + $this->MultiCell(0, 6, FileExportHelpers::FormatTextForExport($this->devisOfDefunt['location_of_devis'])); $this->Ln(6); $this->SetFont('ComicSans', '', 14); - $this->Cell(0,6, - FileExportHelpers::FormatTextForExport("Numéro de série : "). - FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_reference_pacemaker']),0,1); - $this->Cell(0,6, - FileExportHelpers::FormatTextForExport("Marque du produit : "). - FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_product_brand']),0,1); - $this->Cell(0,12, FileExportHelpers::FormatTextForExport("La présente attestation est établie pour faire valoir ce que de droit."),0,5); + $this->Cell( + 0, + 6, + FileExportHelpers::FormatTextForExport("Numéro de série : ") . + FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_reference_pacemaker']), + 0, + 1 + ); + $this->Cell( + 0, + 6, + FileExportHelpers::FormatTextForExport("Marque du produit : ") . + FileExportHelpers::FormatTextForExport($this->devisOfDefunt['defunt_product_brand']), + 0, + 1 + ); + $this->Cell(0, 12, FileExportHelpers::FormatTextForExport("La présente attestation est établie pour faire valoir ce que de droit."), 0, 5); $this->Ln(5); - $this->MultiAlignCell(120,7,FileExportHelpers::FormatTextForExport('Fait à '). FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse),0); + $this->MultiAlignCell(120, 7, FileExportHelpers::FormatTextForExport('Fait à ') . FileExportHelpers::FormatTextForExport($this->devisOfDefunt['configuration']->adresse), 0); $this->SetX(140); - $this->Cell(0,7,'le '. $this->devisOfDefunt['devis_date']->format('d/m/Y'),0); + $this->Cell(0, 7, 'le ' . $this->devisOfDefunt['devis_date']->format('d/m/Y'), 0); } - private function SetPacemakerCertificateTitle(){ + private function SetPacemakerCertificateTitle() + { $this->SetY(y: 50); $this->SetFont('ComicSans', 'B', 20); - $this->Cell(0,10,'ATTESTATION DE RETRAIT DE LA',0,1,'C'); - $this->Cell(0,10,'PROTHESE FONCTIONNANT A PILE',0,1,'C'); - $this->Ln(20); + $this->Cell(0, 10, 'ATTESTATION DE RETRAIT DE LA', 0, 1, 'C'); + $this->Cell(0, 10, 'PROTHESE FONCTIONNANT A PILE', 0, 1, 'C'); + $this->Ln(20); } - function MultiAlignCell($w,$h,$text,$border=0,$ln=0,$align='L',$fill=false) - { - // Store reset values for (x,y) positions - $x = $this->GetX() + $w; - $y = $this->GetY(); + function MultiAlignCell($w, $h, $text, $border = 0, $ln = 0, $align = 'L', $fill = false) + { + // Store reset values for (x,y) positions + $x = $this->GetX() + $w; + $y = $this->GetY(); - // Make a call to FPDF's MultiCell - $this->MultiCell($w,$h,$text,$border,$align,$fill); + // Make a call to FPDF's MultiCell + $this->MultiCell($w, $h, $text, $border, $align, $fill); - // Reset the line position to the right, like in Cell - if( $ln==0 ) - { - $this->SetXY($x,$y); - } - } + // Reset the line position to the right, like in Cell + if ($ln == 0) { + $this->SetXY($x, $y); + } + } - function NbLines($w, $txt) + function NbLines($w, $txt) { // Compute the number of lines a MultiCell of width w will take - if(!isset($this->CurrentFont)) + if (!isset($this->CurrentFont)) $this->Error('No font has been set'); $cw = $this->CurrentFont['cw']; - if($w==0) - $w = $this->w-$this->rMargin-$this->x; - $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; - $s = str_replace("\r",'',(string)$txt); + if ($w == 0) + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + $s = str_replace("\r", '', (string) $txt); $nb = strlen($s); - if($nb>0 && $s[$nb-1]=="\n") + if ($nb > 0 && $s[$nb - 1] == "\n") $nb--; $sep = -1; $i = 0; $j = 0; $l = 0; $nl = 1; - while($i<$nb) - { + while ($i < $nb) { $c = $s[$i]; - if($c=="\n") - { + if ($c == "\n") { $i++; $sep = -1; $j = $i; @@ -162,24 +174,20 @@ class PacemakerCertificatePdfHandler extends FPDF { $nl++; continue; } - if($c==' ') + if ($c == ' ') $sep = $i; $l += $cw[$c]; - if($l>$wmax) - { - if($sep==-1) - { - if($i==$j) + if ($l > $wmax) { + if ($sep == -1) { + if ($i == $j) $i++; - } - else - $i = $sep+1; + } else + $i = $sep + 1; $sep = -1; $j = $i; $l = 0; $nl++; - } - else + } else $i++; } return $nl; diff --git a/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php b/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php index 45d86ea..e186f5e 100644 --- a/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php +++ b/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php @@ -31,7 +31,8 @@ use \FPDF; use OCA\Gestion\Helpers\FileExportHelpers; use OCA\Gestion\Helpers\PriceHelpers; -class DevisPdfHandler extends FPDF { +class DevisPdfHandler extends FPDF +{ private $multipleDevisData = []; private $devisData = []; @@ -39,53 +40,57 @@ class DevisPdfHandler extends FPDF { private $logoPath = "/var/www/html/data/admin/files/.gestion/"; function Header() { - if($this->logo != "nothing"){ - $this->Image($this->logoPath."logo.png", 10, 10, 75, 25); - } - else{ - $this->Cell(55,30,''); + if ($this->logo != "nothing") { + $this->Image($this->logoPath . "logo.png", 4, 2, 50, 35); + } else { + $this->Cell(55, 30, ''); } } function Footer() { $this->SetY(-40); $this->SetFont('ComicSans', '', 7); - $this->MultiCell(0,5,utf8_decode(html_entity_decode('Tout retard de paiement entraînera de plein droit une pénalité de retard de 3 fois le taux légal ( Loi 2008-776 du 4 août 2008) et une indemnité forfaitaire de 40 EUR pour frais de recouvrement sera appliquée.'))); + $this->MultiCell(0, 5, utf8_decode(html_entity_decode('Tout retard de paiement entraînera de plein droit une pénalité de retard de 3 fois le taux légal ( Loi 2008-776 du 4 août 2008) et une indemnité forfaitaire de 40 EUR pour frais de recouvrement sera appliquée.'))); $this->Ln(1); - $this->MultiCell(0,5,utf8_decode(html_entity_decode('Si les frais de recouvrement sont supérieurs à ce montant forfaitaire, une indemnisation complémentaire sera due sur présentation de justificatifs ( articles L.441-3 et L.441-6 du code de commerce ). -'))); + $this->MultiCell(0, 5, utf8_decode(html_entity_decode('Si les frais de recouvrement sont supérieurs à ce montant forfaitaire, une indemnisation complémentaire sera due sur présentation de justificatifs ( articles L.441-3 et L.441-6 du code de commerce ). +'))); $this->SetY(-15); $this->SetFont('ComicSans', 'B', 8); $this->Cell(0, 10, utf8_decode(html_entity_decode($this->devisData['configuration']->legal_one)), 0, 0, 'C'); } - public function SetDevisPdfData(array $devisData,$logo = null){ + public function SetDevisPdfData(array $devisData, $logo = null) + { $this->devisData = $devisData; $this->logo = $logo; } - public function SetMultipleDevisPdfData(array $multipleDevisData,$logo = null){ + public function SetMultipleDevisPdfData(array $multipleDevisData, $logo = null) + { $this->multipleDevisData = $multipleDevisData; $this->logo = $logo; } - private function DrawDevisCompanyAndClientInfo(){ + private function DrawDevisCompanyAndClientInfo() + { $this->SetY(40); $this->SetFont('ComicSans', '', 12); $this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration']->entreprise), 0, 0); - $this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['client_nom']), 0, 1,'R'); + $this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['client_nom']), 0, 1, 'R'); $this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration_adresse']), 0, 0); - $this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->devisData['client_real_adress'])), 0, 1,'R'); - $this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration_adresse_city']), 0, 0);border: - $this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->devisData['client_adress_city'])), 0, 1,'R'); - $this->Cell(0, 7, FileExportHelpers::FormatTextForExport('Tél : ') . FileExportHelpers::FormatTextForExport($this->devisData['configuration']->telephone),0,0); - $this->Cell(0, 7, 'Siret: ' . $this->devisData['siret'], 0, 1,'R'); + $this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->devisData['client_real_adress'])), 0, 1, 'R'); + $this->Cell(0, 7, FileExportHelpers::FormatTextForExport($this->devisData['configuration_adresse_city']), 0, 0); + border: + $this->Cell(0, 7, trim(FileExportHelpers::FormatTextForExport($this->devisData['client_adress_city'])), 0, 1, 'R'); + $this->Cell(0, 7, FileExportHelpers::FormatTextForExport('Tél : ') . FileExportHelpers::FormatTextForExport($this->devisData['configuration']->telephone), 0, 0); + $this->Cell(0, 7, 'Siret: ' . $this->devisData['siret'], 0, 1, 'R'); $this->Cell(0, 7, 'Mail : ' . $this->devisData['configuration']->mail, 0, 1); $this->Ln(3); } - private function DrawDevisInfoTable(){ + private function DrawDevisInfoTable() + { $this->SetFont('ComicSans', 'B', 11); $this->Cell(30, 7, 'DATE', 1, 0, 'C'); $this->Cell(80, 7, 'CLIENT', 1, 0, 'C'); @@ -99,91 +104,95 @@ class DevisPdfHandler extends FPDF { $this->Ln(8); } - private function DrawArticlesTable(){ - $this->SetLineWidth(0.1); + private function DrawArticlesTable() + { + $this->SetLineWidth(0.1); $this->Rect(10, 105, 190, 100, "D"); // cadre titre des colonnes - $this->Line(10, 115, 200,115); + $this->Line(10, 115, 200, 115); // les traits verticaux colonnes $this->Line(35, 105, 35, 205); - $this->Line(135, 105, 135, 205); - $this->Line(155, 105, 155, 205); + $this->Line(135, 105, 135, 205); + $this->Line(155, 105, 155, 205); $this->Line(175, 105, 175, 205); } - private function DrawArticlesTableHeader(){ + private function DrawArticlesTableHeader() + { $tvaValue = $this->devisData["configuration"]->tva_default; - $this->SetFont('ComicSans','',10); - $this->SetXY( 10,106 ); - $this->Cell( 20, 8, "Date", 0, 0, 'C'); + $this->SetFont('ComicSans', '', 10); + $this->SetXY(10, 106); + $this->Cell(20, 8, "Date", 0, 0, 'C'); - $this->SetXY( 35,106 ); - $this->Cell( 100, 8, "Description", 0, 0, 'C'); + $this->SetXY(35, 106); + $this->Cell(100, 8, "Description", 0, 0, 'C'); - $this->SetXY( 135,106 ); - $this->Cell( 20, 8, "Prix Uni. HT", 0, 0, 'C'); + $this->SetXY(135, 106); + $this->Cell(20, 8, "Prix Uni. HT", 0, 0, 'C'); - $this->SetXY( 155,106 ); - $this->Cell( 20, 8, 'TVA ' . $tvaValue . '%', 0, 0, 'C'); + $this->SetXY(155, 106); + $this->Cell(20, 8, 'TVA ' . $tvaValue . '%', 0, 0, 'C'); - $this->SetXY( 175,106 ); - $this->Cell( 25, 8, "Prix Uni. TTC", 0, 0, 'C'); + $this->SetXY(175, 106); + $this->Cell(25, 8, "Prix Uni. TTC", 0, 0, 'C'); } - public function DrawArticlesTableValueAndReturnTotalPrice(){ - $this->SetFont('ComicSans','',10); + public function DrawArticlesTableValueAndReturnTotalPrice() + { + $this->SetFont('ComicSans', '', 10); $tvaValue = $this->devisData["configuration"]->tva_default; $totalHt = 0; $totalTtc = 0; $totalTva = 0; $products = $this->devisData["products"]; $yValue = 116; - foreach($products as $product){ + foreach ($products as $product) { $valueHt = $product['produit_price'] * $product['quantite']; - $valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue); - $totalHt+=$valueHt; - $totalTtc+=$valueTtc; + $valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt, $tvaValue); + $totalHt += $valueHt; + $totalTtc += $valueTtc; $productDescription = $product["produit_description"]; $dateValue = ""; - if($product === end($products)){ + if ($product === end($products)) { $dateValue = $this->devisData['devis_date']; - $productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->devisData['defunt_sexe']) . ' '. $this->devisData["defunt_nom"]; + $productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->devisData['defunt_sexe']) . ' ' . $this->devisData["defunt_nom"]; } $tvaAmount = $valueTtc - $valueHt; - $this->SetXY( 10,$yValue ); - $this->Cell(20, 6, $dateValue, 0,0); + $this->SetXY(10, $yValue); + $this->Cell(20, 6, $dateValue, 0, 0); - $this->SetXY( 35,$yValue ); - $this->MultiAlignCell(100, 6, utf8_decode(html_entity_decode($productDescription)),0,'0',); + $this->SetXY(35, $yValue); + $this->MultiAlignCell(100, 6, utf8_decode(html_entity_decode($productDescription)), 0, '0', ); - $this->SetXY( 135,$yValue ); - $this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C'); - - $this->SetXY( 155,$yValue ); - $this->Cell(20, 6, number_format($tvaAmount,2,'.','').chr(128), 0, 0, 'C'); - - $this->SetXY( 175,$yValue ); - $this->Cell(25, 6, number_format($valueTtc,2,'.','').chr(128), 0, 1, 'C'); + $this->SetXY(135, $yValue); + $this->Cell(20, 6, number_format($valueHt, 2, '.', '') . chr(128), 0, 0, 'C'); + + $this->SetXY(155, $yValue); + $this->Cell(20, 6, number_format($tvaAmount, 2, '.', '') . chr(128), 0, 0, 'C'); + + $this->SetXY(175, $yValue); + $this->Cell(25, 6, number_format($valueTtc, 2, '.', '') . chr(128), 0, 1, 'C'); $yValue += 12; $totalTva += $tvaAmount; } return [ "TOTAL HT" => $totalHt, - "TVA ".$tvaValue. "%" => $totalTva, + "TVA " . $tvaValue . "%" => $totalTva, "TOTAL TTC" => $totalTtc ]; } - private function DrawBankAndTotalPriceInfo($totalPriceArray){ + private function DrawBankAndTotalPriceInfo($totalPriceArray) + { $this->SetY(210); $this->SetFont('ComicSans', '', 9); - $this->MultiCell(0,5,utf8_decode(html_entity_decode("Paiement à votre convenance par chèque à l'ordre de ". $this->devisData['configuration']->entreprise))); - $this->MultiCell(0,5,utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :"))); + $this->MultiCell(0, 5, utf8_decode(html_entity_decode("Paiement à votre convenance par chèque à l'ordre de " . $this->devisData['configuration']->entreprise))); + $this->MultiCell(0, 5, utf8_decode(html_entity_decode("en indiquant le numéro de facture, ou par virement :"))); $this->Ln(1); - + //Table IBAN $this->SetFont('ComicSans', '', 11); $ibanWidth = 90; @@ -193,28 +202,30 @@ class DevisPdfHandler extends FPDF { $this->Cell($ibanWidth, 7, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C'); //TABLE HT - $ibanLastPositionX = $ibanCursorX+$ibanWidth + 20; + $ibanLastPositionX = $ibanCursorX + $ibanWidth + 20; $startOfArrayX = $ibanLastPositionX; $startOfArrayY = $ibanCursorY; - foreach($totalPriceArray as $label => $price){ - $this->SetXY($startOfArrayX,$startOfArrayY); + foreach ($totalPriceArray as $label => $price) { + $this->SetXY($startOfArrayX, $startOfArrayY); $this->Cell(40, 7, $label, 1, 1, 'C'); - $this->SetXY($startOfArrayX + 40,$startOfArrayY); - $this->Cell(40, 7, number_format($price,2,'.','').chr(128), 1, 1, 'C'); + $this->SetXY($startOfArrayX + 40, $startOfArrayY); + $this->Cell(40, 7, number_format($price, 2, '.', '') . chr(128), 1, 1, 'C'); $startOfArrayY += 7; } } - public function SetMultipleDevisContent(){ - foreach($this->multipleDevisData as $devisData){ + public function SetMultipleDevisContent() + { + foreach ($this->multipleDevisData as $devisData) { $this->devisData = $devisData; $this->SetDevisContent(); } } - public function SetDevisContent(){ + public function SetDevisContent() + { $this->AddPage(); - $this->SetMargins(10,0,10); + $this->SetMargins(10, 0, 10); $this->DrawDevisCompanyAndClientInfo(); $this->DrawDevisInfoTable(); $this->DrawArticlesTable(); @@ -223,45 +234,42 @@ class DevisPdfHandler extends FPDF { $this->DrawBankAndTotalPriceInfo($totalPriceValue); } - function MultiAlignCell($w,$h,$text,$border=0,$ln=0,$align='L',$fill=false) - { - // Store reset values for (x,y) positions - $x = $this->GetX() + $w; - $y = $this->GetY(); + function MultiAlignCell($w, $h, $text, $border = 0, $ln = 0, $align = 'L', $fill = false) + { + // Store reset values for (x,y) positions + $x = $this->GetX() + $w; + $y = $this->GetY(); - // Make a call to FPDF's MultiCell - $this->MultiCell($w,$h,$text,$border,$align,$fill); + // Make a call to FPDF's MultiCell + $this->MultiCell($w, $h, $text, $border, $align, $fill); - // Reset the line position to the right, like in Cell - if( $ln==0 ) - { - $this->SetXY($x,$y); - } - } + // Reset the line position to the right, like in Cell + if ($ln == 0) { + $this->SetXY($x, $y); + } + } - function NbLines($w, $txt) + function NbLines($w, $txt) { // Compute the number of lines a MultiCell of width w will take - if(!isset($this->CurrentFont)) + if (!isset($this->CurrentFont)) $this->Error('No font has been set'); $cw = $this->CurrentFont['cw']; - if($w==0) - $w = $this->w-$this->rMargin-$this->x; - $wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; - $s = str_replace("\r",'',(string)$txt); + if ($w == 0) + $w = $this->w - $this->rMargin - $this->x; + $wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize; + $s = str_replace("\r", '', (string) $txt); $nb = strlen($s); - if($nb>0 && $s[$nb-1]=="\n") + if ($nb > 0 && $s[$nb - 1] == "\n") $nb--; $sep = -1; $i = 0; $j = 0; $l = 0; $nl = 1; - while($i<$nb) - { + while ($i < $nb) { $c = $s[$i]; - if($c=="\n") - { + if ($c == "\n") { $i++; $sep = -1; $j = $i; @@ -269,24 +277,20 @@ class DevisPdfHandler extends FPDF { $nl++; continue; } - if($c==' ') + if ($c == ' ') $sep = $i; $l += $cw[$c]; - if($l>$wmax) - { - if($sep==-1) - { - if($i==$j) + if ($l > $wmax) { + if ($sep == -1) { + if ($i == $j) $i++; - } - else - $i = $sep+1; + } else + $i = $sep + 1; $sep = -1; $j = $i; $l = 0; $nl++; - } - else + } else $i++; } return $nl; diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php index ea91098..6a34469 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php @@ -57,7 +57,7 @@ class InvoiceGroupPdfHandler extends FPDF function Header() { if ($this->logo != "nothing") { - $this->Image($this->logoPath . "logo.png", 2, 10, 75, 25); + $this->Image($this->logoPath . "logo.png", 4, 2, 50, 35); $this->AddWatermark(); } else { $this->Cell(55, 30, ''); diff --git a/gestion/lib/Service/InvoicePdfHandler.php b/gestion/lib/Service/InvoicePdfHandler.php index 004aeae..7a90fe4 100644 --- a/gestion/lib/Service/InvoicePdfHandler.php +++ b/gestion/lib/Service/InvoicePdfHandler.php @@ -52,7 +52,7 @@ class InvoicePdfHandler extends FPDF function Header() { if ($this->logo != "nothing") { - $this->Image($this->logoPath . "logo.png", 2, 10, 75, 25); + $this->Image($this->logoPath . "logo.png", 4, 2, 50, 35); $this->AddWatermark(); } else { $this->Cell(55, 30, ''); @@ -172,13 +172,13 @@ class InvoicePdfHandler extends FPDF $addressWidth = $this->GetStringWidth($address); $addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo; $addressIsMoreThanTwoLines = ($addressWidth / $availableWidhtForClientInfo) > 2; - + $clientInfoYAxis = $addressIsMoreThanTwoLines ? 35 : 35;// the old is ? 35 : 39 but not working $this->SetXY($clientInfoXAxis, $clientInfoYAxis); $this->Cell(0, $this->interLigneHeader, FileExportHelpers::FormatTextForExport($clientName)); $clientInfoYAxis += $this->interLigneHeader; $clientAddresses = explode(",", $clientAddress); - foreach ($clientAddresses as $address) { + foreach ($clientAddresses as $address) { $address = FileExportHelpers::FormatTextForExport(trim($address)); $addressWidth = $this->GetStringWidth($address); $addressWidthGreaterThanMaxWidth = $addressWidth > $availableWidhtForClientInfo; From 1983f506c8c0dc3589f2edaa977b48f2c23f13c0 Mon Sep 17 00:00:00 2001 From: narindraezway Date: Mon, 18 Aug 2025 14:49:34 +0300 Subject: [PATCH 2/6] Fix signature image dimensions email --- gestion/lib/Service/MailerService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gestion/lib/Service/MailerService.php b/gestion/lib/Service/MailerService.php index 6ff915e..5314609 100644 --- a/gestion/lib/Service/MailerService.php +++ b/gestion/lib/Service/MailerService.php @@ -51,7 +51,7 @@ class MailerService { if (!$signatureImage) { return ""; } - return "" ; + return "" ; } private function getSignatureContent(){ From 63ff1428d8167ae26d777f216d2523b5f4865f1c Mon Sep 17 00:00:00 2001 From: narindraezway Date: Mon, 18 Aug 2025 14:49:34 +0300 Subject: [PATCH 3/6] Update admin app ID --- gestion/lib/Constants/BddConstant.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gestion/lib/Constants/BddConstant.php b/gestion/lib/Constants/BddConstant.php index 82a3ab7..527f8a3 100644 --- a/gestion/lib/Constants/BddConstant.php +++ b/gestion/lib/Constants/BddConstant.php @@ -8,7 +8,7 @@ abstract class BddConstant const DEFAULT_TABLE_PREFIX = "*PREFIX*"; const DEFAULT_CLIENT_GROUP_NAME = "Nom du groupe"; const DEFAULT_ADMIN_ID_NEXTCLOUD = 'admin'; - const DEFAULT_ADMIN_APP_ID_NEXTCLOUD = "Johann"; + const DEFAULT_ADMIN_APP_ID_NEXTCLOUD = "Vanessa"; const ISLEAVEPROPERTYONVCALENDAR = "ISLEAVE"; From d10dce3880c7d1d40c3347226bcfeb14c734902c Mon Sep 17 00:00:00 2001 From: narindraezway Date: Mon, 18 Aug 2025 14:49:34 +0300 Subject: [PATCH 4/6] Refactor email signature handling to include user name in footer content --- gestion/lib/Controller/PageController.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 0d37a15..161ad04 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -1616,9 +1616,7 @@ class PageController extends Controller { $message->attach($content); $message->setSubject($subject); $body_text = $addName ? ($body." de ".$devis['defunt_nom'] ) : $body; - - $signature = $this->mailerService->getFooterContent(); - + $signature = $this->mailerService->getFooterContent($this->getUserNameForEmailSignature()); $message->setHtmlBody( "

Bonjour.

". "

$body_text

". @@ -1636,13 +1634,10 @@ class PageController extends Controller { // } } } - public function addSignatureEmailLogo (){ - $signatureImage = $this->getSignature(); - if (!$signatureImage) { - return ""; - } - //Add html img in base 64 - return "" ; + public function getUserNameForEmailSignature (){ + $configs = json_decode($this->myDb->getConfiguration(self::DEFAULT_NEXTCLOUD_ADMIN)); + $currentConfig = $configs[0]; + return $currentConfig->nom . " " . $currentConfig->prenom; } /** From 9a1c8bca860cd61504612099f8822a248890e382 Mon Sep 17 00:00:00 2001 From: Tolotsoa Date: Mon, 18 Aug 2025 14:49:35 +0300 Subject: [PATCH 5/6] feat add is_tva client --- gestion/js/apercusTousDevis.app.js | 2 +- gestion/js/apercusToutesFactures.app.js | 2 +- gestion/js/article.app.js | 2 +- gestion/js/bibliotheque.app.js | 2 +- gestion/js/client.app.js | 2 +- gestion/js/clientGroup.app.js | 2 +- gestion/js/clientGroupDiscount.app.js | 2 +- gestion/js/clientGroupFacturation.app.js | 2 +- gestion/js/configuration.app.js | 2 +- gestion/js/defunt.app.js | 2 +- gestion/js/defuntShow.app.js | 2 +- gestion/js/devis.app.js | 2 +- gestion/js/devisShow.app.js | 2 +- gestion/js/facture.app.js | 2 +- gestion/js/factureGroupDetails.app.js | 2 +- gestion/js/factureShow.app.js | 2 +- gestion/js/legalnotice.app.js | 2 +- gestion/js/lieu.app.js | 2 +- gestion/js/produit.app.js | 2 +- gestion/js/statistique.app.js | 2 +- gestion/js/thanatopracteur.app.js | 2 +- gestion/js/trajet.app.js | 2 +- gestion/js/trajetdetails.app.js | 2 +- ..._node_modules_canvg_lib_index_es_js.app.js | 10657 ++++++++++++++++ gestion/lib/Controller/PageController.php | 6366 ++++----- gestion/lib/Db/Bdd.php | 2616 ++-- .../Version20001Date20250812120000.php | 52 + .../lib/Service/Devis/Pdf/DevisPdfHandler.php | 79 +- .../lib/Service/Devis/Pdf/DevisPdfService.php | 3 + gestion/lib/Service/InvoicePdfHandler.php | 106 +- gestion/lib/Service/InvoicePdfService.php | 242 +- .../InvoiceRecap/InvoiceRecapService.php | 790 +- gestion/src/js/modules/mainFunction.mjs | 40 +- gestion/src/js/objects/client.mjs | 39 +- .../templates/content/apercustousdevis.php | 195 +- .../content/apercustoutesfactures.php | 165 +- gestion/templates/content/index.php | 3 + 37 files changed, 16645 insertions(+), 4754 deletions(-) create mode 100644 gestion/js/vendors-node_modules_jspdf_node_modules_canvg_lib_index_es_js.app.js create mode 100644 gestion/lib/Migration/Version20001Date20250812120000.php diff --git a/gestion/js/apercusTousDevis.app.js b/gestion/js/apercusTousDevis.app.js index 5af4bb6..36f4760 100644 --- a/gestion/js/apercusTousDevis.app.js +++ b/gestion/js/apercusTousDevis.app.js @@ -1,2 +1,2 @@ /*! For license information please see apercusTousDevis.app.js.LICENSE.txt */ -(()=>{var n={2:(t,n,e)=>{var r=e(6926),a=e(9310);(t.exports=function(t,n){return a[t]||(a[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.28.0",mode:r?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.28.0/LICENSE",source:"https://github.com/zloirock/core-js"})},54:(t,n,e)=>{"use strict";var r,a,o=e(2368),i=e(281),l=e(5362),s=e(6844),d=e(2192),c=e(2),p=e(3105),u=e(9206).get,m=e(1036),f=e(8121),g=c("native-string-replace",String.prototype.replace),b=RegExp.prototype.exec,h=b,v=i("".charAt),x=i("".indexOf),y=i("".replace),w=i("".slice),T=(a=/b*/g,o(b,r=/a/,"a"),o(b,a,"a"),0!==r.lastIndex||0!==a.lastIndex),_=d.BROKEN_CARET,k=void 0!==/()??/.exec("")[1];(T||k||_||m||f)&&(h=function(t){var n,e,r,a,i,d,c,m=this,f=u(m),S=l(t),C=f.raw;if(C)return C.lastIndex=m.lastIndex,n=o(h,C,S),m.lastIndex=C.lastIndex,n;var D=f.groups,L=_&&m.sticky,A=o(s,m),E=m.source,j=0,F=S;if(L&&(A=y(A,"y",""),-1===x(A,"g")&&(A+="g"),F=w(S,m.lastIndex),m.lastIndex>0&&(!m.multiline||m.multiline&&"\n"!==v(S,m.lastIndex-1))&&(E="(?: "+E+")",F=" "+F,j++),e=new RegExp("^(?:"+E+")",A)),k&&(e=new RegExp("^"+E+"$(?!\\s)",A)),T&&(r=m.lastIndex),a=o(b,L?e:m,F),L?a?(a.input=w(a.input,j),a[0]=w(a[0],j),a.index=m.lastIndex,m.lastIndex+=a[0].length):m.lastIndex=0:T&&a&&(m.lastIndex=m.global?a.index+a[0].length:r),k&&a&&a.length>1&&o(g,a[0],e,(function(){for(i=1;i{"use strict";var r=e(9070),a=e(2368),o=e(281),i=e(779),l=e(2074),s=e(3938),d=e(8420),c=e(8406),p=e(9328),u=e(3747),m=e(5362),f=e(1229),g=e(7234),b=e(6457),h=e(4433),v=e(6793),x=e(1602)("replace"),y=Math.max,w=Math.min,T=o([].concat),_=o([].push),k=o("".indexOf),S=o("".slice),C="$0"==="a".replace(/./,"$0"),D=!!/./[x]&&""===/./[x]("a","$0");i("replace",(function(t,n,e){var o=D?"$":"$0";return[function(t,e){var r=f(this),o=c(t)?void 0:b(t,x);return o?a(o,t,r,e):a(n,m(r),t,e)},function(t,a){var i=s(this),l=m(t);if("string"==typeof a&&-1===k(a,o)&&-1===k(a,"$<")){var c=e(n,i,l,a);if(c.done)return c.value}var f=d(a);f||(a=m(a));var b=i.global;if(b){var x=i.unicode;i.lastIndex=0}for(var C=[];;){var D=v(i,l);if(null===D)break;if(_(C,D),!b)break;""===m(D[0])&&(i.lastIndex=g(l,u(i.lastIndex),x))}for(var L,A="",E=0,j=0;j=E&&(A+=S(l,E,N)+M,E=N+F.length)}return A+S(l,E)}]}),!!l((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!C||D)},200:(t,n,e)=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e.g&&e.g)||function(){return this}()||Function("return this")()},281:(t,n,e)=>{var r=e(8823),a=Function.prototype,o=a.call,i=r&&a.bind.bind(o,o);t.exports=r?i:function(t){return function(){return o.apply(t,arguments)}}},290:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},353:(t,n,e)=>{var r=e(2368),a=e(6490),o=e(7658),i=e(6844),l=RegExp.prototype;t.exports=function(t){var n=t.flags;return void 0!==n||"flags"in l||a(t,"flags")||!o(l,t)?n:r(i,t)}},540:t=>{"use strict";t.exports=function(t){var n=document.createElement("style");return t.setAttributes(n,t.attributes),t.insert(n,t.options),n}},580:t=>{"use strict";var n=/["'&<>]/;t.exports=function(t){var e,r=""+t,a=n.exec(r);if(!a)return r;var o="",i=0,l=0;for(i=a.index;i{var r=e(281),a=0,o=Math.random(),i=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+i(++a+o,36)}},779:(t,n,e)=>{"use strict";e(7136);var r=e(3091),a=e(7485),o=e(54),i=e(2074),l=e(1602),s=e(7712),d=l("species"),c=RegExp.prototype;t.exports=function(t,n,e,p){var u=l(t),m=!i((function(){var n={};return n[u]=function(){return 7},7!=""[t](n)})),f=m&&!i((function(){var n=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[d]=function(){return e},e.flags="",e[u]=/./[u]),e.exec=function(){return n=!0,null},e[u](""),!n}));if(!m||!f||e){var g=r(/./[u]),b=n(u,""[t],(function(t,n,e,a,i){var l=r(t),s=n.exec;return s===o||s===c.exec?m&&!i?{done:!0,value:g(n,e,a)}:{done:!0,value:l(e,n,a)}:{done:!1}}));a(String.prototype,t,b[0]),a(c,u,b[1])}p&&s(c[u],"sham",!0)}},874:(t,n,e)=>{var r=e(2368),a=e(5335),o=e(2328),i=e(6457),l=e(9751),s=e(1602),d=TypeError,c=s("toPrimitive");t.exports=function(t,n){if(!a(t)||o(t))return t;var e,s=i(t,c);if(s){if(void 0===n&&(n="default"),e=r(s,t,n),!a(e)||o(e))return e;throw d("Can't convert object to primitive value")}return void 0===n&&(n="number"),l(t,n)}},1036:(t,n,e)=>{var r=e(2074),a=e(200).RegExp;t.exports=r((function(){var t=a(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},1113:t=>{"use strict";t.exports=function(t,n){if(n.styleSheet)n.styleSheet.cssText=t;else{for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(document.createTextNode(t))}}},1144:t=>{"use strict";t.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 fill=%27%23fff%27%3e%3cpath d=%27M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z%27/%3e%3c/svg%3e"},1229:(t,n,e)=>{var r=e(8406),a=TypeError;t.exports=function(t){if(r(t))throw a("Can't call method on "+t);return t}},1479:t=>{"use strict";t.exports="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTYiIHdpZHRoPSIxNiI+CiAgPHBhdGggZD0iTTE0IDEyLjNMMTIuMyAxNCA4IDkuNyAzLjcgMTQgMiAxMi4zIDYuMyA4IDIgMy43IDMuNyAyIDggNi4zIDEyLjMgMiAxNCAzLjcgOS43IDh6IiBzdHlsZT0iZmlsbC1vcGFjaXR5OjE7ZmlsbDojZmZmZmZmIi8+Cjwvc3ZnPgo="},1601:t=>{"use strict";t.exports=function(t){return t[1]}},1602:(t,n,e)=>{var r=e(200),a=e(2),o=e(6490),i=e(665),l=e(2072),s=e(5225),d=r.Symbol,c=a("wks"),p=s?d.for||d:d&&d.withoutSetter||i;t.exports=function(t){return o(c,t)||(c[t]=l&&o(d,t)?d[t]:p("Symbol."+t)),c[t]}},1605:(t,n,e)=>{var r=e(200),a=e(7632).f,o=e(7712),i=e(7485),l=e(9430),s=e(4361),d=e(4977);t.exports=function(t,n){var e,c,p,u,m,f=t.target,g=t.global,b=t.stat;if(e=g?r:b?r[f]||l(f,{}):(r[f]||{}).prototype)for(c in n){if(u=n[c],p=t.dontCallGetSet?(m=a(e,c))&&m.value:e[c],!d(g?c:f+(b?".":"#")+c,t.forced)&&void 0!==p){if(typeof u==typeof p)continue;s(u,p)}(t.sham||p&&p.sham)&&o(u,"sham",!0),i(e,c,u,t)}}},1641:(t,n,e)=>{var r=e(6347),a=e(290);t.exports=Object.keys||function(t){return r(t,a)}},1688:(t,n,e)=>{"use strict";var r=e(5077),a=e(281),o=e(2368),i=e(2074),l=e(1641),s=e(8916),d=e(9304),c=e(2612),p=e(8664),u=Object.assign,m=Object.defineProperty,f=a([].concat);t.exports=!u||i((function(){if(r&&1!==u({b:1},u(m({},"a",{enumerable:!0,get:function(){m(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},n={},e=Symbol(),a="abcdefghijklmnopqrst";return t[e]=7,a.split("").forEach((function(t){n[t]=t})),7!=u({},t)[e]||l(u({},n)).join("")!=a}))?function(t,n){for(var e=c(t),a=arguments.length,i=1,u=s.f,m=d.f;a>i;)for(var g,b=p(arguments[i++]),h=u?f(l(b),u(b)):l(b),v=h.length,x=0;v>x;)g=h[x++],r&&!o(m,b,g)||(e[g]=b[g]);return e}:u},2071:(t,n,e)=>{var r=e(5077),a=e(6490),o=Function.prototype,i=r&&Object.getOwnPropertyDescriptor,l=a(o,"name"),s=l&&"something"===function(){}.name,d=l&&(!r||r&&i(o,"name").configurable);t.exports={EXISTS:l,PROPER:s,CONFIGURABLE:d}},2072:(t,n,e)=>{var r=e(6845),a=e(2074);t.exports=!!Object.getOwnPropertySymbols&&!a((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},2074:t=>{t.exports=function(t){try{return!!t()}catch(t){return!0}}},2192:(t,n,e)=>{var r=e(2074),a=e(200).RegExp,o=r((function(){var t=a("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),i=o||r((function(){return!a("a","y").sticky})),l=o||r((function(){var t=a("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:l,MISSED_STICKY:i,UNSUPPORTED_Y:o}},2328:(t,n,e)=>{var r=e(6492),a=e(8420),o=e(7658),i=e(5225),l=Object;t.exports=i?function(t){return"symbol"==typeof t}:function(t){var n=r("Symbol");return a(n)&&o(n.prototype,l(t))}},2349:(t,n,e)=>{"use strict";var r=e(2074);t.exports=function(t,n){var e=[][t];return!!e&&r((function(){e.call(null,n||function(){return 1},1)}))}},2368:(t,n,e)=>{var r=e(8823),a=Function.prototype.call;t.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},2612:(t,n,e)=>{var r=e(1229),a=Object;t.exports=function(t){return a(r(t))}},2838:function(t){t.exports=function(){"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(n)}function n(t,e){return n=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},n(t,e)}function e(t,r,a){return e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}()?Reflect.construct:function(t,e,r){var a=[null];a.push.apply(a,e);var o=new(Function.bind.apply(t,a));return r&&n(o,r.prototype),o},e.apply(null,arguments)}function r(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return a(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?a(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e1?e-1:0),a=1;a/gm),G=p(/\${[\w\W]*}/gm),W=p(/^data-[\-\w.\u00B7-\uFFFF]/),J=p(/^aria-[\-\w]+$/),X=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),V=p(/^(?:\w+script|data):/i),Y=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=p(/^html$/i),Z=function(){return"undefined"==typeof window?null:window};return function n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z(),a=function(t){return n(t)};if(a.version="2.4.4",a.removed=[],!e||!e.document||9!==e.document.nodeType)return a.isSupported=!1,a;var o=e.document,i=e.document,l=e.DocumentFragment,s=e.HTMLTemplateElement,d=e.Node,p=e.Element,u=e.NodeFilter,m=e.NamedNodeMap,f=void 0===m?e.NamedNodeMap||e.MozNamedAttrMap:m,g=e.HTMLFormElement,b=e.DOMParser,L=e.trustedTypes,Q=p.prototype,tt=j(Q,"cloneNode"),nt=j(Q,"nextSibling"),et=j(Q,"childNodes"),rt=j(Q,"parentNode");if("function"==typeof s){var at=i.createElement("template");at.content&&at.content.ownerDocument&&(i=at.content.ownerDocument)}var ot=function(n,e){if("object"!==t(n)||"function"!=typeof n.createPolicy)return null;var r=null,a="data-tt-policy-suffix";e.currentScript&&e.currentScript.hasAttribute(a)&&(r=e.currentScript.getAttribute(a));var o="dompurify"+(r?"#"+r:"");try{return n.createPolicy(o,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(L,o),it=ot?ot.createHTML(""):"",lt=i,st=lt.implementation,dt=lt.createNodeIterator,ct=lt.createDocumentFragment,pt=lt.getElementsByTagName,ut=o.importNode,mt={};try{mt=E(i).documentMode?i.documentMode:{}}catch(t){}var ft={};a.isSupported="function"==typeof rt&&st&&void 0!==st.createHTMLDocument&&9!==mt;var gt,bt,ht=q,vt=B,xt=G,yt=W,wt=J,Tt=V,_t=Y,kt=X,St=null,Ct=A({},[].concat(r(F),r(N),r(O),r(I),r(M))),Dt=null,Lt=A({},[].concat(r(z),r(H),r(U),r($))),At=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,jt=null,Ft=!0,Nt=!0,Ot=!1,Pt=!0,It=!1,Rt=!1,Mt=!1,zt=!1,Ht=!1,Ut=!1,$t=!1,qt=!0,Bt=!1,Gt=!0,Wt=!1,Jt={},Xt=null,Vt=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Yt=null,Kt=A({},["audio","video","img","source","image","track"]),Zt=null,Qt=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tn="http://www.w3.org/1998/Math/MathML",nn="http://www.w3.org/2000/svg",en="http://www.w3.org/1999/xhtml",rn=en,an=!1,on=null,ln=A({},[tn,nn,en],w),sn=["application/xhtml+xml","text/html"],dn=null,cn=i.createElement("form"),pn=function(t){return t instanceof RegExp||t instanceof Function},un=function(n){dn&&dn===n||(n&&"object"===t(n)||(n={}),n=E(n),gt=gt=-1===sn.indexOf(n.PARSER_MEDIA_TYPE)?"text/html":n.PARSER_MEDIA_TYPE,bt="application/xhtml+xml"===gt?w:y,St="ALLOWED_TAGS"in n?A({},n.ALLOWED_TAGS,bt):Ct,Dt="ALLOWED_ATTR"in n?A({},n.ALLOWED_ATTR,bt):Lt,on="ALLOWED_NAMESPACES"in n?A({},n.ALLOWED_NAMESPACES,w):ln,Zt="ADD_URI_SAFE_ATTR"in n?A(E(Qt),n.ADD_URI_SAFE_ATTR,bt):Qt,Yt="ADD_DATA_URI_TAGS"in n?A(E(Kt),n.ADD_DATA_URI_TAGS,bt):Kt,Xt="FORBID_CONTENTS"in n?A({},n.FORBID_CONTENTS,bt):Vt,Et="FORBID_TAGS"in n?A({},n.FORBID_TAGS,bt):{},jt="FORBID_ATTR"in n?A({},n.FORBID_ATTR,bt):{},Jt="USE_PROFILES"in n&&n.USE_PROFILES,Ft=!1!==n.ALLOW_ARIA_ATTR,Nt=!1!==n.ALLOW_DATA_ATTR,Ot=n.ALLOW_UNKNOWN_PROTOCOLS||!1,Pt=!1!==n.ALLOW_SELF_CLOSE_IN_ATTR,It=n.SAFE_FOR_TEMPLATES||!1,Rt=n.WHOLE_DOCUMENT||!1,Ht=n.RETURN_DOM||!1,Ut=n.RETURN_DOM_FRAGMENT||!1,$t=n.RETURN_TRUSTED_TYPE||!1,zt=n.FORCE_BODY||!1,qt=!1!==n.SANITIZE_DOM,Bt=n.SANITIZE_NAMED_PROPS||!1,Gt=!1!==n.KEEP_CONTENT,Wt=n.IN_PLACE||!1,kt=n.ALLOWED_URI_REGEXP||kt,rn=n.NAMESPACE||en,n.CUSTOM_ELEMENT_HANDLING&&pn(n.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(At.tagNameCheck=n.CUSTOM_ELEMENT_HANDLING.tagNameCheck),n.CUSTOM_ELEMENT_HANDLING&&pn(n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(At.attributeNameCheck=n.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),n.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(At.allowCustomizedBuiltInElements=n.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),It&&(Nt=!1),Ut&&(Ht=!0),Jt&&(St=A({},r(M)),Dt=[],!0===Jt.html&&(A(St,F),A(Dt,z)),!0===Jt.svg&&(A(St,N),A(Dt,H),A(Dt,$)),!0===Jt.svgFilters&&(A(St,O),A(Dt,H),A(Dt,$)),!0===Jt.mathMl&&(A(St,I),A(Dt,U),A(Dt,$))),n.ADD_TAGS&&(St===Ct&&(St=E(St)),A(St,n.ADD_TAGS,bt)),n.ADD_ATTR&&(Dt===Lt&&(Dt=E(Dt)),A(Dt,n.ADD_ATTR,bt)),n.ADD_URI_SAFE_ATTR&&A(Zt,n.ADD_URI_SAFE_ATTR,bt),n.FORBID_CONTENTS&&(Xt===Vt&&(Xt=E(Xt)),A(Xt,n.FORBID_CONTENTS,bt)),Gt&&(St["#text"]=!0),Rt&&A(St,["html","head","body"]),St.table&&(A(St,["tbody"]),delete Et.tbody),c&&c(n),dn=n)},mn=A({},["mi","mo","mn","ms","mtext"]),fn=A({},["foreignobject","desc","title","annotation-xml"]),gn=A({},["title","style","font","a","script"]),bn=A({},N);A(bn,O),A(bn,P);var hn=A({},I);A(hn,R);var vn=function(t){x(a.removed,{element:t});try{t.parentNode.removeChild(t)}catch(n){try{t.outerHTML=it}catch(n){t.remove()}}},xn=function(t,n){try{x(a.removed,{attribute:n.getAttributeNode(t),from:n})}catch(t){x(a.removed,{attribute:null,from:n})}if(n.removeAttribute(t),"is"===t&&!Dt[t])if(Ht||Ut)try{vn(n)}catch(t){}else try{n.setAttribute(t,"")}catch(t){}},yn=function(t){var n,e;if(zt)t=""+t;else{var r=T(t,/^[\r\n\t ]+/);e=r&&r[0]}"application/xhtml+xml"===gt&&rn===en&&(t=''+t+"");var a=ot?ot.createHTML(t):t;if(rn===en)try{n=(new b).parseFromString(a,gt)}catch(t){}if(!n||!n.documentElement){n=st.createDocument(rn,"template",null);try{n.documentElement.innerHTML=an?it:a}catch(t){}}var o=n.body||n.documentElement;return t&&e&&o.insertBefore(i.createTextNode(e),o.childNodes[0]||null),rn===en?pt.call(n,Rt?"html":"body")[0]:Rt?n.documentElement:o},wn=function(t){return dt.call(t.ownerDocument||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,null,!1)},Tn=function(n){return"object"===t(d)?n instanceof d:n&&"object"===t(n)&&"number"==typeof n.nodeType&&"string"==typeof n.nodeName},_n=function(t,n,e){ft[t]&&h(ft[t],(function(t){t.call(a,n,e,dn)}))},kn=function(t){var n,e;if(_n("beforeSanitizeElements",t,null),(e=t)instanceof g&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof f)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes))return vn(t),!0;if(C(/[\u0080-\uFFFF]/,t.nodeName))return vn(t),!0;var r=bt(t.nodeName);if(_n("uponSanitizeElement",t,{tagName:r,allowedTags:St}),t.hasChildNodes()&&!Tn(t.firstElementChild)&&(!Tn(t.content)||!Tn(t.content.firstElementChild))&&C(/<[/\w]/g,t.innerHTML)&&C(/<[/\w]/g,t.textContent))return vn(t),!0;if("select"===r&&C(/