@driveflux/pdf 1.6.67 → 1.6.69

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.
@@ -1,98 +1,15 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
- return arr2;
5
- }
6
- function _array_without_holes(arr) {
7
- if (Array.isArray(arr)) return _array_like_to_array(arr);
8
- }
9
- function _iterable_to_array(iter) {
10
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
- }
12
- function _non_iterable_spread() {
13
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
- }
15
- function _to_consumable_array(arr) {
16
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
- }
18
- function _unsupported_iterable_to_array(o, minLen) {
19
- if (!o) return;
20
- if (typeof o === "string") return _array_like_to_array(o, minLen);
21
- var n = Object.prototype.toString.call(o).slice(8, -1);
22
- if (n === "Object" && o.constructor) n = o.constructor.name;
23
- if (n === "Map" || n === "Set") return Array.from(n);
24
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
- }
26
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
2
  import { Text, View } from '@react-pdf/renderer';
28
- var TermsOfUse = function(param) {
29
- var termsOfUse = param.termsOfUse;
30
- var getTerms = function(items) {
31
- var indices = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
32
- return items.map(function(item, i) {
33
- var _item_items;
34
- var currentIndices = _to_consumable_array(indices).concat([
35
- i + 1
36
- ]);
37
- var indicesString = currentIndices.join('.');
38
- return /*#__PURE__*/ _jsxs(View, {
39
- style: {
40
- rowGap: 16
41
- },
42
- children: [
43
- item.content && /*#__PURE__*/ _jsxs(View, {
44
- style: {
45
- flexDirection: 'row',
46
- columnGap: 16
47
- },
48
- children: [
49
- /*#__PURE__*/ _jsx(Text, {
50
- style: {
51
- fontWeight: 'bold'
52
- },
53
- children: indicesString
54
- }),
55
- /*#__PURE__*/ _jsx(Text, {
56
- style: {
57
- textAlign: 'justify',
58
- flex: 1
59
- },
60
- children: item.content
61
- })
62
- ]
63
- }),
64
- ((_item_items = item.items) === null || _item_items === void 0 ? void 0 : _item_items.length) > 0 && /*#__PURE__*/ _jsx(View, {
65
- style: {
66
- paddingLeft: 16,
67
- rowGap: 16
68
- },
69
- children: getTerms(item.items, currentIndices)
70
- })
71
- ]
72
- }, "".// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
73
- concat(indicesString, "-").concat(i));
3
+ import { renderMarkdown } from './utils.js';
4
+ const TermsOfUse = ({ termsOfUse }) => {
5
+ const getTerms = (items, indices = []) => {
6
+ return items.map((item, i) => {
7
+ const currentIndices = [...indices, i + 1];
8
+ const indicesString = currentIndices.join('.');
9
+ return (_jsxs(View, { style: { rowGap: 16 }, children: [item.content && (_jsxs(View, { style: { flexDirection: 'row', columnGap: 16 }, children: [_jsx(Text, { style: { fontWeight: 'bold' }, children: indicesString }), _jsxs(Text, { style: { textAlign: 'justify', flex: 1 }, children: [renderMarkdown(item.content), ' '] })] })), item.items?.length > 0 && (_jsx(View, { style: { paddingLeft: 16, rowGap: 16 }, children: getTerms(item.items, currentIndices) }))] }, indicesString));
74
10
  });
75
11
  };
76
- return /*#__PURE__*/ _jsxs(View, {
77
- style: {
78
- rowGap: 16
79
- },
80
- children: [
81
- /*#__PURE__*/ _jsx(Text, {
82
- style: {
83
- fontWeight: 'bold',
84
- textTransform: 'uppercase'
85
- },
86
- children: 'Terms of Use'
87
- }),
88
- /*#__PURE__*/ _jsx(View, {
89
- style: {
90
- rowGap: 16,
91
- lineHeight: 1.4
92
- },
93
- children: getTerms(termsOfUse.items)
94
- })
95
- ]
96
- });
12
+ return (_jsxs(View, { style: { rowGap: 16 }, children: [_jsx(Text, { style: { fontWeight: 'bold', textTransform: 'uppercase' }, children: 'Terms of Use' }), _jsx(View, { style: { rowGap: 16, lineHeight: 1.4 }, children: getTerms(termsOfUse.items) })] }));
97
13
  };
98
14
  export default TermsOfUse;
15
+ //# sourceMappingURL=TermsOfUse.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TermsOfUse.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUse.tsx"],"names":[],"mappings":";AAIA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAOhD,MAAM,UAAU,GAAc,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IAChD,MAAM,QAAQ,GAAG,CAAC,KAAuB,EAAE,UAAoB,EAAE,EAAE,EAAE;QACpE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;YAC5B,MAAM,cAAc,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC1C,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAE9C,OAAO,CACN,MAAC,IAAI,IAKJ,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,aAEpB,IAAI,CAAC,OAAO,IAAI,CAChB,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,EAAE,aACnD,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAG,aAAa,GAAQ,EAC3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAC5C,IAAI,CAAC,OAAO,GACP,IACD,CACP,EACA,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,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,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAG/B,KAAK,wBAAwB,GAC1B,MAAM,GACN;IACA,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,wBAAwB,EAAE,CAAA;CACtC,CAAA;AAEJ,KAAK,KAAK,GAAG;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,wBAAwB,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA4CnC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
1
+ {"version":3,"file":"TermsOfUseSubSection.d.ts","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAA;AAI/B,KAAK,wBAAwB,GAC1B,MAAM,GACN;IACA,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,wBAAwB,EAAE,CAAA;CACtC,CAAA;AAEJ,KAAK,KAAK,GAAG;IACZ,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,wBAAwB,CAAA;CACpC,CAAA;AAED,QAAA,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA8CnC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -1,102 +1,17 @@
1
- function _array_like_to_array(arr, len) {
2
- if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
- return arr2;
5
- }
6
- function _array_without_holes(arr) {
7
- if (Array.isArray(arr)) return _array_like_to_array(arr);
8
- }
9
- function _iterable_to_array(iter) {
10
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
- }
12
- function _non_iterable_spread() {
13
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14
- }
15
- function _to_consumable_array(arr) {
16
- return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
17
- }
18
- function _unsupported_iterable_to_array(o, minLen) {
19
- if (!o) return;
20
- if (typeof o === "string") return _array_like_to_array(o, minLen);
21
- var n = Object.prototype.toString.call(o).slice(8, -1);
22
- if (n === "Object" && o.constructor) n = o.constructor.name;
23
- if (n === "Map" || n === "Set") return Array.from(n);
24
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
25
- }
26
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
2
  import { Text, View } from '@react-pdf/renderer';
28
3
  import { useMemo } from 'react';
29
- var TermsOfUseSubSection = function(param) {
30
- var indices = param.indices, subSection = param.subSection;
31
- var _useMemo = useMemo(function() {
32
- return {
33
- indicesString: indices.reduce(function(prev, curr, i) {
34
- return "".concat(prev).concat(curr).concat(i === indices.length - 1 ? '' : '.');
35
- }, ''),
36
- paddingLeft: Math.max(indices.length - 2, 0) * 16
37
- };
38
- }, [
39
- indices.length,
40
- indices.reduce
41
- ]), indicesString = _useMemo.indicesString, paddingLeft = _useMemo.paddingLeft;
42
- return typeof subSection === 'string' ? /*#__PURE__*/ _jsxs(View, {
43
- style: {
44
- flexDirection: 'row',
45
- paddingLeft: paddingLeft,
46
- columnGap: 16
47
- },
48
- children: [
49
- /*#__PURE__*/ _jsx(Text, {
50
- style: {
51
- fontWeight: 'bold'
52
- },
53
- children: indicesString
54
- }),
55
- /*#__PURE__*/ _jsx(Text, {
56
- style: {
57
- textAlign: 'justify',
58
- flex: 1
59
- },
60
- children: subSection
61
- })
62
- ]
63
- }, indicesString) : 'subSections' in subSection ? /*#__PURE__*/ _jsxs(View, {
64
- style: {
65
- gap: 16
66
- },
67
- children: [
68
- /*#__PURE__*/ _jsxs(View, {
69
- style: {
70
- flexDirection: 'row',
71
- paddingLeft: paddingLeft,
72
- columnGap: 16
73
- },
74
- children: [
75
- /*#__PURE__*/ _jsx(Text, {
76
- style: {
77
- fontWeight: 'bold'
78
- },
79
- children: indicesString
80
- }),
81
- /*#__PURE__*/ _jsx(Text, {
82
- style: {
83
- textAlign: 'justify',
84
- flex: 1
85
- },
86
- children: subSection.paragraph
87
- })
88
- ]
89
- }, indicesString),
90
- subSection.subSections.map(function(subSection, i) {
91
- return /*#__PURE__*/ _jsx(TermsOfUseSubSection, {
92
- indices: _to_consumable_array(indices).concat([
93
- i + 1
94
- ]),
95
- subSection: subSection
96
- }, "".// biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
97
- concat(indices, ".").concat(i));
98
- })
99
- ]
100
- }, indicesString) : null;
4
+ import { renderMarkdown } from './utils.js';
5
+ const TermsOfUseSubSection = ({ indices, subSection }) => {
6
+ const { indicesString, paddingLeft } = useMemo(() => ({
7
+ indicesString: indices.reduce((prev, curr, i) => `${prev}${curr}${i === indices.length - 1 ? '' : '.'}`, ''),
8
+ paddingLeft: Math.max(indices.length - 2, 0) * 16,
9
+ }), [indices.length, indices.reduce]);
10
+ return typeof subSection === 'string' ? (_jsxs(View, { style: { flexDirection: 'row', paddingLeft, columnGap: 16 }, children: [_jsx(Text, { style: { fontWeight: 'bold' }, children: indicesString }), _jsx(Text, { style: { textAlign: 'justify', flex: 1 }, children: subSection })] }, indicesString)) : 'subSections' in subSection ? (_jsxs(View, { style: { gap: 16 }, children: [_jsxs(View, { style: { flexDirection: 'row', paddingLeft, columnGap: 16 }, children: [_jsx(Text, { style: { fontWeight: 'bold' }, children: indicesString }), _jsx(Text, { style: { textAlign: 'justify', flex: 1 }, children: typeof subSection === 'string'
11
+ ? renderMarkdown(subSection)
12
+ : renderMarkdown(subSection.paragraph) })] }, indicesString), subSection.subSections.map((subSection, i) => (_jsx(TermsOfUseSubSection, { indices: [...indices, i + 1], subSection: subSection }, `${indices}.${
13
+ // biome-ignore lint/suspicious/noArrayIndexKey: <explanation>
14
+ i}`)))] }, indicesString)) : null;
101
15
  };
102
16
  export default TermsOfUseSubSection;
17
+ //# sourceMappingURL=TermsOfUseSubSection.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TermsOfUseSubSection.js","sourceRoot":"","sources":["../../../src/templates/SubscriptionAgreement/TermsOfUseSubSection.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAEhD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAc/B,MAAM,oBAAoB,GAAc,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE;IACnE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,OAAO,CAC7C,GAAG,EAAE,CAAC,CAAC;QACN,aAAa,EAAE,OAAO,CAAC,MAAM,CAC5B,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,CACjB,GAAG,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,EACvD,EAAE,CACF;QACD,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE;KACjD,CAAC,EACF,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAChC,CAAA;IAED,OAAO,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CACvC,MAAC,IAAI,IACJ,KAAK,EAAE,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,EAAE,aAG3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,YAAG,aAAa,GAAQ,EAC3D,KAAC,IAAI,IAAC,KAAK,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EA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EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,YAC5C,OAAO,UAAU,KAAK,QAAQ;4BAC9B,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC;4BAC5B,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,CAAC,GACjC,KAPF,aAAa,CAQZ,EACN,UAAU,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC,CAC9C,KAAC,oBAAoB,IAKpB,OAAO,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC,EAC5B,UAAU,EAAE,UAAU,IALjB,GAAG,OAAO,IAAI;YAClB,8DAA8D;YAC9D,CACD,EAAE,CAGD,CACF,CAAC,KArBQ,aAAa,CAsBjB,CACP,CAAC,CAAC,CAAC,IAAI,CAAA;AACT,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
@@ -1,3 +1,179 @@
1
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
+ try {
3
+ var info = gen[key](arg);
4
+ var value = info.value;
5
+ } catch (error) {
6
+ reject(error);
7
+ return;
8
+ }
9
+ if (info.done) {
10
+ resolve(value);
11
+ } else {
12
+ Promise.resolve(value).then(_next, _throw);
13
+ }
14
+ }
15
+ function _async_to_generator(fn) {
16
+ return function() {
17
+ var self = this, args = arguments;
18
+ return new Promise(function(resolve, reject) {
19
+ var gen = fn.apply(self, args);
20
+ function _next(value) {
21
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
22
+ }
23
+ function _throw(err) {
24
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
25
+ }
26
+ _next(undefined);
27
+ });
28
+ };
29
+ }
30
+ function _define_property(obj, key, value) {
31
+ if (key in obj) {
32
+ Object.defineProperty(obj, key, {
33
+ value: value,
34
+ enumerable: true,
35
+ configurable: true,
36
+ writable: true
37
+ });
38
+ } else {
39
+ obj[key] = value;
40
+ }
41
+ return obj;
42
+ }
43
+ function _object_spread(target) {
44
+ for(var i = 1; i < arguments.length; i++){
45
+ var source = arguments[i] != null ? arguments[i] : {};
46
+ var ownKeys = Object.keys(source);
47
+ if (typeof Object.getOwnPropertySymbols === "function") {
48
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
49
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
50
+ }));
51
+ }
52
+ ownKeys.forEach(function(key) {
53
+ _define_property(target, key, source[key]);
54
+ });
55
+ }
56
+ return target;
57
+ }
58
+ function ownKeys(object, enumerableOnly) {
59
+ var keys = Object.keys(object);
60
+ if (Object.getOwnPropertySymbols) {
61
+ var symbols = Object.getOwnPropertySymbols(object);
62
+ if (enumerableOnly) {
63
+ symbols = symbols.filter(function(sym) {
64
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
65
+ });
66
+ }
67
+ keys.push.apply(keys, symbols);
68
+ }
69
+ return keys;
70
+ }
71
+ function _object_spread_props(target, source) {
72
+ source = source != null ? source : {};
73
+ if (Object.getOwnPropertyDescriptors) {
74
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
75
+ } else {
76
+ ownKeys(Object(source)).forEach(function(key) {
77
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
78
+ });
79
+ }
80
+ return target;
81
+ }
82
+ function _ts_generator(thisArg, body) {
83
+ var f, y, t, g, _ = {
84
+ label: 0,
85
+ sent: function() {
86
+ if (t[0] & 1) throw t[1];
87
+ return t[1];
88
+ },
89
+ trys: [],
90
+ ops: []
91
+ };
92
+ return g = {
93
+ next: verb(0),
94
+ "throw": verb(1),
95
+ "return": verb(2)
96
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
97
+ return this;
98
+ }), g;
99
+ function verb(n) {
100
+ return function(v) {
101
+ return step([
102
+ n,
103
+ v
104
+ ]);
105
+ };
106
+ }
107
+ function step(op) {
108
+ if (f) throw new TypeError("Generator is already executing.");
109
+ while(_)try {
110
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
111
+ if (y = 0, t) op = [
112
+ op[0] & 2,
113
+ t.value
114
+ ];
115
+ switch(op[0]){
116
+ case 0:
117
+ case 1:
118
+ t = op;
119
+ break;
120
+ case 4:
121
+ _.label++;
122
+ return {
123
+ value: op[1],
124
+ done: false
125
+ };
126
+ case 5:
127
+ _.label++;
128
+ y = op[1];
129
+ op = [
130
+ 0
131
+ ];
132
+ continue;
133
+ case 7:
134
+ op = _.ops.pop();
135
+ _.trys.pop();
136
+ continue;
137
+ default:
138
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
139
+ _ = 0;
140
+ continue;
141
+ }
142
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
143
+ _.label = op[1];
144
+ break;
145
+ }
146
+ if (op[0] === 6 && _.label < t[1]) {
147
+ _.label = t[1];
148
+ t = op;
149
+ break;
150
+ }
151
+ if (t && _.label < t[2]) {
152
+ _.label = t[2];
153
+ _.ops.push(op);
154
+ break;
155
+ }
156
+ if (t[2]) _.ops.pop();
157
+ _.trys.pop();
158
+ continue;
159
+ }
160
+ op = body.call(thisArg, _);
161
+ } catch (e) {
162
+ op = [
163
+ 6,
164
+ e
165
+ ];
166
+ y = 0;
167
+ } finally{
168
+ f = t = 0;
169
+ }
170
+ if (op[0] & 5) throw op[1];
171
+ return {
172
+ value: op[0] ? op[1] : void 0,
173
+ done: true
174
+ };
175
+ }
176
+ }
1
177
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
178
  import { Document } from '@react-pdf/renderer';
3
179
  import { useMemo } from 'react';
@@ -8,26 +184,88 @@ import Details from './Details.js';
8
184
  import SubscriptionAgreementPage from './SubscriptionAgreementPage.js';
9
185
  import TermsOfUse from './TermsOfUse.js';
10
186
  import { useTranslations } from './translations.js';
11
- export const generateSubscriptionAgreementPdf = async ({ locale = 'en', subscription, termsOfUse, signature }, fileName) => {
12
- if (!signature) {
13
- throw new Error('Signature not found');
14
- }
15
- return await toPdf(_jsx(SubscriptionAgreement, { locale: locale, signature: signature, subscription: subscription, termsOfUse: termsOfUse }), fileName);
16
- };
17
- const SubscriptionAgreement = ({ locale = 'en', signature, subscription, termsOfUse, }) => {
187
+ export var generateSubscriptionAgreementPdf = /*#__PURE__*/ function() {
188
+ var _ref = _async_to_generator(function(param, fileName) {
189
+ var _param_locale, locale, subscription, termsOfUse, signature;
190
+ return _ts_generator(this, function(_state) {
191
+ switch(_state.label){
192
+ case 0:
193
+ _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, subscription = param.subscription, termsOfUse = param.termsOfUse, signature = param.signature;
194
+ if (!signature) {
195
+ throw new Error('Signature not found');
196
+ }
197
+ return [
198
+ 4,
199
+ toPdf(/*#__PURE__*/ _jsx(SubscriptionAgreement, {
200
+ locale: locale,
201
+ signature: signature,
202
+ subscription: subscription,
203
+ termsOfUse: termsOfUse
204
+ }), fileName)
205
+ ];
206
+ case 1:
207
+ return [
208
+ 2,
209
+ _state.sent()
210
+ ];
211
+ }
212
+ });
213
+ });
214
+ return function generateSubscriptionAgreementPdf(_, fileName) {
215
+ return _ref.apply(this, arguments);
216
+ };
217
+ }();
218
+ var SubscriptionAgreement = function(param) {
219
+ var _param_locale = param.locale, locale = _param_locale === void 0 ? 'en' : _param_locale, signature = param.signature, subscription = param.subscription, termsOfUse = param.termsOfUse;
18
220
  if (!signature.signedAt) {
19
- throw new Error(`Missing 'signature.signedAt'`);
221
+ throw new Error("Missing 'signature.signedAt'");
20
222
  }
21
- const useT = useTranslations(locale);
22
- const pageProps = useMemo(() => {
223
+ var useT = useTranslations(locale);
224
+ var pageProps = useMemo(function() {
23
225
  return {
24
226
  t: useT,
25
227
  userId: subscription.userId,
26
- subscriptionId: subscription.id,
228
+ subscriptionId: subscription.id
27
229
  };
28
- }, [subscription.userId, subscription.id, useT]);
29
- const payerType = subscription.payerType;
30
- const { t } = pageProps;
31
- return (_jsxs(Document, { title: t.title, language: locale, children: [_jsx(SubscriptionAgreementPage, { ...pageProps, children: _jsx(CoverPage, { tTitle: t.title, tCover: t.cover, signedAt: signature.signedAt, user: subscription.user, business: subscription.business, payerType: payerType }) }), _jsx(SubscriptionAgreementPage, { ...pageProps, children: _jsx(TermsOfUse, { termsOfUse: termsOfUse }) }), _jsxs(SubscriptionAgreementPage, { ...pageProps, children: [_jsx(Details, { tDetails: t.details, subscription: subscription }), _jsx(Confirmation, { tConfirmation: t.confirmation, subscription: subscription, signature: signature })] })] }));
230
+ }, [
231
+ subscription.userId,
232
+ subscription.id,
233
+ useT
234
+ ]);
235
+ var payerType = subscription.payerType;
236
+ var t = pageProps.t;
237
+ return /*#__PURE__*/ _jsxs(Document, {
238
+ title: t.title,
239
+ language: locale,
240
+ children: [
241
+ /*#__PURE__*/ _jsx(SubscriptionAgreementPage, _object_spread_props(_object_spread({}, pageProps), {
242
+ children: /*#__PURE__*/ _jsx(CoverPage, {
243
+ tTitle: t.title,
244
+ tCover: t.cover,
245
+ signedAt: signature.signedAt,
246
+ user: subscription.user,
247
+ business: subscription.business,
248
+ payerType: payerType
249
+ })
250
+ })),
251
+ /*#__PURE__*/ _jsx(SubscriptionAgreementPage, _object_spread_props(_object_spread({}, pageProps), {
252
+ children: /*#__PURE__*/ _jsx(TermsOfUse, {
253
+ termsOfUse: termsOfUse
254
+ })
255
+ })),
256
+ /*#__PURE__*/ _jsxs(SubscriptionAgreementPage, _object_spread_props(_object_spread({}, pageProps), {
257
+ children: [
258
+ /*#__PURE__*/ _jsx(Details, {
259
+ tDetails: t.details,
260
+ subscription: subscription
261
+ }),
262
+ /*#__PURE__*/ _jsx(Confirmation, {
263
+ tConfirmation: t.confirmation,
264
+ subscription: subscription,
265
+ signature: signature
266
+ })
267
+ ]
268
+ }))
269
+ ]
270
+ });
32
271
  };
33
- //# sourceMappingURL=index.js.map