@nice2dev/ui-printing 1.2.1 → 1.2.2

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