@nice2dev/ui-printing 1.2.1 → 1.3.0

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.mjs CHANGED
@@ -1,149 +1,149 @@
1
- import { jsx as e, jsxs as a, Fragment as V } from "react/jsx-runtime";
2
- import { useNiceTranslation as X, NiceAppShell as Ve, NiceIcon as S } from "@nice2dev/ui";
3
- import Xe, { useReducer as Ke, useState as H, useCallback as E, useMemo as ue, useEffect as Se, useRef as Je } from "react";
4
- import { createPortal as Qe } from "react-dom";
5
- const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt = "_toolbarGroup_19f1m_75", at = "_toolbarBtn_19f1m_107", it = "_toolbarBtnActive_19f1m_171", st = "_toolbarBtnDanger_19f1m_195", rt = "_toolbarSelect_19f1m_207", ot = "_toolbarSep_19f1m_237", lt = "_insertWrapper_19f1m_263", ct = "_insertBtn_19f1m_271", dt = "_insertDropdown_19f1m_293", mt = "_insertCategory_19f1m_333", pt = "_insertItem_19f1m_351", ut = "_insertIcon_19f1m_395", ht = "_zoomSelect_19f1m_409", _t = "_saveBtn_19f1m_441", gt = "_editorBody_19f1m_477", bt = "_leftPanel_19f1m_493", yt = "_leftTabs_19f1m_523", ft = "_leftTab_19f1m_523", vt = "_leftTabActive_19f1m_601", Nt = "_leftTabIcon_19f1m_621", wt = "_leftTabLabel_19f1m_629", kt = "_leftContent_19f1m_639", St = "_panelHeader_19f1m_653", Ct = "_panelHeaderIcon_19f1m_677", Bt = "_panelHeaderName_19f1m_685", It = "_searchBox_19f1m_699", Lt = "_searchInput_19f1m_707", xt = "_fieldList_19f1m_753", zt = "_fieldItem_19f1m_763", Tt = "_fieldItemIcon_19f1m_807", $t = "_fieldItemInfo_19f1m_821", Dt = "_fieldItemLabel_19f1m_831", Rt = "_fieldItemPath_19f1m_847", At = "_fieldItemType_19f1m_863", Et = "_layerList_19f1m_883", Mt = "_layerItem_19f1m_895", Pt = "_layerItemSelected_19f1m_931", Ft = "_layerIcon_19f1m_949", Ht = "_layerName_19f1m_961", Gt = "_layerActions_19f1m_977", Ot = "_layerBtn_19f1m_999", qt = "_wmList_19f1m_1031", Wt = "_wmItem_19f1m_1039", Yt = "_wmRow_19f1m_1065", jt = "_wmLabel_19f1m_1079", Ut = "_wmInput_19f1m_1091", Vt = "_wmInputNum_19f1m_1123", Xt = "_wmSelect_19f1m_1143", Kt = "_wmSlider_19f1m_1175", Jt = "_wmValue_19f1m_1185", Qt = "_wmUnit_19f1m_1199", Zt = "_wmDelete_19f1m_1209", en = "_addBtn_19f1m_1241", tn = "_settingsForm_19f1m_1277", nn = "_settingsRow_19f1m_1285", an = "_settingsLabel_19f1m_1299", sn = "_settingsInput_19f1m_1311", rn = "_settingsInputNum_19f1m_1343", on = "_settingsTextarea_19f1m_1375", ln = "_settingsDivider_19f1m_1409", cn = "_settingsUnit_19f1m_1429", dn = "_emptyMsg_19f1m_1441", mn = "_canvasArea_19f1m_1459", pn = "_testDataBar_19f1m_1485", un = "_testDataLabel_19f1m_1517", hn = "_testDataSelect_19f1m_1527", _n = "_rulerWrapper_19f1m_1547", gn = "_rulerCorner_19f1m_1563", bn = "_ruler_19f1m_1547", yn = "_ruler_h_19f1m_1621", fn = "_ruler_v_19f1m_1631", vn = "_rulerTick_19f1m_1651", Nn = "_rulerTickMajor_19f1m_1691", wn = "_rulerLabel_19f1m_1711", kn = "_paperScroll_19f1m_1749", Sn = "_paperShadow_19f1m_1767", Cn = "_marginGuide_19f1m_1803", Bn = "_watermark_19f1m_1819", In = "_sectionCanvas_19f1m_1845", Ln = "_sectionCanvasOver_19f1m_1859", xn = "_sectionTypeChip_19f1m_1867", zn = "_sectionResizeBar_19f1m_1899", Tn = "_sectionResizeGrip_19f1m_1933", $n = "_fieldImagePlaceholder_19f1m_1949", Dn = "_fieldBarcodePlaceholder_19f1m_1971", Rn = "_fieldSignaturePlaceholder_19f1m_1999", An = "_resizeHandle_19f1m_2031", En = "_handle_n_19f1m_2051", Mn = "_handle_s_19f1m_2063", Pn = "_handle_e_19f1m_2075", Fn = "_handle_w_19f1m_2087", Hn = "_handle_ne_19f1m_2099", Gn = "_handle_nw_19f1m_2109", On = "_handle_se_19f1m_2119", qn = "_handle_sw_19f1m_2129", Wn = "_rightPanel_19f1m_2143", Yn = "_rightTabs_19f1m_2173", jn = "_rightTab_19f1m_2173", Un = "_rightTabActive_19f1m_2243", Vn = "_propsBody_19f1m_2255", Xn = "_propsEmpty_19f1m_2267", Kn = "_propsEmptyIcon_19f1m_2289", Jn = "_propsEmptyText_19f1m_2299", Qn = "_posGrid_19f1m_2311", Zn = "_posCell_19f1m_2325", ea = "_posLabel_19f1m_2337", ta = "_posInput_19f1m_2349", na = "_posUnit_19f1m_2391", aa = "_snapSection_19f1m_2403", ia = "_snapTitle_19f1m_2411", sa = "_snapRow_19f1m_2429", ra = "_snapBtn_19f1m_2439", oa = "_styleGroup_19f1m_2473", la = "_styleGroupTitle_19f1m_2481", ca = "_styleRow_19f1m_2511", da = "_styleLabel_19f1m_2525", ma = "_styleSelect_19f1m_2539", pa = "_styleSelectFull_19f1m_2569", ua = "_styleSelectSm_19f1m_2601", ha = "_styleSelectXs_19f1m_2621", _a = "_styleInput_19f1m_2653", ga = "_styleInputFull_19f1m_2685", ba = "_styleUnit_19f1m_2717", ya = "_styleValue_19f1m_2729", fa = "_toggleGroup_19f1m_2743", va = "_toggleBtn_19f1m_2753", Na = "_toggleBtnActive_19f1m_2787", wa = "_colorPicker_19f1m_2801", ka = "_colorHex_19f1m_2819", Sa = "_clearBtn_19f1m_2853", Ca = "_sliderInput_19f1m_2885", Ba = "_conditionalHint_19f1m_2897", Ia = "_clearConditionalBtn_19f1m_2929", La = "_shortcutGrid_19f1m_2961", xa = "_shortcutChip_19f1m_2975", za = "_shortcutKeys_19f1m_3007", Ta = "_shortcutLabel_19f1m_3027", t = {
6
- root: Ze,
7
- dark: et,
8
- toolbar: tt,
9
- toolbarGroup: nt,
10
- toolbarBtn: at,
11
- toolbarBtnActive: it,
12
- toolbarBtnDanger: st,
13
- toolbarSelect: rt,
14
- toolbarSep: ot,
15
- insertWrapper: lt,
16
- insertBtn: ct,
17
- insertDropdown: dt,
18
- insertCategory: mt,
19
- insertItem: pt,
20
- insertIcon: ut,
21
- zoomSelect: ht,
22
- saveBtn: _t,
23
- editorBody: gt,
24
- leftPanel: bt,
25
- leftTabs: yt,
26
- leftTab: ft,
27
- leftTabActive: vt,
28
- leftTabIcon: Nt,
29
- leftTabLabel: wt,
30
- leftContent: kt,
31
- panelHeader: St,
32
- panelHeaderIcon: Ct,
33
- panelHeaderName: Bt,
34
- searchBox: It,
35
- searchInput: Lt,
36
- fieldList: xt,
37
- fieldItem: zt,
38
- fieldItemIcon: Tt,
39
- fieldItemInfo: $t,
40
- fieldItemLabel: Dt,
41
- fieldItemPath: Rt,
42
- fieldItemType: At,
43
- layerList: Et,
44
- layerItem: Mt,
45
- layerItemSelected: Pt,
46
- layerIcon: Ft,
47
- layerName: Ht,
48
- layerActions: Gt,
49
- layerBtn: Ot,
50
- wmList: qt,
51
- wmItem: Wt,
52
- wmRow: Yt,
53
- wmLabel: jt,
54
- wmInput: Ut,
55
- wmInputNum: Vt,
56
- wmSelect: Xt,
57
- wmSlider: Kt,
58
- wmValue: Jt,
59
- wmUnit: Qt,
60
- wmDelete: Zt,
61
- addBtn: en,
62
- settingsForm: tn,
63
- settingsRow: nn,
64
- settingsLabel: an,
65
- settingsInput: sn,
66
- settingsInputNum: rn,
67
- settingsTextarea: on,
68
- settingsDivider: ln,
69
- settingsUnit: cn,
70
- emptyMsg: dn,
71
- canvasArea: mn,
72
- testDataBar: pn,
73
- testDataLabel: un,
74
- testDataSelect: hn,
75
- rulerWrapper: _n,
76
- rulerCorner: gn,
77
- ruler: bn,
78
- ruler_h: yn,
79
- ruler_v: fn,
80
- rulerTick: vn,
81
- rulerTickMajor: Nn,
82
- rulerLabel: wn,
83
- paperScroll: kn,
84
- paperShadow: Sn,
85
- marginGuide: Cn,
86
- watermark: Bn,
87
- sectionCanvas: In,
88
- sectionCanvasOver: Ln,
89
- sectionTypeChip: xn,
90
- sectionResizeBar: zn,
91
- sectionResizeGrip: Tn,
92
- fieldImagePlaceholder: $n,
93
- fieldBarcodePlaceholder: Dn,
94
- fieldSignaturePlaceholder: Rn,
95
- resizeHandle: An,
96
- handle_n: En,
97
- handle_s: Mn,
98
- handle_e: Pn,
99
- handle_w: Fn,
100
- handle_ne: Hn,
101
- handle_nw: Gn,
102
- handle_se: On,
103
- handle_sw: qn,
104
- rightPanel: Wn,
105
- rightTabs: Yn,
106
- rightTab: jn,
107
- rightTabActive: Un,
108
- propsBody: Vn,
109
- propsEmpty: Xn,
110
- propsEmptyIcon: Kn,
111
- propsEmptyText: Jn,
112
- posGrid: Qn,
113
- posCell: Zn,
114
- posLabel: ea,
115
- posInput: ta,
116
- posUnit: na,
117
- snapSection: aa,
118
- snapTitle: ia,
119
- snapRow: sa,
120
- snapBtn: ra,
121
- styleGroup: oa,
122
- styleGroupTitle: la,
123
- styleRow: ca,
124
- styleLabel: da,
125
- styleSelect: ma,
126
- styleSelectFull: pa,
127
- styleSelectSm: ua,
128
- styleSelectXs: ha,
129
- styleInput: _a,
130
- styleInputFull: ga,
131
- styleUnit: ba,
132
- styleValue: ya,
133
- toggleGroup: fa,
134
- toggleBtn: va,
135
- toggleBtnActive: Na,
136
- colorPicker: wa,
137
- colorHex: ka,
138
- clearBtn: Sa,
139
- sliderInput: Ca,
140
- conditionalHint: Ba,
141
- clearConditionalBtn: Ia,
142
- shortcutGrid: La,
143
- shortcutChip: xa,
144
- shortcutKeys: za,
145
- shortcutLabel: Ta
146
- }, W = 3.78, Le = {
1
+ import { jsx as e, jsxs as a, Fragment as J } from "react/jsx-runtime";
2
+ import { useNiceTranslation as j, NiceAppShell as Je, NiceIcon as v, clickOnActivationKey as we, useOverlayFocus as Ze, useIntent as Qe, useInputHints as et } from "@nice2dev/ui";
3
+ import tt, { useReducer as nt, useState as H, useCallback as M, useMemo as ue, useEffect as Be, useRef as ke } from "react";
4
+ import { createPortal as at } from "react-dom";
5
+ const it = "_root_19f1m_3", st = "_dark_19f1m_27", rt = "_toolbar_19f1m_39", ot = "_toolbarGroup_19f1m_75", lt = "_toolbarBtn_19f1m_107", ct = "_toolbarBtnActive_19f1m_171", dt = "_toolbarBtnDanger_19f1m_195", mt = "_toolbarSelect_19f1m_207", pt = "_toolbarSep_19f1m_237", ut = "_insertWrapper_19f1m_263", ht = "_insertBtn_19f1m_271", gt = "_insertDropdown_19f1m_293", _t = "_insertCategory_19f1m_333", bt = "_insertItem_19f1m_351", yt = "_insertIcon_19f1m_395", ft = "_zoomSelect_19f1m_409", vt = "_saveBtn_19f1m_441", Nt = "_editorBody_19f1m_477", wt = "_leftPanel_19f1m_493", kt = "_leftTabs_19f1m_523", St = "_leftTab_19f1m_523", Ct = "_leftTabActive_19f1m_601", Bt = "_leftTabIcon_19f1m_621", It = "_leftTabLabel_19f1m_629", Lt = "_leftContent_19f1m_639", xt = "_panelHeader_19f1m_653", zt = "_panelHeaderIcon_19f1m_677", Tt = "_panelHeaderName_19f1m_685", Dt = "_searchBox_19f1m_699", $t = "_searchInput_19f1m_707", Rt = "_fieldList_19f1m_753", At = "_fieldItem_19f1m_763", Pt = "_fieldItemIcon_19f1m_807", Et = "_fieldItemInfo_19f1m_821", Mt = "_fieldItemLabel_19f1m_831", Ft = "_fieldItemPath_19f1m_847", Ht = "_fieldItemType_19f1m_863", Gt = "_layerList_19f1m_883", Ot = "_layerItem_19f1m_895", qt = "_layerItemSelected_19f1m_931", Wt = "_layerIcon_19f1m_949", Yt = "_layerName_19f1m_961", Ut = "_layerActions_19f1m_977", jt = "_layerBtn_19f1m_999", Vt = "_wmList_19f1m_1031", Kt = "_wmItem_19f1m_1039", Xt = "_wmRow_19f1m_1065", Jt = "_wmLabel_19f1m_1079", Zt = "_wmInput_19f1m_1091", Qt = "_wmInputNum_19f1m_1123", en = "_wmSelect_19f1m_1143", tn = "_wmSlider_19f1m_1175", nn = "_wmValue_19f1m_1185", an = "_wmUnit_19f1m_1199", sn = "_wmDelete_19f1m_1209", rn = "_addBtn_19f1m_1241", on = "_settingsForm_19f1m_1277", ln = "_settingsRow_19f1m_1285", cn = "_settingsLabel_19f1m_1299", dn = "_settingsInput_19f1m_1311", mn = "_settingsInputNum_19f1m_1343", pn = "_settingsTextarea_19f1m_1375", un = "_settingsDivider_19f1m_1409", hn = "_settingsUnit_19f1m_1429", gn = "_emptyMsg_19f1m_1441", _n = "_canvasArea_19f1m_1459", bn = "_testDataBar_19f1m_1485", yn = "_testDataLabel_19f1m_1517", fn = "_testDataSelect_19f1m_1527", vn = "_rulerWrapper_19f1m_1547", Nn = "_rulerCorner_19f1m_1563", wn = "_ruler_19f1m_1547", kn = "_ruler_h_19f1m_1621", Sn = "_ruler_v_19f1m_1631", Cn = "_rulerTick_19f1m_1651", Bn = "_rulerTickMajor_19f1m_1691", In = "_rulerLabel_19f1m_1711", Ln = "_paperScroll_19f1m_1749", xn = "_paperShadow_19f1m_1767", zn = "_marginGuide_19f1m_1803", Tn = "_watermark_19f1m_1819", Dn = "_sectionCanvas_19f1m_1845", $n = "_sectionCanvasOver_19f1m_1859", Rn = "_sectionTypeChip_19f1m_1867", An = "_sectionResizeBar_19f1m_1899", Pn = "_sectionResizeGrip_19f1m_1933", En = "_fieldImagePlaceholder_19f1m_1949", Mn = "_fieldBarcodePlaceholder_19f1m_1971", Fn = "_fieldSignaturePlaceholder_19f1m_1999", Hn = "_resizeHandle_19f1m_2031", Gn = "_handle_n_19f1m_2051", On = "_handle_s_19f1m_2063", qn = "_handle_e_19f1m_2075", Wn = "_handle_w_19f1m_2087", Yn = "_handle_ne_19f1m_2099", Un = "_handle_nw_19f1m_2109", jn = "_handle_se_19f1m_2119", Vn = "_handle_sw_19f1m_2129", Kn = "_rightPanel_19f1m_2143", Xn = "_rightTabs_19f1m_2173", Jn = "_rightTab_19f1m_2173", Zn = "_rightTabActive_19f1m_2243", Qn = "_propsBody_19f1m_2255", ea = "_propsEmpty_19f1m_2267", ta = "_propsEmptyIcon_19f1m_2289", na = "_propsEmptyText_19f1m_2299", aa = "_posGrid_19f1m_2311", ia = "_posCell_19f1m_2325", sa = "_posLabel_19f1m_2337", ra = "_posInput_19f1m_2349", oa = "_posUnit_19f1m_2391", la = "_snapSection_19f1m_2403", ca = "_snapTitle_19f1m_2411", da = "_snapRow_19f1m_2429", ma = "_snapBtn_19f1m_2439", pa = "_styleGroup_19f1m_2473", ua = "_styleGroupTitle_19f1m_2481", ha = "_styleRow_19f1m_2511", ga = "_styleLabel_19f1m_2525", _a = "_styleSelect_19f1m_2539", ba = "_styleSelectFull_19f1m_2569", ya = "_styleSelectSm_19f1m_2601", fa = "_styleSelectXs_19f1m_2621", va = "_styleInput_19f1m_2653", Na = "_styleInputFull_19f1m_2685", wa = "_styleUnit_19f1m_2717", ka = "_styleValue_19f1m_2729", Sa = "_toggleGroup_19f1m_2743", Ca = "_toggleBtn_19f1m_2753", Ba = "_toggleBtnActive_19f1m_2787", Ia = "_colorPicker_19f1m_2801", La = "_colorHex_19f1m_2819", xa = "_clearBtn_19f1m_2853", za = "_sliderInput_19f1m_2885", Ta = "_conditionalHint_19f1m_2897", Da = "_clearConditionalBtn_19f1m_2929", $a = "_shortcutGrid_19f1m_2961", Ra = "_shortcutChip_19f1m_2975", Aa = "_shortcutKeys_19f1m_3007", Pa = "_shortcutLabel_19f1m_3027", t = {
6
+ root: it,
7
+ dark: st,
8
+ toolbar: rt,
9
+ toolbarGroup: ot,
10
+ toolbarBtn: lt,
11
+ toolbarBtnActive: ct,
12
+ toolbarBtnDanger: dt,
13
+ toolbarSelect: mt,
14
+ toolbarSep: pt,
15
+ insertWrapper: ut,
16
+ insertBtn: ht,
17
+ insertDropdown: gt,
18
+ insertCategory: _t,
19
+ insertItem: bt,
20
+ insertIcon: yt,
21
+ zoomSelect: ft,
22
+ saveBtn: vt,
23
+ editorBody: Nt,
24
+ leftPanel: wt,
25
+ leftTabs: kt,
26
+ leftTab: St,
27
+ leftTabActive: Ct,
28
+ leftTabIcon: Bt,
29
+ leftTabLabel: It,
30
+ leftContent: Lt,
31
+ panelHeader: xt,
32
+ panelHeaderIcon: zt,
33
+ panelHeaderName: Tt,
34
+ searchBox: Dt,
35
+ searchInput: $t,
36
+ fieldList: Rt,
37
+ fieldItem: At,
38
+ fieldItemIcon: Pt,
39
+ fieldItemInfo: Et,
40
+ fieldItemLabel: Mt,
41
+ fieldItemPath: Ft,
42
+ fieldItemType: Ht,
43
+ layerList: Gt,
44
+ layerItem: Ot,
45
+ layerItemSelected: qt,
46
+ layerIcon: Wt,
47
+ layerName: Yt,
48
+ layerActions: Ut,
49
+ layerBtn: jt,
50
+ wmList: Vt,
51
+ wmItem: Kt,
52
+ wmRow: Xt,
53
+ wmLabel: Jt,
54
+ wmInput: Zt,
55
+ wmInputNum: Qt,
56
+ wmSelect: en,
57
+ wmSlider: tn,
58
+ wmValue: nn,
59
+ wmUnit: an,
60
+ wmDelete: sn,
61
+ addBtn: rn,
62
+ settingsForm: on,
63
+ settingsRow: ln,
64
+ settingsLabel: cn,
65
+ settingsInput: dn,
66
+ settingsInputNum: mn,
67
+ settingsTextarea: pn,
68
+ settingsDivider: un,
69
+ settingsUnit: hn,
70
+ emptyMsg: gn,
71
+ canvasArea: _n,
72
+ testDataBar: bn,
73
+ testDataLabel: yn,
74
+ testDataSelect: fn,
75
+ rulerWrapper: vn,
76
+ rulerCorner: Nn,
77
+ ruler: wn,
78
+ ruler_h: kn,
79
+ ruler_v: Sn,
80
+ rulerTick: Cn,
81
+ rulerTickMajor: Bn,
82
+ rulerLabel: In,
83
+ paperScroll: Ln,
84
+ paperShadow: xn,
85
+ marginGuide: zn,
86
+ watermark: Tn,
87
+ sectionCanvas: Dn,
88
+ sectionCanvasOver: $n,
89
+ sectionTypeChip: Rn,
90
+ sectionResizeBar: An,
91
+ sectionResizeGrip: Pn,
92
+ fieldImagePlaceholder: En,
93
+ fieldBarcodePlaceholder: Mn,
94
+ fieldSignaturePlaceholder: Fn,
95
+ resizeHandle: Hn,
96
+ handle_n: Gn,
97
+ handle_s: On,
98
+ handle_e: qn,
99
+ handle_w: Wn,
100
+ handle_ne: Yn,
101
+ handle_nw: Un,
102
+ handle_se: jn,
103
+ handle_sw: Vn,
104
+ rightPanel: Kn,
105
+ rightTabs: Xn,
106
+ rightTab: Jn,
107
+ rightTabActive: Zn,
108
+ propsBody: Qn,
109
+ propsEmpty: ea,
110
+ propsEmptyIcon: ta,
111
+ propsEmptyText: na,
112
+ posGrid: aa,
113
+ posCell: ia,
114
+ posLabel: sa,
115
+ posInput: ra,
116
+ posUnit: oa,
117
+ snapSection: la,
118
+ snapTitle: ca,
119
+ snapRow: da,
120
+ snapBtn: ma,
121
+ styleGroup: pa,
122
+ styleGroupTitle: ua,
123
+ styleRow: ha,
124
+ styleLabel: ga,
125
+ styleSelect: _a,
126
+ styleSelectFull: ba,
127
+ styleSelectSm: ya,
128
+ styleSelectXs: fa,
129
+ styleInput: va,
130
+ styleInputFull: Na,
131
+ styleUnit: wa,
132
+ styleValue: ka,
133
+ toggleGroup: Sa,
134
+ toggleBtn: Ca,
135
+ toggleBtnActive: Ba,
136
+ colorPicker: Ia,
137
+ colorHex: La,
138
+ clearBtn: xa,
139
+ sliderInput: za,
140
+ conditionalHint: Ta,
141
+ clearConditionalBtn: Da,
142
+ shortcutGrid: $a,
143
+ shortcutChip: Ra,
144
+ shortcutKeys: Aa,
145
+ shortcutLabel: Pa
146
+ }, W = 3.78, ze = {
147
147
  A3: [297, 420],
148
148
  A4: [210, 297],
149
149
  A5: [148, 210],
@@ -152,7 +152,7 @@ const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
152
152
  Legal: [216, 356],
153
153
  Tabloid: [279, 432],
154
154
  custom: [210, 297]
155
- }, $a = [
155
+ }, Ea = [
156
156
  "sans-serif",
157
157
  "serif",
158
158
  "monospace",
@@ -162,7 +162,7 @@ const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
162
162
  "Georgia",
163
163
  "Verdana",
164
164
  "Tahoma"
165
- ], xe = [6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 60, 72], he = {
165
+ ], Te = [6, 7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 60, 72], he = {
166
166
  text: "type",
167
167
  number: "hash",
168
168
  currency: "dollar",
@@ -180,7 +180,7 @@ const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
180
180
  page_number: "hash",
181
181
  total_pages: "layers",
182
182
  print_date: "calendar"
183
- }, _e = {
183
+ }, ge = {
184
184
  text: "Text",
185
185
  number: "Number",
186
186
  currency: "Currency",
@@ -198,13 +198,13 @@ const Ze = "_root_19f1m_3", et = "_dark_19f1m_27", tt = "_toolbar_19f1m_39", nt
198
198
  page_number: "Page number",
199
199
  total_pages: "Total pages",
200
200
  print_date: "Print date"
201
- }, we = (n, s) => _e[s] ? n(`printing.fieldType.${s}`, _e[s]) : s;
202
- function Da(n, s) {
203
- switch (s.type) {
201
+ }, Se = (n, o) => ge[o] ? n(`printing.fieldType.${o}`, ge[o]) : o;
202
+ function Ma(n, o) {
203
+ switch (o.type) {
204
204
  case "UPDATE":
205
205
  return {
206
206
  past: [...n.past.slice(-50), n.present],
207
- present: s.payload,
207
+ present: o.payload,
208
208
  future: []
209
209
  };
210
210
  case "UNDO":
@@ -223,17 +223,17 @@ function Da(n, s) {
223
223
  return n;
224
224
  }
225
225
  }
226
- const se = "#000000", ge = "#94a3b8";
226
+ const se = "#000000", be = "#94a3b8";
227
227
  function ce() {
228
228
  return `f-${Date.now()}-${Math.floor(Math.random() * 1e3)}`;
229
229
  }
230
- function ze(n, s) {
231
- const m = {
230
+ function De(n, o) {
231
+ const d = {
232
232
  id: ce(),
233
- name: (s == null ? void 0 : s.label) ?? _e[n] ?? n,
234
- label: (s == null ? void 0 : s.label) ?? _e[n] ?? n,
233
+ name: (o == null ? void 0 : o.label) ?? ge[n] ?? n,
234
+ label: (o == null ? void 0 : o.label) ?? ge[n] ?? n,
235
235
  type: n,
236
- dataPath: (s == null ? void 0 : s.path) ?? "",
236
+ dataPath: (o == null ? void 0 : o.path) ?? "",
237
237
  fallback: n === "static_text" ? "Static text" : void 0,
238
238
  format: n === "date" || n === "datetime" ? "DD.MM.YYYY" : void 0,
239
239
  position: {
@@ -244,45 +244,45 @@ function ze(n, s) {
244
244
  },
245
245
  style: { fontSize: 10, color: se, fontFamily: "sans-serif" }
246
246
  };
247
- return n === "rect" && (m.style.backgroundColor = "var(--nice-bg-secondary, #f1f5f9)"), n === "line" && (m.style = {
248
- ...m.style,
247
+ return n === "rect" && (d.style.backgroundColor = "var(--nice-bg-secondary, #f1f5f9)"), n === "line" && (d.style = {
248
+ ...d.style,
249
249
  borderWidth: 0.5,
250
250
  borderColor: se,
251
251
  borderStyle: "solid"
252
- }), m;
252
+ }), d;
253
253
  }
254
- const Te = ({
254
+ const $e = ({
255
255
  lengthMm: n,
256
- zoom: s,
257
- orientation: m
256
+ zoom: o,
257
+ orientation: d
258
258
  }) => {
259
- const o = [], B = s < 0.6 ? 20 : s < 1 ? 10 : 5;
260
- for (let N = 0; N <= n; N += B) {
261
- const b = N * s * W, h = N % (B * 2) === 0;
262
- o.push(
259
+ const l = [], C = o < 0.6 ? 20 : o < 1 ? 10 : 5;
260
+ for (let N = 0; N <= n; N += C) {
261
+ const _ = N * o * W, g = N % (C * 2) === 0;
262
+ l.push(
263
263
  /* @__PURE__ */ e(
264
264
  "div",
265
265
  {
266
- className: `${t.rulerTick} ${h ? t.rulerTickMajor : ""}`,
267
- style: m === "h" ? { left: b } : { top: b },
268
- children: h && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: N })
266
+ className: `${t.rulerTick} ${g ? t.rulerTickMajor : ""}`,
267
+ style: d === "h" ? { left: _ } : { top: _ },
268
+ children: g && /* @__PURE__ */ e("span", { className: t.rulerLabel, children: N })
269
269
  },
270
270
  N
271
271
  )
272
272
  );
273
273
  }
274
- return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${m}`]}`, children: o });
275
- }, Ra = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Aa = ({ onResizeStart: n }) => /* @__PURE__ */ e(V, { children: Ra.map((s) => /* @__PURE__ */ e(
274
+ return /* @__PURE__ */ e("div", { className: `${t.ruler} ${t[`ruler_${d}`]}`, children: l });
275
+ }, Fa = ["n", "s", "e", "w", "ne", "nw", "se", "sw"], Ha = ({ onResizeStart: n }) => /* @__PURE__ */ e(J, { children: Fa.map((o) => /* @__PURE__ */ e(
276
276
  "div",
277
277
  {
278
- className: `${t.resizeHandle} ${t[`handle_${s}`]}`,
279
- onMouseDown: (m) => {
280
- m.stopPropagation(), n(s, m);
278
+ className: `${t.resizeHandle} ${t[`handle_${o}`]}`,
279
+ onMouseDown: (d) => {
280
+ d.stopPropagation(), n(o, d);
281
281
  }
282
282
  },
283
- s
283
+ o
284
284
  )) });
285
- function Ea(n, s) {
285
+ function Ga(n, o) {
286
286
  if (n.type === "static_text")
287
287
  return n.fallback ?? "Text";
288
288
  if (n.type === "page_number")
@@ -291,92 +291,101 @@ function Ea(n, s) {
291
291
  return "3";
292
292
  if (n.type === "print_date")
293
293
  return (/* @__PURE__ */ new Date()).toLocaleDateString("pl-PL");
294
- if (s && n.dataPath) {
295
- const m = n.dataPath.split(".").reduce(
296
- (o, B) => o && typeof o == "object" ? o[B] : null,
297
- s
294
+ if (o && n.dataPath) {
295
+ const d = n.dataPath.split(".").reduce(
296
+ (l, C) => l && typeof l == "object" ? l[C] : null,
297
+ o
298
298
  );
299
- if (m != null)
300
- return String(m);
299
+ if (d != null)
300
+ return String(d);
301
301
  }
302
302
  return n.label ? `{${n.label}}` : `{${n.dataPath}}`;
303
303
  }
304
- const Ma = ({
304
+ const Oa = ({
305
305
  field: n,
306
- zoom: s,
307
- selected: m,
308
- sampleData: o,
309
- onClick: B,
306
+ zoom: o,
307
+ selected: d,
308
+ sampleData: l,
309
+ onClick: C,
310
310
  onDragStart: N,
311
- onResizeStart: b,
312
- readOnly: h
311
+ onResizeStart: _,
312
+ readOnly: g
313
313
  }) => {
314
- const g = n.position, _ = n.style, l = (i) => i * s * W, f = n.type === "line", C = n.type === "rect", z = n.type === "image" || n.type === "static_image", y = n.type === "barcode" || n.type === "qr", r = {
314
+ const { t: f } = j(), k = n.position, u = n.style, r = (m) => m * o * W, S = n.type === "line", I = n.type === "rect", x = n.type === "image" || n.type === "static_image", s = n.type === "barcode" || n.type === "qr", i = {
315
315
  position: "absolute",
316
- left: l(g.x),
317
- top: l(g.y),
318
- width: l(g.width),
319
- height: l(g.height),
320
- zIndex: g.zIndex ?? 1,
321
- transform: _.rotation ? `rotate(${_.rotation}deg)` : void 0,
316
+ left: r(k.x),
317
+ top: r(k.y),
318
+ width: r(k.width),
319
+ height: r(k.height),
320
+ zIndex: k.zIndex ?? 1,
321
+ transform: u.rotation ? `rotate(${u.rotation}deg)` : void 0,
322
322
  boxSizing: "border-box",
323
323
  overflow: "hidden",
324
- ...!f && !C ? {
325
- fontSize: (_.fontSize ?? 10) * s,
326
- fontFamily: _.fontFamily ?? "sans-serif",
327
- fontWeight: _.fontWeight ?? "normal",
328
- fontStyle: _.fontStyle ?? "normal",
329
- color: _.color ?? se,
330
- textAlign: _.textAlign ?? "left",
331
- lineHeight: _.lineHeight ?? 1.4,
332
- letterSpacing: _.letterSpacing ? `${_.letterSpacing}em` : void 0,
333
- padding: _.padding ? l(_.padding) : 0
324
+ ...!S && !I ? {
325
+ fontSize: (u.fontSize ?? 10) * o,
326
+ fontFamily: u.fontFamily ?? "sans-serif",
327
+ fontWeight: u.fontWeight ?? "normal",
328
+ fontStyle: u.fontStyle ?? "normal",
329
+ color: u.color ?? se,
330
+ textAlign: u.textAlign ?? "left",
331
+ lineHeight: u.lineHeight ?? 1.4,
332
+ letterSpacing: u.letterSpacing ? `${u.letterSpacing}em` : void 0,
333
+ padding: u.padding ? r(u.padding) : 0
334
334
  } : {},
335
- backgroundColor: _.backgroundColor,
336
- borderWidth: _.borderWidth ?? 0,
337
- borderColor: _.borderColor ?? "transparent",
338
- borderStyle: _.borderStyle ?? "solid",
339
- borderRadius: _.borderRadius,
340
- opacity: _.opacity,
341
- outline: m ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
335
+ backgroundColor: u.backgroundColor,
336
+ borderWidth: u.borderWidth ?? 0,
337
+ borderColor: u.borderColor ?? "transparent",
338
+ borderStyle: u.borderStyle ?? "solid",
339
+ borderRadius: u.borderRadius,
340
+ opacity: u.opacity,
341
+ outline: d ? "1.5px solid var(--nice-primary-hover, #2563eb)" : "1px dashed transparent",
342
342
  outlineOffset: 1,
343
- cursor: h ? "default" : "move"
343
+ cursor: g ? "default" : "move"
344
344
  };
345
- return /* @__PURE__ */ a("div", { style: r, onClick: B, onMouseDown: h ? void 0 : N, children: [
346
- f ? /* @__PURE__ */ e(
347
- "div",
348
- {
349
- style: {
350
- width: "100%",
351
- borderBottom: `${(_.borderWidth ?? 0.5) * s}px ${_.borderStyle ?? "solid"} ${_.borderColor ?? se}`
352
- }
353
- }
354
- ) : C ? null : z ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: /* @__PURE__ */ e(S, { name: "image", size: 24 }) }) : y ? /* @__PURE__ */ a("div", { className: t.fieldBarcodePlaceholder, children: [
355
- /* @__PURE__ */ e(S, { name: n.type === "qr" ? "qr-code" : "barcode", size: 14 }),
356
- " ",
357
- n.type === "qr" ? "QR" : "Barcode"
358
- ] }) : n.type === "signature" ? /* @__PURE__ */ a("div", { className: t.fieldSignaturePlaceholder, children: [
359
- /* @__PURE__ */ e(S, { name: "pen", size: 14 }),
360
- " ",
361
- n.label
362
- ] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: Ea(n, o) }),
363
- m && !h && /* @__PURE__ */ e(Aa, { onResizeStart: b })
364
- ] });
365
- }, Pa = ({
345
+ return /* @__PURE__ */ a(
346
+ "div",
347
+ {
348
+ role: "presentation",
349
+ style: i,
350
+ onClick: C,
351
+ onMouseDown: g ? void 0 : N,
352
+ children: [
353
+ S ? /* @__PURE__ */ e(
354
+ "div",
355
+ {
356
+ style: {
357
+ width: "100%",
358
+ borderBottom: `${(u.borderWidth ?? 0.5) * o}px ${u.borderStyle ?? "solid"} ${u.borderColor ?? se}`
359
+ }
360
+ }
361
+ ) : I ? null : x ? /* @__PURE__ */ e("div", { className: t.fieldImagePlaceholder, children: /* @__PURE__ */ e(v, { name: "image", size: 24 }) }) : s ? /* @__PURE__ */ a("div", { className: t.fieldBarcodePlaceholder, children: [
362
+ /* @__PURE__ */ e(v, { name: n.type === "qr" ? "qr-code" : "barcode", size: 14 }),
363
+ " ",
364
+ n.type === "qr" ? "QR" : f("templateEditor.barcode", "Barcode")
365
+ ] }) : n.type === "signature" ? /* @__PURE__ */ a("div", { className: t.fieldSignaturePlaceholder, children: [
366
+ /* @__PURE__ */ e(v, { name: "pen", size: 14 }),
367
+ " ",
368
+ n.label
369
+ ] }) : /* @__PURE__ */ e("span", { style: { display: "block", width: "100%" }, children: Ga(n, l) }),
370
+ d && !g && /* @__PURE__ */ e(Ha, { onResizeStart: _ })
371
+ ]
372
+ }
373
+ );
374
+ }, qa = ({
366
375
  section: n,
367
- zoom: s,
368
- paperWidthMm: m,
369
- selectedIds: o,
370
- sampleData: B,
376
+ zoom: o,
377
+ paperWidthMm: d,
378
+ selectedIds: l,
379
+ sampleData: C,
371
380
  readOnly: N,
372
- showGrid: b,
373
- onFieldClick: h,
374
- onFieldDragStart: g,
375
- onResizeStart: _,
376
- onSectionHeightChange: l,
377
- onDropField: f
381
+ showGrid: _,
382
+ onFieldClick: g,
383
+ onFieldDragStart: f,
384
+ onResizeStart: k,
385
+ onSectionHeightChange: u,
386
+ onDropField: r
378
387
  }) => {
379
- const C = (n.heightMm ?? (n.type === "body" ? 200 : 40)) * s * W, z = m * s * W, [y, r] = H(!1), i = {
388
+ const S = (n.heightMm ?? (n.type === "body" ? 200 : 40)) * o * W, I = d * o * W, [x, s] = H(!1), i = {
380
389
  // audit-allow: literal-color +3 — band tints on the white page - print colours
381
390
  header: "rgba(219,234,254,0.35)",
382
391
  footer: "rgba(220,252,231,0.35)",
@@ -386,56 +395,56 @@ const Ma = ({
386
395
  return /* @__PURE__ */ a(
387
396
  "div",
388
397
  {
389
- className: `${t.sectionCanvas} ${y ? t.sectionCanvasOver : ""}`,
398
+ className: `${t.sectionCanvas} ${x ? t.sectionCanvasOver : ""}`,
390
399
  style: {
391
- width: z,
392
- height: C,
400
+ width: I,
401
+ height: S,
393
402
  position: "relative",
394
403
  background: i[n.type] ?? "transparent",
395
- backgroundImage: b ? `repeating-linear-gradient(0deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * s * W}px),
396
- repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * s * W}px)` : void 0
404
+ backgroundImage: _ ? `repeating-linear-gradient(0deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * o * W}px),
405
+ repeating-linear-gradient(90deg, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 0, var(--nice-overlay-15, rgba(148, 163, 184, 0.15)) 1px, transparent 1px, transparent ${5 * o * W}px)` : void 0
397
406
  },
398
- onDragOver: (u) => {
399
- u.preventDefault(), r(!0);
407
+ onDragOver: (m) => {
408
+ m.preventDefault(), s(!0);
400
409
  },
401
- onDragLeave: () => r(!1),
402
- onDrop: (u) => {
403
- u.preventDefault(), r(!1);
404
- const c = u.dataTransfer.getData("fieldPath");
405
- if (!c)
410
+ onDragLeave: () => s(!1),
411
+ onDrop: (m) => {
412
+ m.preventDefault(), s(!1);
413
+ const h = m.dataTransfer.getData("fieldPath");
414
+ if (!h)
406
415
  return;
407
- const F = u.currentTarget.getBoundingClientRect(), v = (u.clientX - F.left) / (s * W), D = (u.clientY - F.top) / (s * W);
408
- f(n.id, c, Math.max(0, v), Math.max(0, D));
416
+ const z = m.currentTarget.getBoundingClientRect(), y = (m.clientX - z.left) / (o * W), R = (m.clientY - z.top) / (o * W);
417
+ r(n.id, h, Math.max(0, y), Math.max(0, R));
409
418
  },
410
419
  children: [
411
420
  /* @__PURE__ */ e("div", { className: t.sectionTypeChip, children: n.type }),
412
- n.fields.map((u) => /* @__PURE__ */ e(
413
- Ma,
421
+ n.fields.map((m) => /* @__PURE__ */ e(
422
+ Oa,
414
423
  {
415
- field: u,
416
- zoom: s,
417
- selected: o.has(u.id),
418
- sampleData: B,
424
+ field: m,
425
+ zoom: o,
426
+ selected: l.has(m.id),
427
+ sampleData: C,
419
428
  readOnly: N,
420
- onClick: (c) => h(u.id, c),
421
- onDragStart: (c) => g(u.id, c),
422
- onResizeStart: (c, F) => _(u.id, c, F)
429
+ onClick: (h) => g(m.id, h),
430
+ onDragStart: (h) => f(m.id, h),
431
+ onResizeStart: (h, z) => k(m.id, h, z)
423
432
  },
424
- u.id
433
+ m.id
425
434
  )),
426
435
  !N && n.type !== "body" && /* @__PURE__ */ e(
427
436
  "div",
428
437
  {
429
438
  className: t.sectionResizeBar,
430
- onMouseDown: (u) => {
431
- u.preventDefault();
432
- const c = u.clientY, F = n.heightMm ?? 40, v = (x) => {
433
- const T = (x.clientY - c) / (s * W);
434
- l(n.id, Math.max(10, F + T));
435
- }, D = () => {
436
- document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", D);
439
+ onMouseDown: (m) => {
440
+ m.preventDefault();
441
+ const h = m.clientY, z = n.heightMm ?? 40, y = (T) => {
442
+ const D = (T.clientY - h) / (o * W);
443
+ u(n.id, Math.max(10, z + D));
444
+ }, R = () => {
445
+ document.removeEventListener("mousemove", y), document.removeEventListener("mouseup", R);
437
446
  };
438
- document.addEventListener("mousemove", v), document.addEventListener("mouseup", D);
447
+ document.addEventListener("mousemove", y), document.addEventListener("mouseup", R);
439
448
  },
440
449
  children: /* @__PURE__ */ e("div", { className: t.sectionResizeGrip })
441
450
  }
@@ -443,45 +452,45 @@ const Ma = ({
443
452
  ]
444
453
  }
445
454
  );
446
- }, le = ({ keys: n, label: s }) => /* @__PURE__ */ a("div", { className: t.shortcutChip, children: [
455
+ }, le = ({ keys: n, label: o }) => /* @__PURE__ */ a("div", { className: t.shortcutChip, children: [
447
456
  /* @__PURE__ */ e("span", { className: t.shortcutKeys, children: n }),
448
- /* @__PURE__ */ e("span", { className: t.shortcutLabel, children: s })
449
- ] }), Fa = [
457
+ /* @__PURE__ */ e("span", { className: t.shortcutLabel, children: o })
458
+ ] }), Wa = [
450
459
  { id: "fields", icon: "list", key: "printing.editor.tabFields", label: "Fields" },
451
460
  { id: "layers", icon: "layers", key: "printing.editor.tabLayers", label: "Layers" },
452
461
  { id: "watermarks", icon: "droplet", key: "printing.editor.tabWatermarks", label: "Watermarks" },
453
462
  { id: "signatures", icon: "pen", key: "printing.editor.tabSignatures", label: "Signatures" },
454
463
  { id: "settings", icon: "settings", key: "printing.editor.tabSettings", label: "Settings" }
455
- ], Ha = [
464
+ ], Ya = [
456
465
  { id: "position", key: "printing.editor.tabPosition", label: "Position" },
457
466
  { id: "style", key: "printing.editor.tabStyle", label: "Style" },
458
467
  { id: "data", key: "printing.editor.tabData", label: "Data" },
459
468
  { id: "conditional", key: "printing.editor.tabConditional", label: "Conditions" }
460
- ], Ga = ({
469
+ ], Ua = ({
461
470
  tpl: n,
462
- zoom: s,
463
- canUndo: m,
464
- canRedo: o,
465
- showGrid: B,
471
+ zoom: o,
472
+ canUndo: d,
473
+ canRedo: l,
474
+ showGrid: C,
466
475
  showRulers: N,
467
- readOnly: b,
468
- selectedCount: h,
469
- onPaperChange: g,
470
- onZoom: _,
471
- onUndo: l,
472
- onRedo: f,
473
- onToggleGrid: C,
474
- onToggleRulers: z,
475
- onInsert: y,
476
- onDelete: r,
476
+ readOnly: _,
477
+ selectedCount: g,
478
+ onPaperChange: f,
479
+ onZoom: k,
480
+ onUndo: u,
481
+ onRedo: r,
482
+ onToggleGrid: S,
483
+ onToggleRulers: I,
484
+ onInsert: x,
485
+ onDelete: s,
477
486
  onDuplicate: i,
478
- onAlignH: u,
479
- onAlignV: c,
480
- onBringForward: F,
481
- onSendBackward: v,
482
- onSave: D
487
+ onAlignH: m,
488
+ onAlignV: h,
489
+ onBringForward: z,
490
+ onSendBackward: y,
491
+ onSave: R
483
492
  }) => {
484
- const { t: x } = X(), { t: T } = X(), [A, Y] = H(!1), Z = [0.5, 0.75, 1, 1.25, 1.5, 2];
493
+ const { t: T } = j(), { t: D } = j(), [Y, X] = H(!1), P = [0.5, 0.75, 1, 1.25, 1.5, 2];
485
494
  return /* @__PURE__ */ a("div", { className: t.toolbar, children: [
486
495
  /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
487
496
  /* @__PURE__ */ e(
@@ -489,83 +498,83 @@ const Ma = ({
489
498
  {
490
499
  className: t.toolbarSelect,
491
500
  value: n.paperSize,
492
- onChange: (w) => g(w.target.value, n.orientation),
493
- children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((w) => /* @__PURE__ */ e("option", { value: w, children: w }, w))
501
+ onChange: (b) => f(b.target.value, n.orientation),
502
+ children: ["A4", "A5", "A3", "Letter", "Legal", "Tabloid", "custom"].map((b) => /* @__PURE__ */ e("option", { value: b, children: b }, b))
494
503
  }
495
504
  ),
496
505
  /* @__PURE__ */ e(
497
506
  "button",
498
507
  {
499
508
  className: `${t.toolbarBtn} ${n.orientation === "portrait" ? t.toolbarBtnActive : ""}`,
500
- onClick: () => g(n.paperSize, "portrait"),
501
- title: x("templateEditor.portrait", "Portrait"),
502
- children: /* @__PURE__ */ e(S, { name: "file", size: 14 })
509
+ onClick: () => f(n.paperSize, "portrait"),
510
+ title: T("templateEditor.portrait", "Portrait"),
511
+ children: /* @__PURE__ */ e(v, { name: "file", size: 14 })
503
512
  }
504
513
  ),
505
514
  /* @__PURE__ */ e(
506
515
  "button",
507
516
  {
508
517
  className: `${t.toolbarBtn} ${n.orientation === "landscape" ? t.toolbarBtnActive : ""}`,
509
- onClick: () => g(n.paperSize, "landscape"),
510
- title: x("templateEditor.landscape", "Landscape"),
511
- children: /* @__PURE__ */ e(S, { name: "file", size: 14, style: { transform: "rotate(90deg)" } })
518
+ onClick: () => f(n.paperSize, "landscape"),
519
+ title: T("templateEditor.landscape", "Landscape"),
520
+ children: /* @__PURE__ */ e(v, { name: "file", size: 14, style: { transform: "rotate(90deg)" } })
512
521
  }
513
522
  )
514
523
  ] }),
515
- !b && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
524
+ !_ && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
516
525
  /* @__PURE__ */ e(
517
526
  "button",
518
527
  {
519
528
  className: t.toolbarBtn,
520
- disabled: !m,
521
- onClick: l,
522
- title: `${T("printing.editor.undo", "Undo")} (Ctrl+Z)`,
523
- children: /* @__PURE__ */ e(S, { name: "undo", size: 14 })
529
+ disabled: !d,
530
+ onClick: u,
531
+ title: `${D("printing.editor.undo", "Undo")} (Ctrl+Z)`,
532
+ children: /* @__PURE__ */ e(v, { name: "undo", size: 14 })
524
533
  }
525
534
  ),
526
535
  /* @__PURE__ */ e(
527
536
  "button",
528
537
  {
529
538
  className: t.toolbarBtn,
530
- disabled: !o,
531
- onClick: f,
532
- title: `${T("printing.editor.redo", "Redo")} (Ctrl+Y)`,
533
- children: /* @__PURE__ */ e(S, { name: "redo", size: 14 })
539
+ disabled: !l,
540
+ onClick: r,
541
+ title: `${D("printing.editor.redo", "Redo")} (Ctrl+Y)`,
542
+ children: /* @__PURE__ */ e(v, { name: "redo", size: 14 })
534
543
  }
535
544
  )
536
545
  ] }),
537
- !b && /* @__PURE__ */ a("div", { className: t.insertWrapper, children: [
546
+ !_ && /* @__PURE__ */ a("div", { className: t.insertWrapper, children: [
538
547
  /* @__PURE__ */ a(
539
548
  "button",
540
549
  {
541
550
  className: `${t.toolbarBtn} ${t.insertBtn}`,
542
- onClick: () => Y((w) => !w),
551
+ onClick: () => X((b) => !b),
543
552
  children: [
544
- /* @__PURE__ */ e(S, { name: "plus", size: 14 }),
553
+ /* @__PURE__ */ e(v, { name: "plus", size: 14 }),
545
554
  " ",
546
- T("printing.editor.insert", "Insert"),
555
+ D("printing.editor.insert", "Insert"),
547
556
  " ",
548
- /* @__PURE__ */ e(S, { name: "chevron-down", size: 12 })
557
+ /* @__PURE__ */ e(v, { name: "chevron-down", size: 12 })
549
558
  ]
550
559
  }
551
560
  ),
552
- A && /* @__PURE__ */ a("div", { className: t.insertDropdown, onMouseLeave: () => Y(!1), children: [
553
- /* @__PURE__ */ e("div", { className: t.insertCategory, children: T("printing.editor.dataFields", "Data fields") }),
554
- ["text", "number", "currency", "date", "image", "barcode", "qr"].map((w) => /* @__PURE__ */ a(
561
+ Y && /* @__PURE__ */ a("div", { className: t.insertDropdown, onMouseLeave: () => X(!1), children: [
562
+ /* @__PURE__ */ e("div", { className: t.insertCategory, children: D("printing.editor.dataFields", "Data fields") }),
563
+ ["text", "number", "currency", "date", "image", "barcode", "qr"].map((b) => /* @__PURE__ */ a(
555
564
  "button",
556
565
  {
557
566
  className: t.insertItem,
558
567
  onClick: () => {
559
- y(w), Y(!1);
568
+ x(b), X(!1);
560
569
  },
561
570
  children: [
562
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[w] }),
563
- we(T, w)
571
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[b] }),
572
+ Se(D, b)
564
573
  ]
565
574
  },
566
- w
575
+ b
567
576
  )),
568
- /* @__PURE__ */ e("div", { className: t.insertCategory, children: x("templateEditor.staticElements", "Static elements") }),
577
+ /* @__PURE__ */ e("div", { className: t.insertCategory, children: T("templateEditor.staticElements", "Static elements") }),
569
578
  [
570
579
  "static_text",
571
580
  "static_image",
@@ -574,31 +583,31 @@ const Ma = ({
574
583
  "page_number",
575
584
  "total_pages",
576
585
  "print_date"
577
- ].map((w) => /* @__PURE__ */ a(
586
+ ].map((b) => /* @__PURE__ */ a(
578
587
  "button",
579
588
  {
580
589
  className: t.insertItem,
581
590
  onClick: () => {
582
- y(w), Y(!1);
591
+ x(b), X(!1);
583
592
  },
584
593
  children: [
585
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[w] }),
586
- we(T, w)
594
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: he[b] }),
595
+ Se(D, b)
587
596
  ]
588
597
  },
589
- w
598
+ b
590
599
  )),
591
- /* @__PURE__ */ e("div", { className: t.insertCategory, children: x("templateEditor.special", "Special") }),
600
+ /* @__PURE__ */ e("div", { className: t.insertCategory, children: T("templateEditor.special", "Special") }),
592
601
  /* @__PURE__ */ a(
593
602
  "button",
594
603
  {
595
604
  className: t.insertItem,
596
605
  onClick: () => {
597
- y("watermark"), Y(!1);
606
+ x("watermark"), X(!1);
598
607
  },
599
608
  children: [
600
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(S, { name: "droplet", size: 14 }) }),
601
- T("printing.editor.watermark", "Watermark")
609
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(v, { name: "droplet", size: 14 }) }),
610
+ D("printing.editor.watermark", "Watermark")
602
611
  ]
603
612
  }
604
613
  ),
@@ -607,33 +616,33 @@ const Ma = ({
607
616
  {
608
617
  className: t.insertItem,
609
618
  onClick: () => {
610
- y("signature"), Y(!1);
619
+ x("signature"), X(!1);
611
620
  },
612
621
  children: [
613
- /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(S, { name: "pen", size: 14 }) }),
614
- T("printing.editor.signature", "Signature")
622
+ /* @__PURE__ */ e("span", { className: t.insertIcon, children: /* @__PURE__ */ e(v, { name: "pen", size: 14 }) }),
623
+ D("printing.editor.signature", "Signature")
615
624
  ]
616
625
  }
617
626
  )
618
627
  ] })
619
628
  ] }),
620
- !b && h > 0 && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
629
+ !_ && g > 0 && /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
621
630
  /* @__PURE__ */ e(
622
631
  "button",
623
632
  {
624
633
  className: t.toolbarBtn,
625
634
  onClick: i,
626
- title: `${T("printing.editor.duplicate", "Duplicate")} (Ctrl+D)`,
627
- children: /* @__PURE__ */ e(S, { name: "copy", size: 14 })
635
+ title: `${D("printing.editor.duplicate", "Duplicate")} (Ctrl+D)`,
636
+ children: /* @__PURE__ */ e(v, { name: "copy", size: 14 })
628
637
  }
629
638
  ),
630
639
  /* @__PURE__ */ e(
631
640
  "button",
632
641
  {
633
642
  className: `${t.toolbarBtn} ${t.toolbarBtnDanger}`,
634
- onClick: r,
635
- title: `${T("printing.action.remove", "Remove")} (Del)`,
636
- children: /* @__PURE__ */ e(S, { name: "trash", size: 14 })
643
+ onClick: s,
644
+ title: `${D("printing.action.remove", "Remove")} (Del)`,
645
+ children: /* @__PURE__ */ e(v, { name: "trash", size: 14 })
637
646
  }
638
647
  ),
639
648
  /* @__PURE__ */ e("span", { className: t.toolbarSep }),
@@ -641,35 +650,35 @@ const Ma = ({
641
650
  "button",
642
651
  {
643
652
  className: t.toolbarBtn,
644
- onClick: () => u("left"),
645
- title: T("printing.editor.alignLeft", "Align left"),
646
- children: /* @__PURE__ */ e(S, { name: "align-left", size: 14 })
653
+ onClick: () => m("left"),
654
+ title: D("printing.editor.alignLeft", "Align left"),
655
+ children: /* @__PURE__ */ e(v, { name: "align-left", size: 14 })
647
656
  }
648
657
  ),
649
658
  /* @__PURE__ */ e(
650
659
  "button",
651
660
  {
652
661
  className: t.toolbarBtn,
653
- onClick: () => u("center"),
654
- title: T("printing.editor.alignCenter", "Align centre"),
655
- children: /* @__PURE__ */ e(S, { name: "align-center", size: 14 })
662
+ onClick: () => m("center"),
663
+ title: D("printing.editor.alignCenter", "Align centre"),
664
+ children: /* @__PURE__ */ e(v, { name: "align-center", size: 14 })
656
665
  }
657
666
  ),
658
667
  /* @__PURE__ */ e(
659
668
  "button",
660
669
  {
661
670
  className: t.toolbarBtn,
662
- onClick: () => u("right"),
663
- title: T("printing.editor.alignRight", "Align right"),
664
- children: /* @__PURE__ */ e(S, { name: "align-right", size: 14 })
671
+ onClick: () => m("right"),
672
+ title: D("printing.editor.alignRight", "Align right"),
673
+ children: /* @__PURE__ */ e(v, { name: "align-right", size: 14 })
665
674
  }
666
675
  ),
667
676
  /* @__PURE__ */ e(
668
677
  "button",
669
678
  {
670
679
  className: t.toolbarBtn,
671
- onClick: () => c("top"),
672
- title: T("printing.editor.alignTop", "Align top"),
680
+ onClick: () => h("top"),
681
+ title: D("printing.editor.alignTop", "Align top"),
673
682
  children: "⊤"
674
683
  }
675
684
  ),
@@ -677,8 +686,8 @@ const Ma = ({
677
686
  "button",
678
687
  {
679
688
  className: t.toolbarBtn,
680
- onClick: () => c("center"),
681
- title: T("printing.editor.alignMiddle", "Align middle"),
689
+ onClick: () => h("center"),
690
+ title: D("printing.editor.alignMiddle", "Align middle"),
682
691
  children: "⊕"
683
692
  }
684
693
  ),
@@ -686,8 +695,8 @@ const Ma = ({
686
695
  "button",
687
696
  {
688
697
  className: t.toolbarBtn,
689
- onClick: () => c("bottom"),
690
- title: T("printing.editor.alignBottom", "Align bottom"),
698
+ onClick: () => h("bottom"),
699
+ title: D("printing.editor.alignBottom", "Align bottom"),
691
700
  children: "⊥"
692
701
  }
693
702
  ),
@@ -696,18 +705,18 @@ const Ma = ({
696
705
  "button",
697
706
  {
698
707
  className: t.toolbarBtn,
699
- onClick: F,
700
- title: x("templateEditor.bringForward", "Bring forward"),
701
- children: /* @__PURE__ */ e(S, { name: "arrow-up", size: 14 })
708
+ onClick: z,
709
+ title: T("templateEditor.bringForward", "Bring forward"),
710
+ children: /* @__PURE__ */ e(v, { name: "arrow-up", size: 14 })
702
711
  }
703
712
  ),
704
713
  /* @__PURE__ */ e(
705
714
  "button",
706
715
  {
707
716
  className: t.toolbarBtn,
708
- onClick: v,
709
- title: T("printing.editor.sendBackward", "Send backward"),
710
- children: /* @__PURE__ */ e(S, { name: "arrow-down", size: 14 })
717
+ onClick: y,
718
+ title: D("printing.editor.sendBackward", "Send backward"),
719
+ children: /* @__PURE__ */ e(v, { name: "arrow-down", size: 14 })
711
720
  }
712
721
  )
713
722
  ] }),
@@ -715,9 +724,9 @@ const Ma = ({
715
724
  /* @__PURE__ */ e(
716
725
  "button",
717
726
  {
718
- className: `${t.toolbarBtn} ${B ? t.toolbarBtnActive : ""}`,
719
- onClick: C,
720
- title: T("printing.editor.grid", "Grid"),
727
+ className: `${t.toolbarBtn} ${C ? t.toolbarBtnActive : ""}`,
728
+ onClick: S,
729
+ title: D("printing.editor.grid", "Grid"),
721
730
  children: "⊞"
722
731
  }
723
732
  ),
@@ -725,130 +734,136 @@ const Ma = ({
725
734
  "button",
726
735
  {
727
736
  className: `${t.toolbarBtn} ${N ? t.toolbarBtnActive : ""}`,
728
- onClick: z,
729
- title: T("printing.editor.rulers", "Rulers"),
730
- children: /* @__PURE__ */ e(S, { name: "ruler", size: 14 })
737
+ onClick: I,
738
+ title: D("printing.editor.rulers", "Rulers"),
739
+ children: /* @__PURE__ */ e(v, { name: "ruler", size: 14 })
731
740
  }
732
741
  )
733
742
  ] }),
734
743
  /* @__PURE__ */ a("div", { className: t.toolbarGroup, children: [
735
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => _(Math.max(0.25, s - 0.1)), children: "−" }),
744
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(Math.max(0.25, o - 0.1)), children: "−" }),
736
745
  /* @__PURE__ */ e(
737
746
  "select",
738
747
  {
739
748
  className: t.zoomSelect,
740
- value: Z.includes(s) ? s : "",
741
- onChange: (w) => _(+w.target.value),
742
- children: Z.map((w) => /* @__PURE__ */ a("option", { value: w, children: [
743
- Math.round(w * 100),
749
+ value: P.includes(o) ? o : "",
750
+ onChange: (b) => k(+b.target.value),
751
+ children: P.map((b) => /* @__PURE__ */ a("option", { value: b, children: [
752
+ Math.round(b * 100),
744
753
  "%"
745
- ] }, w))
754
+ ] }, b))
746
755
  }
747
756
  ),
748
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => _(Math.min(3, s + 0.1)), children: "+" }),
749
- /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => _(1), title: "100%", children: "⊡" })
757
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(Math.min(3, o + 0.1)), children: "+" }),
758
+ /* @__PURE__ */ e("button", { className: t.toolbarBtn, onClick: () => k(1), title: "100%", children: "⊡" })
750
759
  ] }),
751
- !b && D && /* @__PURE__ */ a("button", { className: t.saveBtn, onClick: D, children: [
752
- /* @__PURE__ */ e(S, { name: "save", size: 14 }),
760
+ !_ && R && /* @__PURE__ */ a("button", { className: t.saveBtn, onClick: R, children: [
761
+ /* @__PURE__ */ e(v, { name: "save", size: 14 }),
753
762
  " ",
754
- T("printing.editor.save", "Save")
763
+ D("printing.editor.save", "Save")
755
764
  ] })
756
765
  ] });
757
- }, Oa = ({
766
+ }, ja = ({
758
767
  activeTab: n,
759
- onTabChange: s,
760
- schema: m,
761
- tpl: o,
762
- allFields: B,
768
+ onTabChange: o,
769
+ schema: d,
770
+ tpl: l,
771
+ allFields: C,
763
772
  selectedIds: N,
764
- onInsertSchemaField: b,
765
- onSelectField: h,
766
- onUpdateTpl: g,
767
- onReorderField: _
773
+ onInsertSchemaField: _,
774
+ onSelectField: g,
775
+ onUpdateTpl: f,
776
+ onReorderField: k
768
777
  }) => {
769
- const { t: l } = X(), { t: f } = X(), [C, z] = H(""), y = m == null ? void 0 : m.fields.filter(
770
- (r) => r.label.toLowerCase().includes(C.toLowerCase()) || r.path.toLowerCase().includes(C.toLowerCase())
778
+ const { t: u } = j(), { t: r } = j(), [S, I] = H(""), x = d == null ? void 0 : d.fields.filter(
779
+ (s) => s.label.toLowerCase().includes(S.toLowerCase()) || s.path.toLowerCase().includes(S.toLowerCase())
771
780
  );
772
781
  return /* @__PURE__ */ a("div", { className: t.leftPanel, children: [
773
- /* @__PURE__ */ e("div", { className: t.leftTabs, children: Fa.map((r) => /* @__PURE__ */ a(
782
+ /* @__PURE__ */ e("div", { className: t.leftTabs, children: Wa.map((s) => /* @__PURE__ */ a(
774
783
  "button",
775
784
  {
776
- className: `${t.leftTab} ${n === r.id ? t.leftTabActive : ""}`,
777
- onClick: () => s(r.id),
778
- title: f(r.key, r.label),
785
+ className: `${t.leftTab} ${n === s.id ? t.leftTabActive : ""}`,
786
+ onClick: () => o(s.id),
787
+ title: r(s.key, s.label),
779
788
  children: [
780
- /* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(S, { name: r.icon, size: 16 }) }),
781
- /* @__PURE__ */ e("span", { className: t.leftTabLabel, children: f(r.key, r.label) })
789
+ /* @__PURE__ */ e("span", { className: t.leftTabIcon, children: /* @__PURE__ */ e(v, { name: s.icon, size: 16 }) }),
790
+ /* @__PURE__ */ e("span", { className: t.leftTabLabel, children: r(s.key, s.label) })
782
791
  ]
783
792
  },
784
- r.id
793
+ s.id
785
794
  )) }),
786
795
  /* @__PURE__ */ a("div", { className: t.leftContent, children: [
787
- n === "fields" && /* @__PURE__ */ a(V, { children: [
788
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: f("printing.editor.dataFields", "Data fields") }),
796
+ n === "fields" && /* @__PURE__ */ a(J, { children: [
797
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: r("printing.editor.dataFields", "Data fields") }),
789
798
  /* @__PURE__ */ e("div", { className: t.searchBox, children: /* @__PURE__ */ e(
790
799
  "input",
791
800
  {
792
801
  className: t.searchInput,
793
- placeholder: f("printing.editor.search", "Search…"),
794
- value: C,
795
- onChange: (r) => z(r.target.value)
802
+ placeholder: r("printing.editor.search", "Search…"),
803
+ value: S,
804
+ onChange: (s) => I(s.target.value)
796
805
  }
797
806
  ) }),
798
- m ? /* @__PURE__ */ a("div", { className: t.fieldList, children: [
799
- (y ?? []).map((r) => /* @__PURE__ */ a(
807
+ d ? /* @__PURE__ */ a("div", { className: t.fieldList, children: [
808
+ (x ?? []).map((s) => /* @__PURE__ */ a(
800
809
  "div",
801
810
  {
811
+ role: "button",
812
+ tabIndex: 0,
813
+ onKeyDown: we,
802
814
  className: t.fieldItem,
803
815
  draggable: !0,
804
816
  onDragStart: (i) => {
805
- i.dataTransfer.setData("fieldPath", r.path), i.dataTransfer.setData("fieldLabel", r.label), i.dataTransfer.setData("fieldType", r.type);
817
+ i.dataTransfer.setData("fieldPath", s.path), i.dataTransfer.setData("fieldLabel", s.label), i.dataTransfer.setData("fieldType", s.type);
806
818
  },
807
- onClick: () => b(r),
819
+ onClick: () => _(s),
808
820
  children: [
809
- /* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: /* @__PURE__ */ e(S, { name: he[r.type] ?? "type", size: 14 }) }),
821
+ /* @__PURE__ */ e("span", { className: t.fieldItemIcon, children: /* @__PURE__ */ e(v, { name: he[s.type] ?? "type", size: 14 }) }),
810
822
  /* @__PURE__ */ a("div", { className: t.fieldItemInfo, children: [
811
- /* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: r.label }),
812
- /* @__PURE__ */ e("div", { className: t.fieldItemPath, children: r.path })
823
+ /* @__PURE__ */ e("div", { className: t.fieldItemLabel, children: s.label }),
824
+ /* @__PURE__ */ e("div", { className: t.fieldItemPath, children: s.path })
813
825
  ] }),
814
- /* @__PURE__ */ e("span", { className: t.fieldItemType, children: r.type })
826
+ /* @__PURE__ */ e("span", { className: t.fieldItemType, children: s.type })
815
827
  ]
816
828
  },
817
- r.path
829
+ s.path
818
830
  )),
819
- (y == null ? void 0 : y.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: f("printing.editor.noMatches", "No matches") })
820
- ] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: f(
831
+ (x == null ? void 0 : x.length) === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r("printing.editor.noMatches", "No matches") })
832
+ ] }) : /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r(
821
833
  "printing.editor.noSchema",
822
834
  "No data schema. Assign an entity in the Settings tab."
823
835
  ) })
824
836
  ] }),
825
- n === "layers" && /* @__PURE__ */ a(V, { children: [
837
+ n === "layers" && /* @__PURE__ */ a(J, { children: [
826
838
  /* @__PURE__ */ a("div", { className: t.panelHeader, children: [
827
- f("printing.editor.layers", "Layers"),
839
+ r("printing.editor.layers", "Layers"),
828
840
  " (",
829
- B.length,
841
+ C.length,
830
842
  ")"
831
843
  ] }),
832
844
  /* @__PURE__ */ a("div", { className: t.layerList, children: [
833
- B.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: f("printing.editor.noElements", "No elements") }),
834
- B.slice().reverse().map((r) => /* @__PURE__ */ a(
845
+ C.length === 0 && /* @__PURE__ */ e("div", { className: t.emptyMsg, children: r("printing.editor.noElements", "No elements") }),
846
+ C.slice().reverse().map((s) => /* @__PURE__ */ a(
835
847
  "div",
836
848
  {
837
- className: `${t.layerItem} ${N.has(r.id) ? t.layerItemSelected : ""}`,
838
- onClick: () => h(r.id),
849
+ role: "button",
850
+ tabIndex: 0,
851
+ onKeyDown: we,
852
+ className: `${t.layerItem} ${N.has(s.id) ? t.layerItemSelected : ""}`,
853
+ onClick: () => g(s.id),
839
854
  children: [
840
- /* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(S, { name: he[r.type] ?? "type", size: 14 }) }),
841
- /* @__PURE__ */ e("span", { className: t.layerName, children: r.name || r.label }),
855
+ /* @__PURE__ */ e("span", { className: t.layerIcon, children: /* @__PURE__ */ e(v, { name: he[s.type] ?? "type", size: 14 }) }),
856
+ /* @__PURE__ */ e("span", { className: t.layerName, children: s.name || s.label }),
842
857
  /* @__PURE__ */ a("div", { className: t.layerActions, children: [
843
858
  /* @__PURE__ */ e(
844
859
  "button",
845
860
  {
846
861
  className: t.layerBtn,
847
862
  onClick: (i) => {
848
- i.stopPropagation(), _(r.id, -1);
863
+ i.stopPropagation(), k(s.id, -1);
849
864
  },
850
- title: f("printing.editor.bringForward", "Bring forward"),
851
- children: /* @__PURE__ */ e(S, { name: "arrow-up", size: 12 })
865
+ title: r("printing.editor.bringForward", "Bring forward"),
866
+ children: /* @__PURE__ */ e(v, { name: "arrow-up", size: 12 })
852
867
  }
853
868
  ),
854
869
  /* @__PURE__ */ e(
@@ -856,57 +871,57 @@ const Ma = ({
856
871
  {
857
872
  className: t.layerBtn,
858
873
  onClick: (i) => {
859
- i.stopPropagation(), _(r.id, 1);
874
+ i.stopPropagation(), k(s.id, 1);
860
875
  },
861
- title: f("printing.editor.sendBackward", "Send backward"),
862
- children: /* @__PURE__ */ e(S, { name: "arrow-down", size: 12 })
876
+ title: r("printing.editor.sendBackward", "Send backward"),
877
+ children: /* @__PURE__ */ e(v, { name: "arrow-down", size: 12 })
863
878
  }
864
879
  )
865
880
  ] })
866
881
  ]
867
882
  },
868
- r.id
883
+ s.id
869
884
  ))
870
885
  ] })
871
886
  ] }),
872
- n === "watermarks" && /* @__PURE__ */ a(V, { children: [
873
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: l("templateEditor.watermarks", "Watermarks") }),
887
+ n === "watermarks" && /* @__PURE__ */ a(J, { children: [
888
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: u("templateEditor.watermarks", "Watermarks") }),
874
889
  /* @__PURE__ */ a("div", { className: t.wmList, children: [
875
- (o.watermarks ?? []).map((r) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
890
+ (l.watermarks ?? []).map((s) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
876
891
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
877
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.type", "Type") }),
892
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.type", "Type") }),
878
893
  /* @__PURE__ */ a(
879
894
  "select",
880
895
  {
881
896
  className: t.wmSelect,
882
- value: r.type,
897
+ value: s.type,
883
898
  onChange: (i) => {
884
- var u;
885
- return g({
886
- watermarks: (u = o.watermarks) == null ? void 0 : u.map(
887
- (c) => c.id === r.id ? { ...c, type: i.target.value } : c
899
+ var m;
900
+ return f({
901
+ watermarks: (m = l.watermarks) == null ? void 0 : m.map(
902
+ (h) => h.id === s.id ? { ...h, type: i.target.value } : h
888
903
  )
889
904
  });
890
905
  },
891
906
  children: [
892
- /* @__PURE__ */ e("option", { value: "text", children: f("printing.fieldType.text", "Text") }),
893
- /* @__PURE__ */ e("option", { value: "image", children: f("printing.fieldType.image", "Image") })
907
+ /* @__PURE__ */ e("option", { value: "text", children: r("printing.fieldType.text", "Text") }),
908
+ /* @__PURE__ */ e("option", { value: "image", children: r("printing.fieldType.image", "Image") })
894
909
  ]
895
910
  }
896
911
  )
897
912
  ] }),
898
- r.type === "text" && /* @__PURE__ */ a("div", { className: t.wmRow, children: [
899
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.fieldType.text", "Text") }),
913
+ s.type === "text" && /* @__PURE__ */ a("div", { className: t.wmRow, children: [
914
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.fieldType.text", "Text") }),
900
915
  /* @__PURE__ */ e(
901
916
  "input",
902
917
  {
903
918
  className: t.wmInput,
904
- value: r.text ?? "",
919
+ value: s.text ?? "",
905
920
  onChange: (i) => {
906
- var u;
907
- return g({
908
- watermarks: (u = o.watermarks) == null ? void 0 : u.map(
909
- (c) => c.id === r.id ? { ...c, text: i.target.value } : c
921
+ var m;
922
+ return f({
923
+ watermarks: (m = l.watermarks) == null ? void 0 : m.map(
924
+ (h) => h.id === s.id ? { ...h, text: i.target.value } : h
910
925
  )
911
926
  });
912
927
  }
@@ -914,7 +929,7 @@ const Ma = ({
914
929
  )
915
930
  ] }),
916
931
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
917
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: l("templateEditor.opacity", "Opacity") }),
932
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: u("templateEditor.opacity", "Opacity") }),
918
933
  /* @__PURE__ */ e(
919
934
  "input",
920
935
  {
@@ -923,24 +938,24 @@ const Ma = ({
923
938
  max: 0.5,
924
939
  step: 0.01,
925
940
  className: t.wmSlider,
926
- value: r.opacity,
941
+ value: s.opacity,
927
942
  onChange: (i) => {
928
- var u;
929
- return g({
930
- watermarks: (u = o.watermarks) == null ? void 0 : u.map(
931
- (c) => c.id === r.id ? { ...c, opacity: +i.target.value } : c
943
+ var m;
944
+ return f({
945
+ watermarks: (m = l.watermarks) == null ? void 0 : m.map(
946
+ (h) => h.id === s.id ? { ...h, opacity: +i.target.value } : h
932
947
  )
933
948
  });
934
949
  }
935
950
  }
936
951
  ),
937
952
  /* @__PURE__ */ a("span", { className: t.wmValue, children: [
938
- Math.round(r.opacity * 100),
953
+ Math.round(s.opacity * 100),
939
954
  "%"
940
955
  ] })
941
956
  ] }),
942
957
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
943
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.angle", "Angle") }),
958
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.angle", "Angle") }),
944
959
  /* @__PURE__ */ e(
945
960
  "input",
946
961
  {
@@ -949,24 +964,24 @@ const Ma = ({
949
964
  max: 90,
950
965
  step: 5,
951
966
  className: t.wmSlider,
952
- value: r.angle,
967
+ value: s.angle,
953
968
  onChange: (i) => {
954
- var u;
955
- return g({
956
- watermarks: (u = o.watermarks) == null ? void 0 : u.map(
957
- (c) => c.id === r.id ? { ...c, angle: +i.target.value } : c
969
+ var m;
970
+ return f({
971
+ watermarks: (m = l.watermarks) == null ? void 0 : m.map(
972
+ (h) => h.id === s.id ? { ...h, angle: +i.target.value } : h
958
973
  )
959
974
  });
960
975
  }
961
976
  }
962
977
  ),
963
978
  /* @__PURE__ */ a("span", { className: t.wmValue, children: [
964
- r.angle,
979
+ s.angle,
965
980
  "°"
966
981
  ] })
967
982
  ] }),
968
983
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
969
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.size", "Size") }),
984
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.size", "Size") }),
970
985
  /* @__PURE__ */ e(
971
986
  "input",
972
987
  {
@@ -974,12 +989,12 @@ const Ma = ({
974
989
  min: 8,
975
990
  max: 200,
976
991
  className: t.wmInputNum,
977
- value: r.fontSize ?? 48,
992
+ value: s.fontSize ?? 48,
978
993
  onChange: (i) => {
979
- var u;
980
- return g({
981
- watermarks: (u = o.watermarks) == null ? void 0 : u.map(
982
- (c) => c.id === r.id ? { ...c, fontSize: +i.target.value } : c
994
+ var m;
995
+ return f({
996
+ watermarks: (m = l.watermarks) == null ? void 0 : m.map(
997
+ (h) => h.id === s.id ? { ...h, fontSize: +i.target.value } : h
983
998
  )
984
999
  });
985
1000
  }
@@ -988,18 +1003,18 @@ const Ma = ({
988
1003
  /* @__PURE__ */ e("span", { className: t.wmUnit, children: "pt" })
989
1004
  ] }),
990
1005
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
991
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.colour", "Colour") }),
1006
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.colour", "Colour") }),
992
1007
  /* @__PURE__ */ e(
993
1008
  "input",
994
1009
  {
995
1010
  type: "color",
996
1011
  className: t.colorPicker,
997
- value: r.color ?? ge,
1012
+ value: s.color ?? be,
998
1013
  onChange: (i) => {
999
- var u;
1000
- return g({
1001
- watermarks: (u = o.watermarks) == null ? void 0 : u.map(
1002
- (c) => c.id === r.id ? { ...c, color: i.target.value } : c
1014
+ var m;
1015
+ return f({
1016
+ watermarks: (m = l.watermarks) == null ? void 0 : m.map(
1017
+ (h) => h.id === s.id ? { ...h, color: i.target.value } : h
1003
1018
  )
1004
1019
  });
1005
1020
  }
@@ -1012,55 +1027,55 @@ const Ma = ({
1012
1027
  className: t.wmDelete,
1013
1028
  onClick: () => {
1014
1029
  var i;
1015
- return g({ watermarks: (i = o.watermarks) == null ? void 0 : i.filter((u) => u.id !== r.id) });
1030
+ return f({ watermarks: (i = l.watermarks) == null ? void 0 : i.filter((m) => m.id !== s.id) });
1016
1031
  },
1017
- children: f("printing.action.remove", "Remove")
1032
+ children: r("printing.action.remove", "Remove")
1018
1033
  }
1019
1034
  )
1020
- ] }, r.id)),
1035
+ ] }, s.id)),
1021
1036
  /* @__PURE__ */ a(
1022
1037
  "button",
1023
1038
  {
1024
1039
  className: t.addBtn,
1025
- onClick: () => g({
1040
+ onClick: () => f({
1026
1041
  watermarks: [
1027
- ...o.watermarks ?? [],
1042
+ ...l.watermarks ?? [],
1028
1043
  {
1029
1044
  id: ce(),
1030
1045
  type: "text",
1031
- text: "COPY",
1046
+ text: u("templateEditor.copy", "COPY"),
1032
1047
  opacity: 0.12,
1033
1048
  angle: -45,
1034
1049
  fontSize: 60,
1035
- color: ge
1050
+ color: be
1036
1051
  }
1037
1052
  ]
1038
1053
  }),
1039
1054
  children: [
1040
- /* @__PURE__ */ e(S, { name: "plus", size: 12 }),
1055
+ /* @__PURE__ */ e(v, { name: "plus", size: 12 }),
1041
1056
  " ",
1042
- f("printing.editor.addWatermark", "Add watermark")
1057
+ r("printing.editor.addWatermark", "Add watermark")
1043
1058
  ]
1044
1059
  }
1045
1060
  )
1046
1061
  ] })
1047
1062
  ] }),
1048
- n === "signatures" && /* @__PURE__ */ a(V, { children: [
1049
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: l("templateEditor.signatures", "Signatures") }),
1063
+ n === "signatures" && /* @__PURE__ */ a(J, { children: [
1064
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: u("templateEditor.signatures", "Signatures") }),
1050
1065
  /* @__PURE__ */ a("div", { className: t.wmList, children: [
1051
- (o.signatures ?? []).map((r) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
1066
+ (l.signatures ?? []).map((s) => /* @__PURE__ */ a("div", { className: t.wmItem, children: [
1052
1067
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1053
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: l("templateEditor.label", "Label") }),
1068
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: u("templateEditor.label", "Label") }),
1054
1069
  /* @__PURE__ */ e(
1055
1070
  "input",
1056
1071
  {
1057
1072
  className: t.wmInput,
1058
- value: r.label,
1073
+ value: s.label,
1059
1074
  onChange: (i) => {
1060
- var u;
1061
- return g({
1062
- signatures: (u = o.signatures) == null ? void 0 : u.map(
1063
- (c) => c.id === r.id ? { ...c, label: i.target.value } : c
1075
+ var m;
1076
+ return f({
1077
+ signatures: (m = l.signatures) == null ? void 0 : m.map(
1078
+ (h) => h.id === s.id ? { ...h, label: i.target.value } : h
1064
1079
  )
1065
1080
  });
1066
1081
  }
@@ -1068,17 +1083,17 @@ const Ma = ({
1068
1083
  )
1069
1084
  ] }),
1070
1085
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1071
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: l("templateEditor.signerName", "Name") }),
1086
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: u("templateEditor.signerName", "Name") }),
1072
1087
  /* @__PURE__ */ e(
1073
1088
  "input",
1074
1089
  {
1075
1090
  className: t.wmInput,
1076
- value: r.signerName ?? "",
1091
+ value: s.signerName ?? "",
1077
1092
  onChange: (i) => {
1078
- var u;
1079
- return g({
1080
- signatures: (u = o.signatures) == null ? void 0 : u.map(
1081
- (c) => c.id === r.id ? { ...c, signerName: i.target.value } : c
1093
+ var m;
1094
+ return f({
1095
+ signatures: (m = l.signatures) == null ? void 0 : m.map(
1096
+ (h) => h.id === s.id ? { ...h, signerName: i.target.value } : h
1082
1097
  )
1083
1098
  });
1084
1099
  }
@@ -1086,17 +1101,17 @@ const Ma = ({
1086
1101
  )
1087
1102
  ] }),
1088
1103
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1089
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.fieldType.line", "Line") }),
1104
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.fieldType.line", "Line") }),
1090
1105
  /* @__PURE__ */ e(
1091
1106
  "input",
1092
1107
  {
1093
1108
  type: "checkbox",
1094
- checked: r.showLine ?? !0,
1109
+ checked: s.showLine ?? !0,
1095
1110
  onChange: (i) => {
1096
- var u;
1097
- return g({
1098
- signatures: (u = o.signatures) == null ? void 0 : u.map(
1099
- (c) => c.id === r.id ? { ...c, showLine: i.target.checked } : c
1111
+ var m;
1112
+ return f({
1113
+ signatures: (m = l.signatures) == null ? void 0 : m.map(
1114
+ (h) => h.id === s.id ? { ...h, showLine: i.target.checked } : h
1100
1115
  )
1101
1116
  });
1102
1117
  }
@@ -1104,17 +1119,17 @@ const Ma = ({
1104
1119
  )
1105
1120
  ] }),
1106
1121
  /* @__PURE__ */ a("div", { className: t.wmRow, children: [
1107
- /* @__PURE__ */ e("span", { className: t.wmLabel, children: f("printing.editor.showDate", "Show date") }),
1122
+ /* @__PURE__ */ e("span", { className: t.wmLabel, children: r("printing.editor.showDate", "Show date") }),
1108
1123
  /* @__PURE__ */ e(
1109
1124
  "input",
1110
1125
  {
1111
1126
  type: "checkbox",
1112
- checked: r.showDate ?? !1,
1127
+ checked: s.showDate ?? !1,
1113
1128
  onChange: (i) => {
1114
- var u;
1115
- return g({
1116
- signatures: (u = o.signatures) == null ? void 0 : u.map(
1117
- (c) => c.id === r.id ? { ...c, showDate: i.target.checked } : c
1129
+ var m;
1130
+ return f({
1131
+ signatures: (m = l.signatures) == null ? void 0 : m.map(
1132
+ (h) => h.id === s.id ? { ...h, showDate: i.target.checked } : h
1118
1133
  )
1119
1134
  });
1120
1135
  }
@@ -1127,22 +1142,22 @@ const Ma = ({
1127
1142
  className: t.wmDelete,
1128
1143
  onClick: () => {
1129
1144
  var i;
1130
- return g({ signatures: (i = o.signatures) == null ? void 0 : i.filter((u) => u.id !== r.id) });
1145
+ return f({ signatures: (i = l.signatures) == null ? void 0 : i.filter((m) => m.id !== s.id) });
1131
1146
  },
1132
- children: f("printing.action.remove", "Remove")
1147
+ children: r("printing.action.remove", "Remove")
1133
1148
  }
1134
1149
  )
1135
- ] }, r.id)),
1150
+ ] }, s.id)),
1136
1151
  /* @__PURE__ */ a(
1137
1152
  "button",
1138
1153
  {
1139
1154
  className: t.addBtn,
1140
- onClick: () => g({
1155
+ onClick: () => f({
1141
1156
  signatures: [
1142
- ...o.signatures ?? [],
1157
+ ...l.signatures ?? [],
1143
1158
  {
1144
1159
  id: ce(),
1145
- label: f("printing.editor.signature", "Signature"),
1160
+ label: r("printing.editor.signature", "Signature"),
1146
1161
  position: { x: 10, y: 5, width: 70, height: 22 },
1147
1162
  showLine: !0,
1148
1163
  showDate: !1
@@ -1150,54 +1165,54 @@ const Ma = ({
1150
1165
  ]
1151
1166
  }),
1152
1167
  children: [
1153
- /* @__PURE__ */ e(S, { name: "plus", size: 12 }),
1168
+ /* @__PURE__ */ e(v, { name: "plus", size: 12 }),
1154
1169
  " ",
1155
- f("printing.editor.addSignature", "Add signature")
1170
+ r("printing.editor.addSignature", "Add signature")
1156
1171
  ]
1157
1172
  }
1158
1173
  )
1159
1174
  ] })
1160
1175
  ] }),
1161
- n === "settings" && /* @__PURE__ */ a(V, { children: [
1162
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: f("printing.editor.templateSettings", "Template settings") }),
1176
+ n === "settings" && /* @__PURE__ */ a(J, { children: [
1177
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: r("printing.editor.templateSettings", "Template settings") }),
1163
1178
  /* @__PURE__ */ a("div", { className: t.settingsForm, children: [
1164
1179
  /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1165
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: f("printing.editor.name", "Name") }),
1180
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r("printing.editor.name", "Name") }),
1166
1181
  /* @__PURE__ */ e(
1167
1182
  "input",
1168
1183
  {
1169
1184
  className: t.settingsInput,
1170
- value: o.name,
1171
- onChange: (r) => g({ name: r.target.value })
1185
+ value: l.name,
1186
+ onChange: (s) => f({ name: s.target.value })
1172
1187
  }
1173
1188
  )
1174
1189
  ] }),
1175
1190
  /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1176
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: f("printing.editor.description", "Description") }),
1191
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r("printing.editor.description", "Description") }),
1177
1192
  /* @__PURE__ */ e(
1178
1193
  "textarea",
1179
1194
  {
1180
1195
  className: t.settingsTextarea,
1181
- value: o.description ?? "",
1182
- onChange: (r) => g({ description: r.target.value }),
1196
+ value: l.description ?? "",
1197
+ onChange: (s) => f({ description: s.target.value }),
1183
1198
  rows: 2
1184
1199
  }
1185
1200
  )
1186
1201
  ] }),
1187
1202
  /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1188
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: l("templateEditor.category", "Category") }),
1203
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: u("templateEditor.category", "Category") }),
1189
1204
  /* @__PURE__ */ e(
1190
1205
  "input",
1191
1206
  {
1192
1207
  className: t.settingsInput,
1193
- value: o.category ?? "",
1194
- onChange: (r) => g({ category: r.target.value })
1208
+ value: l.category ?? "",
1209
+ onChange: (s) => f({ category: s.target.value })
1195
1210
  }
1196
1211
  )
1197
1212
  ] }),
1198
- /* @__PURE__ */ e("div", { className: t.settingsDivider, children: f("printing.editor.margins", "Margins (mm)") }),
1199
- ["top", "right", "bottom", "left"].map((r) => /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1200
- /* @__PURE__ */ e("label", { className: t.settingsLabel, children: r === "top" ? f("printing.editor.marginTop", "Top") : r === "right" ? f("printing.editor.marginRight", "Right") : r === "bottom" ? f("printing.editor.marginBottom", "Bottom") : f("printing.editor.marginLeft", "Left") }),
1213
+ /* @__PURE__ */ e("div", { className: t.settingsDivider, children: r("printing.editor.margins", "Margins (mm)") }),
1214
+ ["top", "right", "bottom", "left"].map((s) => /* @__PURE__ */ a("div", { className: t.settingsRow, children: [
1215
+ /* @__PURE__ */ e("label", { className: t.settingsLabel, children: s === "top" ? r("printing.editor.marginTop", "Top") : s === "right" ? r("printing.editor.marginRight", "Right") : s === "bottom" ? r("printing.editor.marginBottom", "Bottom") : r("printing.editor.marginLeft", "Left") }),
1201
1216
  /* @__PURE__ */ e(
1202
1217
  "input",
1203
1218
  {
@@ -1206,51 +1221,51 @@ const Ma = ({
1206
1221
  max: 50,
1207
1222
  step: 1,
1208
1223
  className: t.settingsInputNum,
1209
- value: o.margins[r],
1210
- onChange: (i) => g({ margins: { ...o.margins, [r]: +i.target.value } })
1224
+ value: l.margins[s],
1225
+ onChange: (i) => f({ margins: { ...l.margins, [s]: +i.target.value } })
1211
1226
  }
1212
1227
  ),
1213
- /* @__PURE__ */ e("span", { className: t.settingsUnit, children: "mm" })
1214
- ] }, r))
1228
+ /* @__PURE__ */ e("span", { className: t.settingsUnit, children: u("templateEditor.mm", "mm") })
1229
+ ] }, s))
1215
1230
  ] })
1216
1231
  ] })
1217
1232
  ] })
1218
1233
  ] });
1219
- }, qa = ({
1234
+ }, Va = ({
1220
1235
  field: n,
1221
- activeTab: s,
1222
- onTabChange: m,
1223
- onChange: o,
1224
- paperWidthMm: B,
1236
+ activeTab: o,
1237
+ onTabChange: d,
1238
+ onChange: l,
1239
+ paperWidthMm: C,
1225
1240
  paperHeightMm: N
1226
1241
  }) => {
1227
- var C, z, y, r;
1228
- const { t: b } = X(), { t: h } = X(), g = E(
1229
- (i) => n && o({ position: { ...n.position, ...i } }),
1230
- [n, o]
1231
- ), _ = E(
1232
- (i) => n && o({ style: { ...(n == null ? void 0 : n.style) ?? {}, ...i } }),
1233
- [n, o]
1242
+ var S, I, x, s;
1243
+ const { t: _ } = j(), { t: g } = j(), f = M(
1244
+ (i) => n && l({ position: { ...n.position, ...i } }),
1245
+ [n, l]
1246
+ ), k = M(
1247
+ (i) => n && l({ style: { ...(n == null ? void 0 : n.style) ?? {}, ...i } }),
1248
+ [n, l]
1234
1249
  );
1235
1250
  if (!n)
1236
1251
  return /* @__PURE__ */ a("div", { className: t.rightPanel, children: [
1237
- /* @__PURE__ */ e("div", { className: t.panelHeader, children: h("printing.editor.properties", "Properties") }),
1252
+ /* @__PURE__ */ e("div", { className: t.panelHeader, children: g("printing.editor.properties", "Properties") }),
1238
1253
  /* @__PURE__ */ a("div", { className: t.propsEmpty, children: [
1239
- /* @__PURE__ */ e("div", { className: t.propsEmptyIcon, children: /* @__PURE__ */ e(S, { name: "cursor", size: 28 }) }),
1240
- /* @__PURE__ */ e("div", { className: t.propsEmptyText, children: h("printing.editor.selectElement", "Select an element on the template") }),
1254
+ /* @__PURE__ */ e("div", { className: t.propsEmptyIcon, children: /* @__PURE__ */ e(v, { name: "cursor", size: 28 }) }),
1255
+ /* @__PURE__ */ e("div", { className: t.propsEmptyText, children: g("printing.editor.selectElement", "Select an element on the template") }),
1241
1256
  /* @__PURE__ */ a("div", { className: t.shortcutGrid, children: [
1242
- /* @__PURE__ */ e(le, { keys: "Del", label: h("printing.action.remove", "Remove") }),
1243
- /* @__PURE__ */ e(le, { keys: "Ctrl+D", label: h("printing.editor.duplicate", "Duplicate") }),
1244
- /* @__PURE__ */ e(le, { keys: "↑↓←→", label: h("printing.editor.move", "Move") }),
1245
- /* @__PURE__ */ e(le, { keys: "Ctrl+Z", label: h("printing.editor.undo", "Undo") }),
1246
- /* @__PURE__ */ e(le, { keys: "Ctrl+A", label: h("printing.editor.selectAll", "Select all") }),
1247
- /* @__PURE__ */ e(le, { keys: "Shift+↑", label: h("printing.editor.move5mm", "Move 5 mm") })
1257
+ /* @__PURE__ */ e(le, { keys: "Del", label: g("printing.action.remove", "Remove") }),
1258
+ /* @__PURE__ */ e(le, { keys: "Ctrl+D", label: g("printing.editor.duplicate", "Duplicate") }),
1259
+ /* @__PURE__ */ e(le, { keys: "↑↓←→", label: g("printing.editor.move", "Move") }),
1260
+ /* @__PURE__ */ e(le, { keys: "Ctrl+Z", label: g("printing.editor.undo", "Undo") }),
1261
+ /* @__PURE__ */ e(le, { keys: "Ctrl+A", label: g("printing.editor.selectAll", "Select all") }),
1262
+ /* @__PURE__ */ e(le, { keys: "Shift+↑", label: g("printing.editor.move5mm", "Move 5 mm") })
1248
1263
  ] })
1249
1264
  ] })
1250
1265
  ] });
1251
- const l = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
1266
+ const u = !["line", "rect", "image", "static_image", "barcode", "qr", "signature"].includes(
1252
1267
  n.type
1253
- ), f = ![
1268
+ ), r = ![
1254
1269
  "static_text",
1255
1270
  "static_image",
1256
1271
  "line",
@@ -1264,25 +1279,25 @@ const Ma = ({
1264
1279
  /* @__PURE__ */ e("span", { className: t.panelHeaderIcon, children: he[n.type] }),
1265
1280
  /* @__PURE__ */ e("span", { className: t.panelHeaderName, children: n.name })
1266
1281
  ] }),
1267
- /* @__PURE__ */ e("div", { className: t.rightTabs, children: Ha.map((i) => i.id === "data" && !f ? null : /* @__PURE__ */ e(
1282
+ /* @__PURE__ */ e("div", { className: t.rightTabs, children: Ya.map((i) => i.id === "data" && !r ? null : /* @__PURE__ */ e(
1268
1283
  "button",
1269
1284
  {
1270
- className: `${t.rightTab} ${s === i.id ? t.rightTabActive : ""}`,
1271
- onClick: () => m(i.id),
1272
- children: h(i.key, i.label)
1285
+ className: `${t.rightTab} ${o === i.id ? t.rightTabActive : ""}`,
1286
+ onClick: () => d(i.id),
1287
+ children: g(i.key, i.label)
1273
1288
  },
1274
1289
  i.id
1275
1290
  )) }),
1276
1291
  /* @__PURE__ */ a("div", { className: t.propsBody, children: [
1277
- s === "position" && /* @__PURE__ */ a(V, { children: [
1292
+ o === "position" && /* @__PURE__ */ a(J, { children: [
1278
1293
  /* @__PURE__ */ a("div", { className: t.posGrid, children: [
1279
1294
  [
1280
1295
  { key: "x", label: "X", unit: "mm" },
1281
1296
  { key: "y", label: "Y", unit: "mm" },
1282
- { key: "width", label: "Szer.", unit: "mm" },
1283
- { key: "height", label: "Wys.", unit: "mm" }
1284
- ].map(({ key: i, label: u, unit: c }) => /* @__PURE__ */ a("div", { className: t.posCell, children: [
1285
- /* @__PURE__ */ e("label", { className: t.posLabel, children: u }),
1297
+ { key: "width", label: _("templateEditor.widthShort", "W"), unit: "mm" },
1298
+ { key: "height", label: _("templateEditor.heightShort", "H"), unit: "mm" }
1299
+ ].map(({ key: i, label: m, unit: h }) => /* @__PURE__ */ a("div", { className: t.posCell, children: [
1300
+ /* @__PURE__ */ e("label", { className: t.posLabel, children: m }),
1286
1301
  /* @__PURE__ */ e(
1287
1302
  "input",
1288
1303
  {
@@ -1290,13 +1305,13 @@ const Ma = ({
1290
1305
  step: 0.5,
1291
1306
  className: t.posInput,
1292
1307
  value: Math.round(n.position[i] * 10) / 10,
1293
- onChange: (F) => g({ [i]: +F.target.value })
1308
+ onChange: (z) => f({ [i]: +z.target.value })
1294
1309
  }
1295
1310
  ),
1296
- /* @__PURE__ */ e("span", { className: t.posUnit, children: c })
1311
+ /* @__PURE__ */ e("span", { className: t.posUnit, children: h })
1297
1312
  ] }, i)),
1298
1313
  /* @__PURE__ */ a("div", { className: t.posCell, children: [
1299
- /* @__PURE__ */ e("label", { className: t.posLabel, children: h("printing.editor.rotation", "Rotation") }),
1314
+ /* @__PURE__ */ e("label", { className: t.posLabel, children: g("printing.editor.rotation", "Rotation") }),
1300
1315
  /* @__PURE__ */ e(
1301
1316
  "input",
1302
1317
  {
@@ -1304,13 +1319,13 @@ const Ma = ({
1304
1319
  step: 5,
1305
1320
  className: t.posInput,
1306
1321
  value: n.style.rotation ?? 0,
1307
- onChange: (i) => _({ rotation: +i.target.value })
1322
+ onChange: (i) => k({ rotation: +i.target.value })
1308
1323
  }
1309
1324
  ),
1310
1325
  /* @__PURE__ */ e("span", { className: t.posUnit, children: "°" })
1311
1326
  ] }),
1312
1327
  /* @__PURE__ */ a("div", { className: t.posCell, children: [
1313
- /* @__PURE__ */ e("label", { className: t.posLabel, children: b("templateEditor.zIdx", "Z-idx") }),
1328
+ /* @__PURE__ */ e("label", { className: t.posLabel, children: _("templateEditor.zIdx", "Z-idx") }),
1314
1329
  /* @__PURE__ */ e(
1315
1330
  "input",
1316
1331
  {
@@ -1319,29 +1334,29 @@ const Ma = ({
1319
1334
  min: 1,
1320
1335
  className: t.posInput,
1321
1336
  value: n.position.zIndex ?? 1,
1322
- onChange: (i) => g({ zIndex: +i.target.value })
1337
+ onChange: (i) => f({ zIndex: +i.target.value })
1323
1338
  }
1324
1339
  )
1325
1340
  ] })
1326
1341
  ] }),
1327
1342
  /* @__PURE__ */ a("div", { className: t.snapSection, children: [
1328
- /* @__PURE__ */ e("div", { className: t.snapTitle, children: h("printing.editor.snapToPage", "Snap to page") }),
1343
+ /* @__PURE__ */ e("div", { className: t.snapTitle, children: g("printing.editor.snapToPage", "Snap to page") }),
1329
1344
  /* @__PURE__ */ a("div", { className: t.snapRow, children: [
1330
1345
  /* @__PURE__ */ e(
1331
1346
  "button",
1332
1347
  {
1333
1348
  className: t.snapBtn,
1334
- onClick: () => g({ x: 0 }),
1335
- title: h("printing.editor.leftEdge", "Left edge"),
1336
- children: /* @__PURE__ */ e(S, { name: "align-left", size: 14 })
1349
+ onClick: () => f({ x: 0 }),
1350
+ title: g("printing.editor.leftEdge", "Left edge"),
1351
+ children: /* @__PURE__ */ e(v, { name: "align-left", size: 14 })
1337
1352
  }
1338
1353
  ),
1339
1354
  /* @__PURE__ */ e(
1340
1355
  "button",
1341
1356
  {
1342
1357
  className: t.snapBtn,
1343
- onClick: () => g({ x: (B - n.position.width) / 2 }),
1344
- title: h("printing.editor.horizontalCentre", "Horizontal centre"),
1358
+ onClick: () => f({ x: (C - n.position.width) / 2 }),
1359
+ title: g("printing.editor.horizontalCentre", "Horizontal centre"),
1345
1360
  children: "⊕"
1346
1361
  }
1347
1362
  ),
@@ -1349,38 +1364,38 @@ const Ma = ({
1349
1364
  "button",
1350
1365
  {
1351
1366
  className: t.snapBtn,
1352
- onClick: () => g({ x: B - n.position.width }),
1353
- title: h("printing.editor.rightEdge", "Right edge"),
1354
- children: /* @__PURE__ */ e(S, { name: "align-right", size: 14 })
1367
+ onClick: () => f({ x: C - n.position.width }),
1368
+ title: g("printing.editor.rightEdge", "Right edge"),
1369
+ children: /* @__PURE__ */ e(v, { name: "align-right", size: 14 })
1355
1370
  }
1356
1371
  )
1357
1372
  ] })
1358
1373
  ] })
1359
1374
  ] }),
1360
- s === "style" && /* @__PURE__ */ a(V, { children: [
1361
- l && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1362
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: b("templateEditor.font", "Font") }),
1375
+ o === "style" && /* @__PURE__ */ a(J, { children: [
1376
+ u && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1377
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: _("templateEditor.font", "Font") }),
1363
1378
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1364
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.fontFamily", "Family") }),
1379
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.fontFamily", "Family") }),
1365
1380
  /* @__PURE__ */ e(
1366
1381
  "select",
1367
1382
  {
1368
1383
  className: t.styleSelectFull,
1369
1384
  value: n.style.fontFamily ?? "sans-serif",
1370
- onChange: (i) => _({ fontFamily: i.target.value }),
1371
- children: $a.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1385
+ onChange: (i) => k({ fontFamily: i.target.value }),
1386
+ children: Ea.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1372
1387
  }
1373
1388
  )
1374
1389
  ] }),
1375
1390
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1376
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.size", "Size") }),
1391
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.size", "Size") }),
1377
1392
  /* @__PURE__ */ e(
1378
1393
  "select",
1379
1394
  {
1380
1395
  className: t.styleSelectSm,
1381
- value: xe.includes(n.style.fontSize ?? 10) ? n.style.fontSize ?? 10 : "",
1382
- onChange: (i) => _({ fontSize: +i.target.value }),
1383
- children: xe.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1396
+ value: Te.includes(n.style.fontSize ?? 10) ? n.style.fontSize ?? 10 : "",
1397
+ onChange: (i) => k({ fontSize: +i.target.value }),
1398
+ children: Te.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
1384
1399
  }
1385
1400
  ),
1386
1401
  /* @__PURE__ */ e(
@@ -1392,20 +1407,20 @@ const Ma = ({
1392
1407
  max: 200,
1393
1408
  className: t.styleInput,
1394
1409
  value: n.style.fontSize ?? 10,
1395
- onChange: (i) => _({ fontSize: +i.target.value })
1410
+ onChange: (i) => k({ fontSize: +i.target.value })
1396
1411
  }
1397
1412
  ),
1398
1413
  /* @__PURE__ */ e("span", { className: t.styleUnit, children: "pt" })
1399
1414
  ] }),
1400
1415
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1401
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.colour", "Colour") }),
1416
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.colour", "Colour") }),
1402
1417
  /* @__PURE__ */ e(
1403
1418
  "input",
1404
1419
  {
1405
1420
  type: "color",
1406
1421
  className: t.colorPicker,
1407
1422
  value: n.style.color ?? se,
1408
- onChange: (i) => _({ color: i.target.value })
1423
+ onChange: (i) => k({ color: i.target.value })
1409
1424
  }
1410
1425
  ),
1411
1426
  /* @__PURE__ */ e(
@@ -1413,19 +1428,19 @@ const Ma = ({
1413
1428
  {
1414
1429
  className: t.colorHex,
1415
1430
  value: n.style.color ?? se,
1416
- onChange: (i) => _({ color: i.target.value }),
1431
+ onChange: (i) => k({ color: i.target.value }),
1417
1432
  maxLength: 7
1418
1433
  }
1419
1434
  )
1420
1435
  ] }),
1421
1436
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1422
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.style", "Style") }),
1437
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.style", "Style") }),
1423
1438
  /* @__PURE__ */ a("div", { className: t.toggleGroup, children: [
1424
1439
  /* @__PURE__ */ e(
1425
1440
  "button",
1426
1441
  {
1427
1442
  className: `${t.toggleBtn} ${n.style.fontWeight === "bold" ? t.toggleBtnActive : ""}`,
1428
- onClick: () => _({ fontWeight: n.style.fontWeight === "bold" ? "normal" : "bold" }),
1443
+ onClick: () => k({ fontWeight: n.style.fontWeight === "bold" ? "normal" : "bold" }),
1429
1444
  children: /* @__PURE__ */ e("b", { children: "B" })
1430
1445
  }
1431
1446
  ),
@@ -1433,27 +1448,27 @@ const Ma = ({
1433
1448
  "button",
1434
1449
  {
1435
1450
  className: `${t.toggleBtn} ${n.style.fontStyle === "italic" ? t.toggleBtnActive : ""}`,
1436
- onClick: () => _({ fontStyle: n.style.fontStyle === "italic" ? "normal" : "italic" }),
1451
+ onClick: () => k({ fontStyle: n.style.fontStyle === "italic" ? "normal" : "italic" }),
1437
1452
  children: /* @__PURE__ */ e("i", { children: "I" })
1438
1453
  }
1439
1454
  )
1440
1455
  ] })
1441
1456
  ] }),
1442
1457
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1443
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.align", "Align") }),
1458
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.align", "Align") }),
1444
1459
  /* @__PURE__ */ e("div", { className: t.toggleGroup, children: ["left", "center", "right", "justify"].map((i) => /* @__PURE__ */ e(
1445
1460
  "button",
1446
1461
  {
1447
1462
  title: i,
1448
1463
  className: `${t.toggleBtn} ${(n.style.textAlign ?? "left") === i ? t.toggleBtnActive : ""}`,
1449
- onClick: () => _({ textAlign: i }),
1464
+ onClick: () => k({ textAlign: i }),
1450
1465
  children: i === "left" ? "≡L" : i === "center" ? "≡C" : i === "right" ? "≡R" : "≡J"
1451
1466
  },
1452
1467
  i
1453
1468
  )) })
1454
1469
  ] }),
1455
1470
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1456
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.lineHeight", "Line h.") }),
1471
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.lineHeight", "Line h.") }),
1457
1472
  /* @__PURE__ */ e(
1458
1473
  "input",
1459
1474
  {
@@ -1463,12 +1478,12 @@ const Ma = ({
1463
1478
  max: 4,
1464
1479
  className: t.styleInput,
1465
1480
  value: n.style.lineHeight ?? 1.4,
1466
- onChange: (i) => _({ lineHeight: +i.target.value })
1481
+ onChange: (i) => k({ lineHeight: +i.target.value })
1467
1482
  }
1468
1483
  )
1469
1484
  ] }),
1470
1485
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1471
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.spacing", "Spacing") }),
1486
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.spacing", "Spacing") }),
1472
1487
  /* @__PURE__ */ e(
1473
1488
  "input",
1474
1489
  {
@@ -1478,37 +1493,37 @@ const Ma = ({
1478
1493
  max: 0.5,
1479
1494
  className: t.styleInput,
1480
1495
  value: n.style.letterSpacing ?? 0,
1481
- onChange: (i) => _({ letterSpacing: +i.target.value })
1496
+ onChange: (i) => k({ letterSpacing: +i.target.value })
1482
1497
  }
1483
1498
  ),
1484
1499
  /* @__PURE__ */ e("span", { className: t.styleUnit, children: "em" })
1485
1500
  ] })
1486
1501
  ] }),
1487
1502
  /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1488
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: h("printing.editor.background", "Background and border") }),
1503
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: g("printing.editor.background", "Background and border") }),
1489
1504
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1490
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.fill", "Fill") }),
1505
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.fill", "Fill") }),
1491
1506
  /* @__PURE__ */ e(
1492
1507
  "input",
1493
1508
  {
1494
1509
  type: "color",
1495
1510
  className: t.colorPicker,
1496
1511
  value: n.style.backgroundColor ?? "var(--nice-bg, #fff)",
1497
- onChange: (i) => _({ backgroundColor: i.target.value })
1512
+ onChange: (i) => k({ backgroundColor: i.target.value })
1498
1513
  }
1499
1514
  ),
1500
1515
  /* @__PURE__ */ e(
1501
1516
  "button",
1502
1517
  {
1503
1518
  className: t.clearBtn,
1504
- onClick: () => _({ backgroundColor: void 0 }),
1505
- title: h("printing.editor.clearFill", "Clear fill"),
1506
- children: /* @__PURE__ */ e(S, { name: "close", size: 12 })
1519
+ onClick: () => k({ backgroundColor: void 0 }),
1520
+ title: g("printing.editor.clearFill", "Clear fill"),
1521
+ children: /* @__PURE__ */ e(v, { name: "close", size: 12 })
1507
1522
  }
1508
1523
  )
1509
1524
  ] }),
1510
1525
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1511
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.border", "Border") }),
1526
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.border", "Border") }),
1512
1527
  /* @__PURE__ */ e(
1513
1528
  "input",
1514
1529
  {
@@ -1518,7 +1533,7 @@ const Ma = ({
1518
1533
  max: 10,
1519
1534
  className: t.styleInput,
1520
1535
  value: n.style.borderWidth ?? 0,
1521
- onChange: (i) => _({ borderWidth: +i.target.value })
1536
+ onChange: (i) => k({ borderWidth: +i.target.value })
1522
1537
  }
1523
1538
  ),
1524
1539
  /* @__PURE__ */ e(
@@ -1527,7 +1542,7 @@ const Ma = ({
1527
1542
  type: "color",
1528
1543
  className: t.colorPicker,
1529
1544
  value: n.style.borderColor ?? se,
1530
- onChange: (i) => _({ borderColor: i.target.value })
1545
+ onChange: (i) => k({ borderColor: i.target.value })
1531
1546
  }
1532
1547
  ),
1533
1548
  /* @__PURE__ */ a(
@@ -1535,7 +1550,7 @@ const Ma = ({
1535
1550
  {
1536
1551
  className: t.styleSelectXs,
1537
1552
  value: n.style.borderStyle ?? "solid",
1538
- onChange: (i) => _({ borderStyle: i.target.value }),
1553
+ onChange: (i) => k({ borderStyle: i.target.value }),
1539
1554
  children: [
1540
1555
  /* @__PURE__ */ e("option", { value: "solid", children: "─" }),
1541
1556
  /* @__PURE__ */ e("option", { value: "dashed", children: "- -" }),
@@ -1545,7 +1560,7 @@ const Ma = ({
1545
1560
  )
1546
1561
  ] }),
1547
1562
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1548
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.radius", "Radius") }),
1563
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.radius", "Radius") }),
1549
1564
  /* @__PURE__ */ e(
1550
1565
  "input",
1551
1566
  {
@@ -1555,13 +1570,13 @@ const Ma = ({
1555
1570
  max: 50,
1556
1571
  className: t.styleInput,
1557
1572
  value: n.style.borderRadius ?? 0,
1558
- onChange: (i) => _({ borderRadius: +i.target.value })
1573
+ onChange: (i) => k({ borderRadius: +i.target.value })
1559
1574
  }
1560
1575
  ),
1561
1576
  /* @__PURE__ */ e("span", { className: t.styleUnit, children: "px" })
1562
1577
  ] }),
1563
1578
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1564
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.padding", "Padding") }),
1579
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.padding", "Padding") }),
1565
1580
  /* @__PURE__ */ e(
1566
1581
  "input",
1567
1582
  {
@@ -1571,13 +1586,13 @@ const Ma = ({
1571
1586
  max: 20,
1572
1587
  className: t.styleInput,
1573
1588
  value: n.style.padding ?? 0,
1574
- onChange: (i) => _({ padding: +i.target.value })
1589
+ onChange: (i) => k({ padding: +i.target.value })
1575
1590
  }
1576
1591
  ),
1577
- /* @__PURE__ */ e("span", { className: t.styleUnit, children: "mm" })
1592
+ /* @__PURE__ */ e("span", { className: t.styleUnit, children: _("templateEditor.mm", "mm") })
1578
1593
  ] }),
1579
1594
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1580
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.opacity", "Opacity") }),
1595
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.opacity", "Opacity") }),
1581
1596
  /* @__PURE__ */ e(
1582
1597
  "input",
1583
1598
  {
@@ -1587,7 +1602,7 @@ const Ma = ({
1587
1602
  step: 0.05,
1588
1603
  className: t.sliderInput,
1589
1604
  value: n.style.opacity ?? 1,
1590
- onChange: (i) => _({ opacity: +i.target.value })
1605
+ onChange: (i) => k({ opacity: +i.target.value })
1591
1606
  }
1592
1607
  ),
1593
1608
  /* @__PURE__ */ a("span", { className: t.styleValue, children: [
@@ -1597,163 +1612,163 @@ const Ma = ({
1597
1612
  ] })
1598
1613
  ] })
1599
1614
  ] }),
1600
- s === "data" && f && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1601
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: h("printing.editor.dataSource", "Data source") }),
1615
+ o === "data" && r && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1616
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: g("printing.editor.dataSource", "Data source") }),
1602
1617
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1603
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.path", "Path") }),
1618
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.path", "Path") }),
1604
1619
  /* @__PURE__ */ e(
1605
1620
  "input",
1606
1621
  {
1607
1622
  className: t.styleInputFull,
1608
1623
  value: n.dataPath,
1609
- onChange: (i) => o({ dataPath: i.target.value }),
1610
- placeholder: b("templateEditor.egInvoiceNumber", "e.g. invoice.number")
1624
+ onChange: (i) => l({ dataPath: i.target.value }),
1625
+ placeholder: _("templateEditor.egInvoiceNumber", "e.g. invoice.number")
1611
1626
  }
1612
1627
  )
1613
1628
  ] }),
1614
1629
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1615
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.format", "Format") }),
1630
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.format", "Format") }),
1616
1631
  /* @__PURE__ */ e(
1617
1632
  "input",
1618
1633
  {
1619
1634
  className: t.styleInputFull,
1620
1635
  value: n.format ?? "",
1621
- onChange: (i) => o({ format: i.target.value }),
1622
- placeholder: b("templateEditor.ddMmYyyy000", "DD.MM.YYYY / #,##0.00")
1636
+ onChange: (i) => l({ format: i.target.value }),
1637
+ placeholder: _("templateEditor.ddMmYyyy000", "DD.MM.YYYY / #,##0.00")
1623
1638
  }
1624
1639
  )
1625
1640
  ] }),
1626
1641
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1627
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.default", "Default") }),
1642
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.default", "Default") }),
1628
1643
  /* @__PURE__ */ e(
1629
1644
  "input",
1630
1645
  {
1631
1646
  className: t.styleInputFull,
1632
1647
  value: n.fallback ?? "",
1633
- onChange: (i) => o({ fallback: i.target.value }),
1634
- placeholder: h("printing.editor.whenEmpty", "When there is no value")
1648
+ onChange: (i) => l({ fallback: i.target.value }),
1649
+ placeholder: g("printing.editor.whenEmpty", "When there is no value")
1635
1650
  }
1636
1651
  )
1637
1652
  ] }),
1638
1653
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1639
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.type", "Type") }),
1654
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.type", "Type") }),
1640
1655
  /* @__PURE__ */ e(
1641
1656
  "select",
1642
1657
  {
1643
1658
  className: t.styleSelectFull,
1644
1659
  value: n.type,
1645
- onChange: (i) => o({ type: i.target.value }),
1646
- children: Object.keys(_e).map((i) => /* @__PURE__ */ e("option", { value: i, children: we(h, i) }, i))
1660
+ onChange: (i) => l({ type: i.target.value }),
1661
+ children: Object.keys(ge).map((i) => /* @__PURE__ */ e("option", { value: i, children: Se(g, i) }, i))
1647
1662
  }
1648
1663
  )
1649
1664
  ] }),
1650
1665
  (n.type === "barcode" || n.type === "qr") && /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1651
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.codeFormat", "Code format") }),
1666
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.codeFormat", "Code format") }),
1652
1667
  /* @__PURE__ */ e(
1653
1668
  "select",
1654
1669
  {
1655
1670
  className: t.styleSelectFull,
1656
1671
  value: n.barcodeType ?? "code128",
1657
- onChange: (i) => o({ barcodeType: i.target.value }),
1672
+ onChange: (i) => l({ barcodeType: i.target.value }),
1658
1673
  children: ["ean13", "ean8", "code128", "code39", "upc", "itf14", "datamatrix"].map((i) => /* @__PURE__ */ e("option", { value: i, children: i.toUpperCase() }, i))
1659
1674
  }
1660
1675
  )
1661
1676
  ] })
1662
1677
  ] }),
1663
- s === "conditional" && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1664
- /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: h("printing.editor.conditionalVisibility", "Conditional visibility") }),
1665
- /* @__PURE__ */ e("div", { className: t.conditionalHint, children: h(
1678
+ o === "conditional" && /* @__PURE__ */ a("div", { className: t.styleGroup, children: [
1679
+ /* @__PURE__ */ e("div", { className: t.styleGroupTitle, children: g("printing.editor.conditionalVisibility", "Conditional visibility") }),
1680
+ /* @__PURE__ */ e("div", { className: t.conditionalHint, children: g(
1666
1681
  "printing.editor.conditionalHint",
1667
1682
  "The element is hidden when the condition is not met."
1668
1683
  ) }),
1669
1684
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1670
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.conditionalField", "Field") }),
1685
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.conditionalField", "Field") }),
1671
1686
  /* @__PURE__ */ e(
1672
1687
  "input",
1673
1688
  {
1674
1689
  className: t.styleInputFull,
1675
- value: ((C = n.conditional) == null ? void 0 : C.field) ?? "",
1690
+ value: ((S = n.conditional) == null ? void 0 : S.field) ?? "",
1676
1691
  onChange: (i) => {
1677
- var u, c;
1678
- return o({
1692
+ var m, h;
1693
+ return l({
1679
1694
  conditional: {
1680
1695
  field: i.target.value,
1681
- operator: ((u = n.conditional) == null ? void 0 : u.operator) ?? "eq",
1682
- value: (c = n.conditional) == null ? void 0 : c.value
1696
+ operator: ((m = n.conditional) == null ? void 0 : m.operator) ?? "eq",
1697
+ value: (h = n.conditional) == null ? void 0 : h.value
1683
1698
  }
1684
1699
  });
1685
1700
  },
1686
- placeholder: b("templateEditor.egInvoiceIsPaid", "e.g. invoice.isPaid")
1701
+ placeholder: _("templateEditor.egInvoiceIsPaid", "e.g. invoice.isPaid")
1687
1702
  }
1688
1703
  )
1689
1704
  ] }),
1690
1705
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1691
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: b("templateEditor.operator", "Operator") }),
1706
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: _("templateEditor.operator", "Operator") }),
1692
1707
  /* @__PURE__ */ a(
1693
1708
  "select",
1694
1709
  {
1695
1710
  className: t.styleSelectFull,
1696
- value: ((z = n.conditional) == null ? void 0 : z.operator) ?? "eq",
1711
+ value: ((I = n.conditional) == null ? void 0 : I.operator) ?? "eq",
1697
1712
  onChange: (i) => {
1698
- var u, c;
1699
- return o({
1713
+ var m, h;
1714
+ return l({
1700
1715
  conditional: {
1701
- field: ((u = n.conditional) == null ? void 0 : u.field) ?? "",
1716
+ field: ((m = n.conditional) == null ? void 0 : m.field) ?? "",
1702
1717
  operator: i.target.value,
1703
- value: (c = n.conditional) == null ? void 0 : c.value
1718
+ value: (h = n.conditional) == null ? void 0 : h.value
1704
1719
  }
1705
1720
  });
1706
1721
  },
1707
1722
  children: [
1708
1723
  /* @__PURE__ */ a("option", { value: "eq", children: [
1709
1724
  "= ",
1710
- h("printing.editor.opEqual", "equal")
1725
+ g("printing.editor.opEqual", "equal")
1711
1726
  ] }),
1712
1727
  /* @__PURE__ */ a("option", { value: "neq", children: [
1713
1728
  "≠ ",
1714
- h("printing.editor.opNotEqual", "not equal")
1729
+ g("printing.editor.opNotEqual", "not equal")
1715
1730
  ] }),
1716
- /* @__PURE__ */ e("option", { value: "gt", children: "> wieksze" }),
1717
- /* @__PURE__ */ e("option", { value: "lt", children: "< mniejsze" }),
1718
- /* @__PURE__ */ e("option", { value: "contains", children: "zawiera" })
1731
+ /* @__PURE__ */ e("option", { value: "gt", children: _("templateEditor.greaterThan", "> greater than") }),
1732
+ /* @__PURE__ */ e("option", { value: "lt", children: _("templateEditor.lessThan", "< less than") }),
1733
+ /* @__PURE__ */ e("option", { value: "contains", children: _("templateEditor.contains", "contains") })
1719
1734
  ]
1720
1735
  }
1721
1736
  )
1722
1737
  ] }),
1723
1738
  /* @__PURE__ */ a("div", { className: t.styleRow, children: [
1724
- /* @__PURE__ */ e("label", { className: t.styleLabel, children: h("printing.editor.value", "Value") }),
1739
+ /* @__PURE__ */ e("label", { className: t.styleLabel, children: g("printing.editor.value", "Value") }),
1725
1740
  /* @__PURE__ */ e(
1726
1741
  "input",
1727
1742
  {
1728
1743
  className: t.styleInputFull,
1729
- value: String(((y = n.conditional) == null ? void 0 : y.value) ?? ""),
1744
+ value: String(((x = n.conditional) == null ? void 0 : x.value) ?? ""),
1730
1745
  onChange: (i) => {
1731
- var u, c;
1732
- return o({
1746
+ var m, h;
1747
+ return l({
1733
1748
  conditional: {
1734
- field: ((u = n.conditional) == null ? void 0 : u.field) ?? "",
1735
- operator: ((c = n.conditional) == null ? void 0 : c.operator) ?? "eq",
1749
+ field: ((m = n.conditional) == null ? void 0 : m.field) ?? "",
1750
+ operator: ((h = n.conditional) == null ? void 0 : h.operator) ?? "eq",
1736
1751
  value: i.target.value
1737
1752
  }
1738
1753
  });
1739
1754
  },
1740
- placeholder: b("templateEditor.egTruePaid", 'e.g. true / "PAID"')
1755
+ placeholder: _("templateEditor.egTruePaid", 'e.g. true / "PAID"')
1741
1756
  }
1742
1757
  )
1743
1758
  ] }),
1744
- ((r = n.conditional) == null ? void 0 : r.field) && /* @__PURE__ */ e(
1759
+ ((s = n.conditional) == null ? void 0 : s.field) && /* @__PURE__ */ e(
1745
1760
  "button",
1746
1761
  {
1747
1762
  className: t.clearConditionalBtn,
1748
- onClick: () => o({ conditional: void 0 }),
1749
- children: h("printing.editor.clearCondition", "Clear condition")
1763
+ onClick: () => l({ conditional: void 0 }),
1764
+ children: g("printing.editor.clearCondition", "Clear condition")
1750
1765
  }
1751
1766
  )
1752
1767
  ] })
1753
1768
  ] })
1754
1769
  ] });
1755
1770
  };
1756
- function Wa() {
1771
+ function Ka() {
1757
1772
  return {
1758
1773
  id: `tpl-${Date.now()}`,
1759
1774
  name: "New template",
@@ -1770,471 +1785,487 @@ function Wa() {
1770
1785
  signatures: []
1771
1786
  };
1772
1787
  }
1773
- const lr = ({
1788
+ const ur = ({
1774
1789
  template: n,
1775
- dataSchema: s,
1776
- sampleData: m = [],
1777
- onChange: o,
1778
- onSave: B,
1790
+ dataSchema: o,
1791
+ sampleData: d = [],
1792
+ onChange: l,
1793
+ onSave: C,
1779
1794
  readOnly: N = !1,
1780
- className: b,
1781
- style: h,
1782
- theme: g = "light"
1795
+ className: _,
1796
+ style: g,
1797
+ theme: f = "light"
1783
1798
  }) => {
1784
- const [{ past: _, present: l, future: f }, C] = Ke(Da, {
1799
+ const { t: k } = j(), [{ past: u, present: r, future: S }, I] = nt(Ma, {
1785
1800
  past: [],
1786
- present: n ?? Wa(),
1801
+ present: n ?? Ka(),
1787
1802
  future: []
1788
- }), { t: z } = X(), [y, r] = H(/* @__PURE__ */ new Set()), [i, u] = H("sec-body"), [c, F] = H(1), [v, D] = H(0), [x, T] = H("fields"), [A, Y] = H("position"), [Z, w] = H(!1), [K, be] = H(!0), M = E(
1789
- (d) => {
1790
- const p = { ...l, ...d };
1791
- C({ type: "UPDATE", payload: p }), o == null || o(p);
1803
+ }), { t: x } = j(), [s, i] = H(/* @__PURE__ */ new Set()), [m, h] = H("sec-body"), [z, y] = H(1), [R, T] = H(0), [D, Y] = H("fields"), [X, P] = H("position"), [b, V] = H(!1), [_e, Pe] = H(!0), E = M(
1804
+ (c) => {
1805
+ const p = { ...r, ...c };
1806
+ I({ type: "UPDATE", payload: p }), l == null || l(p);
1792
1807
  },
1793
- [l, o]
1808
+ [r, l]
1794
1809
  ), [ee, ye] = ue(() => {
1795
- const [d, p] = Le[l.paperSize] ?? Le.A4;
1796
- return l.orientation === "landscape" ? [p, d] : [d, p];
1797
- }, [l.paperSize, l.orientation]), te = ue(() => l.sections.flatMap((d) => d.fields), [l]), G = ue(
1798
- () => te.find((d) => y.has(d.id)) ?? null,
1799
- [te, y]
1800
- ), fe = E(
1801
- (d, p) => {
1802
- M({
1803
- sections: l.sections.map((L) => ({
1810
+ const [c, p] = ze[r.paperSize] ?? ze.A4;
1811
+ return r.orientation === "landscape" ? [p, c] : [c, p];
1812
+ }, [r.paperSize, r.orientation]), te = ue(() => r.sections.flatMap((c) => c.fields), [r]), G = ue(
1813
+ () => te.find((c) => s.has(c.id)) ?? null,
1814
+ [te, s]
1815
+ ), fe = M(
1816
+ (c, p) => {
1817
+ E({
1818
+ sections: r.sections.map((L) => ({
1804
1819
  ...L,
1805
1820
  fields: L.fields.map(
1806
- (I) => I.id === d ? { ...I, ...p, style: { ...I.style, ...p.style ?? {} } } : I
1821
+ (B) => B.id === c ? { ...B, ...p, style: { ...B.style, ...p.style ?? {} } } : B
1807
1822
  )
1808
1823
  }))
1809
1824
  });
1810
1825
  },
1811
- [l, M]
1812
- ), de = E(
1813
- (d) => {
1814
- M({
1815
- sections: l.sections.map((p) => ({
1826
+ [r, E]
1827
+ ), de = M(
1828
+ (c) => {
1829
+ E({
1830
+ sections: r.sections.map((p) => ({
1816
1831
  ...p,
1817
1832
  fields: p.fields.map(
1818
- (L) => y.has(L.id) ? { ...L, ...d, style: { ...L.style, ...d.style ?? {} } } : L
1833
+ (L) => s.has(L.id) ? { ...L, ...c, style: { ...L.style, ...c.style ?? {} } } : L
1819
1834
  )
1820
1835
  }))
1821
1836
  });
1822
1837
  },
1823
- [l, y, M]
1824
- ), Ce = E(
1825
- (d, p) => {
1826
- if (d === "watermark") {
1827
- M({
1838
+ [r, s, E]
1839
+ ), Ie = M(
1840
+ (c, p) => {
1841
+ if (c === "watermark") {
1842
+ E({
1828
1843
  watermarks: [
1829
- ...l.watermarks ?? [],
1844
+ ...r.watermarks ?? [],
1830
1845
  {
1831
1846
  id: ce(),
1832
1847
  type: "text",
1833
- text: "COPY",
1848
+ text: k("templateEditor.copy", "COPY"),
1834
1849
  opacity: 0.12,
1835
1850
  angle: -45,
1836
1851
  fontSize: 60,
1837
- color: ge
1852
+ color: be
1838
1853
  }
1839
1854
  ]
1840
- }), T("watermarks");
1855
+ }), Y("watermarks");
1841
1856
  return;
1842
1857
  }
1843
- if (d === "signature") {
1844
- M({
1858
+ if (c === "signature") {
1859
+ E({
1845
1860
  signatures: [
1846
- ...l.signatures ?? [],
1861
+ ...r.signatures ?? [],
1847
1862
  {
1848
1863
  id: ce(),
1849
- label: z("printing.editor.signature", "Signature"),
1864
+ label: x("printing.editor.signature", "Signature"),
1850
1865
  position: { x: 10, y: 5, width: 70, height: 22 },
1851
1866
  showLine: !0,
1852
1867
  showDate: !1
1853
1868
  }
1854
1869
  ]
1855
- }), T("signatures");
1870
+ }), Y("signatures");
1856
1871
  return;
1857
1872
  }
1858
- const L = l.sections.find((O) => O.id === i) ?? l.sections.find((O) => O.type === "body");
1873
+ const L = r.sections.find((O) => O.id === m) ?? r.sections.find((O) => O.type === "body");
1859
1874
  if (!L)
1860
1875
  return;
1861
- const I = ze(d, p), P = {
1862
- sections: l.sections.map(
1863
- (O) => O.id === L.id ? { ...O, fields: [...O.fields, I] } : O
1876
+ const B = De(c, p), F = {
1877
+ sections: r.sections.map(
1878
+ (O) => O.id === L.id ? { ...O, fields: [...O.fields, B] } : O
1864
1879
  )
1865
1880
  };
1866
- C({ type: "UPDATE", payload: { ...l, ...P } }), o == null || o({ ...l, ...P }), r(/* @__PURE__ */ new Set([I.id]));
1881
+ I({ type: "UPDATE", payload: { ...r, ...F } }), l == null || l({ ...r, ...F }), i(/* @__PURE__ */ new Set([B.id]));
1867
1882
  },
1868
- [l, i, o]
1869
- ), Re = E(
1870
- (d, p, L, I) => {
1871
- const P = s == null ? void 0 : s.fields.find((j) => j.path === p), O = ze((P == null ? void 0 : P.type) ?? "text", P);
1872
- O.position.x = Math.round(L * 2) / 2, O.position.y = Math.round(I * 2) / 2;
1883
+ [r, m, l, k, x, E]
1884
+ ), Ee = M(
1885
+ (c, p, L, B) => {
1886
+ const F = o == null ? void 0 : o.fields.find((U) => U.path === p), O = De((F == null ? void 0 : F.type) ?? "text", F);
1887
+ O.position.x = Math.round(L * 2) / 2, O.position.y = Math.round(B * 2) / 2;
1873
1888
  const ne = {
1874
- sections: l.sections.map(
1875
- (j) => j.id === d ? { ...j, fields: [...j.fields, O] } : j
1889
+ sections: r.sections.map(
1890
+ (U) => U.id === c ? { ...U, fields: [...U.fields, O] } : U
1876
1891
  )
1877
1892
  };
1878
- C({ type: "UPDATE", payload: { ...l, ...ne } }), o == null || o({ ...l, ...ne }), r(/* @__PURE__ */ new Set([O.id]));
1893
+ I({ type: "UPDATE", payload: { ...r, ...ne } }), l == null || l({ ...r, ...ne }), i(/* @__PURE__ */ new Set([O.id]));
1879
1894
  },
1880
- [l, s, o]
1881
- ), Ae = E((d, p) => {
1882
- p.ctrlKey || p.metaKey ? r((L) => {
1883
- const I = new Set(L);
1884
- return I.has(d) ? I.delete(d) : I.add(d), I;
1885
- }) : p.shiftKey ? r((L) => /* @__PURE__ */ new Set([...L, d])) : r(/* @__PURE__ */ new Set([d]));
1886
- }, []), Ee = E(
1887
- (d, p) => {
1895
+ [r, o, l]
1896
+ ), Me = M((c, p) => {
1897
+ p.ctrlKey || p.metaKey ? i((L) => {
1898
+ const B = new Set(L);
1899
+ return B.has(c) ? B.delete(c) : B.add(c), B;
1900
+ }) : p.shiftKey ? i((L) => /* @__PURE__ */ new Set([...L, c])) : i(/* @__PURE__ */ new Set([c]));
1901
+ }, []), Fe = M(
1902
+ (c, p) => {
1888
1903
  if (N)
1889
1904
  return;
1890
- p.preventDefault(), y.has(d) || r(/* @__PURE__ */ new Set([d]));
1891
- const L = p.clientX, I = p.clientY, P = l.sections.map((j) => ({
1892
- id: j.id,
1893
- fields: j.fields.map((ae) => ({ id: ae.id, pos: { ...ae.position } }))
1894
- })), O = (j) => {
1895
- const ae = (j.clientX - L) / (c * W), re = (j.clientY - I) / (c * W), me = y.has(d) ? y : /* @__PURE__ */ new Set([d]), pe = l.sections.map((ie) => {
1896
- const J = P.find((U) => U.id === ie.id);
1905
+ p.preventDefault(), s.has(c) || i(/* @__PURE__ */ new Set([c]));
1906
+ const L = p.clientX, B = p.clientY, F = r.sections.map((U) => ({
1907
+ id: U.id,
1908
+ fields: U.fields.map((ae) => ({ id: ae.id, pos: { ...ae.position } }))
1909
+ })), O = (U) => {
1910
+ const ae = (U.clientX - L) / (z * W), re = (U.clientY - B) / (z * W), me = s.has(c) ? s : /* @__PURE__ */ new Set([c]), pe = r.sections.map((ie) => {
1911
+ const Z = F.find((K) => K.id === ie.id);
1897
1912
  return {
1898
1913
  ...ie,
1899
- fields: ie.fields.map((U) => {
1900
- var Ie;
1901
- if (!me.has(U.id))
1902
- return U;
1903
- const Be = ((Ie = J == null ? void 0 : J.fields.find((Ue) => Ue.id === U.id)) == null ? void 0 : Ie.pos) ?? U.position;
1914
+ fields: ie.fields.map((K) => {
1915
+ var xe;
1916
+ if (!me.has(K.id))
1917
+ return K;
1918
+ const Le = ((xe = Z == null ? void 0 : Z.fields.find((Xe) => Xe.id === K.id)) == null ? void 0 : xe.pos) ?? K.position;
1904
1919
  return {
1905
- ...U,
1920
+ ...K,
1906
1921
  position: {
1907
- ...U.position,
1908
- x: Math.max(0, Math.round((Be.x + ae) * 2) / 2),
1909
- y: Math.max(0, Math.round((Be.y + re) * 2) / 2)
1922
+ ...K.position,
1923
+ x: Math.max(0, Math.round((Le.x + ae) * 2) / 2),
1924
+ y: Math.max(0, Math.round((Le.y + re) * 2) / 2)
1910
1925
  }
1911
1926
  };
1912
1927
  })
1913
1928
  };
1914
- }), oe = { ...l, sections: pe };
1915
- o == null || o(oe), C({ type: "UPDATE", payload: oe });
1929
+ }), oe = { ...r, sections: pe };
1930
+ l == null || l(oe), I({ type: "UPDATE", payload: oe });
1916
1931
  }, ne = () => {
1917
1932
  document.removeEventListener("mousemove", O), document.removeEventListener("mouseup", ne);
1918
1933
  };
1919
1934
  document.addEventListener("mousemove", O), document.addEventListener("mouseup", ne);
1920
1935
  },
1921
- [l, c, y, N, o]
1922
- ), Me = E(
1923
- (d, p, L) => {
1936
+ [r, z, s, N, l]
1937
+ ), He = M(
1938
+ (c, p, L) => {
1924
1939
  if (N)
1925
1940
  return;
1926
1941
  L.preventDefault();
1927
- const I = te.find((re) => re.id === d);
1928
- if (!I)
1942
+ const B = te.find((re) => re.id === c);
1943
+ if (!B)
1929
1944
  return;
1930
- const P = { ...I.position }, O = L.clientX, ne = L.clientY, j = (re) => {
1931
- const me = (re.clientX - O) / (c * W), pe = (re.clientY - ne) / (c * W);
1932
- let { x: oe, y: ie, width: J, height: U } = P;
1933
- p.includes("e") && (J = Math.max(5, J + me)), p.includes("s") && (U = Math.max(3, U + pe)), p.includes("w") && (oe = oe + me, J = Math.max(5, J - me)), p.includes("n") && (ie = ie + pe, U = Math.max(3, U - pe)), fe(d, {
1945
+ const F = { ...B.position }, O = L.clientX, ne = L.clientY, U = (re) => {
1946
+ const me = (re.clientX - O) / (z * W), pe = (re.clientY - ne) / (z * W);
1947
+ let { x: oe, y: ie, width: Z, height: K } = F;
1948
+ p.includes("e") && (Z = Math.max(5, Z + me)), p.includes("s") && (K = Math.max(3, K + pe)), p.includes("w") && (oe = oe + me, Z = Math.max(5, Z - me)), p.includes("n") && (ie = ie + pe, K = Math.max(3, K - pe)), fe(c, {
1934
1949
  position: {
1935
- ...P,
1950
+ ...F,
1936
1951
  x: Math.round(oe * 2) / 2,
1937
1952
  y: Math.round(ie * 2) / 2,
1938
- width: Math.round(J * 2) / 2,
1939
- height: Math.round(U * 2) / 2
1953
+ width: Math.round(Z * 2) / 2,
1954
+ height: Math.round(K * 2) / 2
1940
1955
  }
1941
1956
  });
1942
1957
  }, ae = () => {
1943
- document.removeEventListener("mousemove", j), document.removeEventListener("mouseup", ae);
1958
+ document.removeEventListener("mousemove", U), document.removeEventListener("mouseup", ae);
1944
1959
  };
1945
- document.addEventListener("mousemove", j), document.addEventListener("mouseup", ae);
1960
+ document.addEventListener("mousemove", U), document.addEventListener("mouseup", ae);
1946
1961
  },
1947
- [te, c, N, fe]
1948
- ), ve = E(() => {
1949
- M({
1950
- sections: l.sections.map((d) => ({
1951
- ...d,
1952
- fields: d.fields.filter((p) => !y.has(p.id))
1962
+ [te, z, N, fe]
1963
+ ), ve = M(() => {
1964
+ E({
1965
+ sections: r.sections.map((c) => ({
1966
+ ...c,
1967
+ fields: c.fields.filter((p) => !s.has(p.id))
1953
1968
  }))
1954
- }), r(/* @__PURE__ */ new Set());
1955
- }, [l, y, M]), Ne = E(() => {
1956
- const d = /* @__PURE__ */ new Set();
1957
- M({
1958
- sections: l.sections.map((p) => {
1959
- const L = p.fields.filter((I) => y.has(I.id)).map((I) => {
1960
- const P = {
1961
- ...I,
1969
+ }), i(/* @__PURE__ */ new Set());
1970
+ }, [r, s, E]), Ne = M(() => {
1971
+ const c = /* @__PURE__ */ new Set();
1972
+ E({
1973
+ sections: r.sections.map((p) => {
1974
+ const L = p.fields.filter((B) => s.has(B.id)).map((B) => {
1975
+ const F = {
1976
+ ...B,
1962
1977
  id: ce(),
1963
- position: { ...I.position, x: I.position.x + 5, y: I.position.y + 5 }
1978
+ position: { ...B.position, x: B.position.x + 5, y: B.position.y + 5 }
1964
1979
  };
1965
- return d.add(P.id), P;
1980
+ return c.add(F.id), F;
1966
1981
  });
1967
1982
  return { ...p, fields: [...p.fields, ...L] };
1968
1983
  })
1969
- }), r(d);
1970
- }, [l, y, M]), Pe = E(
1971
- (d) => {
1972
- M({
1973
- sections: l.sections.map((p) => ({
1984
+ }), i(c);
1985
+ }, [r, s, E]), Ge = M(
1986
+ (c) => {
1987
+ E({
1988
+ sections: r.sections.map((p) => ({
1974
1989
  ...p,
1975
1990
  fields: p.fields.map((L) => {
1976
- if (!y.has(L.id))
1991
+ if (!s.has(L.id))
1977
1992
  return L;
1978
- const I = d === "left" ? l.margins.left : d === "right" ? ee - l.margins.right - L.position.width : (ee - L.position.width) / 2;
1979
- return { ...L, position: { ...L.position, x: I } };
1993
+ const B = c === "left" ? r.margins.left : c === "right" ? ee - r.margins.right - L.position.width : (ee - L.position.width) / 2;
1994
+ return { ...L, position: { ...L.position, x: B } };
1980
1995
  })
1981
1996
  }))
1982
1997
  });
1983
1998
  },
1984
- [l, y, ee, M]
1985
- ), Fe = E(
1986
- (d) => {
1987
- const p = l.sections.find((I) => I.id === i);
1999
+ [r, s, ee, E]
2000
+ ), Oe = M(
2001
+ (c) => {
2002
+ const p = r.sections.find((B) => B.id === m);
1988
2003
  if (!p)
1989
2004
  return;
1990
2005
  const L = p.heightMm ?? 200;
1991
- M({
1992
- sections: l.sections.map((I) => I.id !== i ? I : {
1993
- ...I,
1994
- fields: I.fields.map((P) => {
1995
- if (!y.has(P.id))
1996
- return P;
1997
- const O = d === "top" ? 0 : d === "bottom" ? L - P.position.height : (L - P.position.height) / 2;
1998
- return { ...P, position: { ...P.position, y: O } };
2006
+ E({
2007
+ sections: r.sections.map((B) => B.id !== m ? B : {
2008
+ ...B,
2009
+ fields: B.fields.map((F) => {
2010
+ if (!s.has(F.id))
2011
+ return F;
2012
+ const O = c === "top" ? 0 : c === "bottom" ? L - F.position.height : (L - F.position.height) / 2;
2013
+ return { ...F, position: { ...F.position, y: O } };
1999
2014
  })
2000
2015
  })
2001
2016
  });
2002
2017
  },
2003
- [l, y, i, M]
2004
- ), He = E(() => {
2005
- M({
2006
- sections: l.sections.map((d) => ({
2007
- ...d,
2008
- fields: d.fields.map(
2009
- (p) => y.has(p.id) ? { ...p, position: { ...p.position, zIndex: (p.position.zIndex ?? 1) + 1 } } : p
2018
+ [r, s, m, E]
2019
+ ), qe = M(() => {
2020
+ E({
2021
+ sections: r.sections.map((c) => ({
2022
+ ...c,
2023
+ fields: c.fields.map(
2024
+ (p) => s.has(p.id) ? { ...p, position: { ...p.position, zIndex: (p.position.zIndex ?? 1) + 1 } } : p
2010
2025
  )
2011
2026
  }))
2012
2027
  });
2013
- }, [l, y, M]), Ge = E(() => {
2014
- M({
2015
- sections: l.sections.map((d) => ({
2016
- ...d,
2017
- fields: d.fields.map(
2018
- (p) => y.has(p.id) ? {
2028
+ }, [r, s, E]), We = M(() => {
2029
+ E({
2030
+ sections: r.sections.map((c) => ({
2031
+ ...c,
2032
+ fields: c.fields.map(
2033
+ (p) => s.has(p.id) ? {
2019
2034
  ...p,
2020
2035
  position: { ...p.position, zIndex: Math.max(1, (p.position.zIndex ?? 1) - 1) }
2021
2036
  } : p
2022
2037
  )
2023
2038
  }))
2024
2039
  });
2025
- }, [l, y, M]), Oe = E(
2026
- (d, p) => {
2027
- M({
2028
- sections: l.sections.map((L) => ({
2040
+ }, [r, s, E]), Ye = M(
2041
+ (c, p) => {
2042
+ E({
2043
+ sections: r.sections.map((L) => ({
2029
2044
  ...L,
2030
2045
  fields: L.fields.map(
2031
- (I) => I.id === d ? {
2032
- ...I,
2046
+ (B) => B.id === c ? {
2047
+ ...B,
2033
2048
  position: {
2034
- ...I.position,
2035
- zIndex: Math.max(1, (I.position.zIndex ?? 1) - p)
2049
+ ...B.position,
2050
+ zIndex: Math.max(1, (B.position.zIndex ?? 1) - p)
2036
2051
  }
2037
- } : I
2052
+ } : B
2038
2053
  )
2039
2054
  }))
2040
2055
  });
2041
2056
  },
2042
- [l, M]
2057
+ [r, E]
2043
2058
  );
2044
- Se(() => {
2045
- const d = (p) => {
2059
+ Be(() => {
2060
+ const c = (p) => {
2046
2061
  const L = p.target.tagName;
2047
2062
  if (L === "INPUT" || L === "TEXTAREA" || L === "SELECT")
2048
2063
  return;
2049
- const I = p.shiftKey ? 5 : 0.5;
2050
- p.key === "Delete" || p.key === "Backspace" ? y.size && (p.preventDefault(), ve()) : p.ctrlKey && p.key === "z" ? (p.preventDefault(), C({ type: "UNDO" })) : p.ctrlKey && (p.key === "y" || p.key === "Y") ? (p.preventDefault(), C({ type: "REDO" })) : p.ctrlKey && (p.key === "d" || p.key === "D") ? (p.preventDefault(), y.size && Ne()) : p.ctrlKey && p.key === "a" ? (p.preventDefault(), r(new Set(te.map((P) => P.id)))) : p.key === "ArrowLeft" ? (p.preventDefault(), de({
2051
- position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - I }
2064
+ const B = p.shiftKey ? 5 : 0.5;
2065
+ p.key === "Delete" || p.key === "Backspace" ? s.size && (p.preventDefault(), ve()) : p.ctrlKey && p.key === "z" ? (p.preventDefault(), I({ type: "UNDO" })) : p.ctrlKey && (p.key === "y" || p.key === "Y") ? (p.preventDefault(), I({ type: "REDO" })) : p.ctrlKey && (p.key === "d" || p.key === "D") ? (p.preventDefault(), s.size && Ne()) : p.ctrlKey && p.key === "a" ? (p.preventDefault(), i(new Set(te.map((F) => F.id)))) : p.key === "ArrowLeft" ? (p.preventDefault(), de({
2066
+ position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) - B }
2052
2067
  })) : p.key === "ArrowRight" ? (p.preventDefault(), de({
2053
- position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + I }
2068
+ position: { ...G.position, x: ((G == null ? void 0 : G.position.x) ?? 0) + B }
2054
2069
  })) : p.key === "ArrowUp" ? (p.preventDefault(), de({
2055
- position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - I }
2070
+ position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) - B }
2056
2071
  })) : p.key === "ArrowDown" && (p.preventDefault(), de({
2057
- position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + I }
2072
+ position: { ...G.position, y: ((G == null ? void 0 : G.position.y) ?? 0) + B }
2058
2073
  }));
2059
2074
  };
2060
- return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
2061
- }, [y, te, G, ve, Ne, de]);
2062
- const qe = E(
2063
- (d, p) => {
2064
- M({
2065
- sections: l.sections.map(
2066
- (L) => L.id === d ? { ...L, heightMm: Math.round(p * 2) / 2 } : L
2075
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
2076
+ }, [s, te, G, ve, Ne, de]);
2077
+ const Ue = M(
2078
+ (c, p) => {
2079
+ E({
2080
+ sections: r.sections.map(
2081
+ (L) => L.id === c ? { ...L, heightMm: Math.round(p * 2) / 2 } : L
2067
2082
  )
2068
2083
  });
2069
2084
  },
2070
- [l, M]
2071
- ), We = ue(() => {
2072
- const d = Array.isArray(m) ? m[v] : m;
2073
- return d ? "data" in d ? d.data : d : {};
2074
- }, [m, v]), Ye = ee * c * W, je = ye * c * W;
2085
+ [r, E]
2086
+ ), je = ue(() => {
2087
+ const c = Array.isArray(d) ? d[R] : d;
2088
+ return c ? "data" in c ? c.data : c : {};
2089
+ }, [d, R]), Ve = ee * z * W, Ke = ye * z * W;
2075
2090
  return /* @__PURE__ */ e(
2076
- Ve,
2091
+ Je,
2077
2092
  {
2078
2093
  flush: !0,
2079
- className: `${t.root} ${g === "dark" ? t.dark : ""} ${b ?? ""}`,
2080
- style: h,
2094
+ className: `${t.root} ${f === "dark" ? t.dark : ""} ${_ ?? ""}`,
2095
+ style: g,
2081
2096
  toolbar: /* @__PURE__ */ e(
2082
- Ga,
2097
+ Ua,
2083
2098
  {
2084
- tpl: l,
2085
- zoom: c,
2086
- canUndo: _.length > 0,
2087
- canRedo: f.length > 0,
2088
- showGrid: Z,
2089
- showRulers: K,
2099
+ tpl: r,
2100
+ zoom: z,
2101
+ canUndo: u.length > 0,
2102
+ canRedo: S.length > 0,
2103
+ showGrid: b,
2104
+ showRulers: _e,
2090
2105
  readOnly: N,
2091
- selectedCount: y.size,
2092
- onPaperChange: (d, p) => M({ paperSize: d, orientation: p }),
2093
- onZoom: F,
2094
- onUndo: () => C({ type: "UNDO" }),
2095
- onRedo: () => C({ type: "REDO" }),
2096
- onToggleGrid: () => w((d) => !d),
2097
- onToggleRulers: () => be((d) => !d),
2098
- onInsert: Ce,
2106
+ selectedCount: s.size,
2107
+ onPaperChange: (c, p) => E({ paperSize: c, orientation: p }),
2108
+ onZoom: y,
2109
+ onUndo: () => I({ type: "UNDO" }),
2110
+ onRedo: () => I({ type: "REDO" }),
2111
+ onToggleGrid: () => V((c) => !c),
2112
+ onToggleRulers: () => Pe((c) => !c),
2113
+ onInsert: Ie,
2099
2114
  onDelete: ve,
2100
2115
  onDuplicate: Ne,
2101
- onAlignH: Pe,
2102
- onAlignV: Fe,
2103
- onBringForward: He,
2104
- onSendBackward: Ge,
2105
- onSave: B ? () => B(l) : void 0
2116
+ onAlignH: Ge,
2117
+ onAlignV: Oe,
2118
+ onBringForward: qe,
2119
+ onSendBackward: We,
2120
+ onSave: C ? () => C(r) : void 0
2106
2121
  }
2107
2122
  ),
2108
2123
  sidebar: /* @__PURE__ */ e(
2109
- Oa,
2124
+ ja,
2110
2125
  {
2111
- activeTab: x,
2112
- onTabChange: T,
2113
- schema: s,
2114
- tpl: l,
2126
+ activeTab: D,
2127
+ onTabChange: Y,
2128
+ schema: o,
2129
+ tpl: r,
2115
2130
  allFields: te,
2116
- selectedIds: y,
2117
- onInsertSchemaField: (d) => Ce(d.type, d),
2118
- onSelectField: (d) => r(/* @__PURE__ */ new Set([d])),
2119
- onUpdateTpl: (d) => M(d),
2120
- onReorderField: Oe
2131
+ selectedIds: s,
2132
+ onInsertSchemaField: (c) => Ie(c.type, c),
2133
+ onSelectField: (c) => i(/* @__PURE__ */ new Set([c])),
2134
+ onUpdateTpl: (c) => E(c),
2135
+ onReorderField: Ye
2121
2136
  }
2122
2137
  ),
2123
2138
  rightSidebar: /* @__PURE__ */ e(
2124
- qa,
2139
+ Va,
2125
2140
  {
2126
2141
  field: G,
2127
- activeTab: A,
2128
- onTabChange: Y,
2129
- onChange: (d) => G && fe(G.id, d),
2142
+ activeTab: X,
2143
+ onTabChange: P,
2144
+ onChange: (c) => G && fe(G.id, c),
2130
2145
  paperWidthMm: ee,
2131
2146
  paperHeightMm: ye
2132
2147
  }
2133
2148
  ),
2134
- children: /* @__PURE__ */ a("div", { className: t.canvasArea, onClick: () => r(/* @__PURE__ */ new Set()), children: [
2135
- Array.isArray(m) && m.length > 0 && /* @__PURE__ */ a("div", { className: t.testDataBar, children: [
2136
- /* @__PURE__ */ a("span", { className: t.testDataLabel, children: [
2137
- z("printing.editor.testData", "Sample data"),
2138
- ":"
2139
- ] }),
2140
- /* @__PURE__ */ e(
2141
- "select",
2142
- {
2143
- className: t.testDataSelect,
2144
- value: v,
2145
- onChange: (d) => D(+d.target.value),
2146
- children: m.map((d, p) => /* @__PURE__ */ a("option", { value: p, children: [
2147
- z("printing.editor.record", "Record"),
2148
- " ",
2149
- p + 1
2150
- ] }, p))
2151
- }
2152
- )
2153
- ] }),
2154
- K && /* @__PURE__ */ a("div", { className: t.rulerWrapper, children: [
2155
- /* @__PURE__ */ e("div", { className: t.rulerCorner }),
2156
- /* @__PURE__ */ e(Te, { lengthMm: ee, zoom: c, orientation: "h" }),
2157
- /* @__PURE__ */ e(Te, { lengthMm: ye, zoom: c, orientation: "v" })
2158
- ] }),
2159
- /* @__PURE__ */ e("div", { className: t.paperScroll, onClick: (d) => d.stopPropagation(), children: /* @__PURE__ */ a("div", { className: t.paperShadow, style: { width: Ye, minHeight: je }, children: [
2160
- /* @__PURE__ */ e(
2161
- "div",
2162
- {
2163
- className: t.marginGuide,
2164
- style: {
2165
- top: l.margins.top * c * W,
2166
- right: l.margins.right * c * W,
2167
- bottom: l.margins.bottom * c * W,
2168
- left: l.margins.left * c * W
2149
+ children: /* @__PURE__ */ a(
2150
+ "div",
2151
+ {
2152
+ role: "presentation",
2153
+ className: t.canvasArea,
2154
+ onClick: () => i(/* @__PURE__ */ new Set()),
2155
+ children: [
2156
+ Array.isArray(d) && d.length > 0 && /* @__PURE__ */ a("div", { className: t.testDataBar, children: [
2157
+ /* @__PURE__ */ a("span", { className: t.testDataLabel, children: [
2158
+ x("printing.editor.testData", "Sample data"),
2159
+ ":"
2160
+ ] }),
2161
+ /* @__PURE__ */ e(
2162
+ "select",
2163
+ {
2164
+ className: t.testDataSelect,
2165
+ value: R,
2166
+ onChange: (c) => T(+c.target.value),
2167
+ children: d.map((c, p) => /* @__PURE__ */ a("option", { value: p, children: [
2168
+ x("printing.editor.record", "Record"),
2169
+ " ",
2170
+ p + 1
2171
+ ] }, p))
2172
+ }
2173
+ )
2174
+ ] }),
2175
+ _e && /* @__PURE__ */ a("div", { className: t.rulerWrapper, children: [
2176
+ /* @__PURE__ */ e("div", { className: t.rulerCorner }),
2177
+ /* @__PURE__ */ e($e, { lengthMm: ee, zoom: z, orientation: "h" }),
2178
+ /* @__PURE__ */ e($e, { lengthMm: ye, zoom: z, orientation: "v" })
2179
+ ] }),
2180
+ /* @__PURE__ */ e(
2181
+ "div",
2182
+ {
2183
+ role: "presentation",
2184
+ className: t.paperScroll,
2185
+ onClick: (c) => c.stopPropagation(),
2186
+ children: /* @__PURE__ */ a("div", { className: t.paperShadow, style: { width: Ve, minHeight: Ke }, children: [
2187
+ /* @__PURE__ */ e(
2188
+ "div",
2189
+ {
2190
+ className: t.marginGuide,
2191
+ style: {
2192
+ top: r.margins.top * z * W,
2193
+ right: r.margins.right * z * W,
2194
+ bottom: r.margins.bottom * z * W,
2195
+ left: r.margins.left * z * W
2196
+ }
2197
+ }
2198
+ ),
2199
+ (r.watermarks ?? []).map((c) => /* @__PURE__ */ e(
2200
+ "div",
2201
+ {
2202
+ className: t.watermark,
2203
+ style: {
2204
+ fontSize: (c.fontSize ?? 60) * z,
2205
+ color: c.color ?? be,
2206
+ opacity: c.opacity,
2207
+ transform: `translate(-50%, -50%) rotate(${c.angle}deg)`
2208
+ },
2209
+ children: c.type === "text" ? c.text : /* @__PURE__ */ e(v, { name: "image", size: (c.fontSize ?? 60) * z })
2210
+ },
2211
+ c.id
2212
+ )),
2213
+ r.sections.map((c) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
2214
+ qa,
2215
+ {
2216
+ section: c,
2217
+ zoom: z,
2218
+ paperWidthMm: ee,
2219
+ selectedIds: s,
2220
+ sampleData: je,
2221
+ readOnly: N,
2222
+ showGrid: b,
2223
+ onFieldClick: Me,
2224
+ onFieldDragStart: Fe,
2225
+ onResizeStart: He,
2226
+ onSectionHeightChange: Ue,
2227
+ onDropField: Ee
2228
+ }
2229
+ ) }, c.id))
2230
+ ] })
2169
2231
  }
2170
- }
2171
- ),
2172
- (l.watermarks ?? []).map((d) => /* @__PURE__ */ e(
2173
- "div",
2174
- {
2175
- className: t.watermark,
2176
- style: {
2177
- fontSize: (d.fontSize ?? 60) * c,
2178
- color: d.color ?? ge,
2179
- opacity: d.opacity,
2180
- transform: `translate(-50%, -50%) rotate(${d.angle}deg)`
2181
- },
2182
- children: d.type === "text" ? d.text : /* @__PURE__ */ e(S, { name: "image", size: (d.fontSize ?? 60) * c })
2183
- },
2184
- d.id
2185
- )),
2186
- l.sections.map((d) => /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(
2187
- Pa,
2188
- {
2189
- section: d,
2190
- zoom: c,
2191
- paperWidthMm: ee,
2192
- selectedIds: y,
2193
- sampleData: We,
2194
- readOnly: N,
2195
- showGrid: Z,
2196
- onFieldClick: Ae,
2197
- onFieldDragStart: Ee,
2198
- onResizeStart: Me,
2199
- onSectionHeightChange: qe,
2200
- onDropField: Re
2201
- }
2202
- ) }, d.id))
2203
- ] }) })
2204
- ] })
2232
+ )
2233
+ ]
2234
+ }
2235
+ )
2205
2236
  }
2206
2237
  );
2207
- }, Ya = "_root_7m4s0_1", ja = "_dark_7m4s0_25", Ua = "_topBar_7m4s0_39", Va = "_searchInput_7m4s0_69", Xa = "_actionBtn_7m4s0_111", Ka = "_categoryRow_7m4s0_157", Ja = "_catChip_7m4s0_187", Qa = "_catChipActive_7m4s0_217", Za = "_grid_7m4s0_231", ei = "_card_7m4s0_253", ti = "_cardSelected_7m4s0_285", ni = "_thumbnail_7m4s0_307", ai = "_thumbnailImg_7m4s0_321", ii = "_thumbnailPlaceholder_7m4s0_333", si = "_paperMini_7m4s0_347", ri = "_paperLine_7m4s0_371", oi = "_cardOverlay_7m4s0_385", li = "_overlayBtn_7m4s0_405", ci = "_overlayBtnDanger_7m4s0_441", di = "_cardBody_7m4s0_481", mi = "_cardName_7m4s0_489", pi = "_cardDesc_7m4s0_517", ui = "_cardMeta_7m4s0_539", hi = "_cardSize_7m4s0_553", _i = "_cardCat_7m4s0_569", gi = "_cardTags_7m4s0_585", bi = "_cardTag_7m4s0_585", yi = "_emptyState_7m4s0_617", fi = "_emptyIcon_7m4s0_639", $ = {
2208
- root: Ya,
2209
- dark: ja,
2210
- topBar: Ua,
2211
- searchInput: Va,
2212
- actionBtn: Xa,
2213
- categoryRow: Ka,
2214
- catChip: Ja,
2215
- catChipActive: Qa,
2216
- grid: Za,
2217
- card: ei,
2218
- cardSelected: ti,
2219
- thumbnail: ni,
2220
- thumbnailImg: ai,
2221
- thumbnailPlaceholder: ii,
2222
- paperMini: si,
2223
- paperLine: ri,
2224
- cardOverlay: oi,
2225
- overlayBtn: li,
2226
- overlayBtnDanger: ci,
2227
- cardBody: di,
2228
- cardName: mi,
2229
- cardDesc: pi,
2230
- cardMeta: ui,
2231
- cardSize: hi,
2232
- cardCat: _i,
2233
- cardTags: gi,
2234
- cardTag: bi,
2235
- emptyState: yi,
2236
- emptyIcon: fi
2237
- }, vi = [], Ni = [
2238
+ }, Xa = "_root_7m4s0_1", Ja = "_dark_7m4s0_25", Za = "_topBar_7m4s0_39", Qa = "_searchInput_7m4s0_69", ei = "_actionBtn_7m4s0_111", ti = "_categoryRow_7m4s0_157", ni = "_catChip_7m4s0_187", ai = "_catChipActive_7m4s0_217", ii = "_grid_7m4s0_231", si = "_card_7m4s0_253", ri = "_cardSelected_7m4s0_285", oi = "_thumbnail_7m4s0_307", li = "_thumbnailImg_7m4s0_321", ci = "_thumbnailPlaceholder_7m4s0_333", di = "_paperMini_7m4s0_347", mi = "_paperLine_7m4s0_371", pi = "_cardOverlay_7m4s0_385", ui = "_overlayBtn_7m4s0_405", hi = "_overlayBtnDanger_7m4s0_441", gi = "_cardBody_7m4s0_481", _i = "_cardName_7m4s0_489", bi = "_cardDesc_7m4s0_517", yi = "_cardMeta_7m4s0_539", fi = "_cardSize_7m4s0_553", vi = "_cardCat_7m4s0_569", Ni = "_cardTags_7m4s0_585", wi = "_cardTag_7m4s0_585", ki = "_emptyState_7m4s0_617", Si = "_emptyIcon_7m4s0_639", $ = {
2239
+ root: Xa,
2240
+ dark: Ja,
2241
+ topBar: Za,
2242
+ searchInput: Qa,
2243
+ actionBtn: ei,
2244
+ categoryRow: ti,
2245
+ catChip: ni,
2246
+ catChipActive: ai,
2247
+ grid: ii,
2248
+ card: si,
2249
+ cardSelected: ri,
2250
+ thumbnail: oi,
2251
+ thumbnailImg: li,
2252
+ thumbnailPlaceholder: ci,
2253
+ paperMini: di,
2254
+ paperLine: mi,
2255
+ cardOverlay: pi,
2256
+ overlayBtn: ui,
2257
+ overlayBtnDanger: hi,
2258
+ cardBody: gi,
2259
+ cardName: _i,
2260
+ cardDesc: bi,
2261
+ cardMeta: yi,
2262
+ cardSize: fi,
2263
+ cardCat: vi,
2264
+ cardTags: Ni,
2265
+ cardTag: wi,
2266
+ emptyState: ki,
2267
+ emptyIcon: Si
2268
+ }, Ci = [], Bi = [
2238
2269
  { key: "printing.category.invoices", fallback: "Invoices" },
2239
2270
  { key: "printing.category.reports", fallback: "Reports" },
2240
2271
  { key: "printing.category.labels", fallback: "Labels" },
@@ -2242,55 +2273,55 @@ const lr = ({
2242
2273
  { key: "printing.category.contracts", fallback: "Contracts" },
2243
2274
  { key: "printing.category.other", fallback: "Other" }
2244
2275
  ];
2245
- function wi(n) {
2246
- return new Promise((s, m) => {
2247
- const o = new FileReader();
2248
- o.onload = (B) => {
2276
+ function Ii(n) {
2277
+ return new Promise((o, d) => {
2278
+ const l = new FileReader();
2279
+ l.onload = (C) => {
2249
2280
  var N;
2250
2281
  try {
2251
- s(JSON.parse((N = B.target) == null ? void 0 : N.result));
2252
- } catch (b) {
2253
- m(b);
2282
+ o(JSON.parse((N = C.target) == null ? void 0 : N.result));
2283
+ } catch (_) {
2284
+ d(_);
2254
2285
  }
2255
- }, o.readAsText(n);
2286
+ }, l.readAsText(n);
2256
2287
  });
2257
2288
  }
2258
- function ki(n) {
2259
- const s = new Blob([JSON.stringify(n, null, 2)], { type: "application/json" }), m = URL.createObjectURL(s), o = document.createElement("a");
2260
- o.href = m, o.download = `${n.name.replace(/\s+/g, "_")}.json`, o.click(), URL.revokeObjectURL(m);
2289
+ function Li(n) {
2290
+ const o = new Blob([JSON.stringify(n, null, 2)], { type: "application/json" }), d = URL.createObjectURL(o), l = document.createElement("a");
2291
+ l.href = d, l.download = `${n.name.replace(/\s+/g, "_")}.json`, l.click(), URL.revokeObjectURL(d);
2261
2292
  }
2262
- const cr = ({
2263
- templates: n = vi,
2264
- selectedId: s,
2265
- onSelect: m,
2266
- onImport: o,
2267
- onExport: B,
2293
+ const hr = ({
2294
+ templates: n = Ci,
2295
+ selectedId: o,
2296
+ onSelect: d,
2297
+ onImport: l,
2298
+ onExport: C,
2268
2299
  onDelete: N,
2269
- onNew: b,
2270
- className: h,
2271
- style: g,
2272
- theme: _ = "light"
2300
+ onNew: _,
2301
+ className: g,
2302
+ style: f,
2303
+ theme: k = "light"
2273
2304
  }) => {
2274
- const { t: l } = X(), [f, C] = H(""), [z, y] = H(null), [r, i] = H(null), u = Xe.useRef(null), c = async (v) => {
2275
- var x;
2276
- const D = (x = v.target.files) == null ? void 0 : x[0];
2277
- if (D) {
2305
+ const { t: u } = j(), [r, S] = H(""), [I, x] = H(null), [s, i] = H(null), m = tt.useRef(null), h = async (y) => {
2306
+ var T;
2307
+ const R = (T = y.target.files) == null ? void 0 : T[0];
2308
+ if (R) {
2278
2309
  try {
2279
- const T = await wi(D);
2280
- o == null || o(T);
2310
+ const D = await Ii(R);
2311
+ l == null || l(D);
2281
2312
  } catch {
2282
2313
  }
2283
- v.target.value = "";
2314
+ y.target.value = "";
2284
2315
  }
2285
- }, F = n.filter((v) => {
2286
- const D = !f || v.name.toLowerCase().includes(f.toLowerCase()) || (v.description ?? "").toLowerCase().includes(f.toLowerCase()) || (v.tags ?? []).some((T) => T.toLowerCase().includes(f.toLowerCase())), x = !z || v.category === z;
2287
- return D && x;
2316
+ }, z = n.filter((y) => {
2317
+ const R = !r || y.name.toLowerCase().includes(r.toLowerCase()) || (y.description ?? "").toLowerCase().includes(r.toLowerCase()) || (y.tags ?? []).some((D) => D.toLowerCase().includes(r.toLowerCase())), T = !I || y.category === I;
2318
+ return R && T;
2288
2319
  });
2289
2320
  return /* @__PURE__ */ a(
2290
2321
  "div",
2291
2322
  {
2292
- className: `${$.root} ${_ === "dark" ? $.dark : ""} ${h ?? ""}`,
2293
- style: g,
2323
+ className: `${$.root} ${k === "dark" ? $.dark : ""} ${g ?? ""}`,
2324
+ style: f,
2294
2325
  children: [
2295
2326
  /* @__PURE__ */ a("div", { className: $.topBar, children: [
2296
2327
  /* @__PURE__ */ e(
@@ -2298,21 +2329,21 @@ const cr = ({
2298
2329
  {
2299
2330
  type: "search",
2300
2331
  className: $.searchInput,
2301
- placeholder: l("printing.searchTemplates", "Search templates…"),
2302
- value: f,
2303
- onChange: (v) => C(v.target.value)
2332
+ placeholder: u("printing.searchTemplates", "Search templates…"),
2333
+ value: r,
2334
+ onChange: (y) => S(y.target.value)
2304
2335
  }
2305
2336
  ),
2306
2337
  /* @__PURE__ */ a(
2307
2338
  "button",
2308
2339
  {
2309
2340
  className: $.actionBtn,
2310
- onClick: b,
2311
- title: l("printing.newTemplate", "New template"),
2341
+ onClick: _,
2342
+ title: u("printing.newTemplate", "New template"),
2312
2343
  children: [
2313
- /* @__PURE__ */ e(S, { name: "plus", size: 14 }),
2344
+ /* @__PURE__ */ e(v, { name: "plus", size: 14 }),
2314
2345
  " ",
2315
- l("printing.new", "New")
2346
+ u("printing.new", "New")
2316
2347
  ]
2317
2348
  }
2318
2349
  ),
@@ -2321,49 +2352,52 @@ const cr = ({
2321
2352
  {
2322
2353
  className: $.actionBtn,
2323
2354
  onClick: () => {
2324
- var v;
2325
- return (v = u.current) == null ? void 0 : v.click();
2355
+ var y;
2356
+ return (y = m.current) == null ? void 0 : y.click();
2326
2357
  },
2327
- title: l("printing.importJson", "Import JSON"),
2358
+ title: u("printing.importJson", "Import JSON"),
2328
2359
  children: [
2329
- /* @__PURE__ */ e(S, { name: "upload", size: 14 }),
2360
+ /* @__PURE__ */ e(v, { name: "upload", size: 14 }),
2330
2361
  " ",
2331
- l("printing.import", "Import")
2362
+ u("printing.import", "Import")
2332
2363
  ]
2333
2364
  }
2334
2365
  ),
2335
- /* @__PURE__ */ e("input", { ref: u, type: "file", accept: ".json", hidden: !0, onChange: c })
2366
+ /* @__PURE__ */ e("input", { ref: m, type: "file", accept: ".json", hidden: !0, onChange: h })
2336
2367
  ] }),
2337
2368
  /* @__PURE__ */ a("div", { className: $.categoryRow, children: [
2338
2369
  /* @__PURE__ */ e(
2339
2370
  "button",
2340
2371
  {
2341
- className: `${$.catChip} ${z ? "" : $.catChipActive}`,
2342
- onClick: () => y(null),
2343
- children: l("printing.filter.all", "All")
2372
+ className: `${$.catChip} ${I ? "" : $.catChipActive}`,
2373
+ onClick: () => x(null),
2374
+ children: u("printing.filter.all", "All")
2344
2375
  }
2345
2376
  ),
2346
- Ni.map((v) => /* @__PURE__ */ e(
2377
+ Bi.map((y) => /* @__PURE__ */ e(
2347
2378
  "button",
2348
2379
  {
2349
- className: `${$.catChip} ${z === v.fallback ? $.catChipActive : ""}`,
2350
- onClick: () => y((D) => D === v.fallback ? null : v.fallback),
2351
- children: l(v.key, v.fallback)
2380
+ className: `${$.catChip} ${I === y.fallback ? $.catChipActive : ""}`,
2381
+ onClick: () => x((R) => R === y.fallback ? null : y.fallback),
2382
+ children: u(y.key, y.fallback)
2352
2383
  },
2353
- v.key
2384
+ y.key
2354
2385
  ))
2355
2386
  ] }),
2356
2387
  /* @__PURE__ */ a("div", { className: $.grid, children: [
2357
- F.map((v) => /* @__PURE__ */ a(
2388
+ z.map((y) => /* @__PURE__ */ a(
2358
2389
  "div",
2359
2390
  {
2360
- className: `${$.card} ${s === v.id ? $.cardSelected : ""}`,
2361
- onClick: () => m == null ? void 0 : m(v),
2362
- onMouseEnter: () => i(v.id),
2391
+ role: d ? "button" : void 0,
2392
+ tabIndex: d ? 0 : void 0,
2393
+ onKeyDown: d ? we : void 0,
2394
+ className: `${$.card} ${o === y.id ? $.cardSelected : ""}`,
2395
+ onClick: () => d == null ? void 0 : d(y),
2396
+ onMouseEnter: () => i(y.id),
2363
2397
  onMouseLeave: () => i(null),
2364
2398
  children: [
2365
2399
  /* @__PURE__ */ a("div", { className: $.thumbnail, children: [
2366
- v.previewImageUrl ? /* @__PURE__ */ e("img", { src: v.previewImageUrl, alt: v.name, className: $.thumbnailImg }) : /* @__PURE__ */ e("div", { className: $.thumbnailPlaceholder, children: /* @__PURE__ */ a("div", { className: $.paperMini, children: [
2400
+ y.previewImageUrl ? /* @__PURE__ */ e("img", { src: y.previewImageUrl, alt: y.name, className: $.thumbnailImg }) : /* @__PURE__ */ e("div", { className: $.thumbnailPlaceholder, children: /* @__PURE__ */ a("div", { className: $.paperMini, children: [
2367
2401
  /* @__PURE__ */ e(
2368
2402
  "div",
2369
2403
  {
@@ -2393,73 +2427,73 @@ const cr = ({
2393
2427
  }
2394
2428
  )
2395
2429
  ] }) }),
2396
- r === v.id && /* @__PURE__ */ a("div", { className: $.cardOverlay, children: [
2430
+ s === y.id && /* @__PURE__ */ a("div", { className: $.cardOverlay, children: [
2397
2431
  /* @__PURE__ */ e(
2398
2432
  "button",
2399
2433
  {
2400
2434
  className: $.overlayBtn,
2401
- onClick: (D) => {
2402
- D.stopPropagation(), B == null || B(v), ki(v);
2435
+ onClick: (R) => {
2436
+ R.stopPropagation(), C == null || C(y), Li(y);
2403
2437
  },
2404
- title: l("printing.export", "Export"),
2405
- children: /* @__PURE__ */ e(S, { name: "download", size: 14 })
2438
+ title: u("printing.export", "Export"),
2439
+ children: /* @__PURE__ */ e(v, { name: "download", size: 14 })
2406
2440
  }
2407
2441
  ),
2408
2442
  N && /* @__PURE__ */ e(
2409
2443
  "button",
2410
2444
  {
2411
2445
  className: $.overlayBtnDanger,
2412
- onClick: (D) => {
2413
- D.stopPropagation(), N(v.id);
2446
+ onClick: (R) => {
2447
+ R.stopPropagation(), N(y.id);
2414
2448
  },
2415
- title: l("printing.action.remove", "Remove"),
2416
- children: /* @__PURE__ */ e(S, { name: "trash", size: 14 })
2449
+ title: u("printing.action.remove", "Remove"),
2450
+ children: /* @__PURE__ */ e(v, { name: "trash", size: 14 })
2417
2451
  }
2418
2452
  )
2419
2453
  ] })
2420
2454
  ] }),
2421
2455
  /* @__PURE__ */ a("div", { className: $.cardBody, children: [
2422
- /* @__PURE__ */ e("div", { className: $.cardName, children: v.name }),
2423
- v.description && /* @__PURE__ */ e("div", { className: $.cardDesc, children: v.description }),
2456
+ /* @__PURE__ */ e("div", { className: $.cardName, children: y.name }),
2457
+ y.description && /* @__PURE__ */ e("div", { className: $.cardDesc, children: y.description }),
2424
2458
  /* @__PURE__ */ a("div", { className: $.cardMeta, children: [
2425
2459
  /* @__PURE__ */ a("span", { className: $.cardSize, children: [
2426
- v.paperSize,
2460
+ y.paperSize,
2427
2461
  " ",
2428
- v.orientation === "landscape" ? l("printing.orientation.landscape", "landscape") : l("printing.orientation.portrait", "portrait")
2462
+ y.orientation === "landscape" ? u("printing.orientation.landscape", "landscape") : u("printing.orientation.portrait", "portrait")
2429
2463
  ] }),
2430
- v.category && /* @__PURE__ */ e("span", { className: $.cardCat, children: v.category })
2464
+ y.category && /* @__PURE__ */ e("span", { className: $.cardCat, children: y.category })
2431
2465
  ] }),
2432
- v.tags && v.tags.length > 0 && /* @__PURE__ */ e("div", { className: $.cardTags, children: v.tags.slice(0, 3).map((D) => /* @__PURE__ */ e("span", { className: $.cardTag, children: D }, D)) })
2466
+ y.tags && y.tags.length > 0 && /* @__PURE__ */ e("div", { className: $.cardTags, children: y.tags.slice(0, 3).map((R) => /* @__PURE__ */ e("span", { className: $.cardTag, children: R }, R)) })
2433
2467
  ] })
2434
2468
  ]
2435
2469
  },
2436
- v.id
2470
+ y.id
2437
2471
  )),
2438
- F.length === 0 && /* @__PURE__ */ a("div", { className: $.emptyState, children: [
2439
- /* @__PURE__ */ e("span", { className: $.emptyIcon, children: /* @__PURE__ */ e(S, { name: "file", size: 32 }) }),
2440
- /* @__PURE__ */ e("span", { children: f ? `${l("printing.noMatches", "No matches for")} "${f}"` : l("printing.noTemplates", "No templates yet.") })
2472
+ z.length === 0 && /* @__PURE__ */ a("div", { className: $.emptyState, children: [
2473
+ /* @__PURE__ */ e("span", { className: $.emptyIcon, children: /* @__PURE__ */ e(v, { name: "file", size: 32 }) }),
2474
+ /* @__PURE__ */ e("span", { children: r ? `${u("printing.noMatches", "No matches for")} "${r}"` : u("printing.noTemplates", "No templates yet.") })
2441
2475
  ] })
2442
2476
  ] })
2443
2477
  ]
2444
2478
  }
2445
2479
  );
2446
- }, Si = "_root_18ja1_1", Ci = "_dark_18ja1_19", Bi = "_headerBar_18ja1_31", Ii = "_entityNav_18ja1_59", Li = "_navBtn_18ja1_69", xi = "_navLabel_18ja1_103", zi = "_sampleBadge_18ja1_117", Ti = "_zoomBar_18ja1_135", $i = "_zoomBtn_18ja1_147", Di = "_zoomLabel_18ja1_179", Ri = "_printBtn_18ja1_193", Ai = "_canvas_18ja1_223", Ei = "_page_18ja1_243", Mi = "_watermark_18ja1_269", Pi = "_footerBar_18ja1_299", q = {
2447
- root: Si,
2448
- dark: Ci,
2449
- headerBar: Bi,
2450
- entityNav: Ii,
2451
- navBtn: Li,
2452
- navLabel: xi,
2453
- sampleBadge: zi,
2454
- zoomBar: Ti,
2455
- zoomBtn: $i,
2456
- zoomLabel: Di,
2457
- printBtn: Ri,
2458
- canvas: Ai,
2459
- page: Ei,
2460
- watermark: Mi,
2461
- footerBar: Pi
2462
- }, Q = 3.78, $e = {
2480
+ }, xi = "_root_18ja1_1", zi = "_dark_18ja1_19", Ti = "_headerBar_18ja1_31", Di = "_entityNav_18ja1_59", $i = "_navBtn_18ja1_69", Ri = "_navLabel_18ja1_103", Ai = "_sampleBadge_18ja1_117", Pi = "_zoomBar_18ja1_135", Ei = "_zoomBtn_18ja1_147", Mi = "_zoomLabel_18ja1_179", Fi = "_printBtn_18ja1_193", Hi = "_canvas_18ja1_223", Gi = "_page_18ja1_243", Oi = "_watermark_18ja1_269", qi = "_footerBar_18ja1_299", q = {
2481
+ root: xi,
2482
+ dark: zi,
2483
+ headerBar: Ti,
2484
+ entityNav: Di,
2485
+ navBtn: $i,
2486
+ navLabel: Ri,
2487
+ sampleBadge: Ai,
2488
+ zoomBar: Pi,
2489
+ zoomBtn: Ei,
2490
+ zoomLabel: Mi,
2491
+ printBtn: Fi,
2492
+ canvas: Hi,
2493
+ page: Gi,
2494
+ watermark: Oi,
2495
+ footerBar: qi
2496
+ }, Q = 3.78, Re = {
2463
2497
  A3: [297, 420],
2464
2498
  A4: [210, 297],
2465
2499
  A5: [148, 210],
@@ -2468,42 +2502,42 @@ const cr = ({
2468
2502
  Legal: [216, 356],
2469
2503
  Tabloid: [279, 432]
2470
2504
  };
2471
- function Fi(n, s) {
2505
+ function Wi(n, o) {
2472
2506
  try {
2473
- return n.split(".").reduce((m, o) => m && typeof m == "object" ? m[o] : null, s);
2507
+ return n.split(".").reduce((d, l) => d && typeof d == "object" ? d[l] : null, o);
2474
2508
  } catch {
2475
2509
  return null;
2476
2510
  }
2477
2511
  }
2478
- function Hi(n, s, m) {
2512
+ function Yi(n, o, d) {
2479
2513
  if (n == null)
2480
2514
  return "";
2481
- if (s === "date" && m)
2515
+ if (o === "date" && d)
2482
2516
  try {
2483
- const o = new Date(n);
2484
- if (m === "DD.MM.YYYY") {
2485
- const B = String(o.getDate()).padStart(2, "0"), N = String(o.getMonth() + 1).padStart(2, "0");
2486
- return `${B}.${N}.${o.getFullYear()}`;
2517
+ const l = new Date(n);
2518
+ if (d === "DD.MM.YYYY") {
2519
+ const C = String(l.getDate()).padStart(2, "0"), N = String(l.getMonth() + 1).padStart(2, "0");
2520
+ return `${C}.${N}.${l.getFullYear()}`;
2487
2521
  }
2488
- return o.toLocaleDateString();
2522
+ return l.toLocaleDateString();
2489
2523
  } catch {
2490
2524
  return String(n);
2491
2525
  }
2492
- if (s === "currency" && m) {
2493
- const o = Number(n);
2494
- if (!isNaN(o))
2495
- return `${o.toFixed(2)} ${m}`;
2526
+ if (o === "currency" && d) {
2527
+ const l = Number(n);
2528
+ if (!isNaN(l))
2529
+ return `${l.toFixed(2)} ${d}`;
2496
2530
  }
2497
- return s === "number" && typeof n == "number" ? n.toLocaleString("pl-PL") : String(n);
2531
+ return o === "number" && typeof n == "number" ? n.toLocaleString("pl-PL") : String(n);
2498
2532
  }
2499
- const Gi = ({ field: n, data: s, zoom: m }) => {
2500
- const o = n.dataPath ? Fi(n.dataPath, s) : null, B = o != null ? Hi(o, n.type, n.format) : n.fallback ?? "", N = (h) => h * m * Q, b = {
2533
+ const Ui = ({ field: n, data: o, zoom: d }) => {
2534
+ const l = n.dataPath ? Wi(n.dataPath, o) : null, C = l != null ? Yi(l, n.type, n.format) : n.fallback ?? "", N = (g) => g * d * Q, _ = {
2501
2535
  position: "absolute",
2502
2536
  left: N(n.position.x),
2503
2537
  top: N(n.position.y),
2504
2538
  width: N(n.position.width),
2505
2539
  height: N(n.position.height),
2506
- fontSize: (n.style.fontSize ?? 10) * m,
2540
+ fontSize: (n.style.fontSize ?? 10) * d,
2507
2541
  fontWeight: n.style.fontWeight ?? "normal",
2508
2542
  fontStyle: n.style.fontStyle ?? "normal",
2509
2543
  color: n.style.color ?? "var(--nice-text-primary, #0f172a)",
@@ -2522,10 +2556,10 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
2522
2556
  borderRadius: n.style.borderRadius,
2523
2557
  zIndex: n.position.zIndex ?? 1
2524
2558
  };
2525
- return n.type === "image" && o ? /* @__PURE__ */ e("div", { style: b, children: /* @__PURE__ */ e(
2559
+ return n.type === "image" && l ? /* @__PURE__ */ e("div", { style: _, children: /* @__PURE__ */ e(
2526
2560
  "img",
2527
2561
  {
2528
- src: String(o),
2562
+ src: String(l),
2529
2563
  alt: "",
2530
2564
  style: { width: "100%", height: "100%", objectFit: "contain" }
2531
2565
  }
@@ -2533,156 +2567,201 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
2533
2567
  "div",
2534
2568
  {
2535
2569
  style: {
2536
- ...b,
2570
+ ..._,
2537
2571
  background: "var(--nice-bg-secondary, #f8fafc)",
2538
2572
  border: "1px dashed var(--nice-border-color, #e2e8f0)",
2539
2573
  alignItems: "center",
2540
2574
  justifyContent: "center",
2541
- fontSize: 10 * m
2575
+ fontSize: 10 * d
2542
2576
  },
2543
2577
  children: [
2544
- /* @__PURE__ */ e(S, { name: n.type === "qr" ? "qr-code" : "barcode", size: 12 * m }),
2578
+ /* @__PURE__ */ e(v, { name: n.type === "qr" ? "qr-code" : "barcode", size: 12 * d }),
2545
2579
  " ",
2546
- B
2580
+ C
2547
2581
  ]
2548
2582
  }
2549
2583
  ) : n.type === "signature" ? /* @__PURE__ */ e(
2550
2584
  "div",
2551
2585
  {
2552
2586
  style: {
2553
- ...b,
2587
+ ..._,
2554
2588
  borderBottom: "1px solid var(--nice-border-color, #0f172a)",
2555
2589
  alignItems: "flex-end"
2556
2590
  },
2557
- children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * m, color: "var(--nice-text-muted, #94a3b8)" }, children: n.label })
2591
+ children: /* @__PURE__ */ e("span", { style: { fontSize: 8 * d, color: "var(--nice-text-muted, #94a3b8)" }, children: n.label })
2558
2592
  }
2559
2593
  ) : n.type === "line" ? /* @__PURE__ */ e(
2560
2594
  "div",
2561
2595
  {
2562
2596
  style: {
2563
- ...b,
2597
+ ..._,
2564
2598
  borderBottom: `${n.style.borderWidth ?? 1}px ${n.style.borderStyle ?? "solid"} ${n.style.borderColor ?? "var(--nice-text-primary, #0f172a)"}`
2565
2599
  }
2566
2600
  }
2567
- ) : /* @__PURE__ */ e("div", { style: b, children: B });
2568
- }, Oi = ({ template: n, data: s, zoom: m }) => {
2569
- var h;
2570
- const [o, B] = (() => {
2571
- const [g, _] = $e[n.paperSize] ?? $e.A4;
2572
- return n.orientation === "landscape" ? [_ * Q * m, g * Q * m] : [g * Q * m, _ * Q * m];
2573
- })(), N = n.margins, b = n.sections.flatMap((g) => g.fields);
2574
- return /* @__PURE__ */ a("div", { className: q.page, style: { width: o, minHeight: B }, children: [
2601
+ ) : /* @__PURE__ */ e("div", { style: _, children: C });
2602
+ }, ji = ({ template: n, data: o, zoom: d }) => {
2603
+ var g;
2604
+ const [l, C] = (() => {
2605
+ const [f, k] = Re[n.paperSize] ?? Re.A4;
2606
+ return n.orientation === "landscape" ? [k * Q * d, f * Q * d] : [f * Q * d, k * Q * d];
2607
+ })(), N = n.margins, _ = n.sections.flatMap((f) => f.fields);
2608
+ return /* @__PURE__ */ a("div", { className: q.page, style: { width: l, minHeight: C }, children: [
2575
2609
  /* @__PURE__ */ e(
2576
2610
  "div",
2577
2611
  {
2578
2612
  style: {
2579
2613
  position: "absolute",
2580
- top: N.top * m * Q,
2581
- left: N.left * m * Q,
2582
- right: N.right * m * Q,
2583
- bottom: N.bottom * m * Q
2614
+ top: N.top * d * Q,
2615
+ left: N.left * d * Q,
2616
+ right: N.right * d * Q,
2617
+ bottom: N.bottom * d * Q
2584
2618
  },
2585
- children: b.map((g) => /* @__PURE__ */ e(Gi, { field: g, data: s, zoom: m }, g.id))
2619
+ children: _.map((f) => /* @__PURE__ */ e(Ui, { field: f, data: o, zoom: d }, f.id))
2586
2620
  }
2587
2621
  ),
2588
- (h = n.watermarks) == null ? void 0 : h.map((g) => /* @__PURE__ */ e(
2622
+ (g = n.watermarks) == null ? void 0 : g.map((f) => /* @__PURE__ */ e(
2589
2623
  "div",
2590
2624
  {
2591
2625
  className: q.watermark,
2592
2626
  style: {
2593
- opacity: g.opacity,
2594
- transform: `rotate(${g.angle}deg)`,
2595
- fontSize: (g.fontSize ?? 48) * m
2627
+ opacity: f.opacity,
2628
+ transform: `rotate(${f.angle}deg)`,
2629
+ fontSize: (f.fontSize ?? 48) * d
2596
2630
  },
2597
- children: g.type === "text" ? g.text : /* @__PURE__ */ e(
2631
+ children: f.type === "text" ? f.text : /* @__PURE__ */ e(
2598
2632
  "img",
2599
2633
  {
2600
- src: g.imageUrl,
2634
+ src: f.imageUrl,
2601
2635
  alt: "wm",
2602
- style: { maxWidth: 200 * m }
2636
+ style: { maxWidth: 200 * d }
2603
2637
  }
2604
2638
  )
2605
2639
  },
2606
- g.id
2640
+ f.id
2607
2641
  ))
2608
2642
  ] });
2609
- }, dr = ({
2643
+ }, gr = ({
2610
2644
  template: n,
2611
- entities: s = [],
2612
- sampleData: m,
2613
- onPrint: o,
2614
- className: B,
2645
+ entities: o = [],
2646
+ sampleData: d,
2647
+ onPrint: l,
2648
+ className: C,
2615
2649
  style: N,
2616
- theme: b = "light",
2617
- asPopup: h = !0,
2618
- open: g,
2619
- onClose: _
2650
+ theme: _ = "light",
2651
+ asPopup: g = !0,
2652
+ open: f,
2653
+ onClose: k
2620
2654
  }) => {
2621
- const { t: l } = X(), [f, C] = H(0), [z, y] = H(0.8), [r, i] = H(!0), u = g !== void 0, c = u ? g : r, F = () => {
2622
- u || i(!1), _ == null || _();
2655
+ const { t: u } = j(), [r, S] = H(0), [I, x] = H(0.8), [s, i] = H(!0), m = f !== void 0, h = m ? f : s, z = () => {
2656
+ m || i(!1), k == null || k();
2623
2657
  };
2624
- Se(() => {
2625
- if (!h || !c)
2626
- return;
2627
- const A = (Y) => {
2628
- Y.key === "Escape" && F();
2629
- };
2630
- return document.addEventListener("keydown", A), document.body.style.overflow = "hidden", () => {
2631
- document.removeEventListener("keydown", A), document.body.style.overflow = "";
2632
- };
2633
- }, [h, c]);
2634
- const v = ue(() => s.length > 0 ? s : m ? [m.data] : [{}], [s, m]), D = v[f] ?? {};
2635
- if (h && !c)
2658
+ Be(() => {
2659
+ if (!(!g || !h))
2660
+ return document.body.style.overflow = "hidden", () => {
2661
+ document.body.style.overflow = "";
2662
+ };
2663
+ }, [g, h]);
2664
+ const y = ue(() => o.length > 0 ? o : d ? [d.data] : [{}], [o, d]), R = y[r] ?? {}, T = ke(null), D = ke(null);
2665
+ if (Ze(T, { open: g && h, onClose: z }), Qe(
2666
+ ["sectionPrev", "sectionNext", "pagePrev", "pageNext"],
2667
+ (P) => {
2668
+ if (P.intent === "sectionPrev" || P.intent === "sectionNext") {
2669
+ const b = P.intent === "sectionNext" ? 1 : -1;
2670
+ S((V) => Math.min(Math.max(V + b, 0), y.length - 1));
2671
+ } else {
2672
+ if (P.source === "keyboard")
2673
+ return !1;
2674
+ {
2675
+ const b = P.intent === "pageNext" ? 0.1 : -0.1;
2676
+ x((V) => Math.min(2.5, Math.max(0.3, V + b)));
2677
+ }
2678
+ }
2679
+ },
2680
+ { ref: D, enabled: !g || h }
2681
+ ), et(
2682
+ D,
2683
+ !g || h ? [
2684
+ ...y.length > 1 ? [
2685
+ {
2686
+ intent: "sectionPrev",
2687
+ label: u("printPreview.previousPage", "Previous page")
2688
+ },
2689
+ { intent: "sectionNext", label: u("printPreview.nextPage", "Next page") }
2690
+ ] : [],
2691
+ { intent: "pageNext", label: u("printPreview.zoomIn", "Zoom in") },
2692
+ { intent: "pagePrev", label: u("printPreview.zoomOut", "Zoom out") }
2693
+ ] : []
2694
+ ), g && !h)
2636
2695
  return null;
2637
- const x = /* @__PURE__ */ a(
2696
+ const Y = /* @__PURE__ */ a(
2638
2697
  "div",
2639
2698
  {
2640
- className: `${q.root} ${b === "dark" ? q.dark : ""} ${B ?? ""}`,
2699
+ ref: D,
2700
+ className: `${q.root} ${_ === "dark" ? q.dark : ""} ${C ?? ""}`,
2641
2701
  style: N,
2642
2702
  children: [
2643
2703
  /* @__PURE__ */ a("div", { className: q.headerBar, children: [
2644
2704
  /* @__PURE__ */ a("div", { className: q.entityNav, children: [
2645
- v.length > 1 && /* @__PURE__ */ a(V, { children: [
2705
+ y.length > 1 && /* @__PURE__ */ a(J, { children: [
2646
2706
  /* @__PURE__ */ e(
2647
2707
  "button",
2648
2708
  {
2649
2709
  className: q.navBtn,
2650
- disabled: f === 0,
2651
- onClick: () => C((A) => A - 1),
2652
- children: "‹"
2710
+ disabled: r === 0,
2711
+ onClick: () => S((P) => P - 1),
2712
+ "aria-label": u("printPreview.previousPage", "Previous page"),
2713
+ children: /* @__PURE__ */ e(v, { name: "chevron-left", size: 14 })
2653
2714
  }
2654
2715
  ),
2655
2716
  /* @__PURE__ */ a("span", { className: q.navLabel, children: [
2656
- f + 1,
2717
+ r + 1,
2657
2718
  " / ",
2658
- v.length
2719
+ y.length
2659
2720
  ] }),
2660
2721
  /* @__PURE__ */ e(
2661
2722
  "button",
2662
2723
  {
2663
2724
  className: q.navBtn,
2664
- disabled: f >= v.length - 1,
2665
- onClick: () => C((A) => A + 1),
2666
- children: "›"
2725
+ disabled: r >= y.length - 1,
2726
+ onClick: () => S((P) => P + 1),
2727
+ "aria-label": u("printPreview.nextPage", "Next page"),
2728
+ children: /* @__PURE__ */ e(v, { name: "chevron-right", size: 14 })
2667
2729
  }
2668
2730
  )
2669
2731
  ] }),
2670
- s.length === 0 && m && /* @__PURE__ */ e("span", { className: q.sampleBadge, children: l("printing.sampleData", "Sample data") })
2732
+ o.length === 0 && d && /* @__PURE__ */ e("span", { className: q.sampleBadge, children: u("printing.sampleData", "Sample data") })
2671
2733
  ] }),
2672
2734
  /* @__PURE__ */ a("div", { className: q.zoomBar, children: [
2673
- /* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => y((A) => Math.max(0.3, A - 0.1)), children: "−" }),
2735
+ /* @__PURE__ */ e(
2736
+ "button",
2737
+ {
2738
+ className: q.zoomBtn,
2739
+ onClick: () => x((P) => Math.max(0.3, P - 0.1)),
2740
+ "aria-label": u("printPreview.zoomOut", "Zoom out"),
2741
+ children: /* @__PURE__ */ e(v, { name: "minus", size: 14 })
2742
+ }
2743
+ ),
2674
2744
  /* @__PURE__ */ a("span", { className: q.zoomLabel, children: [
2675
- Math.round(z * 100),
2745
+ Math.round(I * 100),
2676
2746
  "%"
2677
2747
  ] }),
2678
- /* @__PURE__ */ e("button", { className: q.zoomBtn, onClick: () => y((A) => Math.min(2.5, A + 0.1)), children: "+" }),
2679
2748
  /* @__PURE__ */ e(
2680
2749
  "button",
2681
2750
  {
2682
2751
  className: q.zoomBtn,
2683
- onClick: () => y(0.8),
2684
- title: l("printing.fit", "Fit"),
2685
- children: "⊡"
2752
+ onClick: () => x((P) => Math.min(2.5, P + 0.1)),
2753
+ "aria-label": u("printPreview.zoomIn", "Zoom in"),
2754
+ children: /* @__PURE__ */ e(v, { name: "plus", size: 14 })
2755
+ }
2756
+ ),
2757
+ /* @__PURE__ */ e(
2758
+ "button",
2759
+ {
2760
+ className: q.zoomBtn,
2761
+ onClick: () => x(0.8),
2762
+ title: u("printing.fit", "Fit"),
2763
+ "aria-label": u("printing.fit", "Fit"),
2764
+ children: /* @__PURE__ */ e(v, { name: "expand", size: 14 })
2686
2765
  }
2687
2766
  )
2688
2767
  ] }),
@@ -2691,39 +2770,42 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
2691
2770
  "button",
2692
2771
  {
2693
2772
  className: q.printBtn,
2694
- onClick: () => o == null ? void 0 : o({ copies: 1, printerId: "" }),
2695
- children: l("printPreview.print", "Print")
2773
+ onClick: () => l == null ? void 0 : l({ copies: 1, printerId: "" }),
2774
+ children: u("printPreview.print", "Print")
2696
2775
  }
2697
2776
  ),
2698
- h && /* @__PURE__ */ e(
2777
+ g && /* @__PURE__ */ e(
2699
2778
  "button",
2700
2779
  {
2701
2780
  type: "button",
2702
2781
  className: q.zoomBtn,
2703
- onClick: F,
2704
- "aria-label": l("close", "Close"),
2705
- title: l("close", "Close"),
2706
- children: /* @__PURE__ */ e(S, { name: "close", size: 16 })
2782
+ onClick: z,
2783
+ "aria-label": u("close", "Close"),
2784
+ title: u("close", "Close"),
2785
+ children: /* @__PURE__ */ e(v, { name: "close", size: 16 })
2707
2786
  }
2708
2787
  )
2709
2788
  ] })
2710
2789
  ] }),
2711
- /* @__PURE__ */ e("div", { className: q.canvas, children: /* @__PURE__ */ e(Oi, { template: n, data: D, zoom: z }) }),
2790
+ /* @__PURE__ */ e("div", { className: q.canvas, children: /* @__PURE__ */ e(ji, { template: n, data: R, zoom: I }) }),
2712
2791
  /* @__PURE__ */ a("div", { className: q.footerBar, children: [
2713
2792
  /* @__PURE__ */ e("span", { children: n.name }),
2714
2793
  /* @__PURE__ */ a("span", { children: [
2715
2794
  n.paperSize,
2716
- " · ",
2717
- n.orientation === "portrait" ? "Pion" : "Poziom"
2795
+ " ·",
2796
+ " ",
2797
+ n.orientation === "portrait" ? u("printing.portrait", "Portrait") : u("printing.landscape", "Landscape")
2718
2798
  ] }),
2719
- n.sections.reduce((A, Y) => A + Y.fields.length, 0),
2799
+ n.sections.reduce((P, b) => P + b.fields.length, 0),
2720
2800
  " ",
2721
- l("printing.fields", "fields")
2801
+ u("printing.fields", "fields")
2722
2802
  ] })
2723
2803
  ]
2724
2804
  }
2725
2805
  );
2726
- return h ? Qe(/* @__PURE__ */ e(
2806
+ if (!g)
2807
+ return Y;
2808
+ const X = /* @__PURE__ */ e(
2727
2809
  "div",
2728
2810
  {
2729
2811
  style: {
@@ -2736,15 +2818,17 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
2736
2818
  zIndex: 1e3,
2737
2819
  padding: 24
2738
2820
  },
2739
- onMouseDown: (A) => {
2740
- A.target === A.currentTarget && F();
2821
+ onMouseDown: (P) => {
2822
+ P.target === P.currentTarget && z();
2741
2823
  },
2742
2824
  role: "presentation",
2743
2825
  children: /* @__PURE__ */ e(
2744
2826
  "div",
2745
2827
  {
2828
+ ref: T,
2746
2829
  role: "dialog",
2747
2830
  "aria-modal": "true",
2831
+ "aria-label": n.name,
2748
2832
  style: {
2749
2833
  background: "var(--nice-bg-elevated, var(--nice-bg-primary, #ffffff))",
2750
2834
  borderRadius: 12,
@@ -2753,506 +2837,507 @@ const Gi = ({ field: n, data: s, zoom: m }) => {
2753
2837
  maxHeight: "90vh",
2754
2838
  overflow: "auto"
2755
2839
  },
2756
- children: x
2840
+ children: Y
2757
2841
  }
2758
2842
  )
2759
2843
  }
2760
- ), document.body) : x;
2761
- }, qi = "_root_1f4bm_1", Wi = "_dark_1f4bm_23", Yi = "_statsBar_1f4bm_37", ji = "_stat_1f4bm_37", Ui = "_dot_1f4bm_75", Vi = "_statPrinting_1f4bm_87", Xi = "_statQueued_1f4bm_93", Ki = "_statDone_1f4bm_99", Ji = "_statError_1f4bm_105", Qi = "_toolbar_1f4bm_115", Zi = "_filterTabs_1f4bm_139", es = "_filterTab_1f4bm_139", ts = "_filterTabActive_1f4bm_177", ns = "_filterCount_1f4bm_187", as = "_bulkActions_1f4bm_211", is = "_bulkCount_1f4bm_223", ss = "_bulkBtn_1f4bm_231", rs = "_bulkBtnRemove_1f4bm_255", os = "_jobList_1f4bm_273", ls = "_listHeader_1f4bm_281", cs = "_headerLabel_1f4bm_313", ds = "_jobRow_1f4bm_323", ms = "_jobRowSelected_1f4bm_359", ps = "_jobCheckbox_1f4bm_373", us = "_statusBadge_1f4bm_387", hs = "_pulse_1f4bm_1", _s = "_jobInfo_1f4bm_479", gs = "_jobName_1f4bm_485", bs = "_jobMeta_1f4bm_497", ys = "_jobTime_1f4bm_513", fs = "_jobDuration_1f4bm_519", vs = "_jobError_1f4bm_525", Ns = "_progressBar_1f4bm_539", ws = "_progressFill_1f4bm_553", ks = "_copiesEditor_1f4bm_569", Ss = "_copiesBtn_1f4bm_581", Cs = "_copiesValue_1f4bm_621", Bs = "_jobActions_1f4bm_635", Is = "_actionBtn_1f4bm_645", Ls = "_removeBtn_1f4bm_677", xs = "_emptyState_1f4bm_695", k = {
2762
- root: qi,
2763
- dark: Wi,
2764
- statsBar: Yi,
2765
- stat: ji,
2766
- dot: Ui,
2767
- statPrinting: Vi,
2768
- statQueued: Xi,
2769
- statDone: Ki,
2770
- statError: Ji,
2771
- toolbar: Qi,
2772
- filterTabs: Zi,
2773
- filterTab: es,
2774
- filterTabActive: ts,
2775
- filterCount: ns,
2776
- bulkActions: as,
2777
- bulkCount: is,
2778
- bulkBtn: ss,
2779
- bulkBtnRemove: rs,
2780
- jobList: os,
2781
- listHeader: ls,
2782
- headerLabel: cs,
2783
- jobRow: ds,
2784
- jobRowSelected: ms,
2785
- jobCheckbox: ps,
2786
- statusBadge: us,
2844
+ );
2845
+ return at(X, document.body);
2846
+ }, Vi = "_root_1f4bm_1", Ki = "_dark_1f4bm_23", Xi = "_statsBar_1f4bm_37", Ji = "_stat_1f4bm_37", Zi = "_dot_1f4bm_75", Qi = "_statPrinting_1f4bm_87", es = "_statQueued_1f4bm_93", ts = "_statDone_1f4bm_99", ns = "_statError_1f4bm_105", as = "_toolbar_1f4bm_115", is = "_filterTabs_1f4bm_139", ss = "_filterTab_1f4bm_139", rs = "_filterTabActive_1f4bm_177", os = "_filterCount_1f4bm_187", ls = "_bulkActions_1f4bm_211", cs = "_bulkCount_1f4bm_223", ds = "_bulkBtn_1f4bm_231", ms = "_bulkBtnRemove_1f4bm_255", ps = "_jobList_1f4bm_273", us = "_listHeader_1f4bm_281", hs = "_headerLabel_1f4bm_313", gs = "_jobRow_1f4bm_323", _s = "_jobRowSelected_1f4bm_359", bs = "_jobCheckbox_1f4bm_373", ys = "_statusBadge_1f4bm_387", fs = "_pulse_1f4bm_1", vs = "_jobInfo_1f4bm_479", Ns = "_jobName_1f4bm_485", ws = "_jobMeta_1f4bm_497", ks = "_jobTime_1f4bm_513", Ss = "_jobDuration_1f4bm_519", Cs = "_jobError_1f4bm_525", Bs = "_progressBar_1f4bm_539", Is = "_progressFill_1f4bm_553", Ls = "_copiesEditor_1f4bm_569", xs = "_copiesBtn_1f4bm_581", zs = "_copiesValue_1f4bm_621", Ts = "_jobActions_1f4bm_635", Ds = "_actionBtn_1f4bm_645", $s = "_removeBtn_1f4bm_677", Rs = "_emptyState_1f4bm_695", w = {
2847
+ root: Vi,
2848
+ dark: Ki,
2849
+ statsBar: Xi,
2850
+ stat: Ji,
2851
+ dot: Zi,
2852
+ statPrinting: Qi,
2853
+ statQueued: es,
2854
+ statDone: ts,
2855
+ statError: ns,
2856
+ toolbar: as,
2857
+ filterTabs: is,
2858
+ filterTab: ss,
2859
+ filterTabActive: rs,
2860
+ filterCount: os,
2861
+ bulkActions: ls,
2862
+ bulkCount: cs,
2863
+ bulkBtn: ds,
2864
+ bulkBtnRemove: ms,
2865
+ jobList: ps,
2866
+ listHeader: us,
2867
+ headerLabel: hs,
2868
+ jobRow: gs,
2869
+ jobRowSelected: _s,
2870
+ jobCheckbox: bs,
2871
+ statusBadge: ys,
2787
2872
  "badge-queued": "_badge-queued_1f4bm_405",
2788
2873
  "badge-printing": "_badge-printing_1f4bm_413",
2789
- pulse: hs,
2874
+ pulse: fs,
2790
2875
  "badge-done": "_badge-done_1f4bm_423",
2791
2876
  "badge-error": "_badge-error_1f4bm_431",
2792
2877
  "badge-paused": "_badge-paused_1f4bm_439",
2793
2878
  "badge-cancelled": "_badge-cancelled_1f4bm_447",
2794
- jobInfo: _s,
2795
- jobName: gs,
2796
- jobMeta: bs,
2797
- jobTime: ys,
2798
- jobDuration: fs,
2799
- jobError: vs,
2800
- progressBar: Ns,
2801
- progressFill: ws,
2802
- copiesEditor: ks,
2803
- copiesBtn: Ss,
2804
- copiesValue: Cs,
2805
- jobActions: Bs,
2806
- actionBtn: Is,
2807
- removeBtn: Ls,
2808
- emptyState: xs
2809
- }, zs = [], De = {
2879
+ jobInfo: vs,
2880
+ jobName: Ns,
2881
+ jobMeta: ws,
2882
+ jobTime: ks,
2883
+ jobDuration: Ss,
2884
+ jobError: Cs,
2885
+ progressBar: Bs,
2886
+ progressFill: Is,
2887
+ copiesEditor: Ls,
2888
+ copiesBtn: xs,
2889
+ copiesValue: zs,
2890
+ jobActions: Ts,
2891
+ actionBtn: Ds,
2892
+ removeBtn: $s,
2893
+ emptyState: Rs
2894
+ }, As = [], Ae = {
2810
2895
  queued: "Queued",
2811
2896
  printing: "Printing",
2812
2897
  done: "Printed",
2813
2898
  error: "Error",
2814
2899
  paused: "Paused",
2815
2900
  cancelled: "Cancelled"
2816
- }, ke = (n, s) => De[s] ? n(`printing.status.${s}`, De[s]) : s;
2817
- function Ts(n, s) {
2901
+ }, Ce = (n, o) => Ae[o] ? n(`printing.status.${o}`, Ae[o]) : o;
2902
+ function Ps(n, o) {
2818
2903
  try {
2819
- return new Date(s).toLocaleTimeString(n, { hour: "2-digit", minute: "2-digit" });
2904
+ return new Date(o).toLocaleTimeString(n, { hour: "2-digit", minute: "2-digit" });
2820
2905
  } catch {
2821
- return s;
2906
+ return o;
2822
2907
  }
2823
2908
  }
2824
- function $s(n) {
2825
- const s = Math.floor((Date.now() - new Date(n).getTime()) / 1e3);
2826
- if (s < 60)
2827
- return `${s}s`;
2828
- const m = Math.floor(s / 60);
2829
- if (m < 60)
2830
- return `${m}m ${s % 60}s`;
2831
- const o = Math.floor(m / 60);
2832
- return o < 24 ? `${o}h ${m % 60}m` : `${Math.floor(o / 24)}d ${o % 24}h`;
2909
+ function Es(n) {
2910
+ const o = Math.floor((Date.now() - new Date(n).getTime()) / 1e3);
2911
+ if (o < 60)
2912
+ return `${o}s`;
2913
+ const d = Math.floor(o / 60);
2914
+ if (d < 60)
2915
+ return `${d}m ${o % 60}s`;
2916
+ const l = Math.floor(d / 60);
2917
+ return l < 24 ? `${l}h ${d % 60}m` : `${Math.floor(l / 24)}d ${l % 24}h`;
2833
2918
  }
2834
- const Ds = ({ jobs: n }) => {
2835
- const { t: s } = X(), m = n.filter((b) => b.status === "printing").length, o = n.filter((b) => b.status === "queued").length, B = n.filter((b) => b.status === "done").length, N = n.filter((b) => b.status === "error").length;
2836
- return /* @__PURE__ */ a("div", { className: k.statsBar, children: [
2837
- /* @__PURE__ */ a("span", { className: `${k.stat} ${k.statPrinting}`, children: [
2838
- /* @__PURE__ */ e("span", { className: k.dot }),
2839
- s("printing.stats.active", "Printing"),
2919
+ const Ms = ({ jobs: n }) => {
2920
+ const { t: o } = j(), d = n.filter((_) => _.status === "printing").length, l = n.filter((_) => _.status === "queued").length, C = n.filter((_) => _.status === "done").length, N = n.filter((_) => _.status === "error").length;
2921
+ return /* @__PURE__ */ a("div", { className: w.statsBar, children: [
2922
+ /* @__PURE__ */ a("span", { className: `${w.stat} ${w.statPrinting}`, children: [
2923
+ /* @__PURE__ */ e("span", { className: w.dot }),
2924
+ o("printing.stats.active", "Printing"),
2840
2925
  ": ",
2841
- /* @__PURE__ */ e("strong", { children: m })
2926
+ /* @__PURE__ */ e("strong", { children: d })
2842
2927
  ] }),
2843
- /* @__PURE__ */ a("span", { className: `${k.stat} ${k.statQueued}`, children: [
2844
- /* @__PURE__ */ e("span", { className: k.dot }),
2845
- s("printing.stats.queued", "In queue"),
2928
+ /* @__PURE__ */ a("span", { className: `${w.stat} ${w.statQueued}`, children: [
2929
+ /* @__PURE__ */ e("span", { className: w.dot }),
2930
+ o("printing.stats.queued", "In queue"),
2846
2931
  ": ",
2847
- /* @__PURE__ */ e("strong", { children: o })
2932
+ /* @__PURE__ */ e("strong", { children: l })
2848
2933
  ] }),
2849
- /* @__PURE__ */ a("span", { className: `${k.stat} ${k.statDone}`, children: [
2850
- /* @__PURE__ */ e("span", { className: k.dot }),
2851
- s("printing.stats.done", "Done"),
2934
+ /* @__PURE__ */ a("span", { className: `${w.stat} ${w.statDone}`, children: [
2935
+ /* @__PURE__ */ e("span", { className: w.dot }),
2936
+ o("printing.stats.done", "Done"),
2852
2937
  ": ",
2853
- /* @__PURE__ */ e("strong", { children: B })
2938
+ /* @__PURE__ */ e("strong", { children: C })
2854
2939
  ] }),
2855
- N > 0 && /* @__PURE__ */ a("span", { className: `${k.stat} ${k.statError}`, children: [
2856
- /* @__PURE__ */ e("span", { className: k.dot }),
2857
- s("printing.stats.errors", "Errors"),
2940
+ N > 0 && /* @__PURE__ */ a("span", { className: `${w.stat} ${w.statError}`, children: [
2941
+ /* @__PURE__ */ e("span", { className: w.dot }),
2942
+ o("printing.stats.errors", "Errors"),
2858
2943
  ": ",
2859
2944
  /* @__PURE__ */ e("strong", { children: N })
2860
2945
  ] })
2861
2946
  ] });
2862
- }, Rs = ({
2947
+ }, Fs = ({
2863
2948
  job: n,
2864
- index: s,
2865
- total: m,
2866
- printers: o,
2867
- selected: B,
2949
+ index: o,
2950
+ total: d,
2951
+ printers: l,
2952
+ selected: C,
2868
2953
  onSelect: N,
2869
- onUpdate: b,
2870
- onRemove: h,
2871
- onPrint: g,
2872
- onReorder: _
2954
+ onUpdate: _,
2955
+ onRemove: g,
2956
+ onPrint: f,
2957
+ onReorder: k
2873
2958
  }) => {
2874
- const { t: l, lang: f } = X(), C = o.find((r) => r.id === n.options.printerId), z = s > 0 && n.status === "queued", y = s < m - 1 && n.status === "queued";
2959
+ const { t: u, lang: r } = j(), S = l.find((s) => s.id === n.options.printerId), I = o > 0 && n.status === "queued", x = o < d - 1 && n.status === "queued";
2875
2960
  return /* @__PURE__ */ a(
2876
2961
  "div",
2877
2962
  {
2878
- className: `${k.jobRow} ${B ? k.jobRowSelected : ""} ${k[`status-${n.status}`] ?? ""}`,
2963
+ className: `${w.jobRow} ${C ? w.jobRowSelected : ""} ${w[`status-${n.status}`] ?? ""}`,
2879
2964
  children: [
2880
2965
  /* @__PURE__ */ e(
2881
2966
  "input",
2882
2967
  {
2883
2968
  type: "checkbox",
2884
- className: k.jobCheckbox,
2885
- checked: B,
2969
+ className: w.jobCheckbox,
2970
+ checked: C,
2886
2971
  onChange: () => N(n.id)
2887
2972
  }
2888
2973
  ),
2889
- /* @__PURE__ */ e("span", { className: `${k.statusBadge} ${k[`badge-${n.status}`]}`, children: ke(l, n.status) }),
2890
- /* @__PURE__ */ a("div", { className: k.jobInfo, children: [
2891
- /* @__PURE__ */ e("div", { className: k.jobName, children: n.templateName ?? n.templateId }),
2892
- /* @__PURE__ */ a("div", { className: k.jobMeta, children: [
2974
+ /* @__PURE__ */ e("span", { className: `${w.statusBadge} ${w[`badge-${n.status}`]}`, children: Ce(u, n.status) }),
2975
+ /* @__PURE__ */ a("div", { className: w.jobInfo, children: [
2976
+ /* @__PURE__ */ e("div", { className: w.jobName, children: n.templateName ?? n.templateId }),
2977
+ /* @__PURE__ */ a("div", { className: w.jobMeta, children: [
2893
2978
  n.entityLabel && /* @__PURE__ */ e("span", { children: n.entityLabel }),
2894
- C && /* @__PURE__ */ a("span", { children: [
2895
- /* @__PURE__ */ e(S, { name: "printer", size: 12 }),
2979
+ S && /* @__PURE__ */ a("span", { children: [
2980
+ /* @__PURE__ */ e(v, { name: "printer", size: 12 }),
2896
2981
  " ",
2897
- C.name
2982
+ S.name
2898
2983
  ] }),
2899
2984
  /* @__PURE__ */ a("span", { children: [
2900
2985
  "×",
2901
2986
  n.options.copies
2902
2987
  ] }),
2903
- n.createdAt && /* @__PURE__ */ e("span", { className: k.jobTime, children: Ts(f, n.createdAt) }),
2904
- n.startedAt && n.status !== "done" && /* @__PURE__ */ e("span", { className: k.jobDuration, children: $s(n.startedAt) })
2988
+ n.createdAt && /* @__PURE__ */ e("span", { className: w.jobTime, children: Ps(r, n.createdAt) }),
2989
+ n.startedAt && n.status !== "done" && /* @__PURE__ */ e("span", { className: w.jobDuration, children: Es(n.startedAt) })
2905
2990
  ] }),
2906
- n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className: k.progressBar, children: /* @__PURE__ */ e("div", { className: k.progressFill, style: { width: `${n.progress}%` } }) }),
2907
- n.status === "error" && n.errorMessage && /* @__PURE__ */ e("div", { className: k.jobError, children: n.errorMessage })
2991
+ n.status === "printing" && n.progress != null && /* @__PURE__ */ e("div", { className: w.progressBar, children: /* @__PURE__ */ e("div", { className: w.progressFill, style: { width: `${n.progress}%` } }) }),
2992
+ n.status === "error" && n.errorMessage && /* @__PURE__ */ e("div", { className: w.jobError, children: n.errorMessage })
2908
2993
  ] }),
2909
- /* @__PURE__ */ a("div", { className: k.copiesEditor, children: [
2994
+ /* @__PURE__ */ a("div", { className: w.copiesEditor, children: [
2910
2995
  /* @__PURE__ */ e(
2911
2996
  "button",
2912
2997
  {
2913
- className: k.copiesBtn,
2998
+ className: w.copiesBtn,
2914
2999
  disabled: n.options.copies <= 1,
2915
- "aria-label": l("printing.copies.decrease", "One copy fewer"),
2916
- onClick: () => b(n.id, { options: { ...n.options, copies: n.options.copies - 1 } }),
2917
- children: /* @__PURE__ */ e(S, { name: "minus", size: 12 })
3000
+ "aria-label": u("printing.copies.decrease", "One copy fewer"),
3001
+ onClick: () => _(n.id, { options: { ...n.options, copies: n.options.copies - 1 } }),
3002
+ children: /* @__PURE__ */ e(v, { name: "minus", size: 12 })
2918
3003
  }
2919
3004
  ),
2920
- /* @__PURE__ */ e("span", { className: k.copiesValue, children: n.options.copies }),
3005
+ /* @__PURE__ */ e("span", { className: w.copiesValue, children: n.options.copies }),
2921
3006
  /* @__PURE__ */ e(
2922
3007
  "button",
2923
3008
  {
2924
- className: k.copiesBtn,
2925
- "aria-label": l("printing.copies.increase", "One copy more"),
2926
- onClick: () => b(n.id, { options: { ...n.options, copies: n.options.copies + 1 } }),
2927
- children: /* @__PURE__ */ e(S, { name: "plus", size: 12 })
3009
+ className: w.copiesBtn,
3010
+ "aria-label": u("printing.copies.increase", "One copy more"),
3011
+ onClick: () => _(n.id, { options: { ...n.options, copies: n.options.copies + 1 } }),
3012
+ children: /* @__PURE__ */ e(v, { name: "plus", size: 12 })
2928
3013
  }
2929
3014
  )
2930
3015
  ] }),
2931
- /* @__PURE__ */ a("div", { className: k.jobActions, children: [
2932
- z && /* @__PURE__ */ e(
3016
+ /* @__PURE__ */ a("div", { className: w.jobActions, children: [
3017
+ I && /* @__PURE__ */ e(
2933
3018
  "button",
2934
3019
  {
2935
- className: k.actionBtn,
2936
- title: l("printing.action.moveUp", "Move up"),
2937
- onClick: () => _(s, s - 1),
2938
- children: /* @__PURE__ */ e(S, { name: "arrow-up", size: 14 })
3020
+ className: w.actionBtn,
3021
+ title: u("printing.action.moveUp", "Move up"),
3022
+ onClick: () => k(o, o - 1),
3023
+ children: /* @__PURE__ */ e(v, { name: "arrow-up", size: 14 })
2939
3024
  }
2940
3025
  ),
2941
- y && /* @__PURE__ */ e(
3026
+ x && /* @__PURE__ */ e(
2942
3027
  "button",
2943
3028
  {
2944
- className: k.actionBtn,
2945
- title: l("printing.action.moveDown", "Move down"),
2946
- onClick: () => _(s, s + 1),
2947
- children: /* @__PURE__ */ e(S, { name: "arrow-down", size: 14 })
3029
+ className: w.actionBtn,
3030
+ title: u("printing.action.moveDown", "Move down"),
3031
+ onClick: () => k(o, o + 1),
3032
+ children: /* @__PURE__ */ e(v, { name: "arrow-down", size: 14 })
2948
3033
  }
2949
3034
  ),
2950
3035
  n.status === "queued" && /* @__PURE__ */ e(
2951
3036
  "button",
2952
3037
  {
2953
- className: k.actionBtn,
2954
- title: l("printing.action.printNow", "Print now"),
2955
- onClick: () => g(n.id),
2956
- children: /* @__PURE__ */ e(S, { name: "play", size: 14 })
3038
+ className: w.actionBtn,
3039
+ title: u("printing.action.printNow", "Print now"),
3040
+ onClick: () => f(n.id),
3041
+ children: /* @__PURE__ */ e(v, { name: "play", size: 14 })
2957
3042
  }
2958
3043
  ),
2959
3044
  n.status === "printing" && /* @__PURE__ */ e(
2960
3045
  "button",
2961
3046
  {
2962
- className: k.actionBtn,
2963
- title: l("printing.action.pause", "Pause"),
2964
- onClick: () => b(n.id, { status: "paused" }),
2965
- children: /* @__PURE__ */ e(S, { name: "pause", size: 14 })
3047
+ className: w.actionBtn,
3048
+ title: u("printing.action.pause", "Pause"),
3049
+ onClick: () => _(n.id, { status: "paused" }),
3050
+ children: /* @__PURE__ */ e(v, { name: "pause", size: 14 })
2966
3051
  }
2967
3052
  ),
2968
3053
  n.status === "paused" && /* @__PURE__ */ e(
2969
3054
  "button",
2970
3055
  {
2971
- className: k.actionBtn,
2972
- title: l("printing.action.resume", "Resume"),
2973
- onClick: () => b(n.id, { status: "queued" }),
2974
- children: /* @__PURE__ */ e(S, { name: "play", size: 14 })
3056
+ className: w.actionBtn,
3057
+ title: u("printing.action.resume", "Resume"),
3058
+ onClick: () => _(n.id, { status: "queued" }),
3059
+ children: /* @__PURE__ */ e(v, { name: "play", size: 14 })
2975
3060
  }
2976
3061
  ),
2977
3062
  /* @__PURE__ */ e(
2978
3063
  "button",
2979
3064
  {
2980
- className: `${k.actionBtn} ${k.removeBtn}`,
2981
- title: l("printing.action.remove", "Remove"),
2982
- onClick: () => h(n.id),
2983
- children: /* @__PURE__ */ e(S, { name: "close", size: 14 })
3065
+ className: `${w.actionBtn} ${w.removeBtn}`,
3066
+ title: u("printing.action.remove", "Remove"),
3067
+ onClick: () => g(n.id),
3068
+ children: /* @__PURE__ */ e(v, { name: "close", size: 14 })
2984
3069
  }
2985
3070
  )
2986
3071
  ] })
2987
3072
  ]
2988
3073
  }
2989
3074
  );
2990
- }, mr = ({
2991
- jobs: n = zs,
2992
- printers: s = [],
2993
- onJobUpdate: m,
2994
- onJobRemove: o,
2995
- onJobReorder: B,
3075
+ }, _r = ({
3076
+ jobs: n = As,
3077
+ printers: o = [],
3078
+ onJobUpdate: d,
3079
+ onJobRemove: l,
3080
+ onJobReorder: C,
2996
3081
  onJobPrint: N,
2997
- onBulkRemove: b,
2998
- onBulkPrint: h,
2999
- maxHeight: g = 500,
3000
- className: _,
3001
- style: l,
3002
- theme: f = "light"
3082
+ onBulkRemove: _,
3083
+ onBulkPrint: g,
3084
+ maxHeight: f = 500,
3085
+ className: k,
3086
+ style: u,
3087
+ theme: r = "light"
3003
3088
  }) => {
3004
- const { t: C } = X(), [z, y] = H(/* @__PURE__ */ new Set()), [r, i] = H("all"), u = r === "all" ? n : n.filter((x) => x.status === r), c = E((x) => {
3005
- y((T) => {
3006
- const A = new Set(T);
3007
- return A.has(x) ? A.delete(x) : A.add(x), A;
3089
+ const { t: S } = j(), [I, x] = H(/* @__PURE__ */ new Set()), [s, i] = H("all"), m = s === "all" ? n : n.filter((T) => T.status === s), h = M((T) => {
3090
+ x((D) => {
3091
+ const Y = new Set(D);
3092
+ return Y.has(T) ? Y.delete(T) : Y.add(T), Y;
3008
3093
  });
3009
- }, []), F = E(() => {
3010
- z.size === u.length ? y(/* @__PURE__ */ new Set()) : y(new Set(u.map((x) => x.id)));
3011
- }, [u, z.size]), v = E(() => {
3012
- b == null || b(Array.from(z)), y(/* @__PURE__ */ new Set());
3013
- }, [z, b]), D = E(() => {
3014
- h == null || h(Array.from(z)), y(/* @__PURE__ */ new Set());
3015
- }, [z, h]);
3094
+ }, []), z = M(() => {
3095
+ I.size === m.length ? x(/* @__PURE__ */ new Set()) : x(new Set(m.map((T) => T.id)));
3096
+ }, [m, I.size]), y = M(() => {
3097
+ _ == null || _(Array.from(I)), x(/* @__PURE__ */ new Set());
3098
+ }, [I, _]), R = M(() => {
3099
+ g == null || g(Array.from(I)), x(/* @__PURE__ */ new Set());
3100
+ }, [I, g]);
3016
3101
  return /* @__PURE__ */ a(
3017
3102
  "div",
3018
3103
  {
3019
- className: `${k.root} ${f === "dark" ? k.dark : ""} ${_ ?? ""}`,
3020
- style: l,
3104
+ className: `${w.root} ${r === "dark" ? w.dark : ""} ${k ?? ""}`,
3105
+ style: u,
3021
3106
  children: [
3022
- /* @__PURE__ */ e(Ds, { jobs: n }),
3023
- /* @__PURE__ */ a("div", { className: k.toolbar, children: [
3024
- /* @__PURE__ */ e("div", { className: k.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((x) => /* @__PURE__ */ a(
3107
+ /* @__PURE__ */ e(Ms, { jobs: n }),
3108
+ /* @__PURE__ */ a("div", { className: w.toolbar, children: [
3109
+ /* @__PURE__ */ e("div", { className: w.filterTabs, children: ["all", "queued", "printing", "done", "error"].map((T) => /* @__PURE__ */ a(
3025
3110
  "button",
3026
3111
  {
3027
- className: `${k.filterTab} ${r === x ? k.filterTabActive : ""}`,
3028
- onClick: () => i(x),
3112
+ className: `${w.filterTab} ${s === T ? w.filterTabActive : ""}`,
3113
+ onClick: () => i(T),
3029
3114
  children: [
3030
- x === "all" ? C("printing.filter.all", "All") : ke(C, x),
3031
- /* @__PURE__ */ e("span", { className: k.filterCount, children: x === "all" ? n.length : n.filter((T) => T.status === x).length })
3115
+ T === "all" ? S("printing.filter.all", "All") : Ce(S, T),
3116
+ /* @__PURE__ */ e("span", { className: w.filterCount, children: T === "all" ? n.length : n.filter((D) => D.status === T).length })
3032
3117
  ]
3033
3118
  },
3034
- x
3119
+ T
3035
3120
  )) }),
3036
- z.size > 0 && /* @__PURE__ */ a("div", { className: k.bulkActions, children: [
3037
- /* @__PURE__ */ a("span", { className: k.bulkCount, children: [
3038
- z.size,
3121
+ I.size > 0 && /* @__PURE__ */ a("div", { className: w.bulkActions, children: [
3122
+ /* @__PURE__ */ a("span", { className: w.bulkCount, children: [
3123
+ I.size,
3039
3124
  " ",
3040
- C("printing.bulk.selected", "selected")
3125
+ S("printing.bulk.selected", "selected")
3041
3126
  ] }),
3042
- h && /* @__PURE__ */ a("button", { className: k.bulkBtn, onClick: D, children: [
3043
- /* @__PURE__ */ e(S, { name: "printer", size: 14 }),
3127
+ g && /* @__PURE__ */ a("button", { className: w.bulkBtn, onClick: R, children: [
3128
+ /* @__PURE__ */ e(v, { name: "printer", size: 14 }),
3044
3129
  " ",
3045
- C("printing.bulk.print", "Print selected")
3130
+ S("printing.bulk.print", "Print selected")
3046
3131
  ] }),
3047
- b && /* @__PURE__ */ a("button", { className: `${k.bulkBtn} ${k.bulkBtnRemove}`, onClick: v, children: [
3048
- /* @__PURE__ */ e(S, { name: "trash", size: 14 }),
3132
+ _ && /* @__PURE__ */ a("button", { className: `${w.bulkBtn} ${w.bulkBtnRemove}`, onClick: y, children: [
3133
+ /* @__PURE__ */ e(v, { name: "trash", size: 14 }),
3049
3134
  " ",
3050
- C("printing.bulk.remove", "Remove selected")
3135
+ S("printing.bulk.remove", "Remove selected")
3051
3136
  ] })
3052
3137
  ] })
3053
3138
  ] }),
3054
- /* @__PURE__ */ e("div", { className: k.jobList, style: { maxHeight: g }, children: u.length === 0 ? /* @__PURE__ */ e("div", { className: k.emptyState, children: r === "all" ? C("printing.empty.queue", "No jobs in the queue") : `${C("printing.empty.filtered", "No jobs with status")} "${ke(C, r)}"` }) : /* @__PURE__ */ a(V, { children: [
3055
- /* @__PURE__ */ a("div", { className: k.listHeader, children: [
3139
+ /* @__PURE__ */ e("div", { className: w.jobList, style: { maxHeight: f }, children: m.length === 0 ? /* @__PURE__ */ e("div", { className: w.emptyState, children: s === "all" ? S("printing.empty.queue", "No jobs in the queue") : `${S("printing.empty.filtered", "No jobs with status")} "${Ce(S, s)}"` }) : /* @__PURE__ */ a(J, { children: [
3140
+ /* @__PURE__ */ a("div", { className: w.listHeader, children: [
3056
3141
  /* @__PURE__ */ e(
3057
3142
  "input",
3058
3143
  {
3059
3144
  type: "checkbox",
3060
- onChange: F,
3061
- checked: z.size === u.length && u.length > 0
3145
+ onChange: z,
3146
+ checked: I.size === m.length && m.length > 0
3062
3147
  }
3063
3148
  ),
3064
- /* @__PURE__ */ e("span", { className: k.headerLabel, children: C("printing.col.job", "Job") }),
3065
- /* @__PURE__ */ e("span", { className: k.headerLabel, children: C("printing.col.copies", "Copies") }),
3066
- /* @__PURE__ */ e("span", { className: k.headerLabel, children: C("printing.col.actions", "Actions") })
3149
+ /* @__PURE__ */ e("span", { className: w.headerLabel, children: S("printing.col.job", "Job") }),
3150
+ /* @__PURE__ */ e("span", { className: w.headerLabel, children: S("printing.col.copies", "Copies") }),
3151
+ /* @__PURE__ */ e("span", { className: w.headerLabel, children: S("printing.col.actions", "Actions") })
3067
3152
  ] }),
3068
- u.map((x, T) => /* @__PURE__ */ e(
3069
- Rs,
3153
+ m.map((T, D) => /* @__PURE__ */ e(
3154
+ Fs,
3070
3155
  {
3071
- job: x,
3072
- index: n.indexOf(x),
3156
+ job: T,
3157
+ index: n.indexOf(T),
3073
3158
  total: n.length,
3074
- printers: s,
3075
- selected: z.has(x.id),
3076
- onSelect: c,
3077
- onUpdate: m,
3078
- onRemove: o,
3159
+ printers: o,
3160
+ selected: I.has(T.id),
3161
+ onSelect: h,
3162
+ onUpdate: d,
3163
+ onRemove: l,
3079
3164
  onPrint: N,
3080
- onReorder: B
3165
+ onReorder: C
3081
3166
  },
3082
- x.id
3167
+ T.id
3083
3168
  ))
3084
3169
  ] }) })
3085
3170
  ]
3086
3171
  }
3087
3172
  );
3088
- }, As = "_container_1f76z_1", Es = "_buttonGroup_1f76z_19", Ms = "_trigger_1f76z_31", Ps = "_triggerDisabled_1f76z_57", Fs = "_mainAction_1f76z_151", Hs = "_dropdownToggle_1f76z_175", Gs = "_chevron_1f76z_201", Os = "_chevronUp_1f76z_211", qs = "_dropdown_1f76z_175", Ws = "_dark_1f76z_245", Ys = "_section_1f76z_257", js = "_sectionLabel_1f76z_263", Us = "_divider_1f76z_283", Vs = "_copiesRow_1f76z_301", Xs = "_copiesBtn_1f76z_311", Ks = "_copiesValue_1f76z_351", Js = "_printerSelect_1f76z_375", Qs = "_printerStatus_1f76z_415", Zs = "_printerDot_1f76z_429", er = "_printerStatusLabel_1f76z_463", tr = "_submitBtn_1f76z_473", nr = "_spinner_1f76z_515", ar = "_spin_1f76z_515", R = {
3089
- container: As,
3090
- buttonGroup: Es,
3091
- trigger: Ms,
3092
- triggerDisabled: Ps,
3173
+ }, Hs = "_container_1f76z_1", Gs = "_buttonGroup_1f76z_19", Os = "_trigger_1f76z_31", qs = "_triggerDisabled_1f76z_57", Ws = "_mainAction_1f76z_151", Ys = "_dropdownToggle_1f76z_175", Us = "_chevron_1f76z_201", js = "_chevronUp_1f76z_211", Vs = "_dropdown_1f76z_175", Ks = "_dark_1f76z_245", Xs = "_section_1f76z_257", Js = "_sectionLabel_1f76z_263", Zs = "_divider_1f76z_283", Qs = "_copiesRow_1f76z_301", er = "_copiesBtn_1f76z_311", tr = "_copiesValue_1f76z_351", nr = "_printerSelect_1f76z_375", ar = "_printerStatus_1f76z_415", ir = "_printerDot_1f76z_429", sr = "_printerStatusLabel_1f76z_463", rr = "_submitBtn_1f76z_473", or = "_spinner_1f76z_515", lr = "_spin_1f76z_515", A = {
3174
+ container: Hs,
3175
+ buttonGroup: Gs,
3176
+ trigger: Os,
3177
+ triggerDisabled: qs,
3093
3178
  "variant-primary": "_variant-primary_1f76z_69",
3094
3179
  "variant-secondary": "_variant-secondary_1f76z_83",
3095
3180
  "variant-ghost": "_variant-ghost_1f76z_99",
3096
3181
  "size-sm": "_size-sm_1f76z_117",
3097
3182
  "size-md": "_size-md_1f76z_127",
3098
3183
  "size-lg": "_size-lg_1f76z_137",
3099
- mainAction: Fs,
3100
- dropdownToggle: Hs,
3101
- chevron: Gs,
3102
- chevronUp: Os,
3103
- dropdown: qs,
3104
- dark: Ws,
3105
- section: Ys,
3106
- sectionLabel: js,
3107
- divider: Us,
3108
- copiesRow: Vs,
3109
- copiesBtn: Xs,
3110
- copiesValue: Ks,
3111
- printerSelect: Js,
3112
- printerStatus: Qs,
3113
- printerDot: Zs,
3184
+ mainAction: Ws,
3185
+ dropdownToggle: Ys,
3186
+ chevron: Us,
3187
+ chevronUp: js,
3188
+ dropdown: Vs,
3189
+ dark: Ks,
3190
+ section: Xs,
3191
+ sectionLabel: Js,
3192
+ divider: Zs,
3193
+ copiesRow: Qs,
3194
+ copiesBtn: er,
3195
+ copiesValue: tr,
3196
+ printerSelect: nr,
3197
+ printerStatus: ar,
3198
+ printerDot: ir,
3114
3199
  "dot-ready": "_dot-ready_1f76z_439",
3115
3200
  "dot-busy": "_dot-busy_1f76z_445",
3116
3201
  "dot-offline": "_dot-offline_1f76z_451",
3117
3202
  "dot-error": "_dot-error_1f76z_457",
3118
- printerStatusLabel: er,
3119
- submitBtn: tr,
3120
- spinner: nr,
3121
- spin: ar
3122
- }, pr = ({
3203
+ printerStatusLabel: sr,
3204
+ submitBtn: rr,
3205
+ spinner: or,
3206
+ spin: lr
3207
+ }, br = ({
3123
3208
  onPrint: n,
3124
- printers: s = [],
3125
- defaultPrinterId: m,
3126
- defaultCopies: o = 1,
3127
- disabled: B = !1,
3209
+ printers: o = [],
3210
+ defaultPrinterId: d,
3211
+ defaultCopies: l = 1,
3212
+ disabled: C = !1,
3128
3213
  loading: N = !1,
3129
- variant: b = "primary",
3130
- size: h = "md",
3131
- label: g,
3132
- className: _,
3133
- style: l,
3134
- theme: f = "light"
3214
+ variant: _ = "primary",
3215
+ size: g = "md",
3216
+ label: f,
3217
+ className: k,
3218
+ style: u,
3219
+ theme: r = "light"
3135
3220
  }) => {
3136
- var Z;
3137
- const { t: C } = X(), z = g ?? C("printing.print", "Print"), [y, r] = H(!1), [i, u] = H(o), [c, F] = H(m ?? ((Z = s[0]) == null ? void 0 : Z.id) ?? ""), v = Je(null);
3138
- Se(() => {
3139
- if (!y)
3221
+ var P;
3222
+ const { t: S } = j(), I = f ?? S("printing.print", "Print"), [x, s] = H(!1), [i, m] = H(l), [h, z] = H(d ?? ((P = o[0]) == null ? void 0 : P.id) ?? ""), y = ke(null);
3223
+ Be(() => {
3224
+ if (!x)
3140
3225
  return;
3141
- const w = (K) => {
3142
- v.current && !v.current.contains(K.target) && r(!1);
3226
+ const b = (V) => {
3227
+ y.current && !y.current.contains(V.target) && s(!1);
3143
3228
  };
3144
- return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
3145
- }, [y]);
3146
- const D = E(() => {
3147
- n({ copies: i, printerId: c }), r(!1);
3148
- }, [i, c, n]), x = E(() => u((w) => Math.min(99, w + 1)), []), T = E(() => u((w) => Math.max(1, w - 1)), []), A = [R.container, f === "dark" ? R.dark : "", _ ?? ""].filter(Boolean).join(" "), Y = [
3149
- R.trigger,
3150
- R[`variant-${b}`],
3151
- R[`size-${h}`],
3152
- B || N ? R.triggerDisabled : ""
3229
+ return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
3230
+ }, [x]);
3231
+ const R = M(() => {
3232
+ n({ copies: i, printerId: h }), s(!1);
3233
+ }, [i, h, n]), T = M(() => m((b) => Math.min(99, b + 1)), []), D = M(() => m((b) => Math.max(1, b - 1)), []), Y = [A.container, r === "dark" ? A.dark : "", k ?? ""].filter(Boolean).join(" "), X = [
3234
+ A.trigger,
3235
+ A[`variant-${_}`],
3236
+ A[`size-${g}`],
3237
+ C || N ? A.triggerDisabled : ""
3153
3238
  ].filter(Boolean).join(" ");
3154
- return /* @__PURE__ */ a("div", { ref: v, className: A, style: l, children: [
3155
- /* @__PURE__ */ a("div", { className: R.buttonGroup, children: [
3239
+ return /* @__PURE__ */ a("div", { ref: y, className: Y, style: u, children: [
3240
+ /* @__PURE__ */ a("div", { className: A.buttonGroup, children: [
3156
3241
  /* @__PURE__ */ a(
3157
3242
  "button",
3158
3243
  {
3159
- className: `${Y} ${R.mainAction}`,
3160
- disabled: B || N,
3161
- onClick: D,
3162
- "aria-label": z,
3244
+ className: `${X} ${A.mainAction}`,
3245
+ disabled: C || N,
3246
+ onClick: R,
3247
+ "aria-label": I,
3163
3248
  children: [
3164
- N ? /* @__PURE__ */ e("span", { className: R.spinner }) : /* @__PURE__ */ e(S, { name: "printer", size: 16 }),
3165
- /* @__PURE__ */ e("span", { children: z })
3249
+ N ? /* @__PURE__ */ e("span", { className: A.spinner }) : /* @__PURE__ */ e(v, { name: "printer", size: 16 }),
3250
+ /* @__PURE__ */ e("span", { children: I })
3166
3251
  ]
3167
3252
  }
3168
3253
  ),
3169
3254
  /* @__PURE__ */ e(
3170
3255
  "button",
3171
3256
  {
3172
- className: `${Y} ${R.dropdownToggle}`,
3173
- disabled: B || N,
3174
- onClick: () => r((w) => !w),
3175
- "aria-label": C("printing.options", "Print options"),
3176
- "aria-expanded": y,
3177
- children: /* @__PURE__ */ e("span", { className: `${R.chevron} ${y ? R.chevronUp : ""}`, children: /* @__PURE__ */ e(S, { name: "chevron-down", size: 12 }) })
3257
+ className: `${X} ${A.dropdownToggle}`,
3258
+ disabled: C || N,
3259
+ onClick: () => s((b) => !b),
3260
+ "aria-label": S("printing.options", "Print options"),
3261
+ "aria-expanded": x,
3262
+ children: /* @__PURE__ */ e("span", { className: `${A.chevron} ${x ? A.chevronUp : ""}`, children: /* @__PURE__ */ e(v, { name: "chevron-down", size: 12 }) })
3178
3263
  }
3179
3264
  )
3180
3265
  ] }),
3181
- y && /* @__PURE__ */ a("div", { className: R.dropdown, children: [
3182
- /* @__PURE__ */ a("div", { className: R.section, children: [
3183
- /* @__PURE__ */ e("label", { className: R.sectionLabel, children: C("printing.copies.label", "Copies") }),
3184
- /* @__PURE__ */ a("div", { className: R.copiesRow, children: [
3266
+ x && /* @__PURE__ */ a("div", { className: A.dropdown, children: [
3267
+ /* @__PURE__ */ a("div", { className: A.section, children: [
3268
+ /* @__PURE__ */ e("label", { className: A.sectionLabel, children: S("printing.copies.label", "Copies") }),
3269
+ /* @__PURE__ */ a("div", { className: A.copiesRow, children: [
3185
3270
  /* @__PURE__ */ e(
3186
3271
  "button",
3187
3272
  {
3188
- className: R.copiesBtn,
3189
- onClick: T,
3273
+ className: A.copiesBtn,
3274
+ onClick: D,
3190
3275
  disabled: i <= 1,
3191
- "aria-label": C("printing.copies.decrease", "One copy fewer"),
3192
- children: /* @__PURE__ */ e(S, { name: "minus", size: 12 })
3276
+ "aria-label": S("printing.copies.decrease", "One copy fewer"),
3277
+ children: /* @__PURE__ */ e(v, { name: "minus", size: 12 })
3193
3278
  }
3194
3279
  ),
3195
- /* @__PURE__ */ e("span", { className: R.copiesValue, children: i }),
3280
+ /* @__PURE__ */ e("span", { className: A.copiesValue, children: i }),
3196
3281
  /* @__PURE__ */ e(
3197
3282
  "button",
3198
3283
  {
3199
- className: R.copiesBtn,
3200
- onClick: x,
3284
+ className: A.copiesBtn,
3285
+ onClick: T,
3201
3286
  disabled: i >= 99,
3202
- "aria-label": C("printing.copies.increase", "One copy more"),
3203
- children: /* @__PURE__ */ e(S, { name: "plus", size: 12 })
3287
+ "aria-label": S("printing.copies.increase", "One copy more"),
3288
+ children: /* @__PURE__ */ e(v, { name: "plus", size: 12 })
3204
3289
  }
3205
3290
  )
3206
3291
  ] })
3207
3292
  ] }),
3208
- /* @__PURE__ */ e("div", { className: R.divider }),
3209
- s.length > 0 && /* @__PURE__ */ a(V, { children: [
3210
- /* @__PURE__ */ a("div", { className: R.section, children: [
3211
- /* @__PURE__ */ e("label", { className: R.sectionLabel, children: C("printing.printer", "Printer") }),
3293
+ /* @__PURE__ */ e("div", { className: A.divider }),
3294
+ o.length > 0 && /* @__PURE__ */ a(J, { children: [
3295
+ /* @__PURE__ */ a("div", { className: A.section, children: [
3296
+ /* @__PURE__ */ e("label", { className: A.sectionLabel, children: S("printing.printer", "Printer") }),
3212
3297
  /* @__PURE__ */ e(
3213
3298
  "select",
3214
3299
  {
3215
- className: R.printerSelect,
3216
- value: c,
3217
- onChange: (w) => F(w.target.value),
3218
- children: s.map((w) => /* @__PURE__ */ a(
3300
+ className: A.printerSelect,
3301
+ value: h,
3302
+ onChange: (b) => z(b.target.value),
3303
+ children: o.map((b) => /* @__PURE__ */ a(
3219
3304
  "option",
3220
3305
  {
3221
- value: w.id,
3222
- disabled: w.status === "offline" || !w.isOnline && w.status == null,
3306
+ value: b.id,
3307
+ disabled: b.status === "offline" || !b.isOnline && b.status == null,
3223
3308
  children: [
3224
- w.name,
3309
+ b.name,
3225
3310
  " ",
3226
- w.status === "offline" || !w.isOnline && w.status == null ? "(Offline)" : w.status === "busy" ? `(${C("printing.printerBusyLabel", "Busy")})` : ""
3311
+ b.status === "offline" || !b.isOnline && b.status == null ? S("printing.offline", "(Offline)") : b.status === "busy" ? `(${S("printing.printerBusyLabel", "Busy")})` : ""
3227
3312
  ]
3228
3313
  },
3229
- w.id
3314
+ b.id
3230
3315
  ))
3231
3316
  }
3232
3317
  ),
3233
- s.find((w) => w.id === c) && /* @__PURE__ */ e("div", { className: R.printerStatus, children: (() => {
3234
- const w = s.find((be) => be.id === c), K = w.status ?? (w.isOnline ? "ready" : "offline");
3235
- return /* @__PURE__ */ a(V, { children: [
3236
- /* @__PURE__ */ e("span", { className: `${R.printerDot} ${R[`dot-${K}`]}` }),
3237
- /* @__PURE__ */ e("span", { className: R.printerStatusLabel, children: K === "ready" ? C("printing.printerReady", "Ready") : K === "busy" ? C("printing.printerBusyLabel", "Busy") : K === "offline" ? "Offline" : C("printing.printerError", "Error") })
3318
+ o.find((b) => b.id === h) && /* @__PURE__ */ e("div", { className: A.printerStatus, children: (() => {
3319
+ const b = o.find((_e) => _e.id === h), V = b.status ?? (b.isOnline ? "ready" : "offline");
3320
+ return /* @__PURE__ */ a(J, { children: [
3321
+ /* @__PURE__ */ e("span", { className: `${A.printerDot} ${A[`dot-${V}`]}` }),
3322
+ /* @__PURE__ */ e("span", { className: A.printerStatusLabel, children: V === "ready" ? S("printing.printerReady", "Ready") : V === "busy" ? S("printing.printerBusyLabel", "Busy") : V === "offline" ? S("printing.offline2", "Offline") : S("printing.printerError", "Error") })
3238
3323
  ] });
3239
3324
  })() })
3240
3325
  ] }),
3241
- /* @__PURE__ */ e("div", { className: R.divider })
3326
+ /* @__PURE__ */ e("div", { className: A.divider })
3242
3327
  ] }),
3243
- /* @__PURE__ */ e("div", { className: R.section, children: /* @__PURE__ */ e(
3328
+ /* @__PURE__ */ e("div", { className: A.section, children: /* @__PURE__ */ e(
3244
3329
  "button",
3245
3330
  {
3246
- className: R.submitBtn,
3247
- onClick: D,
3248
- disabled: B || N || s.length > 0 && (() => {
3249
- const w = s.find((K) => K.id === c);
3250
- return w != null && (w.status === "offline" || !w.isOnline && w.status == null);
3331
+ className: A.submitBtn,
3332
+ onClick: R,
3333
+ disabled: C || N || o.length > 0 && (() => {
3334
+ const b = o.find((V) => V.id === h);
3335
+ return b != null && (b.status === "offline" || !b.isOnline && b.status == null);
3251
3336
  })(),
3252
- children: N ? C("printing.printing", "Printing…") : /* @__PURE__ */ a(V, { children: [
3253
- /* @__PURE__ */ e(S, { name: "printer", size: 14 }),
3337
+ children: N ? S("printing.printing", "Printing…") : /* @__PURE__ */ a(J, { children: [
3338
+ /* @__PURE__ */ e(v, { name: "printer", size: 14 }),
3254
3339
  " ",
3255
- z,
3340
+ I,
3256
3341
  i > 1 ? ` (${i})` : ""
3257
3342
  ] })
3258
3343
  }
@@ -3261,9 +3346,9 @@ const Ds = ({ jobs: n }) => {
3261
3346
  ] });
3262
3347
  };
3263
3348
  export {
3264
- pr as NicePrintButton,
3265
- dr as NicePrintPreview,
3266
- mr as NicePrintQueue,
3267
- cr as NiceTemplateBrowser,
3268
- lr as NiceTemplateEditor
3349
+ br as NicePrintButton,
3350
+ gr as NicePrintPreview,
3351
+ _r as NicePrintQueue,
3352
+ hr as NiceTemplateBrowser,
3353
+ ur as NiceTemplateEditor
3269
3354
  };