randmarcomps 1.481.0 → 1.483.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,372 +42,367 @@
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
- */const __iconNode$1n=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ArrowDown=createLucideIcon("ArrowDown",__iconNode$1n);/**
45
+ */const __iconNode$1m=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ArrowDown=createLucideIcon("ArrowDown",__iconNode$1m);/**
46
46
  * @license lucide-react v0.479.0 - ISC
47
47
  *
48
48
  * This source code is licensed under the ISC license.
49
49
  * See the LICENSE file in the root directory of this source tree.
50
- */const __iconNode$1m=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ArrowUpDown=createLucideIcon("ArrowUpDown",__iconNode$1m);/**
50
+ */const __iconNode$1l=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ArrowUpDown=createLucideIcon("ArrowUpDown",__iconNode$1l);/**
51
51
  * @license lucide-react v0.479.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
- */const __iconNode$1l=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ArrowUp=createLucideIcon("ArrowUp",__iconNode$1l);/**
55
+ */const __iconNode$1k=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ArrowUp=createLucideIcon("ArrowUp",__iconNode$1k);/**
56
56
  * @license lucide-react v0.479.0 - ISC
57
57
  *
58
58
  * This source code is licensed under the ISC license.
59
59
  * See the LICENSE file in the root directory of this source tree.
60
- */const __iconNode$1k=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],BadgeCheck=createLucideIcon("BadgeCheck",__iconNode$1k);/**
60
+ */const __iconNode$1j=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],BadgeCheck=createLucideIcon("BadgeCheck",__iconNode$1j);/**
61
61
  * @license lucide-react v0.479.0 - ISC
62
62
  *
63
63
  * This source code is licensed under the ISC license.
64
64
  * See the LICENSE file in the root directory of this source tree.
65
- */const __iconNode$1j=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Banknote=createLucideIcon("Banknote",__iconNode$1j);/**
65
+ */const __iconNode$1i=[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]],Banknote=createLucideIcon("Banknote",__iconNode$1i);/**
66
66
  * @license lucide-react v0.479.0 - ISC
67
67
  *
68
68
  * This source code is licensed under the ISC license.
69
69
  * See the LICENSE file in the root directory of this source tree.
70
- */const __iconNode$1i=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Bold$1=createLucideIcon("Bold",__iconNode$1i);/**
70
+ */const __iconNode$1h=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],Bold$1=createLucideIcon("Bold",__iconNode$1h);/**
71
71
  * @license lucide-react v0.479.0 - ISC
72
72
  *
73
73
  * This source code is licensed under the ISC license.
74
74
  * See the LICENSE file in the root directory of this source tree.
75
- */const __iconNode$1h=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Bot=createLucideIcon("Bot",__iconNode$1h);/**
75
+ */const __iconNode$1g=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Bot=createLucideIcon("Bot",__iconNode$1g);/**
76
76
  * @license lucide-react v0.479.0 - ISC
77
77
  *
78
78
  * This source code is licensed under the ISC license.
79
79
  * See the LICENSE file in the root directory of this source tree.
80
- */const __iconNode$1g=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],CalendarDays=createLucideIcon("CalendarDays",__iconNode$1g);/**
80
+ */const __iconNode$1f=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],CalendarDays=createLucideIcon("CalendarDays",__iconNode$1f);/**
81
81
  * @license lucide-react v0.479.0 - ISC
82
82
  *
83
83
  * This source code is licensed under the ISC license.
84
84
  * See the LICENSE file in the root directory of this source tree.
85
- */const __iconNode$1f=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],CalendarRange=createLucideIcon("CalendarRange",__iconNode$1f);/**
85
+ */const __iconNode$1e=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],CalendarRange=createLucideIcon("CalendarRange",__iconNode$1e);/**
86
86
  * @license lucide-react v0.479.0 - ISC
87
87
  *
88
88
  * This source code is licensed under the ISC license.
89
89
  * See the LICENSE file in the root directory of this source tree.
90
- */const __iconNode$1e=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Calendar$1=createLucideIcon("Calendar",__iconNode$1e);/**
90
+ */const __iconNode$1d=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Calendar$1=createLucideIcon("Calendar",__iconNode$1d);/**
91
91
  * @license lucide-react v0.479.0 - ISC
92
92
  *
93
93
  * This source code is licensed under the ISC license.
94
94
  * See the LICENSE file in the root directory of this source tree.
95
- */const __iconNode$1d=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],ChartLine=createLucideIcon("ChartLine",__iconNode$1d);/**
95
+ */const __iconNode$1c=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]],ChartLine=createLucideIcon("ChartLine",__iconNode$1c);/**
96
96
  * @license lucide-react v0.479.0 - ISC
97
97
  *
98
98
  * This source code is licensed under the ISC license.
99
99
  * See the LICENSE file in the root directory of this source tree.
100
- */const __iconNode$1c=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],ChartNoAxesColumnIncreasing=createLucideIcon("ChartNoAxesColumnIncreasing",__iconNode$1c);/**
100
+ */const __iconNode$1b=[["line",{x1:"12",x2:"12",y1:"20",y2:"10",key:"1vz5eb"}],["line",{x1:"18",x2:"18",y1:"20",y2:"4",key:"cun8e5"}],["line",{x1:"6",x2:"6",y1:"20",y2:"16",key:"hq0ia6"}]],ChartNoAxesColumnIncreasing=createLucideIcon("ChartNoAxesColumnIncreasing",__iconNode$1b);/**
101
101
  * @license lucide-react v0.479.0 - ISC
102
102
  *
103
103
  * This source code is licensed under the ISC license.
104
104
  * See the LICENSE file in the root directory of this source tree.
105
- */const __iconNode$1b=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("Check",__iconNode$1b);/**
105
+ */const __iconNode$1a=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Check=createLucideIcon("Check",__iconNode$1a);/**
106
106
  * @license lucide-react v0.479.0 - ISC
107
107
  *
108
108
  * This source code is licensed under the ISC license.
109
109
  * See the LICENSE file in the root directory of this source tree.
110
- */const __iconNode$1a=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ChevronDown=createLucideIcon("ChevronDown",__iconNode$1a);/**
110
+ */const __iconNode$19=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ChevronDown=createLucideIcon("ChevronDown",__iconNode$19);/**
111
111
  * @license lucide-react v0.479.0 - ISC
112
112
  *
113
113
  * This source code is licensed under the ISC license.
114
114
  * See the LICENSE file in the root directory of this source tree.
115
- */const __iconNode$19=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ChevronLeft=createLucideIcon("ChevronLeft",__iconNode$19);/**
115
+ */const __iconNode$18=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ChevronLeft=createLucideIcon("ChevronLeft",__iconNode$18);/**
116
116
  * @license lucide-react v0.479.0 - ISC
117
117
  *
118
118
  * This source code is licensed under the ISC license.
119
119
  * See the LICENSE file in the root directory of this source tree.
120
- */const __iconNode$18=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ChevronRight=createLucideIcon("ChevronRight",__iconNode$18);/**
120
+ */const __iconNode$17=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ChevronRight=createLucideIcon("ChevronRight",__iconNode$17);/**
121
121
  * @license lucide-react v0.479.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
- */const __iconNode$17=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ChevronUp=createLucideIcon("ChevronUp",__iconNode$17);/**
125
+ */const __iconNode$16=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ChevronUp=createLucideIcon("ChevronUp",__iconNode$16);/**
126
126
  * @license lucide-react v0.479.0 - ISC
127
127
  *
128
128
  * This source code is licensed under the ISC license.
129
129
  * See the LICENSE file in the root directory of this source tree.
130
- */const __iconNode$16=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],ChevronsLeft=createLucideIcon("ChevronsLeft",__iconNode$16);/**
130
+ */const __iconNode$15=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],ChevronsLeft=createLucideIcon("ChevronsLeft",__iconNode$15);/**
131
131
  * @license lucide-react v0.479.0 - ISC
132
132
  *
133
133
  * This source code is licensed under the ISC license.
134
134
  * See the LICENSE file in the root directory of this source tree.
135
- */const __iconNode$15=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],ChevronsRight=createLucideIcon("ChevronsRight",__iconNode$15);/**
135
+ */const __iconNode$14=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],ChevronsRight=createLucideIcon("ChevronsRight",__iconNode$14);/**
136
136
  * @license lucide-react v0.479.0 - ISC
137
137
  *
138
138
  * This source code is licensed under the ISC license.
139
139
  * See the LICENSE file in the root directory of this source tree.
140
- */const __iconNode$14=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ChevronsUpDown=createLucideIcon("ChevronsUpDown",__iconNode$14);/**
140
+ */const __iconNode$13=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ChevronsUpDown=createLucideIcon("ChevronsUpDown",__iconNode$13);/**
141
141
  * @license lucide-react v0.479.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
- */const __iconNode$13=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],CircleAlert=createLucideIcon("CircleAlert",__iconNode$13);/**
145
+ */const __iconNode$12=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],CircleAlert=createLucideIcon("CircleAlert",__iconNode$12);/**
146
146
  * @license lucide-react v0.479.0 - ISC
147
147
  *
148
148
  * This source code is licensed under the ISC license.
149
149
  * See the LICENSE file in the root directory of this source tree.
150
- */const __iconNode$12=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],CircleCheck=createLucideIcon("CircleCheck",__iconNode$12);/**
150
+ */const __iconNode$11=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],CircleCheck=createLucideIcon("CircleCheck",__iconNode$11);/**
151
151
  * @license lucide-react v0.479.0 - ISC
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const __iconNode$11=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],CircleDashed=createLucideIcon("CircleDashed",__iconNode$11);/**
155
+ */const __iconNode$10=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],CircleDashed=createLucideIcon("CircleDashed",__iconNode$10);/**
156
156
  * @license lucide-react v0.479.0 - ISC
157
157
  *
158
158
  * This source code is licensed under the ISC license.
159
159
  * See the LICENSE file in the root directory of this source tree.
160
- */const __iconNode$10=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Circle=createLucideIcon("Circle",__iconNode$10);/**
160
+ */const __iconNode$$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Circle=createLucideIcon("Circle",__iconNode$$);/**
161
161
  * @license lucide-react v0.479.0 - ISC
162
162
  *
163
163
  * This source code is licensed under the ISC license.
164
164
  * See the LICENSE file in the root directory of this source tree.
165
- */const __iconNode$$=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],ClipboardList=createLucideIcon("ClipboardList",__iconNode$$);/**
165
+ */const __iconNode$_=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],ClipboardList=createLucideIcon("ClipboardList",__iconNode$_);/**
166
166
  * @license lucide-react v0.479.0 - ISC
167
167
  *
168
168
  * This source code is licensed under the ISC license.
169
169
  * See the LICENSE file in the root directory of this source tree.
170
- */const __iconNode$_=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],CodeXml=createLucideIcon("CodeXml",__iconNode$_);/**
170
+ */const __iconNode$Z=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],CodeXml=createLucideIcon("CodeXml",__iconNode$Z);/**
171
171
  * @license lucide-react v0.479.0 - ISC
172
172
  *
173
173
  * This source code is licensed under the ISC license.
174
174
  * See the LICENSE file in the root directory of this source tree.
175
- */const __iconNode$Z=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Code$1=createLucideIcon("Code",__iconNode$Z);/**
175
+ */const __iconNode$Y=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Code$1=createLucideIcon("Code",__iconNode$Y);/**
176
176
  * @license lucide-react v0.479.0 - ISC
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
- */const __iconNode$Y=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Copy=createLucideIcon("Copy",__iconNode$Y);/**
180
+ */const __iconNode$X=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Copy=createLucideIcon("Copy",__iconNode$X);/**
181
181
  * @license lucide-react v0.479.0 - ISC
182
182
  *
183
183
  * This source code is licensed under the ISC license.
184
184
  * See the LICENSE file in the root directory of this source tree.
185
- */const __iconNode$X=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],CreditCard=createLucideIcon("CreditCard",__iconNode$X);/**
185
+ */const __iconNode$W=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],CreditCard=createLucideIcon("CreditCard",__iconNode$W);/**
186
186
  * @license lucide-react v0.479.0 - ISC
187
187
  *
188
188
  * This source code is licensed under the ISC license.
189
189
  * See the LICENSE file in the root directory of this source tree.
190
- */const __iconNode$W=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],DollarSign=createLucideIcon("DollarSign",__iconNode$W);/**
190
+ */const __iconNode$V=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],DollarSign=createLucideIcon("DollarSign",__iconNode$V);/**
191
191
  * @license lucide-react v0.479.0 - ISC
192
192
  *
193
193
  * This source code is licensed under the ISC license.
194
194
  * See the LICENSE file in the root directory of this source tree.
195
- */const __iconNode$V=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Download=createLucideIcon("Download",__iconNode$V);/**
195
+ */const __iconNode$U=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Download=createLucideIcon("Download",__iconNode$U);/**
196
196
  * @license lucide-react v0.479.0 - ISC
197
197
  *
198
198
  * This source code is licensed under the ISC license.
199
199
  * See the LICENSE file in the root directory of this source tree.
200
- */const __iconNode$U=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ExternalLink=createLucideIcon("ExternalLink",__iconNode$U);/**
200
+ */const __iconNode$T=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ExternalLink=createLucideIcon("ExternalLink",__iconNode$T);/**
201
201
  * @license lucide-react v0.479.0 - ISC
202
202
  *
203
203
  * This source code is licensed under the ISC license.
204
204
  * See the LICENSE file in the root directory of this source tree.
205
- */const __iconNode$T=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Eye=createLucideIcon("Eye",__iconNode$T);/**
205
+ */const __iconNode$S=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Eye=createLucideIcon("Eye",__iconNode$S);/**
206
206
  * @license lucide-react v0.479.0 - ISC
207
207
  *
208
208
  * This source code is licensed under the ISC license.
209
209
  * See the LICENSE file in the root directory of this source tree.
210
- */const __iconNode$S=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],FileText=createLucideIcon("FileText",__iconNode$S);/**
210
+ */const __iconNode$R=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],FileText=createLucideIcon("FileText",__iconNode$R);/**
211
211
  * @license lucide-react v0.479.0 - ISC
212
212
  *
213
213
  * This source code is licensed under the ISC license.
214
214
  * See the LICENSE file in the root directory of this source tree.
215
- */const __iconNode$R=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],File$1=createLucideIcon("File",__iconNode$R);/**
215
+ */const __iconNode$Q=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],File$1=createLucideIcon("File",__iconNode$Q);/**
216
216
  * @license lucide-react v0.479.0 - ISC
217
217
  *
218
218
  * This source code is licensed under the ISC license.
219
219
  * See the LICENSE file in the root directory of this source tree.
220
- */const __iconNode$Q=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],Filter=createLucideIcon("Filter",__iconNode$Q);/**
220
+ */const __iconNode$P=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],Filter=createLucideIcon("Filter",__iconNode$P);/**
221
221
  * @license lucide-react v0.479.0 - ISC
222
222
  *
223
223
  * This source code is licensed under the ISC license.
224
224
  * See the LICENSE file in the root directory of this source tree.
225
- */const __iconNode$P=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Globe=createLucideIcon("Globe",__iconNode$P);/**
225
+ */const __iconNode$O=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Globe=createLucideIcon("Globe",__iconNode$O);/**
226
226
  * @license lucide-react v0.479.0 - ISC
227
227
  *
228
228
  * This source code is licensed under the ISC license.
229
229
  * See the LICENSE file in the root directory of this source tree.
230
- */const __iconNode$O=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Handshake=createLucideIcon("Handshake",__iconNode$O);/**
230
+ */const __iconNode$N=[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]],Handshake=createLucideIcon("Handshake",__iconNode$N);/**
231
231
  * @license lucide-react v0.479.0 - ISC
232
232
  *
233
233
  * This source code is licensed under the ISC license.
234
234
  * See the LICENSE file in the root directory of this source tree.
235
- */const __iconNode$N=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]],HardDriveDownload=createLucideIcon("HardDriveDownload",__iconNode$N);/**
235
+ */const __iconNode$M=[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m16 6-4 4-4-4",key:"6wukr"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",key:"w68u3i"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M10 18h.01",key:"h775k"}]],HardDriveDownload=createLucideIcon("HardDriveDownload",__iconNode$M);/**
236
236
  * @license lucide-react v0.479.0 - ISC
237
237
  *
238
238
  * This source code is licensed under the ISC license.
239
239
  * See the LICENSE file in the root directory of this source tree.
240
- */const __iconNode$M=[["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["rect",{x:"2",y:"15",width:"20",height:"4",rx:"1",key:"g3x8cw"}]],HardHat=createLucideIcon("HardHat",__iconNode$M);/**
240
+ */const __iconNode$L=[["path",{d:"M10 10V5a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v5",key:"1p9q5i"}],["path",{d:"M14 6a6 6 0 0 1 6 6v3",key:"1hnv84"}],["path",{d:"M4 15v-3a6 6 0 0 1 6-6",key:"9ciidu"}],["rect",{x:"2",y:"15",width:"20",height:"4",rx:"1",key:"g3x8cw"}]],HardHat=createLucideIcon("HardHat",__iconNode$L);/**
241
241
  * @license lucide-react v0.479.0 - ISC
242
242
  *
243
243
  * This source code is licensed under the ISC license.
244
244
  * See the LICENSE file in the root directory of this source tree.
245
- */const __iconNode$L=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],ImageOff=createLucideIcon("ImageOff",__iconNode$L);/**
245
+ */const __iconNode$K=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],ImageOff=createLucideIcon("ImageOff",__iconNode$K);/**
246
246
  * @license lucide-react v0.479.0 - ISC
247
247
  *
248
248
  * This source code is licensed under the ISC license.
249
249
  * See the LICENSE file in the root directory of this source tree.
250
- */const __iconNode$K=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Info=createLucideIcon("Info",__iconNode$K);/**
250
+ */const __iconNode$J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Info=createLucideIcon("Info",__iconNode$J);/**
251
251
  * @license lucide-react v0.479.0 - ISC
252
252
  *
253
253
  * This source code is licensed under the ISC license.
254
254
  * See the LICENSE file in the root directory of this source tree.
255
- */const __iconNode$J=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],Italic$1=createLucideIcon("Italic",__iconNode$J);/**
255
+ */const __iconNode$I=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],Italic$1=createLucideIcon("Italic",__iconNode$I);/**
256
256
  * @license lucide-react v0.479.0 - ISC
257
257
  *
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
- */const __iconNode$I=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],ListOrdered=createLucideIcon("ListOrdered",__iconNode$I);/**
260
+ */const __iconNode$H=[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]],ListOrdered=createLucideIcon("ListOrdered",__iconNode$H);/**
261
261
  * @license lucide-react v0.479.0 - ISC
262
262
  *
263
263
  * This source code is licensed under the ISC license.
264
264
  * See the LICENSE file in the root directory of this source tree.
265
- */const __iconNode$H=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],List$1=createLucideIcon("List",__iconNode$H);/**
265
+ */const __iconNode$G=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],List$1=createLucideIcon("List",__iconNode$G);/**
266
266
  * @license lucide-react v0.479.0 - ISC
267
267
  *
268
268
  * This source code is licensed under the ISC license.
269
269
  * See the LICENSE file in the root directory of this source tree.
270
- */const __iconNode$G=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],LoaderCircle=createLucideIcon("LoaderCircle",__iconNode$G);/**
270
+ */const __iconNode$F=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],LoaderCircle=createLucideIcon("LoaderCircle",__iconNode$F);/**
271
271
  * @license lucide-react v0.479.0 - ISC
272
272
  *
273
273
  * This source code is licensed under the ISC license.
274
274
  * See the LICENSE file in the root directory of this source tree.
275
- */const __iconNode$F=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],LogOut=createLucideIcon("LogOut",__iconNode$F);/**
275
+ */const __iconNode$E=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],LogOut=createLucideIcon("LogOut",__iconNode$E);/**
276
276
  * @license lucide-react v0.479.0 - ISC
277
277
  *
278
278
  * This source code is licensed under the ISC license.
279
279
  * See the LICENSE file in the root directory of this source tree.
280
- */const __iconNode$E=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],Mail=createLucideIcon("Mail",__iconNode$E);/**
280
+ */const __iconNode$D=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],Mail=createLucideIcon("Mail",__iconNode$D);/**
281
281
  * @license lucide-react v0.479.0 - ISC
282
282
  *
283
283
  * This source code is licensed under the ISC license.
284
284
  * See the LICENSE file in the root directory of this source tree.
285
- */const __iconNode$D=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Menu$1=createLucideIcon("Menu",__iconNode$D);/**
285
+ */const __iconNode$C=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],Menu$1=createLucideIcon("Menu",__iconNode$C);/**
286
286
  * @license lucide-react v0.479.0 - ISC
287
287
  *
288
288
  * This source code is licensed under the ISC license.
289
289
  * See the LICENSE file in the root directory of this source tree.
290
- */const __iconNode$C=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],MessageCircleX=createLucideIcon("MessageCircleX",__iconNode$C);/**
290
+ */const __iconNode$B=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],MessageCircleX=createLucideIcon("MessageCircleX",__iconNode$B);/**
291
291
  * @license lucide-react v0.479.0 - ISC
292
292
  *
293
293
  * This source code is licensed under the ISC license.
294
294
  * See the LICENSE file in the root directory of this source tree.
295
- */const __iconNode$B=[["path",{d:"M19 15v-2a2 2 0 1 0-4 0v2",key:"h3d1vz"}],["path",{d:"M9 17H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v3.5",key:"xsnnhn"}],["rect",{x:"13",y:"15",width:"8",height:"5",rx:"1",key:"1ccwuk"}]],MessageSquareLock=createLucideIcon("MessageSquareLock",__iconNode$B);/**
295
+ */const __iconNode$A=[["path",{d:"M19 15v-2a2 2 0 1 0-4 0v2",key:"h3d1vz"}],["path",{d:"M9 17H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v3.5",key:"xsnnhn"}],["rect",{x:"13",y:"15",width:"8",height:"5",rx:"1",key:"1ccwuk"}]],MessageSquareLock=createLucideIcon("MessageSquareLock",__iconNode$A);/**
296
296
  * @license lucide-react v0.479.0 - ISC
297
297
  *
298
298
  * This source code is licensed under the ISC license.
299
299
  * See the LICENSE file in the root directory of this source tree.
300
- */const __iconNode$A=[["path",{d:"M21 12v3a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h7",key:"tqtdkg"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"m16 8 5-5",key:"15mbrl"}]],MessageSquareShare=createLucideIcon("MessageSquareShare",__iconNode$A);/**
300
+ */const __iconNode$z=[["path",{d:"M21 12v3a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h7",key:"tqtdkg"}],["path",{d:"M16 3h5v5",key:"1806ms"}],["path",{d:"m16 8 5-5",key:"15mbrl"}]],MessageSquareShare=createLucideIcon("MessageSquareShare",__iconNode$z);/**
301
301
  * @license lucide-react v0.479.0 - ISC
302
302
  *
303
303
  * This source code is licensed under the ISC license.
304
304
  * See the LICENSE file in the root directory of this source tree.
305
- */const __iconNode$z=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],MessageSquare=createLucideIcon("MessageSquare",__iconNode$z);/**
305
+ */const __iconNode$y=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]],MessageSquare=createLucideIcon("MessageSquare",__iconNode$y);/**
306
306
  * @license lucide-react v0.479.0 - ISC
307
307
  *
308
308
  * This source code is licensed under the ISC license.
309
309
  * See the LICENSE file in the root directory of this source tree.
310
- */const __iconNode$y=[["path",{d:"M5 12h14",key:"1ays0h"}]],Minus=createLucideIcon("Minus",__iconNode$y);/**
310
+ */const __iconNode$x=[["path",{d:"M5 12h14",key:"1ays0h"}]],Minus=createLucideIcon("Minus",__iconNode$x);/**
311
311
  * @license lucide-react v0.479.0 - ISC
312
312
  *
313
313
  * This source code is licensed under the ISC license.
314
314
  * See the LICENSE file in the root directory of this source tree.
315
- */const __iconNode$x=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],MousePointerClick=createLucideIcon("MousePointerClick",__iconNode$x);/**
315
+ */const __iconNode$w=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],MousePointerClick=createLucideIcon("MousePointerClick",__iconNode$w);/**
316
316
  * @license lucide-react v0.479.0 - ISC
317
317
  *
318
318
  * This source code is licensed under the ISC license.
319
319
  * See the LICENSE file in the root directory of this source tree.
320
- */const __iconNode$w=[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]],Package2=createLucideIcon("Package2",__iconNode$w);/**
320
+ */const __iconNode$v=[["path",{d:"M3 9h18v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9Z",key:"1ront0"}],["path",{d:"m3 9 2.45-4.9A2 2 0 0 1 7.24 3h9.52a2 2 0 0 1 1.8 1.1L21 9",key:"19h2x1"}],["path",{d:"M12 3v6",key:"1holv5"}]],Package2=createLucideIcon("Package2",__iconNode$v);/**
321
321
  * @license lucide-react v0.479.0 - ISC
322
322
  *
323
323
  * This source code is licensed under the ISC license.
324
324
  * See the LICENSE file in the root directory of this source tree.
325
- */const __iconNode$v=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Package=createLucideIcon("Package",__iconNode$v);/**
325
+ */const __iconNode$u=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Package=createLucideIcon("Package",__iconNode$u);/**
326
326
  * @license lucide-react v0.479.0 - ISC
327
327
  *
328
328
  * This source code is licensed under the ISC license.
329
329
  * See the LICENSE file in the root directory of this source tree.
330
- */const __iconNode$u=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],PanelLeft=createLucideIcon("PanelLeft",__iconNode$u);/**
330
+ */const __iconNode$t=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],PanelLeft=createLucideIcon("PanelLeft",__iconNode$t);/**
331
331
  * @license lucide-react v0.479.0 - ISC
332
332
  *
333
333
  * This source code is licensed under the ISC license.
334
334
  * See the LICENSE file in the root directory of this source tree.
335
- */const __iconNode$t=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],Paperclip=createLucideIcon("Paperclip",__iconNode$t);/**
335
+ */const __iconNode$s=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],Paperclip=createLucideIcon("Paperclip",__iconNode$s);/**
336
336
  * @license lucide-react v0.479.0 - ISC
337
337
  *
338
338
  * This source code is licensed under the ISC license.
339
339
  * See the LICENSE file in the root directory of this source tree.
340
- */const __iconNode$s=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],Phone=createLucideIcon("Phone",__iconNode$s);/**
340
+ */const __iconNode$r=[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]],Phone=createLucideIcon("Phone",__iconNode$r);/**
341
341
  * @license lucide-react v0.479.0 - ISC
342
342
  *
343
343
  * This source code is licensed under the ISC license.
344
344
  * See the LICENSE file in the root directory of this source tree.
345
- */const __iconNode$r=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Play=createLucideIcon("Play",__iconNode$r);/**
345
+ */const __iconNode$q=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Play=createLucideIcon("Play",__iconNode$q);/**
346
346
  * @license lucide-react v0.479.0 - ISC
347
347
  *
348
348
  * This source code is licensed under the ISC license.
349
349
  * See the LICENSE file in the root directory of this source tree.
350
- */const __iconNode$q=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Printer=createLucideIcon("Printer",__iconNode$q);/**
350
+ */const __iconNode$p=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],Printer=createLucideIcon("Printer",__iconNode$p);/**
351
351
  * @license lucide-react v0.479.0 - ISC
352
352
  *
353
353
  * This source code is licensed under the ISC license.
354
354
  * See the LICENSE file in the root directory of this source tree.
355
- */const __iconNode$p=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],QrCode=createLucideIcon("QrCode",__iconNode$p);/**
355
+ */const __iconNode$o=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],QrCode=createLucideIcon("QrCode",__iconNode$o);/**
356
356
  * @license lucide-react v0.479.0 - ISC
357
357
  *
358
358
  * This source code is licensed under the ISC license.
359
359
  * See the LICENSE file in the root directory of this source tree.
360
- */const __iconNode$o=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],RefreshCcw=createLucideIcon("RefreshCcw",__iconNode$o);/**
360
+ */const __iconNode$n=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],RefreshCcw=createLucideIcon("RefreshCcw",__iconNode$n);/**
361
361
  * @license lucide-react v0.479.0 - ISC
362
362
  *
363
363
  * This source code is licensed under the ISC license.
364
364
  * See the LICENSE file in the root directory of this source tree.
365
- */const __iconNode$n=[["path",{d:"M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47",key:"1krf6h"}],["path",{d:"M8 16H3v5",key:"1cv678"}],["path",{d:"M3 12C3 9.51 4 7.26 5.64 5.64",key:"ruvoct"}],["path",{d:"m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64",key:"19q130"}],["path",{d:"M21 12c0 1-.16 1.97-.47 2.87",key:"4w8emr"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}]],RefreshCwOff=createLucideIcon("RefreshCwOff",__iconNode$n);/**
365
+ */const __iconNode$m=[["path",{d:"M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47",key:"1krf6h"}],["path",{d:"M8 16H3v5",key:"1cv678"}],["path",{d:"M3 12C3 9.51 4 7.26 5.64 5.64",key:"ruvoct"}],["path",{d:"m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64",key:"19q130"}],["path",{d:"M21 12c0 1-.16 1.97-.47 2.87",key:"4w8emr"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}]],RefreshCwOff=createLucideIcon("RefreshCwOff",__iconNode$m);/**
366
366
  * @license lucide-react v0.479.0 - ISC
367
367
  *
368
368
  * This source code is licensed under the ISC license.
369
369
  * See the LICENSE file in the root directory of this source tree.
370
- */const __iconNode$m=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],RefreshCw=createLucideIcon("RefreshCw",__iconNode$m);/**
370
+ */const __iconNode$l=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],RefreshCw=createLucideIcon("RefreshCw",__iconNode$l);/**
371
371
  * @license lucide-react v0.479.0 - ISC
372
372
  *
373
373
  * This source code is licensed under the ISC license.
374
374
  * See the LICENSE file in the root directory of this source tree.
375
- */const __iconNode$l=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],ScrollText=createLucideIcon("ScrollText",__iconNode$l);/**
375
+ */const __iconNode$k=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],ScrollText=createLucideIcon("ScrollText",__iconNode$k);/**
376
376
  * @license lucide-react v0.479.0 - ISC
377
377
  *
378
378
  * This source code is licensed under the ISC license.
379
379
  * See the LICENSE file in the root directory of this source tree.
380
- */const __iconNode$k=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],SearchX=createLucideIcon("SearchX",__iconNode$k);/**
380
+ */const __iconNode$j=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],SearchX=createLucideIcon("SearchX",__iconNode$j);/**
381
381
  * @license lucide-react v0.479.0 - ISC
382
382
  *
383
383
  * This source code is licensed under the ISC license.
384
384
  * See the LICENSE file in the root directory of this source tree.
385
- */const __iconNode$j=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Search=createLucideIcon("Search",__iconNode$j);/**
385
+ */const __iconNode$i=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Search=createLucideIcon("Search",__iconNode$i);/**
386
386
  * @license lucide-react v0.479.0 - ISC
387
387
  *
388
388
  * This source code is licensed under the ISC license.
389
389
  * See the LICENSE file in the root directory of this source tree.
390
- */const __iconNode$i=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Send=createLucideIcon("Send",__iconNode$i);/**
390
+ */const __iconNode$h=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Send=createLucideIcon("Send",__iconNode$h);/**
391
391
  * @license lucide-react v0.479.0 - ISC
392
392
  *
393
393
  * This source code is licensed under the ISC license.
394
394
  * See the LICENSE file in the root directory of this source tree.
395
- */const __iconNode$h=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Settings=createLucideIcon("Settings",__iconNode$h);/**
395
+ */const __iconNode$g=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Settings=createLucideIcon("Settings",__iconNode$g);/**
396
396
  * @license lucide-react v0.479.0 - ISC
397
397
  *
398
398
  * This source code is licensed under the ISC license.
399
399
  * See the LICENSE file in the root directory of this source tree.
400
- */const __iconNode$g=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ShieldCheck=createLucideIcon("ShieldCheck",__iconNode$g);/**
400
+ */const __iconNode$f=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ShieldCheck=createLucideIcon("ShieldCheck",__iconNode$f);/**
401
401
  * @license lucide-react v0.479.0 - ISC
402
402
  *
403
403
  * This source code is licensed under the ISC license.
404
404
  * See the LICENSE file in the root directory of this source tree.
405
- */const __iconNode$f=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],ShoppingCart=createLucideIcon("ShoppingCart",__iconNode$f);/**
406
- * @license lucide-react v0.479.0 - ISC
407
- *
408
- * This source code is licensed under the ISC license.
409
- * See the LICENSE file in the root directory of this source tree.
410
- */const __iconNode$e=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],Sparkles=createLucideIcon("Sparkles",__iconNode$e);/**
405
+ */const __iconNode$e=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],ShoppingCart=createLucideIcon("ShoppingCart",__iconNode$e);/**
411
406
  * @license lucide-react v0.479.0 - ISC
412
407
  *
413
408
  * This source code is licensed under the ISC license.
@@ -1199,7 +1194,7 @@ Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An err
1199
1194
 
1200
1195
  Defaulting to \`null\`.`}var Root$2=Progress$1,Indicator=ProgressIndicator;const Progress=React__namespace.forwardRef(({className:e,value:t,...n},o)=>jsxRuntime.jsx(Root$2,{ref:o,className:cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:jsxRuntime.jsx(Indicator,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));Progress.displayName=Root$2.displayName;function ManufacturerInventoryFinanceCard({manufacturer:e,isLoading:t}){const{data:n,isLoading:o,isFetching:l}=useGetV4ManufacturerByRouteManufacturerIdInventoryValueQuery({routeManufacturerId:(e==null?void 0:e.ManufacturerId)??""},{skip:!(e!=null&&e.ManufacturerId)}),d=(e==null?void 0:e.DefaultMaxInventoryValue)??0,f=(n||[]).reduce((_,S)=>_+(S.InventoryValue||0),0),g=d-f,b=Math.round(f/d*100);return t||o||l?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/2 mt-2"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsx(Skeleton,{className:"h-2 w-full"})]})]})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsxs(CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(DollarSign,{className:"h-5 w-5 text-muted-foreground"}),"Inventory Finance"]}),jsxRuntime.jsx(CardDescription,{children:"Current inventory financial status"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[d!==0&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Max Allowance"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(d)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Current value"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(f)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Available"}),jsxRuntime.jsx("span",{className:`font-bold ${g>=0?"text-emerald-600 dark:text-emerald-500":"text-red-600 dark:text-red-500"}`,children:formatMoney(g)})]})]}),d!==0&&jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Budget Usage"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[b,"%"]}),b>80&&jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4 text-amber-500"})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:b>80?"High usage alert":"Budget usage"})})]})})]}),jsxRuntime.jsx(Progress,{value:b,className:"h-2"})]})]})]})}function ManufacturerCreditFinanceCard({manufacturer:e,isLoading:t}){const n=(e==null?void 0:e.CreditLimit)??0,o=(e==null?void 0:e.OutstandingBalance)??0,l=n-o,d=Math.round(o/n*100);return t?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/2 mt-2"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/4"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-1/3"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsx(Skeleton,{className:"h-2 w-full"})]})]})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsxs(CardTitle,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(CreditCard,{className:"h-5 w-5 text-muted-foreground"}),"Credit Finance"]}),jsxRuntime.jsx(CardDescription,{children:"Current credit financial status"})]}),jsxRuntime.jsxs(CardContent,{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Credit Limit"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(n)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Outstanding Balance"}),jsxRuntime.jsx("span",{className:"font-bold",children:formatMoney(o)})]}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Available Credit"}),jsxRuntime.jsx("span",{className:`font-bold ${l>=0?"text-emerald-600 dark:text-emerald-500":"text-red-600 dark:text-red-500"}`,children:formatMoney(l)})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Credit Usage"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[d,"%"]}),d>80&&jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4 text-amber-500"})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:d>80?"High credit usage alert":"Credit usage"})})]})})]}),jsxRuntime.jsx(Progress,{value:d,className:"h-2"})]})]})]})}function SalesChartCard({statistics:e,loading:t=!1,mode:n="month",chartHeight:o=300,className:l,size:d="default"}){return t?jsxRuntime.jsxs(Card,{className:cn("w-full",l),children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-48 rounded-md"})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsx("div",{style:{height:o},children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full rounded-md"})}),d==="default"&&n==="month"&&jsxRuntime.jsxs("div",{className:"mt-4 flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-10 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40 rounded-md"})]})]})]}):jsxRuntime.jsxs(Card,{className:cn("w-full",l),children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:n==="week"?"Weekly Sales Performance":"Monthly Sales Performance"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(SalesChart,{statistics:e,mode:n,chartHeight:o,size:d})})]})}function ManufacturerOverviewPage({applicationId:e,readonly:t,withReports:n,manufacturer:o,userEmail:l}){const{data:d,isLoading:f,isError:g}=useGetV4PartnerByApplicationIdAccountManufacturerQuery({applicationId:e,withSpecification:!0},{skip:!!o}),[b,_]=React.useState({publicInfo:{hasUnsavedChanges:!1},qualifications:{hasUnsavedChanges:!1},billingInfo:{hasUnsavedChanges:!1}}),S=React.useCallback(()=>t?!1:b.publicInfo.hasUnsavedChanges||b.qualifications.hasUnsavedChanges||b.billingInfo.hasUnsavedChanges,[t,b]),R=React.useCallback((A,M)=>{_(I=>{var j;return((j=I[A])==null?void 0:j.hasUnsavedChanges)!==M.hasUnsavedChanges?(console.log(`Updating form state for ${A}:`,M.hasUnsavedChanges),{...I,[A]:M}):I})},[]),{NavigationGuardDialog:C}=useRouterNavigationGuard(S),E=o??d;return jsxRuntime.jsxs("div",{className:"@container",children:[g?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your manufacturer information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:E==null?void 0:E.FiscalYearMonthStart,salesData:E==null?void 0:E.SalesData,isLoading:f}),jsxRuntime.jsxs("div",{className:"grid @2xl:grid-cols-2 gap-6",children:[jsxRuntime.jsx(SalesChartCard,{statistics:(E==null?void 0:E.SalesStatistics)??[],loading:f}),jsxRuntime.jsx(ManufacturerResellerOrdersSection,{manufacturerId:(E==null?void 0:E.ManufacturerId)??"",activeOrders:(E==null?void 0:E.ActiveOrderDetails)??void 0,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerInventoryFinanceCard,{manufacturer:E,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerCreditFinanceCard,{manufacturer:E,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerReorderingCard,{manufacturer:E??{},onSave:()=>{},loading:f,readonly:t}),n&&jsxRuntime.jsx(ManufacturerPublicInfoSection,{manufacturer:E,readonly:t,isLoading:f,onUnsavedChanges:A=>R("publicInfo",{hasUnsavedChanges:A})}),n&&jsxRuntime.jsx(OpenToWorkSection,{manufacturer:E,readonly:t,isLoading:f}),n&&jsxRuntime.jsx(ManufacturerBillingInfoSection,{manufacturer:E,readonly:t,isLoading:f,onUnsavedChanges:A=>R("billingInfo",{hasUnsavedChanges:A})}),n&&jsxRuntime.jsx(ManufacturerQualificationsSection,{manufacturer:E,readonly:t,isLoading:f,onUnsavedChanges:A=>R("qualifications",{hasUnsavedChanges:A})})]}),n&&jsxRuntime.jsx(ManufacturerReportsSection,{manufacturerId:(E==null?void 0:E.ManufacturerId)??"",userEmail:l,isLoading:f})]}),jsxRuntime.jsx(C,{})]})}function ManufacturerCategories({categories:e,activeCategory:t,onSelectCategory:n}){return jsxRuntime.jsx("div",{className:"grid",children:jsxRuntime.jsx("div",{className:"flex overflow-x-auto small-scrollbar pb-4",children:jsxRuntime.jsxs("div",{className:"flex gap-2 items-baseline",children:[jsxRuntime.jsx("p",{children:"Category filter:"}),e.map(o=>jsxRuntime.jsxs(Button$1,{onClick:()=>n(o.CategoryCode??""),variant:t===o.CategoryCode?"default":"outline",size:"sm",className:"px-3 py-1.5 text-xs whitespace-nowrap rounded-full",children:[o.CategoryName??"Undefined",o.QualificationRequired&&jsxRuntime.jsx(ShieldCheck,{className:`ml-1 w-5 h-5 ${t!==o.CategoryCode?"text-red-500":""}`})]},o.CategoryCode))]})})})}function CategoryStats(e){const{data:t,isLoading:n,isFetching:o}=useGetV4ResellerByRouteResellerIdManufacturerAndManufacturerIdCategoryCodeQuery({routeResellerId:e.appID,manufacturerId:e.manufID,categoryCode:e.categoryCode});return jsxRuntime.jsx(Card,{className:"w-full",children:jsxRuntime.jsx(CardContent,{className:"p-4 space-y-1",children:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:e.categoryName}),jsxRuntime.jsx(SalesChart,{statistics:(t==null?void 0:t.SalesStatistics)??[],loading:n||o,chartHeight:300})]})})})}function ManufacturerCategoriesStats(e){return(e.categories??[]).filter(n=>n.CategoryName).map(n=>jsxRuntime.jsx(CategoryStats,{appID:e.appID,manufID:e.manufID,categoryCode:n.CategoryCode,categoryName:n.CategoryName},`${e.manufID}-${n.CategoryCode}`))}const badgeVariants=cva("inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground border border-input hover:bg-accent hover:text-accent-foreground",success:"bg-green-600 text-white hover:bg-green-700",warning:"bg-yellow-500 text-white hover:bg-yellow-600",info:"bg-blue-500 text-white hover:bg-blue-600",ghost:"bg-background hover:bg-accent hover:text-accent-foreground",randmarRed:"bg-randmar-red text-white hover:bg-randmar-red/80",randmarBlue:"bg-randmar-blue text-white hover:bg-randmar-blue/80",randmarPurple:"bg-randmar-purple text-white hover:bg-randmar-purple/80",randmarGreen:"bg-randmar-green text-black hover:bg-randmar-green/80",randmarBlack:"bg-randmar-black text-white hover:bg-randmar-black/80",randmarYellow:"bg-randmar-yellow text-black hover:bg-randmar-yellow/80"},size:{default:"h-6",sm:"h-5 text-[10px]",lg:"h-7 px-3"}},defaultVariants:{variant:"default",size:"default"}}),Badge=React__namespace.forwardRef(({className:e,variant:t,size:n,icon:o,children:l,...d},f)=>jsxRuntime.jsxs("div",{ref:f,className:cn(badgeVariants({variant:t,size:n}),e),...d,children:[o&&jsxRuntime.jsx("span",{className:"mr-1",children:o}),l]}));Badge.displayName="Badge";function ManufacturerCategorySummary({name:e="N/A",niche:t="N/A",productsNumber:n=0,autoreorder:o=!1,starred:l=!1,isLoading:d=!1,children:f}){return d?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{className:"pb-4",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between",children:[jsxRuntime.jsx("div",{className:"space-y-1 flex-1",children:jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-3 w-28 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsx("div",{className:"h-5 w-48 bg-muted rounded-md animate-pulse"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxRuntime.jsx("div",{className:"h-3 w-12 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsx("div",{className:"h-5 w-5 bg-muted rounded-md animate-pulse"})]})]})}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("div",{className:"h-3 w-8 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsx("div",{className:"h-4 w-32 bg-muted rounded-md animate-pulse"})]}),jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-1 flex-1",children:[jsxRuntime.jsx("div",{className:"h-3 w-16 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-4 w-4 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsx("div",{className:"h-4 w-6 bg-muted rounded-md animate-pulse"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-1 flex-1 flex flex-col items-end",children:[jsxRuntime.jsx("div",{className:"h-3 w-20 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("div",{className:"h-4 w-4 bg-muted rounded-md animate-pulse"}),jsxRuntime.jsx("div",{className:"h-6 w-16 bg-muted rounded-md animate-pulse"})]})]})]})]})]}):jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"grid grid-cols-[1fr_auto] items-start gap-4 pt-6",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Category Name"}),jsxRuntime.jsx("h3",{className:"text-lg font-semibold leading-none tracking-tight",children:e})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Niche"}),jsxRuntime.jsx("p",{className:"text-sm font-medium",children:t})]}),jsxRuntime.jsxs("div",{className:"space-y-1",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Products"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Package,{className:"h-4 w-4 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:n})]})]})]}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end justify-between gap-4 h-full",children:[f,jsxRuntime.jsxs("div",{className:"flex flex-col items-end gap-1",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Starred"}),l?jsxRuntime.jsx(Star,{className:"h-5 w-5 fill-yellow-400 text-yellow-400"}):jsxRuntime.jsx(Star,{className:"h-5 w-5 text-muted-foreground"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 flex flex-col items-end",children:[jsxRuntime.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:"Auto-reorder"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[o?jsxRuntime.jsx(RefreshCw,{className:"size-4 text-green-600"}):jsxRuntime.jsx(RefreshCwOff,{className:"size-4 text-amber-600"}),jsxRuntime.jsx(Badge,{variant:o?"default":"secondary",className:cn("text-xs",o?"text-green-600 bg-green-100 hover:bg-green-200":"text-amber-600 bg-amber-100 hover:bg-amber-200"),children:o?"Enabled":"Disabled"})]})]})]})]})})}function createSlot$1(e){const t=createSlotClone$1(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$1);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$1(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$1(l),g=mergeProps$1(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$2=Symbol("radix.slottable");function isSlottable$1(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$2}function mergeProps$1(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$1(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var OPEN_KEYS=[" ","Enter","ArrowUp","ArrowDown"],SELECTION_KEYS=[" ","Enter"],SELECT_NAME="Select",[Collection$1,useCollection$1,createCollectionScope$1]=createCollection(SELECT_NAME),[createSelectContext]=createContextScope$2(SELECT_NAME,[createCollectionScope$1,createPopperScope]),usePopperScope$1=createPopperScope(),[SelectProvider,useSelectContext]=createSelectContext(SELECT_NAME),[SelectNativeOptionsProvider,useSelectNativeOptionsContext]=createSelectContext(SELECT_NAME),Select$2=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:l,onOpenChange:d,value:f,defaultValue:g,onValueChange:b,dir:_,name:S,autoComplete:R,disabled:C,required:E,form:A}=e,M=usePopperScope$1(t),[I,j]=React__namespace.useState(null),[q,Q]=React__namespace.useState(null),[te,F]=React__namespace.useState(!1),V=useDirection(_),[ne,ae]=useControllableState({prop:o,defaultProp:l??!1,onChange:d,caller:SELECT_NAME}),[se,Oe]=useControllableState({prop:f,defaultProp:g,onChange:b,caller:SELECT_NAME}),Ne=React__namespace.useRef(null),oe=I?A||!!I.closest("form"):!0,[$e,Ae]=React__namespace.useState(new Set),je=Array.from($e).map(Be=>Be.props.value).join(";");return jsxRuntime.jsx(Root2$7,{...M,children:jsxRuntime.jsxs(SelectProvider,{required:E,scope:t,trigger:I,onTriggerChange:j,valueNode:q,onValueNodeChange:Q,valueNodeHasChildren:te,onValueNodeHasChildrenChange:F,contentId:useId(),value:se,onValueChange:Oe,open:ne,onOpenChange:ae,dir:V,triggerPointerDownPosRef:Ne,disabled:C,children:[jsxRuntime.jsx(Collection$1.Provider,{scope:t,children:jsxRuntime.jsx(SelectNativeOptionsProvider,{scope:e.__scopeSelect,onNativeOptionAdd:React__namespace.useCallback(Be=>{Ae(qe=>new Set(qe).add(Be))},[]),onNativeOptionRemove:React__namespace.useCallback(Be=>{Ae(qe=>{const Ve=new Set(qe);return Ve.delete(Be),Ve})},[]),children:n})}),oe?jsxRuntime.jsxs(SelectBubbleInput,{"aria-hidden":!0,required:E,tabIndex:-1,name:S,autoComplete:R,value:se,onChange:Be=>Oe(Be.target.value),disabled:C,form:A,children:[se===void 0?jsxRuntime.jsx("option",{value:""}):null,Array.from($e)]},je):null]})})};Select$2.displayName=SELECT_NAME;var TRIGGER_NAME$5="SelectTrigger",SelectTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...l}=e,d=usePopperScope$1(n),f=useSelectContext(TRIGGER_NAME$5,n),g=f.disabled||o,b=useComposedRefs(t,f.onTriggerChange),_=useCollection$1(n),S=React__namespace.useRef("touch"),[R,C,E]=useTypeaheadSearch(M=>{const I=_().filter(Q=>!Q.disabled),j=I.find(Q=>Q.value===f.value),q=findNextItem(I,M,j);q!==void 0&&f.onValueChange(q.value)}),A=M=>{g||(f.onOpenChange(!0),E()),M&&(f.triggerPointerDownPosRef.current={x:Math.round(M.pageX),y:Math.round(M.pageY)})};return jsxRuntime.jsx(Anchor,{asChild:!0,...d,children:jsxRuntime.jsx(Primitive$4.button,{type:"button",role:"combobox","aria-controls":f.contentId,"aria-expanded":f.open,"aria-required":f.required,"aria-autocomplete":"none",dir:f.dir,"data-state":f.open?"open":"closed",disabled:g,"data-disabled":g?"":void 0,"data-placeholder":shouldShowPlaceholder(f.value)?"":void 0,...l,ref:b,onClick:composeEventHandlers(l.onClick,M=>{M.currentTarget.focus(),S.current!=="mouse"&&A(M)}),onPointerDown:composeEventHandlers(l.onPointerDown,M=>{S.current=M.pointerType;const I=M.target;I.hasPointerCapture(M.pointerId)&&I.releasePointerCapture(M.pointerId),M.button===0&&M.ctrlKey===!1&&M.pointerType==="mouse"&&(A(M),M.preventDefault())}),onKeyDown:composeEventHandlers(l.onKeyDown,M=>{const I=R.current!=="";!(M.ctrlKey||M.altKey||M.metaKey)&&M.key.length===1&&C(M.key),!(I&&M.key===" ")&&OPEN_KEYS.includes(M.key)&&(A(),M.preventDefault())})})})});SelectTrigger$1.displayName=TRIGGER_NAME$5;var VALUE_NAME="SelectValue",SelectValue$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,children:d,placeholder:f="",...g}=e,b=useSelectContext(VALUE_NAME,n),{onValueNodeHasChildrenChange:_}=b,S=d!==void 0,R=useComposedRefs(t,b.onValueNodeChange);return useLayoutEffect2(()=>{_(S)},[_,S]),jsxRuntime.jsx(Primitive$4.span,{...g,ref:R,style:{pointerEvents:"none"},children:shouldShowPlaceholder(b.value)?jsxRuntime.jsx(jsxRuntime.Fragment,{children:f}):d})});SelectValue$1.displayName=VALUE_NAME;var ICON_NAME="SelectIcon",SelectIcon=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...l}=e;return jsxRuntime.jsx(Primitive$4.span,{"aria-hidden":!0,...l,ref:t,children:o||"▼"})});SelectIcon.displayName=ICON_NAME;var PORTAL_NAME$2="SelectPortal",SelectPortal=e=>jsxRuntime.jsx(Portal$5,{asChild:!0,...e});SelectPortal.displayName=PORTAL_NAME$2;var CONTENT_NAME$4="SelectContent",SelectContent$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContext(CONTENT_NAME$4,e.__scopeSelect),[o,l]=React__namespace.useState();if(useLayoutEffect2(()=>{l(new DocumentFragment)},[]),!n.open){const d=o;return d?ReactDOM__namespace.createPortal(jsxRuntime.jsx(SelectContentProvider,{scope:e.__scopeSelect,children:jsxRuntime.jsx(Collection$1.Slot,{scope:e.__scopeSelect,children:jsxRuntime.jsx("div",{children:e.children})})}),d):null}return jsxRuntime.jsx(SelectContentImpl,{...e,ref:t})});SelectContent$1.displayName=CONTENT_NAME$4;var CONTENT_MARGIN=10,[SelectContentProvider,useSelectContentContext]=createSelectContext(CONTENT_NAME$4),CONTENT_IMPL_NAME="SelectContentImpl",Slot$1=createSlot$1("SelectContent.RemoveScroll"),SelectContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:l,onEscapeKeyDown:d,onPointerDownOutside:f,side:g,sideOffset:b,align:_,alignOffset:S,arrowPadding:R,collisionBoundary:C,collisionPadding:E,sticky:A,hideWhenDetached:M,avoidCollisions:I,...j}=e,q=useSelectContext(CONTENT_NAME$4,n),[Q,te]=React__namespace.useState(null),[F,V]=React__namespace.useState(null),ne=useComposedRefs(t,et=>te(et)),[ae,se]=React__namespace.useState(null),[Oe,Ne]=React__namespace.useState(null),oe=useCollection$1(n),[$e,Ae]=React__namespace.useState(!1),je=React__namespace.useRef(!1);React__namespace.useEffect(()=>{if(Q)return hideOthers(Q)},[Q]),useFocusGuards();const Be=React__namespace.useCallback(et=>{const[at,...tt]=oe().map(Ge=>Ge.ref.current),[ot]=tt.slice(-1),lt=document.activeElement;for(const Ge of et)if(Ge===lt||(Ge==null||Ge.scrollIntoView({block:"nearest"}),Ge===at&&F&&(F.scrollTop=0),Ge===ot&&F&&(F.scrollTop=F.scrollHeight),Ge==null||Ge.focus(),document.activeElement!==lt))return},[oe,F]),qe=React__namespace.useCallback(()=>Be([ae,Q]),[Be,ae,Q]);React__namespace.useEffect(()=>{$e&&qe()},[$e,qe]);const{onOpenChange:Ve,triggerPointerDownPosRef:Le}=q;React__namespace.useEffect(()=>{if(Q){let et={x:0,y:0};const at=ot=>{var lt,Ge;et={x:Math.abs(Math.round(ot.pageX)-(((lt=Le.current)==null?void 0:lt.x)??0)),y:Math.abs(Math.round(ot.pageY)-(((Ge=Le.current)==null?void 0:Ge.y)??0))}},tt=ot=>{et.x<=10&&et.y<=10?ot.preventDefault():Q.contains(ot.target)||Ve(!1),document.removeEventListener("pointermove",at),Le.current=null};return Le.current!==null&&(document.addEventListener("pointermove",at),document.addEventListener("pointerup",tt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",at),document.removeEventListener("pointerup",tt,{capture:!0})}}},[Q,Ve,Le]),React__namespace.useEffect(()=>{const et=()=>Ve(!1);return window.addEventListener("blur",et),window.addEventListener("resize",et),()=>{window.removeEventListener("blur",et),window.removeEventListener("resize",et)}},[Ve]);const[He,We]=useTypeaheadSearch(et=>{const at=oe().filter(lt=>!lt.disabled),tt=at.find(lt=>lt.ref.current===document.activeElement),ot=findNextItem(at,et,tt);ot&&setTimeout(()=>ot.ref.current.focus())}),ze=React__namespace.useCallback((et,at,tt)=>{const ot=!je.current&&!tt;(q.value!==void 0&&q.value===at||ot)&&(se(et),ot&&(je.current=!0))},[q.value]),Xe=React__namespace.useCallback(()=>Q==null?void 0:Q.focus(),[Q]),nt=React__namespace.useCallback((et,at,tt)=>{const ot=!je.current&&!tt;(q.value!==void 0&&q.value===at||ot)&&Ne(et)},[q.value]),Je=o==="popper"?SelectPopperPosition:SelectItemAlignedPosition,st=Je===SelectPopperPosition?{side:g,sideOffset:b,align:_,alignOffset:S,arrowPadding:R,collisionBoundary:C,collisionPadding:E,sticky:A,hideWhenDetached:M,avoidCollisions:I}:{};return jsxRuntime.jsx(SelectContentProvider,{scope:n,content:Q,viewport:F,onViewportChange:V,itemRefCallback:ze,selectedItem:ae,onItemLeave:Xe,itemTextRefCallback:nt,focusSelectedItem:qe,selectedItemText:Oe,position:o,isPositioned:$e,searchRef:He,children:jsxRuntime.jsx(ReactRemoveScroll,{as:Slot$1,allowPinchZoom:!0,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:q.open,onMountAutoFocus:et=>{et.preventDefault()},onUnmountAutoFocus:composeEventHandlers(l,et=>{var at;(at=q.trigger)==null||at.focus({preventScroll:!0}),et.preventDefault()}),children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:et=>et.preventDefault(),onDismiss:()=>q.onOpenChange(!1),children:jsxRuntime.jsx(Je,{role:"listbox",id:q.contentId,"data-state":q.open?"open":"closed",dir:q.dir,onContextMenu:et=>et.preventDefault(),...j,...st,onPlaced:()=>Ae(!0),ref:ne,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:composeEventHandlers(j.onKeyDown,et=>{const at=et.ctrlKey||et.altKey||et.metaKey;if(et.key==="Tab"&&et.preventDefault(),!at&&et.key.length===1&&We(et.key),["ArrowUp","ArrowDown","Home","End"].includes(et.key)){let ot=oe().filter(lt=>!lt.disabled).map(lt=>lt.ref.current);if(["ArrowUp","End"].includes(et.key)&&(ot=ot.slice().reverse()),["ArrowUp","ArrowDown"].includes(et.key)){const lt=et.target,Ge=ot.indexOf(lt);ot=ot.slice(Ge+1)}setTimeout(()=>Be(ot)),et.preventDefault()}})})})})})})});SelectContentImpl.displayName=CONTENT_IMPL_NAME;var ITEM_ALIGNED_POSITION_NAME="SelectItemAlignedPosition",SelectItemAlignedPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...l}=e,d=useSelectContext(CONTENT_NAME$4,n),f=useSelectContentContext(CONTENT_NAME$4,n),[g,b]=React__namespace.useState(null),[_,S]=React__namespace.useState(null),R=useComposedRefs(t,ne=>S(ne)),C=useCollection$1(n),E=React__namespace.useRef(!1),A=React__namespace.useRef(!0),{viewport:M,selectedItem:I,selectedItemText:j,focusSelectedItem:q}=f,Q=React__namespace.useCallback(()=>{if(d.trigger&&d.valueNode&&g&&_&&M&&I&&j){const ne=d.trigger.getBoundingClientRect(),ae=_.getBoundingClientRect(),se=d.valueNode.getBoundingClientRect(),Oe=j.getBoundingClientRect();if(d.dir!=="rtl"){const lt=Oe.left-ae.left,Ge=se.left-lt,$t=ne.left-Ge,rt=ne.width+$t,Rt=Math.max(rt,ae.width),dt=window.innerWidth-CONTENT_MARGIN,It=clamp(Ge,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,dt-Rt)]);g.style.minWidth=rt+"px",g.style.left=It+"px"}else{const lt=ae.right-Oe.right,Ge=window.innerWidth-se.right-lt,$t=window.innerWidth-ne.right-Ge,rt=ne.width+$t,Rt=Math.max(rt,ae.width),dt=window.innerWidth-CONTENT_MARGIN,It=clamp(Ge,[CONTENT_MARGIN,Math.max(CONTENT_MARGIN,dt-Rt)]);g.style.minWidth=rt+"px",g.style.right=It+"px"}const Ne=C(),oe=window.innerHeight-CONTENT_MARGIN*2,$e=M.scrollHeight,Ae=window.getComputedStyle(_),je=parseInt(Ae.borderTopWidth,10),Be=parseInt(Ae.paddingTop,10),qe=parseInt(Ae.borderBottomWidth,10),Ve=parseInt(Ae.paddingBottom,10),Le=je+Be+$e+Ve+qe,He=Math.min(I.offsetHeight*5,Le),We=window.getComputedStyle(M),ze=parseInt(We.paddingTop,10),Xe=parseInt(We.paddingBottom,10),nt=ne.top+ne.height/2-CONTENT_MARGIN,Je=oe-nt,st=I.offsetHeight/2,et=I.offsetTop+st,at=je+Be+et,tt=Le-at;if(at<=nt){const lt=Ne.length>0&&I===Ne[Ne.length-1].ref.current;g.style.bottom="0px";const Ge=_.clientHeight-M.offsetTop-M.offsetHeight,$t=Math.max(Je,st+(lt?Xe:0)+Ge+qe),rt=at+$t;g.style.height=rt+"px"}else{const lt=Ne.length>0&&I===Ne[0].ref.current;g.style.top="0px";const $t=Math.max(nt,je+M.offsetTop+(lt?ze:0)+st)+tt;g.style.height=$t+"px",M.scrollTop=at-nt+M.offsetTop}g.style.margin=`${CONTENT_MARGIN}px 0`,g.style.minHeight=He+"px",g.style.maxHeight=oe+"px",o==null||o(),requestAnimationFrame(()=>E.current=!0)}},[C,d.trigger,d.valueNode,g,_,M,I,j,d.dir,o]);useLayoutEffect2(()=>Q(),[Q]);const[te,F]=React__namespace.useState();useLayoutEffect2(()=>{_&&F(window.getComputedStyle(_).zIndex)},[_]);const V=React__namespace.useCallback(ne=>{ne&&A.current===!0&&(Q(),q==null||q(),A.current=!1)},[Q,q]);return jsxRuntime.jsx(SelectViewportProvider,{scope:n,contentWrapper:g,shouldExpandOnScrollRef:E,onScrollButtonChange:V,children:jsxRuntime.jsx("div",{ref:b,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:te},children:jsxRuntime.jsx(Primitive$4.div,{...l,ref:R,style:{boxSizing:"border-box",maxHeight:"100%",...l.style}})})})});SelectItemAlignedPosition.displayName=ITEM_ALIGNED_POSITION_NAME;var POPPER_POSITION_NAME="SelectPopperPosition",SelectPopperPosition=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:l=CONTENT_MARGIN,...d}=e,f=usePopperScope$1(n);return jsxRuntime.jsx(Content$2,{...f,...d,ref:t,align:o,collisionPadding:l,style:{boxSizing:"border-box",...d.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});SelectPopperPosition.displayName=POPPER_POSITION_NAME;var[SelectViewportProvider,useSelectViewportContext]=createSelectContext(CONTENT_NAME$4,{}),VIEWPORT_NAME="SelectViewport",SelectViewport=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...l}=e,d=useSelectContentContext(VIEWPORT_NAME,n),f=useSelectViewportContext(VIEWPORT_NAME,n),g=useComposedRefs(t,d.onViewportChange),b=React__namespace.useRef(0);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),jsxRuntime.jsx(Collection$1.Slot,{scope:n,children:jsxRuntime.jsx(Primitive$4.div,{"data-radix-select-viewport":"",role:"presentation",...l,ref:g,style:{position:"relative",flex:1,overflow:"hidden auto",...l.style},onScroll:composeEventHandlers(l.onScroll,_=>{const S=_.currentTarget,{contentWrapper:R,shouldExpandOnScrollRef:C}=f;if(C!=null&&C.current&&R){const E=Math.abs(b.current-S.scrollTop);if(E>0){const A=window.innerHeight-CONTENT_MARGIN*2,M=parseFloat(R.style.minHeight),I=parseFloat(R.style.height),j=Math.max(M,I);if(j<A){const q=j+E,Q=Math.min(A,q),te=q-Q;R.style.height=Q+"px",R.style.bottom==="0px"&&(S.scrollTop=te>0?te:0,R.style.justifyContent="flex-end")}}}b.current=S.scrollTop})})})]})});SelectViewport.displayName=VIEWPORT_NAME;var GROUP_NAME="SelectGroup",[SelectGroupContextProvider,useSelectGroupContext]=createSelectContext(GROUP_NAME),SelectGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useId();return jsxRuntime.jsx(SelectGroupContextProvider,{scope:n,id:l,children:jsxRuntime.jsx(Primitive$4.div,{role:"group","aria-labelledby":l,...o,ref:t})})});SelectGroup$1.displayName=GROUP_NAME;var LABEL_NAME="SelectLabel",SelectLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=useSelectGroupContext(LABEL_NAME,n);return jsxRuntime.jsx(Primitive$4.div,{id:l.id,...o,ref:t})});SelectLabel$1.displayName=LABEL_NAME;var ITEM_NAME$1="SelectItem",[SelectItemContextProvider,useSelectItemContext]=createSelectContext(ITEM_NAME$1),SelectItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:l=!1,textValue:d,...f}=e,g=useSelectContext(ITEM_NAME$1,n),b=useSelectContentContext(ITEM_NAME$1,n),_=g.value===o,[S,R]=React__namespace.useState(d??""),[C,E]=React__namespace.useState(!1),A=useComposedRefs(t,q=>{var Q;return(Q=b.itemRefCallback)==null?void 0:Q.call(b,q,o,l)}),M=useId(),I=React__namespace.useRef("touch"),j=()=>{l||(g.onValueChange(o),g.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return jsxRuntime.jsx(SelectItemContextProvider,{scope:n,value:o,disabled:l,textId:M,isSelected:_,onItemTextChange:React__namespace.useCallback(q=>{R(Q=>Q||((q==null?void 0:q.textContent)??"").trim())},[]),children:jsxRuntime.jsx(Collection$1.ItemSlot,{scope:n,value:o,disabled:l,textValue:S,children:jsxRuntime.jsx(Primitive$4.div,{role:"option","aria-labelledby":M,"data-highlighted":C?"":void 0,"aria-selected":_&&C,"data-state":_?"checked":"unchecked","aria-disabled":l||void 0,"data-disabled":l?"":void 0,tabIndex:l?void 0:-1,...f,ref:A,onFocus:composeEventHandlers(f.onFocus,()=>E(!0)),onBlur:composeEventHandlers(f.onBlur,()=>E(!1)),onClick:composeEventHandlers(f.onClick,()=>{I.current!=="mouse"&&j()}),onPointerUp:composeEventHandlers(f.onPointerUp,()=>{I.current==="mouse"&&j()}),onPointerDown:composeEventHandlers(f.onPointerDown,q=>{I.current=q.pointerType}),onPointerMove:composeEventHandlers(f.onPointerMove,q=>{var Q;I.current=q.pointerType,l?(Q=b.onItemLeave)==null||Q.call(b):I.current==="mouse"&&q.currentTarget.focus({preventScroll:!0})}),onPointerLeave:composeEventHandlers(f.onPointerLeave,q=>{var Q;q.currentTarget===document.activeElement&&((Q=b.onItemLeave)==null||Q.call(b))}),onKeyDown:composeEventHandlers(f.onKeyDown,q=>{var te;((te=b.searchRef)==null?void 0:te.current)!==""&&q.key===" "||(SELECTION_KEYS.includes(q.key)&&j(),q.key===" "&&q.preventDefault())})})})})});SelectItem$1.displayName=ITEM_NAME$1;var ITEM_TEXT_NAME="SelectItemText",SelectItemText=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:l,...d}=e,f=useSelectContext(ITEM_TEXT_NAME,n),g=useSelectContentContext(ITEM_TEXT_NAME,n),b=useSelectItemContext(ITEM_TEXT_NAME,n),_=useSelectNativeOptionsContext(ITEM_TEXT_NAME,n),[S,R]=React__namespace.useState(null),C=useComposedRefs(t,j=>R(j),b.onItemTextChange,j=>{var q;return(q=g.itemTextRefCallback)==null?void 0:q.call(g,j,b.value,b.disabled)}),E=S==null?void 0:S.textContent,A=React__namespace.useMemo(()=>jsxRuntime.jsx("option",{value:b.value,disabled:b.disabled,children:E},b.value),[b.disabled,b.value,E]),{onNativeOptionAdd:M,onNativeOptionRemove:I}=_;return useLayoutEffect2(()=>(M(A),()=>I(A)),[M,I,A]),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Primitive$4.span,{id:b.textId,...d,ref:C}),b.isSelected&&f.valueNode&&!f.valueNodeHasChildren?ReactDOM__namespace.createPortal(d.children,f.valueNode):null]})});SelectItemText.displayName=ITEM_TEXT_NAME;var ITEM_INDICATOR_NAME="SelectItemIndicator",SelectItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return useSelectItemContext(ITEM_INDICATOR_NAME,n).isSelected?jsxRuntime.jsx(Primitive$4.span,{"aria-hidden":!0,...o,ref:t}):null});SelectItemIndicator.displayName=ITEM_INDICATOR_NAME;var SCROLL_UP_BUTTON_NAME="SelectScrollUpButton",SelectScrollUpButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_UP_BUTTON_NAME,e.__scopeSelect),[l,d]=React__namespace.useState(!1),f=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let g=function(){const _=b.scrollTop>0;d(_)};const b=n.viewport;return g(),b.addEventListener("scroll",g),()=>b.removeEventListener("scroll",g)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:f,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=n;g&&b&&(g.scrollTop=g.scrollTop-b.offsetHeight)}}):null});SelectScrollUpButton$1.displayName=SCROLL_UP_BUTTON_NAME;var SCROLL_DOWN_BUTTON_NAME="SelectScrollDownButton",SelectScrollDownButton$1=React__namespace.forwardRef((e,t)=>{const n=useSelectContentContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),o=useSelectViewportContext(SCROLL_DOWN_BUTTON_NAME,e.__scopeSelect),[l,d]=React__namespace.useState(!1),f=useComposedRefs(t,o.onScrollButtonChange);return useLayoutEffect2(()=>{if(n.viewport&&n.isPositioned){let g=function(){const _=b.scrollHeight-b.clientHeight,S=Math.ceil(b.scrollTop)<_;d(S)};const b=n.viewport;return g(),b.addEventListener("scroll",g),()=>b.removeEventListener("scroll",g)}},[n.viewport,n.isPositioned]),l?jsxRuntime.jsx(SelectScrollButtonImpl,{...e,ref:f,onAutoScroll:()=>{const{viewport:g,selectedItem:b}=n;g&&b&&(g.scrollTop=g.scrollTop+b.offsetHeight)}}):null});SelectScrollDownButton$1.displayName=SCROLL_DOWN_BUTTON_NAME;var SelectScrollButtonImpl=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...l}=e,d=useSelectContentContext("SelectScrollButton",n),f=React__namespace.useRef(null),g=useCollection$1(n),b=React__namespace.useCallback(()=>{f.current!==null&&(window.clearInterval(f.current),f.current=null)},[]);return React__namespace.useEffect(()=>()=>b(),[b]),useLayoutEffect2(()=>{var S;const _=g().find(R=>R.ref.current===document.activeElement);(S=_==null?void 0:_.ref.current)==null||S.scrollIntoView({block:"nearest"})},[g]),jsxRuntime.jsx(Primitive$4.div,{"aria-hidden":!0,...l,ref:t,style:{flexShrink:0,...l.style},onPointerDown:composeEventHandlers(l.onPointerDown,()=>{f.current===null&&(f.current=window.setInterval(o,50))}),onPointerMove:composeEventHandlers(l.onPointerMove,()=>{var _;(_=d.onItemLeave)==null||_.call(d),f.current===null&&(f.current=window.setInterval(o,50))}),onPointerLeave:composeEventHandlers(l.onPointerLeave,()=>{b()})})}),SEPARATOR_NAME="SelectSeparator",SelectSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{"aria-hidden":!0,...o,ref:t})});SelectSeparator$1.displayName=SEPARATOR_NAME;var ARROW_NAME$1="SelectArrow",SelectArrow=React__namespace.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,l=usePopperScope$1(n),d=useSelectContext(ARROW_NAME$1,n),f=useSelectContentContext(ARROW_NAME$1,n);return d.open&&f.position==="popper"?jsxRuntime.jsx(Arrow,{...l,...o,ref:t}):null});SelectArrow.displayName=ARROW_NAME$1;var BUBBLE_INPUT_NAME$1="SelectBubbleInput",SelectBubbleInput=React__namespace.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const l=React__namespace.useRef(null),d=useComposedRefs(o,l),f=usePrevious(t);return React__namespace.useEffect(()=>{const g=l.current;if(!g)return;const b=window.HTMLSelectElement.prototype,S=Object.getOwnPropertyDescriptor(b,"value").set;if(f!==t&&S){const R=new Event("change",{bubbles:!0});S.call(g,t),g.dispatchEvent(R)}},[f,t]),jsxRuntime.jsx(Primitive$4.select,{...n,style:{...VISUALLY_HIDDEN_STYLES,...n.style},ref:d,defaultValue:t})});SelectBubbleInput.displayName=BUBBLE_INPUT_NAME$1;function shouldShowPlaceholder(e){return e===""||e===void 0}function useTypeaheadSearch(e){const t=useCallbackRef$1(e),n=React__namespace.useRef(""),o=React__namespace.useRef(0),l=React__namespace.useCallback(f=>{const g=n.current+f;t(g),(function b(_){n.current=_,window.clearTimeout(o.current),_!==""&&(o.current=window.setTimeout(()=>b(""),1e3))})(g)},[t]),d=React__namespace.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return React__namespace.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,l,d]}function findNextItem(e,t,n){const l=t.length>1&&Array.from(t).every(_=>_===t[0])?t[0]:t,d=n?e.indexOf(n):-1;let f=wrapArray(e,Math.max(d,0));l.length===1&&(f=f.filter(_=>_!==n));const b=f.find(_=>_.textValue.toLowerCase().startsWith(l.toLowerCase()));return b!==n?b:void 0}function wrapArray(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var Root2$3=Select$2,Trigger$2=SelectTrigger$1,Value=SelectValue$1,Icon=SelectIcon,Portal$1=SelectPortal,Content2$3=SelectContent$1,Viewport=SelectViewport,Group=SelectGroup$1,Label=SelectLabel$1,Item$2=SelectItem$1,ItemText=SelectItemText,ItemIndicator=SelectItemIndicator,ScrollUpButton=SelectScrollUpButton$1,ScrollDownButton=SelectScrollDownButton$1,Separator=SelectSeparator$1;const Select$1=Root2$3,SelectGroup=Group,SelectValue=Value,SelectTrigger=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Trigger$2,{ref:o,className:cn("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,jsxRuntime.jsx(Icon,{asChild:!0,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4 opacity-50"})})]}));SelectTrigger.displayName=Trigger$2.displayName;const SelectScrollUpButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollUpButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronUp,{className:"h-4 w-4"})}));SelectScrollUpButton.displayName=ScrollUpButton.displayName;const SelectScrollDownButton=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(ScrollDownButton,{ref:n,className:cn("flex cursor-default items-center justify-center py-1",e),...t,children:jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4"})}));SelectScrollDownButton.displayName=ScrollDownButton.displayName;const SelectContent=React__namespace.forwardRef(({className:e,children:t,position:n="popper",...o},l)=>jsxRuntime.jsx(Portal$1,{children:jsxRuntime.jsxs(Content2$3,{ref:l,className:cn("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[jsxRuntime.jsx(SelectScrollUpButton,{}),jsxRuntime.jsx(Viewport,{className:cn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),jsxRuntime.jsx(SelectScrollDownButton,{})]})}));SelectContent.displayName=Content2$3.displayName;const SelectLabel=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Label,{ref:n,className:cn("px-2 py-1.5 text-sm font-semibold",e),...t}));SelectLabel.displayName=Label.displayName;const SelectItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(Item$2,{ref:o,className:cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[jsxRuntime.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),jsxRuntime.jsx(ItemText,{children:t})]}));SelectItem.displayName=Item$2.displayName;const SelectSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));SelectSeparator.displayName=Separator.displayName;function ManufacturerProducts({applicationId:e,manufacturer:t,shopifyHostName:n}){var Q,te,F,V,ne;const[o]=usePostV4ResellerByRouteResellerIdManufacturerAndManufacturerIdCategoryCodeShopifyMutation(),[l,d]=React.useState(((te=(Q=t.Categories)==null?void 0:Q[0])==null?void 0:te.CategoryCode)||""),[f,g]=React.useState(!1),[b,_]=React.useState(!1),[S,R]=React.useState("percentile"),{toast:C}=useToast(),{data:E,isLoading:A,isFetching:M}=useGetV4ResellerByRouteResellerIdManufacturerAndManufacturerIdCategoryCodeQuery({routeResellerId:e,manufacturerId:t.ManufacturerId,categoryCode:l??""},{skip:!t.ManufacturerId||!l}),I=async()=>{try{g(!0),_(!1),await o({routeResellerId:e,manufacturerId:t.ManufacturerId??"",categoryCode:l,shopifyHostName:n}).unwrap()&&C({title:"Success",description:"Category synced to Shopify successfully",variant:"success"})}catch(ae){console.error("Error syncing to Shopify:",ae),C({title:"Error",description:"Error syncing category to Shopify.",variant:"destructive"})}finally{g(!1)}},j=()=>{var ae,se;return((se=(ae=t.Categories)==null?void 0:ae.find(Oe=>Oe.CategoryCode===l))==null?void 0:se.CategoryName)||l},q=React.useMemo(()=>E!=null&&E.Products?[...E.Products].sort((ae,se)=>S==="price-asc"?(ae.MAP??0)-(se.MAP??0):S==="price-desc"?(se.MAP??0)-(ae.MAP??0):S==="name"?(ae.Title??"").localeCompare(se.Title??""):S==="percentile"?(se.OverallPercentileRank??0)-(ae.OverallPercentileRank??0):0):[],[E==null?void 0:E.Products,S]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx(ManufacturerCategories,{categories:t.Categories||[],activeCategory:l,onSelectCategory:d}),jsxRuntime.jsx("div",{className:"mb-4 w-full",children:jsxRuntime.jsx(ManufacturerCategorySummary,{name:j(),niche:(E==null?void 0:E.Niche)||"",productsNumber:((F=E==null?void 0:E.Products)==null?void 0:F.length)||0,autoreorder:(E==null?void 0:E.AutoReorder)||!1,starred:(E==null?void 0:E.Starred)||!1,isLoading:A||M,children:n&&((V=t.Categories)==null?void 0:V.findIndex(ae=>ae.AvailableToBuy))!==-1&&jsxRuntime.jsx(Button$1,{className:"bg-green-600 hover:bg-green-700",disabled:f,onClick:()=>_(!0),children:f?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2 h-4 w-4"}),"Sync Category to Shopify"]})})})}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsx(ManufacturerCategoriesStats,{categories:[(ne=t.Categories)==null?void 0:ne.find(ae=>ae.CategoryCode===l)].filter(Boolean),manufID:t.ManufacturerId,appID:e}),jsxRuntime.jsx(ActiveOrdersCard,{orders:(E==null?void 0:E.ActiveOrderDetails)??void 0,loading:A||M})]})]}),jsxRuntime.jsx(ManufacturerCategories,{categories:t.Categories||[],activeCategory:l,onSelectCategory:d}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center mt-7 mb-4",children:[jsxRuntime.jsx("h4",{className:"text-xl md:text-2xl text-foreground font-bold",children:"Products"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 ms-auto",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium text-muted-foreground",children:"Sort by:"}),jsxRuntime.jsxs(Select$1,{value:S,onValueChange:R,children:[jsxRuntime.jsx(SelectTrigger,{className:"w-[220px]",children:jsxRuntime.jsx(SelectValue,{})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"price-asc",children:"MAP: Low to High"}),jsxRuntime.jsx(SelectItem,{value:"price-desc",children:"MAP: High to Low"}),jsxRuntime.jsx(SelectItem,{value:"name",children:"Name"}),jsxRuntime.jsx(SelectItem,{value:"percentile",children:"Best Selling"})]})]})]})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4 mb-4",children:A||M?Array.from({length:4}).map((ae,se)=>jsxRuntime.jsx(ProductCard,{},se)):q.length>0?q.map(ae=>jsxRuntime.jsx(ProductCard,{applicationId:e,product:ae,viewProductLink:`/${e}/Product/${ae.RandmarSKU}`,shopifyHostname:n},ae.RandmarSKU)):jsxRuntime.jsxs(Alert,{variant:"warning",className:"col-span-1 @md:col-span-2",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Warning"}),jsxRuntime.jsx(AlertDescription,{children:"No products found for this manufacturer category."})]})}),jsxRuntime.jsx(Dialog,{open:b,onOpenChange:_,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Confirm Sync to Shopify"}),jsxRuntime.jsxs(DialogDescription,{children:['Are you sure you want to sync the category "',j(),'" to Shopify? This will add all products in this category to your Shopify store.']})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>_(!1),children:"Cancel"}),jsxRuntime.jsx(Button$1,{className:"bg-green-600 hover:bg-green-700",onClick:I,disabled:f,children:f?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):"Confirm Sync"})]})]})})]})}function PartnerRelationshipPage({applicationId:e,partnerId:t,userEmail:n,shopifyHostName:o,isSuperAdmin:l}){var q,Q,te;const{data:d}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e}),{data:f,isLoading:g,isFetching:b}=useGetV4PartnerByRouteApplicationIdPartnerAndPartnerIdQuery({routeApplicationId:e,partnerId:t,withSpecification:!0}),{toast:_}=useToast(),[S]=usePostV4ResellerByRouteResellerIdManufacturerAndManufacturerIdShopifyMutation(),[R,C]=React.useState(!1),[E,A]=React.useState(!1),M=async()=>{try{C(!0),A(!1),await S({routeResellerId:e??"",manufacturerId:t??"",shopifyHostName:o}).unwrap()&&_({title:"Success",description:"Manufacturer synced to Shopify successfully",variant:"success"})}catch(F){console.error("Error syncing to Shopify:",F),_({title:"Error",description:"Error syncing manufacturer to Shopify.",variant:"destructive"})}finally{C(!1)}},I=()=>f!=null&&f.Manufacturer?"products":f!=null&&f.Reseller?"reseller-overview":"",j=usePartnershipAssistantPrompt(d,f);return jsxRuntime.jsxs("div",{className:"@container",children:[jsxRuntime.jsxs("div",{className:"grid gap-4 @2xl:grid-cols-2",children:[jsxRuntime.jsx(PartnerCard,{account:f,loading:g||b,withAbout:!0,withVoice:!1,action:" "}),jsxRuntime.jsxs("div",{className:"grid gap-4",children:[((f==null?void 0:f.Manufacturer)||g||b)&&jsxRuntime.jsx(ManufacturerCard,{manufacturer:f==null?void 0:f.Manufacturer,loading:g||b,mainAction:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[(f==null?void 0:f.Manufacturer)&&jsxRuntime.jsx(ManufacturerGetStartedButton,{applicationId:e,manufacturer:f==null?void 0:f.Manufacturer}),o&&((Q=(q=f==null?void 0:f.Manufacturer)==null?void 0:q.Categories)==null?void 0:Q.findIndex(F=>F.AvailableToBuy))!==-1&&jsxRuntime.jsxs(Dialog,{open:E,onOpenChange:A,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{className:"bg-green-600 hover:bg-green-700 ml-2",disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2 h-4 w-4"}),"Sync Manufacturer to Shopify"]})})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Confirm Sync to Shopify"}),jsxRuntime.jsxs(DialogDescription,{children:['Are you sure you want to sync the manufacturer "',(te=f==null?void 0:f.Manufacturer)==null?void 0:te.PublicName,'" to Shopify? This will add all products from this manufacturer to your Shopify store.']})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>A(!1),children:"Cancel"}),jsxRuntime.jsx(Button$1,{className:"bg-green-600 hover:bg-green-700",onClick:M,disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Syncing..."]}):"Confirm Sync"})]})]})]})]})}),(f==null?void 0:f.Reseller)&&jsxRuntime.jsx(ResellerCard,{reseller:f==null?void 0:f.Reseller,loading:g||b})]})]}),((f==null?void 0:f.Reseller)||(f==null?void 0:f.Manufacturer))&&!g&&!b&&jsxRuntime.jsx("div",{className:"max-w-6xl mx-auto p-4",children:jsxRuntime.jsxs(Tabs,{defaultValue:I(),className:"w-full",children:[jsxRuntime.jsxs(TabsList,{className:"inline-flex h-auto items-center justify-center rounded-none border-b bg-transparent p-0",children:[(f==null?void 0:f.Reseller)&&jsxRuntime.jsx(TabsTrigger,{value:"reseller-overview",className:"reseller-theme relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:"Reseller Overview"}),(f==null?void 0:f.Manufacturer)&&jsxRuntime.jsx(TabsTrigger,{value:"manufacturer-overview",className:"manufacturer-theme relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:"Manufacturer Overview"}),(f==null?void 0:f.Manufacturer)&&jsxRuntime.jsx(TabsTrigger,{value:"products",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:"Products"}),jsxRuntime.jsxs(TabsTrigger,{value:"assistant",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",children:[jsxRuntime.jsx(Bot,{className:"mr-2 w-4 h-4"}),"Assistant"]})]}),(f==null?void 0:f.Reseller)&&jsxRuntime.jsx(TabsContent,{value:"reseller-overview",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ResellerOverview,{readonly:!0,appID:f.ApplicationId||"",reseller:f==null?void 0:f.Reseller,userEmail:n,isSuperAdmin:l,withoutReports:!0})})}),(f==null?void 0:f.Manufacturer)&&jsxRuntime.jsx(TabsContent,{value:"manufacturer-overview",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ManufacturerOverviewPage,{readonly:!0,manufacturer:f==null?void 0:f.Manufacturer,applicationId:e,userEmail:n})})}),(f==null?void 0:f.Manufacturer)&&jsxRuntime.jsx(TabsContent,{value:"products",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ManufacturerProducts,{applicationId:e,manufacturer:f.Manufacturer,shopifyHostName:o})})}),jsxRuntime.jsx(TabsContent,{value:"assistant",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(AssistantInsight,{prompt:j,thinkingPlaceholderText:"Thinking about the relationship..."})})})]})}),(g||b)&&jsxRuntime.jsx("div",{className:"max-w-6xl mx-auto p-4 mt-4 flex justify-center items-center h-32",children:jsxRuntime.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin text-primary"})})]})}const PublicInfo=({reseller:e,appID:t,isLoading:n,readonly:o,onUnsavedChanges:l})=>{const{toast:d}=useToast(),[f]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),[g,b]=React.useState({}),_=React.useMemo(()=>({publicEmail:e.PublicEmail??"",contactName:e.ContactName??"",phone:e.Phone??"",website:e.Website??""}),[e]),{register:S,handleSubmit:R,reset:C,watch:E,formState:{errors:A,isSubmitting:M}}=useForm({defaultValues:_}),I=E(),j=React.useCallback(()=>g?JSON.stringify(I)!==JSON.stringify(g):!1,[I,g]);React.useEffect(()=>{l&&l(j())},[j,l]),React.useEffect(()=>{e&&Object.keys(e).length>0&&(C(_),b(_))},[e,C,_]);const q=async te=>{let F=!0,V=!1;const ne=Object.keys(te).map(ae=>({key:ae,keyApi:ae.charAt(0).toUpperCase()+ae.slice(1)}));for(const ae of ne){const se=te[ae.key],Oe=e[ae.keyApi];if(se!==Oe&&se!==void 0){V=!0;try{await f({applicationId:t,fieldName:ae.keyApi,newValue:String(se)}).unwrap()||(F=!1)}catch(Ne){console.error(`Error updating ${ae.keyApi}:`,Ne),F=!1}}}F&&V?(d({title:"Public info",description:"Information updated successfully",variant:"success"}),b({...te}),l&&l(!1)):F||d({title:"Updation error",description:"Failed to update",variant:"destructive"})},Q=te=>!te||te.trim()==="";return n?jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Public Information"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-20"})})]})})]}):jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsxs(CardTitle,{className:"text-1xl font-bold",children:["Public Information ",o?"(read only)":""]})}),jsxRuntime.jsxs(CardContent,{children:[(Q(E("contactName"))||Q(E("publicEmail"))||Q(E("website"))||Q(E("phone")))&&jsxRuntime.jsxs(Alert,{variant:"destructive",className:"mb-6",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Missing information"}),jsxRuntime.jsx(AlertDescription,{children:"All fields are required to get started at working with Manufacturers."})]}),jsxRuntime.jsxs("form",{onSubmit:R(q),className:"space-y-4",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-4",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"contactName",children:"Main Representative *"}),jsxRuntime.jsx(Input,{id:"contactName",placeholder:"John Doe",readOnly:o,...S("contactName",{}),className:A.contactName||Q(E("contactName"))?"input-error-indicator":""}),A.contactName&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.contactName.message})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"publicEmail",children:"Public Email *"}),jsxRuntime.jsx(Input,{id:"publicEmail",placeholder:"contact@company.com",readOnly:o,...S("publicEmail",{pattern:{value:/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i,message:"Invalid email address"}}),className:A.publicEmail||Q(E("publicEmail"))?"input-error-indicator":""}),A.publicEmail&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.publicEmail.message})]})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"website",children:"Website *"}),jsxRuntime.jsx(Input,{id:"website",placeholder:"https://company.com",readOnly:o,...S("website",{pattern:{value:/^.{7,}$/,message:"Must be at least 7 characters"}}),className:A.website||Q(E("website"))?"input-error-indicator":""}),A.website&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.website.message})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("label",{className:"text-sm font-medium leading-none",htmlFor:"phone",children:"Phone Number *"}),jsxRuntime.jsx(Input,{id:"phone",placeholder:"+1 (555) 123-4567",readOnly:o,...S("phone",{pattern:{value:/^.{7,}$/,message:"Must be at least 7 characters"}}),className:A.phone||Q(E("phone"))?"input-error-indicator":""}),A.phone&&jsxRuntime.jsx("p",{className:"text-red-500 text-sm",children:A.phone.message})]}),jsxRuntime.jsx("div",{className:"flex justify-end",children:jsxRuntime.jsx(Button$1,{type:"submit",disabled:M||o,className:o?"hidden":"",children:M?"Saving...":"Save"})})]})]})]})};function BillingCard({appID:e,reseller:t,isLoading:n,withoutReports:o,userEmail:l,isSuperAdmin:d}){const{toast:f}=useToast(),{Statement:g,CreditLimit:b}=t,[_,S]=React.useState(!1),[R,C]=React.useState(!1),[E,A]=React.useState(!1),[M,I]=React.useState(!1),[j,q]=React.useState(l||""),[Q,te]=React.useState(!1),[F,V]=React.useState((b==null?void 0:b.toString())||""),[ne,{isLoading:ae}]=usePostV4PartnerByApplicationIdAccountResellerCreditLimitMutation(),se=[{label:"0 - 30 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(g==null?void 0:g.Over0)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:Calendar$1},{label:"31 - 45 Days",value:jsxRuntime.jsx(FormattedNumber,{value:(g==null?void 0:g.Over30)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarDays},{label:"45+ Days",value:jsxRuntime.jsx(FormattedNumber,{value:(g==null?void 0:g.Over45)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:CalendarRange},{label:"Total",value:jsxRuntime.jsx(FormattedNumber,{value:(g==null?void 0:g.Total)||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),icon:DollarSign},{label:"Credit Limit",value:jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(FormattedNumber,{value:b||0,style:"currency",currency:"CAD",currencyDisplay:"symbol"}),d&&jsxRuntime.jsx(Button$1,{size:"icon",variant:"outline",className:"ml-2",onClick:()=>{te(!0),V((b==null?void 0:b.toString())||"")},children:jsxRuntime.jsx(SquarePen,{})})]}),icon:CreditCard}],[Oe]=useLazyGetV4ResellerByRouteResellerIdDocumentAndDocumentNumberPdfQuery(),Ne=async je=>{je?S(!0):C(!0);try{const qe=(await Oe({routeResellerId:e,documentNumber:`ST${e}`})).data;if(!qe)throw new Error("No data received for download.");if(je)window.open(qe);else{const Ve=document.createElement("a");Ve.href=qe,Ve.download=`ST${e}.pdf`,document.body.appendChild(Ve),Ve.click(),Ve.remove()}f({title:"Success",description:"Statement downloaded successfully.",variant:"success"})}catch(Be){console.error("Download Error:",Be),f({title:"Error",description:"An error occurred while downloading the statement. Please try again.",variant:"destructive"})}finally{je?S(!1):C(!1)}},[oe]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),$e=async()=>{if(!j||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(j)){f({title:"Invalid Email",description:"Please enter a valid email address.",variant:"destructive"});return}A(!0);try{await oe({routeResellerId:e,emailAddress:j}).unwrap(),f({title:"Success",description:`Statement sent to ${j} successfully.`,variant:"success"}),I(!1)}catch(Be){console.error("Send Email Error:",Be),f({title:"Error",description:"An error occurred while sending the statement. Please try again.",variant:"destructive"})}finally{A(!1)}};if(n)return jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-36"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:[1,2,3].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]},je))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:[1,2].map(je=>jsxRuntime.jsx("div",{className:je===2?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 ms-auto"})]})},je))})]}),jsxRuntime.jsxs("div",{className:"flex justify-end mt-6 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-28"})]})]})]});const Ae=!o;return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"border-b p-6 md:p-5",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Billing Overview"})}),jsxRuntime.jsxs(CardContent,{className:"p-6 md:p-5",children:[jsxRuntime.jsxs("div",{className:"grid sm:grid-cols-2 sm:divide-x divide-border",children:[jsxRuntime.jsx("div",{className:"space-y-6 sm:pe-4",children:se.slice(0,3).map((je,Be)=>jsxRuntime.jsx(BillingItem,{icon:je.icon,label:je.label,value:je.value},Be))}),jsxRuntime.jsx("div",{className:"space-y-6 sm:ps-4 pt-6 sm:pt-0 mt-6 sm:mt-0 border-t sm:border-t-0 border-border",children:se.slice(3).map((je,Be)=>jsxRuntime.jsx("div",{className:Be===1?"pt-6 mt-6 border-t border-border":"",children:jsxRuntime.jsx(BillingItem,{icon:je.icon,label:je.label,value:je.value})},Be))})]}),Ae&&jsxRuntime.jsxs("div",{className:"flex justify-end mt-6 gap-2",children:[jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",size:"icon",onClick:()=>Ne(!0),disabled:_,children:_?jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):jsxRuntime.jsx(Printer,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Print Statement"})})]})}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",size:"icon",onClick:()=>Ne(!1),disabled:R,children:R?jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):jsxRuntime.jsx(Download,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Download Statement"})})]})}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",size:"icon",onClick:()=>I(!0),disabled:E,children:E?jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):jsxRuntime.jsx(Mail,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Email Statement"})})]})}),jsxRuntime.jsx(reactRouterDom.Link,{to:`${window.location.hostname==="dashboard.randmar.io"?"":"https://dashboard.randmar.io"}/${e}/PayInvoice`,target:window.location.hostname==="dashboard.randmar.io"?"_self":"_blank",children:jsxRuntime.jsxs(Button$1,{children:[jsxRuntime.jsx(CreditCard,{className:"mr-2 h-4 w-4"}),"Pay Invoices"]})})]})]})]}),jsxRuntime.jsx(Dialog,{open:M,onOpenChange:I,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Statement by Email"}),jsxRuntime.jsx(DialogDescription,{children:"Enter the recipient's email address below. The statement will be sent as a PDF attachment."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:j,onChange:je=>q(je.target.value),className:"col-span-3",placeholder:"recipient@example.com"})]})}),jsxRuntime.jsx(DialogFooter,{children:jsxRuntime.jsx(Button$1,{type:"submit",onClick:$e,disabled:E||!j,children:E?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"}),"Send"]})})})]})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:te,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Edit Credit Limit"}),jsxRuntime.jsx(DialogDescription,{children:"Enter the new credit limit for this reseller."})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"creditLimit",className:"text-right",children:"Amount"}),jsxRuntime.jsx(Input,{id:"creditLimit",type:"number",value:F,onChange:je=>V(je.target.value),className:"col-span-3",placeholder:"0.00"})]})}),jsxRuntime.jsx(DialogFooter,{children:jsxRuntime.jsx(Button$1,{type:"submit",onClick:async()=>{const je=Number(F);if(isNaN(je)){f({title:"Invalid Amount",description:"Please enter a valid number for credit limit.",variant:"destructive"});return}try{await ne({applicationId:e,newValue:je}).unwrap(),te(!1),f({title:"Success",description:"Credit limit updated successfully.",variant:"success"})}catch(Be){console.error("Update Credit Limit Error:",Be),f({title:"Error",description:"Failed to update credit limit. Please try again.",variant:"destructive"})}},disabled:ae,children:ae?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save"})})]})})]})}function BillingItem({icon:e,label:t,value:n}){return jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap gap-1.5",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(e,{className:"size-4 text-muted-foreground"}),jsxRuntime.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:t})]}),jsxRuntime.jsx("span",{className:"text-base font-semibold ms-auto",children:n})]})}function ChangePricingTierModal({open:e,setOpen:t,tier:n,onTierChange:o,isLoading:l}){const d=()=>{t(!1)};return jsxRuntime.jsx(Dialog,{open:e,onOpenChange:t,children:jsxRuntime.jsxs(DialogContent,{className:"sm:max-w-[425px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Change Pricing Tier"})}),jsxRuntime.jsxs("div",{className:"grid gap-1.5 py-2",children:[jsxRuntime.jsxs("p",{className:"text-lg text-muted-foreground",children:["Requested Pricing Tier: ",jsxRuntime.jsx("span",{className:"font-bold",children:n})]}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If your account qualifies, your pricing will update immediately."}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"If not, we'll review your request and notify you of the decision."})]}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:d,disabled:l,children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:o,disabled:l,children:l?"Loading...":`Apply for ${n}`})]})]})})}const getPricingText=e=>e===1?"The Best":e===2?"Fixed 12.5% GP on all items":e===3?"Advantageous":e===4?"Buying Group":e===5?"Cost":e,getShippingText=e=>e==="A"?"Free or Custom":e==="B"?"Fixed $10 anywhere":e==="C"?`Free shipping on $150+ orders to your location,
1201
1196
  $15 for drop shipped orders under $1,500,
1202
- $10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full shipping charges":e,getTermsText=e=>e==="STRIPE"?"Credit card payment":e==="NET30"?"Net 30 days":e,AccountTier=({isSuperAdmin:e,readonly:t,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=je=>je&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco",COOPSCO:"coopsco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[je]||"",E=je=>je&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[je]||"",A=je=>je&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[je]||"",[M,I]=React.useState(C((n==null?void 0:n.Priority)??"")),[j,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[Q,te]=React.useState(A(n==null?void 0:n.PriceProfile)),F=je=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",coopsco:"COOPSCO",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[je]||je,V=je=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[je]||je,ne=je=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[je]||je;React.useEffect(()=>{I(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),te(A(n==null?void 0:n.PriceProfile))},[n]);const ae=async(je,Be,qe,Ve)=>{try{(await S({applicationId:o,fieldName:je,newValue:Be})).error?d({title:"Error",description:Ve,variant:"destructive"}):d({title:"Success",description:qe,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},se=async je=>{I(je);const Be=F(je);ae("Priority",Be,`Priority updated to ${Be}`,"Failed to update priority")},Oe=async je=>{q(je);const Be=V(je);ae("ShippingProfile",Be,`Shipping profile updated to ${Be}`,"Failed to update shipping profile")},Ne=async je=>{te(je);const Be=ne(je);ae("PriceProfile",Be,`Pricing profile updated to ${Be}`,"Failed to update pricing profile")},oe=async()=>{try{const je=await S({applicationId:o,fieldName:"Tier",newValue:b});je.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):je.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},$e=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:e}],Ae=je=>{_(je),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},je))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar$1,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!t&&jsxRuntime.jsx(Button$1,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:"https://randmar.io/pricing",target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{disabled:t,className:t?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),$e.map(je=>jsxRuntime.jsx(Button$1,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!je.enabled,onClick:()=>Ae(je.name),children:je.name},je.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:oe}),e&&!t&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:M,onValueChange:se,className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"coopsco",label:"COOPSCO"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:je.value,id:`priority-${je.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${je.value}`,className:"cursor-pointer text-xs",children:je.label})]},je.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:j,onValueChange:Oe,className:"grid grid-cols-1 @md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:je.value,id:`shipping-${je.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${je.value}`,className:"cursor-pointer text-xs",children:je.label})]},je.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:Q,onValueChange:Ne,className:"grid grid-cols-2 @sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:je.value,id:`pricing-${je.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${je.value}`,className:"cursor-pointer text-xs",children:je.label})]},je.value))})]})]})})]})]})};function OrderCategories({openOrders:e=[],isLoading:t=!1}){const n=(e==null?void 0:e.filter(M=>M.DocumentType==="Order"))||[],o=(e==null?void 0:e.filter(M=>M.DocumentType==="Shipment"))||[],l=n.filter(M=>M.WarehouseCode!=="3PLE"),d=l.reduce((M,I)=>M+(I.Quantity??0),0),f=l.reduce((M,I)=>M+(I.ExtendedPrice??0),0),g=n.filter(M=>M.WarehouseCode==="3PLE"),b=g.reduce((M,I)=>M+(I.Quantity??0),0),_=g.reduce((M,I)=>M+(I.ExtendedPrice??0),0),S=o.reduce((M,I)=>M+(I.Quantity??0),0),R=o.reduce((M,I)=>M+(I.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,A=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return t?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},M))})})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:A.map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:M.name}),jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(M.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:M.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:M.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},M.name))})})]})}function ReportsSection({isLoading:e,userEmail:t,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[A,{isLoading:M}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[I,j]=React.useState(null),[q,Q]=React.useState(t),[te,F]=React.useState(!1),[V,ne]=React.useState("all"),{data:ae,isLoading:se}=useGetV4PartnerByRouteApplicationIdManufacturersQuery({routeApplicationId:n,withSpecification:!1}),Oe=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],Ne=async Ae=>{j(Ae),Ae.id==="Products"&&ne("all"),F(!0)},oe=async()=>{if(!(!I||!n))try{switch(I.id){case"Products":{const Ae={routeResellerId:n,emailAddress:q};V&&V!=="all"&&(Ae.manufacturerId=V),await S(Ae).unwrap();break}case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await A({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${I.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(Ae){console.error("Error requesting report:",Ae),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},$e=_||R||g||d||M||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(Ae=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(je=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},je))]},Ae))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:Oe.map(Ae=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:Ae.name}),Ae.reports.map(je=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(je.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:je.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:je.description})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>Ne(je),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},je.id))]},Ae.name))})}),jsxRuntime.jsx(Dialog,{open:te,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",I==null?void 0:I.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:Ae=>Q(Ae.target.value),placeholder:"your@email.com",className:"mt-2"})]}),(I==null?void 0:I.id)==="Products"&&jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"manufacturer",children:"Manufacturer"}),jsxRuntime.jsxs("select",{id:"manufacturer",className:"mt-2 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:V,onChange:Ae=>ne(Ae.target.value),disabled:se,children:[jsxRuntime.jsx("option",{value:"all",children:"All manufacturers"}),!se&&Array.isArray(ae)&&ae.slice().sort((Ae,je)=>(Ae.PublicName||Ae.Name||"").localeCompare(je.PublicName||je.Name||"")).map(Ae=>Ae!=null&&Ae.ManufacturerId?jsxRuntime.jsx("option",{value:Ae.ManufacturerId,children:(Ae.PublicName||Ae.Name||Ae.ManufacturerId)+(Ae.OpenToWork?" (Open to Work)":"")},Ae.ManufacturerId):null)]})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:oe,disabled:!q||$e,children:$e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function QualificationBadge({qualification:e}){return!e.QualificationId||e.QualificationId==="Suspended"?null:e.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X$1,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:e.DefaultOpportunityNumber?"pr-1":"",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),e.QualificationId,e.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:e.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function SalesChart({statistics:e,mode:t="month",chartHeight:n,loading:o=!1,size:l="default"}){const[d,f]=React.useState([]),[g,b]=React.useState(!1),_=[{name:"dollarVolume",label:"Dollar Volume",color:"var(--primary)",yAxisId:"left",format:"money"},{name:"unitsSold",label:"Units Sold",color:"#888",units:" units",yAxisId:"right",format:"integer"}];return React.useEffect(()=>{if(o||!e){f([]);return}let S=[];if(t==="week"){const R=new Map;e.forEach(C=>{var A;const E=((A=C.Day)==null?void 0:A.toString())||"";if(E.length===8){const M=parseInt(E.substring(0,4),10),I=parseInt(E.substring(4,6),10)-1,j=parseInt(E.substring(6,8),10),q=new Date(M,I,j),Q=new Date(q);Q.setDate(q.getDate()-q.getDay());const te=`${Q.getFullYear()}-${String(Q.getMonth()+1).padStart(2,"0")}-${String(Q.getDate()).padStart(2,"0")}`,F=R.get(te)||{price:0,quantity:0};F.price+=C.ExtendedPrice||0,F.quantity+=C.Quantity||0,R.set(te,F)}}),S=Array.from(R).sort(([C],[E])=>C.localeCompare(E)).map(([C,E])=>({date:`${C.substring(5,7)}/${C.substring(8,10)}`,dollarVolume:E.price,unitsSold:E.quantity}))}else{const R=new Date,C=R.getFullYear(),E=R.getMonth(),A=R.getDate(),M=`${C}-${(E+1).toString().padStart(2,"0")}`,I=Array.from({length:12},(q,Q)=>{const te=new Date(C,E-(11-Q),1);return`${te.getFullYear()}-${(te.getMonth()+1).toString().padStart(2,"0")}`}),j=Object.fromEntries(I.map(q=>[q,{price:0,quantity:0}]));if(e.forEach(q=>{const Q=String(q.Day??0);if(Q.length!==8)return;const te=`${Q.substring(0,4)}-${Q.substring(4,6)}`;j[te]&&(j[te].price+=q.ExtendedPrice??0,j[te].quantity+=q.Quantity??0)}),S=I.map(q=>{const Q=j[q],[te,F]=q.split("-").map(Number);return{date:new Date(te,F-1).toLocaleString("default",{month:"short",year:"numeric"}),dollarVolume:Q.price,unitsSold:Q.quantity}}),g){const q=j[M];if(q&&q.price>0&&A>0){const Q=new Date(C,E+1,0).getDate();if(A<Q){const te=q.price/A,F=q.quantity/A,V=te*Q,ne=F*Q,ae=S[S.length-1];ae&&(ae.dollarVolume=V,ae.unitsSold=ne)}}}}f(S)},[e,t,g,o]),o?jsxRuntime.jsx("div",{style:{height:n},children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full rounded-md"})}):d.length===0?jsxRuntime.jsx("div",{style:{height:n},className:"flex items-center justify-center text-muted-foreground",children:"No sales data available."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(AreaChart,{data:d,series:_,height:n,size:l}),l==="default"&&t==="month"&&jsxRuntime.jsxs("div",{className:"mt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{checked:g,onCheckedChange:b,id:"extrapolate-switch"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate Current Month"})]}),g&&jsxRuntime.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["* Values for ",new Date().toLocaleString("default",{month:"long"})," are projected estimates."]})]})]})}function PartnerCardHeader({type:e,applicationId:t,publicName:n,name:o,location:l,link:d,linkNewTab:f=!0,children:g}){const[b,_]=React.useState(!1),S=C=>{C.preventDefault(),C.stopPropagation(),navigator.clipboard.writeText(t),_(!0),setTimeout(()=>_(!1),2e3)},R=jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t,width:48,height:48},`partner_logo_${t}`)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:e}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{delayDuration:300,children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex cursor-pointer items-center gap-1",onClick:S,children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t}),b?jsxRuntime.jsx(Check,{className:"h-3 w-3 text-green-500"}):jsxRuntime.jsx(Copy,{className:"h-3 w-3 text-muted-foreground"})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:b?"Copied!":"Copy ID"})})]})})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:n||"N/A"}),o&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:o}),l&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:l})]})]}),g&&jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:g})]});return d?jsxRuntime.jsx(reactRouterDom.Link,{to:d,target:f?"_blank":"_self",children:R}):R}function ManufacturerCard({manufacturer:e,link:t,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1,appID:f}){var te,F,V;const{toast:g}=useToast(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[S,R]=React.useState(!1),[C,E]=React.useState(""),{data:A}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:f||""},{skip:!f}),M=A==null?void 0:A.IsReseller;if(d||!e)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const I=[e.City,e.Province,e.Country].filter(Boolean),j=I.length>0?I.join(", "):"",q=((te=e.Tags)==null?void 0:te.split(",").map(ne=>ne.trim()).filter(Boolean))||[],Q=async()=>{if(!(!(e!=null&&e.ManufacturerId)||!f||!C))try{await b({routeResellerId:f,emailAddress:C,manufacturerId:e.ManufacturerId}).unwrap(),g({title:"Report requested",description:`The Universal Product List for this manufacturer will be sent to ${C} shortly.`,variant:"success"}),R(!1)}catch(ne){console.error("Error requesting product list:",ne),g({title:"Error",description:"Failed to request product list. Please try again.",variant:"destructive"})}};return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(PartnerCardHeader,{type:"Manufacturer",applicationId:e.ManufacturerId,publicName:e.PublicName,name:e.Name,location:j,link:t,linkNewTab:n,children:jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:e.SalesStatistics&&e.SalesStatistics.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(SalesChart,{statistics:e.SalesStatistics,size:"mini"})})})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((F=e.Qualification)!=null&&F.QualificationId)&&((V=e.Qualification)==null?void 0:V.QualificationId)!=="Suspended"||!!e.OpenToWork||!!e.OnHold&&e.OnHold!==0||q.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}}),!!e.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),q.map((ne,ae)=>jsxRuntime.jsx(Badge,{variant:"outline",children:ne},ae))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${e.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${e.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:e.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),e.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:e.SalesData.SalesYearToDay?formatMoney(e.SalesData.SalesYearToDay):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:e.SalesData.SalesLast3Months?formatMoney(e.SalesData.SalesLast3Months):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:e.SalesData.SalesLast30Days?formatMoney(e.SalesData.SalesLast30Days):"—"})]})]})}),(o||l||e.PublicResourcesLink||M&&f&&e.ManufacturerId)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[o&&o,M&&f&&e.ManufacturerId&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{size:"icon",onClick:()=>R(!0),disabled:_,children:_?jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):jsxRuntime.jsx(Download,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Email Product List"})})]})}),e.PublicResourcesLink&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:e.PublicResourcesLink,target:"_blank",children:jsxRuntime.jsx(Button$1,{size:"icon",children:jsxRuntime.jsx(HardDriveDownload,{className:"h-4 w-4"})})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Public Resources Link"})})]})})]}),l&&jsxRuntime.jsx("div",{children:l})]}),jsxRuntime.jsx(Dialog,{open:S,onOpenChange:R,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Request Universal Product List"}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:C,onChange:ne=>E(ne.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>R(!1),children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:Q,disabled:!C||_,children:_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function ProductInventoryButton({applicationId:e,randmarSku:t,inventory:n,buttonSize:o="default"}){var Oe;const l=React.useRef(null),d=useIntersectionObserver({elementRef:l,threshold:.1,rootMargin:"100px",freezeOnceVisible:!0}),{toast:f}=useToast(),[g,b]=React.useState(!1),[_,S]=React.useState(!1),[R,C]=React.useState(!1),{data:E,isLoading:A,isFetching:M}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e},{skip:!e||!d}),{data:I,isLoading:j,isFetching:q}=useGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery({routeApplicationId:e,randmarSku:t,withSpecification:!1},{skip:!!n||!d}),[Q]=usePutV4ResellerByRouteResellerIdProductAndRandmarSkuRequisitionMutation(),te=n??((Oe=I==null?void 0:I.Distribution)==null?void 0:Oe.Inventory);React.useEffect(()=>{b(!1)},[t]);const{inventoryQuantity:F,totalIncomingQuantity:V}=React.useMemo(()=>{if(!te||te.length===0)return{inventoryQuantity:0,totalIncomingQuantity:0};const Ne=te.reduce(($e,Ae)=>$e+(Ae.AvailableQuantity||0),0),oe=te.reduce(($e,Ae)=>$e+(Ae.PurchaseOrderQuantity||0),0);return{inventoryQuantity:Ne,totalIncomingQuantity:oe}},[te]);if(A||M||j||q)return jsxRuntime.jsx("div",{ref:l,children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-36 rounded-md"})});const ae=()=>{R||!(E!=null&&E.IsReseller)||(C(!0),Q({routeResellerId:e??"",randmarSku:t??""}).then(Ne=>{Ne.error||Ne.data===!1?f({title:"Warning",description:"Reorder is pending or requires manual approval. Contact the Randmar team for details.",variant:"warning"}):f({title:"Success",description:"Qualification successfully submitted.",variant:"success"}),S(!1)}).catch(Ne=>{console.error(Ne),f({title:"Error",description:"Error submitting your qualification.",variant:"destructive"})}).finally(()=>{C(!1)}))};if(!te)return jsxRuntime.jsx("div",{ref:l,children:jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx("span",{tabIndex:0,children:jsxRuntime.jsxs(Button$1,{disabled:!0,size:o,variant:"outline",className:"text-sm",children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),"No data"]})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"No inventory data could be found for this product."})})]})})});if(E!=null&&E.IsReseller&&F<=0&&V<=0)return jsxRuntime.jsx("div",{ref:l,children:jsxRuntime.jsxs(Dialog,{open:_,onOpenChange:S,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"outline",size:o,className:"text-sm reseller-theme text-primary",children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),"Request to stock"]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-md",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Request to stock"})}),jsxRuntime.jsx("p",{className:"py-4",children:"Are you sure you want to request this product to be stocked?"}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>S(!1),disabled:R,children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:ae,disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Requesting..."]}):"Confirm"})]})]})]})});const se=F<=0&&V>0;return jsxRuntime.jsx("div",{ref:l,children:jsxRuntime.jsxs(Dialog,{open:g,onOpenChange:b,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"outline",size:o,className:`text-sm ${se?"manufacturer-theme text-primary":F>0?"text-green-700":"text-red-700"}`,children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),se?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[formatNumber(V)," Incoming"]}):F>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[formatNumber(F)," in stock"]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Out of stock"})]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-4xl",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{className:"flex items-center",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2",size:18}),"Inventory Information"]})}),jsxRuntime.jsx(ProductInventoryGrid,{inventory:te})]})]})})}function OrdersCard({applicationId:e,orders:t=null,loading:n=!1,title:o="Order Details"}){const l=React.useMemo(()=>[{accessorKey:"OrderNumber",header:"Order Number",cell:({row:g})=>g.original.OrderNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/GeneralDocument/${g.original.OrderNumber}`,className:"font-medium text-primary hover:underline",children:g.original.OrderNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for order ",g.original.OrderNumber]})})]})}):"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"DocumentNumber",header:"Document Number",cell:({row:g})=>g.original.DocumentNumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"DocumentDate",header:"Document Date",cell:({row:g})=>formatYYYYMMDDIntToDateString(g.original.DocumentDate),enableSorting:!0,enableFiltering:!1},{accessorKey:"PONumber",header:"PO Number",cell:({row:g})=>g.original.PONumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"WarehouseCode",header:"Warehouse",cell:({row:g})=>g.original.WarehouseCode??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"MPN",header:"MPN",cell:({row:g})=>g.original.MPN?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Product/${g.original.MPN}`,className:"font-medium text-primary hover:underline",children:g.original.MPN})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for MPN ",g.original.MPN]})})]})}):"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:g})=>g.original.Quantity??"N/A",enableSorting:!0,enableFiltering:!1},{accessorKey:"ShipToName",header:"Name",cell:({row:g})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:g.original.ShipToName??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:g})=>g.original.UnitPrice?formatMoney(g.original.UnitPrice):"N/A",enableSorting:!0,enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:g})=>jsxRuntime.jsx("div",{className:"flex space-x-2",children:jsxRuntime.jsx(ProductInventoryButton,{applicationId:e,randmarSku:g.original.RandmarSKU??"",buttonSize:"sm"})})}],[e]),d=React.useMemo(()=>{const g={};if(t){const b=Array.from(new Set(t.map(A=>A.WarehouseCode).filter(A=>A!=null)));g.WarehouseCode=b;const _=Array.from(new Set(t.map(A=>A.ShipToName).filter(A=>A!=null)));g.ShipToName=_;const S=Array.from(new Set(t.map(A=>A.DocumentNumber).filter(A=>A!=null)));g.DocumentNumber=S;const R=Array.from(new Set(t.map(A=>A.OrderNumber).filter(A=>A!=null)));g.OrderNumber=R;const C=Array.from(new Set(t.map(A=>A.PONumber).filter(A=>A!=null)));g.PONumber=C;const E=Array.from(new Set(t.map(A=>A.MPN).filter(A=>A!=null)));g.MPN=E}return g},[t]),f=t||[];return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:o})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:l,data:f,uniqueValues:d})})]})}function ResellerOverview({appID:e,reseller:t,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){var q,Q,te,F;const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:e??"",withSpecification:!0},{skip:!!t}),[_,S]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),R=React.useCallback(()=>n?!1:_.publicInfo.hasUnsavedChanges,[n,_]),C=React.useCallback((V,ne)=>{S(ae=>{var se;return((se=ae[V])==null?void 0:se.hasUnsavedChanges)!==ne.hasUnsavedChanges?{...ae,[V]:ne}:ae})},[]),{NavigationGuardDialog:E}=useRouterNavigationGuard(R),A=t??f,M=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,I=(A==null?void 0:A.QualifiedManufacturers)??[],j=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs("div",{className:"@container",children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid @lg:grid-cols-2 gap-6",children:[jsxRuntime.jsx(SalesChartCard,{statistics:(A==null?void 0:A.SalesStatistics)??[],loading:g}),jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),M&&jsxRuntime.jsx(BillingCard,{appID:e,reseller:A||{},withoutReports:d,isLoading:g,userEmail:o,isSuperAdmin:l}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:e??"",isLoading:g,readonly:n,onUnsavedChanges:V=>C("publicInfo",{hasUnsavedChanges:V})}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:e??"",isLoading:g})]}),g||I.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid @lg:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((V,ne)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},ne)):I.map(V=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:V,link:`https://dashboard.randmar.io/${e}/Partner/${V.ManufacturerId}`},V.ManufacturerId))})})]}):j.length>0&&jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:j}),(((q=A==null?void 0:A.Opportunities)==null?void 0:q.length)??0)>0&&jsxRuntime.jsx(OpportunitiesTable,{applicationId:e,opportunities:A==null?void 0:A.Opportunities,loading:g}),(((Q=A==null?void 0:A.ActiveOrderDetails)==null?void 0:Q.length)??0)>0&&jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Active Orders",orders:A==null?void 0:A.ActiveOrderDetails,loading:g}),(((te=A==null?void 0:A.CompletedOrderDetails)==null?void 0:te.length)??0)>0&&jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Completed Orders",orders:A==null?void 0:A.CompletedOrderDetails,loading:g}),(((F=A==null?void 0:A.Returns)==null?void 0:F.length)??0)>0&&jsxRuntime.jsx(ReturnsTable,{applicationId:e,returns:A==null?void 0:A.Returns,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:e,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(E,{})]})}const alertVariants=cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-50 text-green-700 dark:border-green-500 dark:bg-green-950 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-700 dark:border-yellow-500 dark:bg-yellow-950 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 bg-blue-50 text-blue-700 dark:border-blue-500 dark:bg-blue-950 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Alert=React__namespace.forwardRef(({className:e,variant:t,...n},o)=>jsxRuntime.jsx("div",{ref:o,role:"alert",className:cn(alertVariants({variant:t}),e),...n}));Alert.displayName="Alert";const AlertTitle=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("h5",{ref:n,className:cn("mb-1 font-medium leading-none tracking-tight",e),...t}));AlertTitle.displayName="AlertTitle";const AlertDescription=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("div",{ref:n,className:cn("text-sm [&_p]:leading-relaxed",e),...t}));AlertDescription.displayName="AlertDescription";/**
1197
+ $10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full shipping charges":e,getTermsText=e=>e==="STRIPE"?"Credit card payment":e==="NET30"?"Net 30 days":e,AccountTier=({isSuperAdmin:e,readonly:t,reseller:n,appID:o,isLoading:l})=>{const{toast:d}=useToast(),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,{isLoading:R}]=usePostV4PartnerByApplicationIdAccountResellerAndFieldNameMutation(),C=je=>je&&{Starter:"starter","E-Commerce":"ecommerce",Commercial:"commercial",Basics:"cws",Novexco:"novexco",COOPSCO:"coopsco","Jean Coutu":"jeancoutu",Exclusive:"exclusive"}[je]||"",E=je=>je&&{A:"free",B:"fixed",C:"dropshipped",D:"under1500",E:"fullcharges"}[je]||"",A=je=>je&&{1:"exclusive",2:"ecommerce",3:"commercial",4:"buyinggroup",5:"cost"}[je]||"",[M,I]=React.useState(C((n==null?void 0:n.Priority)??"")),[j,q]=React.useState(E((n==null?void 0:n.ShippingProfile)??"")),[Q,te]=React.useState(A(n==null?void 0:n.PriceProfile)),F=je=>({starter:"Starter",ecommerce:"E-Commerce",commercial:"Commercial",cws:"Basics",novexco:"Novexco",coopsco:"COOPSCO",jeancoutu:"Jean Coutu",exclusive:"Exclusive"})[je]||je,V=je=>({free:"A",fixed:"B",dropshipped:"C",under1500:"D",fullcharges:"E"})[je]||je,ne=je=>({exclusive:"1",ecommerce:"2",commercial:"3",buyinggroup:"4",cost:"5"})[je]||je;React.useEffect(()=>{I(C((n==null?void 0:n.Priority)??"")),q(E((n==null?void 0:n.ShippingProfile)??"")),te(A(n==null?void 0:n.PriceProfile))},[n]);const ae=async(je,Be,qe,Ve)=>{try{(await S({applicationId:o,fieldName:je,newValue:Be})).error?d({title:"Error",description:Ve,variant:"destructive"}):d({title:"Success",description:qe,variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}},se=async je=>{I(je);const Be=F(je);ae("Priority",Be,`Priority updated to ${Be}`,"Failed to update priority")},Oe=async je=>{q(je);const Be=V(je);ae("ShippingProfile",Be,`Shipping profile updated to ${Be}`,"Failed to update shipping profile")},Ne=async je=>{te(je);const Be=ne(je);ae("PriceProfile",Be,`Pricing profile updated to ${Be}`,"Failed to update pricing profile")},oe=async()=>{try{const je=await S({applicationId:o,fieldName:"Tier",newValue:b});je.error?d({title:"Error",description:"Failed to update reseller",variant:"destructive"}):je.data?d({title:"Success",description:`Pricing Tier changed to ${b}`,variant:"success"}):d({title:"Considered",description:"Request being considered",variant:"success"})}catch{d({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{g(!1),_("")}},$e=[{name:"Terms",enabled:n.Priority==="Starter"},{name:"E-Commerce",enabled:n.Priority==="Commercial"},{name:"Commercial",enabled:n.Priority==="E-Commerce"},{name:"Exclusive",enabled:e}],Ae=je=>{_(je),g(!0)};return l?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-28"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-16 rounded-full"})]})}),jsxRuntime.jsxs(CardContent,{children:[jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-56"})]}),jsxRuntime.jsx("div",{className:"grid gap-3",children:[1,2,3].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full shrink-0"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]})]},je))}),jsxRuntime.jsxs("div",{className:"flex gap-2 mt-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full"})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{className:"pb-2 pt-4 px-4 flex flex-row items-center justify-between",children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Account Tier"}),jsxRuntime.jsx(Badge,{variant:"secondary",className:"bg-green-100 text-green-700 hover:bg-green-200 text-xs",children:"Active"})]}),jsxRuntime.jsxs(CardContent,{className:"pt-2 px-4 pb-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-3 bg-primary/5 p-4 rounded-lg",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("h3",{className:"text-lg font-bold text-primary",children:[(n==null?void 0:n.Priority)||""," Tier"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Optimized for online retail"})]}),jsxRuntime.jsx(CircleCheck,{className:"h-6 w-6 text-green-600"})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 gap-2 mb-3",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Package2,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Pricing"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground truncate",children:getPricingText(n.PriceProfile||0)})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Truck,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Shipping"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getShippingText(n.ShippingProfile||"").split(".")[0]})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-lg border bg-card hover:bg-accent/5 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-1.5 rounded-full shrink-0",children:jsxRuntime.jsx(Calendar$1,{className:"h-4 w-4 text-primary"})}),jsxRuntime.jsxs("div",{className:"min-w-0",children:[jsxRuntime.jsx("p",{className:"font-medium text-sm",children:"Payment terms"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:getTermsText((n==null?void 0:n.Terms)||"")})]})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-2",children:[!t&&jsxRuntime.jsx(Button$1,{variant:"outline",className:"flex-1",asChild:!0,children:jsxRuntime.jsxs(reactRouterDom.Link,{to:"https://randmar.io/pricing",target:"_blank",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4 mr-1"}),"Pricing Tiers"]})}),jsxRuntime.jsxs(Popover,{children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{disabled:t,className:t?"hidden":"flex-1",children:["Upgrade Tier ",jsxRuntime.jsx(ChevronRight,{className:"h-3 w-3 ml-1"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56 p-2",children:jsxRuntime.jsxs("div",{className:"grid gap-1",children:[jsxRuntime.jsx("h4",{className:"font-medium text-xs mb-1",children:"Select a tier"}),$e.map(je=>jsxRuntime.jsx(Button$1,{variant:"ghost",size:"sm",className:"w-full justify-start h-8",disabled:!je.enabled,onClick:()=>Ae(je.name),children:je.name},je.name))]})})]})]})]})]}),jsxRuntime.jsx(ChangePricingTierModal,{isLoading:R,open:f,setOpen:g,tier:b,onTierChange:oe}),e&&!t&&jsxRuntime.jsxs(Card,{className:"mt-4",children:[jsxRuntime.jsx(CardHeader,{className:"pb-2 pt-3 px-4",children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Admin Configuration"})}),jsxRuntime.jsx(CardContent,{className:"pt-2 px-4 pb-4",children:jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Priority"}),jsxRuntime.jsx(RadioGroup$1,{value:M,onValueChange:se,className:"grid grid-cols-2 @sm:grid-cols-3 @md:grid-cols-4 gap-1",children:[{value:"starter",label:"Starter"},{value:"ecommerce",label:"E-Commerce"},{value:"commercial",label:"Commercial"},{value:"cws",label:"CWS (Basics)"},{value:"novexco",label:"Novexco"},{value:"coopsco",label:"COOPSCO"},{value:"jeancoutu",label:"Jean Coutu"},{value:"exclusive",label:"Exclusive"}].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:je.value,id:`priority-${je.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`priority-${je.value}`,className:"cursor-pointer text-xs",children:je.label})]},je.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Shipping Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:j,onValueChange:Oe,className:"grid grid-cols-1 @md:grid-cols-2 gap-1",children:[{value:"free",label:"Free (A)"},{value:"fixed",label:"Fixed $10 Shipping (B)"},{value:"dropshipped",label:"$15 for drop shipped (C)"},{value:"under1500",label:"15$ under 1,500 (D)"},{value:"fullcharges",label:"Full shipping charges (E)"}].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:je.value,id:`shipping-${je.value}`,className:"h-6 w-6 scale-50"}),jsxRuntime.jsx(Label$2,{htmlFor:`shipping-${je.value}`,className:"cursor-pointer text-xs",children:je.label})]},je.value))})]}),jsxRuntime.jsxs("div",{className:"bg-muted/30 p-2 rounded-lg",children:[jsxRuntime.jsx(Label$2,{className:"block mb-1 text-xs font-medium",children:"Pricing Profile"}),jsxRuntime.jsx(RadioGroup$1,{value:Q,onValueChange:Ne,className:"grid grid-cols-2 @sm:grid-cols-3 gap-1",children:[{value:"exclusive",label:"Exclusive (1)"},{value:"ecommerce",label:"E-Commerce (2)"},{value:"commercial",label:"Commercial (3)"},{value:"buyinggroup",label:"Buying Group (4)"},{value:"cost",label:"Cost (5)"}].map(je=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntime.jsx(RadioGroupItem,{value:je.value,id:`pricing-${je.value}`,className:"h-6 w-6 scale-50 antialiased"}),jsxRuntime.jsx(Label$2,{htmlFor:`pricing-${je.value}`,className:"cursor-pointer text-xs",children:je.label})]},je.value))})]})]})})]})]})};function OrderCategories({openOrders:e=[],isLoading:t=!1}){const n=(e==null?void 0:e.filter(M=>M.DocumentType==="Order"))||[],o=(e==null?void 0:e.filter(M=>M.DocumentType==="Shipment"))||[],l=n.filter(M=>M.WarehouseCode!=="3PLE"),d=l.reduce((M,I)=>M+(I.Quantity??0),0),f=l.reduce((M,I)=>M+(I.ExtendedPrice??0),0),g=n.filter(M=>M.WarehouseCode==="3PLE"),b=g.reduce((M,I)=>M+(I.Quantity??0),0),_=g.reduce((M,I)=>M+(I.ExtendedPrice??0),0),S=o.reduce((M,I)=>M+(I.Quantity??0),0),R=o.reduce((M,I)=>M+(I.ExtendedPrice??0),0),C=d+b+S,E=f+_+R,A=[{name:"All",icon:Package,color:"bg-blue-500",orders:C,amount:E},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",orders:d,amount:f},{name:"Shipped",icon:Truck,color:"bg-green-500",orders:S,amount:R},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",orders:b,amount:_}];return t?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-40"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:[1,2,3,4].map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:"bg-gray-200 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]})},M))})})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Order Categories"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-3.5",children:A.map(M=>jsxRuntime.jsx(Card,{className:"overflow-hidden rounded-md rounded-b-lg border-0 shadow-md",children:jsxRuntime.jsxs(CardContent,{className:"p-0",children:[jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:M.name}),jsxRuntime.jsx("div",{className:`${M.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(M.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:M.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:jsxRuntime.jsx(FormattedNumber,{value:M.amount,style:"currency",currency:"CAD",currencyDisplay:"symbol"})})]})]})]})]})},M.name))})})]})}function ReportsSection({isLoading:e,userEmail:t,appID:n}){const{toast:o}=useToast(),[l,{isLoading:d}]=usePostV4ResellerByRouteResellerIdReportWalmartTrackingFileEmailMutation(),[f,{isLoading:g}]=usePostV4ResellerByRouteResellerIdReportAmazonTrackingFileEmailMutation(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportOpenOrdersEmailMutation(),[S,{isLoading:R}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[C,{isLoading:E}]=usePostV4ResellerByRouteResellerIdReportInvoicesEmailMutation(),[A,{isLoading:M}]=usePostV4ResellerByRouteResellerIdDocumentStatementEmailMutation(),[I,j]=React.useState(null),[q,Q]=React.useState(t),[te,F]=React.useState(!1),[V,ne]=React.useState("all"),{data:ae,isLoading:se}=useGetV4PartnerByRouteApplicationIdManufacturersQuery({routeApplicationId:n,withSpecification:!1}),Oe=[{name:"Products",reports:[{id:"Products",title:"Universal Product List",description:"A comprehensive overview of your product list with detailed specifications and pricing information.",icon:Package}]},{name:"Operation Details",reports:[{id:"OpenOrders",title:"Order Details",description:"A detailed report of all your orders and shipments, including status, tracking information, and delivery estimates.",icon:ShoppingCart},{id:"Invoices",title:"Invoices and Credits Report",description:"Detailed overview of your invoices and credits within a specific date range. It also contains reports about additional charges, serial numbers, and other relevant information.",icon:ScrollText},{id:"Statement",title:"Statement and RMAs Report",description:"A detailed report of all unpaid invoices and active RMAs.",icon:Banknote}]},{name:"Tracking Files",reports:[{id:"AmazonTrackingFile",title:"Amazon Tracking File",description:"Track products sold on Amazon marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing},{id:"WalmartTrackingFile",title:"Walmart Tracking File",description:"Track products sold on Walmart marketplace with detailed sales and inventory information.",icon:ChartNoAxesColumnIncreasing}]}],Ne=async Ae=>{j(Ae),Ae.id==="Products"&&ne("all"),F(!0)},oe=async()=>{if(!(!I||!n))try{switch(I.id){case"Products":{const Ae={routeResellerId:n,emailAddress:q};V&&V!=="all"&&(Ae.manufacturerId=V),await S(Ae).unwrap();break}case"AmazonTrackingFile":await f({routeResellerId:n,emailAddress:q}).unwrap();break;case"WalmartTrackingFile":await l({routeResellerId:n,emailAddress:q}).unwrap();break;case"OpenOrders":await b({routeResellerId:n,emailAddress:q}).unwrap();break;case"Invoices":await C({routeResellerId:n,emailAddress:q}).unwrap();break;case"Statement":await A({routeResellerId:n,emailAddress:q}).unwrap();break;default:throw new Error("invalid report id")}o({title:"Report requested",description:`The ${I.title} will be sent to ${q} shortly.`,variant:"success"}),F(!1)}catch(Ae){console.error("Error requesting report:",Ae),o({title:"Error",description:"Failed to request report. Please try again.",variant:"destructive"})}},$e=_||R||g||d||M||E;return jsxRuntime.jsxs(Card,{children:[jsxRuntime.jsxs(CardHeader,{children:[jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Reports"}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Download essential business reports, from your Product List to your Order Details."})]}),jsxRuntime.jsx(CardContent,{className:"space-y-6",children:e?jsxRuntime.jsx(jsxRuntime.Fragment,{children:[1,2,3].map(Ae=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-48"}),[1,2].map(je=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-9 rounded-full"}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full"})]}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})]},je))]},Ae))}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:Oe.map(Ae=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h3",{className:"text-sm font-semibold",children:Ae.name}),Ae.reports.map(je=>jsxRuntime.jsxs("div",{className:"flex items-start gap-4 p-4 border rounded-lg hover:bg-gray-100 transition-colors",children:[jsxRuntime.jsx("div",{className:"bg-primary/10 p-2 rounded-full",children:jsxRuntime.jsx(je.icon,{className:"h-5 w-5 text-primary"})}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h4",{className:"font-semibold text-sm",children:je.title}),jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:je.description})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",className:"flex items-center gap-1",onClick:()=>Ne(je),children:[jsxRuntime.jsx(Download,{className:"h-4 w-4"}),"Request"]})]},je.id))]},Ae.name))})}),jsxRuntime.jsx(Dialog,{open:te,onOpenChange:F,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsxs(DialogTitle,{children:["Request ",I==null?void 0:I.title]}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:q,onChange:Ae=>Q(Ae.target.value),placeholder:"your@email.com",className:"mt-2"})]}),(I==null?void 0:I.id)==="Products"&&jsxRuntime.jsxs("div",{className:"py-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"manufacturer",children:"Manufacturer"}),jsxRuntime.jsxs("select",{id:"manufacturer",className:"mt-2 block w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:V,onChange:Ae=>ne(Ae.target.value),disabled:se,children:[jsxRuntime.jsx("option",{value:"all",children:"All manufacturers"}),!se&&Array.isArray(ae)&&ae.slice().sort((Ae,je)=>(Ae.PublicName||Ae.Name||"").localeCompare(je.PublicName||je.Name||"")).map(Ae=>Ae!=null&&Ae.ManufacturerId?jsxRuntime.jsx("option",{value:Ae.ManufacturerId,children:(Ae.PublicName||Ae.Name||Ae.ManufacturerId)+(Ae.OpenToWork?" (Open to Work)":"")},Ae.ManufacturerId):null)]})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>F(!1),children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:oe,disabled:!q||$e,children:$e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function QualificationBadge({qualification:e}){return!e.QualificationId||e.QualificationId==="Suspended"?null:e.QualificationId==="Do Not Sell"?jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"destructive",children:[jsxRuntime.jsx(X$1,{className:"h-3 w-3 mr-1"}),"Do Not Sell"]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})}):jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs(Badge,{variant:"info",className:e.DefaultOpportunityNumber?"pr-1":"",children:[jsxRuntime.jsx(BadgeCheck,{className:"h-3 w-3 mr-1"}),e.QualificationId,e.DefaultOpportunityNumber&&jsxRuntime.jsx(Badge,{variant:"secondary",size:"sm",className:"ml-1",children:e.DefaultOpportunityNumber})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Qualification"})})]})})}function SalesChart({statistics:e,mode:t="month",chartHeight:n,loading:o=!1,size:l="default"}){const[d,f]=React.useState([]),[g,b]=React.useState(!1),_=[{name:"dollarVolume",label:"Dollar Volume",color:"var(--primary)",yAxisId:"left",format:"money"},{name:"unitsSold",label:"Units Sold",color:"#888",units:" units",yAxisId:"right",format:"integer"}];return React.useEffect(()=>{if(o||!e){f([]);return}let S=[];if(t==="week"){const R=new Map;e.forEach(C=>{var A;const E=((A=C.Day)==null?void 0:A.toString())||"";if(E.length===8){const M=parseInt(E.substring(0,4),10),I=parseInt(E.substring(4,6),10)-1,j=parseInt(E.substring(6,8),10),q=new Date(M,I,j),Q=new Date(q);Q.setDate(q.getDate()-q.getDay());const te=`${Q.getFullYear()}-${String(Q.getMonth()+1).padStart(2,"0")}-${String(Q.getDate()).padStart(2,"0")}`,F=R.get(te)||{price:0,quantity:0};F.price+=C.ExtendedPrice||0,F.quantity+=C.Quantity||0,R.set(te,F)}}),S=Array.from(R).sort(([C],[E])=>C.localeCompare(E)).map(([C,E])=>({date:`${C.substring(5,7)}/${C.substring(8,10)}`,dollarVolume:E.price,unitsSold:E.quantity}))}else{const R=new Date,C=R.getFullYear(),E=R.getMonth(),A=R.getDate(),M=`${C}-${(E+1).toString().padStart(2,"0")}`,I=Array.from({length:12},(q,Q)=>{const te=new Date(C,E-(11-Q),1);return`${te.getFullYear()}-${(te.getMonth()+1).toString().padStart(2,"0")}`}),j=Object.fromEntries(I.map(q=>[q,{price:0,quantity:0}]));if(e.forEach(q=>{const Q=String(q.Day??0);if(Q.length!==8)return;const te=`${Q.substring(0,4)}-${Q.substring(4,6)}`;j[te]&&(j[te].price+=q.ExtendedPrice??0,j[te].quantity+=q.Quantity??0)}),S=I.map(q=>{const Q=j[q],[te,F]=q.split("-").map(Number);return{date:new Date(te,F-1).toLocaleString("default",{month:"short",year:"numeric"}),dollarVolume:Q.price,unitsSold:Q.quantity}}),g){const q=j[M];if(q&&q.price>0&&A>0){const Q=new Date(C,E+1,0).getDate();if(A<Q){const te=q.price/A,F=q.quantity/A,V=te*Q,ne=F*Q,ae=S[S.length-1];ae&&(ae.dollarVolume=V,ae.unitsSold=ne)}}}}f(S)},[e,t,g,o]),o?jsxRuntime.jsx("div",{style:{height:n},children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full rounded-md"})}):d.length===0?jsxRuntime.jsx("div",{style:{height:n},className:"flex items-center justify-center text-muted-foreground",children:"No sales data available."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(AreaChart,{data:d,series:_,height:n,size:l}),l==="default"&&t==="month"&&jsxRuntime.jsxs("div",{className:"mt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Switch,{checked:g,onCheckedChange:b,id:"extrapolate-switch"}),jsxRuntime.jsx(Label$2,{htmlFor:"extrapolate-switch",children:"Extrapolate Current Month"})]}),g&&jsxRuntime.jsxs("p",{className:"mt-2 text-sm text-muted-foreground",children:["* Values for ",new Date().toLocaleString("default",{month:"long"})," are projected estimates."]})]})]})}function PartnerCardHeader({type:e,applicationId:t,publicName:n,name:o,location:l,link:d,linkNewTab:f=!0,children:g}){const[b,_]=React.useState(!1),S=C=>{C.preventDefault(),C.stopPropagation(),navigator.clipboard.writeText(t),_(!0),setTimeout(()=>_(!1),2e3)},R=jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx("div",{className:"h-12 w-12 overflow-hidden rounded-md",children:jsxRuntime.jsx(PartnerLogo,{id:t,width:48,height:48},`partner_logo_${t}`)}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{className:"text-xs text-primary",children:e}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"|"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{delayDuration:300,children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex cursor-pointer items-center gap-1",onClick:S,children:[jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:t}),b?jsxRuntime.jsx(Check,{className:"h-3 w-3 text-green-500"}):jsxRuntime.jsx(Copy,{className:"h-3 w-3 text-muted-foreground"})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:b?"Copied!":"Copy ID"})})]})})]}),jsxRuntime.jsx("h3",{className:"font-semibold",children:n||"N/A"}),o&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:o}),l&&jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:l})]})]}),g&&jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:g})]});return d?jsxRuntime.jsx(reactRouterDom.Link,{to:d,target:f?"_blank":"_self",children:R}):R}function ManufacturerCard({manufacturer:e,link:t,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1,appID:f}){var te,F,V;const{toast:g}=useToast(),[b,{isLoading:_}]=usePostV4ResellerByRouteResellerIdReportProductsEmailMutation(),[S,R]=React.useState(!1),[C,E]=React.useState(""),{data:A}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:f||""},{skip:!f}),M=A==null?void 0:A.IsReseller;if(d||!e)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsxs(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-24"})]}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const I=[e.City,e.Province,e.Country].filter(Boolean),j=I.length>0?I.join(", "):"",q=((te=e.Tags)==null?void 0:te.split(",").map(ne=>ne.trim()).filter(Boolean))||[],Q=async()=>{if(!(!(e!=null&&e.ManufacturerId)||!f||!C))try{await b({routeResellerId:f,emailAddress:C,manufacturerId:e.ManufacturerId}).unwrap(),g({title:"Report requested",description:`The Universal Product List for this manufacturer will be sent to ${C} shortly.`,variant:"success"}),R(!1)}catch(ne){console.error("Error requesting product list:",ne),g({title:"Error",description:"Failed to request product list. Please try again.",variant:"destructive"})}};return jsxRuntime.jsxs(Card,{className:"manufacturer-theme flex flex-col h-full",children:[jsxRuntime.jsx(PartnerCardHeader,{type:"Manufacturer",applicationId:e.ManufacturerId,publicName:e.PublicName,name:e.Name,location:j,link:t,linkNewTab:n,children:jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:e.SalesStatistics&&e.SalesStatistics.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(SalesChart,{statistics:e.SalesStatistics,size:"mini"})})})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((F=e.Qualification)!=null&&F.QualificationId)&&((V=e.Qualification)==null?void 0:V.QualificationId)!=="Suspended"||!!e.OpenToWork||!!e.OnHold&&e.OnHold!==0||q.length>0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}}),!!e.OpenToWork&&jsxRuntime.jsxs(Badge,{variant:"success",children:[jsxRuntime.jsx(HardHat,{className:"h-3 w-3 mr-1"}),"Open To Work"]}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"}),q.map((ne,ae)=>jsxRuntime.jsx(Badge,{variant:"outline",children:ne},ae))]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${e.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${e.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:e.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),e.SalesData&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:e.SalesData.SalesYearToDay?formatMoney(e.SalesData.SalesYearToDay):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:e.SalesData.SalesLast3Months?formatMoney(e.SalesData.SalesLast3Months):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:e.SalesData.SalesLast30Days?formatMoney(e.SalesData.SalesLast30Days):"—"})]})]})}),(o||l||e.PublicResourcesLink||M&&f&&e.ManufacturerId)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[o&&o,M&&f&&e.ManufacturerId&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{size:"icon",onClick:()=>R(!0),disabled:_,children:_?jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):jsxRuntime.jsx(Download,{className:"h-4 w-4"})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Email Product List"})})]})}),e.PublicResourcesLink&&jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:e.PublicResourcesLink,target:"_blank",children:jsxRuntime.jsx(Button$1,{size:"icon",children:jsxRuntime.jsx(HardDriveDownload,{className:"h-4 w-4"})})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"Public Resources Link"})})]})})]}),l&&jsxRuntime.jsx("div",{children:l})]}),jsxRuntime.jsx(Dialog,{open:S,onOpenChange:R,children:jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Request Universal Product List"}),jsxRuntime.jsx(DialogDescription,{children:"Enter the email address where you would like to receive the report."})]}),jsxRuntime.jsxs("div",{className:"py-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",value:C,onChange:ne=>E(ne.target.value),placeholder:"your@email.com",className:"mt-2"})]}),jsxRuntime.jsx(DialogDescription,{children:"The report will take around 5 minutes to generate."}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>R(!1),children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:Q,disabled:!C||_,children:_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):"Send Report"})]})]})})]})}function ProductInventoryButton({applicationId:e,randmarSku:t,inventory:n,buttonSize:o="default",buttonClassName:l}){var Ne;const d=React.useRef(null),f=useIntersectionObserver({elementRef:d,threshold:.1,rootMargin:"100px",freezeOnceVisible:!0}),{toast:g}=useToast(),[b,_]=React.useState(!1),[S,R]=React.useState(!1),[C,E]=React.useState(!1),{data:A,isLoading:M,isFetching:I}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e},{skip:!e||!f}),{data:j,isLoading:q,isFetching:Q}=useGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery({routeApplicationId:e,randmarSku:t,withSpecification:!1},{skip:!!n||!f}),[te]=usePutV4ResellerByRouteResellerIdProductAndRandmarSkuRequisitionMutation(),F=n??((Ne=j==null?void 0:j.Distribution)==null?void 0:Ne.Inventory);React.useEffect(()=>{_(!1)},[t]);const{inventoryQuantity:V,totalIncomingQuantity:ne}=React.useMemo(()=>{if(!F||F.length===0)return{inventoryQuantity:0,totalIncomingQuantity:0};const oe=F.reduce((Ae,je)=>Ae+(je.AvailableQuantity||0),0),$e=F.reduce((Ae,je)=>Ae+(je.PurchaseOrderQuantity||0),0);return{inventoryQuantity:oe,totalIncomingQuantity:$e}},[F]);if(M||I||q||Q)return jsxRuntime.jsx("div",{ref:d,children:jsxRuntime.jsx(Skeleton,{className:cn("h-10 w-36 rounded-md",l)})});const se=()=>{C||!(A!=null&&A.IsReseller)||(E(!0),te({routeResellerId:e??"",randmarSku:t??""}).then(oe=>{oe.error||oe.data===!1?g({title:"Warning",description:"Reorder is pending or requires manual approval. Contact the Randmar team for details.",variant:"warning"}):g({title:"Success",description:"Qualification successfully submitted.",variant:"success"}),R(!1)}).catch(oe=>{console.error(oe),g({title:"Error",description:"Error submitting your qualification.",variant:"destructive"})}).finally(()=>{E(!1)}))};if(!F)return jsxRuntime.jsx("div",{ref:d,children:jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx("span",{tabIndex:0,children:jsxRuntime.jsxs(Button$1,{disabled:!0,size:o,variant:"outline",className:cn("text-sm",l),children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),"No data"]})})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"No inventory data could be found for this product."})})]})})});if(A!=null&&A.IsReseller&&V<=0&&ne<=0)return jsxRuntime.jsx("div",{ref:d,children:jsxRuntime.jsxs(Dialog,{open:S,onOpenChange:R,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"outline",size:o,className:cn("text-sm reseller-theme text-primary",l),children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),"Request to stock"]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-md",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsx(DialogTitle,{children:"Request to stock"})}),jsxRuntime.jsx("p",{className:"py-4",children:"Are you sure you want to request this product to be stocked?"}),jsxRuntime.jsxs("div",{className:"flex justify-end gap-2",children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>R(!1),disabled:C,children:"Cancel"}),jsxRuntime.jsx(Button$1,{onClick:se,disabled:C,children:C?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Requesting..."]}):"Confirm"})]})]})]})});const Oe=V<=0&&ne>0;return jsxRuntime.jsx("div",{ref:d,children:jsxRuntime.jsxs(Dialog,{open:b,onOpenChange:_,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"outline",size:o,className:cn("text-sm",Oe?"manufacturer-theme text-primary":V>0?"text-green-700":"text-red-700",l),children:[jsxRuntime.jsx(Warehouse,{size:"16",className:"mr-2"}),Oe?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[formatNumber(ne)," Incoming"]}):V>0?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[formatNumber(V)," in stock"]}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:"Out of stock"})]})}),jsxRuntime.jsxs(DialogContent,{className:"max-w-4xl",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{className:"flex items-center",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2",size:18}),"Inventory Information"]})}),jsxRuntime.jsx(ProductInventoryGrid,{inventory:F})]})]})})}function OrdersCard({applicationId:e,orders:t=null,loading:n=!1,title:o="Order Details"}){const l=React.useMemo(()=>[{accessorKey:"OrderNumber",header:"Order Number",cell:({row:g})=>g.original.OrderNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/GeneralDocument/${g.original.OrderNumber}`,className:"font-medium text-primary hover:underline",children:g.original.OrderNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for order ",g.original.OrderNumber]})})]})}):"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"DocumentNumber",header:"Document Number",cell:({row:g})=>g.original.DocumentNumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"DocumentDate",header:"Document Date",cell:({row:g})=>formatYYYYMMDDIntToDateString(g.original.DocumentDate),enableSorting:!0,enableFiltering:!1},{accessorKey:"PONumber",header:"PO Number",cell:({row:g})=>g.original.PONumber??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"WarehouseCode",header:"Warehouse",cell:({row:g})=>g.original.WarehouseCode??"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"MPN",header:"MPN",cell:({row:g})=>g.original.MPN?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Product/${g.original.MPN}`,className:"font-medium text-primary hover:underline",children:g.original.MPN})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for MPN ",g.original.MPN]})})]})}):"N/A",enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:g})=>g.original.Quantity??"N/A",enableSorting:!0,enableFiltering:!1},{accessorKey:"ShipToName",header:"Name",cell:({row:g})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:g.original.ShipToName??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:g})=>g.original.UnitPrice?formatMoney(g.original.UnitPrice):"N/A",enableSorting:!0,enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:g})=>jsxRuntime.jsx("div",{className:"flex space-x-2",children:jsxRuntime.jsx(ProductInventoryButton,{applicationId:e,randmarSku:g.original.RandmarSKU??"",buttonSize:"sm"})})}],[e]),d=React.useMemo(()=>{const g={};if(t){const b=Array.from(new Set(t.map(A=>A.WarehouseCode).filter(A=>A!=null)));g.WarehouseCode=b;const _=Array.from(new Set(t.map(A=>A.ShipToName).filter(A=>A!=null)));g.ShipToName=_;const S=Array.from(new Set(t.map(A=>A.DocumentNumber).filter(A=>A!=null)));g.DocumentNumber=S;const R=Array.from(new Set(t.map(A=>A.OrderNumber).filter(A=>A!=null)));g.OrderNumber=R;const C=Array.from(new Set(t.map(A=>A.PONumber).filter(A=>A!=null)));g.PONumber=C;const E=Array.from(new Set(t.map(A=>A.MPN).filter(A=>A!=null)));g.MPN=E}return g},[t]),f=t||[];return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:o})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:l,data:f,uniqueValues:d})})]})}function ResellerOverview({appID:e,reseller:t,readonly:n,userEmail:o,isSuperAdmin:l,withoutReports:d=!1}){var q,Q,te,F;const{data:f,isLoading:g,isError:b}=useGetV4PartnerByApplicationIdAccountResellerQuery({applicationId:e??"",withSpecification:!0},{skip:!!t}),[_,S]=React.useState({publicInfo:{hasUnsavedChanges:!1}}),R=React.useCallback(()=>n?!1:_.publicInfo.hasUnsavedChanges,[n,_]),C=React.useCallback((V,ne)=>{S(ae=>{var se;return((se=ae[V])==null?void 0:se.hasUnsavedChanges)!==ne.hasUnsavedChanges?{...ae,[V]:ne}:ae})},[]),{NavigationGuardDialog:E}=useRouterNavigationGuard(R),A=t??f,M=!n||!!(A!=null&&A.Statement)&&(A.Statement.Total??0)>0,I=(A==null?void 0:A.QualifiedManufacturers)??[],j=(A==null?void 0:A.Qualifications)??[];return jsxRuntime.jsxs("div",{className:"@container",children:[b?jsxRuntime.jsx(Card,{className:"p-6",children:jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(CircleAlert,{className:"h-4 w-4"}),jsxRuntime.jsx(AlertTitle,{children:"Error"}),jsxRuntime.jsx(AlertDescription,{children:"There was an error loading your reseller information. Please try again later."})]})}):jsxRuntime.jsxs("div",{className:"space-y-6 mb-6",children:[jsxRuntime.jsx(SalesSummary,{fiscalYearMonthStart:(A==null?void 0:A.FiscalYearMonthStart)||1,salesData:A==null?void 0:A.SalesData,isLoading:g}),jsxRuntime.jsxs("div",{className:"grid @lg:grid-cols-2 gap-6",children:[jsxRuntime.jsx(SalesChartCard,{statistics:(A==null?void 0:A.SalesStatistics)??[],loading:g}),jsxRuntime.jsx(OrderCategories,{openOrders:(A==null?void 0:A.ActiveOrderDetails)??[],isLoading:g}),M&&jsxRuntime.jsx(BillingCard,{appID:e,reseller:A||{},withoutReports:d,isLoading:g,userEmail:o,isSuperAdmin:l}),jsxRuntime.jsx(PublicInfo,{reseller:A||{},appID:e??"",isLoading:g,readonly:n,onUnsavedChanges:V=>C("publicInfo",{hasUnsavedChanges:V})}),jsxRuntime.jsx(AccountTier,{isSuperAdmin:l,readonly:n,reseller:A||{},appID:e??"",isLoading:g})]}),g||I.length>0?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{children:"Manufacturers you are qualified for"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx("div",{className:"grid @lg:grid-cols-2 gap-4",children:g?Array.from({length:2}).map((V,ne)=>jsxRuntime.jsx(ManufacturerCard,{loading:!0},ne)):I.map(V=>jsxRuntime.jsx(ManufacturerCard,{manufacturer:V,link:`https://dashboard.randmar.io/${e}/Partner/${V.ManufacturerId}`},V.ManufacturerId))})})]}):j.length>0&&jsxRuntime.jsx(ResellerQualificationsCard,{qualifications:j}),(((q=A==null?void 0:A.Opportunities)==null?void 0:q.length)??0)>0&&jsxRuntime.jsx(OpportunitiesTable,{applicationId:e,opportunities:A==null?void 0:A.Opportunities,loading:g}),(((Q=A==null?void 0:A.ActiveOrderDetails)==null?void 0:Q.length)??0)>0&&jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Active Orders",orders:A==null?void 0:A.ActiveOrderDetails,loading:g}),(((te=A==null?void 0:A.CompletedOrderDetails)==null?void 0:te.length)??0)>0&&jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Completed Orders",orders:A==null?void 0:A.CompletedOrderDetails,loading:g}),(((F=A==null?void 0:A.Returns)==null?void 0:F.length)??0)>0&&jsxRuntime.jsx(ReturnsTable,{applicationId:e,returns:A==null?void 0:A.Returns,loading:g}),!d&&jsxRuntime.jsx(ReportsSection,{appID:e,userEmail:o,isLoading:g})]}),jsxRuntime.jsx(E,{})]})}const alertVariants=cva("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",success:"border-green-500/50 bg-green-50 text-green-700 dark:border-green-500 dark:bg-green-950 dark:text-green-400 [&>svg]:text-green-500",warning:"border-yellow-500/50 bg-yellow-50 text-yellow-700 dark:border-yellow-500 dark:bg-yellow-950 dark:text-yellow-400 [&>svg]:text-yellow-500",info:"border-blue-500/50 bg-blue-50 text-blue-700 dark:border-blue-500 dark:bg-blue-950 dark:text-blue-400 [&>svg]:text-blue-500"}},defaultVariants:{variant:"default"}}),Alert=React__namespace.forwardRef(({className:e,variant:t,...n},o)=>jsxRuntime.jsx("div",{ref:o,role:"alert",className:cn(alertVariants({variant:t}),e),...n}));Alert.displayName="Alert";const AlertTitle=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("h5",{ref:n,className:cn("mb-1 font-medium leading-none tracking-tight",e),...t}));AlertTitle.displayName="AlertTitle";const AlertDescription=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("div",{ref:n,className:cn("text-sm [&_p]:leading-relaxed",e),...t}));AlertDescription.displayName="AlertDescription";/**
1203
1198
  * table-core
1204
1199
  *
1205
1200
  * Copyright (c) TanStack
@@ -1220,11 +1215,11 @@ $10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full sh
1220
1215
  * LICENSE.md file in the root directory of this source tree.
1221
1216
  *
1222
1217
  * @license MIT
1223
- */function flexRender(e,t){return e?isReactComponent(e)?React__namespace.createElement(e,t):e:null}function isReactComponent(e){return isClassComponent(e)||typeof e=="function"||isExoticComponent(e)}function isClassComponent(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function isExoticComponent(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function useReactTable(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=React__namespace.useState(()=>({current:createTable(t)})),[o,l]=React__namespace.useState(()=>n.current.initialState);return n.current.setOptions(d=>({...d,...e,state:{...o,...e.state},onStateChange:f=>{l(f),e.onStateChange==null||e.onStateChange(f)}})),n.current}function DataTable({columns:e,data:t,uniqueValues:n,tableClass:o,loading:l,initialSort:d}){var I;const[f,g]=React.useState(d??[]),[b,_]=React.useState([]),[S,R]=React.useState({pageIndex:0,pageSize:10}),[C,E]=React.useState(null),A=useReactTable({data:l?[]:t,columns:e,getCoreRowModel:getCoreRowModel(),onSortingChange:g,getSortedRowModel:getSortedRowModel(),onColumnFiltersChange:_,getFilteredRowModel:getFilteredRowModel(),getPaginationRowModel:getPaginationRowModel(),onPaginationChange:R,state:{sorting:f,columnFilters:b,pagination:S},manualPagination:l,manualSorting:l,manualFiltering:l}),M=(j,q)=>{j.toggleSorting(q),E(null)};return l?jsxRuntime.jsxs("div",{className:"@container space-y-4",children:[jsxRuntime.jsx("div",{className:`rounded-md border ${o??""}`,children:jsxRuntime.jsxs(Table,{children:[jsxRuntime.jsx(TableHeader,{children:jsxRuntime.jsx(TableRow,{children:e.map((j,q)=>jsxRuntime.jsx(TableHead,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-full"})},`skeleton-header-${q}`))})}),jsxRuntime.jsx(TableBody,{children:Array.from({length:S.pageSize}).map((j,q)=>jsxRuntime.jsx(TableRow,{children:e.map((Q,te)=>jsxRuntime.jsx(TableCell,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-full"})},`skeleton-cell-${q}-${te}`))},`skeleton-row-${q}`))})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 @[35rem]:flex-row @[35rem]:justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-[110px]"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-[70px]"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"hidden h-8 w-8 lg:flex"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-8"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-8"})]}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8"}),jsxRuntime.jsx(Skeleton,{className:"hidden h-8 w-8 lg:flex"})]})]})]}):jsxRuntime.jsxs("div",{className:"@container space-y-4",children:[jsxRuntime.jsxs(ScrollArea,{className:`rounded-md border ${o??""}`,children:[jsxRuntime.jsxs(Table,{children:[jsxRuntime.jsx(TableHeader,{children:A.getHeaderGroups().map(j=>jsxRuntime.jsx(TableRow,{children:j.headers.map(q=>{var Q;return jsxRuntime.jsx(TableHead,{children:q.isPlaceholder?null:q.column.getCanSort()||q.column.getCanFilter()?jsxRuntime.jsxs(Popover,{open:C===q.id,onOpenChange:te=>E(te?q.id:null),children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"ghost",className:"pl-0",children:[flexRender(q.column.columnDef.header,q.getContext()),q.column.getIsFiltered()?jsxRuntime.jsx(Filter,{className:"ml-2 h-4 w-4"}):q.column.getIsSorted()==="asc"?jsxRuntime.jsx(ArrowUp,{className:"ml-2 h-4 w-4"}):q.column.getIsSorted()==="desc"?jsxRuntime.jsx(ArrowDown,{className:"ml-2 h-4 w-4"}):jsxRuntime.jsx(ArrowUpDown,{className:"ml-2 h-4 w-4"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56",children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[q.column.getCanSort()&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button$1,{variant:"ghost",className:"w-full justify-start",onClick:()=>M(q.column,!1),children:[jsxRuntime.jsx(ArrowUp,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),jsxRuntime.jsxs(Button$1,{variant:"ghost",className:"w-full justify-start",onClick:()=>M(q.column,!0),children:[jsxRuntime.jsx(ArrowDown,{className:"mr-2 h-4 w-4"}),"Sort Descending"]})]}),q.column.getCanFilter()&&jsxRuntime.jsx("div",{className:"px-2 py-1",children:n[q.column.id]?jsxRuntime.jsxs(Select$1,{onValueChange:te=>q.column.setFilterValue(te==="all"?void 0:[te]),children:[jsxRuntime.jsx(SelectTrigger,{children:jsxRuntime.jsx(SelectValue,{placeholder:`Filter ${q.column.columnDef.header}...`})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"all",children:"All"}),(Q=n[q.column.id])==null?void 0:Q.map(te=>jsxRuntime.jsx(SelectItem,{value:te||"empty",children:te||"(Empty)"},te))]})]}):jsxRuntime.jsx(Input,{placeholder:`Filter ${q.column.columnDef.header}...`,value:q.column.getFilterValue()??"",onChange:te=>q.column.setFilterValue(te.target.value),className:"w-full"})})]})})]}):jsxRuntime.jsx("div",{className:"py-2 px-4",children:flexRender(q.column.columnDef.header,q.getContext())})},q.id)})},j.id))}),jsxRuntime.jsx(TableBody,{children:(I=A.getRowModel().rows)!=null&&I.length?A.getRowModel().rows.map(j=>jsxRuntime.jsx(TableRow,{"data-state":j.getIsSelected()&&"selected",children:j.getVisibleCells().map(q=>jsxRuntime.jsx(TableCell,{children:flexRender(q.column.columnDef.cell,q.getContext())},q.id))},j.id)):jsxRuntime.jsx(TableRow,{children:jsxRuntime.jsx(TableCell,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]}),jsxRuntime.jsx(ScrollBar,{orientation:"horizontal"})]}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 @[35rem]:flex-row @[35rem]:justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),jsxRuntime.jsxs(Select$1,{value:`${A.getState().pagination.pageSize}`,onValueChange:j=>{A.setPageSize(Number(j))},children:[jsxRuntime.jsx(SelectTrigger,{className:"h-8 w-[70px]",children:jsxRuntime.jsx(SelectValue,{asChild:!0,children:jsxRuntime.jsx("span",{children:A.getState().pagination.pageSize})})}),jsxRuntime.jsx(SelectContent,{side:"top",children:[10,20,30,40,50].map(j=>jsxRuntime.jsx(SelectItem,{value:`${j}`,children:jsxRuntime.jsx("span",{children:j})},j))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsxs(Button$1,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>A.setPageIndex(0),disabled:!A.getCanPreviousPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to first page"}),jsxRuntime.jsx(ChevronsLeft,{className:"h-4 w-4"})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>A.previousPage(),disabled:!A.getCanPreviousPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to previous page"}),jsxRuntime.jsx(ChevronLeft,{className:"h-4 w-4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Page"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:A.getState().pagination.pageIndex+1}),jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"of"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:A.getPageCount()})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>A.nextPage(),disabled:!A.getCanNextPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to next page"}),jsxRuntime.jsx(ChevronRight,{className:"h-4 w-4"})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>A.setPageIndex(A.getPageCount()-1),disabled:!A.getCanNextPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to last page"}),jsxRuntime.jsx(ChevronsRight,{className:"h-4 w-4"})]})]})]})]})}function PartnerCard({account:e,action:t,loading:n=!1,className:o,withAbout:l=!1,withVoice:d=!0}){const[f,g]=React.useState(!1),[b,_]=React.useState(!0),[S,R]=React.useState(null),[C,E]=React.useState(!1),A=React.useMemo(()=>e!=null&&e.ApplicationId?{videoUrl:`https://api.randmar.io/V4/Partner/${e.ApplicationId}/Account/Video`,videoExistsUrl:`https://api.randmar.io/V4/Partner/${e.ApplicationId}/Account/Video/Exists`}:null,[e==null?void 0:e.ApplicationId]);React.useEffect(()=>{if(!A||n)return;R(null);const I=async()=>{try{const q=await fetch(A.videoExistsUrl);if(q.ok){const Q=await q.text();g(Q.toLowerCase()==="true")}else throw new Error(`Failed to check video: ${q.status}`)}catch(q){console.error("Failed to check if video exists:",q),g(!1)}};(async()=>{I()})()},[A,n]);const M=()=>{_(!1)};return n||!e?jsxRuntime.jsxs(Card,{className:`flex flex-col h-full ${o}`,children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16"}),jsxRuntime.jsx(Skeleton,{className:"h-3 w-16"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-48 mt-1"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"})]}),l&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-full"})]}),d&&jsxRuntime.jsx("div",{className:"p-3 bg-slate-50 rounded-md",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @lg:grid-cols-3 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]})]})})]})}),jsxRuntime.jsxs(CardFooter,{className:"px-6 py-4 flex justify-between gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-48"})]})]}):jsxRuntime.jsxs(Card,{className:`flex flex-col h-full ${o}`,children:[jsxRuntime.jsx(PartnerCardHeader,{type:"Partner",applicationId:e.ApplicationId,publicName:e.PublicName}),jsxRuntime.jsxs(CardContent,{className:"pb-2 flex-grow",children:[S&&jsxRuntime.jsx("div",{className:"text-red-500 mb-4 text-sm",role:"alert",children:S}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[(e.IsManufacturer||e.IsReseller||e.IsSalesAgency)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.IsManufacturer&&jsxRuntime.jsx(Badge,{className:"manufacturer-theme",children:"Manufacturer"}),e.IsReseller&&jsxRuntime.jsx(Badge,{className:"reseller-theme",children:"Reseller"}),e.IsSalesAgency&&jsxRuntime.jsx(Badge,{children:"Agency"})]}),l&&e.About&&jsxRuntime.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:e.About??""}}),d&&jsxRuntime.jsx("div",{className:"p-3 bg-slate-50 rounded-md",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @lg:grid-cols-3 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Name"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.VoiceName??"Regular"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Style"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.VoiceStyle??"Regular"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Scene Name"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.SceneName??"N/A"})]})]})})]})]}),jsxRuntime.jsxs(CardFooter,{className:"px-6 py-4 flex justify-between gap-2 mt-auto",children:[f&&A?jsxRuntime.jsxs(Dialog,{open:C,onOpenChange:E,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"flex items-center gap-2",children:[jsxRuntime.jsx(Video,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Watch Video"})]})}),jsxRuntime.jsxs(DialogContent,{className:"@sm:max-w-[360px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{children:[e.PublicName," Video"]})}),jsxRuntime.jsxs("div",{className:"w-full h-[640px] rounded-md overflow-hidden",children:[b&&jsxRuntime.jsx(Skeleton,{className:"w-full h-full"}),jsxRuntime.jsx("video",{src:A.videoUrl,controls:!0,preload:"auto",playsInline:!0,autoPlay:!0,"aria-label":`Video for ${e.PublicName}`,className:`w-full h-full object-cover ${b?"invisible":"visible"}`,style:{objectPosition:"center",imageRendering:"auto"},onLoadedData:M,onError:()=>_(!1)})]})]})]}):jsxRuntime.jsx("div",{}),t||jsxRuntime.jsxs(Button$1,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Partner Dashboard"]})]})]})}function ResellerCard({reseller:e,link:t,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1}){var b,_;if(d||!e)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsx("div",{className:"flex",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const f=[e.City,e.Province,e.Country].filter(Boolean),g=f.length>0?f.join(", "):"Location not provided";return jsxRuntime.jsxs(Card,{className:"reseller-theme flex flex-col h-full",children:[jsxRuntime.jsx(PartnerCardHeader,{type:"Reseller",applicationId:e.ResellerId,publicName:e.PublicName,name:e.Name,location:g,link:t,linkNewTab:n,children:jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:e.SalesStatistics&&e.SalesStatistics.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(SalesChart,{statistics:e.SalesStatistics,size:"mini"})})})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((b=e.Qualification)!=null&&b.QualificationId)&&((_=e.Qualification)==null?void 0:_.QualificationId)!=="Suspended"||!!e.OnHold&&e.OnHold!==0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${e.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${e.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:e.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),(e==null?void 0:e.SalesData)&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:e!=null&&e.SalesData.SalesYearToDay?formatMoney(e==null?void 0:e.SalesData.SalesYearToDay):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:e!=null&&e.SalesData.SalesLast3Months?formatMoney(e==null?void 0:e.SalesData.SalesLast3Months):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:e!=null&&e.SalesData.SalesLast30Days?formatMoney(e==null?void 0:e.SalesData.SalesLast30Days):"—"})]})]})}),(o||l)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:o&&o}),l&&jsxRuntime.jsx("div",{children:l})]})]})}const Table=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("div",{className:"relative w-full overflow-auto",children:jsxRuntime.jsx("table",{ref:n,className:cn("w-full caption-bottom text-sm",e),...t})}));Table.displayName="Table";const TableHeader=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("thead",{ref:n,className:cn("[&_tr]:border-b",e),...t}));TableHeader.displayName="TableHeader";const TableBody=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("tbody",{ref:n,className:cn("[&_tr:last-child]:border-0",e),...t}));TableBody.displayName="TableBody";const TableFooter=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("tfoot",{ref:n,className:cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));TableFooter.displayName="TableFooter";const TableRow=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("tr",{ref:n,className:cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));TableRow.displayName="TableRow";const TableHead=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("th",{ref:n,className:cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t,children:React__namespace.isValidElement(t.children)&&t.children.type==="span"?t.children:jsxRuntime.jsx("span",{children:t.children})}));TableHead.displayName="TableHead";const TableCell=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("td",{ref:n,className:cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t,children:React__namespace.isValidElement(t.children)&&t.children.type==="span"?t.children:jsxRuntime.jsx("span",{children:t.children})}));TableCell.displayName="TableCell";const TableCaption=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("caption",{ref:n,className:cn("mt-4 text-sm text-muted-foreground",e),...t}));TableCaption.displayName="TableCaption";const FEEDBACK_MAX_LENGTH=800,FEEDBACK_INTENT_OPTIONS=[{value:"idea",label:"Feature request",description:"Capabilities that would unlock additional value."},{value:"issue",label:"Defect or reliability issue",description:"Unexpected behavior or something that blocks work."},{value:"praise",label:"Positive impact",description:"Outcomes that are working well and should be preserved."},{value:"other",label:"General feedback",description:"Context or directional insight not captured above."}],FEEDBACK_TAGS=["Merchandising","Logistics","Data & Reporting","Compliance","Integrations"],FEEDBACK_GUIDELINES=["Summarize the scenario or objective.","Share the impact to your team or clients.","Note any timelines or priority considerations."],Topbar=React.forwardRef(({appID:e,onSignOut:t,handleValidSearch:n,rightMenu:o,searchPlaceholder:l},d)=>{var $e;const[f,g]=React.useState(""),[b,_]=React.useState(!1),[S,R]=React.useState(""),[C,E]=React.useState(""),[A,M]=React.useState(!1),[I,j]=React.useState(null),[q,Q]=React.useState(()=>typeof window<"u"?window.location.href:""),te=reactRouterDom.useLocation(),{toast:F}=useToast(),[V,{isLoading:ne}]=usePostV4PartnerByApplicationIdAccountFeedbackMutation(),ae=S.length,se=React.useMemo(()=>{var Ae;return((Ae=FEEDBACK_INTENT_OPTIONS.find(je=>je.value===I))==null?void 0:Ae.label)??""},[I]);React.useEffect(()=>{const je=new URLSearchParams(te.search).get("q");je&&g(je)},[te.search]),React.useEffect(()=>{Q(typeof window<"u"?window.location.href:`${te.pathname}${te.search}${te.hash}`)},[te]),React.useEffect(()=>{A||E("")},[A]);const Oe=()=>{const Ae=f.trim();if(!Ae||Ae.length<2){F({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}n(Ae)},Ne=Ae=>{Ae.key==="Enter"&&Oe()},oe=async Ae=>{Ae.preventDefault();const je=S.trim(),Be=C.trim();if(!je){F({title:"Add feedback before submitting",description:"Let us know what could be better so we can help.",variant:"destructive"});return}if(A&&!Be){F({title:"Add your email to get a reply",description:"Toggle follow-ups off or include an email so we know where to reach you.",variant:"destructive"});return}const qe=[se?`Focus: ${se}`:null,`Page: ${q||(typeof window<"u"?window.location.href:"")}`].filter(Boolean).join(`
1218
+ */function flexRender(e,t){return e?isReactComponent(e)?React__namespace.createElement(e,t):e:null}function isReactComponent(e){return isClassComponent(e)||typeof e=="function"||isExoticComponent(e)}function isClassComponent(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function isExoticComponent(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function useReactTable(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=React__namespace.useState(()=>({current:createTable(t)})),[o,l]=React__namespace.useState(()=>n.current.initialState);return n.current.setOptions(d=>({...d,...e,state:{...o,...e.state},onStateChange:f=>{l(f),e.onStateChange==null||e.onStateChange(f)}})),n.current}function DataTable({columns:e,data:t,uniqueValues:n,tableClass:o,loading:l,initialSort:d}){var I;const[f,g]=React.useState(d??[]),[b,_]=React.useState([]),[S,R]=React.useState({pageIndex:0,pageSize:10}),[C,E]=React.useState(null),A=useReactTable({data:l?[]:t,columns:e,getCoreRowModel:getCoreRowModel(),onSortingChange:g,getSortedRowModel:getSortedRowModel(),onColumnFiltersChange:_,getFilteredRowModel:getFilteredRowModel(),getPaginationRowModel:getPaginationRowModel(),onPaginationChange:R,state:{sorting:f,columnFilters:b,pagination:S},manualPagination:l,manualSorting:l,manualFiltering:l}),M=(j,q)=>{j.toggleSorting(q),E(null)};return l?jsxRuntime.jsxs("div",{className:"@container space-y-4",children:[jsxRuntime.jsx("div",{className:`rounded-md border ${o??""}`,children:jsxRuntime.jsxs(Table,{children:[jsxRuntime.jsx(TableHeader,{children:jsxRuntime.jsx(TableRow,{children:e.map((j,q)=>jsxRuntime.jsx(TableHead,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-full"})},`skeleton-header-${q}`))})}),jsxRuntime.jsx(TableBody,{children:Array.from({length:S.pageSize}).map((j,q)=>jsxRuntime.jsx(TableRow,{children:e.map((Q,te)=>jsxRuntime.jsx(TableCell,{children:jsxRuntime.jsx(Skeleton,{className:"h-6 w-full"})},`skeleton-cell-${q}-${te}`))},`skeleton-row-${q}`))})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 @[35rem]:flex-row @[35rem]:justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-[110px]"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-[70px]"})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"hidden h-8 w-8 lg:flex"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8"}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-12"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-8"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-8"})]}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8"}),jsxRuntime.jsx(Skeleton,{className:"hidden h-8 w-8 lg:flex"})]})]})]}):jsxRuntime.jsxs("div",{className:"@container space-y-4",children:[jsxRuntime.jsxs(ScrollArea,{className:`rounded-md border ${o??""}`,children:[jsxRuntime.jsxs(Table,{children:[jsxRuntime.jsx(TableHeader,{children:A.getHeaderGroups().map(j=>jsxRuntime.jsx(TableRow,{children:j.headers.map(q=>{var Q;return jsxRuntime.jsx(TableHead,{children:q.isPlaceholder?null:q.column.getCanSort()||q.column.getCanFilter()?jsxRuntime.jsxs(Popover,{open:C===q.id,onOpenChange:te=>E(te?q.id:null),children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"ghost",className:"pl-0",children:[flexRender(q.column.columnDef.header,q.getContext()),q.column.getIsFiltered()?jsxRuntime.jsx(Filter,{className:"ml-2 h-4 w-4"}):q.column.getIsSorted()==="asc"?jsxRuntime.jsx(ArrowUp,{className:"ml-2 h-4 w-4"}):q.column.getIsSorted()==="desc"?jsxRuntime.jsx(ArrowDown,{className:"ml-2 h-4 w-4"}):jsxRuntime.jsx(ArrowUpDown,{className:"ml-2 h-4 w-4"})]})}),jsxRuntime.jsx(PopoverContent,{className:"w-56",children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[q.column.getCanSort()&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button$1,{variant:"ghost",className:"w-full justify-start",onClick:()=>M(q.column,!1),children:[jsxRuntime.jsx(ArrowUp,{className:"mr-2 h-4 w-4"}),"Sort Ascending"]}),jsxRuntime.jsxs(Button$1,{variant:"ghost",className:"w-full justify-start",onClick:()=>M(q.column,!0),children:[jsxRuntime.jsx(ArrowDown,{className:"mr-2 h-4 w-4"}),"Sort Descending"]})]}),q.column.getCanFilter()&&jsxRuntime.jsx("div",{className:"px-2 py-1",children:n[q.column.id]?jsxRuntime.jsxs(Select$1,{onValueChange:te=>q.column.setFilterValue(te==="all"?void 0:[te]),children:[jsxRuntime.jsx(SelectTrigger,{children:jsxRuntime.jsx(SelectValue,{placeholder:`Filter ${q.column.columnDef.header}...`})}),jsxRuntime.jsxs(SelectContent,{children:[jsxRuntime.jsx(SelectItem,{value:"all",children:"All"}),(Q=n[q.column.id])==null?void 0:Q.map(te=>jsxRuntime.jsx(SelectItem,{value:te||"empty",children:te||"(Empty)"},te))]})]}):jsxRuntime.jsx(Input,{placeholder:`Filter ${q.column.columnDef.header}...`,value:q.column.getFilterValue()??"",onChange:te=>q.column.setFilterValue(te.target.value),className:"w-full"})})]})})]}):jsxRuntime.jsx("div",{className:"py-2 px-4",children:flexRender(q.column.columnDef.header,q.getContext())})},q.id)})},j.id))}),jsxRuntime.jsx(TableBody,{children:(I=A.getRowModel().rows)!=null&&I.length?A.getRowModel().rows.map(j=>jsxRuntime.jsx(TableRow,{"data-state":j.getIsSelected()&&"selected",children:j.getVisibleCells().map(q=>jsxRuntime.jsx(TableCell,{children:flexRender(q.column.columnDef.cell,q.getContext())},q.id))},j.id)):jsxRuntime.jsx(TableRow,{children:jsxRuntime.jsx(TableCell,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]}),jsxRuntime.jsx(ScrollBar,{orientation:"horizontal"})]}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center gap-4 @[35rem]:flex-row @[35rem]:justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Rows per page"}),jsxRuntime.jsxs(Select$1,{value:`${A.getState().pagination.pageSize}`,onValueChange:j=>{A.setPageSize(Number(j))},children:[jsxRuntime.jsx(SelectTrigger,{className:"h-8 w-[70px]",children:jsxRuntime.jsx(SelectValue,{asChild:!0,children:jsxRuntime.jsx("span",{children:A.getState().pagination.pageSize})})}),jsxRuntime.jsx(SelectContent,{side:"top",children:[10,20,30,40,50].map(j=>jsxRuntime.jsx(SelectItem,{value:`${j}`,children:jsxRuntime.jsx("span",{children:j})},j))})]})]}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsxs(Button$1,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>A.setPageIndex(0),disabled:!A.getCanPreviousPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to first page"}),jsxRuntime.jsx(ChevronsLeft,{className:"h-4 w-4"})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>A.previousPage(),disabled:!A.getCanPreviousPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to previous page"}),jsxRuntime.jsx(ChevronLeft,{className:"h-4 w-4"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"Page"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:A.getState().pagination.pageIndex+1}),jsxRuntime.jsx("p",{className:"text-sm font-medium",children:"of"}),jsxRuntime.jsx("span",{className:"text-sm font-medium",children:A.getPageCount()})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-8 w-8 p-0",onClick:()=>A.nextPage(),disabled:!A.getCanNextPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to next page"}),jsxRuntime.jsx(ChevronRight,{className:"h-4 w-4"})]}),jsxRuntime.jsxs(Button$1,{variant:"outline",className:"hidden h-8 w-8 p-0 lg:flex",onClick:()=>A.setPageIndex(A.getPageCount()-1),disabled:!A.getCanNextPage(),children:[jsxRuntime.jsx("span",{className:"sr-only",children:"Go to last page"}),jsxRuntime.jsx(ChevronsRight,{className:"h-4 w-4"})]})]})]})]})}function PartnerCard({account:e,action:t,loading:n=!1,className:o,withAbout:l=!1,withVoice:d=!0}){const[f,g]=React.useState(!1),[b,_]=React.useState(!0),[S,R]=React.useState(null),[C,E]=React.useState(!1),A=React.useMemo(()=>e!=null&&e.ApplicationId?{videoUrl:`https://api.randmar.io/V4/Partner/${e.ApplicationId}/Account/Video`,videoExistsUrl:`https://api.randmar.io/V4/Partner/${e.ApplicationId}/Account/Video/Exists`}:null,[e==null?void 0:e.ApplicationId]);React.useEffect(()=>{if(!A||n)return;R(null);const I=async()=>{try{const q=await fetch(A.videoExistsUrl);if(q.ok){const Q=await q.text();g(Q.toLowerCase()==="true")}else throw new Error(`Failed to check video: ${q.status}`)}catch(q){console.error("Failed to check if video exists:",q),g(!1)}};(async()=>{I()})()},[A,n]);const M=()=>{_(!1)};return n||!e?jsxRuntime.jsxs(Card,{className:`flex flex-col h-full ${o}`,children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16"}),jsxRuntime.jsx(Skeleton,{className:"h-3 w-16"})]}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-48 mt-1"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"})]}),l&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-full"})]}),d&&jsxRuntime.jsx("div",{className:"p-3 bg-slate-50 rounded-md",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @lg:grid-cols-3 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]})]})})]})}),jsxRuntime.jsxs(CardFooter,{className:"px-6 py-4 flex justify-between gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-48"})]})]}):jsxRuntime.jsxs(Card,{className:`flex flex-col h-full ${o}`,children:[jsxRuntime.jsx(PartnerCardHeader,{type:"Partner",applicationId:e.ApplicationId,publicName:e.PublicName}),jsxRuntime.jsxs(CardContent,{className:"pb-2 flex-grow",children:[S&&jsxRuntime.jsx("div",{className:"text-red-500 mb-4 text-sm",role:"alert",children:S}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-4",children:[(e.IsManufacturer||e.IsReseller||e.IsSalesAgency)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.IsManufacturer&&jsxRuntime.jsx(Badge,{className:"manufacturer-theme",children:"Manufacturer"}),e.IsReseller&&jsxRuntime.jsx(Badge,{className:"reseller-theme",children:"Reseller"}),e.IsSalesAgency&&jsxRuntime.jsx(Badge,{children:"Agency"})]}),l&&e.About&&jsxRuntime.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:e.About??""}}),d&&jsxRuntime.jsx("div",{className:"p-3 bg-slate-50 rounded-md",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-1 @lg:grid-cols-3 gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Name"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.VoiceName??"Regular"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Voice Style"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.VoiceStyle??"Regular"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Scene Name"}),jsxRuntime.jsx("div",{className:"font-medium",children:e.SceneName??"N/A"})]})]})})]})]}),jsxRuntime.jsxs(CardFooter,{className:"px-6 py-4 flex justify-between gap-2 mt-auto",children:[f&&A?jsxRuntime.jsxs(Dialog,{open:C,onOpenChange:E,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"flex items-center gap-2",children:[jsxRuntime.jsx(Video,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:"Watch Video"})]})}),jsxRuntime.jsxs(DialogContent,{className:"@sm:max-w-[360px]",children:[jsxRuntime.jsx(DialogHeader,{children:jsxRuntime.jsxs(DialogTitle,{children:[e.PublicName," Video"]})}),jsxRuntime.jsxs("div",{className:"w-full h-[640px] rounded-md overflow-hidden",children:[b&&jsxRuntime.jsx(Skeleton,{className:"w-full h-full"}),jsxRuntime.jsx("video",{src:A.videoUrl,controls:!0,preload:"auto",playsInline:!0,autoPlay:!0,"aria-label":`Video for ${e.PublicName}`,className:`w-full h-full object-cover ${b?"invisible":"visible"}`,style:{objectPosition:"center",imageRendering:"auto"},onLoadedData:M,onError:()=>_(!1)})]})]})]}):jsxRuntime.jsx("div",{}),t||jsxRuntime.jsxs(Button$1,{className:"flex items-center gap-2",children:[jsxRuntime.jsx(ExternalLink,{className:"h-4 w-4"}),"Go to Partner Dashboard"]})]})]})}function ResellerCard({reseller:e,link:t,linkNewTab:n=!0,actions:o,mainAction:l,loading:d=!1}){var b,_;if(d||!e)return jsxRuntime.jsxs(Card,{className:"flex flex-col h-full",children:[jsxRuntime.jsx(CardHeader,{className:"flex flex-row items-start justify-between space-y-0 pb-2 pt-4",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-12 rounded-md"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-24 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-40 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-48"})]})]})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsx("div",{className:"flex",children:jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-16 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-14 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-32"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-40"})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-4"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-36"})]})]})]})})}),jsxRuntime.jsxs(CardFooter,{className:"flex justify-between pt-2 gap-2 mt-auto",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-40"})]})]});const f=[e.City,e.Province,e.Country].filter(Boolean),g=f.length>0?f.join(", "):"Location not provided";return jsxRuntime.jsxs(Card,{className:"reseller-theme flex flex-col h-full",children:[jsxRuntime.jsx(PartnerCardHeader,{type:"Reseller",applicationId:e.ResellerId,publicName:e.PublicName,name:e.Name,location:g,link:t,linkNewTab:n,children:jsxRuntime.jsx("div",{className:"flex flex-col items-end gap-2",children:e.SalesStatistics&&e.SalesStatistics.length>0&&jsxRuntime.jsx("div",{className:"h-16 w-24",children:jsxRuntime.jsx(SalesChart,{statistics:e.SalesStatistics,size:"mini"})})})}),jsxRuntime.jsx(CardContent,{className:"pb-2 flex-grow",children:jsxRuntime.jsxs("div",{className:"flex",children:[jsxRuntime.jsxs("div",{className:"flex flex-col flex-1 space-y-2",children:[(!!((b=e.Qualification)!=null&&b.QualificationId)&&((_=e.Qualification)==null?void 0:_.QualificationId)!=="Suspended"||!!e.OnHold&&e.OnHold!==0)&&jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2",children:[jsxRuntime.jsx(QualificationBadge,{qualification:e.Qualification??{}}),!!e.OnHold&&e.OnHold!==0&&jsxRuntime.jsx(Badge,{variant:"warning",children:"On Hold"})]}),jsxRuntime.jsxs("div",{className:"space-y-1 pt-2",children:[e.Phone&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`tel:${e.Phone}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Phone,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Phone})]}),e.PublicEmail&&jsxRuntime.jsxs(reactRouterDom.Link,{to:`mailto:${e.PublicEmail}`,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.PublicEmail})]}),e.Website&&jsxRuntime.jsxs(reactRouterDom.Link,{to:e.Website,target:"_blank",className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(Globe,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.Website})]}),e.CurrencyCode&&jsxRuntime.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[jsxRuntime.jsx(DollarSign,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{children:e.CurrencyCode})]})]})]}),(e==null?void 0:e.SalesData)&&jsxRuntime.jsxs("div",{className:"border-l pl-2 ml-2 flex flex-col text-sm",children:[jsxRuntime.jsx("strong",{className:"",children:"YTD"}),jsxRuntime.jsx("p",{children:e!=null&&e.SalesData.SalesYearToDay?formatMoney(e==null?void 0:e.SalesData.SalesYearToDay):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"3 mo."}),jsxRuntime.jsx("p",{children:e!=null&&e.SalesData.SalesLast3Months?formatMoney(e==null?void 0:e.SalesData.SalesLast3Months):"—"}),jsxRuntime.jsx("strong",{className:"mt-2",children:"30 days"}),jsxRuntime.jsx("p",{children:e!=null&&e.SalesData.SalesLast30Days?formatMoney(e==null?void 0:e.SalesData.SalesLast30Days):"—"})]})]})}),(o||l)&&jsxRuntime.jsxs(CardFooter,{className:"flex pt-2 gap-2 justify-between mt-auto",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2",children:o&&o}),l&&jsxRuntime.jsx("div",{children:l})]})]})}const Table=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("div",{className:"relative w-full overflow-auto",children:jsxRuntime.jsx("table",{ref:n,className:cn("w-full caption-bottom text-sm",e),...t})}));Table.displayName="Table";const TableHeader=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("thead",{ref:n,className:cn("[&_tr]:border-b",e),...t}));TableHeader.displayName="TableHeader";const TableBody=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("tbody",{ref:n,className:cn("[&_tr:last-child]:border-0",e),...t}));TableBody.displayName="TableBody";const TableFooter=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("tfoot",{ref:n,className:cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));TableFooter.displayName="TableFooter";const TableRow=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("tr",{ref:n,className:cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));TableRow.displayName="TableRow";const TableHead=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("th",{ref:n,className:cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t,children:React__namespace.isValidElement(t.children)&&t.children.type==="span"?t.children:jsxRuntime.jsx("span",{children:t.children})}));TableHead.displayName="TableHead";const TableCell=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("td",{ref:n,className:cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t,children:React__namespace.isValidElement(t.children)&&t.children.type==="span"?t.children:jsxRuntime.jsx("span",{children:t.children})}));TableCell.displayName="TableCell";const TableCaption=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("caption",{ref:n,className:cn("mt-4 text-sm text-muted-foreground",e),...t}));TableCaption.displayName="TableCaption";const FEEDBACK_MAX_LENGTH=800,FEEDBACK_INTENT_OPTIONS=[{value:"idea",label:"Feature request",description:"Capabilities that would unlock additional value."},{value:"issue",label:"Defect or reliability issue",description:"Unexpected behavior or something that blocks work."},{value:"praise",label:"Positive impact",description:"Outcomes that are working well and should be preserved."},{value:"other",label:"General feedback",description:"Context or directional insight not captured above."}],Topbar=React.forwardRef(({appID:e,onSignOut:t,handleValidSearch:n,rightMenu:o,searchPlaceholder:l},d)=>{var $e;const[f,g]=React.useState(""),[b,_]=React.useState(!1),[S,R]=React.useState(""),[C,E]=React.useState(""),[A,M]=React.useState(!1),[I,j]=React.useState(null),[q,Q]=React.useState(()=>typeof window<"u"?window.location.href:""),te=reactRouterDom.useLocation(),{toast:F}=useToast(),[V,{isLoading:ne}]=usePostV4PartnerByApplicationIdAccountFeedbackMutation(),ae=S.length,se=React.useMemo(()=>{var Ae;return((Ae=FEEDBACK_INTENT_OPTIONS.find(je=>je.value===I))==null?void 0:Ae.label)??""},[I]);React.useEffect(()=>{const je=new URLSearchParams(te.search).get("q");je&&g(je)},[te.search]),React.useEffect(()=>{Q(typeof window<"u"?window.location.href:`${te.pathname}${te.search}${te.hash}`)},[te]),React.useEffect(()=>{A||E("")},[A]);const Oe=()=>{const Ae=f.trim();if(!Ae||Ae.length<2){F({title:"Enter more characters to search",description:"At least 2 characters are needed to search products.",variant:"destructive",duration:5e3});return}n(Ae)},Ne=Ae=>{Ae.key==="Enter"&&Oe()},oe=async Ae=>{Ae.preventDefault();const je=S.trim(),Be=C.trim();if(!je){F({title:"Add feedback before submitting",description:"Let us know what could be better so we can help.",variant:"destructive"});return}if(A&&!Be){F({title:"Add your email to get a reply",description:"Toggle follow-ups off or include an email so we know where to reach you.",variant:"destructive"});return}const qe=[se?`Focus: ${se}`:null,`Page: ${q||(typeof window<"u"?window.location.href:"")}`].filter(Boolean).join(`
1224
1219
  `),Ve=qe?`${je}
1225
1220
 
1226
1221
  ---
1227
- ${qe}`:je;try{await V({applicationId:e,comment:Ve,emailAddress:Be||void 0}).unwrap(),F({title:"Feedback sent",description:"Thanks for helping us improve."}),_(!1),R(""),E(""),M(!1),j(null)}catch(Le){console.error("Failed to send feedback",Le),F({title:"Feedback could not be sent",description:"Please try again in a moment.",variant:"destructive"})}};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:Oe,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:l??"Search...",className:"w-full pl-8 bg-white text-black",value:f,onChange:Ae=>g(Ae.target.value),onKeyDown:Ne,ref:d},"topbar-search")]})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs(Dialog,{open:b,onOpenChange:_,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{type:"button",variant:"outline",size:"sm",className:"gap-2",children:[jsxRuntime.jsx(MessageSquare,{className:"h-4 w-4"}),"Feedback"]})}),jsxRuntime.jsx(DialogContent,{className:"w-[min(95vw,980px)] max-w-4xl overflow-hidden border border-border/40 bg-background p-0 shadow-[0_35px_120px_rgba(15,23,42,0.45)]",children:jsxRuntime.jsxs("form",{className:"flex max-h-[85vh] flex-col gap-6 overflow-y-auto bg-background p-6 sm:p-8",onSubmit:oe,children:[jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-[32px] bg-gradient-to-br from-slate-950 via-slate-900 to-indigo-950 p-6 text-white shadow-[0_20px_45px_rgba(15,23,42,0.55)] sm:p-8",children:[jsxRuntime.jsxs("div",{className:"pointer-events-none absolute inset-0 opacity-70",children:[jsxRuntime.jsx("div",{className:"absolute -left-14 top-10 h-32 w-32 rounded-full bg-white/10 blur-3xl","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"absolute right-0 top-1/2 h-40 w-40 -translate-y-1/2 rounded-full bg-indigo-400/20 blur-3xl","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-1/3 h-44 w-44 translate-y-1/3 rounded-full bg-sky-300/20 blur-3xl","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-col gap-5",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-xs uppercase tracking-wide text-white/80",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:"w-max border-white/30 bg-white/10 text-white",children:"Partner feedback desk"}),jsxRuntime.jsx("p",{className:"text-white/70",children:"Product & operations review every submission"})]}),jsxRuntime.jsxs(DialogHeader,{className:"space-y-3 text-left text-white",children:[jsxRuntime.jsx(DialogTitle,{className:"text-3xl leading-tight sm:text-4xl",children:"Share your perspective"}),jsxRuntime.jsx(DialogDescription,{className:"text-base text-white/80",children:"Clear context helps us triage, scope, and respond. Please highlight the scenario, desired outcome, and any urgency we should be aware of."})]}),jsxRuntime.jsxs("div",{className:"rounded-2xl border border-white/20 bg-white/5 p-4 text-sm leading-relaxed text-white/90",children:[jsxRuntime.jsxs("p",{className:"flex items-start gap-2 font-semibold",children:[jsxRuntime.jsx(Sparkles,{className:"mt-0.5 h-4 w-4 text-yellow-200"}),"To help us act quickly"]}),jsxRuntime.jsx("ul",{className:"mt-3 space-y-2 text-white/80",children:FEEDBACK_GUIDELINES.map(Ae=>jsxRuntime.jsxs("li",{className:"flex items-start gap-2",children:[jsxRuntime.jsx(CircleCheck,{className:"mt-0.5 h-4 w-4 text-emerald-200"}),jsxRuntime.jsx("span",{children:Ae})]},Ae))})]}),jsxRuntime.jsxs("div",{className:"space-y-2 text-[11px] uppercase tracking-[0.18em] text-white/80",children:[jsxRuntime.jsx("p",{className:"font-semibold tracking-[0.25em] text-white",children:"Common focus areas"}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:FEEDBACK_TAGS.map(Ae=>jsxRuntime.jsx("span",{className:"rounded-full border border-white/30 bg-white/10 px-3 py-1",children:Ae},Ae))})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"space-y-2 rounded-2xl border bg-muted/60 p-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[jsxRuntime.jsx("p",{className:"font-semibold uppercase tracking-wide text-foreground",children:"Select an intent"}),jsxRuntime.jsx("p",{children:I?`Currently tagged as ${se}.`:"Choosing a category routes the note to the right team."})]}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:FEEDBACK_INTENT_OPTIONS.map(Ae=>jsxRuntime.jsx(Button$1,{type:"button",variant:I===Ae.value?"default":"outline",size:"sm",className:cn("rounded-full px-3 text-xs transition-all",I===Ae.value?"shadow-lg shadow-primary/30":"bg-background hover:-translate-y-[1px]"),"aria-pressed":I===Ae.value,onClick:()=>j(je=>je===Ae.value?null:Ae.value),children:Ae.label},Ae.value))}),I&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:($e=FEEDBACK_INTENT_OPTIONS.find(Ae=>Ae.value===I))==null?void 0:$e.description})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"topbar-feedback-message",className:"text-sm font-semibold",children:"What should we know?"}),jsxRuntime.jsx(Textarea,{id:"topbar-feedback-message",rows:4,value:S,onChange:Ae=>R(Ae.target.value),maxLength:FEEDBACK_MAX_LENGTH,placeholder:"Describe the situation, expected outcome, and any supporting context.",className:"resize-none rounded-2xl border-2 border-dashed border-muted/80 bg-gradient-to-br from-muted/40 to-background focus-visible:border-primary focus-visible:ring-primary/40"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[jsxRuntime.jsx("span",{children:ae?`${ae}/${FEEDBACK_MAX_LENGTH} characters`:"Up to 800 characters is plenty."}),jsxRuntime.jsx("span",{children:I?`Intent: ${se}`:"Include context, impact, and urgency if applicable."})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3 rounded-2xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs(Label$2,{htmlFor:"topbar-feedback-email",className:"flex items-center gap-2 text-sm font-semibold",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),"Request a follow-up"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Include an email if you'd like us to provide updates or clarify details."})]}),jsxRuntime.jsx(Switch,{id:"feedback-follow-up",checked:A,onCheckedChange:Ae=>M(!!Ae),"aria-label":"Toggle follow-up preference"})]}),A&&jsxRuntime.jsx(Input,{id:"topbar-feedback-email",type:"email",value:C,onChange:Ae=>E(Ae.target.value),placeholder:"you@example.com"}),jsxRuntime.jsxs("div",{className:"rounded-xl bg-muted px-3 py-2 text-[11px] text-muted-foreground",children:["We use this email solely for this conversation. The page URL you were on (",q,") is attached automatically for added context."]})]}),jsxRuntime.jsx(Separator$1,{}),jsxRuntime.jsxs(DialogFooter,{className:"gap-3",children:[jsxRuntime.jsx(Button$1,{type:"button",variant:"outline",onClick:()=>_(!1),disabled:ne,children:"Cancel"}),jsxRuntime.jsx(Button$1,{type:"submit",disabled:ne,children:ne?"Sending...":"Send Feedback"})]})]})})]}),o,t&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Button$1,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:t,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:e,loading:t=!1}){const n=React.useMemo(()=>{if(!e||e.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const l=e.filter(I=>I.DocumentType==="Order"),d=e.filter(I=>I.DocumentType==="Shipment"),f=l.filter(I=>I.WarehouseCode!=="3PLE"),g=f.reduce((I,j)=>I+(j.Quantity||0),0),b=f.reduce((I,j)=>I+(j.ExtendedPrice||0),0),_=l.filter(I=>I.WarehouseCode==="3PLE"),S=_.reduce((I,j)=>I+(j.Quantity||0),0),R=_.reduce((I,j)=>I+(j.ExtendedPrice||0),0),C=d.length,E=d.reduce((I,j)=>I+(j.ExtendedPrice||0),0),A=g+S+C,M=b+R+E;return{all:{orders:A,amount:M},processing:{orders:g,amount:b},shipped:{orders:C,amount:E},delayed:{orders:S,amount:R}}},[e]),o=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:n.all.orders,amount:n.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:n.processing.orders,amount:n.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:n.shipped.orders,amount:n.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:n.delayed.orders,amount:n.delayed.amount}];return t?jsxRuntime.jsxs(Card,{className:"@container",children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(l=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},l))})]}):jsxRuntime.jsxs(Card,{className:"@container",children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:o.map(l=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${l.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:l.name}),jsxRuntime.jsx("div",{className:`${l.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(l.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:l.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:formatMoney(l.amount)})]})]})]})]},l.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(e,t,n)=>{n=e!=null?__create(__getProtoOf(e)):{};const o=__defProp(n,"default",{value:e,enumerable:!0});for(let l of __getOwnPropNames(e))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>e[l],enumerable:!0});return o},__commonJS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),require_xhtml=__commonJS((e,t)=>{t.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((e,t)=>{(function(n,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(e,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],d="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",f="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},b="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_={5:b,"5module":b+" export import",6:b+" const class extends export import super"},S=/^in(stanceof)?$/,R=new RegExp("["+f+"]"),C=new RegExp("["+f+d+"]");function E(z,ge){for(var Fe=65536,Ue=0;Ue<ge.length;Ue+=2){if(Fe+=ge[Ue],Fe>z)return!1;if(Fe+=ge[Ue+1],Fe>=z)return!0}return!1}function A(z,ge){return z<65?z===36:z<91?!0:z<97?z===95:z<123?!0:z<=65535?z>=170&&R.test(String.fromCharCode(z)):ge===!1?!1:E(z,l)}function M(z,ge){return z<48?z===36:z<58?!0:z<65?!1:z<91?!0:z<97?z===95:z<123?!0:z<=65535?z>=170&&C.test(String.fromCharCode(z)):ge===!1?!1:E(z,l)||E(z,o)}var I=function(ge,Fe){Fe===void 0&&(Fe={}),this.label=ge,this.keyword=Fe.keyword,this.beforeExpr=!!Fe.beforeExpr,this.startsExpr=!!Fe.startsExpr,this.isLoop=!!Fe.isLoop,this.isAssign=!!Fe.isAssign,this.prefix=!!Fe.prefix,this.postfix=!!Fe.postfix,this.binop=Fe.binop||null,this.updateContext=null};function j(z,ge){return new I(z,{beforeExpr:!0,binop:ge})}var q={beforeExpr:!0},Q={startsExpr:!0},te={};function F(z,ge){return ge===void 0&&(ge={}),ge.keyword=z,te[z]=new I(z,ge)}var V={num:new I("num",Q),regexp:new I("regexp",Q),string:new I("string",Q),name:new I("name",Q),privateId:new I("privateId",Q),eof:new I("eof"),bracketL:new I("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:!0,startsExpr:!0}),braceR:new I("}"),parenL:new I("(",{beforeExpr:!0,startsExpr:!0}),parenR:new I(")"),comma:new I(",",q),semi:new I(";",q),colon:new I(":",q),dot:new I("."),question:new I("?",q),questionDot:new I("?."),arrow:new I("=>",q),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",q),backQuote:new I("`",Q),dollarBraceL:new I("${",{beforeExpr:!0,startsExpr:!0}),eq:new I("=",{beforeExpr:!0,isAssign:!0}),assign:new I("_=",{beforeExpr:!0,isAssign:!0}),incDec:new I("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new I("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new I("**",{beforeExpr:!0}),coalesce:j("??",1),_break:F("break"),_case:F("case",q),_catch:F("catch"),_continue:F("continue"),_debugger:F("debugger"),_default:F("default",q),_do:F("do",{isLoop:!0,beforeExpr:!0}),_else:F("else",q),_finally:F("finally"),_for:F("for",{isLoop:!0}),_function:F("function",Q),_if:F("if"),_return:F("return",q),_switch:F("switch"),_throw:F("throw",q),_try:F("try"),_var:F("var"),_const:F("const"),_while:F("while",{isLoop:!0}),_with:F("with"),_new:F("new",{beforeExpr:!0,startsExpr:!0}),_this:F("this",Q),_super:F("super",Q),_class:F("class",Q),_extends:F("extends",q),_export:F("export"),_import:F("import",Q),_null:F("null",Q),_true:F("true",Q),_false:F("false",Q),_in:F("in",{beforeExpr:!0,binop:7}),_instanceof:F("instanceof",{beforeExpr:!0,binop:7}),_typeof:F("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:F("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:F("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ne=/\r\n?|\n|\u2028|\u2029/,ae=new RegExp(ne.source,"g");function se(z){return z===10||z===13||z===8232||z===8233}function Oe(z,ge,Fe){Fe===void 0&&(Fe=z.length);for(var Ue=ge;Ue<Fe;Ue++){var Qe=z.charCodeAt(Ue);if(se(Qe))return Ue<Fe-1&&Qe===13&&z.charCodeAt(Ue+1)===10?Ue+2:Ue+1}return-1}var Ne=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,oe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$e=Object.prototype,Ae=$e.hasOwnProperty,je=$e.toString,Be=Object.hasOwn||function(z,ge){return Ae.call(z,ge)},qe=Array.isArray||function(z){return je.call(z)==="[object Array]"},Ve=Object.create(null);function Le(z){return Ve[z]||(Ve[z]=new RegExp("^(?:"+z.replace(/ /g,"|")+")$"))}function He(z){return z<=65535?String.fromCharCode(z):(z-=65536,String.fromCharCode((z>>10)+55296,(z&1023)+56320))}var We=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ze=function(ge,Fe){this.line=ge,this.column=Fe};ze.prototype.offset=function(ge){return new ze(this.line,this.column+ge)};var Xe=function(ge,Fe,Ue){this.start=Fe,this.end=Ue,ge.sourceFile!==null&&(this.source=ge.sourceFile)};function nt(z,ge){for(var Fe=1,Ue=0;;){var Qe=Oe(z,Ue,ge);if(Qe<0)return new ze(Fe,ge-Ue);++Fe,Ue=Qe}}var Je={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},st=!1;function et(z){var ge={};for(var Fe in Je)ge[Fe]=z&&Be(z,Fe)?z[Fe]:Je[Fe];if(ge.ecmaVersion==="latest"?ge.ecmaVersion=1e8:ge.ecmaVersion==null?(!st&&typeof console=="object"&&console.warn&&(st=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
1222
+ ${qe}`:je;try{await V({applicationId:e,comment:Ve,emailAddress:Be||void 0}).unwrap(),F({title:"Feedback sent",description:"Thanks for helping us improve."}),_(!1),R(""),E(""),M(!1),j(null)}catch(Le){console.error("Failed to send feedback",Le),F({title:"Feedback could not be sent",description:"Please try again in a moment.",variant:"destructive"})}};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:Oe,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:l??"Search...",className:"w-full pl-8 bg-white text-black",value:f,onChange:Ae=>g(Ae.target.value),onKeyDown:Ne,ref:d},"topbar-search")]})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs(Dialog,{open:b,onOpenChange:_,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{type:"button",variant:"outline",size:"sm",className:"gap-2",children:[jsxRuntime.jsx(MessageSquare,{className:"h-4 w-4"}),"Feedback"]})}),jsxRuntime.jsx(DialogContent,{className:"w-[min(95vw,980px)] max-w-4xl overflow-hidden border border-border/40 bg-background p-0 shadow-[0_35px_120px_rgba(15,23,42,0.45)]",children:jsxRuntime.jsxs("form",{className:"flex max-h-[85vh] flex-col gap-6 overflow-y-auto bg-background p-6 sm:p-8",onSubmit:oe,children:[jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-[32px] bg-gradient-to-br from-slate-950 via-slate-900 to-indigo-950 p-6 text-white shadow-[0_20px_45px_rgba(15,23,42,0.55)] sm:p-8",children:[jsxRuntime.jsxs("div",{className:"pointer-events-none absolute inset-0 opacity-70",children:[jsxRuntime.jsx("div",{className:"absolute -left-14 top-10 h-32 w-32 rounded-full bg-white/10 blur-3xl","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"absolute right-0 top-1/2 h-40 w-40 -translate-y-1/2 rounded-full bg-indigo-400/20 blur-3xl","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-1/3 h-44 w-44 translate-y-1/3 rounded-full bg-sky-300/20 blur-3xl","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-col gap-5",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-xs uppercase tracking-wide text-white/80",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:"w-max border-white/30 bg-white/10 text-white",children:"Partner feedback desk"}),jsxRuntime.jsx("p",{className:"text-white/70",children:"Product & operations review every submission"})]}),jsxRuntime.jsxs(DialogHeader,{className:"space-y-3 text-left text-white",children:[jsxRuntime.jsx(DialogTitle,{className:"text-3xl leading-tight sm:text-4xl",children:"Share your perspective"}),jsxRuntime.jsx(DialogDescription,{className:"text-base text-white/80",children:"Clear context helps us triage, scope, and respond. Please highlight the scenario, desired outcome, and any urgency we should be aware of."})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"space-y-2 rounded-2xl border bg-muted/60 p-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[jsxRuntime.jsx("p",{className:"font-semibold uppercase tracking-wide text-foreground",children:"Select an intent"}),jsxRuntime.jsx("p",{children:I?`Currently tagged as ${se}.`:"Choosing a category routes the note to the right team."})]}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:FEEDBACK_INTENT_OPTIONS.map(Ae=>jsxRuntime.jsx(Button$1,{type:"button",variant:I===Ae.value?"default":"outline",size:"sm",className:cn("rounded-full px-3 text-xs transition-all",I===Ae.value?"shadow-lg shadow-primary/30":"bg-background hover:-translate-y-[1px]"),"aria-pressed":I===Ae.value,onClick:()=>j(je=>je===Ae.value?null:Ae.value),children:Ae.label},Ae.value))}),I&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:($e=FEEDBACK_INTENT_OPTIONS.find(Ae=>Ae.value===I))==null?void 0:$e.description})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"topbar-feedback-message",className:"text-sm font-semibold",children:"What should we know?"}),jsxRuntime.jsx(Textarea,{id:"topbar-feedback-message",rows:4,value:S,onChange:Ae=>R(Ae.target.value),maxLength:FEEDBACK_MAX_LENGTH,placeholder:"Describe the situation, expected outcome, and any supporting context.",className:"resize-none rounded-2xl border-2 border-dashed border-muted/80 bg-gradient-to-br from-muted/40 to-background focus-visible:border-primary focus-visible:ring-primary/40"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[jsxRuntime.jsx("span",{children:ae?`${ae}/${FEEDBACK_MAX_LENGTH} characters`:"Up to 800 characters is plenty."}),jsxRuntime.jsx("span",{children:I?`Intent: ${se}`:"Include context, impact, and urgency if applicable."})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3 rounded-2xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs(Label$2,{htmlFor:"topbar-feedback-email",className:"flex items-center gap-2 text-sm font-semibold",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),"Request a follow-up"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Include an email if you'd like us to provide updates or clarify details."})]}),jsxRuntime.jsx(Switch,{id:"feedback-follow-up",checked:A,onCheckedChange:Ae=>M(!!Ae),"aria-label":"Toggle follow-up preference"})]}),A&&jsxRuntime.jsx(Input,{id:"topbar-feedback-email",type:"email",value:C,onChange:Ae=>E(Ae.target.value),placeholder:"you@example.com"}),jsxRuntime.jsxs("div",{className:"rounded-xl bg-muted px-3 py-2 text-[11px] text-muted-foreground",children:["We use this email solely for this conversation. The page URL you were on (",q,") is attached automatically for added context."]})]}),jsxRuntime.jsx(Separator$1,{}),jsxRuntime.jsxs(DialogFooter,{className:"gap-3",children:[jsxRuntime.jsx(Button$1,{type:"button",variant:"outline",onClick:()=>_(!1),disabled:ne,children:"Cancel"}),jsxRuntime.jsx(Button$1,{type:"submit",disabled:ne,children:ne?"Sending...":"Send Feedback"})]})]})})]}),o,t&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Button$1,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:t,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:e,loading:t=!1}){const n=React.useMemo(()=>{if(!e||e.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const l=e.filter(I=>I.DocumentType==="Order"),d=e.filter(I=>I.DocumentType==="Shipment"),f=l.filter(I=>I.WarehouseCode!=="3PLE"),g=f.reduce((I,j)=>I+(j.Quantity||0),0),b=f.reduce((I,j)=>I+(j.ExtendedPrice||0),0),_=l.filter(I=>I.WarehouseCode==="3PLE"),S=_.reduce((I,j)=>I+(j.Quantity||0),0),R=_.reduce((I,j)=>I+(j.ExtendedPrice||0),0),C=d.length,E=d.reduce((I,j)=>I+(j.ExtendedPrice||0),0),A=g+S+C,M=b+R+E;return{all:{orders:A,amount:M},processing:{orders:g,amount:b},shipped:{orders:C,amount:E},delayed:{orders:S,amount:R}}},[e]),o=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:n.all.orders,amount:n.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:n.processing.orders,amount:n.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:n.shipped.orders,amount:n.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:n.delayed.orders,amount:n.delayed.amount}];return t?jsxRuntime.jsxs(Card,{className:"@container",children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(l=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},l))})]}):jsxRuntime.jsxs(Card,{className:"@container",children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:o.map(l=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${l.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:l.name}),jsxRuntime.jsx("div",{className:`${l.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(l.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:l.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:formatMoney(l.amount)})]})]})]})]},l.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(e,t,n)=>{n=e!=null?__create(__getProtoOf(e)):{};const o=__defProp(n,"default",{value:e,enumerable:!0});for(let l of __getOwnPropNames(e))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>e[l],enumerable:!0});return o},__commonJS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),require_xhtml=__commonJS((e,t)=>{t.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((e,t)=>{(function(n,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(e,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],d="‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‌‍‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",f="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},b="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_={5:b,"5module":b+" export import",6:b+" const class extends export import super"},S=/^in(stanceof)?$/,R=new RegExp("["+f+"]"),C=new RegExp("["+f+d+"]");function E(z,ge){for(var Fe=65536,Ue=0;Ue<ge.length;Ue+=2){if(Fe+=ge[Ue],Fe>z)return!1;if(Fe+=ge[Ue+1],Fe>=z)return!0}return!1}function A(z,ge){return z<65?z===36:z<91?!0:z<97?z===95:z<123?!0:z<=65535?z>=170&&R.test(String.fromCharCode(z)):ge===!1?!1:E(z,l)}function M(z,ge){return z<48?z===36:z<58?!0:z<65?!1:z<91?!0:z<97?z===95:z<123?!0:z<=65535?z>=170&&C.test(String.fromCharCode(z)):ge===!1?!1:E(z,l)||E(z,o)}var I=function(ge,Fe){Fe===void 0&&(Fe={}),this.label=ge,this.keyword=Fe.keyword,this.beforeExpr=!!Fe.beforeExpr,this.startsExpr=!!Fe.startsExpr,this.isLoop=!!Fe.isLoop,this.isAssign=!!Fe.isAssign,this.prefix=!!Fe.prefix,this.postfix=!!Fe.postfix,this.binop=Fe.binop||null,this.updateContext=null};function j(z,ge){return new I(z,{beforeExpr:!0,binop:ge})}var q={beforeExpr:!0},Q={startsExpr:!0},te={};function F(z,ge){return ge===void 0&&(ge={}),ge.keyword=z,te[z]=new I(z,ge)}var V={num:new I("num",Q),regexp:new I("regexp",Q),string:new I("string",Q),name:new I("name",Q),privateId:new I("privateId",Q),eof:new I("eof"),bracketL:new I("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:!0,startsExpr:!0}),braceR:new I("}"),parenL:new I("(",{beforeExpr:!0,startsExpr:!0}),parenR:new I(")"),comma:new I(",",q),semi:new I(";",q),colon:new I(":",q),dot:new I("."),question:new I("?",q),questionDot:new I("?."),arrow:new I("=>",q),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",q),backQuote:new I("`",Q),dollarBraceL:new I("${",{beforeExpr:!0,startsExpr:!0}),eq:new I("=",{beforeExpr:!0,isAssign:!0}),assign:new I("_=",{beforeExpr:!0,isAssign:!0}),incDec:new I("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new I("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new I("**",{beforeExpr:!0}),coalesce:j("??",1),_break:F("break"),_case:F("case",q),_catch:F("catch"),_continue:F("continue"),_debugger:F("debugger"),_default:F("default",q),_do:F("do",{isLoop:!0,beforeExpr:!0}),_else:F("else",q),_finally:F("finally"),_for:F("for",{isLoop:!0}),_function:F("function",Q),_if:F("if"),_return:F("return",q),_switch:F("switch"),_throw:F("throw",q),_try:F("try"),_var:F("var"),_const:F("const"),_while:F("while",{isLoop:!0}),_with:F("with"),_new:F("new",{beforeExpr:!0,startsExpr:!0}),_this:F("this",Q),_super:F("super",Q),_class:F("class",Q),_extends:F("extends",q),_export:F("export"),_import:F("import",Q),_null:F("null",Q),_true:F("true",Q),_false:F("false",Q),_in:F("in",{beforeExpr:!0,binop:7}),_instanceof:F("instanceof",{beforeExpr:!0,binop:7}),_typeof:F("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:F("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:F("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ne=/\r\n?|\n|\u2028|\u2029/,ae=new RegExp(ne.source,"g");function se(z){return z===10||z===13||z===8232||z===8233}function Oe(z,ge,Fe){Fe===void 0&&(Fe=z.length);for(var Ue=ge;Ue<Fe;Ue++){var Qe=z.charCodeAt(Ue);if(se(Qe))return Ue<Fe-1&&Qe===13&&z.charCodeAt(Ue+1)===10?Ue+2:Ue+1}return-1}var Ne=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,oe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$e=Object.prototype,Ae=$e.hasOwnProperty,je=$e.toString,Be=Object.hasOwn||function(z,ge){return Ae.call(z,ge)},qe=Array.isArray||function(z){return je.call(z)==="[object Array]"},Ve=Object.create(null);function Le(z){return Ve[z]||(Ve[z]=new RegExp("^(?:"+z.replace(/ /g,"|")+")$"))}function He(z){return z<=65535?String.fromCharCode(z):(z-=65536,String.fromCharCode((z>>10)+55296,(z&1023)+56320))}var We=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ze=function(ge,Fe){this.line=ge,this.column=Fe};ze.prototype.offset=function(ge){return new ze(this.line,this.column+ge)};var Xe=function(ge,Fe,Ue){this.start=Fe,this.end=Ue,ge.sourceFile!==null&&(this.source=ge.sourceFile)};function nt(z,ge){for(var Fe=1,Ue=0;;){var Qe=Oe(z,Ue,ge);if(Qe<0)return new ze(Fe,ge-Ue);++Fe,Ue=Qe}}var Je={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},st=!1;function et(z){var ge={};for(var Fe in Je)ge[Fe]=z&&Be(z,Fe)?z[Fe]:Je[Fe];if(ge.ecmaVersion==="latest"?ge.ecmaVersion=1e8:ge.ecmaVersion==null?(!st&&typeof console=="object"&&console.warn&&(st=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
1228
1223
  Defaulting to 2020, but this will stop working in the future.`)),ge.ecmaVersion=11):ge.ecmaVersion>=2015&&(ge.ecmaVersion-=2009),ge.allowReserved==null&&(ge.allowReserved=ge.ecmaVersion<5),(!z||z.allowHashBang==null)&&(ge.allowHashBang=ge.ecmaVersion>=14),qe(ge.onToken)){var Ue=ge.onToken;ge.onToken=function(Qe){return Ue.push(Qe)}}return qe(ge.onComment)&&(ge.onComment=at(ge,ge.onComment)),ge}function at(z,ge){return function(Fe,Ue,Qe,ut,pt,Vt){var Ft={type:Fe?"Block":"Line",value:Ue,start:Qe,end:ut};z.locations&&(Ft.loc=new Xe(this,pt,Vt)),z.ranges&&(Ft.range=[Qe,ut]),ge.push(Ft)}}var tt=1,ot=2,lt=4,Ge=8,$t=16,rt=32,Rt=64,dt=128,It=256,Mt=tt|ot|It;function Ct(z,ge){return ot|(z?lt:0)|(ge?Ge:0)}var Ke=0,Ye=1,Ze=2,ct=3,mt=4,ft=5,yt=function(ge,Fe,Ue){this.options=ge=et(ge),this.sourceFile=ge.sourceFile,this.keywords=Le(_[ge.ecmaVersion>=6?6:ge.sourceType==="module"?"5module":5]);var Qe="";ge.allowReserved!==!0&&(Qe=g[ge.ecmaVersion>=6?6:ge.ecmaVersion===5?5:3],ge.sourceType==="module"&&(Qe+=" await")),this.reservedWords=Le(Qe);var ut=(Qe?Qe+" ":"")+g.strict;this.reservedWordsStrict=Le(ut),this.reservedWordsStrictBind=Le(ut+" "+g.strictBind),this.input=String(Fe),this.containsEsc=!1,Ue?(this.pos=Ue,this.lineStart=this.input.lastIndexOf(`
1229
1224
  `,Ue-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ne).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=V.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=ge.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&ge.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(tt),this.regexpState=null,this.privateNameStack=[]},Ht={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};yt.prototype.parse=function(){var ge=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(ge)},Ht.inFunction.get=function(){return(this.currentVarScope().flags&ot)>0},Ht.inGenerator.get=function(){return(this.currentVarScope().flags&Ge)>0&&!this.currentVarScope().inClassFieldInit},Ht.inAsync.get=function(){return(this.currentVarScope().flags&lt)>0&&!this.currentVarScope().inClassFieldInit},Ht.canAwait.get=function(){for(var z=this.scopeStack.length-1;z>=0;z--){var ge=this.scopeStack[z];if(ge.inClassFieldInit||ge.flags&It)return!1;if(ge.flags&ot)return(ge.flags&lt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ht.allowSuper.get=function(){var z=this.currentThisScope(),ge=z.flags,Fe=z.inClassFieldInit;return(ge&Rt)>0||Fe||this.options.allowSuperOutsideMethod},Ht.allowDirectSuper.get=function(){return(this.currentThisScope().flags&dt)>0},Ht.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ht.allowNewDotTarget.get=function(){var z=this.currentThisScope(),ge=z.flags,Fe=z.inClassFieldInit;return(ge&(ot|It))>0||Fe},Ht.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&It)>0},yt.extend=function(){for(var ge=[],Fe=arguments.length;Fe--;)ge[Fe]=arguments[Fe];for(var Ue=this,Qe=0;Qe<ge.length;Qe++)Ue=ge[Qe](Ue);return Ue},yt.parse=function(ge,Fe){return new this(Fe,ge).parse()},yt.parseExpressionAt=function(ge,Fe,Ue){var Qe=new this(Ue,ge,Fe);return Qe.nextToken(),Qe.parseExpression()},yt.tokenizer=function(ge,Fe){return new this(Fe,ge)},Object.defineProperties(yt.prototype,Ht);var Kt=yt.prototype,un=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Kt.strictDirective=function(z){if(this.options.ecmaVersion<5)return!1;for(;;){oe.lastIndex=z,z+=oe.exec(this.input)[0].length;var ge=un.exec(this.input.slice(z));if(!ge)return!1;if((ge[1]||ge[2])==="use strict"){oe.lastIndex=z+ge[0].length;var Fe=oe.exec(this.input),Ue=Fe.index+Fe[0].length,Qe=this.input.charAt(Ue);return Qe===";"||Qe==="}"||ne.test(Fe[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Qe)||Qe==="!"&&this.input.charAt(Ue+1)==="=")}z+=ge[0].length,oe.lastIndex=z,z+=oe.exec(this.input)[0].length,this.input[z]===";"&&z++}},Kt.eat=function(z){return this.type===z?(this.next(),!0):!1},Kt.isContextual=function(z){return this.type===V.name&&this.value===z&&!this.containsEsc},Kt.eatContextual=function(z){return this.isContextual(z)?(this.next(),!0):!1},Kt.expectContextual=function(z){this.eatContextual(z)||this.unexpected()},Kt.canInsertSemicolon=function(){return this.type===V.eof||this.type===V.braceR||ne.test(this.input.slice(this.lastTokEnd,this.start))},Kt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Kt.semicolon=function(){!this.eat(V.semi)&&!this.insertSemicolon()&&this.unexpected()},Kt.afterTrailingComma=function(z,ge){if(this.type===z)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),ge||this.next(),!0},Kt.expect=function(z){this.eat(z)||this.unexpected()},Kt.unexpected=function(z){this.raise(z??this.start,"Unexpected token")};var hn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Kt.checkPatternErrors=function(z,ge){if(z){z.trailingComma>-1&&this.raiseRecoverable(z.trailingComma,"Comma is not permitted after the rest element");var Fe=ge?z.parenthesizedAssign:z.parenthesizedBind;Fe>-1&&this.raiseRecoverable(Fe,ge?"Assigning to rvalue":"Parenthesized pattern")}},Kt.checkExpressionErrors=function(z,ge){if(!z)return!1;var Fe=z.shorthandAssign,Ue=z.doubleProto;if(!ge)return Fe>=0||Ue>=0;Fe>=0&&this.raise(Fe,"Shorthand property assignments are valid only in destructuring patterns"),Ue>=0&&this.raiseRecoverable(Ue,"Redefinition of __proto__ property")},Kt.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Kt.isSimpleAssignTarget=function(z){return z.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(z.expression):z.type==="Identifier"||z.type==="MemberExpression"};var qt=yt.prototype;qt.parseTopLevel=function(z){var ge=Object.create(null);for(z.body||(z.body=[]);this.type!==V.eof;){var Fe=this.parseStatement(null,!0,ge);z.body.push(Fe)}if(this.inModule)for(var Ue=0,Qe=Object.keys(this.undefinedExports);Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.raiseRecoverable(this.undefinedExports[ut].start,"Export '"+ut+"' is not defined")}return this.adaptDirectivePrologue(z.body),this.next(),z.sourceType=this.options.sourceType,this.finishNode(z,"Program")};var An={kind:"loop"},xn={kind:"switch"};qt.isLet=function(z){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;oe.lastIndex=this.pos;var ge=oe.exec(this.input),Fe=this.pos+ge[0].length,Ue=this.input.charCodeAt(Fe);if(Ue===91||Ue===92)return!0;if(z)return!1;if(Ue===123||Ue>55295&&Ue<56320)return!0;if(A(Ue,!0)){for(var Qe=Fe+1;M(Ue=this.input.charCodeAt(Qe),!0);)++Qe;if(Ue===92||Ue>55295&&Ue<56320)return!0;var ut=this.input.slice(Fe,Qe);if(!S.test(ut))return!0}return!1},qt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;oe.lastIndex=this.pos;var z=oe.exec(this.input),ge=this.pos+z[0].length,Fe;return!ne.test(this.input.slice(this.pos,ge))&&this.input.slice(ge,ge+8)==="function"&&(ge+8===this.input.length||!(M(Fe=this.input.charCodeAt(ge+8))||Fe>55295&&Fe<56320))},qt.parseStatement=function(z,ge,Fe){var Ue=this.type,Qe=this.startNode(),ut;switch(this.isLet(z)&&(Ue=V._var,ut="let"),Ue){case V._break:case V._continue:return this.parseBreakContinueStatement(Qe,Ue.keyword);case V._debugger:return this.parseDebuggerStatement(Qe);case V._do:return this.parseDoStatement(Qe);case V._for:return this.parseForStatement(Qe);case V._function:return z&&(this.strict||z!=="if"&&z!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(Qe,!1,!z);case V._class:return z&&this.unexpected(),this.parseClass(Qe,!0);case V._if:return this.parseIfStatement(Qe);case V._return:return this.parseReturnStatement(Qe);case V._switch:return this.parseSwitchStatement(Qe);case V._throw:return this.parseThrowStatement(Qe);case V._try:return this.parseTryStatement(Qe);case V._const:case V._var:return ut=ut||this.value,z&&ut!=="var"&&this.unexpected(),this.parseVarStatement(Qe,ut);case V._while:return this.parseWhileStatement(Qe);case V._with:return this.parseWithStatement(Qe);case V.braceL:return this.parseBlock(!0,Qe);case V.semi:return this.parseEmptyStatement(Qe);case V._export:case V._import:if(this.options.ecmaVersion>10&&Ue===V._import){oe.lastIndex=this.pos;var pt=oe.exec(this.input),Vt=this.pos+pt[0].length,Ft=this.input.charCodeAt(Vt);if(Ft===40||Ft===46)return this.parseExpressionStatement(Qe,this.parseExpression())}return this.options.allowImportExportEverywhere||(ge||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),Ue===V._import?this.parseImport(Qe):this.parseExport(Qe,Fe);default:if(this.isAsyncFunction())return z&&this.unexpected(),this.next(),this.parseFunctionStatement(Qe,!0,!z);var nn=this.value,Qt=this.parseExpression();return Ue===V.name&&Qt.type==="Identifier"&&this.eat(V.colon)?this.parseLabeledStatement(Qe,nn,Qt,z):this.parseExpressionStatement(Qe,Qt)}},qt.parseBreakContinueStatement=function(z,ge){var Fe=ge==="break";this.next(),this.eat(V.semi)||this.insertSemicolon()?z.label=null:this.type!==V.name?this.unexpected():(z.label=this.parseIdent(),this.semicolon());for(var Ue=0;Ue<this.labels.length;++Ue){var Qe=this.labels[Ue];if((z.label==null||Qe.name===z.label.name)&&(Qe.kind!=null&&(Fe||Qe.kind==="loop")||z.label&&Fe))break}return Ue===this.labels.length&&this.raise(z.start,"Unsyntactic "+ge),this.finishNode(z,Fe?"BreakStatement":"ContinueStatement")},qt.parseDebuggerStatement=function(z){return this.next(),this.semicolon(),this.finishNode(z,"DebuggerStatement")},qt.parseDoStatement=function(z){return this.next(),this.labels.push(An),z.body=this.parseStatement("do"),this.labels.pop(),this.expect(V._while),z.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(V.semi):this.semicolon(),this.finishNode(z,"DoWhileStatement")},qt.parseForStatement=function(z){this.next();var ge=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(An),this.enterScope(0),this.expect(V.parenL),this.type===V.semi)return ge>-1&&this.unexpected(ge),this.parseFor(z,null);var Fe=this.isLet();if(this.type===V._var||this.type===V._const||Fe){var Ue=this.startNode(),Qe=Fe?"let":this.value;return this.next(),this.parseVar(Ue,!0,Qe),this.finishNode(Ue,"VariableDeclaration"),(this.type===V._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ue.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===V._in?ge>-1&&this.unexpected(ge):z.await=ge>-1),this.parseForIn(z,Ue)):(ge>-1&&this.unexpected(ge),this.parseFor(z,Ue))}var ut=this.isContextual("let"),pt=!1,Vt=this.containsEsc,Ft=new hn,nn=this.start,Qt=ge>-1?this.parseExprSubscripts(Ft,"await"):this.parseExpression(!0,Ft);return this.type===V._in||(pt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(ge>-1?(this.type===V._in&&this.unexpected(ge),z.await=!0):pt&&this.options.ecmaVersion>=8&&(Qt.start===nn&&!Vt&&Qt.type==="Identifier"&&Qt.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(z.await=!1)),ut&&pt&&this.raise(Qt.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Qt,!1,Ft),this.checkLValPattern(Qt),this.parseForIn(z,Qt)):(this.checkExpressionErrors(Ft,!0),ge>-1&&this.unexpected(ge),this.parseFor(z,Qt))},qt.parseFunctionStatement=function(z,ge,Fe){return this.next(),this.parseFunction(z,vn|(Fe?0:Pn),!1,ge)},qt.parseIfStatement=function(z){return this.next(),z.test=this.parseParenExpression(),z.consequent=this.parseStatement("if"),z.alternate=this.eat(V._else)?this.parseStatement("if"):null,this.finishNode(z,"IfStatement")},qt.parseReturnStatement=function(z){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(V.semi)||this.insertSemicolon()?z.argument=null:(z.argument=this.parseExpression(),this.semicolon()),this.finishNode(z,"ReturnStatement")},qt.parseSwitchStatement=function(z){this.next(),z.discriminant=this.parseParenExpression(),z.cases=[],this.expect(V.braceL),this.labels.push(xn),this.enterScope(0);for(var ge,Fe=!1;this.type!==V.braceR;)if(this.type===V._case||this.type===V._default){var Ue=this.type===V._case;ge&&this.finishNode(ge,"SwitchCase"),z.cases.push(ge=this.startNode()),ge.consequent=[],this.next(),Ue?ge.test=this.parseExpression():(Fe&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Fe=!0,ge.test=null),this.expect(V.colon)}else ge||this.unexpected(),ge.consequent.push(this.parseStatement(null));return this.exitScope(),ge&&this.finishNode(ge,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(z,"SwitchStatement")},qt.parseThrowStatement=function(z){return this.next(),ne.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),z.argument=this.parseExpression(),this.semicolon(),this.finishNode(z,"ThrowStatement")};var Rn=[];qt.parseCatchClauseParam=function(){var z=this.parseBindingAtom(),ge=z.type==="Identifier";return this.enterScope(ge?rt:0),this.checkLValPattern(z,ge?mt:Ze),this.expect(V.parenR),z},qt.parseTryStatement=function(z){if(this.next(),z.block=this.parseBlock(),z.handler=null,this.type===V._catch){var ge=this.startNode();this.next(),this.eat(V.parenL)?ge.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),ge.param=null,this.enterScope(0)),ge.body=this.parseBlock(!1),this.exitScope(),z.handler=this.finishNode(ge,"CatchClause")}return z.finalizer=this.eat(V._finally)?this.parseBlock():null,!z.handler&&!z.finalizer&&this.raise(z.start,"Missing catch or finally clause"),this.finishNode(z,"TryStatement")},qt.parseVarStatement=function(z,ge,Fe){return this.next(),this.parseVar(z,!1,ge,Fe),this.semicolon(),this.finishNode(z,"VariableDeclaration")},qt.parseWhileStatement=function(z){return this.next(),z.test=this.parseParenExpression(),this.labels.push(An),z.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(z,"WhileStatement")},qt.parseWithStatement=function(z){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),z.object=this.parseParenExpression(),z.body=this.parseStatement("with"),this.finishNode(z,"WithStatement")},qt.parseEmptyStatement=function(z){return this.next(),this.finishNode(z,"EmptyStatement")},qt.parseLabeledStatement=function(z,ge,Fe,Ue){for(var Qe=0,ut=this.labels;Qe<ut.length;Qe+=1){var pt=ut[Qe];pt.name===ge&&this.raise(Fe.start,"Label '"+ge+"' is already declared")}for(var Vt=this.type.isLoop?"loop":this.type===V._switch?"switch":null,Ft=this.labels.length-1;Ft>=0;Ft--){var nn=this.labels[Ft];if(nn.statementStart===z.start)nn.statementStart=this.start,nn.kind=Vt;else break}return this.labels.push({name:ge,kind:Vt,statementStart:this.start}),z.body=this.parseStatement(Ue?Ue.indexOf("label")===-1?Ue+"label":Ue:"label"),this.labels.pop(),z.label=Fe,this.finishNode(z,"LabeledStatement")},qt.parseExpressionStatement=function(z,ge){return z.expression=ge,this.semicolon(),this.finishNode(z,"ExpressionStatement")},qt.parseBlock=function(z,ge,Fe){for(z===void 0&&(z=!0),ge===void 0&&(ge=this.startNode()),ge.body=[],this.expect(V.braceL),z&&this.enterScope(0);this.type!==V.braceR;){var Ue=this.parseStatement(null);ge.body.push(Ue)}return Fe&&(this.strict=!1),this.next(),z&&this.exitScope(),this.finishNode(ge,"BlockStatement")},qt.parseFor=function(z,ge){return z.init=ge,this.expect(V.semi),z.test=this.type===V.semi?null:this.parseExpression(),this.expect(V.semi),z.update=this.type===V.parenR?null:this.parseExpression(),this.expect(V.parenR),z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(z,"ForStatement")},qt.parseForIn=function(z,ge){var Fe=this.type===V._in;return this.next(),ge.type==="VariableDeclaration"&&ge.declarations[0].init!=null&&(!Fe||this.options.ecmaVersion<8||this.strict||ge.kind!=="var"||ge.declarations[0].id.type!=="Identifier")&&this.raise(ge.start,(Fe?"for-in":"for-of")+" loop variable declaration may not have an initializer"),z.left=ge,z.right=Fe?this.parseExpression():this.parseMaybeAssign(),this.expect(V.parenR),z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(z,Fe?"ForInStatement":"ForOfStatement")},qt.parseVar=function(z,ge,Fe,Ue){for(z.declarations=[],z.kind=Fe;;){var Qe=this.startNode();if(this.parseVarId(Qe,Fe),this.eat(V.eq)?Qe.init=this.parseMaybeAssign(ge):!Ue&&Fe==="const"&&!(this.type===V._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!Ue&&Qe.id.type!=="Identifier"&&!(ge&&(this.type===V._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Qe.init=null,z.declarations.push(this.finishNode(Qe,"VariableDeclarator")),!this.eat(V.comma))break}return z},qt.parseVarId=function(z,ge){z.id=this.parseBindingAtom(),this.checkLValPattern(z.id,ge==="var"?Ye:Ze,!1)};var vn=1,Pn=2,Mn=4;qt.parseFunction=function(z,ge,Fe,Ue,Qe){this.initFunction(z),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Ue)&&(this.type===V.star&&ge&Pn&&this.unexpected(),z.generator=this.eat(V.star)),this.options.ecmaVersion>=8&&(z.async=!!Ue),ge&vn&&(z.id=ge&Mn&&this.type!==V.name?null:this.parseIdent(),z.id&&!(ge&Pn)&&this.checkLValSimple(z.id,this.strict||z.generator||z.async?this.treatFunctionsAsVar?Ye:Ze:ct));var ut=this.yieldPos,pt=this.awaitPos,Vt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ct(z.async,z.generator)),ge&vn||(z.id=this.type===V.name?this.parseIdent():null),this.parseFunctionParams(z),this.parseFunctionBody(z,Fe,!1,Qe),this.yieldPos=ut,this.awaitPos=pt,this.awaitIdentPos=Vt,this.finishNode(z,ge&vn?"FunctionDeclaration":"FunctionExpression")},qt.parseFunctionParams=function(z){this.expect(V.parenL),z.params=this.parseBindingList(V.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},qt.parseClass=function(z,ge){this.next();var Fe=this.strict;this.strict=!0,this.parseClassId(z,ge),this.parseClassSuper(z);var Ue=this.enterClassBody(),Qe=this.startNode(),ut=!1;for(Qe.body=[],this.expect(V.braceL);this.type!==V.braceR;){var pt=this.parseClassElement(z.superClass!==null);pt&&(Qe.body.push(pt),pt.type==="MethodDefinition"&&pt.kind==="constructor"?(ut&&this.raiseRecoverable(pt.start,"Duplicate constructor in the same class"),ut=!0):pt.key&&pt.key.type==="PrivateIdentifier"&&$n(Ue,pt)&&this.raiseRecoverable(pt.key.start,"Identifier '#"+pt.key.name+"' has already been declared"))}return this.strict=Fe,this.next(),z.body=this.finishNode(Qe,"ClassBody"),this.exitClassBody(),this.finishNode(z,ge?"ClassDeclaration":"ClassExpression")},qt.parseClassElement=function(z){if(this.eat(V.semi))return null;var ge=this.options.ecmaVersion,Fe=this.startNode(),Ue="",Qe=!1,ut=!1,pt="method",Vt=!1;if(this.eatContextual("static")){if(ge>=13&&this.eat(V.braceL))return this.parseClassStaticBlock(Fe),Fe;this.isClassElementNameStart()||this.type===V.star?Vt=!0:Ue="static"}if(Fe.static=Vt,!Ue&&ge>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===V.star)&&!this.canInsertSemicolon()?ut=!0:Ue="async"),!Ue&&(ge>=9||!ut)&&this.eat(V.star)&&(Qe=!0),!Ue&&!ut&&!Qe){var Ft=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?pt=Ft:Ue=Ft)}if(Ue?(Fe.computed=!1,Fe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Fe.key.name=Ue,this.finishNode(Fe.key,"Identifier")):this.parseClassElementName(Fe),ge<13||this.type===V.parenL||pt!=="method"||Qe||ut){var nn=!Fe.static&&Vn(Fe,"constructor"),Qt=nn&&z;nn&&pt!=="method"&&this.raise(Fe.key.start,"Constructor can't have get/set modifier"),Fe.kind=nn?"constructor":pt,this.parseClassMethod(Fe,Qe,ut,Qt)}else this.parseClassField(Fe);return Fe},qt.isClassElementNameStart=function(){return this.type===V.name||this.type===V.privateId||this.type===V.num||this.type===V.string||this.type===V.bracketL||this.type.keyword},qt.parseClassElementName=function(z){this.type===V.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),z.computed=!1,z.key=this.parsePrivateIdent()):this.parsePropertyName(z)},qt.parseClassMethod=function(z,ge,Fe,Ue){var Qe=z.key;z.kind==="constructor"?(ge&&this.raise(Qe.start,"Constructor can't be a generator"),Fe&&this.raise(Qe.start,"Constructor can't be an async method")):z.static&&Vn(z,"prototype")&&this.raise(Qe.start,"Classes may not have a static property named prototype");var ut=z.value=this.parseMethod(ge,Fe,Ue);return z.kind==="get"&&ut.params.length!==0&&this.raiseRecoverable(ut.start,"getter should have no params"),z.kind==="set"&&ut.params.length!==1&&this.raiseRecoverable(ut.start,"setter should have exactly one param"),z.kind==="set"&&ut.params[0].type==="RestElement"&&this.raiseRecoverable(ut.params[0].start,"Setter cannot use rest params"),this.finishNode(z,"MethodDefinition")},qt.parseClassField=function(z){if(Vn(z,"constructor")?this.raise(z.key.start,"Classes can't have a field named 'constructor'"):z.static&&Vn(z,"prototype")&&this.raise(z.key.start,"Classes can't have a static field named 'prototype'"),this.eat(V.eq)){var ge=this.currentThisScope(),Fe=ge.inClassFieldInit;ge.inClassFieldInit=!0,z.value=this.parseMaybeAssign(),ge.inClassFieldInit=Fe}else z.value=null;return this.semicolon(),this.finishNode(z,"PropertyDefinition")},qt.parseClassStaticBlock=function(z){z.body=[];var ge=this.labels;for(this.labels=[],this.enterScope(It|Rt);this.type!==V.braceR;){var Fe=this.parseStatement(null);z.body.push(Fe)}return this.next(),this.exitScope(),this.labels=ge,this.finishNode(z,"StaticBlock")},qt.parseClassId=function(z,ge){this.type===V.name?(z.id=this.parseIdent(),ge&&this.checkLValSimple(z.id,Ze,!1)):(ge===!0&&this.unexpected(),z.id=null)},qt.parseClassSuper=function(z){z.superClass=this.eat(V._extends)?this.parseExprSubscripts(null,!1):null},qt.enterClassBody=function(){var z={declared:Object.create(null),used:[]};return this.privateNameStack.push(z),z.declared},qt.exitClassBody=function(){var z=this.privateNameStack.pop(),ge=z.declared,Fe=z.used;if(this.options.checkPrivateFields)for(var Ue=this.privateNameStack.length,Qe=Ue===0?null:this.privateNameStack[Ue-1],ut=0;ut<Fe.length;++ut){var pt=Fe[ut];Be(ge,pt.name)||(Qe?Qe.used.push(pt):this.raiseRecoverable(pt.start,"Private field '#"+pt.name+"' must be declared in an enclosing class"))}};function $n(z,ge){var Fe=ge.key.name,Ue=z[Fe],Qe="true";return ge.type==="MethodDefinition"&&(ge.kind==="get"||ge.kind==="set")&&(Qe=(ge.static?"s":"i")+ge.kind),Ue==="iget"&&Qe==="iset"||Ue==="iset"&&Qe==="iget"||Ue==="sget"&&Qe==="sset"||Ue==="sset"&&Qe==="sget"?(z[Fe]="true",!1):Ue?!0:(z[Fe]=Qe,!1)}function Vn(z,ge){var Fe=z.computed,Ue=z.key;return!Fe&&(Ue.type==="Identifier"&&Ue.name===ge||Ue.type==="Literal"&&Ue.value===ge)}qt.parseExportAllDeclaration=function(z,ge){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(z.exported=this.parseModuleExportName(),this.checkExport(ge,z.exported,this.lastTokStart)):z.exported=null),this.expectContextual("from"),this.type!==V.string&&this.unexpected(),z.source=this.parseExprAtom(),this.semicolon(),this.finishNode(z,"ExportAllDeclaration")},qt.parseExport=function(z,ge){if(this.next(),this.eat(V.star))return this.parseExportAllDeclaration(z,ge);if(this.eat(V._default))return this.checkExport(ge,"default",this.lastTokStart),z.declaration=this.parseExportDefaultDeclaration(),this.finishNode(z,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())z.declaration=this.parseExportDeclaration(z),z.declaration.type==="VariableDeclaration"?this.checkVariableExport(ge,z.declaration.declarations):this.checkExport(ge,z.declaration.id,z.declaration.id.start),z.specifiers=[],z.source=null;else{if(z.declaration=null,z.specifiers=this.parseExportSpecifiers(ge),this.eatContextual("from"))this.type!==V.string&&this.unexpected(),z.source=this.parseExprAtom();else{for(var Fe=0,Ue=z.specifiers;Fe<Ue.length;Fe+=1){var Qe=Ue[Fe];this.checkUnreserved(Qe.local),this.checkLocalExport(Qe.local),Qe.local.type==="Literal"&&this.raise(Qe.local.start,"A string literal cannot be used as an exported binding without `from`.")}z.source=null}this.semicolon()}return this.finishNode(z,"ExportNamedDeclaration")},qt.parseExportDeclaration=function(z){return this.parseStatement(null)},qt.parseExportDefaultDeclaration=function(){var z;if(this.type===V._function||(z=this.isAsyncFunction())){var ge=this.startNode();return this.next(),z&&this.next(),this.parseFunction(ge,vn|Mn,!1,z)}else if(this.type===V._class){var Fe=this.startNode();return this.parseClass(Fe,"nullableID")}else{var Ue=this.parseMaybeAssign();return this.semicolon(),Ue}},qt.checkExport=function(z,ge,Fe){z&&(typeof ge!="string"&&(ge=ge.type==="Identifier"?ge.name:ge.value),Be(z,ge)&&this.raiseRecoverable(Fe,"Duplicate export '"+ge+"'"),z[ge]=!0)},qt.checkPatternExport=function(z,ge){var Fe=ge.type;if(Fe==="Identifier")this.checkExport(z,ge,ge.start);else if(Fe==="ObjectPattern")for(var Ue=0,Qe=ge.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkPatternExport(z,ut)}else if(Fe==="ArrayPattern")for(var pt=0,Vt=ge.elements;pt<Vt.length;pt+=1){var Ft=Vt[pt];Ft&&this.checkPatternExport(z,Ft)}else Fe==="Property"?this.checkPatternExport(z,ge.value):Fe==="AssignmentPattern"?this.checkPatternExport(z,ge.left):Fe==="RestElement"&&this.checkPatternExport(z,ge.argument)},qt.checkVariableExport=function(z,ge){if(z)for(var Fe=0,Ue=ge;Fe<Ue.length;Fe+=1){var Qe=Ue[Fe];this.checkPatternExport(z,Qe.id)}},qt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},qt.parseExportSpecifier=function(z){var ge=this.startNode();return ge.local=this.parseModuleExportName(),ge.exported=this.eatContextual("as")?this.parseModuleExportName():ge.local,this.checkExport(z,ge.exported,ge.exported.start),this.finishNode(ge,"ExportSpecifier")},qt.parseExportSpecifiers=function(z){var ge=[],Fe=!0;for(this.expect(V.braceL);!this.eat(V.braceR);){if(Fe)Fe=!1;else if(this.expect(V.comma),this.afterTrailingComma(V.braceR))break;ge.push(this.parseExportSpecifier(z))}return ge},qt.parseImport=function(z){return this.next(),this.type===V.string?(z.specifiers=Rn,z.source=this.parseExprAtom()):(z.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),z.source=this.type===V.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(z,"ImportDeclaration")},qt.parseImportSpecifier=function(){var z=this.startNode();return z.imported=this.parseModuleExportName(),this.eatContextual("as")?z.local=this.parseIdent():(this.checkUnreserved(z.imported),z.local=z.imported),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportSpecifier")},qt.parseImportDefaultSpecifier=function(){var z=this.startNode();return z.local=this.parseIdent(),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportDefaultSpecifier")},qt.parseImportNamespaceSpecifier=function(){var z=this.startNode();return this.next(),this.expectContextual("as"),z.local=this.parseIdent(),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportNamespaceSpecifier")},qt.parseImportSpecifiers=function(){var z=[],ge=!0;if(this.type===V.name&&(z.push(this.parseImportDefaultSpecifier()),!this.eat(V.comma)))return z;if(this.type===V.star)return z.push(this.parseImportNamespaceSpecifier()),z;for(this.expect(V.braceL);!this.eat(V.braceR);){if(ge)ge=!1;else if(this.expect(V.comma),this.afterTrailingComma(V.braceR))break;z.push(this.parseImportSpecifier())}return z},qt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===V.string){var z=this.parseLiteral(this.value);return We.test(z.value)&&this.raise(z.start,"An export name cannot include a lone surrogate."),z}return this.parseIdent(!0)},qt.adaptDirectivePrologue=function(z){for(var ge=0;ge<z.length&&this.isDirectiveCandidate(z[ge]);++ge)z[ge].directive=z[ge].expression.raw.slice(1,-1)},qt.isDirectiveCandidate=function(z){return this.options.ecmaVersion>=5&&z.type==="ExpressionStatement"&&z.expression.type==="Literal"&&typeof z.expression.value=="string"&&(this.input[z.start]==='"'||this.input[z.start]==="'")};var Jt=yt.prototype;Jt.toAssignable=function(z,ge,Fe){if(this.options.ecmaVersion>=6&&z)switch(z.type){case"Identifier":this.inAsync&&z.name==="await"&&this.raise(z.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":z.type="ObjectPattern",Fe&&this.checkPatternErrors(Fe,!0);for(var Ue=0,Qe=z.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.toAssignable(ut,ge),ut.type==="RestElement"&&(ut.argument.type==="ArrayPattern"||ut.argument.type==="ObjectPattern")&&this.raise(ut.argument.start,"Unexpected token")}break;case"Property":z.kind!=="init"&&this.raise(z.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(z.value,ge);break;case"ArrayExpression":z.type="ArrayPattern",Fe&&this.checkPatternErrors(Fe,!0),this.toAssignableList(z.elements,ge);break;case"SpreadElement":z.type="RestElement",this.toAssignable(z.argument,ge),z.argument.type==="AssignmentPattern"&&this.raise(z.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":z.operator!=="="&&this.raise(z.left.end,"Only '=' operator can be used for specifying default value."),z.type="AssignmentPattern",delete z.operator,this.toAssignable(z.left,ge);break;case"ParenthesizedExpression":this.toAssignable(z.expression,ge,Fe);break;case"ChainExpression":this.raiseRecoverable(z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ge)break;default:this.raise(z.start,"Assigning to rvalue")}else Fe&&this.checkPatternErrors(Fe,!0);return z},Jt.toAssignableList=function(z,ge){for(var Fe=z.length,Ue=0;Ue<Fe;Ue++){var Qe=z[Ue];Qe&&this.toAssignable(Qe,ge)}if(Fe){var ut=z[Fe-1];this.options.ecmaVersion===6&&ge&&ut&&ut.type==="RestElement"&&ut.argument.type!=="Identifier"&&this.unexpected(ut.argument.start)}return z},Jt.parseSpread=function(z){var ge=this.startNode();return this.next(),ge.argument=this.parseMaybeAssign(!1,z),this.finishNode(ge,"SpreadElement")},Jt.parseRestBinding=function(){var z=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==V.name&&this.unexpected(),z.argument=this.parseBindingAtom(),this.finishNode(z,"RestElement")},Jt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case V.bracketL:var z=this.startNode();return this.next(),z.elements=this.parseBindingList(V.bracketR,!0,!0),this.finishNode(z,"ArrayPattern");case V.braceL:return this.parseObj(!0)}return this.parseIdent()},Jt.parseBindingList=function(z,ge,Fe,Ue){for(var Qe=[],ut=!0;!this.eat(z);)if(ut?ut=!1:this.expect(V.comma),ge&&this.type===V.comma)Qe.push(null);else{if(Fe&&this.afterTrailingComma(z))break;if(this.type===V.ellipsis){var pt=this.parseRestBinding();this.parseBindingListItem(pt),Qe.push(pt),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(z);break}else Qe.push(this.parseAssignableListItem(Ue))}return Qe},Jt.parseAssignableListItem=function(z){var ge=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ge),ge},Jt.parseBindingListItem=function(z){return z},Jt.parseMaybeDefault=function(z,ge,Fe){if(Fe=Fe||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(V.eq))return Fe;var Ue=this.startNodeAt(z,ge);return Ue.left=Fe,Ue.right=this.parseMaybeAssign(),this.finishNode(Ue,"AssignmentPattern")},Jt.checkLValSimple=function(z,ge,Fe){ge===void 0&&(ge=Ke);var Ue=ge!==Ke;switch(z.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(z.name)&&this.raiseRecoverable(z.start,(Ue?"Binding ":"Assigning to ")+z.name+" in strict mode"),Ue&&(ge===Ze&&z.name==="let"&&this.raiseRecoverable(z.start,"let is disallowed as a lexically bound name"),Fe&&(Be(Fe,z.name)&&this.raiseRecoverable(z.start,"Argument name clash"),Fe[z.name]=!0),ge!==ft&&this.declareName(z.name,ge,z.start));break;case"ChainExpression":this.raiseRecoverable(z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":Ue&&this.raiseRecoverable(z.start,"Binding member expression");break;case"ParenthesizedExpression":return Ue&&this.raiseRecoverable(z.start,"Binding parenthesized expression"),this.checkLValSimple(z.expression,ge,Fe);default:this.raise(z.start,(Ue?"Binding":"Assigning to")+" rvalue")}},Jt.checkLValPattern=function(z,ge,Fe){switch(ge===void 0&&(ge=Ke),z.type){case"ObjectPattern":for(var Ue=0,Qe=z.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkLValInnerPattern(ut,ge,Fe)}break;case"ArrayPattern":for(var pt=0,Vt=z.elements;pt<Vt.length;pt+=1){var Ft=Vt[pt];Ft&&this.checkLValInnerPattern(Ft,ge,Fe)}break;default:this.checkLValSimple(z,ge,Fe)}},Jt.checkLValInnerPattern=function(z,ge,Fe){switch(ge===void 0&&(ge=Ke),z.type){case"Property":this.checkLValInnerPattern(z.value,ge,Fe);break;case"AssignmentPattern":this.checkLValPattern(z.left,ge,Fe);break;case"RestElement":this.checkLValPattern(z.argument,ge,Fe);break;default:this.checkLValPattern(z,ge,Fe)}};var Zt=function(ge,Fe,Ue,Qe,ut){this.token=ge,this.isExpr=!!Fe,this.preserveSpace=!!Ue,this.override=Qe,this.generator=!!ut},Ut={b_stat:new Zt("{",!1),b_expr:new Zt("{",!0),b_tmpl:new Zt("${",!1),p_stat:new Zt("(",!1),p_expr:new Zt("(",!0),q_tmpl:new Zt("`",!0,!0,function(z){return z.tryReadTemplateToken()}),f_stat:new Zt("function",!1),f_expr:new Zt("function",!0),f_expr_gen:new Zt("function",!0,!1,null,!0),f_gen:new Zt("function",!1,!1,null,!0)},tn=yt.prototype;tn.initialContext=function(){return[Ut.b_stat]},tn.curContext=function(){return this.context[this.context.length-1]},tn.braceIsBlock=function(z){var ge=this.curContext();return ge===Ut.f_expr||ge===Ut.f_stat?!0:z===V.colon&&(ge===Ut.b_stat||ge===Ut.b_expr)?!ge.isExpr:z===V._return||z===V.name&&this.exprAllowed?ne.test(this.input.slice(this.lastTokEnd,this.start)):z===V._else||z===V.semi||z===V.eof||z===V.parenR||z===V.arrow?!0:z===V.braceL?ge===Ut.b_stat:z===V._var||z===V._const||z===V.name?!1:!this.exprAllowed},tn.inGeneratorContext=function(){for(var z=this.context.length-1;z>=1;z--){var ge=this.context[z];if(ge.token==="function")return ge.generator}return!1},tn.updateContext=function(z){var ge,Fe=this.type;Fe.keyword&&z===V.dot?this.exprAllowed=!1:(ge=Fe.updateContext)?ge.call(this,z):this.exprAllowed=Fe.beforeExpr},tn.overrideContext=function(z){this.curContext()!==z&&(this.context[this.context.length-1]=z)},V.parenR.updateContext=V.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var z=this.context.pop();z===Ut.b_stat&&this.curContext().token==="function"&&(z=this.context.pop()),this.exprAllowed=!z.isExpr},V.braceL.updateContext=function(z){this.context.push(this.braceIsBlock(z)?Ut.b_stat:Ut.b_expr),this.exprAllowed=!0},V.dollarBraceL.updateContext=function(){this.context.push(Ut.b_tmpl),this.exprAllowed=!0},V.parenL.updateContext=function(z){var ge=z===V._if||z===V._for||z===V._with||z===V._while;this.context.push(ge?Ut.p_stat:Ut.p_expr),this.exprAllowed=!0},V.incDec.updateContext=function(){},V._function.updateContext=V._class.updateContext=function(z){z.beforeExpr&&z!==V._else&&!(z===V.semi&&this.curContext()!==Ut.p_stat)&&!(z===V._return&&ne.test(this.input.slice(this.lastTokEnd,this.start)))&&!((z===V.colon||z===V.braceL)&&this.curContext()===Ut.b_stat)?this.context.push(Ut.f_expr):this.context.push(Ut.f_stat),this.exprAllowed=!1},V.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},V.backQuote.updateContext=function(){this.curContext()===Ut.q_tmpl?this.context.pop():this.context.push(Ut.q_tmpl),this.exprAllowed=!1},V.star.updateContext=function(z){if(z===V._function){var ge=this.context.length-1;this.context[ge]===Ut.f_expr?this.context[ge]=Ut.f_expr_gen:this.context[ge]=Ut.f_gen}this.exprAllowed=!0},V.name.updateContext=function(z){var ge=!1;this.options.ecmaVersion>=6&&z!==V.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(ge=!0),this.exprAllowed=ge};var Yt=yt.prototype;Yt.checkPropClash=function(z,ge,Fe){if(!(this.options.ecmaVersion>=9&&z.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(z.computed||z.method||z.shorthand))){var Ue=z.key,Qe;switch(Ue.type){case"Identifier":Qe=Ue.name;break;case"Literal":Qe=String(Ue.value);break;default:return}var ut=z.kind;if(this.options.ecmaVersion>=6){Qe==="__proto__"&&ut==="init"&&(ge.proto&&(Fe?Fe.doubleProto<0&&(Fe.doubleProto=Ue.start):this.raiseRecoverable(Ue.start,"Redefinition of __proto__ property")),ge.proto=!0);return}Qe="$"+Qe;var pt=ge[Qe];if(pt){var Vt;ut==="init"?Vt=this.strict&&pt.init||pt.get||pt.set:Vt=pt.init||pt[ut],Vt&&this.raiseRecoverable(Ue.start,"Redefinition of property")}else pt=ge[Qe]={init:!1,get:!1,set:!1};pt[ut]=!0}},Yt.parseExpression=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseMaybeAssign(z,ge);if(this.type===V.comma){var ut=this.startNodeAt(Fe,Ue);for(ut.expressions=[Qe];this.eat(V.comma);)ut.expressions.push(this.parseMaybeAssign(z,ge));return this.finishNode(ut,"SequenceExpression")}return Qe},Yt.parseMaybeAssign=function(z,ge,Fe){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(z);this.exprAllowed=!1}var Ue=!1,Qe=-1,ut=-1,pt=-1;ge?(Qe=ge.parenthesizedAssign,ut=ge.trailingComma,pt=ge.doubleProto,ge.parenthesizedAssign=ge.trailingComma=-1):(ge=new hn,Ue=!0);var Vt=this.start,Ft=this.startLoc;(this.type===V.parenL||this.type===V.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=z==="await");var nn=this.parseMaybeConditional(z,ge);if(Fe&&(nn=Fe.call(this,nn,Vt,Ft)),this.type.isAssign){var Qt=this.startNodeAt(Vt,Ft);return Qt.operator=this.value,this.type===V.eq&&(nn=this.toAssignable(nn,!1,ge)),Ue||(ge.parenthesizedAssign=ge.trailingComma=ge.doubleProto=-1),ge.shorthandAssign>=nn.start&&(ge.shorthandAssign=-1),this.type===V.eq?this.checkLValPattern(nn):this.checkLValSimple(nn),Qt.left=nn,this.next(),Qt.right=this.parseMaybeAssign(z),pt>-1&&(ge.doubleProto=pt),this.finishNode(Qt,"AssignmentExpression")}else Ue&&this.checkExpressionErrors(ge,!0);return Qe>-1&&(ge.parenthesizedAssign=Qe),ut>-1&&(ge.trailingComma=ut),nn},Yt.parseMaybeConditional=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseExprOps(z,ge);if(this.checkExpressionErrors(ge))return Qe;if(this.eat(V.question)){var ut=this.startNodeAt(Fe,Ue);return ut.test=Qe,ut.consequent=this.parseMaybeAssign(),this.expect(V.colon),ut.alternate=this.parseMaybeAssign(z),this.finishNode(ut,"ConditionalExpression")}return Qe},Yt.parseExprOps=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseMaybeUnary(ge,!1,!1,z);return this.checkExpressionErrors(ge)||Qe.start===Fe&&Qe.type==="ArrowFunctionExpression"?Qe:this.parseExprOp(Qe,Fe,Ue,-1,z)},Yt.parseExprOp=function(z,ge,Fe,Ue,Qe){var ut=this.type.binop;if(ut!=null&&(!Qe||this.type!==V._in)&&ut>Ue){var pt=this.type===V.logicalOR||this.type===V.logicalAND,Vt=this.type===V.coalesce;Vt&&(ut=V.logicalAND.binop);var Ft=this.value;this.next();var nn=this.start,Qt=this.startLoc,_n=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Qe),nn,Qt,ut,Qe),Gn=this.buildBinary(ge,Fe,z,_n,Ft,pt||Vt);return(pt&&this.type===V.coalesce||Vt&&(this.type===V.logicalOR||this.type===V.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(Gn,ge,Fe,Ue,Qe)}return z},Yt.buildBinary=function(z,ge,Fe,Ue,Qe,ut){Ue.type==="PrivateIdentifier"&&this.raise(Ue.start,"Private identifier can only be left side of binary expression");var pt=this.startNodeAt(z,ge);return pt.left=Fe,pt.operator=Qe,pt.right=Ue,this.finishNode(pt,ut?"LogicalExpression":"BinaryExpression")},Yt.parseMaybeUnary=function(z,ge,Fe,Ue){var Qe=this.start,ut=this.startLoc,pt;if(this.isContextual("await")&&this.canAwait)pt=this.parseAwait(Ue),ge=!0;else if(this.type.prefix){var Vt=this.startNode(),Ft=this.type===V.incDec;Vt.operator=this.value,Vt.prefix=!0,this.next(),Vt.argument=this.parseMaybeUnary(null,!0,Ft,Ue),this.checkExpressionErrors(z,!0),Ft?this.checkLValSimple(Vt.argument):this.strict&&Vt.operator==="delete"&&an(Vt.argument)?this.raiseRecoverable(Vt.start,"Deleting local variable in strict mode"):Vt.operator==="delete"&&mn(Vt.argument)?this.raiseRecoverable(Vt.start,"Private fields can not be deleted"):ge=!0,pt=this.finishNode(Vt,Ft?"UpdateExpression":"UnaryExpression")}else if(!ge&&this.type===V.privateId)(Ue||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),pt=this.parsePrivateIdent(),this.type!==V._in&&this.unexpected();else{if(pt=this.parseExprSubscripts(z,Ue),this.checkExpressionErrors(z))return pt;for(;this.type.postfix&&!this.canInsertSemicolon();){var nn=this.startNodeAt(Qe,ut);nn.operator=this.value,nn.prefix=!1,nn.argument=pt,this.checkLValSimple(pt),this.next(),pt=this.finishNode(nn,"UpdateExpression")}}if(!Fe&&this.eat(V.starstar))if(ge)this.unexpected(this.lastTokStart);else return this.buildBinary(Qe,ut,pt,this.parseMaybeUnary(null,!1,!1,Ue),"**",!1);else return pt};function an(z){return z.type==="Identifier"||z.type==="ParenthesizedExpression"&&an(z.expression)}function mn(z){return z.type==="MemberExpression"&&z.property.type==="PrivateIdentifier"||z.type==="ChainExpression"&&mn(z.expression)||z.type==="ParenthesizedExpression"&&mn(z.expression)}Yt.parseExprSubscripts=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseExprAtom(z,ge);if(Qe.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Qe;var ut=this.parseSubscripts(Qe,Fe,Ue,!1,ge);return z&&ut.type==="MemberExpression"&&(z.parenthesizedAssign>=ut.start&&(z.parenthesizedAssign=-1),z.parenthesizedBind>=ut.start&&(z.parenthesizedBind=-1),z.trailingComma>=ut.start&&(z.trailingComma=-1)),ut},Yt.parseSubscripts=function(z,ge,Fe,Ue,Qe){for(var ut=this.options.ecmaVersion>=8&&z.type==="Identifier"&&z.name==="async"&&this.lastTokEnd===z.end&&!this.canInsertSemicolon()&&z.end-z.start===5&&this.potentialArrowAt===z.start,pt=!1;;){var Vt=this.parseSubscript(z,ge,Fe,Ue,ut,pt,Qe);if(Vt.optional&&(pt=!0),Vt===z||Vt.type==="ArrowFunctionExpression"){if(pt){var Ft=this.startNodeAt(ge,Fe);Ft.expression=Vt,Vt=this.finishNode(Ft,"ChainExpression")}return Vt}z=Vt}},Yt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(V.arrow)},Yt.parseSubscriptAsyncArrow=function(z,ge,Fe,Ue){return this.parseArrowExpression(this.startNodeAt(z,ge),Fe,!0,Ue)},Yt.parseSubscript=function(z,ge,Fe,Ue,Qe,ut,pt){var Vt=this.options.ecmaVersion>=11,Ft=Vt&&this.eat(V.questionDot);Ue&&Ft&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var nn=this.eat(V.bracketL);if(nn||Ft&&this.type!==V.parenL&&this.type!==V.backQuote||this.eat(V.dot)){var Qt=this.startNodeAt(ge,Fe);Qt.object=z,nn?(Qt.property=this.parseExpression(),this.expect(V.bracketR)):this.type===V.privateId&&z.type!=="Super"?Qt.property=this.parsePrivateIdent():Qt.property=this.parseIdent(this.options.allowReserved!=="never"),Qt.computed=!!nn,Vt&&(Qt.optional=Ft),z=this.finishNode(Qt,"MemberExpression")}else if(!Ue&&this.eat(V.parenL)){var _n=new hn,Gn=this.yieldPos,rr=this.awaitPos,Yn=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var gr=this.parseExprList(V.parenR,this.options.ecmaVersion>=8,!1,_n);if(Qe&&!Ft&&this.shouldParseAsyncArrow())return this.checkPatternErrors(_n,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=Gn,this.awaitPos=rr,this.awaitIdentPos=Yn,this.parseSubscriptAsyncArrow(ge,Fe,gr,pt);this.checkExpressionErrors(_n,!0),this.yieldPos=Gn||this.yieldPos,this.awaitPos=rr||this.awaitPos,this.awaitIdentPos=Yn||this.awaitIdentPos;var Jn=this.startNodeAt(ge,Fe);Jn.callee=z,Jn.arguments=gr,Vt&&(Jn.optional=Ft),z=this.finishNode(Jn,"CallExpression")}else if(this.type===V.backQuote){(Ft||ut)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Xn=this.startNodeAt(ge,Fe);Xn.tag=z,Xn.quasi=this.parseTemplate({isTagged:!0}),z=this.finishNode(Xn,"TaggedTemplateExpression")}return z},Yt.parseExprAtom=function(z,ge,Fe){this.type===V.slash&&this.readRegexp();var Ue,Qe=this.potentialArrowAt===this.start;switch(this.type){case V._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),Ue=this.startNode(),this.next(),this.type===V.parenL&&!this.allowDirectSuper&&this.raise(Ue.start,"super() call outside constructor of a subclass"),this.type!==V.dot&&this.type!==V.bracketL&&this.type!==V.parenL&&this.unexpected(),this.finishNode(Ue,"Super");case V._this:return Ue=this.startNode(),this.next(),this.finishNode(Ue,"ThisExpression");case V.name:var ut=this.start,pt=this.startLoc,Vt=this.containsEsc,Ft=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Vt&&Ft.name==="async"&&!this.canInsertSemicolon()&&this.eat(V._function))return this.overrideContext(Ut.f_expr),this.parseFunction(this.startNodeAt(ut,pt),0,!1,!0,ge);if(Qe&&!this.canInsertSemicolon()){if(this.eat(V.arrow))return this.parseArrowExpression(this.startNodeAt(ut,pt),[Ft],!1,ge);if(this.options.ecmaVersion>=8&&Ft.name==="async"&&this.type===V.name&&!Vt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Ft=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(V.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(ut,pt),[Ft],!0,ge)}return Ft;case V.regexp:var nn=this.value;return Ue=this.parseLiteral(nn.value),Ue.regex={pattern:nn.pattern,flags:nn.flags},Ue;case V.num:case V.string:return this.parseLiteral(this.value);case V._null:case V._true:case V._false:return Ue=this.startNode(),Ue.value=this.type===V._null?null:this.type===V._true,Ue.raw=this.type.keyword,this.next(),this.finishNode(Ue,"Literal");case V.parenL:var Qt=this.start,_n=this.parseParenAndDistinguishExpression(Qe,ge);return z&&(z.parenthesizedAssign<0&&!this.isSimpleAssignTarget(_n)&&(z.parenthesizedAssign=Qt),z.parenthesizedBind<0&&(z.parenthesizedBind=Qt)),_n;case V.bracketL:return Ue=this.startNode(),this.next(),Ue.elements=this.parseExprList(V.bracketR,!0,!0,z),this.finishNode(Ue,"ArrayExpression");case V.braceL:return this.overrideContext(Ut.b_expr),this.parseObj(!1,z);case V._function:return Ue=this.startNode(),this.next(),this.parseFunction(Ue,0);case V._class:return this.parseClass(this.startNode(),!1);case V._new:return this.parseNew();case V.backQuote:return this.parseTemplate();case V._import:return this.options.ecmaVersion>=11?this.parseExprImport(Fe):this.unexpected();default:return this.parseExprAtomDefault()}},Yt.parseExprAtomDefault=function(){this.unexpected()},Yt.parseExprImport=function(z){var ge=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===V.parenL&&!z)return this.parseDynamicImport(ge);if(this.type===V.dot){var Fe=this.startNodeAt(ge.start,ge.loc&&ge.loc.start);return Fe.name="import",ge.meta=this.finishNode(Fe,"Identifier"),this.parseImportMeta(ge)}else this.unexpected()},Yt.parseDynamicImport=function(z){if(this.next(),z.source=this.parseMaybeAssign(),!this.eat(V.parenR)){var ge=this.start;this.eat(V.comma)&&this.eat(V.parenR)?this.raiseRecoverable(ge,"Trailing comma is not allowed in import()"):this.unexpected(ge)}return this.finishNode(z,"ImportExpression")},Yt.parseImportMeta=function(z){this.next();var ge=this.containsEsc;return z.property=this.parseIdent(!0),z.property.name!=="meta"&&this.raiseRecoverable(z.property.start,"The only valid meta property for import is 'import.meta'"),ge&&this.raiseRecoverable(z.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(z.start,"Cannot use 'import.meta' outside a module"),this.finishNode(z,"MetaProperty")},Yt.parseLiteral=function(z){var ge=this.startNode();return ge.value=z,ge.raw=this.input.slice(this.start,this.end),ge.raw.charCodeAt(ge.raw.length-1)===110&&(ge.bigint=ge.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(ge,"Literal")},Yt.parseParenExpression=function(){this.expect(V.parenL);var z=this.parseExpression();return this.expect(V.parenR),z},Yt.shouldParseArrow=function(z){return!this.canInsertSemicolon()},Yt.parseParenAndDistinguishExpression=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe,ut=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var pt=this.start,Vt=this.startLoc,Ft=[],nn=!0,Qt=!1,_n=new hn,Gn=this.yieldPos,rr=this.awaitPos,Yn;for(this.yieldPos=0,this.awaitPos=0;this.type!==V.parenR;)if(nn?nn=!1:this.expect(V.comma),ut&&this.afterTrailingComma(V.parenR,!0)){Qt=!0;break}else if(this.type===V.ellipsis){Yn=this.start,Ft.push(this.parseParenItem(this.parseRestBinding())),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Ft.push(this.parseMaybeAssign(!1,_n,this.parseParenItem));var gr=this.lastTokEnd,Jn=this.lastTokEndLoc;if(this.expect(V.parenR),z&&this.shouldParseArrow(Ft)&&this.eat(V.arrow))return this.checkPatternErrors(_n,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Gn,this.awaitPos=rr,this.parseParenArrowList(Fe,Ue,Ft,ge);(!Ft.length||Qt)&&this.unexpected(this.lastTokStart),Yn&&this.unexpected(Yn),this.checkExpressionErrors(_n,!0),this.yieldPos=Gn||this.yieldPos,this.awaitPos=rr||this.awaitPos,Ft.length>1?(Qe=this.startNodeAt(pt,Vt),Qe.expressions=Ft,this.finishNodeAt(Qe,"SequenceExpression",gr,Jn)):Qe=Ft[0]}else Qe=this.parseParenExpression();if(this.options.preserveParens){var Xn=this.startNodeAt(Fe,Ue);return Xn.expression=Qe,this.finishNode(Xn,"ParenthesizedExpression")}else return Qe},Yt.parseParenItem=function(z){return z},Yt.parseParenArrowList=function(z,ge,Fe,Ue){return this.parseArrowExpression(this.startNodeAt(z,ge),Fe,!1,Ue)};var On=[];Yt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var z=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===V.dot){var ge=this.startNodeAt(z.start,z.loc&&z.loc.start);ge.name="new",z.meta=this.finishNode(ge,"Identifier"),this.next();var Fe=this.containsEsc;return z.property=this.parseIdent(!0),z.property.name!=="target"&&this.raiseRecoverable(z.property.start,"The only valid meta property for new is 'new.target'"),Fe&&this.raiseRecoverable(z.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(z.start,"'new.target' can only be used in functions and class static block"),this.finishNode(z,"MetaProperty")}var Ue=this.start,Qe=this.startLoc;return z.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Ue,Qe,!0,!1),this.eat(V.parenL)?z.arguments=this.parseExprList(V.parenR,this.options.ecmaVersion>=8,!1):z.arguments=On,this.finishNode(z,"NewExpression")},Yt.parseTemplateElement=function(z){var ge=z.isTagged,Fe=this.startNode();return this.type===V.invalidTemplate?(ge||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Fe.value={raw:this.value.replace(/\r\n?/g,`
1230
1225
  `),cooked:null}):Fe.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
@@ -1242,7 +1237,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
1242
1237
  `;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},pp.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(types$1.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
1243
1238
  `&&++this.pos;case`
1244
1239
  `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},pp.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
1245
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var o=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(o,8);return l>255&&(o=o.slice(0,-1),l=parseInt(o,8)),this.pos+=o.length-1,t=this.input.charCodeAt(this.pos),(o!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-o.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},pp.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},pp.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,o=this.options.ecmaVersion>=6;this.pos<this.input.length;){var l=this.fullCharCodeAtPos();if(isIdentifierChar(l,o))this.pos+=l<=65535?1:2;else if(l===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var d=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var f=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(f,o)||this.invalidStringToken(d,"Invalid Unicode escape"),e+=codePointToString(f),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},pp.readWord=function(){var e=this.readWord1(),t=types$1.name;return this.keywords.test(e)&&(t=keywords[e]),this.finishToken(t,e)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node:Node$3,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var AcornJSX=__toESM(require_acorn_jsx()),attributeNames_default={acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",colspan:"colSpan",contenteditable:"contentEditable",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",for:"htmlFor",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",httpequiv:"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"},VOID_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],NO_WHITESPACE=["table","tbody","tfoot","thead","tr"];function canHaveChildren(e){return VOID_ELEMENTS.indexOf(e.toLowerCase())===-1}function canHaveWhitespace(e){return NO_WHITESPACE.indexOf(e.toLowerCase())!==-1}class NullishShortCircuit extends Error{constructor(t="Nullish value encountered"){super(t),this.name="NullishShortCircuit"}}var hash=(e="",t=16)=>{const n=String(e);let o=0;return n.split("").forEach(l=>{o=(o<<5)-o+l.charCodeAt(0),o&=o}),Math.abs(o).toString(t)},randomHash=()=>hash(Math.random().toString()),camelCase=e=>e.replace(/([A-Z])([A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g," ").toLowerCase().split(" ").filter(t=>t).map((t,n)=>n>0?t[0].toUpperCase()+t.slice(1):t).join(""),parseStyle=e=>{switch(typeof e){case"string":return e.split(";").filter(t=>t).reduce((t,n)=>{const o=n.slice(0,n.indexOf(":")).trim(),l=n.slice(n.indexOf(":")+1).trim();return{...t,[camelCase(o)]:l}},{});case"object":return e;default:return}},pathToArrayPath=e=>e==null||e===""?[]:e.split("."),resolveArrayPath=(e,t)=>{const[n,...o]=t;if(!(e==null||n==null))return o.length===0?e[n]:resolveArrayPath(e[n],o)},resolvePath=(e,t)=>resolveArrayPath(e,pathToArrayPath(t));function handleNaN(e){return Number.isNaN(e)?"NaN":e}class JsxParser extends React.Component{constructor(){super(...arguments);en(this,"ParsedChildren",null);zn(this,fn,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{return d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[],d.map(f=>on(this,rn).call(this,f)).filter(Boolean)}catch(f){return this.props.showWarnings&&console.warn(f),this.props.onError&&this.props.onError(f),this.props.renderError?this.props.renderError({error:String(f)}):null}});zn(this,rn,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:on(this,rn).call(this,n.value,o);case"JSXElement":case"JSXFragment":return on(this,Qn).call(this,n,o);case"JSXExpressionContainer":return on(this,rn).call(this,n.expression,o);case"JSXText":const f=this.props.disableKeyGeneration?void 0:randomHash();return this.props.disableFragments?n.value:React.createElement(React.Fragment,{key:f},n.value);case"ArrayExpression":return n.elements.map(A=>on(this,rn).call(this,A,o));case"BinaryExpression":const g=on(this,rn).call(this,n.left,o),b=on(this,rn).call(this,n.right,o);let _;switch(n.operator){case"-":_=g-b;break;case"!=":_=g!=b;break;case"!==":_=g!==b;break;case"*":_=g*b;break;case"**":_=g**b;break;case"/":_=g/b;break;case"%":_=g%b;break;case"+":_=g+b;break;case"<":_=g<b;break;case"<=":_=g<=b;break;case"==":_=g==b;break;case"===":_=g===b;break;case">":_=g>b;break;case">=":_=g>=b;break;default:this.props.onError(new Error(`Unsupported binary operator: ${n.operator}`));return}return handleNaN(_);case"CallExpression":const S=on(this,rn).call(this,n.callee,o);if(S===void 0){if(n.optional)throw new NullishShortCircuit;this.props.onError(new Error(`The expression '${n.callee}' could not be resolved, resulting in an undefined return value.`));return}return S(...n.arguments.map(A=>on(this,rn).call(this,A,o)));case"ConditionalExpression":return on(this,rn).call(this,n.test,o)?on(this,rn).call(this,n.consequent,o):on(this,rn).call(this,n.alternate,o);case"ExpressionStatement":return on(this,rn).call(this,n.expression,o);case"Identifier":return n.name==="Infinity"?1/0:n.name==="-Infinity"?-1/0:n.name==="NaN"?NaN:o&&n.name in o?handleNaN(o[n.name]):handleNaN((this.props.bindings||{})[n.name]);case"Literal":return n.value;case"LogicalExpression":const R=on(this,rn).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?on(this,rn).call(this,n.right,o):!1;case"MemberExpression":return on(this,ar).call(this,n,o);case"ChainExpression":return on(this,ir).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=on(this,rn).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,M)=>A.start<M.start?-1:1).map(A=>on(this,rn).call(this,A,o)).join("");case"UnaryExpression":const E=on(this,rn).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!E;case"~":return~E;case"typeof":return typeof E}return;case"ArrowFunctionExpression":return(n.async||n.generator)&&((d=(l=this.props).onError)==null||d.call(l,new Error("Async and generator arrow functions are not supported."))),(...A)=>{const M={...o};return n.params.forEach((I,j)=>{M[I.name]=A[j]}),on(this,rn).call(this,n.body,M)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});zn(this,ir,(n,o)=>{try{return on(this,rn).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});zn(this,ar,(n,o)=>{const l=on(this,rn).call(this,n.object,o);let d;if(n.computed)d=on(this,rn).call(this,n.property,o);else if(n.property.type==="Identifier")d=n.property.name;else{this.props.onError(new Error("Only simple MemberExpressions are supported."));return}if(l==null&&n.optional)throw new NullishShortCircuit;let f;try{f=l[d]}catch{this.props.onError(new Error(`The property '${d}' could not be resolved on the object '${l}'.`));return}return typeof f=="function"?f.bind(l):f});zn(this,Wn,n=>n.type==="JSXIdentifier"?n.name:`${on(this,Wn).call(this,n.object)}.${on(this,Wn).call(this,n.property)}`);zn(this,Qn,(n,o)=>{const{allowUnknownElements:l,components:d,componentsOnly:f,onError:g}=this.props,{children:b=[]}=n,_=n.type==="JSXElement"?n.openingElement:n.openingFragment,{attributes:S=[]}=_,R=n.type==="JSXElement"?on(this,Wn).call(this,_.name):"",C=(this.props.blacklistedAttrs||[]).map(Q=>Q instanceof RegExp?Q:new RegExp(Q,"i")),E=(this.props.blacklistedTags||[]).map(Q=>Q.trim().toLowerCase()).filter(Boolean);if(/^(html|head|body)$/i.test(R))return b.map(Q=>on(this,Qn).call(this,Q,o));const A=R.trim().toLowerCase();if(E.indexOf(A)!==-1)return g(new Error(`The tag <${R}> is blacklisted, and will not be rendered.`)),null;if(R!==""&&!resolvePath(d,R)){if(f)return g(new Error(`The component <${R}> is unrecognized, and will not be rendered.`)),this.props.renderUnrecognized(R);if(!l&&document.createElement(R)instanceof HTMLUnknownElement)return g(new Error(`The tag <${R}> is unrecognized in this browser, and will not be rendered.`)),this.props.renderUnrecognized(R)}let M,I=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(I||canHaveChildren(R)){if(M=b.map(te=>on(this,rn).call(this,te,o)),R.includes(".")){const F=R.split(".").reduce((V,ne)=>V?V[ne]:d==null?void 0:d[ne],null);F&&(I=F)}!I&&!canHaveWhitespace(R)&&(M=M.filter(te=>typeof te!="string"||!/^\s*$/.test(te)));const Q=M.find(te=>typeof te=="function");M.length===0?M=void 0:Q?M=Q:M.length===1?[M]=M:M.length>1&&!this.props.disableKeyGeneration&&(M=M.map((te,F)=>te!=null&&te.type&&!(te!=null&&te.key)?{...te,key:te.key||F}:te))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(Q=>{if(Q.type==="JSXAttribute"){const te=Q.name.name,F=attributeNames_default[te]||te,V=on(this,rn).call(this,Q,o);C.filter(ae=>ae.test(F)).length===0&&(j[F]=V)}else if(Q.type==="JSXSpreadAttribute"&&Q.argument.type==="Identifier"||Q.argument.type==="MemberExpression"){const te=on(this,rn).call(this,Q.argument,o);typeof te=="object"&&Object.keys(te).forEach(F=>{const V=attributeNames_default[F]||F;C.filter(ae=>ae.test(V)).length===0&&(j[V]=te[F])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const q=R.toLowerCase();return q==="option"&&(M=M.props.children),React.createElement(I||q,j,M)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=on(this,fn).call(this,n);const o=[...new Set(["jsx-parser",...String(this.props.className).split(" ")])].filter(Boolean).join(" ");return this.props.renderInWrapper?React.createElement("div",{className:o},this.ParsedChildren):this.ParsedChildren}}fn=new WeakMap,rn=new WeakMap,ir=new WeakMap,ar=new WeakMap,Wn=new WeakMap,Qn=new WeakMap,en(JsxParser,"displayName","JsxParser"),en(JsxParser,"defaultProps",{allowUnknownElements:!0,autoCloseVoidElements:!1,bindings:{},blacklistedAttrs:[/^on.+/i],blacklistedTags:["script"],className:"",components:{},componentsOnly:!1,disableFragments:!1,disableKeyGeneration:!1,jsx:"",onError:()=>{},showWarnings:!1,renderError:void 0,renderInWrapper:!0,renderUnrecognized:()=>null});var source_default=JsxParser;const CountryFlag=({countryCode:e,className:t=""})=>{const[n,o]=React.useState(null),[l,d]=React.useState(!1);return React.useEffect(()=>{if(!e)return;const g=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(g,{method:"HEAD"}).then(b=>{b.ok?(o(g),d(!1)):d(!0)}).catch(()=>{d(!0)})},[e]),l||!n?jsxRuntime.jsx("span",{className:t,children:e}):jsxRuntime.jsx("img",{src:n,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function ProductCard({applicationId:e,product:t,viewProductLink:n,defaultOpportunityNumber:o="",onAddToCart:l,addingToCart:d=!1,shopifyHostname:f,customAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var $t,rt,Rt,dt,It,Mt,Ct,Ke,Ye;const b=reactRouterDom.useNavigate(),{toast:_}=useToast(),[S,R]=React.useState(1),[C,E]=React.useState(null),[A,M]=React.useState(0),[I,j]=React.useState(!1),[q]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),[Q,te]=React.useState(!1),[F,V]=React.useState(null),[ne,ae]=React.useState("idle"),[se,Oe]=React.useState(null),[Ne]=useLazyGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery(),oe=(($t=t==null?void 0:t.Distribution)==null?void 0:$t.Cost)||0,$e=((rt=t==null?void 0:t.Distribution)==null?void 0:rt.RegularPrice)||0,Ae=((Rt=t==null?void 0:t.Distribution)==null?void 0:Rt.Price)||0,je=!!(e&&(t!=null&&t.RandmarSKU));React.useEffect(()=>{R(1),E(null),M(0)},[t==null?void 0:t.RandmarSKU]),React.useEffect(()=>{var Ze;if(t&&o){const ct=(Ze=t.Opportunities)==null?void 0:Ze.find(mt=>mt.BidNumber==o);ct&&Be(ct)&&E(ct)}},[t,o]),React.useEffect(()=>{if(!t)return;const Ze=C!=null&&C.Price?C.Price:Ae;M($e>0?Math.round(($e-Ze)/$e*100):0)},[t,C,Ae,$e]),React.useEffect(()=>{d||R(1)},[d]),React.useEffect(()=>{if(!Q){V(null),ae("idle"),Oe(null);return}if(!e||!(t!=null&&t.RandmarSKU)){ae("error"),Oe("Missing identifiers to load performance data.");return}let Ze=!1;const ct=t.RandmarSKU;return(async()=>{ae("summary"),Oe(null);try{const ft=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!1});if(Ze)return;if("error"in ft&&ft.error)throw ft.error;V(ft.data??null),ae("detailed");const yt=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!0});if(Ze)return;if("error"in yt&&yt.error)throw yt.error;V(yt.data??ft.data??null),ae("complete")}catch(ft){if(Ze)return;console.error("Failed to load performance data for product modal",ft),ae("error"),Oe("We couldn't load the performance details. Please try again.")}})(),()=>{Ze=!0}},[e,Ne,Q,t==null?void 0:t.RandmarSKU]);const Be=Ze=>{if(Ze.Active!==!0)return!1;const ct=new Date().toISOString().split("T")[0];return!(Ze.EndDate&&Ze.EndDate.split("T")[0]<ct||Ze.StartDate&&Ze.StartDate.split("T")[0]>ct)},qe=Ze=>Ze>=90?{label:"Top 10% Bestseller",color:"text-purple-950",bgColor:"bg-purple-200"}:Ze>=75?{label:"Bestseller",color:"text-blue-700",bgColor:"bg-blue-50"}:Ze>=33?{label:"Popular",color:"text-green-700",bgColor:"bg-green-50"}:{label:"Rising",color:"text-gray-700",bgColor:"bg-white"},Ve=ne!=="complete"&&ne!=="error",Le=ne==="summary"?40:ne==="detailed"?80:10,He=(F==null?void 0:F.SalesStatistics)??[],We=Ve?[]:He,ze=(F==null?void 0:F.RandmarTitle)??(t==null?void 0:t.RandmarTitle)??(t==null?void 0:t.RandmarSKU)??"this product",Xe=(F==null?void 0:F.RandmarSKU)??(t==null?void 0:t.RandmarSKU);if(!t)return jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-28 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx("div",{className:"w-60 h-40",children:jsxRuntime.jsx(Skeleton,{className:"w-full h-full rounded-lg"})})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24 mb-3"}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-full rounded-md"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 mt-4"})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 flex-1 rounded-md"})]})]})]})});const nt=(t==null?void 0:t.Opportunities)||[],Je=nt.length>0,st=()=>{if(S==null){R(1);return}S>1&&R(S-1)},et=()=>{if(S==null){R(1);return}R(S+1)},at=Ze=>{const ct=Number.parseInt(Ze.target.value,10);if(!isNaN(ct)&&ct>0){R(ct);return}R(void 0)},tt=()=>{(S==null||S<1)&&R(1)},ot=Ze=>{try{return new Date(Ze).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(ct){return console.error(ct),Ze.split("T")[0]||"N/A"}},lt=()=>{typeof l<"u"&&l({quantity:S??1,bidNumber:(C==null?void 0:C.BidNumber)??null})},Ge=()=>{I||!f||(j(!0),q({routeResellerId:e??"",randmarSku:t.RandmarSKU??"",shopifyHostName:f}).then(Ze=>{if(Ze.error){console.error("Error syncing to Shopify:",Ze.error),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}_({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Ze=>{console.error("Error syncing to Shopify:",Ze),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{j(!1)}))};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Card,{className:"w-full hover:shadow-lg transition-shadow @container",children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-xl",children:t.Title||t.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex items-center justify-end ml-4 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,name:t.ManufacturerName,width:96,height:40},`partner_logo_${t.ManufacturerId}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1 @[36rem]:order-1 order-2 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-center @[36rem]:items-start @[36rem]:justify-start",children:[t.State&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Check,{size:"12",className:"mr-1.5"})," ",t.State]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[jsxRuntime.jsx(QrCode,{size:"12",className:"mr-1.5"})," ",t.SerialNumber?"Serialized":"Unserialized"]}),t.TransparencyCode&&jsxRuntime.jsxs(Badge,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[jsxRuntime.jsx(CircleDashed,{size:"12",className:"mr-1.5"})," Transparency Code"]}),t.AvailableToBuy!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(ShoppingCart,{size:"12",className:"mr-1.5"})," ",t.AvailableToBuy?"Available":"Unavailable"]}),t.ManufacturerCategory!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${(dt=t.ManufacturerCategory)!=null&&dt.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[jsxRuntime.jsx(ShieldCheck,{size:"12",className:"mr-1.5"})," ",(It=t.ManufacturerCategory)!=null&&It.QualificationRequired?"Qualified Only":"Available to all"]}),t.ManufacturerId&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(RefreshCw,{size:"12",className:"mr-1.5"})," ",t.AutoUpdate?`Automatic Reorder (${t.MasterCarton})`:"Manually Reorders"]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.BodyHTML&&t.Title&&t.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Store,{size:"12",className:"mr-1.5"})," ",t.BodyHTML&&t.Title&&t.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.MPN||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UPC||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UnitWeight?`${formatNumber(t.UnitWeight)} lbs`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["MAP",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),"MSRP"]}),jsxRuntime.jsxs("div",{className:"font-medium",children:[t.MAP?formatMoney(t.MAP):"N/A",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),t.MSRP?formatMoney(t.MSRP):"N/A"]})]}),!!t.OverallPercentileRank&&!!t.ManufacturerPercentileRank&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Bestseller Status"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{children:"Global: "}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.OverallPercentileRank).bgColor} ${qe(t.OverallPercentileRank).color} hover:${qe(t.OverallPercentileRank).bgColor}`,children:qe(t.OverallPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.OverallPercentileRank]})})]})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{children:[t.ManufacturerName,": "]}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.ManufacturerPercentileRank).bgColor} ${qe(t.ManufacturerPercentileRank).color} hover:${qe(t.ManufacturerPercentileRank).bgColor}`,children:qe(t.ManufacturerPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.ManufacturerPercentileRank]})})]})})]})]})]}),t.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex items-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:t.CountryCodeOfOrigin,className:"mr-2"}),t.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:order-2 order-1 items-center",children:jsxRuntime.jsx(ProductImage,{randmarSKU:t.RandmarSKU||"",alt:t.RandmarTitle||""},`product_image_${t.RandmarSKU}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-row @[36rem]:flex-col gap-4 justify-center @[36rem]:justify-start @[36rem]:order-2 order-1",children:[n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-11 px-4 text-sm font-medium justify-start",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})}),jsxRuntime.jsx(ProductInventoryButton,{applicationId:e??"",randmarSku:t.RandmarSKU??"",inventory:(Mt=t.Distribution)==null?void 0:Mt.Inventory})]}),jsxRuntime.jsx("div",{className:"flex flex-1 @[36rem]:order-1 order-2",children:Je&&t.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex items-center",children:"You have "+nt.length+(nt.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:nt.map((Ze,ct)=>Be(Ze)?jsxRuntime.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 border border-muted cursor-pointer ${Ze.BidNumber==(C==null?void 0:C.BidNumber)?"bg-purple-100 border-2 border-purple-900":"bg-white border-1 border-purple-600 hover:bg-purple-200"}`,onClick:()=>{E(Ze.BidNumber!==(C==null?void 0:C.BidNumber)?Ze:null)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsx("span",{className:"text-xs text-neutral-900",children:Ze.BidNumber})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]},ct):jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted cursor-pointer !bg-neutral-50 hover:bg-neutral-100",onClick:()=>{Ze.BidNumber&&b(`/${e}/Opportunity/${Ze.ManufacturerId}/${Ze.BidNumber}`)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Ze.BidNumber," ",jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Opportunity"})})]},ct))})})]})})]}),jsxRuntime.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end mt-4 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex-shrink-1 flex flex-col gap-3",children:[t.Distribution&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:oe>0?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(oe)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap",children:[$e>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((C?(Ke=(Ct=t.Opportunities)==null?void 0:Ct.find(Ze=>Ze.BidNumber==C.BidNumber))==null?void 0:Ke.Price:Ae)??0)})}),A>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney($e)})]}),A>0&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Badge,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[jsxRuntime.jsxs("span",{children:[A,"% OFF"]}),((Ye=t.InstantRebate)==null?void 0:Ye.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",t.InstantRebate.EndDate.split("T")[0]]}),(C==null?void 0:C.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",C.EndDate.split("T")[0]]})]})})]})}),jsxRuntime.jsxs(Button$1,{variant:"outline",type:"button",className:"h-11 px-4 text-sm font-medium justify-start w-fit",onClick:()=>te(!0),disabled:!je,children:[jsxRuntime.jsx(ChartLine,{className:"mr-2"}),"View statistics"]})]}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center @[36rem]:justify-end items-end gap-2 w-full",children:[f&&jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:Ge,disabled:I,children:I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Sync to Shopify"]})}),g,typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex gap-2 whitespace-nowrap",children:[jsxRuntime.jsxs("div",{className:"flex items-center border rounded-md",children:[jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:st,disabled:typeof S<"u"&&(S<=1||!t.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:S,onChange:at,onBlur:tt,onClick:Ze=>Ze.currentTarget.select(),className:`w-6 @[36rem]:w-12 text-center border-0 focus:ring-0 focus:outline-none ${!t.AvailableToBuy||d?"text-gray-400":""}`,disabled:!t.AvailableToBuy||d}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:et,disabled:!t.AvailableToBuy||d,children:"+"})]}),jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap",onClick:lt,disabled:!t.AvailableToBuy||d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Add to Cart"]})})]})]})]})]})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:te,children:jsxRuntime.jsxs(DialogContent,{className:"w-[min(95vw,1100px)] max-w-5xl space-y-6",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Monthly Sales Performance"}),jsxRuntime.jsxs(DialogDescription,{children:["Expanded product insights for ",ze,Xe?` (SKU ${Xe})`:""]})]}),jsxRuntime.jsx("div",{className:"space-y-6",children:se?jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(AlertTitle,{children:"Unable to load details"}),jsxRuntime.jsx(AlertDescription,{children:se})]}):jsxRuntime.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"mb-4 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Rolling 12-month sales dollars and units sold pulled from the detailed endpoint."}),Ve&&jsxRuntime.jsx("div",{"aria-live":"polite","aria-busy":"true",children:jsxRuntime.jsx(Progress,{value:Le,className:"h-2 w-full animate-pulse","aria-label":"Loading performance data"})})]}),jsxRuntime.jsx(SalesChart,{statistics:We,mode:"month",chartHeight:320}),Ve&&jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Gathering product summary and sales statistics..."})]})})]})})]})}const complexComponents=[`----
1240
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var o=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(o,8);return l>255&&(o=o.slice(0,-1),l=parseInt(o,8)),this.pos+=o.length-1,t=this.input.charCodeAt(this.pos),(o!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-o.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},pp.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},pp.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,o=this.options.ecmaVersion>=6;this.pos<this.input.length;){var l=this.fullCharCodeAtPos();if(isIdentifierChar(l,o))this.pos+=l<=65535?1:2;else if(l===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var d=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var f=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(f,o)||this.invalidStringToken(d,"Invalid Unicode escape"),e+=codePointToString(f),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},pp.readWord=function(){var e=this.readWord1(),t=types$1.name;return this.keywords.test(e)&&(t=keywords[e]),this.finishToken(t,e)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node:Node$3,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var AcornJSX=__toESM(require_acorn_jsx()),attributeNames_default={acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",colspan:"colSpan",contenteditable:"contentEditable",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",for:"htmlFor",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",httpequiv:"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"},VOID_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],NO_WHITESPACE=["table","tbody","tfoot","thead","tr"];function canHaveChildren(e){return VOID_ELEMENTS.indexOf(e.toLowerCase())===-1}function canHaveWhitespace(e){return NO_WHITESPACE.indexOf(e.toLowerCase())!==-1}class NullishShortCircuit extends Error{constructor(t="Nullish value encountered"){super(t),this.name="NullishShortCircuit"}}var hash=(e="",t=16)=>{const n=String(e);let o=0;return n.split("").forEach(l=>{o=(o<<5)-o+l.charCodeAt(0),o&=o}),Math.abs(o).toString(t)},randomHash=()=>hash(Math.random().toString()),camelCase=e=>e.replace(/([A-Z])([A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g," ").toLowerCase().split(" ").filter(t=>t).map((t,n)=>n>0?t[0].toUpperCase()+t.slice(1):t).join(""),parseStyle=e=>{switch(typeof e){case"string":return e.split(";").filter(t=>t).reduce((t,n)=>{const o=n.slice(0,n.indexOf(":")).trim(),l=n.slice(n.indexOf(":")+1).trim();return{...t,[camelCase(o)]:l}},{});case"object":return e;default:return}},pathToArrayPath=e=>e==null||e===""?[]:e.split("."),resolveArrayPath=(e,t)=>{const[n,...o]=t;if(!(e==null||n==null))return o.length===0?e[n]:resolveArrayPath(e[n],o)},resolvePath=(e,t)=>resolveArrayPath(e,pathToArrayPath(t));function handleNaN(e){return Number.isNaN(e)?"NaN":e}class JsxParser extends React.Component{constructor(){super(...arguments);en(this,"ParsedChildren",null);zn(this,fn,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{return d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[],d.map(f=>on(this,rn).call(this,f)).filter(Boolean)}catch(f){return this.props.showWarnings&&console.warn(f),this.props.onError&&this.props.onError(f),this.props.renderError?this.props.renderError({error:String(f)}):null}});zn(this,rn,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:on(this,rn).call(this,n.value,o);case"JSXElement":case"JSXFragment":return on(this,Qn).call(this,n,o);case"JSXExpressionContainer":return on(this,rn).call(this,n.expression,o);case"JSXText":const f=this.props.disableKeyGeneration?void 0:randomHash();return this.props.disableFragments?n.value:React.createElement(React.Fragment,{key:f},n.value);case"ArrayExpression":return n.elements.map(A=>on(this,rn).call(this,A,o));case"BinaryExpression":const g=on(this,rn).call(this,n.left,o),b=on(this,rn).call(this,n.right,o);let _;switch(n.operator){case"-":_=g-b;break;case"!=":_=g!=b;break;case"!==":_=g!==b;break;case"*":_=g*b;break;case"**":_=g**b;break;case"/":_=g/b;break;case"%":_=g%b;break;case"+":_=g+b;break;case"<":_=g<b;break;case"<=":_=g<=b;break;case"==":_=g==b;break;case"===":_=g===b;break;case">":_=g>b;break;case">=":_=g>=b;break;default:this.props.onError(new Error(`Unsupported binary operator: ${n.operator}`));return}return handleNaN(_);case"CallExpression":const S=on(this,rn).call(this,n.callee,o);if(S===void 0){if(n.optional)throw new NullishShortCircuit;this.props.onError(new Error(`The expression '${n.callee}' could not be resolved, resulting in an undefined return value.`));return}return S(...n.arguments.map(A=>on(this,rn).call(this,A,o)));case"ConditionalExpression":return on(this,rn).call(this,n.test,o)?on(this,rn).call(this,n.consequent,o):on(this,rn).call(this,n.alternate,o);case"ExpressionStatement":return on(this,rn).call(this,n.expression,o);case"Identifier":return n.name==="Infinity"?1/0:n.name==="-Infinity"?-1/0:n.name==="NaN"?NaN:o&&n.name in o?handleNaN(o[n.name]):handleNaN((this.props.bindings||{})[n.name]);case"Literal":return n.value;case"LogicalExpression":const R=on(this,rn).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?on(this,rn).call(this,n.right,o):!1;case"MemberExpression":return on(this,ar).call(this,n,o);case"ChainExpression":return on(this,ir).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=on(this,rn).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,M)=>A.start<M.start?-1:1).map(A=>on(this,rn).call(this,A,o)).join("");case"UnaryExpression":const E=on(this,rn).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!E;case"~":return~E;case"typeof":return typeof E}return;case"ArrowFunctionExpression":return(n.async||n.generator)&&((d=(l=this.props).onError)==null||d.call(l,new Error("Async and generator arrow functions are not supported."))),(...A)=>{const M={...o};return n.params.forEach((I,j)=>{M[I.name]=A[j]}),on(this,rn).call(this,n.body,M)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});zn(this,ir,(n,o)=>{try{return on(this,rn).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});zn(this,ar,(n,o)=>{const l=on(this,rn).call(this,n.object,o);let d;if(n.computed)d=on(this,rn).call(this,n.property,o);else if(n.property.type==="Identifier")d=n.property.name;else{this.props.onError(new Error("Only simple MemberExpressions are supported."));return}if(l==null&&n.optional)throw new NullishShortCircuit;let f;try{f=l[d]}catch{this.props.onError(new Error(`The property '${d}' could not be resolved on the object '${l}'.`));return}return typeof f=="function"?f.bind(l):f});zn(this,Wn,n=>n.type==="JSXIdentifier"?n.name:`${on(this,Wn).call(this,n.object)}.${on(this,Wn).call(this,n.property)}`);zn(this,Qn,(n,o)=>{const{allowUnknownElements:l,components:d,componentsOnly:f,onError:g}=this.props,{children:b=[]}=n,_=n.type==="JSXElement"?n.openingElement:n.openingFragment,{attributes:S=[]}=_,R=n.type==="JSXElement"?on(this,Wn).call(this,_.name):"",C=(this.props.blacklistedAttrs||[]).map(Q=>Q instanceof RegExp?Q:new RegExp(Q,"i")),E=(this.props.blacklistedTags||[]).map(Q=>Q.trim().toLowerCase()).filter(Boolean);if(/^(html|head|body)$/i.test(R))return b.map(Q=>on(this,Qn).call(this,Q,o));const A=R.trim().toLowerCase();if(E.indexOf(A)!==-1)return g(new Error(`The tag <${R}> is blacklisted, and will not be rendered.`)),null;if(R!==""&&!resolvePath(d,R)){if(f)return g(new Error(`The component <${R}> is unrecognized, and will not be rendered.`)),this.props.renderUnrecognized(R);if(!l&&document.createElement(R)instanceof HTMLUnknownElement)return g(new Error(`The tag <${R}> is unrecognized in this browser, and will not be rendered.`)),this.props.renderUnrecognized(R)}let M,I=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(I||canHaveChildren(R)){if(M=b.map(te=>on(this,rn).call(this,te,o)),R.includes(".")){const F=R.split(".").reduce((V,ne)=>V?V[ne]:d==null?void 0:d[ne],null);F&&(I=F)}!I&&!canHaveWhitespace(R)&&(M=M.filter(te=>typeof te!="string"||!/^\s*$/.test(te)));const Q=M.find(te=>typeof te=="function");M.length===0?M=void 0:Q?M=Q:M.length===1?[M]=M:M.length>1&&!this.props.disableKeyGeneration&&(M=M.map((te,F)=>te!=null&&te.type&&!(te!=null&&te.key)?{...te,key:te.key||F}:te))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(Q=>{if(Q.type==="JSXAttribute"){const te=Q.name.name,F=attributeNames_default[te]||te,V=on(this,rn).call(this,Q,o);C.filter(ae=>ae.test(F)).length===0&&(j[F]=V)}else if(Q.type==="JSXSpreadAttribute"&&Q.argument.type==="Identifier"||Q.argument.type==="MemberExpression"){const te=on(this,rn).call(this,Q.argument,o);typeof te=="object"&&Object.keys(te).forEach(F=>{const V=attributeNames_default[F]||F;C.filter(ae=>ae.test(V)).length===0&&(j[V]=te[F])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const q=R.toLowerCase();return q==="option"&&(M=M.props.children),React.createElement(I||q,j,M)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=on(this,fn).call(this,n);const o=[...new Set(["jsx-parser",...String(this.props.className).split(" ")])].filter(Boolean).join(" ");return this.props.renderInWrapper?React.createElement("div",{className:o},this.ParsedChildren):this.ParsedChildren}}fn=new WeakMap,rn=new WeakMap,ir=new WeakMap,ar=new WeakMap,Wn=new WeakMap,Qn=new WeakMap,en(JsxParser,"displayName","JsxParser"),en(JsxParser,"defaultProps",{allowUnknownElements:!0,autoCloseVoidElements:!1,bindings:{},blacklistedAttrs:[/^on.+/i],blacklistedTags:["script"],className:"",components:{},componentsOnly:!1,disableFragments:!1,disableKeyGeneration:!1,jsx:"",onError:()=>{},showWarnings:!1,renderError:void 0,renderInWrapper:!0,renderUnrecognized:()=>null});var source_default=JsxParser;const CountryFlag=({countryCode:e,className:t=""})=>{const[n,o]=React.useState(null),[l,d]=React.useState(!1);return React.useEffect(()=>{if(!e)return;const g=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(g,{method:"HEAD"}).then(b=>{b.ok?(o(g),d(!1)):d(!0)}).catch(()=>{d(!0)})},[e]),l||!n?jsxRuntime.jsx("span",{className:t,children:e}):jsxRuntime.jsx("img",{src:n,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function ProductCard({applicationId:e,product:t,viewProductLink:n,defaultOpportunityNumber:o="",onAddToCart:l,addingToCart:d=!1,shopifyHostname:f,customAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var $t,rt,Rt,dt,It,Mt,Ct,Ke,Ye;const b=reactRouterDom.useNavigate(),{toast:_}=useToast(),[S,R]=React.useState(1),[C,E]=React.useState(null),[A,M]=React.useState(0),[I,j]=React.useState(!1),[q]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),[Q,te]=React.useState(!1),[F,V]=React.useState(null),[ne,ae]=React.useState("idle"),[se,Oe]=React.useState(null),[Ne]=useLazyGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery(),oe=(($t=t==null?void 0:t.Distribution)==null?void 0:$t.Cost)||0,$e=((rt=t==null?void 0:t.Distribution)==null?void 0:rt.RegularPrice)||0,Ae=((Rt=t==null?void 0:t.Distribution)==null?void 0:Rt.Price)||0,je=!!(e&&(t!=null&&t.RandmarSKU));React.useEffect(()=>{R(1),E(null),M(0)},[t==null?void 0:t.RandmarSKU]),React.useEffect(()=>{var Ze;if(t&&o){const ct=(Ze=t.Opportunities)==null?void 0:Ze.find(mt=>mt.BidNumber==o);ct&&Be(ct)&&E(ct)}},[t,o]),React.useEffect(()=>{if(!t)return;const Ze=C!=null&&C.Price?C.Price:Ae;M($e>0?Math.round(($e-Ze)/$e*100):0)},[t,C,Ae,$e]),React.useEffect(()=>{d||R(1)},[d]),React.useEffect(()=>{if(!Q){V(null),ae("idle"),Oe(null);return}if(!e||!(t!=null&&t.RandmarSKU)){ae("error"),Oe("Missing identifiers to load performance data.");return}let Ze=!1;const ct=t.RandmarSKU;return(async()=>{ae("summary"),Oe(null);try{const ft=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!1});if(Ze)return;if("error"in ft&&ft.error)throw ft.error;V(ft.data??null),ae("detailed");const yt=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!0});if(Ze)return;if("error"in yt&&yt.error)throw yt.error;V(yt.data??ft.data??null),ae("complete")}catch(ft){if(Ze)return;console.error("Failed to load performance data for product modal",ft),ae("error"),Oe("We couldn't load the performance details. Please try again.")}})(),()=>{Ze=!0}},[e,Ne,Q,t==null?void 0:t.RandmarSKU]);const Be=Ze=>{if(Ze.Active!==!0)return!1;const ct=new Date().toISOString().split("T")[0];return!(Ze.EndDate&&Ze.EndDate.split("T")[0]<ct||Ze.StartDate&&Ze.StartDate.split("T")[0]>ct)},qe=Ze=>Ze>=90?{label:"Top 10% Bestseller",color:"text-purple-950",bgColor:"bg-purple-200"}:Ze>=75?{label:"Bestseller",color:"text-blue-700",bgColor:"bg-blue-50"}:Ze>=33?{label:"Popular",color:"text-green-700",bgColor:"bg-green-50"}:{label:"Rising",color:"text-gray-700",bgColor:"bg-white"},Ve=ne!=="complete"&&ne!=="error",Le=ne==="summary"?40:ne==="detailed"?80:10,He=(F==null?void 0:F.SalesStatistics)??[],We=Ve?[]:He,ze=(F==null?void 0:F.RandmarTitle)??(t==null?void 0:t.RandmarTitle)??(t==null?void 0:t.RandmarSKU)??"this product",Xe=(F==null?void 0:F.RandmarSKU)??(t==null?void 0:t.RandmarSKU);if(!t)return jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-28 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx("div",{className:"w-60 h-40",children:jsxRuntime.jsx(Skeleton,{className:"w-full h-full rounded-lg"})})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24 mb-3"}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-full rounded-md"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 mt-4"})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 flex-1 rounded-md"})]})]})]})});const nt=(t==null?void 0:t.Opportunities)||[],Je=nt.length>0,st=()=>{if(S==null){R(1);return}S>1&&R(S-1)},et=()=>{if(S==null){R(1);return}R(S+1)},at=Ze=>{const ct=Number.parseInt(Ze.target.value,10);if(!isNaN(ct)&&ct>0){R(ct);return}R(void 0)},tt=()=>{(S==null||S<1)&&R(1)},ot=Ze=>{try{return new Date(Ze).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(ct){return console.error(ct),Ze.split("T")[0]||"N/A"}},lt=()=>{typeof l<"u"&&l({quantity:S??1,bidNumber:(C==null?void 0:C.BidNumber)??null})},Ge=()=>{I||!f||(j(!0),q({routeResellerId:e??"",randmarSku:t.RandmarSKU??"",shopifyHostName:f}).then(Ze=>{if(Ze.error){console.error("Error syncing to Shopify:",Ze.error),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}_({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Ze=>{console.error("Error syncing to Shopify:",Ze),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{j(!1)}))};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Card,{className:"w-full hover:shadow-lg transition-shadow @container",children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-xl",children:t.Title||t.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex items-center justify-end ml-4 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,name:t.ManufacturerName,width:96,height:40},`partner_logo_${t.ManufacturerId}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1 @[36rem]:order-1 order-2 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-center @[36rem]:items-start @[36rem]:justify-start",children:[t.State&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Check,{size:"12",className:"mr-1.5"})," ",t.State]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[jsxRuntime.jsx(QrCode,{size:"12",className:"mr-1.5"})," ",t.SerialNumber?"Serialized":"Unserialized"]}),t.TransparencyCode&&jsxRuntime.jsxs(Badge,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[jsxRuntime.jsx(CircleDashed,{size:"12",className:"mr-1.5"})," Transparency Code"]}),t.AvailableToBuy!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(ShoppingCart,{size:"12",className:"mr-1.5"})," ",t.AvailableToBuy?"Available":"Unavailable"]}),t.ManufacturerCategory!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${(dt=t.ManufacturerCategory)!=null&&dt.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[jsxRuntime.jsx(ShieldCheck,{size:"12",className:"mr-1.5"})," ",(It=t.ManufacturerCategory)!=null&&It.QualificationRequired?"Qualified Only":"Available to all"]}),t.ManufacturerId&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(RefreshCw,{size:"12",className:"mr-1.5"})," ",t.AutoUpdate?`Automatic Reorder (${t.MasterCarton})`:"Manually Reorders"]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.BodyHTML&&t.Title&&t.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Store,{size:"12",className:"mr-1.5"})," ",t.BodyHTML&&t.Title&&t.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.MPN||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UPC||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UnitWeight?`${formatNumber(t.UnitWeight)} lbs`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["MAP",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),"MSRP"]}),jsxRuntime.jsxs("div",{className:"font-medium",children:[t.MAP?formatMoney(t.MAP):"N/A",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),t.MSRP?formatMoney(t.MSRP):"N/A"]})]}),!!t.OverallPercentileRank&&!!t.ManufacturerPercentileRank&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Bestseller Status"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{children:"Global: "}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.OverallPercentileRank).bgColor} ${qe(t.OverallPercentileRank).color} hover:${qe(t.OverallPercentileRank).bgColor}`,children:qe(t.OverallPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.OverallPercentileRank]})})]})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{children:[t.ManufacturerName,": "]}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.ManufacturerPercentileRank).bgColor} ${qe(t.ManufacturerPercentileRank).color} hover:${qe(t.ManufacturerPercentileRank).bgColor}`,children:qe(t.ManufacturerPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.ManufacturerPercentileRank]})})]})})]})]})]}),t.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex items-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:t.CountryCodeOfOrigin,className:"mr-2"}),t.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:order-2 order-1 items-center",children:jsxRuntime.jsx(ProductImage,{randmarSKU:t.RandmarSKU||"",alt:t.RandmarTitle||""},`product_image_${t.RandmarSKU}`)})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:flex-row gap-6 mt-4",children:jsxRuntime.jsx("div",{className:"flex flex-1 @[36rem]:order-1 order-2",children:Je&&t.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex items-center",children:"You have "+nt.length+(nt.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:nt.map((Ze,ct)=>Be(Ze)?jsxRuntime.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 border border-muted cursor-pointer ${Ze.BidNumber==(C==null?void 0:C.BidNumber)?"bg-purple-100 border-2 border-purple-900":"bg-white border-1 border-purple-600 hover:bg-purple-200"}`,onClick:()=>{E(Ze.BidNumber!==(C==null?void 0:C.BidNumber)?Ze:null)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsx("span",{className:"text-xs text-neutral-900",children:Ze.BidNumber})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]},ct):jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted cursor-pointer !bg-neutral-50 hover:bg-neutral-100",onClick:()=>{Ze.BidNumber&&b(`/${e}/Opportunity/${Ze.ManufacturerId}/${Ze.BidNumber}`)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Ze.BidNumber," ",jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Opportunity"})})]},ct))})})]})})}),jsxRuntime.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end mt-4 gap-4",children:[jsxRuntime.jsxs("div",{className:"flex-shrink-1 flex flex-col gap-3",children:[t.Distribution&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:oe>0?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(oe)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap",children:[$e>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((C?(Ct=(Mt=t.Opportunities)==null?void 0:Mt.find(Ze=>Ze.BidNumber==C.BidNumber))==null?void 0:Ct.Price:Ae)??0)})}),A>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney($e)})]}),A>0&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Badge,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[jsxRuntime.jsxs("span",{children:[A,"% OFF"]}),((Ke=t.InstantRebate)==null?void 0:Ke.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",t.InstantRebate.EndDate.split("T")[0]]}),(C==null?void 0:C.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",C.EndDate.split("T")[0]]})]})})]})}),jsxRuntime.jsxs("div",{className:"w-full flex flex-col gap-2 @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsxs(Button$1,{variant:"outline",type:"button",className:"h-11 px-4 text-sm font-medium justify-start w-full",onClick:()=>te(!0),disabled:!je,children:[jsxRuntime.jsx(ChartLine,{className:"mr-2"}),"View statistics"]})}),jsxRuntime.jsx("div",{className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsx(ProductInventoryButton,{applicationId:e??"",randmarSku:t.RandmarSKU??"",inventory:(Ye=t.Distribution)==null?void 0:Ye.Inventory,buttonSize:"lg",buttonClassName:"w-full h-11 justify-start"})}),n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-11 px-4 text-sm font-medium justify-start w-full",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})})]})]}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center @[36rem]:justify-end items-end gap-2 w-full",children:[f&&jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:Ge,disabled:I,children:I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Sync to Shopify"]})}),g,typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex gap-2 whitespace-nowrap",children:[jsxRuntime.jsxs("div",{className:"flex items-center border rounded-md",children:[jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:st,disabled:typeof S<"u"&&(S<=1||!t.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:S,onChange:at,onBlur:tt,onClick:Ze=>Ze.currentTarget.select(),className:`w-6 @[36rem]:w-12 text-center border-0 focus:ring-0 focus:outline-none ${!t.AvailableToBuy||d?"text-gray-400":""}`,disabled:!t.AvailableToBuy||d}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:et,disabled:!t.AvailableToBuy||d,children:"+"})]}),jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap",onClick:lt,disabled:!t.AvailableToBuy||d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Add to Cart"]})})]})]})]})]})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:te,children:jsxRuntime.jsxs(DialogContent,{className:"w-[min(95vw,1100px)] max-w-5xl space-y-6",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Monthly Sales Performance"}),jsxRuntime.jsxs(DialogDescription,{children:["Expanded product insights for ",ze,Xe?` (SKU ${Xe})`:""]})]}),jsxRuntime.jsx("div",{className:"space-y-6",children:se?jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(AlertTitle,{children:"Unable to load details"}),jsxRuntime.jsx(AlertDescription,{children:se})]}):jsxRuntime.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"mb-4 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Rolling 12-month sales dollars and units sold pulled from the detailed endpoint."}),Ve&&jsxRuntime.jsx("div",{"aria-live":"polite","aria-busy":"true",children:jsxRuntime.jsx(Progress,{value:Le,className:"h-2 w-full animate-pulse","aria-label":"Loading performance data"})})]}),jsxRuntime.jsx(SalesChart,{statistics:We,mode:"month",chartHeight:320}),Ve&&jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Gathering product summary and sales statistics..."})]})})]})})]})}const complexComponents=[`----
1246
1241
  PartnerCard: For data that fits this shape:
1247
1242
  { "ApplicationId": "19022", "PublicName": "BiOSS", "VoiceName": null, "VoiceStyle": null, "About": "example", "SceneName": "Kitchen Counter", "IsReseller": true, "IsManufacturer": true, "IsSalesAgency": false, "Socials": [ { "ApplicationId": "19022", "SocialNetwork": "Facebook", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "Instagram", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "LinkedIn", "Tag": "@biossinc" }, { "ApplicationId": "19022", "SocialNetwork": "Youtube", "Tag": "@biosssolutionssanitairessa4095" } ], "Manufacturer": null, "Reseller": null }
1248
1243
  Use <PartnerCard account={data} action={<></>}>`,`----