ui.shipaid.com 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.es.js CHANGED
@@ -1,3 +1,72 @@
1
+ function calculateProtectionTotal(store, protectionProduct, cart) {
2
+ var _a, _b, _c;
3
+ if (!store)
4
+ throw new Error("Missing store settings.");
5
+ if (!protectionProduct)
6
+ throw new Error("Missing protectionProduct.");
7
+ if (!cart)
8
+ throw new Error("Missing Shopify cart.");
9
+ const settings = store == null ? void 0 : store.protectionSettings;
10
+ if (!settings) {
11
+ throw new Error("Tried to find protection variant, but protection settings for this store are missing.");
12
+ }
13
+ const excludedProductSkus = Array.isArray(store == null ? void 0 : store.excludedProductSkus) ? store == null ? void 0 : store.excludedProductSkus.map((sku) => sku.trim()) : [];
14
+ const itemTotal = ((_a = cart.items) == null ? void 0 : _a.reduce((total, item) => {
15
+ if (!item.sku)
16
+ return total;
17
+ const itemIsExcluded = excludedProductSkus.some((sku) => sku === item.sku.trim());
18
+ return itemIsExcluded ? total - item.final_line_price : total;
19
+ }, cart.total_price)) ?? cart.total_price;
20
+ const protectionVariantsInCart = ((_b = cart.items) == null ? void 0 : _b.filter((item) => {
21
+ var _a2;
22
+ return (_a2 = protectionProduct == null ? void 0 : protectionProduct.variants) == null ? void 0 : _a2.some((variant) => variant.id === item.variant_id);
23
+ })) ?? [];
24
+ const protectionVariantsInCartTotal = protectionVariantsInCart.reduce((total, item) => total + item.final_line_price, 0);
25
+ const cartTotal = itemTotal - protectionVariantsInCartTotal;
26
+ if (settings.protectionType === "FIXED") {
27
+ if (typeof settings.defaultFee !== "number")
28
+ throw new Error("Missing default fee amount.");
29
+ if (!((_c = settings.rules) == null ? void 0 : _c.length))
30
+ return settings.defaultFee;
31
+ const formattedCartTotal = cartTotal / 100;
32
+ const sortedRules = settings.rules.sort((a2, b2) => {
33
+ if (!a2.rangeLower || !b2.rangeLower)
34
+ return 0;
35
+ return a2.rangeLower - b2.rangeLower;
36
+ });
37
+ const rule = sortedRules.find((rule2) => {
38
+ const lower = Boolean(rule2.rangeLower && rule2.rangeLower < formattedCartTotal);
39
+ if (!rule2.rangeUpper)
40
+ return lower;
41
+ return lower && rule2.rangeUpper >= formattedCartTotal;
42
+ });
43
+ return typeof (rule == null ? void 0 : rule.fee) === "number" ? rule.fee : settings.defaultFee;
44
+ }
45
+ if (settings.protectionType === "PERCENTAGE") {
46
+ const percentageFee = cartTotal * settings.percentage / 100;
47
+ return percentageFee >= settings.minimumFee ? percentageFee : settings.minimumFee;
48
+ }
49
+ throw new Error("No protection type handler found for this store.");
50
+ }
51
+ function findProtectionVariant(store, protectionProduct, protectionFee) {
52
+ var _a;
53
+ const settings = store == null ? void 0 : store.protectionSettings;
54
+ if (!settings || !((_a = protectionProduct == null ? void 0 : protectionProduct.variants) == null ? void 0 : _a.length)) {
55
+ throw new Error("Missing product and variants from protection settings.");
56
+ }
57
+ const formattedVariants = protectionProduct == null ? void 0 : protectionProduct.variants.flatMap((variant) => {
58
+ if (!(variant == null ? void 0 : variant.price))
59
+ return [];
60
+ const formattedPrice = Number(variant.price);
61
+ return [{ ...variant, formattedPrice }];
62
+ }).sort((a2, b2) => a2.formattedPrice - b2.formattedPrice);
63
+ const matchingVariant = formattedVariants.find((variant) => variant.formattedPrice >= protectionFee);
64
+ if (!matchingVariant) {
65
+ return formattedVariants[formattedVariants.length - 1];
66
+ }
67
+ return matchingVariant;
68
+ }
69
+ const common = { calculateProtectionTotal, findProtectionVariant };
1
70
  /**
2
71
  * @license
3
72
  * Copyright 2017 Google LLC
@@ -894,19 +963,20 @@ function n(n2, o3, r2) {
894
963
  }
895
964
  const styles$1 = i$2`
896
965
  :host {
897
- --shipaid-primary: #002bd6;
966
+ --shipaid-primary: #0056d6;
898
967
  --shipaid-secondary: #0076ff;
899
968
  --shipaid-danger: #f44336;
900
969
  --shipaid-text: #000000;
901
970
  --shipaid-text-muted: #cccccc;
902
971
  --shipaid-text-grey: #aaaaaa;
903
972
  --shipaid-light-grey: #ebecf0;
973
+ --shipaid-light-blue: #bacef4;
904
974
  --shipaid-font: "Lato", sans-serif;
905
975
  --shipaid-font-xs: 12px;
906
976
  --shipaid-font-sm: 14px;
907
977
  --shipaid-font-base: 16px;
908
978
  --shipaid-font-lg: 18px;
909
- --shipaid-font-display: 24px;
979
+ --shipaid-font-display: 36px;
910
980
  --shipaid-font-regular: 400;
911
981
  --shipaid-font-heavy: 700;
912
982
  }
@@ -929,8 +999,9 @@ const styles$1 = i$2`
929
999
  max-width: 500px;
930
1000
  max-height: 80vh;
931
1001
  height: fit-content;
932
- border: var(--shipaid-popup-border, var(--shipaid-light-grey)) 1px solid;
1002
+ border: var(--shipaid-popup-border, var(--shipaid-primary)) 6px solid;
933
1003
  background-color: var(--shipaid-popup-background, #fff);
1004
+ border-radius: 45px;
934
1005
  z-index: 1000000000;
935
1006
  overflow: auto;
936
1007
  visibility: hidden;
@@ -958,6 +1029,11 @@ const styles$1 = i$2`
958
1029
  }
959
1030
  }
960
1031
 
1032
+ .popup-logo {
1033
+ width: 70%;
1034
+ margin: auto;
1035
+ }
1036
+
961
1037
  .shipaid-popup .popup-close {
962
1038
  width: fit-content;
963
1039
  margin-left: auto;
@@ -973,6 +1049,7 @@ const styles$1 = i$2`
973
1049
  font-size: var(--shipaid-font-display);
974
1050
  font-weight: var(--shipaid-font-regular);
975
1051
  letter-spacing: 1px;
1052
+ text-align: center;
976
1053
  }
977
1054
 
978
1055
  .shipaid-popup .popup-top-image {
@@ -982,6 +1059,35 @@ const styles$1 = i$2`
982
1059
  object-fit: contain;
983
1060
  }
984
1061
 
1062
+ .shipaid-popup .popup-icon {
1063
+ margin-left: 1rem;
1064
+ width: 60%;
1065
+ height: auto;
1066
+ object-fit: cover;
1067
+ }
1068
+
1069
+ .shipaid-popup .popup-icon-b {
1070
+ margin-left: 1rem;
1071
+ width: 53%;
1072
+ height: auto;
1073
+ object-fit: contain;
1074
+ }
1075
+
1076
+ .shipaid-popup .popup-icon-bell {
1077
+ margin-left: 1rem;
1078
+ width: 66%;
1079
+ height: auto;
1080
+ object-fit: contain;
1081
+ }
1082
+
1083
+ .shipaid-popup .popup-disclaimer-subtitle {
1084
+ display: inline-flex;
1085
+ }
1086
+
1087
+ .shipaid-popup .popup-disclaimer-subtitle p {
1088
+ margin: auto;
1089
+ }
1090
+
985
1091
  .shipaid-popup p {
986
1092
  font-size: var(--shipaid-font-base);
987
1093
  margin: 0;
@@ -989,15 +1095,19 @@ const styles$1 = i$2`
989
1095
 
990
1096
  .shipaid-popup .popup-disclaimer {
991
1097
  font-size: 10px;
992
- color: var(--shipaid-text-muted);
1098
+ color: var(--shipaid-light-blue);
1099
+ }
1100
+
1101
+ .popup-divider {
1102
+ border-top: 1px solid var(--shipaid-text);
1103
+ width: 90%;
993
1104
  }
994
1105
 
995
1106
  .shipaid-popup .popup-footer {
996
1107
  display: flex;
997
1108
  flex-direction: row;
998
- justify-content: space-between;
1109
+ justify-content: center;
999
1110
  align-items: flex-start;
1000
- margin-top: 2rem;
1001
1111
  }
1002
1112
 
1003
1113
  @media (max-width: 600px) {
@@ -1015,16 +1125,229 @@ const styles$1 = i$2`
1015
1125
  .shipaid-popup .popup-footer .footer-links a {
1016
1126
  font-family: var(--shipaid-font);
1017
1127
  font-size: var(--shipaid-font-sm);
1018
- color: var(--shipaid-text-muted);
1128
+ color: var(--shipaid-text);
1019
1129
  }
1020
1130
 
1021
1131
  .shipaid-popup .popup-footer .footer-date p {
1022
1132
  font-family: var(--shipaid-font);
1023
- font-weight: var(--shipaid-font-heavy);
1024
1133
  font-size: var(--shipaid-font-sm);
1025
1134
  color: var(--shipaid-text);
1135
+ margin-left: 2rem;
1026
1136
  }
1027
1137
  `;
1138
+ const CheckmarkIcon = y`
1139
+ <svg
1140
+ version="1.0"
1141
+ viewBox="0 0 500.000000 500.000000"
1142
+ preserveAspectRatio="xMidYMid meet"
1143
+ >
1144
+ <g
1145
+ transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"
1146
+ fill="#0056d6"
1147
+ stroke="none"
1148
+ >
1149
+ <path
1150
+ d="M1332 4545 c-540 -173 -996 -323 -1012 -335 -15 -11 -38 -41 -50 -65 -25 -51 -25 -28 6 -490 48 -726 177 -2199 199 -2270 7 -25 25 -61 39 -80 17 -22 322 -225 903 -602 866 -560 879 -568 928 -568 49 1 69 13 929 570 683 442 885 577 907 608 15 21 32 62 38 90 10 49 64 646 131 1439 42 501 80 1040 83 1170 2 102 0 117 -21 149 -12 21 -34 44 -48 54 -33 22 -1990 645 -2023 644 -14 0 -468 -141 -1009 -314z m1073 -21 c22 -8 402 -129 845 -270 443 -141 815 -262 828 -270 13 -8 32 -29 43 -47 19 -30 20 -43 15 -217 -6 -224 -99 -1390 -156 -1960 -6 -58 -13 -129 -16 -159 -6 -65 -23 -100 -67 -141 -17 -17 -367 -246 -777 -510 -535 -345 -753 -480 -773 -480 -16 0 -38 5 -50 12 -57 30 -1485 954 -1510 976 -61 57 -63 69 -111 612 -89 999 -141 1705 -134 1798 5 53 34 98 80 123 10 5 365 120 790 255 425 134 805 256 843 269 81 28 96 29 150 9z"
1151
+ />
1152
+ <path
1153
+ d="M2295 3870 c-17 -5 -228 -124 -470 -264 -360 -208 -442 -259 -453 -284 -15 -32 -12 -66 10 -94 13 -16 851 -502 897 -520 43 -16 106 -11 152 12 24 13 176 99 337 192 162 93 300 172 308 175 12 4 14 -55 12 -427 l-3 -432 -120 -70 c-66 -39 -221 -129 -345 -200 l-225 -130 -60 4 c-57 4 -76 13 -375 187 -173 100 -326 193 -340 207 l-25 24 -3 277 c-2 175 -7 282 -14 290 -6 7 -66 45 -135 84 -110 63 -127 70 -149 60 l-24 -11 0 -445 0 -446 23 -22 c12 -12 240 -148 507 -302 l485 -280 60 0 60 0 455 263 c250 145 474 274 496 287 23 14 46 37 53 52 8 21 11 188 9 620 -3 557 -4 592 -21 611 -27 29 -287 176 -309 175 -10 -1 -157 -81 -325 -179 -169 -97 -327 -186 -352 -197 -71 -31 -111 -20 -282 79 -143 83 -166 103 -153 137 3 9 74 55 157 103 188 109 210 113 316 59 l73 -36 137 78 c117 67 136 82 139 105 4 31 9 27 -233 166 -165 94 -211 110 -270 92z"
1154
+ />
1155
+ </g>
1156
+ </svg>
1157
+ `;
1158
+ const ShipAidLogo = y`
1159
+ <svg
1160
+ version="1.0"
1161
+ width="500.000000pt"
1162
+ height="500.000000pt"
1163
+ viewBox="0 0 500.000000 500.000000"
1164
+ preserveAspectRatio="xMidYMid meet"
1165
+ >
1166
+ <g
1167
+ transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"
1168
+ fill="#000000"
1169
+ stroke="none"
1170
+ >
1171
+ <path
1172
+ d="M2465 4855 c-5 -2 -446 -142 -979 -312 -534 -169 -984 -317 -1000 -328 -17 -11 -41 -36 -54 -55 -24 -35 -24 -37 -18 -210 9 -274 84 -1236 170 -2176 37 -401 43 -430 103 -489 25 -24 1389 -912 1702 -1107 93 -59 125 -61 202 -15 30 18 429 275 888 572 647 418 840 547 862 578 15 21 32 62 38 90 16 83 148 1610 191 2202 11 160 21 342 23 405 2 104 0 118 -21 151 -12 21 -34 45 -49 54 -34 23 -1989 645 -2022 644 -14 0 -30 -2 -36 -4z m135 -345 c30 -11 393 -125 805 -255 413 -130 768 -242 791 -250 22 -9 54 -29 70 -46 l29 -30 -1 -182 c-1 -218 -36 -669 -135 -1747 -42 -461 -47 -488 -95 -532 -11 -9 -359 -235 -774 -503 -714 -460 -757 -486 -795 -483 -33 3 -167 85 -775 477 -404 260 -750 484 -768 498 -47 35 -70 89 -81 190 -25 219 -118 1328 -151 1781 -26 368 -26 467 0 509 10 18 29 39 42 47 13 8 374 126 803 261 429 135 812 257 850 270 75 27 95 26 185 -5z"
1173
+ />
1174
+ <path
1175
+ d="M2340 3816 c-252 -140 -776 -446 -797 -465 -17 -14 -23 -31 -23 -61 0 -30 6 -47 23 -62 26 -23 775 -457 862 -499 33 -16 76 -29 95 -29 48 0 90 22 440 224 l305 176 3 -427 c1 -235 -1 -430 -5 -434 -5 -4 -161 -96 -348 -204 l-340 -196 -60 3 c-58 4 -75 12 -388 192 -251 144 -331 195 -342 217 -12 22 -15 79 -15 291 0 145 -4 268 -8 275 -13 20 -253 153 -278 153 -13 0 -28 -9 -34 -19 -17 -32 -14 -843 4 -884 12 -28 75 -68 507 -317 l494 -285 65 0 65 0 495 286 c481 278 495 287 508 324 10 30 12 167 10 616 -3 548 -4 578 -22 598 -30 33 -297 183 -317 178 -9 -3 -138 -74 -286 -160 -393 -227 -401 -230 -466 -225 -45 4 -78 18 -200 89 -144 82 -164 101 -153 137 3 9 75 56 159 105 141 81 156 87 207 87 43 0 66 -7 105 -30 28 -16 60 -30 71 -30 23 0 236 119 268 150 34 33 13 54 -157 153 -291 169 -278 167 -447 73z"
1176
+ />
1177
+ </g>
1178
+ </svg>
1179
+ `;
1180
+ const ShipAidLogoText = y`
1181
+ <svg
1182
+ viewBox="0 0 423 62"
1183
+ version="1.1"
1184
+ xml:space="preserve"
1185
+ style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
1186
+ >
1187
+ <g transform="matrix(1,0,0,1,-45.4439,-231.396)">
1188
+ <g transform="matrix(1,0,0,1,41.8553,292.5)">
1189
+ <g>
1190
+ <path
1191
+ d="M25.484,0.536C36.161,0.536 47.828,-4.755 47.646,-17.047C47.646,-37.958 14.089,-31.047 14.177,-43.427C14.089,-47.646 18.036,-51.328 25.125,-51.328C31.318,-51.328 34.724,-50.068 39.302,-47.646C40.021,-47.286 40.828,-47.021 41.547,-47.021C43.88,-47.021 46.12,-48.995 46.12,-51.505C46.214,-53.391 45.047,-54.734 43.88,-55.453C39.75,-58.234 31.854,-61.104 25.125,-61.104C13.729,-61.104 3.589,-55.094 3.589,-42.979C3.589,-20.995 37.146,-27.906 37.146,-16.333C37.146,-11.932 32.214,-8.885 25.036,-9.062C19.474,-9.151 15.432,-11.036 11.667,-12.922C10.859,-13.37 9.87,-13.547 9.422,-13.547C6.911,-13.547 4.484,-11.484 4.396,-8.526C4.307,-6.729 5.385,-5.292 6.818,-4.307C10.766,-1.703 18.125,0.63 25.484,0.536Z"
1192
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1193
+ />
1194
+ </g>
1195
+ </g>
1196
+ <g transform="matrix(1,0,0,1,111.569,292.5)">
1197
+ <g>
1198
+ <path
1199
+ d="M48.901,-60.656C45.943,-60.656 43.609,-58.234 43.609,-55.365L43.609,-34.547L16.87,-34.547L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-24.943L43.609,-24.943L43.609,-5.292C43.609,-2.333 45.943,0 48.901,0C51.776,0 54.198,-2.333 54.198,-5.292L54.198,-55.365C54.198,-58.234 51.776,-60.656 48.901,-60.656Z"
1200
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1201
+ />
1202
+ </g>
1203
+ </g>
1204
+ <g transform="matrix(1,0,0,1,190.435,292.5)">
1205
+ <g>
1206
+ <path
1207
+ d="M11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0Z"
1208
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1209
+ />
1210
+ </g>
1211
+ </g>
1212
+ <g transform="matrix(1,0,0,1,232.067,292.5)">
1213
+ <g>
1214
+ <path
1215
+ d="M25.125,-60.656L11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-23.151L25.125,-23.151C35.714,-23.151 44.328,-30.865 44.328,-41.906C44.328,-52.849 35.714,-60.656 25.125,-60.656ZM24.766,-32.844L16.87,-32.844L16.87,-50.969L24.766,-50.969C29.703,-50.969 33.74,-47.198 33.74,-41.906C33.74,-36.521 29.703,-32.844 24.766,-32.844Z"
1216
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1217
+ />
1218
+ </g>
1219
+ </g>
1220
+ <g transform="matrix(1,0,0,1,298.418,292.5)">
1221
+ <g>
1222
+ <path
1223
+ d="M54.198,-4.844L32.214,-58.417C31.583,-59.849 30.151,-60.839 28.536,-60.745C26.917,-60.839 25.396,-59.849 24.854,-58.417L2.87,-4.844C2.063,-2.87 3.052,-0.63 4.938,0.089C6.729,0.896 9.063,0.177 9.87,-1.974L15.255,-15.344L41.724,-15.344L47.109,-1.974C47.917,-0.089 50.161,0.99 52.135,0.089C54.016,-0.63 54.917,-2.964 54.198,-4.844ZM18.125,-22.432L28.536,-48.276L38.854,-22.432L18.125,-22.432Z"
1224
+ style="fill:rgb(47,52,61);fill-rule:nonzero;"
1225
+ />
1226
+ </g>
1227
+ </g>
1228
+ <g transform="matrix(1,0,0,1,373.874,292.5)">
1229
+ <g>
1230
+ <path
1231
+ d="M10.318,0C12.474,0 14.177,-1.703 14.177,-3.859L14.177,-56.797C14.177,-58.865 12.474,-60.656 10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0Z"
1232
+ style="fill:rgb(47,52,61);fill-rule:nonzero;"
1233
+ />
1234
+ </g>
1235
+ </g>
1236
+ <g transform="matrix(1,0,0,1,412.904,292.5)">
1237
+ <g>
1238
+ <path
1239
+ d="M24.854,-60.656L10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0L24.854,0C41.724,0 55.005,-12.38 55.005,-30.328C55.005,-48.187 41.724,-60.656 24.854,-60.656ZM24.854,-7.089L14.177,-7.089L14.177,-53.568L24.854,-53.568C37.417,-53.568 47.286,-44.057 47.286,-30.328C47.286,-16.51 37.417,-7.089 24.854,-7.089Z"
1240
+ style="fill:rgb(47,52,61);fill-rule:nonzero;"
1241
+ />
1242
+ </g>
1243
+ </g>
1244
+ <path
1245
+ d="M255.854,234.453C247.292,234.453 240.354,241.391 240.354,249.953C240.354,258.51 247.292,265.453 255.854,265.453C264.417,265.453 271.354,258.51 271.354,249.953C271.354,241.391 264.417,234.453 255.854,234.453ZM253.01,257.911L246.188,251.089L248.458,248.813L253.01,253.365L263.25,243.125L265.521,245.401L253.01,257.911Z"
1246
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1247
+ />
1248
+ <path
1249
+ d="M270.385,238.443L256.297,233.974C256.005,233.88 255.698,233.88 255.406,233.974L241.318,238.443C240.745,238.599 240.354,239.12 240.354,239.714C240.552,244.578 241.917,259.135 241.917,259.135C241.958,259.693 242.26,260.193 242.729,260.5L255.365,268.646C255.661,268.833 256.042,268.833 256.339,268.646L268.974,260.5C269.443,260.193 269.745,259.693 269.786,259.135C269.786,259.135 271.151,244.578 271.349,239.714C271.349,239.12 270.958,238.599 270.385,238.443"
1250
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1251
+ />
1252
+ <path
1253
+ d="M266.224,245.536C266.167,245.427 266.094,245.323 265.938,245.24L263.719,243.922C263.688,243.901 263.656,243.885 263.62,243.88C263.609,243.875 263.599,243.875 263.589,243.875C263.563,243.87 263.542,243.865 263.516,243.865C263.448,243.87 263.385,243.885 263.328,243.922L258.339,246.896L258.333,246.885L257.932,247.125C257.448,247.417 256.849,247.417 256.365,247.125L254.182,245.823C254.063,245.755 253.984,245.62 253.984,245.474C253.984,245.328 254.063,245.198 254.182,245.125L256.365,243.823C256.849,243.536 257.448,243.536 257.932,243.823L258.458,244.135C258.578,244.208 258.724,244.208 258.849,244.135L260.88,242.927C261,242.854 261.073,242.724 261.073,242.578C261.073,242.432 261,242.297 260.88,242.224L257.932,240.469C257.448,240.182 256.849,240.182 256.365,240.469L249.141,244.776C248.62,245.083 248.62,245.865 249.141,246.177L256.365,250.479C256.849,250.771 257.448,250.771 257.932,250.479L263.516,247.151L263.516,254.734L261.719,255.807L257.932,258.073C257.813,258.141 257.682,258.198 257.547,258.234C257.151,258.344 256.724,258.286 256.365,258.073L251.172,254.979C250.927,254.833 250.781,254.563 250.781,254.276L250.781,249.854C250.781,249.714 250.703,249.578 250.583,249.505L248.552,248.297C248.432,248.224 248.281,248.224 248.161,248.297C248.042,248.37 247.964,248.5 247.964,248.646L247.964,255.953C247.964,256.245 248.115,256.51 248.359,256.656L256.365,261.427C256.599,261.568 256.865,261.641 257.135,261.641L257.141,261.641C257.177,261.641 257.219,261.641 257.255,261.635C257.286,261.635 257.318,261.635 257.344,261.63C257.385,261.625 257.427,261.615 257.464,261.604C257.495,261.599 257.521,261.599 257.547,261.589C257.589,261.578 257.63,261.563 257.672,261.547C257.698,261.536 257.719,261.531 257.74,261.521C257.807,261.495 257.87,261.464 257.932,261.427L264.839,257.307L265.932,256.667C266.177,256.526 266.328,256.255 266.328,255.964L266.328,245.943C266.328,245.797 266.292,245.656 266.224,245.536"
1254
+ style="fill:white;fill-rule:nonzero;"
1255
+ />
1256
+ <path
1257
+ d="M257.911,238.047C257.677,237.911 257.417,237.833 257.146,237.833C256.88,237.833 256.615,237.911 256.38,238.047L246.734,243.797C246.25,244.089 245.953,244.62 245.953,245.198L245.953,256.698C245.953,257.276 246.25,257.807 246.734,258.094L256.38,263.844C256.62,263.99 256.885,264.063 257.156,264.063C257.432,264.063 257.698,263.99 257.932,263.849L267.536,258.12C268.021,257.833 268.323,257.302 268.323,256.724L268.323,253.401C268.318,253.255 268.396,253.125 268.516,253.052L270.563,251.833C270.682,251.76 270.828,251.76 270.953,251.833C271.073,251.906 271.146,252.036 271.146,252.182L271.146,258.37C271.146,258.635 271.083,258.896 270.964,259.13C270.932,259.281 270.771,259.458 270.542,259.646C270.536,259.651 270.531,259.651 270.526,259.656C269.948,260.12 268.995,260.599 268.823,260.703L257.932,267.193C257.693,267.339 257.411,267.411 257.13,267.411L257.12,267.411L257.12,267.406C256.859,267.401 256.604,267.328 256.38,267.193L243.927,259.771C243.443,259.479 243.146,258.948 243.146,258.37L243.146,243.526C243.146,243.266 243.177,243 243.286,242.776C243.302,242.719 243.453,242.432 243.766,242.198C243.885,242.12 244.089,242.01 244.286,241.891L256.349,234.703C256.589,234.557 256.865,234.484 257.146,234.49C257.427,234.484 257.703,234.557 257.948,234.703L269.078,241.339C269.104,241.354 269.12,241.37 269.146,241.391L269.286,241.474C269.661,241.682 270.255,241.995 270.578,242.25L270.604,242.271C270.609,242.271 270.615,242.276 270.62,242.276C270.63,242.286 270.635,242.297 270.646,242.307C270.766,242.411 270.865,242.531 270.943,242.661C270.948,242.667 270.948,242.667 270.948,242.672C271.078,242.896 271.146,243.151 271.146,243.411L271.146,248.849C271.146,248.995 271.073,249.125 270.953,249.198L268.906,250.417C268.786,250.49 268.635,250.49 268.516,250.417C268.396,250.344 268.318,250.214 268.318,250.068L268.318,245.167C268.318,244.589 268.021,244.052 267.536,243.766L257.911,238.047Z"
1258
+ style="fill:rgb(0,86,214);fill-rule:nonzero;"
1259
+ />
1260
+ </g>
1261
+ </svg>
1262
+ `;
1263
+ const CheckmarkRibbon = y`
1264
+ <svg
1265
+ version="1.0"
1266
+ viewBox="0 0 500.000000 500.000000"
1267
+ preserveAspectRatio="xMidYMid meet"
1268
+ >
1269
+ <g
1270
+ transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"
1271
+ fill="#0056d6"
1272
+ stroke="none"
1273
+ >
1274
+ <path
1275
+ d="M2157 4460 c-66 -17 -120 -51 -194 -121 -84 -82 -151 -115 -255 -129 -94 -12 -155 -38 -213 -91 -56 -52 -90 -107 -106 -174 -6 -27 -25 -76 -42 -108 -30 -57 -51 -78 -167 -170 -39 -31 -64 -61 -88 -108 -42 -81 -49 -147 -29 -264 18 -109 10 -179 -28 -255 -45 -89 -56 -131 -56 -212 -1 -93 18 -141 96 -242 69 -91 85 -135 94 -271 9 -127 28 -180 87 -245 46 -50 87 -78 167 -109 78 -32 146 -96 190 -178 46 -87 106 -149 176 -182 51 -24 68 -26 199 -28 138 -1 145 -3 205 -32 34 -17 82 -44 107 -61 25 -16 74 -37 110 -46 94 -24 171 -8 281 57 112 66 141 73 276 65 92 -5 121 -3 171 12 85 27 147 74 192 146 94 149 120 173 237 222 175 72 236 160 253 361 10 119 33 174 105 256 116 132 132 265 53 428 -40 83 -49 194 -23 299 33 133 -6 256 -110 345 -144 124 -170 161 -200 276 -44 169 -146 261 -320 289 -102 16 -148 41 -239 128 -95 92 -115 105 -186 126 -75 22 -137 20 -226 -9 -105 -34 -200 -34 -291 1 -76 28 -169 38 -226 24z m458 -430 c50 -6 126 -19 170 -31 100 -25 279 -112 366 -178 82 -62 202 -188 252 -264 248 -375 247 -855 -3 -1228 -54 -80 -206 -232 -285 -284 -136 -90 -286 -150 -439 -176 -105 -18 -351 -6 -451 21 -478 129 -815 565 -815 1055 0 484 328 918 795 1050 144 41 265 51 410 35z"
1276
+ />
1277
+ <path
1278
+ d="M3045 3470 c-16 -4 -39 -11 -50 -18 -11 -6 -155 -159 -320 -341 -165 -181 -305 -330 -310 -330 -6 -1 -73 51 -150 115 -77 64 -156 123 -175 131 -67 29 -145 5 -194 -61 -25 -33 -29 -119 -7 -160 14 -26 398 -346 463 -386 46 -28 115 -27 159 3 37 25 719 763 750 812 23 36 25 114 5 153 -32 62 -104 96 -171 82z"
1279
+ />
1280
+ <path
1281
+ d="M1445 1778 c-26 -78 -306 -1021 -303 -1023 2 -2 109 27 238 66 129 38 240 68 246 67 7 -2 83 -87 169 -190 87 -104 160 -188 164 -188 3 0 64 194 135 431 l129 431 -29 23 c-51 42 -110 56 -205 49 -210 -16 -386 80 -482 263 -40 76 -54 93 -62 71z"
1282
+ />
1283
+ <path
1284
+ d="M3460 1677 c-95 -174 -295 -278 -481 -249 -41 6 -83 7 -114 1 -52 -10 -145 -63 -145 -84 0 -14 236 -802 247 -826 6 -13 45 28 168 177 88 106 166 193 173 193 7 1 117 -30 244 -68 128 -39 234 -68 237 -65 4 4 -275 945 -288 971 -4 8 -21 -13 -41 -50z"
1285
+ />
1286
+ </g>
1287
+ </svg>
1288
+ `;
1289
+ const MapIcon = y`
1290
+ <svg
1291
+ version="1.0"
1292
+ viewBox="0 0 500.000000 500.000000"
1293
+ preserveAspectRatio="xMidYMid meet"
1294
+ >
1295
+ <g
1296
+ transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"
1297
+ fill="#0056d6"
1298
+ stroke="none"
1299
+ >
1300
+ <path
1301
+ d="M2287 4490 c-650 -102 -1142 -559 -1295 -1205 -24 -100 -26 -128 -26 -315 0 -173 4 -220 22 -303 69 -311 206 -580 478 -940 185 -243 541 -680 814 -996 63 -74 133 -156 155 -182 29 -36 47 -49 65 -48 20 0 77 62 297 322 921 1092 1113 1383 1215 1844 32 143 32 421 0 580 -55 275 -184 539 -359 733 -231 256 -496 411 -843 491 -76 17 -133 22 -280 25 -102 1 -211 -1 -243 -6z m360 -241 c206 -23 416 -101 591 -221 102 -70 264 -233 330 -333 104 -157 177 -334 208 -508 25 -138 23 -355 -4 -484 -111 -516 -496 -902 -1012 -1015 -140 -31 -396 -30 -535 1 -382 86 -708 339 -883 686 -52 104 -95 228 -118 340 -25 126 -26 378 -1 495 56 263 175 481 361 666 291 289 659 418 1063 373z"
1302
+ />
1303
+ <path
1304
+ d="M2400 4098 c-502 -34 -925 -417 -1027 -927 -22 -111 -19 -316 7 -441 93 -457 446 -806 907 -897 115 -22 319 -22 428 1 292 63 533 216 710 451 67 88 151 265 182 380 24 90 27 117 27 280 1 206 -11 275 -75 442 -79 203 -244 406 -429 525 -114 74 -167 100 -281 136 -154 50 -272 63 -449 50z m248 -277 c50 -29 92 -56 92 -59 0 -7 -684 -394 -705 -400 -16 -4 -268 118 -260 126 4 4 167 100 363 213 l357 207 30 -18 c17 -9 72 -41 123 -69z m428 -243 c79 -45 144 -85 144 -88 0 -3 -162 -86 -360 -182 l-360 -177 -140 66 c-78 37 -137 70 -133 74 13 13 687 389 697 389 5 0 73 -37 152 -82z m-1266 -303 l130 -65 0 -220 0 -219 79 -61 c44 -33 82 -60 85 -60 3 0 7 107 8 239 l3 238 148 -70 147 -70 0 -464 c0 -254 -2 -463 -4 -463 -3 0 -168 94 -368 209 l-363 209 -3 431 c-1 237 0 431 3 431 3 0 64 -29 135 -65z m1520 -363 l0 -429 -369 -211 c-203 -117 -372 -212 -375 -212 -3 0 -5 208 -4 462 l3 462 364 178 c201 98 368 178 373 178 4 0 8 -193 8 -428z"
1305
+ />
1306
+ </g>
1307
+ </svg>
1308
+ `;
1309
+ const BoxIcon = y`
1310
+ <svg
1311
+ version="1.0"
1312
+ viewBox="0 0 500.000000 500.000000"
1313
+ preserveAspectRatio="xMidYMid meet"
1314
+ >
1315
+ <g
1316
+ transform="translate(0.000000,500.000000) scale(0.100000,-0.100000)"
1317
+ fill="#0056d6"
1318
+ stroke="none"
1319
+ >
1320
+ <path
1321
+ d="M1314 3708 c-92 -106 -174 -201 -182 -210 -14 -17 17 -18 636 -18 l652 0 0 210 0 210 -469 0 -469 0 -168 -192z"
1322
+ />
1323
+ <path
1324
+ d="M2570 3690 l0 -210 645 0 c355 0 645 2 645 5 0 7 -257 303 -319 368 l-45 47 -463 0 -463 0 0 -210z"
1325
+ />
1326
+ <path
1327
+ d="M1100 3170 l0 -160 83 0 82 0 115 -96 c63 -52 121 -103 128 -112 28 -36 15 -74 -58 -164 -68 -84 -70 -89 -70 -142 l0 -55 160 -3 161 -3 89 -91 c75 -76 90 -96 90 -123 0 -40 -31 -71 -71 -71 -25 0 -45 14 -103 70 l-73 70 -154 0 -155 0 -109 -44 -110 -44 -3 -185 -2 -185 121 -4 c113 -3 122 -5 140 -27 26 -32 24 -73 -4 -99 -21 -20 -34 -22 -140 -22 l-117 0 0 -285 0 -285 1395 0 1395 0 0 288 0 288 -70 69 -70 69 0 109 0 108 -75 79 c-45 47 -75 87 -75 100 0 13 30 53 75 100 l75 79 0 108 0 109 70 69 c69 69 70 70 70 122 l0 53 -110 0 c-78 0 -119 4 -139 15 -48 24 -55 72 -16 110 23 24 30 25 145 25 l120 0 0 160 0 160 -465 0 -465 0 0 -439 c0 -428 0 -439 -21 -465 -13 -17 -30 -26 -49 -26 -17 0 -102 40 -214 101 l-185 101 -184 -101 c-195 -107 -229 -117 -263 -80 -18 20 -19 45 -22 465 l-3 444 -459 0 -460 0 0 -160z m2429 -1355 c48 -24 55 -72 16 -110 -24 -25 -25 -25 -227 -25 -221 0 -239 4 -252 56 -8 31 14 71 47 84 12 5 104 9 205 9 142 1 189 -2 211 -14z m105 -356 c51 -23 55 -103 7 -128 -13 -7 -130 -11 -328 -11 -297 0 -310 1 -331 20 -32 30 -30 82 4 109 26 20 38 21 325 21 200 0 306 -4 323 -11z"
1328
+ />
1329
+ <path
1330
+ d="M2170 2965 c0 -201 2 -365 5 -365 2 0 66 34 142 76 76 41 150 78 165 81 20 4 55 -10 145 -60 65 -35 133 -72 151 -81 l32 -17 0 366 0 365 -320 0 -320 0 0 -365z"
1331
+ />
1332
+ </g>
1333
+ </svg>
1334
+ `;
1335
+ const BellIcon = y`
1336
+ <svg version="1.0" viewBox="0 0 500 500" preserveAspectRatio="xMidYMid meet">
1337
+ <g
1338
+ transform="translate(50.000000,450.000000) scale(0.080000,-0.080000)"
1339
+ fill="#0056d6"
1340
+ stroke="none"
1341
+ >
1342
+ <path
1343
+ d="M2434 4491 c-141 -36 -234 -150 -234 -287 l0 -53 -42 -11 c-232 -59 -452 -180 -626 -345 -212 -200 -345 -433 -414 -725 -18 -75 -21 -135 -28 -515 -7 -383 -10 -441 -29 -527 -41 -187 -98 -323 -233 -551 -85 -145 -99 -196 -74 -280 12 -43 29 -70 61 -102 80 -81 -44 -75 1685 -75 1729 0 1605 -6 1685 75 32 32 49 59 61 102 25 85 11 135 -77 285 -137 231 -188 354 -230 547 -18 84 -22 148 -29 511 -7 360 -11 427 -28 508 l-21 93 93 92 c75 75 100 108 134 178 95 193 96 406 3 594 -86 172 -214 281 -406 346 -101 34 -279 34 -380 0 -130 -44 -229 -108 -315 -204 -34 -38 -37 -39 -70 -29 -19 6 -54 16 -77 22 l-43 11 0 57 c0 105 -68 211 -165 257 -58 27 -150 39 -201 26z m1166 -781 l0 -360 -90 0 -90 0 0 240 c0 227 -1 241 -20 260 -14 14 -33 20 -65 20 l-45 0 0 40 c0 30 5 42 18 47 64 22 134 59 158 84 24 25 35 29 81 29 l53 0 0 -360z"
1344
+ />
1345
+ <path
1346
+ d="M2080 840 c-16 -30 -4 -70 39 -137 70 -109 179 -180 312 -204 136 -24 285 25 388 128 71 72 119 163 105 201 l-9 27 -412 3 c-408 2 -412 2 -423 -18z"
1347
+ />
1348
+ </g>
1349
+ </svg>
1350
+ `;
1028
1351
  var __defProp$1 = Object.defineProperty;
1029
1352
  var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
1030
1353
  var __decorateClass$1 = (decorators, target, key, kind) => {
@@ -1055,41 +1378,53 @@ let LearnMorePopup = class extends s$1 {
1055
1378
  >
1056
1379
  ${translate("learn-more-popup.close")}
1057
1380
  </button>
1381
+ <div class="popup-logo">${ShipAidLogoText}</div>
1058
1382
  <p class="popup-title">${translate("learn-more-popup.title")}</p>
1059
- <p>
1060
- ${translate("learn-more-popup.subtitle")}
1061
- </p>
1062
- <img
1063
- src="https://res.cloudinary.com/dxyz34kfj/image/upload/v1660782754/shipaid-image_hoz6k8.jpg"
1064
- alt="shipaid protected parcel"
1065
- class="popup-top-image"
1066
- />
1067
- <p class="popup-title">${translate("learn-more-popup.disclaimer.title")}</p>
1068
- <p>
1069
- ${translate("learn-more-popup.disclaimer.subtitle")}
1070
- </p>
1071
- <p class="popup-disclaimer">
1072
- ${translate("learn-more-popup.disclaimer.text")}
1073
- </p>
1074
- <div class="popup-footer">
1075
- <div class="footer-links">
1076
- <a
1077
- href="https://www.shipaid.com/terms-of-service"
1078
- target="_blank"
1079
- rel="noreferrer"
1080
- >
1081
- ${translate("learn-more-popup.links.terms")}
1082
- </a>
1083
- <a
1084
- href="https://www.shipaid.com/privacy-policy"
1085
- target="_blank"
1086
- rel="noreferrer"
1087
- >
1088
- ${translate("learn-more-popup.links.privacy")}
1089
- </a>
1090
- </div>
1091
- <div class="footer-date">
1092
- <p>ShipAid &copy; ${new Date().getFullYear()}</p>
1383
+ <div class="popup-disclaimer-subtitle">
1384
+ <div class="popup-icon">${CheckmarkRibbon}</div>
1385
+ <p>${translate("learn-more-popup.disclaimer.subtitle-enable")}</p>
1386
+ </div>
1387
+ <div class="popup-disclaimer-subtitle">
1388
+ <div class="popup-icon">${MapIcon}</div>
1389
+ <p>${translate("learn-more-popup.disclaimer.subtitle-monitor")}</p>
1390
+ </div>
1391
+ <div class="popup-disclaimer-subtitle">
1392
+ <div class="popup-icon-b">${BoxIcon}</div>
1393
+ <p>${translate("learn-more-popup.disclaimer.subtitle-notify")}</p>
1394
+ </div>
1395
+ <div class="popup-disclaimer-subtitle">
1396
+ <div class="popup-icon-bell">${BellIcon}</div>
1397
+ <p>
1398
+ ${translate("learn-more-popup.disclaimer.subtitle-resolution")}
1399
+ </p>
1400
+ </div>
1401
+ <p class="popup-disclaimer">
1402
+ ${translate("learn-more-popup.disclaimer.text")}
1403
+ </p>
1404
+ <hr class="popup-divider" />
1405
+ <div class="popup-footer">
1406
+ <div class="footer-links">
1407
+ <a
1408
+ href="https://www.shipaid.com/terms-of-service"
1409
+ target="_blank"
1410
+ rel="noreferrer"
1411
+ >
1412
+ ${translate("learn-more-popup.links.terms")}
1413
+ </a>
1414
+ <a
1415
+ href="https://www.shipaid.com/privacy-policy"
1416
+ target="_blank"
1417
+ rel="noreferrer"
1418
+ >
1419
+ ${translate("learn-more-popup.links.privacy")}
1420
+ </a>
1421
+ </div>
1422
+ <div class="footer-date">
1423
+ <p>ShipAid &copy; ${new Date().getFullYear()}</p>
1424
+ </div>
1425
+ </div>
1426
+ </div>
1427
+ </div>
1093
1428
  </div>
1094
1429
  </div>
1095
1430
  </div>
@@ -1123,10 +1458,11 @@ const defaultLangFile = {
1123
1458
  "learn-more-popup": {
1124
1459
  close: "Close",
1125
1460
  title: "Delivery Guarantee",
1126
- subtitle: "We empower your favorite brands to offer a delivery guarantee because every order is precious!",
1127
1461
  disclaimer: {
1128
- title: "Shop Worry-Free",
1129
- subtitle: "Brands and shipment carriers cannot always guarantee your order will arrive at your doorstep safely. Things happen! We help the brand you are purchasing from replace the product you ordered in the chance of an issue in transit. If you encounter an issue, simply reach out to the brand and they will get it resolved as soon as possible.",
1462
+ "subtitle-enable": "We enable your favorite brands to provide a delivery guarantee because we know that every order is precious, and things happen!",
1463
+ "subtitle-monitor": "We continuously monitor your package and offer a convenient portal for you to track your order's progress at any moment!",
1464
+ "subtitle-notify": "You'll be notified throughout the entire shipping process, ensuring you stay up to date every step of the way.",
1465
+ "subtitle-resolution": "In case of any issues during transit, we offer a quick and easy method to report the problem directly to the brand, for a swift resolution.",
1130
1466
  text: "By purchasing this delivery guarantee, you agree to our Terms Of Service and Privacy Policy. You are not obligated to purchase this guarantee. This guarantee is NOT insurance and does not provide indemnification against loss, damage, or liability arising from a contingent or unknown event, but rather, through ShipAid brands provide a delivery guarantee whereby if the product you ordered is not delivered in satisfactory condition, the brand from which you ordered the product may replace the product free of charge. ShipAid does not provide any products or services directly to consumers, but instead provides a service that allow brands to facilitate product replacement to their customers. Purchasing this guarantee does not mean that you will automatically be reimbursed for any product or shipping costs because the resolution process and decision for compensation is strictly decided by the brand you a purchasing from. The brand will require proof of damage or undelivered product."
1131
1467
  },
1132
1468
  links: {
@@ -1154,19 +1490,22 @@ const styles = i$2`
1154
1490
  --shipaid-text-grey: #aaaaaa;
1155
1491
  --shipaid-light-grey: #ebecf0;
1156
1492
  --shipaid-font: "Lato", sans-serif;
1493
+ --shipaid-font-xxs: 11px;
1157
1494
  --shipaid-font-xs: 12px;
1158
1495
  --shipaid-font-sm: 14px;
1159
1496
  --shipaid-font-base: 16px;
1160
1497
  --shipaid-font-lg: 18px;
1161
1498
  --shipaid-font-regular: 400;
1162
1499
  --shipaid-font-heavy: 700;
1500
+ --shipaid-prompt-badge: #f2f7ff;
1163
1501
  }
1164
1502
 
1165
1503
  * {
1166
1504
  font-family: var(--shipaid-font);
1167
1505
  }
1168
1506
 
1169
- p, a {
1507
+ p,
1508
+ a {
1170
1509
  font-weight: var(--shipaid-font-regular);
1171
1510
  font-size: var(--shipaid-font-base);
1172
1511
  color: var(--shipaid-text);
@@ -1179,11 +1518,11 @@ const styles = i$2`
1179
1518
 
1180
1519
  /* Widget */
1181
1520
  .shipaid-prompt {
1182
- width: var(--shipaid-prompt-width, 400px);
1521
+ width: var(--shipaid-prompt-width, 300px);
1183
1522
  max-width: 100%;
1184
1523
  display: flex;
1185
1524
  flex-direction: column;
1186
- gap: 1rem;
1525
+ gap: 0.5rem;
1187
1526
  margin: var(--shipaid-prompt-margin, 2rem 0px 4rem auto);
1188
1527
  }
1189
1528
 
@@ -1206,7 +1545,7 @@ const styles = i$2`
1206
1545
  .shipaid-prompt .prompt-product {
1207
1546
  display: flex;
1208
1547
  flex-direction: row;
1209
- gap: 1.2rem;
1548
+ gap: 1rem;
1210
1549
  margin-top: 1rem;
1211
1550
  }
1212
1551
  .shipaid-prompt .prompt-product .prompt-product-image {
@@ -1217,18 +1556,18 @@ const styles = i$2`
1217
1556
  width: auto;
1218
1557
  }
1219
1558
  .shipaid-prompt
1220
- .prompt-product
1221
- .prompt-product-details
1222
- .prompt-product-details-title {
1559
+ .prompt-product
1560
+ .prompt-product-details
1561
+ .prompt-product-details-title {
1223
1562
  text-align: left;
1224
- font-size: var(--shipaid-font-sm);
1563
+ font-size: var(--shipaid-font-lg);
1225
1564
  font-weight: var(--shipaid-font-heavy);
1226
1565
  }
1227
1566
  .shipaid-prompt
1228
- .prompt-product
1229
- .prompt-product-details
1230
- .prompt-product-details-description {
1231
- font-size: var(--shipaid-font-xs);
1567
+ .prompt-product
1568
+ .prompt-product-details
1569
+ .prompt-product-details-description {
1570
+ font-size: var(--shipaid-font-xxs);
1232
1571
  margin-top: var(--shipaid-prompt-product-description-margin, 0.65rem);
1233
1572
  }
1234
1573
  .shipaid-prompt .prompt-product .prompt-product-actions {
@@ -1262,7 +1601,7 @@ const styles = i$2`
1262
1601
  .shipaid-prompt .prompt-footer {
1263
1602
  display: flex;
1264
1603
  flex-direction: row;
1265
- justify-content: flex-end;
1604
+ justify-content: flex-start;
1266
1605
  align-items: center;
1267
1606
  }
1268
1607
  .shipaid-prompt .prompt-footer .prompt-footer-about {
@@ -1276,9 +1615,12 @@ const styles = i$2`
1276
1615
  margin-left: 0.5rem;
1277
1616
  }
1278
1617
  .shipaid-prompt .prompt-footer .prompt-footer-badge {
1279
- background-color: var(--shipaid-prompt-badge-background-color, var(--shipaid-light-grey));
1618
+ background-color: var(
1619
+ --shipaid-prompt-badge-background-color,
1620
+ var(--shipaid-prompt-badge)
1621
+ );
1280
1622
  color: var(--shipaid-prompt-badge-text-color, var(--shipaid-text));
1281
- padding: 0.5rem 1.5rem;
1623
+ padding: 0.2rem 1rem;
1282
1624
  border-radius: 30px;
1283
1625
  cursor: pointer;
1284
1626
  text-decoration: none;
@@ -1291,140 +1633,6 @@ const styles = i$2`
1291
1633
  height: 9px;
1292
1634
  }
1293
1635
  `;
1294
- const CheckmarkIcon = y`
1295
- <svg viewBox="0 0 453 511" version="1.1" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
1296
- <g transform="matrix(1,0,0,1,-29.4375,-0.984384)">
1297
- <path d="M468.297,67.385L262.417,2C258.177,0.646 253.63,0.646 249.391,2L43.51,67.385C35.188,69.708 29.438,77.318 29.438,85.979C32.302,157.156 52.266,370.036 52.266,370.036C52.906,378.188 57.297,385.568 64.167,390.01L248.807,509.156C253.12,511.943 258.688,511.943 263.005,509.156L447.641,390.01C454.51,385.568 458.901,378.188 459.542,370.036C459.542,370.036 479.51,157.156 482.37,85.979C482.37,77.318 476.625,69.708 468.297,67.385" style="fill:rgb(47,52,61);fill-rule:nonzero;"/>
1298
- <path d="M256.01,120.969C286.193,120.969 314.057,130.87 336.536,147.604L309.406,174.656C294.073,164.573 275.729,158.708 256.01,158.708C229.141,158.708 204.823,169.604 187.214,187.198C169.615,204.797 158.719,229.125 158.719,255.995C158.719,282.865 169.615,307.182 187.214,324.792C204.813,342.406 229.141,353.286 256.01,353.286C282.88,353.286 307.208,342.406 324.807,324.792C342.406,307.193 353.297,282.865 353.297,255.995C353.297,251.818 353.036,247.719 352.526,243.688L383.859,212.458C388.51,226.115 391.036,240.766 391.036,255.995C391.036,293.286 375.927,327.047 351.49,351.479C327.057,375.911 293.302,391.021 256.01,391.021C218.729,391.021 184.964,375.911 160.526,351.479C136.094,327.047 120.984,293.286 120.984,255.995C120.984,218.719 136.094,184.948 160.526,160.516C184.964,136.083 218.719,120.969 256.01,120.969ZM218.141,220.906L253.615,259.729L354.844,158.813L381.375,185.484L252.396,314.068L190.422,246.255L218.13,220.906L218.141,220.906Z" style="fill:white;fill-rule:nonzero;"/>
1299
- </g>
1300
- </svg>
1301
- `;
1302
- const ShipAidLogo = y`
1303
- <svg
1304
- viewBox="0 0 384 383.999986"
1305
- preserveAspectRatio="xMidYMid meet"
1306
- >
1307
- <defs>
1308
- <clipPath id="id1">
1309
- <path
1310
- d="M 22.078125 0.753906 L 361.777344 0.753906 L 361.777344 383.4375 L 22.078125 383.4375 Z M 22.078125 0.753906 "
1311
- clip-rule="nonzero"
1312
- />
1313
- </clipPath>
1314
- <clipPath id="id2">
1315
- <path
1316
- d="M 37.261719 0 L 347.011719 0 L 347.011719 353 L 37.261719 353 Z M 37.261719 0 "
1317
- clip-rule="nonzero"
1318
- />
1319
- </clipPath>
1320
- </defs>
1321
- <g clip-path="url(#id1)">
1322
- <path
1323
- fill="#0056d6"
1324
- d="M 351.222656 50.539062 L 196.8125 1.5 C 193.632812 0.484375 190.222656 0.484375 187.042969 1.5 L 32.632812 50.539062 C 26.390625 52.28125 22.078125 57.988281 22.078125 64.484375 C 24.226562 117.867188 39.199219 277.527344 39.199219 277.527344 C 39.679688 283.640625 42.972656 289.175781 48.125 292.507812 L 186.605469 381.867188 C 189.839844 383.957031 194.015625 383.957031 197.253906 381.867188 L 335.730469 292.507812 C 340.882812 289.175781 344.175781 283.640625 344.65625 277.527344 C 344.65625 277.527344 359.632812 117.867188 361.777344 64.484375 C 361.777344 57.988281 357.46875 52.28125 351.222656 50.539062 "
1325
- fill-opacity="1"
1326
- fill-rule="nonzero"
1327
- />
1328
- </g>
1329
- <path
1330
- fill="#ffffff"
1331
- d="M 292.539062 118.640625 C 291.910156 117.488281 291.085938 116.351562 289.371094 115.484375 L 264.84375 101.324219 C 264.503906 101.132812 264.140625 100.984375 263.753906 100.886719 C 263.632812 100.855469 263.511719 100.855469 263.378906 100.835938 C 263.125 100.792969 262.871094 100.746094 262.617188 100.75 L 262.570312 100.746094 L 262.570312 100.757812 C 261.84375 100.773438 261.128906 100.96875 260.5 101.328125 L 205.3125 133.175781 L 205.265625 133.078125 L 200.8125 135.65625 C 195.441406 138.75 188.832031 138.75 183.460938 135.65625 L 159.335938 121.738281 C 158 120.960938 157.171875 119.53125 157.171875 117.980469 C 157.171875 116.429688 158 115 159.335938 114.222656 L 183.460938 100.3125 C 188.832031 97.214844 195.441406 97.214844 200.8125 100.3125 L 206.621094 103.664062 C 207.964844 104.4375 209.609375 104.4375 210.953125 103.664062 L 233.421875 90.703125 C 234.765625 89.929688 235.585938 88.5 235.585938 86.949219 C 235.585938 85.402344 234.765625 83.96875 233.421875 83.195312 L 200.8125 64.375 C 195.441406 61.28125 188.832031 61.28125 183.460938 64.375 L 103.578125 110.472656 C 97.796875 113.8125 97.796875 122.148438 103.578125 125.484375 L 183.460938 171.582031 C 188.832031 174.679688 195.441406 174.679688 200.8125 171.582031 L 262.570312 135.945312 L 262.570312 217.125 L 242.726562 228.609375 L 200.8125 252.867188 C 199.480469 253.628906 198.066406 254.210938 196.589844 254.609375 C 192.160156 255.785156 187.441406 255.15625 183.460938 252.867188 L 126.035156 219.734375 C 123.351562 218.1875 121.699219 215.320312 121.699219 212.226562 L 121.699219 164.90625 C 121.699219 163.359375 120.871094 161.921875 119.53125 161.160156 L 97.070312 148.183594 C 95.726562 147.410156 94.074219 147.410156 92.730469 148.183594 C 91.390625 148.957031 90.5625 150.394531 90.5625 151.945312 L 90.5625 230.195312 C 90.5625 233.292969 92.21875 236.144531 94.902344 237.703125 L 183.460938 288.808594 C 186.0625 290.308594 189.015625 291.09375 192.015625 291.117188 L 192.078125 291.117188 C 192.5 291.117188 192.921875 291.070312 193.347656 291.046875 C 193.671875 291.019531 194 291.019531 194.328125 290.984375 C 194.773438 290.925781 195.222656 290.816406 195.65625 290.730469 C 195.960938 290.660156 196.261719 290.621094 196.554688 290.550781 C 197.039062 290.429688 197.496094 290.246094 197.957031 290.078125 C 198.222656 289.980469 198.476562 289.921875 198.71875 289.824219 C 199.433594 289.535156 200.132812 289.195312 200.800781 288.808594 L 277.210938 244.71875 L 289.320312 237.851562 C 292.03125 236.3125 293.714844 233.4375 293.714844 230.316406 L 293.714844 122.980469 C 293.714844 121.433594 293.289062 119.941406 292.539062 118.640625 "
1332
- fill-opacity="1"
1333
- fill-rule="nonzero"
1334
- />
1335
- <g clip-path="url(#id2)">
1336
- <path
1337
- fill="#0056d6"
1338
- d="M 200.59375 38.453125 C 198.015625 36.96875 195.113281 36.175781 192.136719 36.148438 C 189.171875 36.175781 186.257812 36.972656 183.679688 38.453125 L 76.964844 100.03125 C 71.613281 103.121094 68.316406 108.828125 68.3125 115.003906 L 68.3125 238.167969 C 68.3125 244.347656 71.609375 250.054688 76.964844 253.140625 L 183.679688 314.714844 C 186.292969 316.226562 189.246094 317.023438 192.257812 317.035156 C 195.269531 317.023438 198.234375 316.226562 200.847656 314.726562 L 307.09375 253.417969 C 312.441406 250.332031 315.746094 244.625 315.746094 238.445312 L 315.746094 202.859375 C 315.734375 201.308594 316.570312 199.882812 317.898438 199.109375 L 340.527344 186.0625 C 341.855469 185.285156 343.515625 185.285156 344.847656 186.0625 C 346.1875 186.835938 347.011719 188.261719 347.011719 189.808594 L 347.011719 256.089844 C 347 258.917969 346.296875 261.699219 344.96875 264.191406 C 344.628906 265.824219 342.847656 267.746094 340.332031 269.71875 C 340.285156 269.765625 340.210938 269.8125 340.152344 269.863281 C 333.761719 274.832031 323.1875 279.960938 321.3125 281.046875 L 200.847656 350.558594 C 198.148438 352.105469 195.078125 352.902344 191.96875 352.867188 L 191.835938 352.867188 L 191.835938 352.855469 C 188.964844 352.78125 186.160156 351.984375 183.679688 350.558594 L 45.914062 271.058594 C 40.558594 267.976562 37.261719 262.269531 37.261719 256.089844 L 37.261719 97.09375 C 37.261719 94.320312 37.613281 91.492188 38.832031 89.097656 C 39 88.476562 40.667969 85.421875 44.109375 82.910156 C 45.40625 82.039062 47.699219 80.863281 49.847656 79.621094 L 183.292969 2.625 C 185.980469 1.078125 189.039062 0.28125 192.136719 0.320312 C 195.246094 0.28125 198.296875 1.078125 200.984375 2.625 L 324.121094 73.667969 C 324.398438 73.839844 324.617188 74.042969 324.859375 74.238281 L 326.417969 75.132812 C 330.605469 77.351562 337.164062 80.730469 340.722656 83.429688 L 341.011719 83.648438 C 341.058594 83.6875 341.109375 83.722656 341.15625 83.753906 C 341.277344 83.859375 341.363281 83.960938 341.484375 84.070312 C 342.789062 85.164062 343.902344 86.445312 344.761719 87.878906 C 344.785156 87.898438 344.800781 87.921875 344.824219 87.945312 L 344.8125 87.949219 C 346.25 90.351562 347.011719 93.097656 347.011719 95.894531 L 347.011719 154.113281 C 347.011719 155.660156 346.191406 157.085938 344.847656 157.859375 L 322.222656 170.921875 C 320.890625 171.683594 319.230469 171.683594 317.902344 170.921875 C 316.558594 170.144531 315.734375 168.71875 315.734375 167.171875 L 315.734375 114.671875 C 315.734375 108.484375 312.433594 102.773438 307.070312 99.6875 L 200.597656 38.453125 L 200.597656 38.457031 Z M 200.59375 38.453125 "
1339
- fill-opacity="1"
1340
- fill-rule="nonzero"
1341
- />
1342
- </g>
1343
- </svg>
1344
- `;
1345
- const ShipAidLogoText = y`
1346
- <svg
1347
- viewBox="0 0 423 62"
1348
- version="1.1"
1349
- xml:space="preserve"
1350
- style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"
1351
- >
1352
- <g transform="matrix(1,0,0,1,-45.4439,-231.396)">
1353
- <g transform="matrix(1,0,0,1,41.8553,292.5)">
1354
- <g>
1355
- <path
1356
- d="M25.484,0.536C36.161,0.536 47.828,-4.755 47.646,-17.047C47.646,-37.958 14.089,-31.047 14.177,-43.427C14.089,-47.646 18.036,-51.328 25.125,-51.328C31.318,-51.328 34.724,-50.068 39.302,-47.646C40.021,-47.286 40.828,-47.021 41.547,-47.021C43.88,-47.021 46.12,-48.995 46.12,-51.505C46.214,-53.391 45.047,-54.734 43.88,-55.453C39.75,-58.234 31.854,-61.104 25.125,-61.104C13.729,-61.104 3.589,-55.094 3.589,-42.979C3.589,-20.995 37.146,-27.906 37.146,-16.333C37.146,-11.932 32.214,-8.885 25.036,-9.062C19.474,-9.151 15.432,-11.036 11.667,-12.922C10.859,-13.37 9.87,-13.547 9.422,-13.547C6.911,-13.547 4.484,-11.484 4.396,-8.526C4.307,-6.729 5.385,-5.292 6.818,-4.307C10.766,-1.703 18.125,0.63 25.484,0.536Z"
1357
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1358
- />
1359
- </g>
1360
- </g>
1361
- <g transform="matrix(1,0,0,1,111.569,292.5)">
1362
- <g>
1363
- <path
1364
- d="M48.901,-60.656C45.943,-60.656 43.609,-58.234 43.609,-55.365L43.609,-34.547L16.87,-34.547L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-24.943L43.609,-24.943L43.609,-5.292C43.609,-2.333 45.943,0 48.901,0C51.776,0 54.198,-2.333 54.198,-5.292L54.198,-55.365C54.198,-58.234 51.776,-60.656 48.901,-60.656Z"
1365
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1366
- />
1367
- </g>
1368
- </g>
1369
- <g transform="matrix(1,0,0,1,190.435,292.5)">
1370
- <g>
1371
- <path
1372
- d="M11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-55.365C16.87,-58.234 14.536,-60.656 11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0Z"
1373
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1374
- />
1375
- </g>
1376
- </g>
1377
- <g transform="matrix(1,0,0,1,232.067,292.5)">
1378
- <g>
1379
- <path
1380
- d="M25.125,-60.656L11.573,-60.656C8.703,-60.656 6.281,-58.234 6.281,-55.365L6.281,-5.292C6.281,-2.333 8.703,0 11.573,0C14.536,0 16.87,-2.333 16.87,-5.292L16.87,-23.151L25.125,-23.151C35.714,-23.151 44.328,-30.865 44.328,-41.906C44.328,-52.849 35.714,-60.656 25.125,-60.656ZM24.766,-32.844L16.87,-32.844L16.87,-50.969L24.766,-50.969C29.703,-50.969 33.74,-47.198 33.74,-41.906C33.74,-36.521 29.703,-32.844 24.766,-32.844Z"
1381
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1382
- />
1383
- </g>
1384
- </g>
1385
- <g transform="matrix(1,0,0,1,298.418,292.5)">
1386
- <g>
1387
- <path
1388
- d="M54.198,-4.844L32.214,-58.417C31.583,-59.849 30.151,-60.839 28.536,-60.745C26.917,-60.839 25.396,-59.849 24.854,-58.417L2.87,-4.844C2.063,-2.87 3.052,-0.63 4.938,0.089C6.729,0.896 9.063,0.177 9.87,-1.974L15.255,-15.344L41.724,-15.344L47.109,-1.974C47.917,-0.089 50.161,0.99 52.135,0.089C54.016,-0.63 54.917,-2.964 54.198,-4.844ZM18.125,-22.432L28.536,-48.276L38.854,-22.432L18.125,-22.432Z"
1389
- style="fill:rgb(47,52,61);fill-rule:nonzero;"
1390
- />
1391
- </g>
1392
- </g>
1393
- <g transform="matrix(1,0,0,1,373.874,292.5)">
1394
- <g>
1395
- <path
1396
- d="M10.318,0C12.474,0 14.177,-1.703 14.177,-3.859L14.177,-56.797C14.177,-58.865 12.474,-60.656 10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0Z"
1397
- style="fill:rgb(47,52,61);fill-rule:nonzero;"
1398
- />
1399
- </g>
1400
- </g>
1401
- <g transform="matrix(1,0,0,1,412.904,292.5)">
1402
- <g>
1403
- <path
1404
- d="M24.854,-60.656L10.318,-60.656C8.167,-60.656 6.458,-58.865 6.458,-56.797L6.458,-3.859C6.458,-1.703 8.167,0 10.318,0L24.854,0C41.724,0 55.005,-12.38 55.005,-30.328C55.005,-48.187 41.724,-60.656 24.854,-60.656ZM24.854,-7.089L14.177,-7.089L14.177,-53.568L24.854,-53.568C37.417,-53.568 47.286,-44.057 47.286,-30.328C47.286,-16.51 37.417,-7.089 24.854,-7.089Z"
1405
- style="fill:rgb(47,52,61);fill-rule:nonzero;"
1406
- />
1407
- </g>
1408
- </g>
1409
- <path
1410
- d="M255.854,234.453C247.292,234.453 240.354,241.391 240.354,249.953C240.354,258.51 247.292,265.453 255.854,265.453C264.417,265.453 271.354,258.51 271.354,249.953C271.354,241.391 264.417,234.453 255.854,234.453ZM253.01,257.911L246.188,251.089L248.458,248.813L253.01,253.365L263.25,243.125L265.521,245.401L253.01,257.911Z"
1411
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1412
- />
1413
- <path
1414
- d="M270.385,238.443L256.297,233.974C256.005,233.88 255.698,233.88 255.406,233.974L241.318,238.443C240.745,238.599 240.354,239.12 240.354,239.714C240.552,244.578 241.917,259.135 241.917,259.135C241.958,259.693 242.26,260.193 242.729,260.5L255.365,268.646C255.661,268.833 256.042,268.833 256.339,268.646L268.974,260.5C269.443,260.193 269.745,259.693 269.786,259.135C269.786,259.135 271.151,244.578 271.349,239.714C271.349,239.12 270.958,238.599 270.385,238.443"
1415
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1416
- />
1417
- <path
1418
- d="M266.224,245.536C266.167,245.427 266.094,245.323 265.938,245.24L263.719,243.922C263.688,243.901 263.656,243.885 263.62,243.88C263.609,243.875 263.599,243.875 263.589,243.875C263.563,243.87 263.542,243.865 263.516,243.865C263.448,243.87 263.385,243.885 263.328,243.922L258.339,246.896L258.333,246.885L257.932,247.125C257.448,247.417 256.849,247.417 256.365,247.125L254.182,245.823C254.063,245.755 253.984,245.62 253.984,245.474C253.984,245.328 254.063,245.198 254.182,245.125L256.365,243.823C256.849,243.536 257.448,243.536 257.932,243.823L258.458,244.135C258.578,244.208 258.724,244.208 258.849,244.135L260.88,242.927C261,242.854 261.073,242.724 261.073,242.578C261.073,242.432 261,242.297 260.88,242.224L257.932,240.469C257.448,240.182 256.849,240.182 256.365,240.469L249.141,244.776C248.62,245.083 248.62,245.865 249.141,246.177L256.365,250.479C256.849,250.771 257.448,250.771 257.932,250.479L263.516,247.151L263.516,254.734L261.719,255.807L257.932,258.073C257.813,258.141 257.682,258.198 257.547,258.234C257.151,258.344 256.724,258.286 256.365,258.073L251.172,254.979C250.927,254.833 250.781,254.563 250.781,254.276L250.781,249.854C250.781,249.714 250.703,249.578 250.583,249.505L248.552,248.297C248.432,248.224 248.281,248.224 248.161,248.297C248.042,248.37 247.964,248.5 247.964,248.646L247.964,255.953C247.964,256.245 248.115,256.51 248.359,256.656L256.365,261.427C256.599,261.568 256.865,261.641 257.135,261.641L257.141,261.641C257.177,261.641 257.219,261.641 257.255,261.635C257.286,261.635 257.318,261.635 257.344,261.63C257.385,261.625 257.427,261.615 257.464,261.604C257.495,261.599 257.521,261.599 257.547,261.589C257.589,261.578 257.63,261.563 257.672,261.547C257.698,261.536 257.719,261.531 257.74,261.521C257.807,261.495 257.87,261.464 257.932,261.427L264.839,257.307L265.932,256.667C266.177,256.526 266.328,256.255 266.328,255.964L266.328,245.943C266.328,245.797 266.292,245.656 266.224,245.536"
1419
- style="fill:white;fill-rule:nonzero;"
1420
- />
1421
- <path
1422
- d="M257.911,238.047C257.677,237.911 257.417,237.833 257.146,237.833C256.88,237.833 256.615,237.911 256.38,238.047L246.734,243.797C246.25,244.089 245.953,244.62 245.953,245.198L245.953,256.698C245.953,257.276 246.25,257.807 246.734,258.094L256.38,263.844C256.62,263.99 256.885,264.063 257.156,264.063C257.432,264.063 257.698,263.99 257.932,263.849L267.536,258.12C268.021,257.833 268.323,257.302 268.323,256.724L268.323,253.401C268.318,253.255 268.396,253.125 268.516,253.052L270.563,251.833C270.682,251.76 270.828,251.76 270.953,251.833C271.073,251.906 271.146,252.036 271.146,252.182L271.146,258.37C271.146,258.635 271.083,258.896 270.964,259.13C270.932,259.281 270.771,259.458 270.542,259.646C270.536,259.651 270.531,259.651 270.526,259.656C269.948,260.12 268.995,260.599 268.823,260.703L257.932,267.193C257.693,267.339 257.411,267.411 257.13,267.411L257.12,267.411L257.12,267.406C256.859,267.401 256.604,267.328 256.38,267.193L243.927,259.771C243.443,259.479 243.146,258.948 243.146,258.37L243.146,243.526C243.146,243.266 243.177,243 243.286,242.776C243.302,242.719 243.453,242.432 243.766,242.198C243.885,242.12 244.089,242.01 244.286,241.891L256.349,234.703C256.589,234.557 256.865,234.484 257.146,234.49C257.427,234.484 257.703,234.557 257.948,234.703L269.078,241.339C269.104,241.354 269.12,241.37 269.146,241.391L269.286,241.474C269.661,241.682 270.255,241.995 270.578,242.25L270.604,242.271C270.609,242.271 270.615,242.276 270.62,242.276C270.63,242.286 270.635,242.297 270.646,242.307C270.766,242.411 270.865,242.531 270.943,242.661C270.948,242.667 270.948,242.667 270.948,242.672C271.078,242.896 271.146,243.151 271.146,243.411L271.146,248.849C271.146,248.995 271.073,249.125 270.953,249.198L268.906,250.417C268.786,250.49 268.635,250.49 268.516,250.417C268.396,250.344 268.318,250.214 268.318,250.068L268.318,245.167C268.318,244.589 268.021,244.052 267.536,243.766L257.911,238.047Z"
1423
- style="fill:rgb(0,86,214);fill-rule:nonzero;"
1424
- />
1425
- </g>
1426
- </svg>
1427
- `;
1428
1636
  var Events = /* @__PURE__ */ ((Events2) => {
1429
1637
  Events2["LOADED"] = "shipaid-loaded";
1430
1638
  Events2["STATUS_UPDATE"] = "shipaid-protection-status";
@@ -1472,7 +1680,11 @@ const StoreQuery = `query StoreByDomain ($store: String!) {
1472
1680
  protectionSettings
1473
1681
  }
1474
1682
  }`;
1475
- const langFiles = /* @__PURE__ */ Object.assign({ "./lang/en.json": () => Promise.resolve().then(() => en).then((m2) => m2["default"]), "./lang/it.json": () => import("./it-0759ce74.js").then((m2) => m2["default"]), "./lang/pt.json": () => import("./pt-bc086d7f.js").then((m2) => m2["default"]) });
1683
+ const langFiles = /* @__PURE__ */ Object.assign({
1684
+ "./lang/en.json": () => Promise.resolve().then(() => en).then((m2) => m2["default"]),
1685
+ "./lang/it.json": () => import("./it-108c90b9.js").then((m2) => m2["default"]),
1686
+ "./lang/pt.json": () => import("./pt-b1b6ec67.js").then((m2) => m2["default"])
1687
+ });
1476
1688
  registerTranslateConfig({
1477
1689
  loader: async (lang) => {
1478
1690
  if (lang === "en")
@@ -1544,7 +1756,9 @@ let ShipAidWidget = class extends s$1 {
1544
1756
  // ? Internal methods
1545
1757
  /** Emit events */
1546
1758
  _dispatchEvent(event, detail = {}) {
1547
- this.dispatchEvent(new CustomEvent(event, { bubbles: true, composed: true, detail }));
1759
+ this.dispatchEvent(
1760
+ new CustomEvent(event, { bubbles: true, composed: true, detail })
1761
+ );
1548
1762
  }
1549
1763
  /** Handle cart or page refreshes */
1550
1764
  async _handleRefresh(input) {
@@ -1561,76 +1775,36 @@ let ShipAidWidget = class extends s$1 {
1561
1775
  }
1562
1776
  /** Given the current order, it calculates the protection total according to the store protection settings. */
1563
1777
  async calculateProtectionTotal(cart) {
1564
- var _a, _b, _c, _d, _e, _f;
1565
1778
  if (!cart)
1566
1779
  cart = await this._fetchCart();
1567
1780
  if (!cart)
1568
1781
  throw new Error("Could not fetch cart.");
1569
1782
  if (!this._store)
1570
- throw new Error("Missing store settings.");
1571
- const settings = (_a = this._store) == null ? void 0 : _a.protectionSettings;
1572
- if (!settings || !this._protectionProduct) {
1573
- throw new Error("Tried to find protection variant, but protection settings for this store are missing.");
1574
- }
1575
- const excludedProductSkus = Array.isArray((_b = this._store) == null ? void 0 : _b.excludedProductSkus) ? (_c = this._store) == null ? void 0 : _c.excludedProductSkus.map((sku) => sku.trim()) : [];
1576
- const itemTotal = ((_d = cart.items) == null ? void 0 : _d.reduce((total, item) => {
1577
- if (!item.sku)
1578
- return total;
1579
- const itemIsExcluded = excludedProductSkus.some((sku) => sku === item.sku.trim());
1580
- return itemIsExcluded ? total - item.final_line_price : total;
1581
- }, cart.total_price)) ?? cart.total_price;
1582
- const protectionVariantsInCart = ((_e = cart.items) == null ? void 0 : _e.filter((item) => {
1583
- var _a2, _b2;
1584
- return (_b2 = (_a2 = this._protectionProduct) == null ? void 0 : _a2.variants) == null ? void 0 : _b2.some((variant) => variant.id === item.variant_id);
1585
- })) ?? [];
1586
- const protectionVariantsInCartTotal = protectionVariantsInCart.reduce((total, item) => total + item.final_line_price, 0);
1587
- const cartTotal = itemTotal - protectionVariantsInCartTotal;
1588
- if (settings.protectionType === "FIXED") {
1589
- if (typeof settings.defaultFee !== "number")
1590
- throw new Error("Missing default fee amount.");
1591
- if (!((_f = settings.rules) == null ? void 0 : _f.length))
1592
- return settings.defaultFee;
1593
- const formattedCartTotal = cartTotal / 100;
1594
- const sortedRules = settings.rules.sort((a2, b2) => {
1595
- if (!a2.rangeLower || !b2.rangeLower)
1596
- return 0;
1597
- return a2.rangeLower - b2.rangeLower;
1598
- });
1599
- const rule = sortedRules.find((rule2) => {
1600
- const lower = Boolean(rule2.rangeLower && rule2.rangeLower < formattedCartTotal);
1601
- if (!rule2.rangeUpper)
1602
- return lower;
1603
- return lower && rule2.rangeUpper >= formattedCartTotal;
1604
- });
1605
- return typeof (rule == null ? void 0 : rule.fee) === "number" ? rule.fee : settings.defaultFee;
1783
+ throw new Error("Missing ShipAid store");
1784
+ if (!this._protectionProduct) {
1785
+ throw new Error("Missing Shopify protection product");
1606
1786
  }
1607
- if (settings.protectionType === "PERCENTAGE") {
1608
- const percentageFee = cartTotal * settings.percentage / 100;
1609
- return percentageFee >= settings.minimumFee ? percentageFee : settings.minimumFee;
1610
- }
1611
- throw new Error("No protection type handler found for this store.");
1787
+ return common.calculateProtectionTotal(
1788
+ this._store,
1789
+ this._protectionProduct,
1790
+ cart
1791
+ );
1612
1792
  }
1613
1793
  /**
1614
1794
  * Given the current order, it finds the relevant protection product variant, and adds it to cart.
1615
1795
  * This should be run whenever the cart updates, or it is manually triggered.
1616
1796
  */
1617
1797
  _findProtectionVariant(protectionFee) {
1618
- var _a, _b, _c, _d;
1619
- const settings = (_a = this._store) == null ? void 0 : _a.protectionSettings;
1620
- if (!settings || !((_c = (_b = this._protectionProduct) == null ? void 0 : _b.variants) == null ? void 0 : _c.length)) {
1621
- throw new Error("Missing product and variants from protection settings.");
1622
- }
1623
- const formattedVariants = (_d = this._protectionProduct) == null ? void 0 : _d.variants.flatMap((variant) => {
1624
- if (!variant || !variant.price)
1625
- return [];
1626
- const formattedPrice = Number(variant.price);
1627
- return [{ ...variant, formattedPrice }];
1628
- }).sort((a2, b2) => a2.formattedPrice - b2.formattedPrice);
1629
- const matchingVariant = formattedVariants.find((variant) => variant.formattedPrice >= protectionFee);
1630
- if (!matchingVariant) {
1631
- return formattedVariants[formattedVariants.length - 1];
1798
+ if (!this._store)
1799
+ throw new Error("Missing ShipAid store");
1800
+ if (!this._protectionProduct) {
1801
+ throw new Error("Missing Shopify protection product");
1632
1802
  }
1633
- return matchingVariant;
1803
+ return common.findProtectionVariant(
1804
+ this._store,
1805
+ this._protectionProduct,
1806
+ protectionFee
1807
+ );
1634
1808
  }
1635
1809
  /** Update State */
1636
1810
  _setState(state2, message) {
@@ -1688,7 +1862,9 @@ let ShipAidWidget = class extends s$1 {
1688
1862
  /** Fetch current product from the Shopify ajax API */
1689
1863
  async _fetchProduct() {
1690
1864
  try {
1691
- const { product } = await this._fetch.get(`/products/${PRODUCT_HANDLE}.json`);
1865
+ const { product } = await this._fetch.get(
1866
+ `/products/${PRODUCT_HANDLE}.json`
1867
+ );
1692
1868
  return product;
1693
1869
  } catch (err) {
1694
1870
  const error = err;
@@ -1770,9 +1946,12 @@ let ShipAidWidget = class extends s$1 {
1770
1946
  /** Templates */
1771
1947
  learnMorePopupTemplate() {
1772
1948
  return y`
1773
- <shipaid-popup-learn-more ?active=${this._popup === "learn-more"} @close=${() => {
1949
+ <shipaid-popup-learn-more
1950
+ ?active=${this._popup === "learn-more"}
1951
+ @close=${() => {
1774
1952
  this._popup = null;
1775
- }}></shipaid-popup-learn-more>
1953
+ }}
1954
+ ></shipaid-popup-learn-more>
1776
1955
  `;
1777
1956
  }
1778
1957
  promptTemplate() {
@@ -1783,8 +1962,8 @@ let ShipAidWidget = class extends s$1 {
1783
1962
  <div class="prompt-product-image">
1784
1963
  ${n(
1785
1964
  this._hasProtectionInCart,
1786
- () => CheckmarkIcon,
1787
- () => ShipAidLogo
1965
+ () => ShipAidLogo,
1966
+ () => CheckmarkIcon
1788
1967
  )}
1789
1968
  </div>
1790
1969
  <div class="prompt-product-details">
@@ -1826,15 +2005,15 @@ let ShipAidWidget = class extends s$1 {
1826
2005
  >
1827
2006
  <span>${translate("footer.button")}</span>
1828
2007
  ${ShipAidLogoText}
1829
- </a>
1830
- <button
1831
- class="prompt-footer-about"
1832
- @click=${() => {
2008
+ <button
2009
+ class="prompt-footer-about"
2010
+ @click=${() => {
1833
2011
  this._popup = "learn-more";
1834
2012
  }}
1835
- >
1836
- i
1837
- </button>
2013
+ >
2014
+ i
2015
+ </button>
2016
+ </a>
1838
2017
  </div>
1839
2018
  </div>
1840
2019
  `;
@@ -1884,7 +2063,9 @@ let ShipAidWidget = class extends s$1 {
1884
2063
  return;
1885
2064
  }
1886
2065
  if (!this._protectionProduct) {
1887
- logger.warn("No protection settings product for this store - skipping setup.");
2066
+ logger.warn(
2067
+ "No protection settings product for this store - skipping setup."
2068
+ );
1888
2069
  this._hasFinishedSetup = true;
1889
2070
  this._shouldShowWidget = false;
1890
2071
  return;
@@ -1901,7 +2082,10 @@ let ShipAidWidget = class extends s$1 {
1901
2082
  const hasSessionPayload = !!sessionStorage.getItem(LOCAL_STORAGE_KEY);
1902
2083
  if (hasSessionPayload)
1903
2084
  return;
1904
- sessionStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify({ loaded: true }));
2085
+ sessionStorage.setItem(
2086
+ LOCAL_STORAGE_KEY,
2087
+ JSON.stringify({ loaded: true })
2088
+ );
1905
2089
  if (
1906
2090
  // If we first check that no protection items are in the cart
1907
2091
  !this._hasProtectionInCart && // Then check we have some items in the cart
@@ -1933,7 +2117,9 @@ let ShipAidWidget = class extends s$1 {
1933
2117
  return;
1934
2118
  const protectionCartItemIndex = (_b = this._cart.items) == null ? void 0 : _b.findIndex((item) => {
1935
2119
  var _a2, _b2;
1936
- return (_b2 = (_a2 = this._protectionProduct) == null ? void 0 : _a2.variants) == null ? void 0 : _b2.some((variant) => variant.id === item.variant_id);
2120
+ return (_b2 = (_a2 = this._protectionProduct) == null ? void 0 : _a2.variants) == null ? void 0 : _b2.some(
2121
+ (variant) => variant.id === item.variant_id
2122
+ );
1937
2123
  });
1938
2124
  const protectionCartItem = (_c = this._cart) == null ? void 0 : _c.items[protectionCartItemIndex];
1939
2125
  this._hasProtectionInCart = !!protectionCartItem;
@@ -1958,7 +2144,7 @@ let ShipAidWidget = class extends s$1 {
1958
2144
  }
1959
2145
  if (!protectionCartItem)
1960
2146
  return;
1961
- if (protectionVariant.id === protectionCartItem.id) {
2147
+ if (protectionVariant.id === protectionCartItem.variant_id) {
1962
2148
  this._protectionCartItem = {
1963
2149
  ...protectionCartItem,
1964
2150
  index: protectionCartItemIndex,
@@ -1970,7 +2156,10 @@ let ShipAidWidget = class extends s$1 {
1970
2156
  id: protectionCartItem.key,
1971
2157
  quantity: 1
1972
2158
  };
1973
- const cart2 = await this._fetch.post("/cart/change.js", updatePayload2);
2159
+ const cart2 = await this._fetch.post(
2160
+ "/cart/change.js",
2161
+ updatePayload2
2162
+ );
1974
2163
  return await this._handleRefresh(cart2);
1975
2164
  }
1976
2165
  const updatePayload = {
@@ -1979,7 +2168,10 @@ let ShipAidWidget = class extends s$1 {
1979
2168
  [protectionVariant.id]: 1
1980
2169
  }
1981
2170
  };
1982
- const cart = await this._fetch.post("/cart/update.js", updatePayload);
2171
+ const cart = await this._fetch.post(
2172
+ "/cart/update.js",
2173
+ updatePayload
2174
+ );
1983
2175
  await this._handleRefresh(cart);
1984
2176
  },
1985
2177
  [this._store, this._cart]
@@ -1997,7 +2189,9 @@ let ShipAidWidget = class extends s$1 {
1997
2189
  () => b
1998
2190
  );
1999
2191
  },
2000
- () => y`<p><slot name="loading" default>${translate("loading")}</slot></p>`
2192
+ () => y`<p>
2193
+ <slot name="loading" default>${translate("loading")}</slot>
2194
+ </p>`
2001
2195
  )}
2002
2196
  </div>
2003
2197
  `;