diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 45ceedf..a916505 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -47,6 +47,7 @@ archives: files: - przykladowe-pliki-wejsciowe - klucze + - examples - src: docs/ksef-dokumentacja-uzytkownika.pdf dst: ksef-dokumentacja-uzytkownika.pdf diff --git a/cmd/ksef/commands/render-pdf.go b/cmd/ksef/commands/render-pdf.go new file mode 100644 index 0000000..a7b2dad --- /dev/null +++ b/cmd/ksef/commands/render-pdf.go @@ -0,0 +1,117 @@ +package commands + +import ( + "crypto/sha256" + "encoding/base64" + "encoding/hex" + "flag" + "fmt" + "ksef/internal/logging" + "ksef/internal/pdf" + "ksef/internal/registry" + "ksef/internal/utils" + "os" +) + +type renderPDFCommand struct { + Command +} +type renderPDFArgsType struct { + path string + resolverConfig utils.FilepathResolverConfig + invoice string +} + +var RenderPDFCommand *renderPDFCommand +var renderPDFArgs renderPDFArgsType + +func init() { + RenderPDFCommand = &renderPDFCommand{ + Command: Command{ + Name: "render-pdf", + FlagSet: flag.NewFlagSet("render-pdf", flag.ExitOnError), + Description: "drukuje PDF dla wskazanej faktury używając lokalnego szablonu", + Run: renderPDFRun, + Args: renderPDFArgs, + }, + } + + RenderPDFCommand.FlagSet.StringVar( + &renderPDFArgs.path, + "p", + "", + "ścieżka do pliku rejestru", + ) + RenderPDFCommand.FlagSet.StringVar( + &renderPDFArgs.resolverConfig.Path, + "o", + "", + "ścieżka do zapisu PDF (domyślnie katalog pliku statusu + {nrRef}.pdf)", + ) + RenderPDFCommand.FlagSet.BoolVar( + &renderPDFArgs.resolverConfig.Mkdir, + "m", + false, + "stwórz katalog, jeśli wskazany do zapisu nie istnieje", + ) + RenderPDFCommand.FlagSet.StringVar( + &renderPDFArgs.invoice, + "i", + "", + "plik XML do wizualizacji", + ) + + registerCommand(&RenderPDFCommand.Command) +} + +func renderPDFRun(c *Command) error { + if renderPDFArgs.path == "" || renderPDFArgs.invoice == "" { + RenderPDFCommand.FlagSet.Usage() + return nil + } + + registry, err := registry.LoadRegistry(renderPDFArgs.path) + if err != nil { + return fmt.Errorf("unable to load registry from file: %v", err) + } + + if registry.Environment == "" { + return fmt.Errorf("file deserialized correctly, but environment is empty") + } + + fileContent, err := os.ReadFile(renderPDFArgs.invoice) + if err != nil { + return fmt.Errorf("nie udało się odczytać pliku źródłowego") + } + + hasher := sha256.New() + hasher.Write(fileContent) + fileChecksum := hex.EncodeToString(hasher.Sum(nil)) + fileBase64 := base64.StdEncoding.EncodeToString(fileContent) + + logging.PDFRendererLogger.Debug("calculated checksum", "checksum", fileChecksum) + + invoiceMeta := registry.GetInvoiceByChecksum(fileChecksum) + if invoiceMeta.Checksum != fileChecksum { + return fmt.Errorf("nie udało się znaleźć faktury na podstawie kryteriów wejściowych") + } + + renderPDFArgs.resolverConfig.DefaultFilename = fmt.Sprintf( + "%s.pdf", + invoiceMeta.SEIReferenceNumber, + ) + + outputPath, err := utils.ResolveFilepath(renderPDFArgs.resolverConfig) + if err == utils.ErrDoesNotExistAndMkdirNotSpecified { + return fmt.Errorf("wskazany katalog nie istnieje a nie użyłeś opcji `-m`") + } + if err != nil { + return fmt.Errorf("błąd tworzenia katalogu wyjściowego: %v", err) + } + + printingEngine, err := pdf.GetLocalPrintingEngine() + if err != nil { + return fmt.Errorf("nie udało się zainicjować silnika drukowania: %v", err) + } + return printingEngine.Print(fileBase64, invoiceMeta, outputPath) +} diff --git a/cmd/ksef/commands/status.go b/cmd/ksef/commands/status.go index ed482e5..7add3c8 100644 --- a/cmd/ksef/commands/status.go +++ b/cmd/ksef/commands/status.go @@ -6,7 +6,7 @@ import ( registryPkg "ksef/internal/registry" "ksef/internal/sei/api/client" "ksef/internal/sei/api/upo" - "os" + "ksef/internal/utils" "path/filepath" ) @@ -35,8 +35,18 @@ func init() { } StatusCommand.FlagSet.StringVar(&statusArgs.path, "p", "", "ścieżka do pliku rejestru") - StatusCommand.FlagSet.StringVar(&statusArgs.downloadUPOArgs.Output, "o", "", "ścieżka do zapisu UPO (domyślnie katalog pliku rejestru + {nrRef}.pdf)") - StatusCommand.FlagSet.BoolVar(&statusArgs.downloadUPOArgs.Mkdir, "m", false, "stwórz katalog, jeśli wskazany do zapisu nie istnieje") + StatusCommand.FlagSet.StringVar( + &statusArgs.downloadUPOArgs.Output, + "o", + "", + "ścieżka do zapisu UPO (domyślnie katalog pliku rejestru + {nrRef}.pdf)", + ) + StatusCommand.FlagSet.BoolVar( + &statusArgs.downloadUPOArgs.Mkdir, + "m", + false, + "stwórz katalog, jeśli wskazany do zapisu nie istnieje", + ) StatusCommand.FlagSet.BoolVar(&statusArgs.xml, "xml", false, "zapis UPO jako plik XML") registerCommand(&StatusCommand.Command) @@ -54,7 +64,10 @@ func statusRun(c *Command) error { } if registry.Environment == "" || registry.SessionID == "" { - return fmt.Errorf("file deserialized correctly, but either environment or referenceNo are empty: %+v", registry) + return fmt.Errorf( + "file deserialized correctly, but either environment or referenceNo are empty: %+v", + registry, + ) } statusArgs.downloadUPOArgs.OutputFormat = upo.UPOFormatPDF @@ -67,29 +80,23 @@ func statusRun(c *Command) error { statusArgs.downloadUPOArgs.Output = filepath.Dir(statusArgs.path) } - // let's validate output. - // first, let's check if this is a file or a directory. - outputExt := filepath.Ext(statusArgs.downloadUPOArgs.Output) - outputPath := filepath.Dir(statusArgs.downloadUPOArgs.Output) + outputPath, err := utils.ResolveFilepath( + utils.FilepathResolverConfig{ + Path: statusArgs.downloadUPOArgs.Output, + Mkdir: statusArgs.downloadUPOArgs.Mkdir, + DefaultFilename: fmt.Sprintf( + "%s.%s", + registry.SessionID, + statusArgs.downloadUPOArgs.OutputFormat, + ), + }, + ) - if outputExt == "" { - // since there is no filename extension we have to treat the whole thing as a path. - outputPath = statusArgs.downloadUPOArgs.Output - statusArgs.downloadUPOArgs.Output = filepath.Join(outputPath, fmt.Sprintf("%s.%s", registry.SessionID, statusArgs.downloadUPOArgs.OutputFormat)) + if err == utils.ErrDoesNotExistAndMkdirNotSpecified { + return fmt.Errorf("wskazany katalog nie istnieje a nie użyłeś opcji `-m`") } - - // let's validate output directory - _, err = os.Stat(outputPath) - - if os.IsNotExist(err) { - // that's still fine at this point. let's check if we can create it. - if !statusArgs.downloadUPOArgs.Mkdir { - return fmt.Errorf("wskazany katalog nie istnieje a nie użyłeś opcji `-m`") - } - if err = os.MkdirAll(outputPath, 0755); err != nil { - return fmt.Errorf("błąd tworzenia katalogu wyjściowego: %v", err) - } - + if err != nil { + return fmt.Errorf("błąd tworzenia katalogu wyjściowego: %v", err) } statusArgs.downloadUPOArgs.OutputPath = outputPath diff --git a/docs/.vitepress/config.mjs b/docs/.vitepress/config.mjs index 3493d9a..29a1e66 100644 --- a/docs/.vitepress/config.mjs +++ b/docs/.vitepress/config.mjs @@ -38,7 +38,10 @@ export default defineConfig({ { text: 'Pobieranie faktur', link: '/content/komendy/download'}, { text: 'Pobieranie UPO', link: '/content/komendy/upo'}, { text: 'Identyfikator płatności', link: '/content/komendy/payment-id'}, - { text: 'Wizualizacja PDF', link: '/content/komendy/wizualizacja-pdf'}, + { text: 'Wizualizacja PDF', items: [ + {text: "Wizualizacja KSeF", link: '/content/komendy/wizualizacja-pdf'}, + {text: "Wizualizacja lokalna", link: '/content/komendy/lokalny-pdf'}, + ]}, ] } ], diff --git a/docs/content/komendy/lokalny-pdf.md b/docs/content/komendy/lokalny-pdf.md new file mode 100644 index 0000000..dcc44b1 --- /dev/null +++ b/docs/content/komendy/lokalny-pdf.md @@ -0,0 +1,154 @@ +# Wizualiacja PDF na podstawie własnego szablonu + +::: warning +Ta funkcjonalność jest cały czas rozwijana - jestem otwarty na wszelkie sugestie +::: + +Niestety, w związku z tym, że eFaktura jest plikiem XML mamy pod górkę już na starcie. Teoretycznie, aby skonwertować plik XML na HTML wystarczy użyć transformacji XSLT. Tyle tylko, że plik faktury zawiera przestrzenie nazw co powoduje, że zapytania XPath stają się niezbyt przyjemne i czytelne. + +Zamiast tego wpadłem na pomysł aby do wizualizacji służyła mikroaplikacja javascriptowa która na wejściu przyjmie surowy plik XML, następnie przetworzy go na obiekt javascriptowy, wyświetli w HTML a następnie wydrukuje za pomocą puppetteer + +::: warning +Zdaję sobie sprawę, że jest to wybór **niemerytoryczny** i że nie każdemu może przypaść do gustu. Dlatego zakładam, że silników drukujących mogłoby być kilka i konfigurowane byłyby w pliku konfiguracyjnym a ten który zaimplementowałem możnaby traktować jedynie jako wersję "referencyjną" +::: + +::: danger +Przykładowa aplikacja uruchamia przeglądarkę chrome / chromium z parametrem `--disable-web-security` aby załadować lokalne pliki z dysku. Opcją numer dwa byłoby serwowanie plików przez program kliencki na jakimś losowym porcie - póki co po prostu nie chce mi się tego implementować. Inną opcją jest użycie programu gotenberg ale wymaga to działającego dockera +::: + +## Rozumiem zagrożenie, co mam zrobić? + +Zerknij na katalog `examples/local-pdf-printout`. Zawiera on dwa katalogi: + +| katalog | znaczenie | +| ----------------- | --------------------------------------------------------------- | +| invoice-rendering | Zawiera **szablon aplikacji** wyświetlającej fakturę oraz QRKod | +| printing | Zawiera projekt oraz przykład skryptu drukującego | + +### Instalacja bibliotek + +```shell +cd invoice-rendering +npm install +cd ../printing +npm install +``` + +### Zmiana szablonu + +Referencyjna aplikacja ma zaimplementowany szablon który na 99% nie będzie spełniać Twoich oczekiwań ale da Ci pogląd na to w jaki sposób można odnosić się do danych zawartych w fakturze, jak renderować QRKod etc etc. + +Mikroaplikacja jest napisana w Vue.js. Ponownie - jest to wybór **niemerytoryczny** i przyczyna jest bardzo prosta - kod wyjściowy generowany przez Vue.js bardziej przypada mi do gustu niż inne silniki. + +W mojej opinii nie ma to jednak **najmniejszego** znaczenia, ponieważ - ponownie - mój sposób jest jedynie przykładowy i równie dobrze możesz napisać aplikację w react / angularze albo svelte. Grunt, żeby działała w identyczny sposób. + +Oto kilka najistotniejszych plików wraz z krótkim omówieniem + +| plik | znaczenie | +| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| index.html | Podstawowy szablon. Zwróć uwagę na specyficzne wartości wpisane do sekcji `head > meta`. Na ich podstawie aplikacja będzie w stanie zwizualizować fakturę | +| src/annotate-invoice.js | Tworzenie anotacji (dodatkowych pomocniczych informacji do wyświetlenia). Zawiera funkcję która podmienia pola z XML na mnemoniki a także oblicza częściowe i całkowite kwoty netto / brutto / VAT | +| src/components/\*.vue | pliki komponentów do renderowania faktury. Jeśli kiedykolwiek robiłeś coś w vue to z pewnością dasz radę je ogarnąć | + +### Sekcja `head > meta` + +Jest to dość istotna kwestia związana z szablonem. Wygląda ona następująco: + +```html + + + +``` + +Do sekcji `meta` mój program przekazuje następujące dane + +| zmienna | znaczenie | +| ------------------------ | ----------------------------------------------------------- | +| `__qrcode_url__` | Link do weryfikacji faktury który znajduje się na kodzie QR | +| `__invoice_sei_ref_no__` | Numer faktury który widnieje w KSeF | +| `__invoice_base64__` | Treść pliku XML z fakturą zakodowana w base64 | + +::: info +Jeśli testujesz szablon, użyj następującej komendy: + +```shell +npm run dev +``` + +Wówczas uruchomi się serwer na porcie 5173. Oczywiście jeśli zostawisz domyślne wartości meta to szablon się wysypie. Pamiętaj więc, żeby do testów wstawić tam własne wartości. O ile link QR i numer faktury z KSeF nie mają większego znaczenia o tyle jeśli nie wpiszesz faktycznego base64 z XML'a z fakturą do `meta[name=invoice]` to .. niczego nie potestujesz :) +::: + +### Budowanie wynikowego szablonu + +Jeśli dostosowałeś szablon do swoich potrzeb to zbuduj jego finalną wersję: + +```shell +npm run build -- --outDir=../template +``` + +::: warning +Podczas wizualizacji program tworzy plik `render.html` który wysyła do procesu drukującego. Teoretycznie więc jeśli będziesz mieć sporo wydruków, warto rozważyć trzymanie szablonu w ramdysku żeby nie niszczyć sobie dysku :-) +::: + +## Jak powiązać to z klientem? + +```text +./ksef render-pdf +Usage of render-pdf: + -i string + plik XML do wizualizacji + -m stwórz katalog, jeśli wskazany do zapisu nie istnieje + -o string + ścieżka do zapisu PDF (domyślnie katalog pliku statusu + {nrRef}.pdf) + -p string + ścieżka do pliku rejestru +``` + +Klient działa w następujący sposób: + +1. Oblicza sumę sha256 pliku XML faktury +2. Znajduje metadane KSeF faktury w pliku rejestru +3. Koduje plik do base64 +4. Bierze wskazany przez Ciebie szablon HTML a następnie wypełnia pola w `meta` odpowiednimi wartościami +5. Tworzy plik render.html (oryginalny index.html pozostaje bez zmian) +6. Renderuje PDF + +Więcej o konfiguracji silników do renderowania PDF czytaj w rozdziale [Konfiguracja](/content/konfiguracja) + +### Przykłady wywołań: + +::: warning +Warunkiem **koniecznym** jest wskazanie lokalizacji pliku konfiguracyjnego poprzez przełącznik `-c` +::: + +#### Zapisanie PDF'a w katalogu `katalog` z domyślną nazwą `{numerFakturyZKSeF}.pdf` + +```shell +./ksef -c config.yaml render-pdf -i katalog/invoice.xml -o katalog -p katalog/registry.yaml +``` + +#### Zapisanie PDF'a w katalogu z własną nazwą + +```shell +./ksef -c config.yaml render-pdf -i katalog/invoice.xml -o katalog/mojafaktura.pdf -p katalog/registry.yaml +``` + +#### Zapisanie PDF'a w innym katalogu z domyślną nazwą + +```shell +./ksef -c config.yaml render-pdf -i katalog/invoice.xml -o inny-katalog -m -p katalog/registry.yaml +``` + +::: warning +zwróć uwagę na flagę `-m` - w przeciwnym wypadku jeśli `inny-katalog` nie istnieje, program zwróci błąd +::: + +#### Zapisanie PDF'a w innym katalogu z własną nazwą + +```shell +./ksef -c config.yaml render-pdf -i katalog/invoice.xml -o inny-katalog/mojafaktura.pdf -m -p katalog/registry.yaml +``` + +::: warning +zwróć uwagę na flagę `-m` - w przeciwnym wypadku jeśli `inny-katalog` nie istnieje, program zwróci błąd +::: diff --git a/docs/content/konfiguracja.md b/docs/content/konfiguracja.md index 586dc87..68feafb 100644 --- a/docs/content/konfiguracja.md +++ b/docs/content/konfiguracja.md @@ -1,3 +1,36 @@ # Konfiguracja programu -W chwili obecnej jedyne co można skonfigurować to poziom loggerów, ale nie wykluczam, że w przyszłości pojawią się kolejne opcje. +## Konfiguracja loggerów + +```yaml +logging: + nazwa-loggera: poziom +``` + +Więcej o dostępnych loggerach i poziomach przeczytasz w rozdziale [Logowanie](/content/logowanie) + +## Konfiguracja silników lokalnego wydruku + +```yaml +pdf-renderer: + engine: puppeteer + node_bin: /usr/bin/node + browser_bin: /usr/bin/brave-browser + template_path: /sciezka/do/pliku/index.html + rendering_script: /sciezka/do/pliku/pdf.js +``` + +::: warning +Wymagane jest posiadanie przeglądarki opartej o silnik Chromium oraz zainstalowanie pakietu `puppeteer-core`. +::: + +::: warning +Jeśli korzystasz z systemu MacOS wówczas ścieżki mogą być podobne do poniższych: + +```yaml +pdf-renderer: + node_bin: /opt/homebrew/opt/node@20/bin/node + browser_bin: "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" +``` + +::: diff --git a/examples/local-pdf-printout/invoice-rendering/.gitignore b/examples/local-pdf-printout/invoice-rendering/.gitignore new file mode 100644 index 0000000..8ee54e8 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo diff --git a/examples/local-pdf-printout/invoice-rendering/README.md b/examples/local-pdf-printout/invoice-rendering/README.md new file mode 100644 index 0000000..51c157f --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/README.md @@ -0,0 +1,21 @@ +# ksef-invoice-visualizer + +To jest _przykładowa_ aplikacja renderująca fakturę z KSeF + +## Instalacja paczek + +```sh +npm install +``` + +### Uruchomienie trybu dev (pamiętaj o wypełnieniu wartości w `meta`!) + +```sh +npm run dev +``` + +### Zbudowanie wynikowego szablonu + +```sh +npm run build -- --outDir=../template +``` diff --git a/examples/local-pdf-printout/invoice-rendering/index.html b/examples/local-pdf-printout/invoice-rendering/index.html new file mode 100644 index 0000000..f8ea750 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/index.html @@ -0,0 +1,16 @@ + + + + + + + + + + Vite App + + +
+ + + diff --git a/examples/local-pdf-printout/invoice-rendering/jsconfig.json b/examples/local-pdf-printout/invoice-rendering/jsconfig.json new file mode 100644 index 0000000..5a1f2d2 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/jsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "paths": { + "@/*": ["./src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/examples/local-pdf-printout/invoice-rendering/package-lock.json b/examples/local-pdf-printout/invoice-rendering/package-lock.json new file mode 100644 index 0000000..429af6a --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/package-lock.json @@ -0,0 +1,993 @@ +{ + "name": "ksef-invoice-visualizer", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "ksef-invoice-visualizer", + "version": "0.0.0", + "dependencies": { + "@akamfoad/qrcode": "^0.3.1", + "bootstrap": "^5.3.2", + "utf8": "^3.0.0", + "vue": "^3.3.11", + "xml-js": "^1.6.11" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^4.5.2", + "vite": "^5.0.10" + } + }, + "node_modules/@akamfoad/qr": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@akamfoad/qr/-/qr-0.4.0.tgz", + "integrity": "sha512-kkuVMHLZIXdJbno48tcZIIFHwmc8QPbq0872sPxPMXQxpOBN007viBesAoME3es5yQg9KPXMPROYGe+piqeTTA==", + "engines": { + "node": ">=16" + } + }, + "node_modules/@akamfoad/qrcode": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@akamfoad/qrcode/-/qrcode-0.3.1.tgz", + "integrity": "sha512-huQHzwRCmQppNxPVcUW0ZWSs2YRm4zrhEspdmla3XV6hQlWi8myGlj+4tVeOuVm8ZYlja1WFIWZsyNwjXOJMxQ==", + "dependencies": { + "@akamfoad/qr": "^0.4.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@babel/parser": { + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.6.tgz", + "integrity": "sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ==", + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.10.tgz", + "integrity": "sha512-Q+mk96KJ+FZ30h9fsJl+67IjNJm3x2eX+GBWGmocAKgzp27cowCOOqSdscX80s0SpdFXZnIv/+1xD1EctFx96Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.10.tgz", + "integrity": "sha512-7W0bK7qfkw1fc2viBfrtAEkDKHatYfHzr/jKAHNr9BvkYDXPcC6bodtm8AyLJNNuqClLNaeTLuwURt4PRT9d7w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.10.tgz", + "integrity": "sha512-1X4CClKhDgC3by7k8aOWZeBXQX8dHT5QAMCAQDArCLaYfkppoARvh0fit3X2Qs+MXDngKcHv6XXyQCpY0hkK1Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.10.tgz", + "integrity": "sha512-O/nO/g+/7NlitUxETkUv/IvADKuZXyH4BHf/g/7laqKC4i/7whLpB0gvpPc2zpF0q9Q6FXS3TS75QHac9MvVWw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.10.tgz", + "integrity": "sha512-YSRRs2zOpwypck+6GL3wGXx2gNP7DXzetmo5pHXLrY/VIMsS59yKfjPizQ4lLt5vEI80M41gjm2BxrGZ5U+VMA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.10.tgz", + "integrity": "sha512-alfGtT+IEICKtNE54hbvPg13xGBe4GkVxyGWtzr+yHO7HIiRJppPDhOKq3zstTcVf8msXb/t4eavW3jCDpMSmA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.10.tgz", + "integrity": "sha512-dMtk1wc7FSH8CCkE854GyGuNKCewlh+7heYP/sclpOG6Cectzk14qdUIY5CrKDbkA/OczXq9WesqnPl09mj5dg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.10.tgz", + "integrity": "sha512-G5UPPspryHu1T3uX8WiOEUa6q6OlQh6gNl4CO4Iw5PS+Kg5bVggVFehzXBJY6X6RSOMS8iXDv2330VzaObm4Ag==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.10.tgz", + "integrity": "sha512-j6gUW5aAaPgD416Hk9FHxn27On28H4eVI9rJ4az7oCGTFW48+LcgNDBN+9f8rKZz7EEowo889CPKyeaD0iw9Kg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.10.tgz", + "integrity": "sha512-QxaouHWZ+2KWEj7cGJmvTIHVALfhpGxo3WLmlYfJ+dA5fJB6lDEIg+oe/0//FuyVHuS3l79/wyBxbHr0NgtxJQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.10.tgz", + "integrity": "sha512-4ub1YwXxYjj9h1UIZs2hYbnTZBtenPw5NfXCRgEkGb0b6OJ2gpkMvDqRDYIDRjRdWSe/TBiZltm3Y3Q8SN1xNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.10.tgz", + "integrity": "sha512-lo3I9k+mbEKoxtoIbM0yC/MZ1i2wM0cIeOejlVdZ3D86LAcFXFRdeuZmh91QJvUTW51bOK5W2BznGNIl4+mDaA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.10.tgz", + "integrity": "sha512-J4gH3zhHNbdZN0Bcr1QUGVNkHTdpijgx5VMxeetSk6ntdt+vR1DqGmHxQYHRmNb77tP6GVvD+K0NyO4xjd7y4A==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.10.tgz", + "integrity": "sha512-tgT/7u+QhV6ge8wFMzaklOY7KqiyitgT1AUHMApau32ZlvTB/+efeCtMk4eXS+uEymYK249JsoiklZN64xt6oQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.10.tgz", + "integrity": "sha512-0f/spw0PfBMZBNqtKe5FLzBDGo0SKZKvMl5PHYQr3+eiSscfJ96XEknCe+JoOayybWUFQbcJTrk946i3j9uYZA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.10.tgz", + "integrity": "sha512-pZFe0OeskMHzHa9U38g+z8Yx5FNCLFtUnJtQMpwhS+r4S566aK2ci3t4NCP4tjt6d5j5uo4h7tExZMjeKoehAA==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.10.tgz", + "integrity": "sha512-SpYNEqg/6pZYoc+1zLCjVOYvxfZVZj6w0KROZ3Fje/QrM3nfvT2llI+wmKSrWuX6wmZeTapbarvuNNK/qepSgA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.10.tgz", + "integrity": "sha512-ACbZ0vXy9zksNArWlk2c38NdKg25+L9pr/mVaj9SUq6lHZu/35nx2xnQVRGLrC1KKQqJKRIB0q8GspiHI3J80Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.10.tgz", + "integrity": "sha512-PxcgvjdSjtgPMiPQrM3pwSaG4kGphP+bLSb+cihuP0LYdZv1epbAIecHVl5sD3npkfYBZ0ZnOjR878I7MdJDFg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.10.tgz", + "integrity": "sha512-ZkIOtrRL8SEJjr+VHjmW0znkPs+oJXhlJbNwfI37rvgeMtk3sxOQevXPXjmAPZPigVTncvFqLMd+uV0IBSEzqA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.10.tgz", + "integrity": "sha512-+Sa4oTDbpBfGpl3Hn3XiUe4f8TU2JF7aX8cOfqFYMMjXp6ma6NJDztl5FDG8Ezx0OjwGikIHw+iA54YLDNNVfw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.10.tgz", + "integrity": "sha512-EOGVLK1oWMBXgfttJdPHDTiivYSjX6jDNaATeNOaCOFEVcfMjtbx7WVQwPSE1eIfCp/CaSF2nSrDtzc4I9f8TQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.10.tgz", + "integrity": "sha512-whqLG6Sc70AbU73fFYvuYzaE4MNMBIlR1Y/IrUeOXFrWHxBEjjbZaQ3IXIQS8wJdAzue2GwYZCjOrgrU1oUHoA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.1.tgz", + "integrity": "sha512-6vMdBZqtq1dVQ4CWdhFwhKZL6E4L1dV6jUjuBvsavvNJSppzi6dLBbuV+3+IyUREaj9ZFvQefnQm28v4OCXlig==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.1.tgz", + "integrity": "sha512-Jto9Fl3YQ9OLsTDWtLFPtaIMSL2kwGyGoVCmPC8Gxvym9TCZm4Sie+cVeblPO66YZsYH8MhBKDMGZ2NDxuk/XQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.1.tgz", + "integrity": "sha512-LtYcLNM+bhsaKAIGwVkh5IOWhaZhjTfNOkGzGqdHvhiCUVuJDalvDxEdSnhFzAn+g23wgsycmZk1vbnaibZwwA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.1.tgz", + "integrity": "sha512-KyP/byeXu9V+etKO6Lw3E4tW4QdcnzDG/ake031mg42lob5tN+5qfr+lkcT/SGZaH2PdW4Z1NX9GHEkZ8xV7og==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.1.tgz", + "integrity": "sha512-Yqz/Doumf3QTKplwGNrCHe/B2p9xqDghBZSlAY0/hU6ikuDVQuOUIpDP/YcmoT+447tsZTmirmjgG3znvSCR0Q==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.1.tgz", + "integrity": "sha512-u3XkZVvxcvlAOlQJ3UsD1rFvLWqu4Ef/Ggl40WAVCuogf4S1nJPHh5RTgqYFpCOvuGJ7H5yGHabjFKEZGExk5Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.1.tgz", + "integrity": "sha512-0XSYN/rfWShW+i+qjZ0phc6vZ7UWI8XWNz4E/l+6edFt+FxoEghrJHjX1EY/kcUGCnZzYYRCl31SNdfOi450Aw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.1.tgz", + "integrity": "sha512-LmYIO65oZVfFt9t6cpYkbC4d5lKHLYv5B4CSHRpnANq0VZUQXGcCPXHzbCXCz4RQnx7jvlYB1ISVNCE/omz5cw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.1.tgz", + "integrity": "sha512-kr8rEPQ6ns/Lmr/hiw8sEVj9aa07gh1/tQF2Y5HrNCCEPiCBGnBUt9tVusrcBBiJfIt1yNaXN6r1CCmpbFEDpg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.1.tgz", + "integrity": "sha512-t4QSR7gN+OEZLG0MiCgPqMWZGwmeHhsM4AkegJ0Kiy6TnJ9vZ8dEIwHw1LcZKhbHxTY32hp9eVCMdR3/I8MGRw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.1.tgz", + "integrity": "sha512-7XI4ZCBN34cb+BH557FJPmh0kmNz2c25SCQeT9OiFWEgf8+dL6ZwJ8f9RnUIit+j01u07Yvrsuu1rZGxJCc51g==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.1.tgz", + "integrity": "sha512-yE5c2j1lSWOH5jp+Q0qNL3Mdhr8WuqCNVjc6BxbVfS5cAS6zRmdiw7ktb8GNpDCEUJphILY6KACoFoRtKoqNQg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.1.tgz", + "integrity": "sha512-PyJsSsafjmIhVgaI1Zdj7m8BB8mMckFah/xbpplObyHfiXzKcI5UOUXRyOdHW7nz4DpMCuzLnF7v5IWHenCwYA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@vitejs/plugin-vue": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.6.0.tgz", + "integrity": "sha512-XHuyFdAikWRmHuAd89FOyUGIjrBU5KlxJtyi2hVeR9ySGFxQwE0bl5xAQju/ArMq5azdBivY4d+D2yPKwoYWUg==", + "dev": true, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "vite": "^4.0.0 || ^5.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.13.tgz", + "integrity": "sha512-bwi9HShGu7uaZLOErZgsH2+ojsEdsjerbf2cMXPwmvcgZfVPZ2BVZzCVnwZBxTAYd6Mzbmf6izcUNDkWnBBQ6A==", + "dependencies": { + "@babel/parser": "^7.23.5", + "@vue/shared": "3.3.13", + "estree-walker": "^2.0.2", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.3.13.tgz", + "integrity": "sha512-EYRDpbLadGtNL0Gph+HoKiYqXLqZ0xSSpR5Dvnu/Ep7ggaCbjRDIus1MMxTS2Qm0koXED4xSlvTZaTnI8cYAsw==", + "dependencies": { + "@vue/compiler-core": "3.3.13", + "@vue/shared": "3.3.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.3.13.tgz", + "integrity": "sha512-DQVmHEy/EKIgggvnGRLx21hSqnr1smUS9Aq8tfxiiot8UR0/pXKHN9k78/qQ7etyQTFj5em5nruODON7dBeumw==", + "dependencies": { + "@babel/parser": "^7.23.5", + "@vue/compiler-core": "3.3.13", + "@vue/compiler-dom": "3.3.13", + "@vue/compiler-ssr": "3.3.13", + "@vue/reactivity-transform": "3.3.13", + "@vue/shared": "3.3.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.5", + "postcss": "^8.4.32", + "source-map-js": "^1.0.2" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.3.13.tgz", + "integrity": "sha512-d/P3bCeUGmkJNS1QUZSAvoCIW4fkOKK3l2deE7zrp0ypJEy+En2AcypIkqvcFQOcw3F0zt2VfMvNsA9JmExTaw==", + "dependencies": { + "@vue/compiler-dom": "3.3.13", + "@vue/shared": "3.3.13" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.13.tgz", + "integrity": "sha512-fjzCxceMahHhi4AxUBzQqqVhuA21RJ0COaWTbIBl1PruGW1CeY97louZzLi4smpYx+CHfFPPU/CS8NybbGvPKQ==", + "dependencies": { + "@vue/shared": "3.3.13" + } + }, + "node_modules/@vue/reactivity-transform": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/reactivity-transform/-/reactivity-transform-3.3.13.tgz", + "integrity": "sha512-oWnydGH0bBauhXvh5KXUy61xr9gKaMbtsMHk40IK9M4gMuKPJ342tKFarY0eQ6jef8906m35q37wwA8DMZOm5Q==", + "dependencies": { + "@babel/parser": "^7.23.5", + "@vue/compiler-core": "3.3.13", + "@vue/shared": "3.3.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.5" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.3.13.tgz", + "integrity": "sha512-1TzA5TvGuh2zUwMJgdfvrBABWZ7y8kBwBhm7BXk8rvdx2SsgcGfz2ruv2GzuGZNvL1aKnK8CQMV/jFOrxNQUMA==", + "dependencies": { + "@vue/reactivity": "3.3.13", + "@vue/shared": "3.3.13" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.3.13.tgz", + "integrity": "sha512-JJkpE8R/hJKXqVTgUoODwS5wqKtOsmJPEqmp90PDVGygtJ4C0PtOkcEYXwhiVEmef6xeXcIlrT3Yo5aQ4qkHhQ==", + "dependencies": { + "@vue/runtime-core": "3.3.13", + "@vue/shared": "3.3.13", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.3.13.tgz", + "integrity": "sha512-vSnN+nuf6iSqTL3Qgx/9A+BT+0Zf/VJOgF5uMZrKjYPs38GMYyAU1coDyBNHauehXDaP+zl73VhwWv0vBRBHcg==", + "dependencies": { + "@vue/compiler-ssr": "3.3.13", + "@vue/shared": "3.3.13" + }, + "peerDependencies": { + "vue": "3.3.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.3.13.tgz", + "integrity": "sha512-/zYUwiHD8j7gKx2argXEMCUXVST6q/21DFU0sTfNX0URJroCe3b1UF6vLJ3lQDfLNIiiRl2ONp7Nh5UVWS6QnA==" + }, + "node_modules/bootstrap": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.2.tgz", + "integrity": "sha512-D32nmNWiQHo94BKHLmOrdjlL05q1c8oxbtBphQFb9Z5to6eGRDCm0QgeaZ4zFBHzfg2++rqa2JkqCcxDy0sH0g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/twbs" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/bootstrap" + } + ], + "peerDependencies": { + "@popperjs/core": "^2.11.8" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" + }, + "node_modules/esbuild": { + "version": "0.19.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.10.tgz", + "integrity": "sha512-S1Y27QGt/snkNYrRcswgRFqZjaTG5a5xM3EQo97uNBnH505pdzSNe/HLBq1v0RO7iK/ngdbhJB6mDAp0OK+iUA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.19.10", + "@esbuild/android-arm": "0.19.10", + "@esbuild/android-arm64": "0.19.10", + "@esbuild/android-x64": "0.19.10", + "@esbuild/darwin-arm64": "0.19.10", + "@esbuild/darwin-x64": "0.19.10", + "@esbuild/freebsd-arm64": "0.19.10", + "@esbuild/freebsd-x64": "0.19.10", + "@esbuild/linux-arm": "0.19.10", + "@esbuild/linux-arm64": "0.19.10", + "@esbuild/linux-ia32": "0.19.10", + "@esbuild/linux-loong64": "0.19.10", + "@esbuild/linux-mips64el": "0.19.10", + "@esbuild/linux-ppc64": "0.19.10", + "@esbuild/linux-riscv64": "0.19.10", + "@esbuild/linux-s390x": "0.19.10", + "@esbuild/linux-x64": "0.19.10", + "@esbuild/netbsd-x64": "0.19.10", + "@esbuild/openbsd-x64": "0.19.10", + "@esbuild/sunos-x64": "0.19.10", + "@esbuild/win32-arm64": "0.19.10", + "@esbuild/win32-ia32": "0.19.10", + "@esbuild/win32-x64": "0.19.10" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/magic-string": { + "version": "0.30.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.5.tgz", + "integrity": "sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/nanoid": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" + }, + "node_modules/postcss": { + "version": "8.4.32", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.32.tgz", + "integrity": "sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.9.1.tgz", + "integrity": "sha512-pgPO9DWzLoW/vIhlSoDByCzcpX92bKEorbgXuZrqxByte3JFk2xSW2JEeAcyLc9Ru9pqcNNW+Ob7ntsk2oT/Xw==", + "dev": true, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.9.1", + "@rollup/rollup-android-arm64": "4.9.1", + "@rollup/rollup-darwin-arm64": "4.9.1", + "@rollup/rollup-darwin-x64": "4.9.1", + "@rollup/rollup-linux-arm-gnueabihf": "4.9.1", + "@rollup/rollup-linux-arm64-gnu": "4.9.1", + "@rollup/rollup-linux-arm64-musl": "4.9.1", + "@rollup/rollup-linux-riscv64-gnu": "4.9.1", + "@rollup/rollup-linux-x64-gnu": "4.9.1", + "@rollup/rollup-linux-x64-musl": "4.9.1", + "@rollup/rollup-win32-arm64-msvc": "4.9.1", + "@rollup/rollup-win32-ia32-msvc": "4.9.1", + "@rollup/rollup-win32-x64-msvc": "4.9.1", + "fsevents": "~2.3.2" + } + }, + "node_modules/sax": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==" + }, + "node_modules/source-map-js": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", + "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + }, + "node_modules/vite": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.10.tgz", + "integrity": "sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw==", + "dev": true, + "dependencies": { + "esbuild": "^0.19.3", + "postcss": "^8.4.32", + "rollup": "^4.2.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.3.13", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.13.tgz", + "integrity": "sha512-LDnUpQvDgsfc0u/YgtAgTMXJlJQqjkxW1PVcOnJA5cshPleULDjHi7U45pl2VJYazSSvLH8UKcid/kzH8I0a0Q==", + "dependencies": { + "@vue/compiler-dom": "3.3.13", + "@vue/compiler-sfc": "3.3.13", + "@vue/runtime-dom": "3.3.13", + "@vue/server-renderer": "3.3.13", + "@vue/shared": "3.3.13" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/xml-js": { + "version": "1.6.11", + "resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz", + "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", + "dependencies": { + "sax": "^1.2.4" + }, + "bin": { + "xml-js": "bin/cli.js" + } + } + } +} diff --git a/examples/local-pdf-printout/invoice-rendering/package.json b/examples/local-pdf-printout/invoice-rendering/package.json new file mode 100644 index 0000000..58714d5 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/package.json @@ -0,0 +1,22 @@ +{ + "name": "ksef-invoice-visualizer", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview" + }, + "dependencies": { + "@akamfoad/qrcode": "^0.3.1", + "bootstrap": "^5.3.2", + "utf8": "^3.0.0", + "vue": "^3.3.11", + "xml-js": "^1.6.11" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^4.5.2", + "vite": "^5.0.10" + } +} diff --git a/examples/local-pdf-printout/invoice-rendering/src/App.vue b/examples/local-pdf-printout/invoice-rendering/src/App.vue new file mode 100644 index 0000000..b01de82 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/App.vue @@ -0,0 +1,29 @@ + + + diff --git a/examples/local-pdf-printout/invoice-rendering/src/annotate-invoice.js b/examples/local-pdf-printout/invoice-rendering/src/annotate-invoice.js new file mode 100644 index 0000000..414bf3f --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/annotate-invoice.js @@ -0,0 +1,84 @@ +const InvoiceItemRenameFields = { + "P_7": "name", + "P_8A": "units", + "P_8B": "quantity", + "P_9A": "unit-price-net", + "P_9B": "unit-price-gross", + "P_12": "vat-rate", +} + +const round = (value) => { + return Math.round(value * 100) / 100 +} + +const parseTotals = (item) => { + let total = { + net: 0.0, + gross: 0.0, + vat: 0.0, + } + + const vatQuantizer = 1 + item["vat-value"] + + if (item["unit-price-net"] !== undefined) { + // calculate from net to gross + total.net = round(item["unit-price-net"] * item["quantity"]) + total.gross = round(total.net * vatQuantizer) + } else { + total.gross = round(item["unit-price-gross"] * item["quantity"]) + total.net = round(total.gross / vatQuantizer) + } + + total.vat = round(total.gross - total.net); + + return total; +} + +export const annotateInvoice = (invoice) => { + let total = { + by_rate: {}, + total: {}, + } + let items = [] + let vat_rate = "" + let totalTemplate = { + net: 0.0, + vat: 0.0, + gross: 0.0, + } + + total["total"] = {...totalTemplate} + + for (let item of invoice.Faktura.Fa.FaWiersz) { + for (const [old_key, new_key] of Object.entries(InvoiceItemRenameFields)) { + if (item[old_key] !== undefined) { + item[new_key] = item[old_key] + delete(item[old_key]) + } + } + item["vat-value"] = 0.0 + if (typeof item["vat-rate"] === "number") { + item["vat-value"] = item["vat-rate"] / 100; + } + items.push(item); + vat_rate = item["vat-rate"] + if (total["by_rate"][vat_rate] === undefined) { + total["by_rate"][vat_rate] = {...totalTemplate} + } + var totals = parseTotals(item); + item["amount"] = totals; + + total["by_rate"][vat_rate].net = round(totals.net + total["by_rate"][vat_rate].net); + total["by_rate"][vat_rate].gross = round(totals.gross + total["by_rate"][vat_rate].gross); + total["by_rate"][vat_rate].vat = round(totals.vat + total["by_rate"][vat_rate].vat) + + total["total"].net = round(totals.net + total["total"].net); + total["total"].gross = round(totals.gross + total["total"].gross); + total["total"].vat = round(totals.vat + total["total"].vat); + + } + return { + items: items, + total: total, + } +} \ No newline at end of file diff --git a/examples/local-pdf-printout/invoice-rendering/src/components/Invoice.vue b/examples/local-pdf-printout/invoice-rendering/src/components/Invoice.vue new file mode 100644 index 0000000..ea621fc --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/components/Invoice.vue @@ -0,0 +1,93 @@ + + + + + \ No newline at end of file diff --git a/examples/local-pdf-printout/invoice-rendering/src/components/items.vue b/examples/local-pdf-printout/invoice-rendering/src/components/items.vue new file mode 100644 index 0000000..140ca0c --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/components/items.vue @@ -0,0 +1,57 @@ + + + \ No newline at end of file diff --git a/examples/local-pdf-printout/invoice-rendering/src/components/subject.vue b/examples/local-pdf-printout/invoice-rendering/src/components/subject.vue new file mode 100644 index 0000000..a5715b0 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/components/subject.vue @@ -0,0 +1,17 @@ + + + \ No newline at end of file diff --git a/examples/local-pdf-printout/invoice-rendering/src/main.js b/examples/local-pdf-printout/invoice-rendering/src/main.js new file mode 100644 index 0000000..23afa76 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/main.js @@ -0,0 +1,6 @@ +import 'bootstrap/dist/css/bootstrap.min.css' + +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/local-pdf-printout/invoice-rendering/src/utils.js b/examples/local-pdf-printout/invoice-rendering/src/utils.js new file mode 100644 index 0000000..5607b91 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/utils.js @@ -0,0 +1,6 @@ +export const vatRateASString = (vatRate) => { + if (parseFloat(vatRate) !== NaN) { + return vatRate + " %" + } + return vatRate; +} diff --git a/examples/local-pdf-printout/invoice-rendering/src/xml2object.js b/examples/local-pdf-printout/invoice-rendering/src/xml2object.js new file mode 100644 index 0000000..de10aeb --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/src/xml2object.js @@ -0,0 +1,44 @@ +/* https://github.com/nashwaan/xml-js/issues/53 */ +import { xml2js } from "xml-js" +import utf8 from "utf8" + +const nativeType = function (value) { + let nValue = Number(value); + if (!isNaN(nValue)) { + return nValue; + } + let bValue = value.toLowerCase(); + if (bValue === 'true') { + return true; + } else if (bValue === 'false') { + return false; + } + return utf8.decode(value); + } + + const removeJsonTextAttribute = function (value, parentElement) { + try { + const parentOfParent = parentElement._parent; + const pOpKeys = Object.keys(parentElement._parent); + const keyNo = pOpKeys.length; + const keyName = pOpKeys[keyNo - 1]; + const arrOfKey = parentElement._parent[keyName]; + const arrOfKeyLen = arrOfKey.length; + if (arrOfKeyLen > 0) { + const arr = arrOfKey; + const arrIndex = arrOfKey.length - 1; + arr[arrIndex] = value; + } else { + parentElement._parent[keyName] = nativeType(value); + } + } catch (e) { } + }; + +export const xml2object = (content) => { + return xml2js(content, { + compact: true, + ignoreAttributes: true, + nativeType: false, + textFn: removeJsonTextAttribute, + }); +} \ No newline at end of file diff --git a/examples/local-pdf-printout/invoice-rendering/vite.config.js b/examples/local-pdf-printout/invoice-rendering/vite.config.js new file mode 100644 index 0000000..25b7ea8 --- /dev/null +++ b/examples/local-pdf-printout/invoice-rendering/vite.config.js @@ -0,0 +1,17 @@ +import { fileURLToPath, URL } from 'node:url' + +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + ], + base: '', + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + } +}) diff --git a/examples/local-pdf-printout/printing/package-lock.json b/examples/local-pdf-printout/printing/package-lock.json new file mode 100644 index 0000000..7612328 --- /dev/null +++ b/examples/local-pdf-printout/printing/package-lock.json @@ -0,0 +1,877 @@ +{ + "name": "printing", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "puppeteer-core": "^21.6.1" + } + }, + "node_modules/@puppeteer/browsers": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-1.9.0.tgz", + "integrity": "sha512-QwguOLy44YBGC8vuPP2nmpX4MUN2FzWbsnvZJtiCzecU3lHmVZkaC1tq6rToi9a200m8RzlVtDyxCS0UIDrxUg==", + "dependencies": { + "debug": "4.3.4", + "extract-zip": "2.0.1", + "progress": "2.0.3", + "proxy-agent": "6.3.1", + "tar-fs": "3.0.4", + "unbzip2-stream": "1.4.3", + "yargs": "17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=16.3.0" + } + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==" + }, + "node_modules/@types/node": { + "version": "20.10.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.5.tgz", + "integrity": "sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw==", + "optional": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/agent-base": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.0.tgz", + "integrity": "sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg==", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/b4a": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.4.tgz", + "integrity": "sha512-fpWrvyVHEKyeEvbKZTVOeZF3VSKKWtJxFIxX/jaVPf+cLbGUSitjb49pHLqPV2BUNNZ0LcoeEGfE/YCpyDYHIw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/basic-ftp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.4.tgz", + "integrity": "sha512-8PzkB0arJFV4jJWSGOYR+OEic6aeKMu/osRhBULN6RY0ykby6LKhbmuQ5ublvaas5BOwboah5D87nrHyuh8PPA==", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "engines": { + "node": "*" + } + }, + "node_modules/chromium-bidi": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.5.1.tgz", + "integrity": "sha512-dcCqOgq9fHKExc2R4JZs/oKbOghWpUNFAJODS8WKRtLhp3avtIH5UDCBrutdqZdh3pARogH8y1ObXm87emwb3g==", + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "9.0.0" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", + "dependencies": { + "node-fetch": "^2.6.12" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", + "integrity": "sha512-MZd3VlchQkp8rdend6vrx7MmVDJzSNTBvghvKjirLkD+WTChA3KUf0jkE68Q4UyctNqI11zZO9/x2Yx+ub5Cvg==", + "engines": { + "node": ">= 14" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.1203626", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1203626.tgz", + "integrity": "sha512-nEzHZteIUZfGCZtTiS1fRpC8UZmsfD1SiyPvaUNvS13dvKf666OAm8YTi0+Ca3n1nLEyu49Cy4+dPWpaHFJk9g==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "engines": { + "node": ">=6" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==" + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.2.tgz", + "integrity": "sha512-5KLucCJobh8vBY1K07EFV4+cPZH3mrV9YeAruUseCQKHB58SGjjT2l9/eA9LD082IiuMjSlFJEcdJ27TXvbZNw==", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.0", + "debug": "^4.3.4", + "fs-extra": "^8.1.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + }, + "node_modules/http-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz", + "integrity": "sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ==", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz", + "integrity": "sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/ip": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.8.tgz", + "integrity": "sha512-PuExPYUiu6qMBQb4l06ecm6T6ujzhmh+MeJcW9wa89PoAz5pvd4zPgN5WJV104mb6S2T1AwNIAaB70JNrLQWhg==" + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==" + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/pac-proxy-agent": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.1.tgz", + "integrity": "sha512-ASV8yU4LLKBAjqIPMbrgtaKIvxQri/yh2OpI+S6hVa9JRkUI3Y3NPFbfngDtY7oFtSMD3w31Xns89mDa3Feo5A==", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "pac-resolver": "^7.0.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-resolver": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.0.tgz", + "integrity": "sha512-Fd9lT9vJbHYRACT8OhCbZBbxr6KRSawSovFpy8nDGshaK99S/EBhVIHp9+crhxrsZOuvLpgL1n23iyPg6Rl2hg==", + "dependencies": { + "degenerator": "^5.0.0", + "ip": "^1.1.8", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==" + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/proxy-agent": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.3.1.tgz", + "integrity": "sha512-Rb5RVBy1iyqOtNl15Cw/llpeLH8bsb37gM1FUfKQ+Wck6xHlbAhWGUFiTRHtkjqGTA5pSHz6+0hrPW/oECihPQ==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.2", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/puppeteer-core": { + "version": "21.6.1", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-21.6.1.tgz", + "integrity": "sha512-0chaaK/RL9S1U3bsyR4fUeUfoj51vNnjWvXgG6DcsyMjwYNpLcAThv187i1rZCo7QhJP0wZN8plQkjNyrq2h+A==", + "dependencies": { + "@puppeteer/browsers": "1.9.0", + "chromium-bidi": "0.5.1", + "cross-fetch": "4.0.0", + "debug": "4.3.4", + "devtools-protocol": "0.0.1203626", + "ws": "8.15.1" + }, + "engines": { + "node": ">=16.13.2" + } + }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==" + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.2.tgz", + "integrity": "sha512-8zuqoLv1aP/66PHF5TqwJ7Czm3Yv32urJQHrVyhD7mmA6d61Zv8cIXQYPTWwmg6qlupnPvs/QKDmfa4P/qct2g==", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "socks": "^2.7.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks/node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/streamx": { + "version": "2.15.6", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz", + "integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==", + "dependencies": { + "fast-fifo": "^1.1.0", + "queue-tick": "^1.0.1" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar-fs": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.4.tgz", + "integrity": "sha512-5AFQU8b9qLfZCX9zp2duONhPmZv0hGYiBPJsyUdqMjzq/mqVpy/rEUSeHk1+YitmxugaptgBh5oDGU3VsAJq4w==", + "dependencies": { + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + } + }, + "node_modules/tar-stream": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.6.tgz", + "integrity": "sha512-B/UyjYwPpMBv+PaFSWAmtYjwdrlEaZQEhMIBFNC5oEG8lpiW8XjcSdmEaClj28ArfKScKHs2nshz3k2le6crsg==", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "optional": true + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/urlpattern-polyfill": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-9.0.0.tgz", + "integrity": "sha512-WHN8KDQblxd32odxeIgo83rdVDE2bvdkb86it7bMhYZwWKJz0+O0RK/eZiHYnM+zgt/U7hAHOlCQGfjjvSkw2g==" + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/ws": { + "version": "8.15.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.15.1.tgz", + "integrity": "sha512-W5OZiCjXEmk0yZ66ZN82beM5Sz7l7coYxpRkzS+p9PP+ToQry8szKh+61eNktr7EA9DOwvFGhfC605jDHbP6QQ==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + } + } +} diff --git a/examples/local-pdf-printout/printing/package.json b/examples/local-pdf-printout/printing/package.json new file mode 100644 index 0000000..bc96c83 --- /dev/null +++ b/examples/local-pdf-printout/printing/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "puppeteer-core": "^21.6.1" + } +} diff --git a/examples/local-pdf-printout/printing/pdf.js b/examples/local-pdf-printout/printing/pdf.js new file mode 100644 index 0000000..8a59a41 --- /dev/null +++ b/examples/local-pdf-printout/printing/pdf.js @@ -0,0 +1,62 @@ +/** + * Copyright 2017 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +const puppeteer = require('puppeteer-core'); + +/** + * process.argv[2] => chrome location + * process.argv[3] => source HTML file + * process.argv[4] => destination PDF + */ + +if(process.argv.length < 5) { + process.exit(1); +} + +(async () => { + const browser = await puppeteer.launch({ + executablePath: process.argv[2], + args: ["--disable-web-security"] + }); + + const page = await browser.newPage(); + + await page.goto('file://' + process.argv[3], { + waitUntil: 'networkidle2', + }); + await page.emulateMediaType('print'); + + // await page.emulateMedia('print'); + // page.pdf() is currently supported only in headless mode. + // @see https://bugs.chromium.org/p/chromium/issues/detail?id=753118 + await page.pdf({ + path: process.argv[4], + format: 'A4', + preferCSSPageSize: true, + printBackground: true, + scale: 0.8, + margin: { + left: '1cm', + right: '1cm', + bottom: '1cm', + top: '1cm', + } + }); + + await browser.close(); +})(); diff --git a/internal/config/config.go b/internal/config/config.go index 086f5da..1146d9d 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -8,7 +8,8 @@ import ( ) type ConfigType struct { - Logging map[string]string `yaml:"logging"` + Logging map[string]string `yaml:"logging"` + PDFRenderer map[string]string `yaml:"pdf-renderer"` } var Config ConfigType diff --git a/internal/logging/loggers.go b/internal/logging/loggers.go index 5d09fbf..a5f003d 100644 --- a/internal/logging/loggers.go +++ b/internal/logging/loggers.go @@ -33,6 +33,7 @@ var DownloadLogger *slog.Logger = defaultLogger() var UPOLogger *slog.Logger = defaultLogger() var UPOHTTPLogger *slog.Logger = defaultLogger() var ParserLogger *slog.Logger = defaultLogger() +var PDFRendererLogger *slog.Logger = defaultLogger() func init() { // populate the helper map so that we can alter the loggers after config @@ -51,5 +52,6 @@ func init() { "upo": UPOLogger, "upo.http": UPOHTTPLogger, "parser": ParserLogger, + "pdf-renderer": PDFRendererLogger, } } diff --git a/internal/pdf/local_print.go b/internal/pdf/local_print.go new file mode 100644 index 0000000..29e4b8a --- /dev/null +++ b/internal/pdf/local_print.go @@ -0,0 +1,94 @@ +package pdf + +import ( + "errors" + "fmt" + "ksef/internal/config" + "ksef/internal/logging" + "ksef/internal/registry" + "os" + "os/exec" + "path" + "strings" +) + +const puppeteer = "puppeteer" + +type PDFPrinter interface { + Print(contentBase64 string, meta registry.Invoice, output string) error +} + +var ErrEngineNotConfigured = errors.New("PDF rendering engine not found in config") + +func GetLocalPrintingEngine() (PDFPrinter, error) { + engine := config.Config.PDFRenderer["engine"] + + if engine == puppeteer { + return &PuppeteerReferencePrinter{ + nodeBin: config.Config.PDFRenderer["node_bin"], + browserBin: config.Config.PDFRenderer["browser_bin"], + templatePath: config.Config.PDFRenderer["template_path"], + renderingScript: config.Config.PDFRenderer["rendering_script"], + }, nil + } + + return nil, ErrEngineNotConfigured +} + +type PuppeteerReferencePrinter struct { + nodeBin string + browserBin string + templatePath string + renderingScript string +} + +func (p *PuppeteerReferencePrinter) Print( + contentBase64 string, + invoiceMeta registry.Invoice, + output string, +) error { + replacer := strings.NewReplacer( + "__qrcode_url__", invoiceMeta.SEIQRCode, + "__invoice_sei_ref_no__", invoiceMeta.SEIReferenceNumber, + "__invoice_base64__", contentBase64, + ) + + templateDir := path.Dir(p.templatePath) + templateContent, err := os.ReadFile(p.templatePath) + if err != nil { + return fmt.Errorf("unable to read template file: %v", err) + } + + renderFilePath := path.Join(templateDir, "render.html") + destFile, err := os.Create(renderFilePath) + if err != nil { + return fmt.Errorf("unable to create pre-rendered file: %v", err) + } + + _, err = replacer.WriteString(destFile, string(templateContent)) + destFile.Close() + if err != nil { + return fmt.Errorf("unable to write to destFile: %v", err) + } + + command := p.nodeBin + commandArgs := []string{ + p.renderingScript, + p.browserBin, + renderFilePath, + output, + } + + logging.PDFRendererLogger.Debug("local PDF render", "command", command, "args", commandArgs) + + cmd := exec.Command(command, commandArgs...) + b := new(strings.Builder) + cmd.Stderr = b + + if err := cmd.Run(); err != nil { + fmt.Printf("Error from stderr: %v\n", b) + return fmt.Errorf("error during conversion to PDF: %v", err) + } + + return nil +} diff --git a/internal/utils/filepath.go b/internal/utils/filepath.go new file mode 100644 index 0000000..9397f03 --- /dev/null +++ b/internal/utils/filepath.go @@ -0,0 +1,51 @@ +package utils + +import ( + "errors" + "fmt" + "os" + "path/filepath" +) + +type FilepathResolverConfig struct { + Path string + Mkdir bool + DefaultFilename string +} + +var ErrDoesNotExistAndMkdirNotSpecified = errors.New("") + +func ResolveFilepath(config FilepathResolverConfig) (string, error) { + // if, by any chance, the caller entered a valid filename which just does not exist + // yet, let's assign it to the final output value. + var finalOutput string = config.Path + var err error + // let's validate output. + // first, let's check if this is a file or a directory. + outputExt := filepath.Ext(config.Path) + outputPath := filepath.Dir(config.Path) + + if outputExt == "" { + // since there is no filename extension we have to treat the whole thing as a path. + outputPath = config.Path + finalOutput = filepath.Join( + outputPath, + config.DefaultFilename, + ) + } + + // let's validate output directory + _, err = os.Stat(outputPath) + + if os.IsNotExist(err) { + // that's still fine at this point. let's check if we can create it. + if !config.Mkdir { + return "", ErrDoesNotExistAndMkdirNotSpecified + } + if err = os.MkdirAll(outputPath, 0755); err != nil { + return "", fmt.Errorf("unable to create directories: %v", err) + } + } + + return finalOutput, nil +}