pdf-catalog-generator 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25,6 +25,29 @@ function _interopNamespace(e) {
25
25
  var XLSX__namespace = /*#__PURE__*/_interopNamespace(XLSX);
26
26
 
27
27
  // src/generator.tsx
28
+ var styles = renderer.StyleSheet.create({
29
+ wrapper: {
30
+ position: "absolute",
31
+ bottom: 6,
32
+ right: 10,
33
+ flexDirection: "row",
34
+ alignItems: "center",
35
+ opacity: 0.5
36
+ },
37
+ label: {
38
+ fontSize: 6.5,
39
+ color: "#666666",
40
+ letterSpacing: 0.2
41
+ },
42
+ link: {
43
+ fontSize: 6.5,
44
+ color: "#666666",
45
+ textDecoration: "none",
46
+ letterSpacing: 0.2
47
+ }
48
+ });
49
+ var PoweredByTeziApp = () => /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles.wrapper, fixed: true, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Link, { style: styles.link, src: "https://teziapp.com", children: "Powered by Tezi App" }) });
50
+ var PoweredByTeziApp_default = PoweredByTeziApp;
28
51
 
29
52
  // src/utils/fieldHelpers.ts
30
53
  function formatFieldName(fieldName) {
@@ -206,12 +229,12 @@ var dynamicFieldStyles = renderer.StyleSheet.create({
206
229
  flexShrink: 1
207
230
  }
208
231
  });
209
- function renderDynamicFields(fields, styles8) {
232
+ function renderDynamicFields(fields, styles9) {
210
233
  if (fields.length === 0) return null;
211
- const containerStyle = styles8?.container || { marginBottom: 8 };
212
- const rowStyle = styles8?.row || dynamicFieldStyles.detailRow;
213
- const labelStyle = styles8?.label || dynamicFieldStyles.detailLabel;
214
- const valueStyle = styles8?.value || dynamicFieldStyles.detailValue;
234
+ const containerStyle = styles9?.container || { marginBottom: 8 };
235
+ const rowStyle = styles9?.row || dynamicFieldStyles.detailRow;
236
+ const labelStyle = styles9?.label || dynamicFieldStyles.detailLabel;
237
+ const valueStyle = styles9?.value || dynamicFieldStyles.detailValue;
215
238
  return /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: containerStyle, children: fields.map(([key, value]) => /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: rowStyle, children: [
216
239
  /* @__PURE__ */ jsxRuntime.jsxs(renderer.Text, { style: labelStyle, children: [
217
240
  formatFieldName(key),
@@ -255,7 +278,7 @@ function mergeTemplateConfig(config = {}) {
255
278
  ...config
256
279
  };
257
280
  }
258
- var styles = renderer.StyleSheet.create({
281
+ var styles2 = renderer.StyleSheet.create({
259
282
  productContainer: {
260
283
  flexDirection: "row",
261
284
  flexWrap: "wrap",
@@ -319,27 +342,27 @@ var styles = renderer.StyleSheet.create({
319
342
  }
320
343
  });
321
344
  var Template1 = ({ products }) => {
322
- return /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles.productContainer, children: products.map((product, index) => {
345
+ return /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles2.productContainer, children: products.map((product, index) => {
323
346
  const fields = extractProductFields(product);
324
- return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles.productSection, children: [
325
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles.image, src: fields.imageUrl }),
326
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles.productTitleBox, children: [
327
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles.productTitle, children: fields.title }),
328
- renderRating(fields.rating, styles.productRate)
347
+ return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles2.productSection, children: [
348
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles2.image, src: fields.imageUrl }),
349
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles2.productTitleBox, children: [
350
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles2.productTitle, children: fields.title }),
351
+ renderRating(fields.rating, styles2.productRate)
329
352
  ] }),
330
- fields.description && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles.productDescription, children: fields.description }),
353
+ fields.description && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles2.productDescription, children: fields.description }),
331
354
  renderDynamicFields(fields.dynamicFields),
332
355
  renderBuyButton(
333
356
  fields.link,
334
- styles.buyButton,
357
+ styles2.buyButton,
335
358
  "Buy Now",
336
- renderPrice(fields.price, styles.productPrice)
359
+ renderPrice(fields.price, styles2.productPrice)
337
360
  )
338
361
  ] }, index);
339
362
  }) });
340
363
  };
341
364
  var Template1_default = Template1;
342
- var styles2 = renderer.StyleSheet.create({
365
+ var styles3 = renderer.StyleSheet.create({
343
366
  productContainer: {
344
367
  flexDirection: "row",
345
368
  flexWrap: "wrap",
@@ -416,14 +439,14 @@ var styles2 = renderer.StyleSheet.create({
416
439
  }
417
440
  });
418
441
  var Template2 = ({ products }) => {
419
- return /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles2.productContainer, children: products.map((product, index) => {
442
+ return /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles3.productContainer, children: products.map((product, index) => {
420
443
  const fields = extractProductFields(product);
421
- return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles2.productSection, children: [
422
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles2.productSectionImage, children: [
423
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles2.image, src: fields.imageUrl }),
424
- renderRating(fields.rating, styles2.productRate)
444
+ return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles3.productSection, children: [
445
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles3.productSectionImage, children: [
446
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles3.image, src: fields.imageUrl }),
447
+ renderRating(fields.rating, styles3.productRate)
425
448
  ] }),
426
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles2.productSectionText, children: [
449
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles3.productSectionText, children: [
427
450
  /* @__PURE__ */ jsxRuntime.jsxs(
428
451
  renderer.View,
429
452
  {
@@ -433,20 +456,20 @@ var Template2 = ({ products }) => {
433
456
  justifyContent: "space-between"
434
457
  },
435
458
  children: [
436
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles2.productTitle, children: fields.title }),
437
- renderPrice(fields.price, styles2.productPrice)
459
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles3.productTitle, children: fields.title }),
460
+ renderPrice(fields.price, styles3.productPrice)
438
461
  ]
439
462
  }
440
463
  ),
441
- fields.description && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles2.productDescription, children: fields.description }),
464
+ fields.description && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles3.productDescription, children: fields.description }),
442
465
  renderDynamicFields(fields.dynamicFields),
443
- renderBuyButton(fields.link, styles2.buyButton)
466
+ renderBuyButton(fields.link, styles3.buyButton)
444
467
  ] })
445
468
  ] }, index);
446
469
  }) });
447
470
  };
448
471
  var Template2_default = Template2;
449
- var styles3 = renderer.StyleSheet.create({
472
+ var styles4 = renderer.StyleSheet.create({
450
473
  productSection: {
451
474
  width: "100%",
452
475
  height: "100vh",
@@ -526,10 +549,10 @@ var compactDynamicFieldStyles = renderer.StyleSheet.create({
526
549
  var Template3 = ({ products }) => {
527
550
  return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: products.map((product, index) => {
528
551
  const fields = extractProductFields(product, { maxDynamicFields: 5 });
529
- return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles3.productSection, children: [
530
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles3.image, src: fields.imageUrl }),
531
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles3.productDetailsBox, children: [
532
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles3.productTitle, children: fields.title }),
552
+ return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles4.productSection, children: [
553
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles4.image, src: fields.imageUrl }),
554
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles4.productDetailsBox, children: [
555
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles4.productTitle, children: fields.title }),
533
556
  /* @__PURE__ */ jsxRuntime.jsxs(
534
557
  renderer.View,
535
558
  {
@@ -539,25 +562,25 @@ var Template3 = ({ products }) => {
539
562
  justifyContent: "space-between"
540
563
  },
541
564
  children: [
542
- renderPrice(fields.price, styles3.productPrice),
543
- renderRating(fields.rating, styles3.productRate)
565
+ renderPrice(fields.price, styles4.productPrice),
566
+ renderRating(fields.rating, styles4.productRate)
544
567
  ]
545
568
  }
546
569
  ),
547
- fields.description && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles3.productDescription, children: fields.description }),
570
+ fields.description && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles4.productDescription, children: fields.description }),
548
571
  renderDynamicFields(fields.dynamicFields, {
549
572
  row: compactDynamicFieldStyles.detailRow,
550
573
  label: compactDynamicFieldStyles.detailLabel,
551
574
  value: compactDynamicFieldStyles.detailValue
552
575
  }),
553
- renderBuyButton(fields.link, styles3.buyButton)
576
+ renderBuyButton(fields.link, styles4.buyButton)
554
577
  ] }),
555
578
  /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { break: true })
556
579
  ] }, index);
557
580
  }) });
558
581
  };
559
582
  var Template3_default = Template3;
560
- var styles4 = renderer.StyleSheet.create({
583
+ var styles5 = renderer.StyleSheet.create({
561
584
  page: {
562
585
  width: "100%",
563
586
  height: "100%",
@@ -654,21 +677,21 @@ var Template4 = ({
654
677
  )
655
678
  );
656
679
  const fields = extractProductFields(product);
657
- return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles4.page, children: [
658
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles4.header, children: [
659
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles4.companyName, children: companyName || "" }),
660
- companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles4.brandLogo, src: companyLogo })
680
+ return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.page, children: [
681
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.header, children: [
682
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles5.companyName, children: companyName || "" }),
683
+ companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles5.brandLogo, src: companyLogo })
661
684
  ] }),
662
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles4.productContainer, children: [
663
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles4.productImage, src: fields.imageUrl }),
664
- allFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles4.detailsBox, children: renderFieldsInColumns(allFields) })
685
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.productContainer, children: [
686
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles5.productImage, src: fields.imageUrl }),
687
+ allFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles5.detailsBox, children: renderFieldsInColumns(allFields) })
665
688
  ] }),
666
689
  /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { break: true })
667
690
  ] }, index);
668
691
  }) });
669
692
  };
670
693
  var Template4_default = Template4;
671
- var styles5 = renderer.StyleSheet.create({
694
+ var styles6 = renderer.StyleSheet.create({
672
695
  page: {
673
696
  width: "100%",
674
697
  height: "100%",
@@ -781,22 +804,22 @@ var Template5 = ({
781
804
  const { imageUrl, title, dynamicFields } = extractProductFields(product);
782
805
  const image2Url = getImage2Url(product);
783
806
  const secondImage = image2Url || imageUrl;
784
- return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.page, children: [
785
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.header, children: [
786
- companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles5.logo, src: companyLogo }),
787
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles5.companyName, children: companyName })
807
+ return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.page, children: [
808
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.header, children: [
809
+ companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.logo, src: companyLogo }),
810
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles6.companyName, children: companyName })
788
811
  ] }),
789
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.contentContainer, children: [
790
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.imageSection, children: [
791
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles5.imageWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles5.productImage, src: imageUrl }) }),
792
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles5.imageWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles5.productImage, src: secondImage }) })
812
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.contentContainer, children: [
813
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.imageSection, children: [
814
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles6.imageWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.productImage, src: imageUrl }) }),
815
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles6.imageWrapper, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.productImage, src: secondImage }) })
793
816
  ] }),
794
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles5.detailsSection, children: [
795
- title && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles5.productTitle, children: title }),
796
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles5.dynamicFieldsContainer, children: renderDynamicFields(dynamicFields, {
797
- row: styles5.detailRow,
798
- label: styles5.detailLabel,
799
- value: styles5.detailValue
817
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.detailsSection, children: [
818
+ title && /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles6.productTitle, children: title }),
819
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles6.dynamicFieldsContainer, children: renderDynamicFields(dynamicFields, {
820
+ row: styles6.detailRow,
821
+ label: styles6.detailLabel,
822
+ value: styles6.detailValue
800
823
  }) })
801
824
  ] })
802
825
  ] }),
@@ -805,7 +828,7 @@ var Template5 = ({
805
828
  }) });
806
829
  };
807
830
  var Template5_default = Template5;
808
- var styles6 = renderer.StyleSheet.create({
831
+ var styles7 = renderer.StyleSheet.create({
809
832
  page: {
810
833
  width: "100%",
811
834
  height: "100%",
@@ -946,26 +969,26 @@ var Template6 = ({
946
969
  const { imageUrl, title, dynamicFields } = extractProductFields(product);
947
970
  const image2Url = getImage2Url2(product);
948
971
  const secondImage = image2Url || imageUrl;
949
- return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.page, children: [
950
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.leftColumn, children: [
951
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.imageFull, src: imageUrl }),
952
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.specsOverlay, children: [
953
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.specsHeader, children: [
954
- companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.miniLogo, src: companyLogo }),
955
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles6.designNumber, children: title || "Specifications" })
972
+ return /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.page, children: [
973
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.leftColumn, children: [
974
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles7.imageFull, src: imageUrl }),
975
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.specsOverlay, children: [
976
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.specsHeader, children: [
977
+ companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles7.miniLogo, src: companyLogo }),
978
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles7.designNumber, children: title || "Specifications" })
956
979
  ] }),
957
980
  renderDynamicFields(dynamicFields, {
958
- row: styles6.fieldRow,
959
- label: styles6.fieldLabel,
960
- value: styles6.fieldValue
981
+ row: styles7.fieldRow,
982
+ label: styles7.fieldLabel,
983
+ value: styles7.fieldValue
961
984
  })
962
985
  ] })
963
986
  ] }),
964
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.rightColumn, children: [
965
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles6.rightImageContainer, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.rightImage, src: secondImage }) }),
966
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles6.footer, children: /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles6.footerContent, children: [
967
- companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles6.footerLogo, src: companyLogo }),
968
- /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles6.footerText, children: companyName })
987
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.rightColumn, children: [
988
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles7.rightImageContainer, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles7.rightImage, src: secondImage }) }),
989
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles7.footer, children: /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.footerContent, children: [
990
+ companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles7.footerLogo, src: companyLogo }),
991
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles7.footerText, children: companyName })
969
992
  ] }) })
970
993
  ] }),
971
994
  /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { break: true })
@@ -973,7 +996,7 @@ var Template6 = ({
973
996
  }) });
974
997
  };
975
998
  var Template6_default = Template6;
976
- var styles7 = renderer.StyleSheet.create({
999
+ var styles8 = renderer.StyleSheet.create({
977
1000
  page: {
978
1001
  flexDirection: "column",
979
1002
  backgroundColor: "#FFFFFF"
@@ -1005,26 +1028,6 @@ renderer.Font.registerEmojiSource({
1005
1028
  format: "png",
1006
1029
  url: "https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/72x72/"
1007
1030
  });
1008
- function normalizeImageSource(imageSource) {
1009
- if (imageSource.startsWith("data:")) {
1010
- return imageSource;
1011
- }
1012
- if (imageSource.startsWith("http://") || imageSource.startsWith("https://")) {
1013
- return imageSource;
1014
- }
1015
- let mimeType = "image/png";
1016
- const base64Start = imageSource.substring(0, 20).toLowerCase();
1017
- if (base64Start.includes("ivborw0kggo") || imageSource.startsWith("iVBORw0KGgo")) {
1018
- mimeType = "image/png";
1019
- } else if (base64Start.includes("/9j/4aaq") || imageSource.startsWith("/9j/4AAQ")) {
1020
- mimeType = "image/jpeg";
1021
- } else if (base64Start.includes("r0lgodlh") || imageSource.startsWith("R0lGODlh")) {
1022
- mimeType = "image/gif";
1023
- } else if (base64Start.includes("uklgr") || imageSource.startsWith("UklGR")) {
1024
- mimeType = "image/webp";
1025
- }
1026
- return `data:${mimeType};base64,${imageSource}`;
1027
- }
1028
1031
  async function generateProductCatalog(config) {
1029
1032
  const { products, companyLogo, companyName, template = "template1" } = config;
1030
1033
  let TemplateComponent;
@@ -1051,39 +1054,45 @@ async function generateProductCatalog(config) {
1051
1054
  TemplateComponent = Template1_default;
1052
1055
  }
1053
1056
  if (template === "template4") {
1054
- const doc2 = /* @__PURE__ */ jsxRuntime.jsx(renderer.Document, { children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Page, { size: "A4", style: styles7.page, children: /* @__PURE__ */ jsxRuntime.jsx(
1055
- Template4_default,
1056
- {
1057
- products,
1058
- companyLogo: companyLogo ? normalizeImageSource(companyLogo) : void 0,
1059
- companyName
1060
- }
1061
- ) }) });
1057
+ const doc2 = /* @__PURE__ */ jsxRuntime.jsx(renderer.Document, { children: /* @__PURE__ */ jsxRuntime.jsxs(renderer.Page, { size: "A4", style: styles8.page, children: [
1058
+ /* @__PURE__ */ jsxRuntime.jsx(
1059
+ Template4_default,
1060
+ {
1061
+ products,
1062
+ companyLogo,
1063
+ companyName
1064
+ }
1065
+ ),
1066
+ /* @__PURE__ */ jsxRuntime.jsx(PoweredByTeziApp_default, {})
1067
+ ] }) });
1062
1068
  const blob2 = await renderer.pdf(doc2).toBlob();
1063
1069
  const arrayBuffer2 = await blob2.arrayBuffer();
1064
1070
  return new Uint8Array(arrayBuffer2);
1065
1071
  }
1066
1072
  if (template === "template5" || template === "template6") {
1067
1073
  const Template = template === "template5" ? Template5_default : Template6_default;
1068
- const doc2 = /* @__PURE__ */ jsxRuntime.jsx(renderer.Document, { children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Page, { size: "A4", orientation: "landscape", style: styles7.page, children: /* @__PURE__ */ jsxRuntime.jsx(
1069
- Template,
1070
- {
1071
- products,
1072
- companyLogo: companyLogo ? normalizeImageSource(companyLogo) : void 0,
1073
- companyName
1074
- }
1075
- ) }) });
1074
+ const doc2 = /* @__PURE__ */ jsxRuntime.jsx(renderer.Document, { children: /* @__PURE__ */ jsxRuntime.jsxs(renderer.Page, { size: "A4", orientation: "landscape", style: styles8.page, children: [
1075
+ /* @__PURE__ */ jsxRuntime.jsx(
1076
+ Template,
1077
+ {
1078
+ products,
1079
+ companyLogo,
1080
+ companyName
1081
+ }
1082
+ ),
1083
+ /* @__PURE__ */ jsxRuntime.jsx(PoweredByTeziApp_default, {})
1084
+ ] }) });
1076
1085
  const blob2 = await renderer.pdf(doc2).toBlob();
1077
1086
  const arrayBuffer2 = await blob2.arrayBuffer();
1078
1087
  return new Uint8Array(arrayBuffer2);
1079
1088
  }
1080
- const doc = /* @__PURE__ */ jsxRuntime.jsx(renderer.Document, { children: /* @__PURE__ */ jsxRuntime.jsxs(renderer.Page, { size: "A4", style: styles7.page, children: [
1081
- /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles7.header, children: [
1082
- companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles7.logoSection, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles7.logo, src: normalizeImageSource(companyLogo) }) }),
1083
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles7.storeNameSection, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles7.storeName, children: companyName }) }),
1084
- /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { break: true })
1089
+ const doc = /* @__PURE__ */ jsxRuntime.jsx(renderer.Document, { children: /* @__PURE__ */ jsxRuntime.jsxs(renderer.Page, { size: "A4", style: styles8.page, children: [
1090
+ /* @__PURE__ */ jsxRuntime.jsxs(renderer.View, { style: styles8.header, children: [
1091
+ companyLogo && /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles8.logoSection, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Image, { style: styles8.logo, src: companyLogo }) }),
1092
+ /* @__PURE__ */ jsxRuntime.jsx(renderer.View, { style: styles8.storeNameSection, children: /* @__PURE__ */ jsxRuntime.jsx(renderer.Text, { style: styles8.storeName, children: companyName }) })
1085
1093
  ] }),
1086
- /* @__PURE__ */ jsxRuntime.jsx(TemplateComponent, { products })
1094
+ /* @__PURE__ */ jsxRuntime.jsx(TemplateComponent, { products }),
1095
+ /* @__PURE__ */ jsxRuntime.jsx(PoweredByTeziApp_default, {})
1087
1096
  ] }) });
1088
1097
  const blob = await renderer.pdf(doc).toBlob();
1089
1098
  const arrayBuffer = await blob.arrayBuffer();