@warp-ds/elements 1.4.1-next.1 → 1.5.0-next.1

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.
Files changed (37) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +778 -259
  3. package/dist/index.js.map +4 -4
  4. package/dist/packages/affix/index.js +4 -4
  5. package/dist/packages/affix/index.js.map +3 -3
  6. package/dist/packages/alert/index.js +6 -6
  7. package/dist/packages/alert/index.js.map +3 -3
  8. package/dist/packages/attention/index.js +48 -49
  9. package/dist/packages/attention/index.js.map +4 -4
  10. package/dist/packages/badge/index.js +1 -1
  11. package/dist/packages/badge/index.js.map +3 -3
  12. package/dist/packages/box/index.js +1 -1
  13. package/dist/packages/box/index.js.map +3 -3
  14. package/dist/packages/breadcrumbs/index.js +2 -2
  15. package/dist/packages/breadcrumbs/index.js.map +3 -3
  16. package/dist/packages/button/index.js +1 -1
  17. package/dist/packages/button/index.js.map +3 -3
  18. package/dist/packages/card/index.js +1 -1
  19. package/dist/packages/card/index.js.map +3 -3
  20. package/dist/packages/expandable/index.js +4 -4
  21. package/dist/packages/expandable/index.js.map +3 -3
  22. package/dist/packages/modal/index.d.ts +6 -0
  23. package/dist/packages/modal/index.js +2291 -0
  24. package/dist/packages/modal/index.js.map +7 -0
  25. package/dist/packages/modal/modal-footer.d.ts +14 -0
  26. package/dist/packages/modal/modal-header.d.ts +37 -0
  27. package/dist/packages/modal/modal-main.d.ts +37 -0
  28. package/dist/packages/modal/util.d.ts +17 -0
  29. package/dist/packages/pill/index.js +3 -3
  30. package/dist/packages/pill/index.js.map +3 -3
  31. package/dist/packages/select/index.js +2 -2
  32. package/dist/packages/select/index.js.map +3 -3
  33. package/dist/packages/textfield/index.js +1 -1
  34. package/dist/packages/textfield/index.js.map +3 -3
  35. package/dist/packages/toast/index.js +5 -5
  36. package/dist/packages/toast/index.js.map +3 -3
  37. package/package.json +8 -5
@@ -0,0 +1,2291 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a2, b2) => {
13
+ for (var prop in b2 || (b2 = {}))
14
+ if (__hasOwnProp.call(b2, prop))
15
+ __defNormalProp(a2, prop, b2[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b2)) {
18
+ if (__propIsEnum.call(b2, prop))
19
+ __defNormalProp(a2, prop, b2[prop]);
20
+ }
21
+ return a2;
22
+ };
23
+ var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2));
24
+ var __objRest = (source, exclude) => {
25
+ var target = {};
26
+ for (var prop in source)
27
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
28
+ target[prop] = source[prop];
29
+ if (source != null && __getOwnPropSymbols)
30
+ for (var prop of __getOwnPropSymbols(source)) {
31
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
32
+ target[prop] = source[prop];
33
+ }
34
+ return target;
35
+ };
36
+ var __commonJS = (cb, mod) => function __require() {
37
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
38
+ };
39
+ var __copyProps = (to, from, except, desc) => {
40
+ if (from && typeof from === "object" || typeof from === "function") {
41
+ for (let key of __getOwnPropNames(from))
42
+ if (!__hasOwnProp.call(to, key) && key !== except)
43
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
44
+ }
45
+ return to;
46
+ };
47
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
48
+ // If the importer is in node compatibility mode or this is not an ESM
49
+ // file that has been converted to a CommonJS file using a Babel-
50
+ // compatible transform (i.e. "__esModule" has not been set), then set
51
+ // "default" to the CommonJS "module.exports" for node compatibility.
52
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
53
+ mod
54
+ ));
55
+ var __publicField = (obj, key, value) => {
56
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
57
+ return value;
58
+ };
59
+
60
+ // node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js
61
+ var require_errors = __commonJS({
62
+ "node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/errors.js"(exports) {
63
+ "use strict";
64
+ Object.defineProperty(exports, "__esModule", { value: true });
65
+ exports.errorMessages = exports.ErrorType = void 0;
66
+ var ErrorType;
67
+ (function(ErrorType2) {
68
+ ErrorType2["MalformedUnicode"] = "MALFORMED_UNICODE";
69
+ ErrorType2["MalformedHexadecimal"] = "MALFORMED_HEXADECIMAL";
70
+ ErrorType2["CodePointLimit"] = "CODE_POINT_LIMIT";
71
+ ErrorType2["OctalDeprecation"] = "OCTAL_DEPRECATION";
72
+ ErrorType2["EndOfString"] = "END_OF_STRING";
73
+ })(ErrorType = exports.ErrorType || (exports.ErrorType = {}));
74
+ exports.errorMessages = /* @__PURE__ */ new Map([
75
+ [ErrorType.MalformedUnicode, "malformed Unicode character escape sequence"],
76
+ [
77
+ ErrorType.MalformedHexadecimal,
78
+ "malformed hexadecimal character escape sequence"
79
+ ],
80
+ [
81
+ ErrorType.CodePointLimit,
82
+ "Unicode codepoint must not be greater than 0x10FFFF in escape sequence"
83
+ ],
84
+ [
85
+ ErrorType.OctalDeprecation,
86
+ '"0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead'
87
+ ],
88
+ [ErrorType.EndOfString, "malformed escape sequence at end of string"]
89
+ ]);
90
+ }
91
+ });
92
+
93
+ // node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/index.js
94
+ var require_dist = __commonJS({
95
+ "node_modules/.pnpm/unraw@3.0.0/node_modules/unraw/dist/index.js"(exports) {
96
+ "use strict";
97
+ Object.defineProperty(exports, "__esModule", { value: true });
98
+ exports.unraw = exports.errorMessages = exports.ErrorType = void 0;
99
+ var errors_1 = require_errors();
100
+ Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function() {
101
+ return errors_1.ErrorType;
102
+ } });
103
+ Object.defineProperty(exports, "errorMessages", { enumerable: true, get: function() {
104
+ return errors_1.errorMessages;
105
+ } });
106
+ function parseHexToInt(hex) {
107
+ const isOnlyHexChars = !hex.match(/[^a-f0-9]/i);
108
+ return isOnlyHexChars ? parseInt(hex, 16) : NaN;
109
+ }
110
+ function validateAndParseHex(hex, errorName, enforcedLength) {
111
+ const parsedHex = parseHexToInt(hex);
112
+ if (Number.isNaN(parsedHex) || enforcedLength !== void 0 && enforcedLength !== hex.length) {
113
+ throw new SyntaxError(errors_1.errorMessages.get(errorName));
114
+ }
115
+ return parsedHex;
116
+ }
117
+ function parseHexadecimalCode(code) {
118
+ const parsedCode = validateAndParseHex(code, errors_1.ErrorType.MalformedHexadecimal, 2);
119
+ return String.fromCharCode(parsedCode);
120
+ }
121
+ function parseUnicodeCode(code, surrogateCode) {
122
+ const parsedCode = validateAndParseHex(code, errors_1.ErrorType.MalformedUnicode, 4);
123
+ if (surrogateCode !== void 0) {
124
+ const parsedSurrogateCode = validateAndParseHex(surrogateCode, errors_1.ErrorType.MalformedUnicode, 4);
125
+ return String.fromCharCode(parsedCode, parsedSurrogateCode);
126
+ }
127
+ return String.fromCharCode(parsedCode);
128
+ }
129
+ function isCurlyBraced(text) {
130
+ return text.charAt(0) === "{" && text.charAt(text.length - 1) === "}";
131
+ }
132
+ function parseUnicodeCodePointCode(codePoint) {
133
+ if (!isCurlyBraced(codePoint)) {
134
+ throw new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.MalformedUnicode));
135
+ }
136
+ const withoutBraces = codePoint.slice(1, -1);
137
+ const parsedCode = validateAndParseHex(withoutBraces, errors_1.ErrorType.MalformedUnicode);
138
+ try {
139
+ return String.fromCodePoint(parsedCode);
140
+ } catch (err) {
141
+ throw err instanceof RangeError ? new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.CodePointLimit)) : err;
142
+ }
143
+ }
144
+ function parseOctalCode(code, error = false) {
145
+ if (error) {
146
+ throw new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.OctalDeprecation));
147
+ }
148
+ const parsedCode = parseInt(code, 8);
149
+ return String.fromCharCode(parsedCode);
150
+ }
151
+ var singleCharacterEscapes = /* @__PURE__ */ new Map([
152
+ ["b", "\b"],
153
+ ["f", "\f"],
154
+ ["n", "\n"],
155
+ ["r", "\r"],
156
+ ["t", " "],
157
+ ["v", "\v"],
158
+ ["0", "\0"]
159
+ ]);
160
+ function parseSingleCharacterCode(code) {
161
+ return singleCharacterEscapes.get(code) || code;
162
+ }
163
+ var escapeMatch = /\\(?:(\\)|x([\s\S]{0,2})|u(\{[^}]*\}?)|u([\s\S]{4})\\u([^{][\s\S]{0,3})|u([\s\S]{0,4})|([0-3]?[0-7]{1,2})|([\s\S])|$)/g;
164
+ function unraw2(raw, allowOctals = false) {
165
+ return raw.replace(escapeMatch, function(_, backslash, hex, codePoint, unicodeWithSurrogate, surrogate, unicode, octal, singleCharacter) {
166
+ if (backslash !== void 0) {
167
+ return "\\";
168
+ }
169
+ if (hex !== void 0) {
170
+ return parseHexadecimalCode(hex);
171
+ }
172
+ if (codePoint !== void 0) {
173
+ return parseUnicodeCodePointCode(codePoint);
174
+ }
175
+ if (unicodeWithSurrogate !== void 0) {
176
+ return parseUnicodeCode(unicodeWithSurrogate, surrogate);
177
+ }
178
+ if (unicode !== void 0) {
179
+ return parseUnicodeCode(unicode);
180
+ }
181
+ if (octal === "0") {
182
+ return "\0";
183
+ }
184
+ if (octal !== void 0) {
185
+ return parseOctalCode(octal, !allowOctals);
186
+ }
187
+ if (singleCharacter !== void 0) {
188
+ return parseSingleCharacterCode(singleCharacter);
189
+ }
190
+ throw new SyntaxError(errors_1.errorMessages.get(errors_1.ErrorType.EndOfString));
191
+ });
192
+ }
193
+ exports.unraw = unraw2;
194
+ exports.default = unraw2;
195
+ }
196
+ });
197
+
198
+ // node_modules/.pnpm/moo@0.5.2/node_modules/moo/moo.js
199
+ var require_moo = __commonJS({
200
+ "node_modules/.pnpm/moo@0.5.2/node_modules/moo/moo.js"(exports, module) {
201
+ (function(root, factory) {
202
+ if (typeof define === "function" && define.amd) {
203
+ define([], factory);
204
+ } else if (typeof module === "object" && module.exports) {
205
+ module.exports = factory();
206
+ } else {
207
+ root.moo = factory();
208
+ }
209
+ })(exports, function() {
210
+ "use strict";
211
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
212
+ var toString = Object.prototype.toString;
213
+ var hasSticky = typeof new RegExp().sticky === "boolean";
214
+ function isRegExp(o) {
215
+ return o && toString.call(o) === "[object RegExp]";
216
+ }
217
+ function isObject(o) {
218
+ return o && typeof o === "object" && !isRegExp(o) && !Array.isArray(o);
219
+ }
220
+ function reEscape(s) {
221
+ return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
222
+ }
223
+ function reGroups(s) {
224
+ var re = new RegExp("|" + s);
225
+ return re.exec("").length - 1;
226
+ }
227
+ function reCapture(s) {
228
+ return "(" + s + ")";
229
+ }
230
+ function reUnion(regexps) {
231
+ if (!regexps.length)
232
+ return "(?!)";
233
+ var source = regexps.map(function(s) {
234
+ return "(?:" + s + ")";
235
+ }).join("|");
236
+ return "(?:" + source + ")";
237
+ }
238
+ function regexpOrLiteral(obj) {
239
+ if (typeof obj === "string") {
240
+ return "(?:" + reEscape(obj) + ")";
241
+ } else if (isRegExp(obj)) {
242
+ if (obj.ignoreCase)
243
+ throw new Error("RegExp /i flag not allowed");
244
+ if (obj.global)
245
+ throw new Error("RegExp /g flag is implied");
246
+ if (obj.sticky)
247
+ throw new Error("RegExp /y flag is implied");
248
+ if (obj.multiline)
249
+ throw new Error("RegExp /m flag is implied");
250
+ return obj.source;
251
+ } else {
252
+ throw new Error("Not a pattern: " + obj);
253
+ }
254
+ }
255
+ function pad(s, length) {
256
+ if (s.length > length) {
257
+ return s;
258
+ }
259
+ return Array(length - s.length + 1).join(" ") + s;
260
+ }
261
+ function lastNLines(string, numLines) {
262
+ var position = string.length;
263
+ var lineBreaks = 0;
264
+ while (true) {
265
+ var idx = string.lastIndexOf("\n", position - 1);
266
+ if (idx === -1) {
267
+ break;
268
+ } else {
269
+ lineBreaks++;
270
+ }
271
+ position = idx;
272
+ if (lineBreaks === numLines) {
273
+ break;
274
+ }
275
+ if (position === 0) {
276
+ break;
277
+ }
278
+ }
279
+ var startPosition = lineBreaks < numLines ? 0 : position + 1;
280
+ return string.substring(startPosition).split("\n");
281
+ }
282
+ function objectToRules(object) {
283
+ var keys = Object.getOwnPropertyNames(object);
284
+ var result = [];
285
+ for (var i2 = 0; i2 < keys.length; i2++) {
286
+ var key = keys[i2];
287
+ var thing = object[key];
288
+ var rules = [].concat(thing);
289
+ if (key === "include") {
290
+ for (var j = 0; j < rules.length; j++) {
291
+ result.push({ include: rules[j] });
292
+ }
293
+ continue;
294
+ }
295
+ var match = [];
296
+ rules.forEach(function(rule) {
297
+ if (isObject(rule)) {
298
+ if (match.length)
299
+ result.push(ruleOptions(key, match));
300
+ result.push(ruleOptions(key, rule));
301
+ match = [];
302
+ } else {
303
+ match.push(rule);
304
+ }
305
+ });
306
+ if (match.length)
307
+ result.push(ruleOptions(key, match));
308
+ }
309
+ return result;
310
+ }
311
+ function arrayToRules(array) {
312
+ var result = [];
313
+ for (var i2 = 0; i2 < array.length; i2++) {
314
+ var obj = array[i2];
315
+ if (obj.include) {
316
+ var include = [].concat(obj.include);
317
+ for (var j = 0; j < include.length; j++) {
318
+ result.push({ include: include[j] });
319
+ }
320
+ continue;
321
+ }
322
+ if (!obj.type) {
323
+ throw new Error("Rule has no type: " + JSON.stringify(obj));
324
+ }
325
+ result.push(ruleOptions(obj.type, obj));
326
+ }
327
+ return result;
328
+ }
329
+ function ruleOptions(type, obj) {
330
+ if (!isObject(obj)) {
331
+ obj = { match: obj };
332
+ }
333
+ if (obj.include) {
334
+ throw new Error("Matching rules cannot also include states");
335
+ }
336
+ var options = {
337
+ defaultType: type,
338
+ lineBreaks: !!obj.error || !!obj.fallback,
339
+ pop: false,
340
+ next: null,
341
+ push: null,
342
+ error: false,
343
+ fallback: false,
344
+ value: null,
345
+ type: null,
346
+ shouldThrow: false
347
+ };
348
+ for (var key in obj) {
349
+ if (hasOwnProperty.call(obj, key)) {
350
+ options[key] = obj[key];
351
+ }
352
+ }
353
+ if (typeof options.type === "string" && type !== options.type) {
354
+ throw new Error("Type transform cannot be a string (type '" + options.type + "' for token '" + type + "')");
355
+ }
356
+ var match = options.match;
357
+ options.match = Array.isArray(match) ? match : match ? [match] : [];
358
+ options.match.sort(function(a2, b2) {
359
+ return isRegExp(a2) && isRegExp(b2) ? 0 : isRegExp(b2) ? -1 : isRegExp(a2) ? 1 : b2.length - a2.length;
360
+ });
361
+ return options;
362
+ }
363
+ function toRules(spec) {
364
+ return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec);
365
+ }
366
+ var defaultErrorRule = ruleOptions("error", { lineBreaks: true, shouldThrow: true });
367
+ function compileRules(rules, hasStates) {
368
+ var errorRule = null;
369
+ var fast = /* @__PURE__ */ Object.create(null);
370
+ var fastAllowed = true;
371
+ var unicodeFlag = null;
372
+ var groups = [];
373
+ var parts = [];
374
+ for (var i2 = 0; i2 < rules.length; i2++) {
375
+ if (rules[i2].fallback) {
376
+ fastAllowed = false;
377
+ }
378
+ }
379
+ for (var i2 = 0; i2 < rules.length; i2++) {
380
+ var options = rules[i2];
381
+ if (options.include) {
382
+ throw new Error("Inheritance is not allowed in stateless lexers");
383
+ }
384
+ if (options.error || options.fallback) {
385
+ if (errorRule) {
386
+ if (!options.fallback === !errorRule.fallback) {
387
+ throw new Error("Multiple " + (options.fallback ? "fallback" : "error") + " rules not allowed (for token '" + options.defaultType + "')");
388
+ } else {
389
+ throw new Error("fallback and error are mutually exclusive (for token '" + options.defaultType + "')");
390
+ }
391
+ }
392
+ errorRule = options;
393
+ }
394
+ var match = options.match.slice();
395
+ if (fastAllowed) {
396
+ while (match.length && typeof match[0] === "string" && match[0].length === 1) {
397
+ var word = match.shift();
398
+ fast[word.charCodeAt(0)] = options;
399
+ }
400
+ }
401
+ if (options.pop || options.push || options.next) {
402
+ if (!hasStates) {
403
+ throw new Error("State-switching options are not allowed in stateless lexers (for token '" + options.defaultType + "')");
404
+ }
405
+ if (options.fallback) {
406
+ throw new Error("State-switching options are not allowed on fallback tokens (for token '" + options.defaultType + "')");
407
+ }
408
+ }
409
+ if (match.length === 0) {
410
+ continue;
411
+ }
412
+ fastAllowed = false;
413
+ groups.push(options);
414
+ for (var j = 0; j < match.length; j++) {
415
+ var obj = match[j];
416
+ if (!isRegExp(obj)) {
417
+ continue;
418
+ }
419
+ if (unicodeFlag === null) {
420
+ unicodeFlag = obj.unicode;
421
+ } else if (unicodeFlag !== obj.unicode && options.fallback === false) {
422
+ throw new Error("If one rule is /u then all must be");
423
+ }
424
+ }
425
+ var pat = reUnion(match.map(regexpOrLiteral));
426
+ var regexp = new RegExp(pat);
427
+ if (regexp.test("")) {
428
+ throw new Error("RegExp matches empty string: " + regexp);
429
+ }
430
+ var groupCount = reGroups(pat);
431
+ if (groupCount > 0) {
432
+ throw new Error("RegExp has capture groups: " + regexp + "\nUse (?: \u2026 ) instead");
433
+ }
434
+ if (!options.lineBreaks && regexp.test("\n")) {
435
+ throw new Error("Rule should declare lineBreaks: " + regexp);
436
+ }
437
+ parts.push(reCapture(pat));
438
+ }
439
+ var fallbackRule = errorRule && errorRule.fallback;
440
+ var flags = hasSticky && !fallbackRule ? "ym" : "gm";
441
+ var suffix2 = hasSticky || fallbackRule ? "" : "|";
442
+ if (unicodeFlag === true)
443
+ flags += "u";
444
+ var combined = new RegExp(reUnion(parts) + suffix2, flags);
445
+ return { regexp: combined, groups, fast, error: errorRule || defaultErrorRule };
446
+ }
447
+ function compile(rules) {
448
+ var result = compileRules(toRules(rules));
449
+ return new Lexer({ start: result }, "start");
450
+ }
451
+ function checkStateGroup(g2, name, map) {
452
+ var state = g2 && (g2.push || g2.next);
453
+ if (state && !map[state]) {
454
+ throw new Error("Missing state '" + state + "' (in token '" + g2.defaultType + "' of state '" + name + "')");
455
+ }
456
+ if (g2 && g2.pop && +g2.pop !== 1) {
457
+ throw new Error("pop must be 1 (in token '" + g2.defaultType + "' of state '" + name + "')");
458
+ }
459
+ }
460
+ function compileStates(states, start) {
461
+ var all = states.$all ? toRules(states.$all) : [];
462
+ delete states.$all;
463
+ var keys = Object.getOwnPropertyNames(states);
464
+ if (!start)
465
+ start = keys[0];
466
+ var ruleMap = /* @__PURE__ */ Object.create(null);
467
+ for (var i2 = 0; i2 < keys.length; i2++) {
468
+ var key = keys[i2];
469
+ ruleMap[key] = toRules(states[key]).concat(all);
470
+ }
471
+ for (var i2 = 0; i2 < keys.length; i2++) {
472
+ var key = keys[i2];
473
+ var rules = ruleMap[key];
474
+ var included = /* @__PURE__ */ Object.create(null);
475
+ for (var j = 0; j < rules.length; j++) {
476
+ var rule = rules[j];
477
+ if (!rule.include)
478
+ continue;
479
+ var splice = [j, 1];
480
+ if (rule.include !== key && !included[rule.include]) {
481
+ included[rule.include] = true;
482
+ var newRules = ruleMap[rule.include];
483
+ if (!newRules) {
484
+ throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')");
485
+ }
486
+ for (var k = 0; k < newRules.length; k++) {
487
+ var newRule = newRules[k];
488
+ if (rules.indexOf(newRule) !== -1)
489
+ continue;
490
+ splice.push(newRule);
491
+ }
492
+ }
493
+ rules.splice.apply(rules, splice);
494
+ j--;
495
+ }
496
+ }
497
+ var map = /* @__PURE__ */ Object.create(null);
498
+ for (var i2 = 0; i2 < keys.length; i2++) {
499
+ var key = keys[i2];
500
+ map[key] = compileRules(ruleMap[key], true);
501
+ }
502
+ for (var i2 = 0; i2 < keys.length; i2++) {
503
+ var name = keys[i2];
504
+ var state = map[name];
505
+ var groups = state.groups;
506
+ for (var j = 0; j < groups.length; j++) {
507
+ checkStateGroup(groups[j], name, map);
508
+ }
509
+ var fastKeys = Object.getOwnPropertyNames(state.fast);
510
+ for (var j = 0; j < fastKeys.length; j++) {
511
+ checkStateGroup(state.fast[fastKeys[j]], name, map);
512
+ }
513
+ }
514
+ return new Lexer(map, start);
515
+ }
516
+ function keywordTransform(map) {
517
+ var isMap = typeof Map !== "undefined";
518
+ var reverseMap = isMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
519
+ var types = Object.getOwnPropertyNames(map);
520
+ for (var i2 = 0; i2 < types.length; i2++) {
521
+ var tokenType = types[i2];
522
+ var item = map[tokenType];
523
+ var keywordList = Array.isArray(item) ? item : [item];
524
+ keywordList.forEach(function(keyword) {
525
+ if (typeof keyword !== "string") {
526
+ throw new Error("keyword must be string (in keyword '" + tokenType + "')");
527
+ }
528
+ if (isMap) {
529
+ reverseMap.set(keyword, tokenType);
530
+ } else {
531
+ reverseMap[keyword] = tokenType;
532
+ }
533
+ });
534
+ }
535
+ return function(k) {
536
+ return isMap ? reverseMap.get(k) : reverseMap[k];
537
+ };
538
+ }
539
+ var Lexer = function(states, state) {
540
+ this.startState = state;
541
+ this.states = states;
542
+ this.buffer = "";
543
+ this.stack = [];
544
+ this.reset();
545
+ };
546
+ Lexer.prototype.reset = function(data, info) {
547
+ this.buffer = data || "";
548
+ this.index = 0;
549
+ this.line = info ? info.line : 1;
550
+ this.col = info ? info.col : 1;
551
+ this.queuedToken = info ? info.queuedToken : null;
552
+ this.queuedText = info ? info.queuedText : "";
553
+ this.queuedThrow = info ? info.queuedThrow : null;
554
+ this.setState(info ? info.state : this.startState);
555
+ this.stack = info && info.stack ? info.stack.slice() : [];
556
+ return this;
557
+ };
558
+ Lexer.prototype.save = function() {
559
+ return {
560
+ line: this.line,
561
+ col: this.col,
562
+ state: this.state,
563
+ stack: this.stack.slice(),
564
+ queuedToken: this.queuedToken,
565
+ queuedText: this.queuedText,
566
+ queuedThrow: this.queuedThrow
567
+ };
568
+ };
569
+ Lexer.prototype.setState = function(state) {
570
+ if (!state || this.state === state)
571
+ return;
572
+ this.state = state;
573
+ var info = this.states[state];
574
+ this.groups = info.groups;
575
+ this.error = info.error;
576
+ this.re = info.regexp;
577
+ this.fast = info.fast;
578
+ };
579
+ Lexer.prototype.popState = function() {
580
+ this.setState(this.stack.pop());
581
+ };
582
+ Lexer.prototype.pushState = function(state) {
583
+ this.stack.push(this.state);
584
+ this.setState(state);
585
+ };
586
+ var eat = hasSticky ? function(re, buffer) {
587
+ return re.exec(buffer);
588
+ } : function(re, buffer) {
589
+ var match = re.exec(buffer);
590
+ if (match[0].length === 0) {
591
+ return null;
592
+ }
593
+ return match;
594
+ };
595
+ Lexer.prototype._getGroup = function(match) {
596
+ var groupCount = this.groups.length;
597
+ for (var i2 = 0; i2 < groupCount; i2++) {
598
+ if (match[i2 + 1] !== void 0) {
599
+ return this.groups[i2];
600
+ }
601
+ }
602
+ throw new Error("Cannot find token type for matched text");
603
+ };
604
+ function tokenToString() {
605
+ return this.value;
606
+ }
607
+ Lexer.prototype.next = function() {
608
+ var index = this.index;
609
+ if (this.queuedGroup) {
610
+ var token = this._token(this.queuedGroup, this.queuedText, index);
611
+ this.queuedGroup = null;
612
+ this.queuedText = "";
613
+ return token;
614
+ }
615
+ var buffer = this.buffer;
616
+ if (index === buffer.length) {
617
+ return;
618
+ }
619
+ var group = this.fast[buffer.charCodeAt(index)];
620
+ if (group) {
621
+ return this._token(group, buffer.charAt(index), index);
622
+ }
623
+ var re = this.re;
624
+ re.lastIndex = index;
625
+ var match = eat(re, buffer);
626
+ var error = this.error;
627
+ if (match == null) {
628
+ return this._token(error, buffer.slice(index, buffer.length), index);
629
+ }
630
+ var group = this._getGroup(match);
631
+ var text = match[0];
632
+ if (error.fallback && match.index !== index) {
633
+ this.queuedGroup = group;
634
+ this.queuedText = text;
635
+ return this._token(error, buffer.slice(index, match.index), index);
636
+ }
637
+ return this._token(group, text, index);
638
+ };
639
+ Lexer.prototype._token = function(group, text, offset) {
640
+ var lineBreaks = 0;
641
+ if (group.lineBreaks) {
642
+ var matchNL = /\n/g;
643
+ var nl = 1;
644
+ if (text === "\n") {
645
+ lineBreaks = 1;
646
+ } else {
647
+ while (matchNL.exec(text)) {
648
+ lineBreaks++;
649
+ nl = matchNL.lastIndex;
650
+ }
651
+ }
652
+ }
653
+ var token = {
654
+ type: typeof group.type === "function" && group.type(text) || group.defaultType,
655
+ value: typeof group.value === "function" ? group.value(text) : text,
656
+ text,
657
+ toString: tokenToString,
658
+ offset,
659
+ lineBreaks,
660
+ line: this.line,
661
+ col: this.col
662
+ };
663
+ var size = text.length;
664
+ this.index += size;
665
+ this.line += lineBreaks;
666
+ if (lineBreaks !== 0) {
667
+ this.col = size - nl + 1;
668
+ } else {
669
+ this.col += size;
670
+ }
671
+ if (group.shouldThrow) {
672
+ var err = new Error(this.formatError(token, "invalid syntax"));
673
+ throw err;
674
+ }
675
+ if (group.pop)
676
+ this.popState();
677
+ else if (group.push)
678
+ this.pushState(group.push);
679
+ else if (group.next)
680
+ this.setState(group.next);
681
+ return token;
682
+ };
683
+ if (typeof Symbol !== "undefined" && Symbol.iterator) {
684
+ var LexerIterator = function(lexer) {
685
+ this.lexer = lexer;
686
+ };
687
+ LexerIterator.prototype.next = function() {
688
+ var token = this.lexer.next();
689
+ return { value: token, done: !token };
690
+ };
691
+ LexerIterator.prototype[Symbol.iterator] = function() {
692
+ return this;
693
+ };
694
+ Lexer.prototype[Symbol.iterator] = function() {
695
+ return new LexerIterator(this);
696
+ };
697
+ }
698
+ Lexer.prototype.formatError = function(token, message) {
699
+ if (token == null) {
700
+ var text = this.buffer.slice(this.index);
701
+ var token = {
702
+ text,
703
+ offset: this.index,
704
+ lineBreaks: text.indexOf("\n") === -1 ? 0 : 1,
705
+ line: this.line,
706
+ col: this.col
707
+ };
708
+ }
709
+ var numLinesAround = 2;
710
+ var firstDisplayedLine = Math.max(token.line - numLinesAround, 1);
711
+ var lastDisplayedLine = token.line + numLinesAround;
712
+ var lastLineDigits = String(lastDisplayedLine).length;
713
+ var displayedLines = lastNLines(
714
+ this.buffer,
715
+ this.line - token.line + numLinesAround + 1
716
+ ).slice(0, 5);
717
+ var errorLines = [];
718
+ errorLines.push(message + " at line " + token.line + " col " + token.col + ":");
719
+ errorLines.push("");
720
+ for (var i2 = 0; i2 < displayedLines.length; i2++) {
721
+ var line = displayedLines[i2];
722
+ var lineNo = firstDisplayedLine + i2;
723
+ errorLines.push(pad(String(lineNo), lastLineDigits) + " " + line);
724
+ if (lineNo === token.line) {
725
+ errorLines.push(pad("", lastLineDigits + token.col + 1) + "^");
726
+ }
727
+ }
728
+ return errorLines.join("\n");
729
+ };
730
+ Lexer.prototype.clone = function() {
731
+ return new Lexer(this.states, this.state);
732
+ };
733
+ Lexer.prototype.has = function(tokenType) {
734
+ return true;
735
+ };
736
+ return {
737
+ compile,
738
+ states: compileStates,
739
+ error: Object.freeze({ error: true }),
740
+ fallback: Object.freeze({ fallback: true }),
741
+ keywords: keywordTransform
742
+ };
743
+ });
744
+ }
745
+ });
746
+
747
+ // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
748
+ var require_lexer = __commonJS({
749
+ "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
750
+ "use strict";
751
+ var __importDefault = exports && exports.__importDefault || function(mod) {
752
+ return mod && mod.__esModule ? mod : { "default": mod };
753
+ };
754
+ Object.defineProperty(exports, "__esModule", { value: true });
755
+ exports.lexer = exports.states = void 0;
756
+ var moo_1 = __importDefault(require_moo());
757
+ exports.states = {
758
+ body: {
759
+ doubleapos: { match: "''", value: () => "'" },
760
+ quoted: {
761
+ lineBreaks: true,
762
+ match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
763
+ value: (src) => src.slice(1, -1).replace(/''/g, "'")
764
+ },
765
+ argument: {
766
+ lineBreaks: true,
767
+ match: /\{\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,
768
+ push: "arg",
769
+ value: (src) => src.substring(1).trim()
770
+ },
771
+ octothorpe: "#",
772
+ end: { match: "}", pop: 1 },
773
+ content: { lineBreaks: true, match: /[^][^{}#']*/u }
774
+ },
775
+ arg: {
776
+ select: {
777
+ lineBreaks: true,
778
+ match: /,\s*(?:plural|select|selectordinal)\s*,\s*/u,
779
+ next: "select",
780
+ value: (src) => src.split(",")[1].trim()
781
+ },
782
+ "func-args": {
783
+ lineBreaks: true,
784
+ match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*,/u,
785
+ next: "body",
786
+ value: (src) => src.split(",")[1].trim()
787
+ },
788
+ "func-simple": {
789
+ lineBreaks: true,
790
+ match: /,\s*[^\p{Pat_Syn}\p{Pat_WS}]+\s*/u,
791
+ value: (src) => src.substring(1).trim()
792
+ },
793
+ end: { match: "}", pop: 1 }
794
+ },
795
+ select: {
796
+ offset: {
797
+ lineBreaks: true,
798
+ match: /\s*offset\s*:\s*\d+\s*/u,
799
+ value: (src) => src.split(":")[1].trim()
800
+ },
801
+ case: {
802
+ lineBreaks: true,
803
+ match: /\s*(?:=\d+|[^\p{Pat_Syn}\p{Pat_WS}]+)\s*\{/u,
804
+ push: "body",
805
+ value: (src) => src.substring(0, src.indexOf("{")).trim()
806
+ },
807
+ end: { match: /\s*\}/u, pop: 1 }
808
+ }
809
+ };
810
+ exports.lexer = moo_1.default.states(exports.states);
811
+ }
812
+ });
813
+
814
+ // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
815
+ var require_parser = __commonJS({
816
+ "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
817
+ "use strict";
818
+ Object.defineProperty(exports, "__esModule", { value: true });
819
+ exports.parse = exports.ParseError = void 0;
820
+ var lexer_js_1 = require_lexer();
821
+ var getContext = (lt) => ({
822
+ offset: lt.offset,
823
+ line: lt.line,
824
+ col: lt.col,
825
+ text: lt.text,
826
+ lineBreaks: lt.lineBreaks
827
+ });
828
+ var isSelectType = (type) => type === "plural" || type === "select" || type === "selectordinal";
829
+ function strictArgStyleParam(lt, param) {
830
+ let value = "";
831
+ let text = "";
832
+ for (const p2 of param) {
833
+ const pText = p2.ctx.text;
834
+ text += pText;
835
+ switch (p2.type) {
836
+ case "content":
837
+ value += p2.value;
838
+ break;
839
+ case "argument":
840
+ case "function":
841
+ case "octothorpe":
842
+ value += pText;
843
+ break;
844
+ default:
845
+ throw new ParseError(lt, `Unsupported part in strict mode function arg style: ${pText}`);
846
+ }
847
+ }
848
+ const c2 = {
849
+ type: "content",
850
+ value: value.trim(),
851
+ ctx: Object.assign({}, param[0].ctx, { text })
852
+ };
853
+ return [c2];
854
+ }
855
+ var strictArgTypes = [
856
+ "number",
857
+ "date",
858
+ "time",
859
+ "spellout",
860
+ "ordinal",
861
+ "duration"
862
+ ];
863
+ var defaultPluralKeys = ["zero", "one", "two", "few", "many", "other"];
864
+ var ParseError = class extends Error {
865
+ /** @internal */
866
+ constructor(lt, msg) {
867
+ super(lexer_js_1.lexer.formatError(lt, msg));
868
+ }
869
+ };
870
+ exports.ParseError = ParseError;
871
+ var Parser = class {
872
+ constructor(src, opt) {
873
+ var _a, _b, _c, _d;
874
+ this.lexer = lexer_js_1.lexer.reset(src);
875
+ this.cardinalKeys = (_a = opt === null || opt === void 0 ? void 0 : opt.cardinal) !== null && _a !== void 0 ? _a : defaultPluralKeys;
876
+ this.ordinalKeys = (_b = opt === null || opt === void 0 ? void 0 : opt.ordinal) !== null && _b !== void 0 ? _b : defaultPluralKeys;
877
+ this.strict = (_c = opt === null || opt === void 0 ? void 0 : opt.strict) !== null && _c !== void 0 ? _c : false;
878
+ this.strictPluralKeys = (_d = opt === null || opt === void 0 ? void 0 : opt.strictPluralKeys) !== null && _d !== void 0 ? _d : true;
879
+ }
880
+ parse() {
881
+ return this.parseBody(false, true);
882
+ }
883
+ checkSelectKey(lt, type, key) {
884
+ if (key[0] === "=") {
885
+ if (type === "select")
886
+ throw new ParseError(lt, `The case ${key} is not valid with select`);
887
+ } else if (type !== "select") {
888
+ const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
889
+ if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
890
+ const msg = `The ${type} case ${key} is not valid in this locale`;
891
+ throw new ParseError(lt, msg);
892
+ }
893
+ }
894
+ }
895
+ parseSelect({ value: arg }, inPlural, ctx, type) {
896
+ const sel = { type, arg, cases: [], ctx };
897
+ if (type === "plural" || type === "selectordinal")
898
+ inPlural = true;
899
+ else if (this.strict)
900
+ inPlural = false;
901
+ for (const lt of this.lexer) {
902
+ switch (lt.type) {
903
+ case "offset":
904
+ if (type === "select")
905
+ throw new ParseError(lt, "Unexpected plural offset for select");
906
+ if (sel.cases.length > 0)
907
+ throw new ParseError(lt, "Plural offset must be set before cases");
908
+ sel.pluralOffset = Number(lt.value);
909
+ ctx.text += lt.text;
910
+ ctx.lineBreaks += lt.lineBreaks;
911
+ break;
912
+ case "case": {
913
+ this.checkSelectKey(lt, type, lt.value);
914
+ sel.cases.push({
915
+ key: lt.value,
916
+ tokens: this.parseBody(inPlural),
917
+ ctx: getContext(lt)
918
+ });
919
+ break;
920
+ }
921
+ case "end":
922
+ return sel;
923
+ default:
924
+ throw new ParseError(lt, `Unexpected lexer token: ${lt.type}`);
925
+ }
926
+ }
927
+ throw new ParseError(null, "Unexpected message end");
928
+ }
929
+ parseArgToken(lt, inPlural) {
930
+ const ctx = getContext(lt);
931
+ const argType = this.lexer.next();
932
+ if (!argType)
933
+ throw new ParseError(null, "Unexpected message end");
934
+ ctx.text += argType.text;
935
+ ctx.lineBreaks += argType.lineBreaks;
936
+ if (this.strict && (argType.type === "func-simple" || argType.type === "func-args") && !strictArgTypes.includes(argType.value)) {
937
+ const msg = `Invalid strict mode function arg type: ${argType.value}`;
938
+ throw new ParseError(lt, msg);
939
+ }
940
+ switch (argType.type) {
941
+ case "end":
942
+ return { type: "argument", arg: lt.value, ctx };
943
+ case "func-simple": {
944
+ const end = this.lexer.next();
945
+ if (!end)
946
+ throw new ParseError(null, "Unexpected message end");
947
+ if (end.type !== "end")
948
+ throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
949
+ ctx.text += end.text;
950
+ if (isSelectType(argType.value.toLowerCase()))
951
+ throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
952
+ return {
953
+ type: "function",
954
+ arg: lt.value,
955
+ key: argType.value,
956
+ ctx
957
+ };
958
+ }
959
+ case "func-args": {
960
+ if (isSelectType(argType.value.toLowerCase())) {
961
+ const msg = `Invalid type identifier: ${argType.value}`;
962
+ throw new ParseError(argType, msg);
963
+ }
964
+ let param = this.parseBody(this.strict ? false : inPlural);
965
+ if (this.strict && param.length > 0)
966
+ param = strictArgStyleParam(lt, param);
967
+ return {
968
+ type: "function",
969
+ arg: lt.value,
970
+ key: argType.value,
971
+ param,
972
+ ctx
973
+ };
974
+ }
975
+ case "select":
976
+ if (isSelectType(argType.value))
977
+ return this.parseSelect(lt, inPlural, ctx, argType.value);
978
+ else
979
+ throw new ParseError(argType, `Unexpected select type ${argType.value}`);
980
+ default:
981
+ throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
982
+ }
983
+ }
984
+ parseBody(inPlural, atRoot) {
985
+ const tokens = [];
986
+ let content = null;
987
+ for (const lt of this.lexer) {
988
+ if (lt.type === "argument") {
989
+ if (content)
990
+ content = null;
991
+ tokens.push(this.parseArgToken(lt, inPlural));
992
+ } else if (lt.type === "octothorpe" && inPlural) {
993
+ if (content)
994
+ content = null;
995
+ tokens.push({ type: "octothorpe", ctx: getContext(lt) });
996
+ } else if (lt.type === "end" && !atRoot) {
997
+ return tokens;
998
+ } else {
999
+ let value = lt.value;
1000
+ if (!inPlural && lt.type === "quoted" && value[0] === "#") {
1001
+ if (value.includes("{")) {
1002
+ const errMsg = `Unsupported escape pattern: ${value}`;
1003
+ throw new ParseError(lt, errMsg);
1004
+ }
1005
+ value = lt.text;
1006
+ }
1007
+ if (content) {
1008
+ content.value += value;
1009
+ content.ctx.text += lt.text;
1010
+ content.ctx.lineBreaks += lt.lineBreaks;
1011
+ } else {
1012
+ content = { type: "content", value, ctx: getContext(lt) };
1013
+ tokens.push(content);
1014
+ }
1015
+ }
1016
+ }
1017
+ if (atRoot)
1018
+ return tokens;
1019
+ throw new ParseError(null, "Unexpected message end");
1020
+ }
1021
+ };
1022
+ function parse2(src, options = {}) {
1023
+ const parser = new Parser(src, options);
1024
+ return parser.parse();
1025
+ }
1026
+ exports.parse = parse2;
1027
+ }
1028
+ });
1029
+
1030
+ // packages/modal/modal-footer.js
1031
+ import { html } from "lit";
1032
+
1033
+ // node_modules/.pnpm/@warp-ds+css@1.10.1/node_modules/@warp-ds/css/component-classes/index.js
1034
+ var box = {
1035
+ box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
1036
+ // Relative here enables w-clickable
1037
+ bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
1038
+ // We target L and R to override the default rounded-8
1039
+ info: "s-bg-info-subtle",
1040
+ neutral: "s-surface-sunken",
1041
+ bordered: "border-2 s-border s-bg",
1042
+ infoClickable: "hover:s-bg-info-subtle-hover active:s-bg-info-subtle-active",
1043
+ // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
1044
+ neutralClickable: "hover:s-bg-hover active:s-bg-active",
1045
+ // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
1046
+ borderedClickable: "hover:s-bg-hover active:s-bg-active hover:s-border-hover active:s-border-active"
1047
+ // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
1048
+ };
1049
+ var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
1050
+ var expandable = {
1051
+ expandable: "will-change-height",
1052
+ expandableTitle: "font-bold s-text",
1053
+ expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
1054
+ expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
1055
+ expandableBleed: box.bleed,
1056
+ chevron: "inline-block align-middle s-icon",
1057
+ chevronNonBox: "ml-8",
1058
+ chevronBox: "",
1059
+ chevronTransform: "transform transition-transform transform-gpu ease-in-out",
1060
+ chevronExpand: "-rotate-180",
1061
+ chevronCollapse: "rotate-180",
1062
+ elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
1063
+ elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
1064
+ elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
1065
+ elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
1066
+ expansion: "overflow-hidden",
1067
+ expansionNotExpanded: "h-0 invisible",
1068
+ button: buttonReset + " hover:underline focus-visible:underline",
1069
+ buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
1070
+ paddingTop: "pt-0",
1071
+ title: "flex w-full justify-between items-center",
1072
+ titleType: "h4"
1073
+ };
1074
+ var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1075
+ var buttonColors = {
1076
+ primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
1077
+ secondary: "s-text-link s-border s-bg hover:s-bg-hover hover:s-border-hover active:s-bg-active",
1078
+ utility: "s-text s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",
1079
+ destructive: "s-bg-negative s-text-inverted hover:s-bg-negative-hover active:s-bg-negative-active",
1080
+ pill: "s-icon hover:s-icon-hover active:s-icon-active bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",
1081
+ disabled: "s-text-inverted s-bg-disabled",
1082
+ quiet: "bg-transparent s-text-link hover:s-bg-hover active:s-bg-active",
1083
+ utilityQuiet: "s-text bg-transparent hover:s-bg-hover active:s-bg-active",
1084
+ negativeQuiet: "bg-transparent s-text-negative hover:s-bg-negative-subtle-hover active:s-bg-negative-subtle-active",
1085
+ loading: "s-text s-bg-subtle",
1086
+ link: "s-text-link"
1087
+ };
1088
+ var buttonTypes = {
1089
+ primary: `border-0 rounded-8 ${buttonDefaultStyling}`,
1090
+ secondary: `border-2 rounded-8 ${buttonDefaultStyling}`,
1091
+ utility: `border rounded-4 ${buttonDefaultStyling}`,
1092
+ negative: `border-0 rounded-8 ${buttonDefaultStyling}`,
1093
+ pill: `p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${buttonDefaultStyling}`,
1094
+ link: `bg-transparent focusable ease-in-out inline active:underline hover:underline focus:underline ${buttonColors.link}`
1095
+ };
1096
+ var buttonSizes = {
1097
+ xsmall: "py-6 px-16",
1098
+ small: "py-8 px-16",
1099
+ medium: "py-10 px-14",
1100
+ large: "py-12 px-16",
1101
+ utility: "py-[11px] px-[15px]",
1102
+ smallUtility: "py-[7px] px-[15px]",
1103
+ pill: "min-h-[44px] min-w-[44px]",
1104
+ pillSmall: "min-h-32 min-w-32",
1105
+ link: "p-0"
1106
+ };
1107
+ var buttonTextSizes = {
1108
+ medium: "text-m leading-[24]",
1109
+ xsmall: "text-xs"
1110
+ };
1111
+ var buttonVariants = {
1112
+ inProgress: `border-transparent animate-inprogress pointer-events-none ${buttonColors.loading}`,
1113
+ // .button--in-progress, a.button--in-progress:visited
1114
+ quiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
1115
+ utilityQuiet: `border-0 rounded-4 ${buttonDefaultStyling}`,
1116
+ negativeQuiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
1117
+ isDisabled: `font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${buttonColors.disabled}`
1118
+ // .button:disabled, .button--is-disabled
1119
+ };
1120
+ var button = {
1121
+ // Buttontypes
1122
+ secondary: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
1123
+ // .button--secondary, .button--default, .button
1124
+ secondaryHref: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
1125
+ secondaryDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
1126
+ secondarySmall: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonColors.secondary}`,
1127
+ secondarySmallDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
1128
+ secondaryQuiet: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1129
+ secondaryQuietDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1130
+ secondarySmallQuiet: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1131
+ secondarySmallQuietDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1132
+ secondaryLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
1133
+ secondarySmallLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
1134
+ secondarySmallQuietLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
1135
+ secondaryQuietLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
1136
+ primary: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.primary} ${buttonColors.primary}`,
1137
+ // .button--primary, .button--cta
1138
+ primaryDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.isDisabled} ${buttonTypes.primary}`,
1139
+ primarySmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.primary} ${buttonColors.primary}`,
1140
+ primarySmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.isDisabled} ${buttonTypes.primary} `,
1141
+ primaryQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1142
+ primaryQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1143
+ primarySmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1144
+ primarySmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1145
+ primaryLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
1146
+ primarySmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
1147
+ primarySmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
1148
+ primaryQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
1149
+ utility: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonColors.utility}`,
1150
+ // .button--utility
1151
+ utilityDisabled: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
1152
+ utilityQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
1153
+ // .button--utility-flat
1154
+ utilityQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
1155
+ utilitySmall: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonColors.utility}`,
1156
+ utilitySmallDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
1157
+ utilitySmallQuiet: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
1158
+ utilitySmallQuietDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
1159
+ utilityLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
1160
+ utilitySmallLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
1161
+ utilityQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
1162
+ utilitySmallQuietLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
1163
+ negative: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonColors.destructive}`,
1164
+ // .button--destructive
1165
+ negativeDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
1166
+ negativeQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
1167
+ // .button--destructive-flat
1168
+ negativeQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet}${buttonVariants.isDisabled}`,
1169
+ negativeSmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonColors.destructive}`,
1170
+ negativeSmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
1171
+ negativeSmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
1172
+ negativeSmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.isDisabled}`,
1173
+ negativeLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
1174
+ negativeSmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.negative}`,
1175
+ negativeQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
1176
+ negativeSmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.inProgress}`,
1177
+ pill: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill}`,
1178
+ // .button--pill
1179
+ pillSmall: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonColors.pill}`,
1180
+ pillLoading: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
1181
+ pillSmallLoading: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
1182
+ link: `${buttonSizes.link} ${buttonTextSizes.medium} ${buttonTypes.link}`,
1183
+ linkSmall: `${buttonSizes.link} ${buttonTextSizes.xsmall} ${buttonTypes.link}`,
1184
+ linkAsButton: "inline-block active:no-underline hover:no-underline focus:no-underline text-center",
1185
+ a11y: "sr-only",
1186
+ fullWidth: "w-full max-w-full",
1187
+ contentWidth: "max-w-max"
1188
+ };
1189
+ var modal = {
1190
+ transparentBg: "",
1191
+ //TODO: Remove in v2 - previously used for opacity before changing to a rgba background in backdrop
1192
+ backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px] bg-[--w-black/25]",
1193
+ modal: "pb-safe-[32] shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 bg-[--w-s-color-surface-elevated-100] flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
1194
+ content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
1195
+ footer: "flex justify-end shrink-0 px-16 sm:px-32",
1196
+ transitionTitle: "transition-all duration-300",
1197
+ transitionTitleCenter: "justify-self-center self-center",
1198
+ transitionTitleColSpan: "col-span-2",
1199
+ title: "py-8 sm:py-0 -mt-4 sm:-mt-8 min-h-40 sm:min-h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-start px-16 sm:px-32 border-b sm:border-b-0 shrink-0",
1200
+ titleText: "mb-0 h4 sm:h3",
1201
+ titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
1202
+ titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
1203
+ titleButtonRight: "-mr-8 sm:-mr-12 justify-self-end",
1204
+ titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
1205
+ titleButtonIconRotated: "transform rotate-90"
1206
+ };
1207
+ var modalElement = {
1208
+ // several items in here are 'resets' for the <dialog> element
1209
+ dialogEl: "bg-transparent backface-hidden w-unset h-unset max-w-unset max-h-unset p-0 m-auto border-0 inset-0 open:flex open:fixed sm:place-content-center sm:place-items-center items-end [--w-modal-max-height:80%] [--w-modal-width:640px]",
1210
+ dialogInner: "transition-all relative pb-safe-[32] sm:pb-32 shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] ease-in-out backface-hidden will-change-height rounded-8 sm:mx-16 s-bg flex flex-col overflow-hidden lt-sm:rounded-b-0",
1211
+ contentSlot: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
1212
+ header: "relative pb-8",
1213
+ headerTitleBar: "pt-16 sm:pt-24 px-16 sm:px-32 grid gap-12 grid-cols-[auto_1fr_auto] items-start shrink-0!",
1214
+ headerButton: "sm:min-h-[32px] sm:min-w-[32px] min-h-[40px] min-w-[40px] text-m leading-[24] p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding font-bold focusable transition-colors ease-in-out",
1215
+ headerButtonLeft: "-ml-8 s-icon bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",
1216
+ headerCloseButton: "-mr-8 s-icon bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",
1217
+ headerCloseButtonOnImage: `absolute right-8 top-8 z-10 s-color-inverted bg-[var(--w-black)/70] hover:bg-[var(--w-black)/85] active:bg-[var(--w-black)] s-text-inverted`,
1218
+ headerTitle: "mb-0 t3 self-center",
1219
+ headerTitleWithBackButton: "justify-self-center",
1220
+ headerTitleWithoutBackButton: "col-span-2",
1221
+ headerTitleWithTopArea: "pt-16 px-16 sm:px-32",
1222
+ footer: "flex justify-end shrink-0 px-16 sm:px-32 pt-24"
1223
+ };
1224
+ var label = {
1225
+ label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
1226
+ optional: "pl-8 font-normal text-s s-text-subtle",
1227
+ labelInvalid: "s-text-negative"
1228
+ // TODO: Remove in v2 - kept for backwards compatibility
1229
+ };
1230
+ var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
1231
+ var suffix = {
1232
+ wrapper: prefixSuffixWrapperBase + "right-0",
1233
+ wrapperWithLabel: "w-max pr-12",
1234
+ wrapperWithIcon: "w-40",
1235
+ label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
1236
+ };
1237
+ var prefix = {
1238
+ wrapper: prefixSuffixWrapperBase + "left-0",
1239
+ wrapperWithLabel: "w-max pl-12",
1240
+ wrapperWithIcon: "w-40",
1241
+ label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
1242
+ };
1243
+ var toggle = {
1244
+ // wrapper classes
1245
+ field: "relative text-m",
1246
+ // true
1247
+ wrapper: "relative py-1",
1248
+ // true
1249
+ wrapperRadioButtons: "inline-flex font-bold rounded-8 focus-within:focusable",
1250
+ // isRadioButton && !isEqualWidth
1251
+ wrapperRadioButtonsJustified: "flex font-bold rounded-8 focus-within:focusable",
1252
+ // isRadioButton && isEqualWidth,
1253
+ // group classes
1254
+ radioButtonsGroup: "group",
1255
+ // isRadioButton
1256
+ radioButtonsGroupJustified: "grow-1 shrink-0 basis-auto",
1257
+ // isRadioButton && isEqualWidth
1258
+ // input classes
1259
+ input: "peer",
1260
+ a11y: "sr-only",
1261
+ // label classes
1262
+ label: "peer-focus:focusable cursor-pointer text-m s-text s-border py-2 pl-28 select-none relative block before:border before:absolute before:transition-all before:left-0 before:w-20 before:h-20 before:top-2",
1263
+ // !isRadioButton
1264
+ labelBefore: 'before:content-[""] before:block',
1265
+ // !isRadioButton && !isIndeterminate
1266
+ checkbox: "before:s-bg before:rounded-2 hover:before:s-border-primary hover:before:s-bg-hover peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-border-primary peer-checked:before:s-bg-primary peer-checked:peer-hover:before:s-border-primary-hover peer-checked:peer-hover:before:s-bg-primary-hover",
1267
+ // isCheckbox && !isIndeterminate && !isInvalid && !isDisabled
1268
+ checkboxInvalid: "before:s-bg before:s-border-negative before:rounded-2 hover:before:s-bg-negative-subtle-hover hover:before:s-border-negative-hover peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-bg-negative peer-checked:before:s-border-negative peer-checked:peer-hover:before:s-bg-negative-hover peer-checked:peer-hover:before:s-border-negative-hover",
1269
+ // isCheckbox && !isIndeterminate && isInvalid && !isDisabled
1270
+ checkboxDisabled: "before:s-bg-disabled-subtle before:s-border-disabled pointer-events-none before:rounded-2 peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-border-disabled peer-checked:before:s-bg-disabled",
1271
+ // isCheckbox && !isIndeterminate && !isInvalid && isDisabled
1272
+ indeterminate: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold before:s-icon-inverted peer-indeterminate:before:s-border-primary peer-indeterminate:before:s-bg-primary peer-indeterminate:hover:before:s-border-primary-hover peer-indeterminate:hover:before:s-bg-primary-hover',
1273
+ // isCheckbox && isIndeterminate && !isInvalid && !isDisabled
1274
+ indeterminateInvalid: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold before:s-icon-inverted peer-indeterminate:before:s-border-negative peer-indeterminate:before:s-bg-negative peer-indeterminate:hover:before:s-border-negative-hover peer-indeterminate:hover:before:s-bg-negative-hover',
1275
+ // isCheckbox && isIndeterminate && isInvalid && !isDisabled
1276
+ indeterminateDisabled: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold pointer-events-none before:s-icon-inverted peer-indeterminate:before:s-border-disabled peer-indeterminate:before:s-bg-disabled',
1277
+ // isCheckbox && isIndeterminate && !isInvalid && isDisabled
1278
+ radio: "before:s-bg before:rounded-full peer-checked:before:border-[6] peer-checked:before:s-border-selected peer-checked:peer-hover:before:s-border-selected-hover peer-hover:before:s-border-primary peer-hover:before:s-bg-hover",
1279
+ // isRadio && !isDisabled && !isInvalid
1280
+ radioInvalid: "before:s-bg before:s-border-negative before:rounded-full peer-checked:before:border-[6] peer-hover:before:s-bg-negative-subtle peer-hover:before:s-border-negative-hover peer-checked:before:s-border-negative peer-checked:peer-hover:before:s-border-negative-hover",
1281
+ // isRadio && isInvalid && !isDisabled
1282
+ radioDisabled: "before:s-bg-disabled-subtle before:s-border-disabled pointer-events-none before:rounded-full peer-checked:before:border-[6]",
1283
+ // isRadio && !isInvalid && isDisabled
1284
+ radioButtonsLabel: "peer-hover:peer-not-checked:s-bg-hover peer-checked:s-text-inverted peer-checked:s-bg-primary peer-checked:s-border-primary block relative font-bold cursor-pointer s-text-link text-center s-bg border-2 s-border group-first-of-type:rounded-tl-8 group-first-of-type:rounded-bl-8 group-last-of-type:rounded-tr-8 group-last-of-type:rounded-br-8 group-not-last-of-type:border-r-0 peer-checked:z-10 group-not-first:-ml-2",
1285
+ // isRadioButtons
1286
+ radioButtonsRegular: "text-s py-8 pl-12 pr-14",
1287
+ // isRadioButtons && !isSmall
1288
+ radioButtonsSmall: "text-xs py-[5px] px-[8px]"
1289
+ // isRadioButtons && isSmall
1290
+ };
1291
+ var deadToggle = {
1292
+ wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
1293
+ input: `${toggle.input} hidden`,
1294
+ inputVue: "hidden",
1295
+ labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
1296
+ labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`,
1297
+ labelVue: "-mt-2"
1298
+ };
1299
+ var clickable = {
1300
+ toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
1301
+ label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
1302
+ buttonOrLink: "bg-transparent focusable",
1303
+ buttonOrLinkStretch: "inset-0 absolute"
1304
+ };
1305
+ var attention = {
1306
+ base: "border-2 relative flex items-start",
1307
+ tooltip: "s-bg-inverted border-[--w-s-color-background-inverted] shadow-m s-text-inverted-static rounded-4 py-6 px-8",
1308
+ callout: "bg-[--w-color-callout-background] border-[--w-color-callout-border] s-text py-8 px-16 rounded-8",
1309
+ highlight: "bg-[--w-color-callout-background] border-[--w-color-callout-border] s-text py-8 px-16 rounded-8 drop-shadow-m translate-z-0",
1310
+ popover: "bg-[--w-s-color-surface-elevated-300] border-[--w-s-color-surface-elevated-300] s-text rounded-8 p-16 drop-shadow-m translate-z-0",
1311
+ arrowBase: "absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",
1312
+ arrowDirectionLeftStart: "-left-[8px]",
1313
+ arrowDirectionLeft: "-left-[8px]",
1314
+ arrowDirectionLeftEnd: "-left-[8px]",
1315
+ arrowDirectionRightStart: "-right-[8px]",
1316
+ arrowDirectionRight: "-right-[8px]",
1317
+ arrowDirectionRightEnd: "-right-[8px]",
1318
+ arrowDirectionBottomStart: "-bottom-[8px]",
1319
+ arrowDirectionBottom: "-bottom-[8px]",
1320
+ arrowDirectionBottomEnd: "-bottom-[8px]",
1321
+ arrowDirectionTopStart: "-top-[8px]",
1322
+ arrowDirectionTop: "-top-[8px]",
1323
+ arrowDirectionTopEnd: "-top-[8px]",
1324
+ arrowTooltip: "s-bg-inverted border-[--w-s-color-background-inverted]",
1325
+ arrowCallout: "bg-[--w-color-callout-background] border-[--w-color-callout-border]",
1326
+ arrowPopover: "bg-[--w-s-color-surface-elevated-300] border-[--w-s-color-surface-elevated-300]",
1327
+ arrowHighlight: "bg-[--w-color-callout-background] border-[--w-color-callout-border]",
1328
+ content: "last-child:mb-0",
1329
+ notCallout: "absolute z-50",
1330
+ closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
1331
+ };
1332
+
1333
+ // packages/modal/modal-footer.js
1334
+ import WarpElement from "@warp-ds/elements-core";
1335
+
1336
+ // packages/modal/util.js
1337
+ var CanCloseMixin = (superClass) => class extends superClass {
1338
+ constructor() {
1339
+ super(...arguments);
1340
+ __publicField(this, "patchClose", true);
1341
+ __publicField(this, "_close", null);
1342
+ }
1343
+ close() {
1344
+ this._close();
1345
+ }
1346
+ };
1347
+ var ProvidesCanCloseToSlotsMixin = (superClass) => class extends superClass {
1348
+ // HACK: slot-props don't seem to exist and neither does the context pattern for this
1349
+ /** @param {Event} evt */
1350
+ handleSlotChange(evt) {
1351
+ const children = evt.target.assignedNodes({ flatten: true });
1352
+ for (const child of children.filter((e) => e.patchClose)) {
1353
+ child._close = () => this.close();
1354
+ }
1355
+ }
1356
+ };
1357
+
1358
+ // packages/modal/modal-footer.js
1359
+ var ModalFooter = class extends CanCloseMixin(ProvidesCanCloseToSlotsMixin(WarpElement)) {
1360
+ render() {
1361
+ return html`
1362
+ <div class="${modalElement.footer}">
1363
+ <slot @slotchange="${this.handleSlotChange}"></slot>
1364
+ </div>
1365
+ `;
1366
+ }
1367
+ };
1368
+ __publicField(ModalFooter, "styles", [WarpElement.styles]);
1369
+
1370
+ // packages/modal/modal-header.js
1371
+ import { html as html4, nothing } from "lit";
1372
+
1373
+ // node_modules/.pnpm/@itsy+animate@0.0.9/node_modules/@itsy/animate/src/utility.js
1374
+ var computeDeltas = (first, last) => ({
1375
+ dx: first.left - last.left,
1376
+ dy: first.top - last.top,
1377
+ dw: first.width / last.width,
1378
+ dh: first.height / last.height,
1379
+ first,
1380
+ last
1381
+ });
1382
+ var moveKeyframes = ({ dx, dy }) => [
1383
+ { transform: `translate(${dx}px, ${dy}px)` },
1384
+ { transform: "none" }
1385
+ ];
1386
+ var animationDefaults = { easing: "ease", duration: 300 };
1387
+
1388
+ // node_modules/.pnpm/@itsy+animate@0.0.9/node_modules/@itsy/animate/src/reduce-motion.js
1389
+ var reduceMotion = false;
1390
+ var windowExists = typeof window !== "undefined";
1391
+ if (windowExists) {
1392
+ const query = window.matchMedia("(prefers-reduced-motion: reduce)");
1393
+ const callback = ({ matches }) => reduceMotion = matches;
1394
+ if (query.addEventListener)
1395
+ query.addEventListener("change", callback);
1396
+ callback(query);
1397
+ }
1398
+
1399
+ // node_modules/.pnpm/@itsy+animate@0.0.9/node_modules/@itsy/animate/src/move.js
1400
+ var Move = class {
1401
+ constructor(el, { animation = {}, keyframes, respectReduceMotion = true } = {}) {
1402
+ /** @type {DOMRect | {}} */
1403
+ __publicField(this, "first");
1404
+ /** @type {DOMRect | {}} */
1405
+ __publicField(this, "last");
1406
+ /** @type {HTMLElement} */
1407
+ __publicField(this, "el");
1408
+ this.el = el;
1409
+ this.first = {};
1410
+ this.last = {};
1411
+ this.userAnimationOptions = animation;
1412
+ this.keyframeGenerator = keyframes || moveKeyframes;
1413
+ this.shouldReduceMotion = respectReduceMotion;
1414
+ }
1415
+ async when(cb) {
1416
+ this.prep();
1417
+ const v = await cb();
1418
+ await this.play();
1419
+ return v;
1420
+ }
1421
+ prep() {
1422
+ this.first = this.el.getBoundingClientRect();
1423
+ }
1424
+ async play() {
1425
+ this.last = this.el.getBoundingClientRect();
1426
+ if (!this.el.animate)
1427
+ return;
1428
+ const animation = this.el.animate(this.keyframes, this.animationOptions);
1429
+ await animation.finished;
1430
+ }
1431
+ get keyframes() {
1432
+ return this.keyframeGenerator(computeDeltas(this.first, this.last));
1433
+ }
1434
+ get defaults() {
1435
+ return animationDefaults;
1436
+ }
1437
+ get mergedOptions() {
1438
+ return __spreadValues(__spreadValues({}, this.defaults), this.userAnimationOptions);
1439
+ }
1440
+ get animationOptions() {
1441
+ if (!this.shouldReduceMotion)
1442
+ return this.mergedOptions;
1443
+ if (!reduceMotion)
1444
+ return this.mergedOptions;
1445
+ return __spreadProps(__spreadValues({}, this.mergedOptions), { duration: 0 });
1446
+ }
1447
+ };
1448
+
1449
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
1450
+ import { LitElement } from "lit";
1451
+ import { unsafeStatic, html as html2 } from "lit/static-html.js";
1452
+
1453
+ // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1454
+ var import_unraw = __toESM(require_dist(), 1);
1455
+
1456
+ // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1457
+ var import_parser = __toESM(require_parser(), 1);
1458
+ function processTokens(tokens, mapText) {
1459
+ if (!tokens.filter((token) => token.type !== "content").length) {
1460
+ return tokens.map((token) => mapText(token.value)).join("");
1461
+ }
1462
+ return tokens.map((token) => {
1463
+ var _a;
1464
+ if (token.type === "content") {
1465
+ return mapText(token.value);
1466
+ } else if (token.type === "octothorpe") {
1467
+ return "#";
1468
+ } else if (token.type === "argument") {
1469
+ return [token.arg];
1470
+ } else if (token.type === "function") {
1471
+ const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
1472
+ if (_param) {
1473
+ return [token.arg, token.key, _param.value.trim()];
1474
+ } else {
1475
+ return [token.arg, token.key];
1476
+ }
1477
+ }
1478
+ const offset = token.pluralOffset;
1479
+ const formatProps = {};
1480
+ token.cases.forEach((item) => {
1481
+ formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1482
+ item.tokens,
1483
+ mapText
1484
+ );
1485
+ });
1486
+ return [
1487
+ token.arg,
1488
+ token.type,
1489
+ __spreadValues({
1490
+ offset
1491
+ }, formatProps)
1492
+ ];
1493
+ });
1494
+ }
1495
+ function compileMessage(message, mapText = (v) => v) {
1496
+ try {
1497
+ return processTokens((0, import_parser.parse)(message), mapText);
1498
+ } catch (e) {
1499
+ console.error(`${e.message}
1500
+
1501
+ Message: ${message}`);
1502
+ return message;
1503
+ }
1504
+ }
1505
+
1506
+ // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1507
+ var isString = (s) => typeof s === "string";
1508
+ var isFunction = (f2) => typeof f2 === "function";
1509
+ var cache = /* @__PURE__ */ new Map();
1510
+ var defaultLocale = "en";
1511
+ function normalizeLocales(locales) {
1512
+ const out = Array.isArray(locales) ? locales : [locales];
1513
+ return [...out, defaultLocale];
1514
+ }
1515
+ function date(locales, value, format) {
1516
+ const _locales = normalizeLocales(locales);
1517
+ const formatter = getMemoized(
1518
+ () => cacheKey("date", _locales, format),
1519
+ () => new Intl.DateTimeFormat(_locales, format)
1520
+ );
1521
+ return formatter.format(isString(value) ? new Date(value) : value);
1522
+ }
1523
+ function number(locales, value, format) {
1524
+ const _locales = normalizeLocales(locales);
1525
+ const formatter = getMemoized(
1526
+ () => cacheKey("number", _locales, format),
1527
+ () => new Intl.NumberFormat(_locales, format)
1528
+ );
1529
+ return formatter.format(value);
1530
+ }
1531
+ function plural(locales, ordinal, value, _a) {
1532
+ var _b = _a, { offset = 0 } = _b, rules = __objRest(_b, ["offset"]);
1533
+ var _a2, _b2;
1534
+ const _locales = normalizeLocales(locales);
1535
+ const plurals = ordinal ? getMemoized(
1536
+ () => cacheKey("plural-ordinal", _locales),
1537
+ () => new Intl.PluralRules(_locales, { type: "ordinal" })
1538
+ ) : getMemoized(
1539
+ () => cacheKey("plural-cardinal", _locales),
1540
+ () => new Intl.PluralRules(_locales, { type: "cardinal" })
1541
+ );
1542
+ return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset)]) != null ? _b2 : rules.other;
1543
+ }
1544
+ function getMemoized(getKey, construct) {
1545
+ const key = getKey();
1546
+ let formatter = cache.get(key);
1547
+ if (!formatter) {
1548
+ formatter = construct();
1549
+ cache.set(key, formatter);
1550
+ }
1551
+ return formatter;
1552
+ }
1553
+ function cacheKey(type, locales, options) {
1554
+ const localeKey = locales.join("-");
1555
+ return `${type}-${localeKey}-${JSON.stringify(options)}`;
1556
+ }
1557
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1558
+ var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1559
+ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1560
+ const locales = passedLocales || locale;
1561
+ const style = (format) => {
1562
+ return typeof format === "object" ? format : formats[format] || { style: format };
1563
+ };
1564
+ const replaceOctothorpe = (value, message) => {
1565
+ const numberFormat = Object.keys(formats).length ? style("number") : void 0;
1566
+ const valueStr = number(locales, value, numberFormat);
1567
+ return message.replace(new RegExp(OCTOTHORPE_PH, "g"), valueStr);
1568
+ };
1569
+ return {
1570
+ plural: (value, cases) => {
1571
+ const { offset = 0 } = cases;
1572
+ const message = plural(locales, false, value, cases);
1573
+ return replaceOctothorpe(value - offset, message);
1574
+ },
1575
+ selectordinal: (value, cases) => {
1576
+ const { offset = 0 } = cases;
1577
+ const message = plural(locales, true, value, cases);
1578
+ return replaceOctothorpe(value - offset, message);
1579
+ },
1580
+ select: selectFormatter,
1581
+ number: (value, format) => number(locales, value, style(format)),
1582
+ date: (value, format) => date(locales, value, style(format))
1583
+ };
1584
+ };
1585
+ var selectFormatter = (value, rules) => {
1586
+ var _a;
1587
+ return (_a = rules[value]) != null ? _a : rules.other;
1588
+ };
1589
+ function interpolate(translation, locale, locales) {
1590
+ return (values = {}, formats) => {
1591
+ const formatters = getDefaultFormats(locale, locales, formats);
1592
+ const formatMessage = (tokens) => {
1593
+ if (!Array.isArray(tokens))
1594
+ return tokens;
1595
+ return tokens.reduce((message, token) => {
1596
+ if (token === "#") {
1597
+ return message + OCTOTHORPE_PH;
1598
+ }
1599
+ if (isString(token)) {
1600
+ return message + token;
1601
+ }
1602
+ const [name, type, format] = token;
1603
+ let interpolatedFormat = {};
1604
+ if (type === "plural" || type === "selectordinal" || type === "select") {
1605
+ Object.entries(format).forEach(
1606
+ ([key, value2]) => {
1607
+ interpolatedFormat[key] = formatMessage(value2);
1608
+ }
1609
+ );
1610
+ } else {
1611
+ interpolatedFormat = format;
1612
+ }
1613
+ let value;
1614
+ if (type) {
1615
+ const formatter = formatters[type];
1616
+ value = formatter(values[name], interpolatedFormat);
1617
+ } else {
1618
+ value = values[name];
1619
+ }
1620
+ if (value == null) {
1621
+ return message;
1622
+ }
1623
+ return message + value;
1624
+ }, "");
1625
+ };
1626
+ const result = formatMessage(translation);
1627
+ if (isString(result) && UNICODE_REGEX.test(result)) {
1628
+ return (0, import_unraw.unraw)(result.trim());
1629
+ }
1630
+ if (isString(result))
1631
+ return result.trim();
1632
+ return result ? String(result) : "";
1633
+ };
1634
+ }
1635
+ var __defProp$1 = Object.defineProperty;
1636
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1637
+ var __publicField$1 = (obj, key, value) => {
1638
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
1639
+ return value;
1640
+ };
1641
+ var EventEmitter = class {
1642
+ constructor() {
1643
+ __publicField$1(this, "_events", {});
1644
+ }
1645
+ on(event, listener) {
1646
+ var _a2;
1647
+ var _a;
1648
+ (_a2 = (_a = this._events)[event]) != null ? _a2 : _a[event] = [];
1649
+ this._events[event].push(listener);
1650
+ return () => this.removeListener(event, listener);
1651
+ }
1652
+ removeListener(event, listener) {
1653
+ const maybeListeners = this._getListeners(event);
1654
+ if (!maybeListeners)
1655
+ return;
1656
+ const index = maybeListeners.indexOf(listener);
1657
+ if (~index)
1658
+ maybeListeners.splice(index, 1);
1659
+ }
1660
+ emit(event, ...args) {
1661
+ const maybeListeners = this._getListeners(event);
1662
+ if (!maybeListeners)
1663
+ return;
1664
+ maybeListeners.map((listener) => listener.apply(this, args));
1665
+ }
1666
+ _getListeners(event) {
1667
+ const maybeListeners = this._events[event];
1668
+ return Array.isArray(maybeListeners) ? maybeListeners : false;
1669
+ }
1670
+ };
1671
+ var __defProp2 = Object.defineProperty;
1672
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1673
+ var __publicField2 = (obj, key, value) => {
1674
+ __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
1675
+ return value;
1676
+ };
1677
+ var I18n = class extends EventEmitter {
1678
+ constructor(params) {
1679
+ var _a;
1680
+ super();
1681
+ __publicField2(this, "_locale", "");
1682
+ __publicField2(this, "_locales");
1683
+ __publicField2(this, "_localeData", {});
1684
+ __publicField2(this, "_messages", {});
1685
+ __publicField2(this, "_missing");
1686
+ __publicField2(this, "t", this._.bind(this));
1687
+ if (params.missing != null)
1688
+ this._missing = params.missing;
1689
+ if (params.messages != null)
1690
+ this.load(params.messages);
1691
+ if (params.localeData != null)
1692
+ this.loadLocaleData(params.localeData);
1693
+ if (typeof params.locale === "string" || params.locales) {
1694
+ this.activate((_a = params.locale) != null ? _a : defaultLocale, params.locales);
1695
+ }
1696
+ }
1697
+ get locale() {
1698
+ return this._locale;
1699
+ }
1700
+ get locales() {
1701
+ return this._locales;
1702
+ }
1703
+ get messages() {
1704
+ var _a;
1705
+ return (_a = this._messages[this._locale]) != null ? _a : {};
1706
+ }
1707
+ /**
1708
+ * @deprecated this has no effect. Please remove this from the code. Deprecated in v4
1709
+ */
1710
+ get localeData() {
1711
+ var _a;
1712
+ return (_a = this._localeData[this._locale]) != null ? _a : {};
1713
+ }
1714
+ _loadLocaleData(locale, localeData) {
1715
+ const maybeLocaleData = this._localeData[locale];
1716
+ if (!maybeLocaleData) {
1717
+ this._localeData[locale] = localeData;
1718
+ } else {
1719
+ Object.assign(maybeLocaleData, localeData);
1720
+ }
1721
+ }
1722
+ /**
1723
+ * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1724
+ */
1725
+ // @ts-ignore deprecated, so ignore the reported error
1726
+ loadLocaleData(localeOrAllData, localeData) {
1727
+ if (localeData != null) {
1728
+ this._loadLocaleData(localeOrAllData, localeData);
1729
+ } else {
1730
+ Object.keys(localeOrAllData).forEach(
1731
+ (locale) => this._loadLocaleData(locale, localeOrAllData[locale])
1732
+ );
1733
+ }
1734
+ this.emit("change");
1735
+ }
1736
+ _load(locale, messages5) {
1737
+ const maybeMessages = this._messages[locale];
1738
+ if (!maybeMessages) {
1739
+ this._messages[locale] = messages5;
1740
+ } else {
1741
+ Object.assign(maybeMessages, messages5);
1742
+ }
1743
+ }
1744
+ load(localeOrMessages, messages5) {
1745
+ if (typeof localeOrMessages == "string" && typeof messages5 === "object") {
1746
+ this._load(localeOrMessages, messages5);
1747
+ } else {
1748
+ Object.entries(localeOrMessages).forEach(
1749
+ ([locale, messages23]) => this._load(locale, messages23)
1750
+ );
1751
+ }
1752
+ this.emit("change");
1753
+ }
1754
+ /**
1755
+ * @param options {@link LoadAndActivateOptions}
1756
+ */
1757
+ loadAndActivate({ locale, locales, messages: messages5 }) {
1758
+ this._locale = locale;
1759
+ this._locales = locales || void 0;
1760
+ this._messages[this._locale] = messages5;
1761
+ this.emit("change");
1762
+ }
1763
+ activate(locale, locales) {
1764
+ if (true) {
1765
+ if (!this._messages[locale]) {
1766
+ console.warn(`Messages for locale "${locale}" not loaded.`);
1767
+ }
1768
+ }
1769
+ this._locale = locale;
1770
+ this._locales = locales;
1771
+ this.emit("change");
1772
+ }
1773
+ _(id, values, options) {
1774
+ let message = options == null ? void 0 : options.message;
1775
+ if (!isString(id)) {
1776
+ values = id.values || values;
1777
+ message = id.message;
1778
+ id = id.id;
1779
+ }
1780
+ const messageForId = this.messages[id];
1781
+ const messageMissing = messageForId === void 0;
1782
+ const missing = this._missing;
1783
+ if (missing && messageMissing) {
1784
+ return isFunction(missing) ? missing(this._locale, id) : missing;
1785
+ }
1786
+ if (messageMissing) {
1787
+ this.emit("missing", { id, locale: this._locale });
1788
+ }
1789
+ let translation = messageForId || message || id;
1790
+ if (true) {
1791
+ translation = isString(translation) ? compileMessage(translation) : translation;
1792
+ }
1793
+ if (isString(translation) && UNICODE_REGEX.test(translation))
1794
+ return JSON.parse(`"${translation}"`);
1795
+ if (isString(translation))
1796
+ return translation;
1797
+ return interpolate(
1798
+ translation,
1799
+ this._locale,
1800
+ this._locales
1801
+ )(values, options == null ? void 0 : options.formats);
1802
+ }
1803
+ date(value, format) {
1804
+ return date(this._locales || this._locale, value, format);
1805
+ }
1806
+ number(value, format) {
1807
+ return number(this._locales || this._locale, value, format);
1808
+ }
1809
+ };
1810
+ function setupI18n(params = {}) {
1811
+ return new I18n(params);
1812
+ }
1813
+ var i18n = setupI18n();
1814
+
1815
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/arrow-left-16.js
1816
+ var messages = JSON.parse('{"icon.title.arrow-left":"Pil som peker mot venstre"}');
1817
+ var messages2 = JSON.parse('{"icon.title.arrow-left":"Leftward-pointing arrow"}');
1818
+ var messages3 = JSON.parse('{"icon.title.arrow-left":"Vasemmalle osoittava nuoli"}');
1819
+ var supportedLocales = ["en", "nb", "fi", "da", "sv"];
1820
+ var defaultLocale2 = "en";
1821
+ var detectByBrand = () => {
1822
+ let value;
1823
+ switch (process.env.NMP_BRAND) {
1824
+ case "FINN":
1825
+ value = "nb";
1826
+ break;
1827
+ case "TORI":
1828
+ value = "fi";
1829
+ break;
1830
+ case "BLOCKET":
1831
+ value = "sv";
1832
+ break;
1833
+ case "DBA":
1834
+ value = "da";
1835
+ break;
1836
+ default:
1837
+ value = "en";
1838
+ }
1839
+ return value;
1840
+ };
1841
+ var detectByHost = () => {
1842
+ var _a;
1843
+ const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
1844
+ if (hostname.includes("finn")) {
1845
+ return "nb";
1846
+ } else if (hostname.includes("tori")) {
1847
+ return "fi";
1848
+ } else if (hostname.includes("blocket")) {
1849
+ return "sv";
1850
+ } else if (hostname.includes("dba")) {
1851
+ return "da";
1852
+ } else {
1853
+ return defaultLocale2;
1854
+ }
1855
+ };
1856
+ var getSupportedLocale = (usedLocale) => {
1857
+ return supportedLocales.find(
1858
+ (locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
1859
+ ) || detectByHost();
1860
+ };
1861
+ function detectLocale() {
1862
+ var _a;
1863
+ if (typeof window === "undefined") {
1864
+ const serverLocale = detectByBrand();
1865
+ return getSupportedLocale(serverLocale);
1866
+ }
1867
+ try {
1868
+ const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
1869
+ const hostLocale = detectByHost();
1870
+ if (!supportedLocales.includes(htmlLocale)) {
1871
+ console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
1872
+ return getSupportedLocale(hostLocale);
1873
+ }
1874
+ return getSupportedLocale(htmlLocale != null ? htmlLocale : hostLocale);
1875
+ } catch (e) {
1876
+ console.warn("could not detect locale, falling back to source locale", e);
1877
+ return defaultLocale2;
1878
+ }
1879
+ }
1880
+ var getMessages = (locale, enMsg, nbMsg, fiMsg) => {
1881
+ if (locale === "nb")
1882
+ return nbMsg;
1883
+ if (locale === "fi")
1884
+ return fiMsg;
1885
+ return enMsg;
1886
+ };
1887
+ var activateI18n = (enMessages, nbMessages, fiMessages) => {
1888
+ const locale = detectLocale();
1889
+ const messages42 = getMessages(locale, enMessages, nbMessages, fiMessages);
1890
+ i18n.load(locale, messages42);
1891
+ i18n.activate(locale);
1892
+ };
1893
+ activateI18n(messages2, messages, messages3);
1894
+ var IconArrowLeft16 = class extends LitElement {
1895
+ render() {
1896
+ const title = i18n.t({ message: `Leftward-pointing arrow`, id: "icon.title.arrow-left", comment: "Title for table arrow left icon" });
1897
+ return html2`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-arrow-left-16-part">${unsafeStatic(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-width="1.5" d="M5.222 8h6.667"></path><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M7.444 11.75 4.111 8l3.333-3.75"></path></svg>`;
1898
+ }
1899
+ };
1900
+ if (!customElements.get("w-icon-arrow-left-16")) {
1901
+ customElements.define("w-icon-arrow-left-16", IconArrowLeft16);
1902
+ }
1903
+
1904
+ // node_modules/.pnpm/@warp-ds+icons@2.0.1/node_modules/@warp-ds/icons/dist/elements/close-16.js
1905
+ import { LitElement as LitElement2 } from "lit";
1906
+ import { unsafeStatic as unsafeStatic2, html as html3 } from "lit/static-html.js";
1907
+ var messages4 = JSON.parse('{"icon.title.close":"Kryss"}');
1908
+ var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
1909
+ var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
1910
+ var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
1911
+ var defaultLocale3 = "en";
1912
+ var detectByBrand2 = () => {
1913
+ let value;
1914
+ switch (process.env.NMP_BRAND) {
1915
+ case "FINN":
1916
+ value = "nb";
1917
+ break;
1918
+ case "TORI":
1919
+ value = "fi";
1920
+ break;
1921
+ case "BLOCKET":
1922
+ value = "sv";
1923
+ break;
1924
+ case "DBA":
1925
+ value = "da";
1926
+ break;
1927
+ default:
1928
+ value = "en";
1929
+ }
1930
+ return value;
1931
+ };
1932
+ var detectByHost2 = () => {
1933
+ var _a;
1934
+ const hostname = (_a = document == null ? void 0 : document.location) == null ? void 0 : _a.hostname;
1935
+ if (hostname.includes("finn")) {
1936
+ return "nb";
1937
+ } else if (hostname.includes("tori")) {
1938
+ return "fi";
1939
+ } else if (hostname.includes("blocket")) {
1940
+ return "sv";
1941
+ } else if (hostname.includes("dba")) {
1942
+ return "da";
1943
+ } else {
1944
+ return defaultLocale3;
1945
+ }
1946
+ };
1947
+ var getSupportedLocale2 = (usedLocale) => {
1948
+ return supportedLocales2.find(
1949
+ (locale) => usedLocale === locale || usedLocale.toLowerCase().includes(locale)
1950
+ ) || detectByHost2();
1951
+ };
1952
+ function detectLocale2() {
1953
+ var _a;
1954
+ if (typeof window === "undefined") {
1955
+ const serverLocale = detectByBrand2();
1956
+ return getSupportedLocale2(serverLocale);
1957
+ }
1958
+ try {
1959
+ const htmlLocale = (_a = document == null ? void 0 : document.documentElement) == null ? void 0 : _a.lang;
1960
+ const hostLocale = detectByHost2();
1961
+ if (!supportedLocales2.includes(htmlLocale)) {
1962
+ console.warn("Unsupported locale set in html lang tag, falling back to detection by hostname");
1963
+ return getSupportedLocale2(hostLocale);
1964
+ }
1965
+ return getSupportedLocale2(htmlLocale != null ? htmlLocale : hostLocale);
1966
+ } catch (e) {
1967
+ console.warn("could not detect locale, falling back to source locale", e);
1968
+ return defaultLocale3;
1969
+ }
1970
+ }
1971
+ var getMessages2 = (locale, enMsg, nbMsg, fiMsg) => {
1972
+ if (locale === "nb")
1973
+ return nbMsg;
1974
+ if (locale === "fi")
1975
+ return fiMsg;
1976
+ return enMsg;
1977
+ };
1978
+ var activateI18n2 = (enMessages, nbMessages, fiMessages) => {
1979
+ const locale = detectLocale2();
1980
+ const messages42 = getMessages2(locale, enMessages, nbMessages, fiMessages);
1981
+ i18n.load(locale, messages42);
1982
+ i18n.activate(locale);
1983
+ };
1984
+ activateI18n2(messages22, messages4, messages32);
1985
+ var IconClose16 = class extends LitElement2 {
1986
+ render() {
1987
+ const title = i18n.t({ message: `Cross`, id: "icon.title.close", comment: "Title for close icon" });
1988
+ return html3`<svg xmlns="http://www.w3.org/2000/svg"width="16"height="16"fill="none"viewBox="0 0 16 16" part="w-icon-close-16-part">${unsafeStatic2(`<title>${title}</title>`)}<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12.5 3.5-9 9m0-9 9 9"></path></svg>`;
1989
+ }
1990
+ };
1991
+ if (!customElements.get("w-icon-close-16")) {
1992
+ customElements.define("w-icon-close-16", IconClose16);
1993
+ }
1994
+
1995
+ // packages/modal/modal-header.js
1996
+ import WarpElement2 from "@warp-ds/elements-core";
1997
+ import { createRef, ref } from "lit/directives/ref.js";
1998
+ var NO_CLOSE_BUTTON = "no-close";
1999
+ var ModalHeader = class extends CanCloseMixin(WarpElement2) {
2000
+ constructor() {
2001
+ super();
2002
+ __publicField(this, "titleEl", createRef());
2003
+ this._hasTopContent = false;
2004
+ }
2005
+ render() {
2006
+ return html4`
2007
+ <div class="${modalElement.header}">
2008
+ <slot name="top" @slotchange=${this.handleTopSlotChange}></slot>
2009
+ <div class="${this._hasTopContent ? "" : modalElement.headerTitleBar}">
2010
+ ${this.backButton}
2011
+ <h1 ${ref(this.titleEl)} class="${this.titleClasses}">${this.title}</h1>
2012
+ ${this.closeButton}
2013
+ </div>
2014
+ </div>
2015
+ `;
2016
+ }
2017
+ async willUpdate(changedProperties) {
2018
+ if (changedProperties.has("back")) {
2019
+ const move = new Move(this.titleEl.value);
2020
+ move.when(async () => {
2021
+ await this.updateComplete;
2022
+ });
2023
+ }
2024
+ }
2025
+ get titleClasses() {
2026
+ return [
2027
+ modalElement.headerTitle,
2028
+ this.back ? modalElement.headerTitleWithBackButton : modalElement.headerTitleWithoutBackButton,
2029
+ this._hasTopContent ? modalElement.headerTitleWithTopArea : ""
2030
+ ].join(" ");
2031
+ }
2032
+ get backButton() {
2033
+ return this.back && !this._hasTopContent ? html4` <button type="button" class="${modalElement.headerButton} ${modalElement.headerButtonLeft}" @click="${this.emitBack}">
2034
+ <w-icon-arrow-left-16></w-icon-arrow-left-16>
2035
+ </button>` : nothing;
2036
+ }
2037
+ get closeButton() {
2038
+ if (this[NO_CLOSE_BUTTON])
2039
+ return nothing;
2040
+ return html4` <button
2041
+ type="button"
2042
+ class="${modalElement.headerButton} ${this._hasTopContent ? modalElement.headerCloseButtonOnImage : modalElement.headerCloseButton}"
2043
+ @click="${this.close}">
2044
+ <w-icon-close-16></w-icon-close-16>
2045
+ </button>`;
2046
+ }
2047
+ emitBack() {
2048
+ this.dispatchEvent(new CustomEvent("backClicked", { bubbles: true, composed: true }));
2049
+ }
2050
+ handleTopSlotChange(slotEvent) {
2051
+ const topContent = slotEvent.target.assignedElements({ flatten: true });
2052
+ this._hasTopContent = !!topContent.length;
2053
+ }
2054
+ };
2055
+ __publicField(ModalHeader, "properties", {
2056
+ title: { type: String },
2057
+ back: { type: Boolean },
2058
+ [NO_CLOSE_BUTTON]: { type: Boolean },
2059
+ _hasTopContent: { state: true }
2060
+ });
2061
+ __publicField(ModalHeader, "styles", [WarpElement2.styles]);
2062
+
2063
+ // packages/modal/modal-main.js
2064
+ import { css, html as html5 } from "lit";
2065
+ import WarpElement3 from "@warp-ds/elements-core";
2066
+ import { createRef as createRef2, ref as ref2 } from "lit/directives/ref.js";
2067
+
2068
+ // node_modules/.pnpm/scroll-doctor@2.0.2/node_modules/scroll-doctor/dist/scroll-doctor.js
2069
+ var n = [];
2070
+ var c = { documentElement: {}, body: {} };
2071
+ var i = Object.freeze({
2072
+ // html
2073
+ documentElement: {
2074
+ "scrollbar-gutter": "stable"
2075
+ },
2076
+ body: {
2077
+ overflow: "hidden",
2078
+ position: "relative",
2079
+ height: "100%"
2080
+ }
2081
+ });
2082
+ var r = (t) => {
2083
+ var _a;
2084
+ t.touches.length > 1 || ((_a = t.preventDefault) == null ? void 0 : _a.call(t));
2085
+ };
2086
+ var h = (t) => ([e, s]) => {
2087
+ c[t][e] = document[t].style[e], document[t].style[e] = s;
2088
+ };
2089
+ var a = () => Object.entries(i).forEach(([t, e]) => {
2090
+ Object.entries(e).forEach(h(t));
2091
+ });
2092
+ var d = (t) => ([e, s]) => {
2093
+ document[t].style[e] = c[t][e];
2094
+ };
2095
+ var f = () => Object.entries(c).forEach(([t, e]) => {
2096
+ Object.entries(e).forEach(d(t));
2097
+ });
2098
+ var m = (t) => t.scrollHeight - Math.abs(t.scrollTop) === t.clientHeight;
2099
+ function y(t) {
2100
+ let e = -1;
2101
+ const s = (o) => {
2102
+ if (o.targetTouches.length !== 1)
2103
+ return;
2104
+ const l = o.targetTouches[0].clientY - e;
2105
+ return t.scrollTop === 0 && l > 0 || m(t) && l < 0 ? r(o) : (o.stopPropagation(), true);
2106
+ };
2107
+ t.ontouchstart = (o) => {
2108
+ o.targetTouches.length === 1 && (e = o.targetTouches[0].clientY);
2109
+ }, t.ontouchmove = s;
2110
+ }
2111
+ function p(t) {
2112
+ t.ontouchstart = null, t.ontouchmove = null;
2113
+ }
2114
+ var u = (t) => () => document[t ? "addEventListener" : "removeEventListener"]("touchmove", r, { passive: false });
2115
+ var b = u(true);
2116
+ var g = u();
2117
+ function E(t) {
2118
+ if (!t)
2119
+ throw Error("Could not run setup, an element must be provided");
2120
+ n.some((e) => e === t) || (n.length || (a(), b()), y(t), n.push(t));
2121
+ }
2122
+ function T() {
2123
+ n.forEach(p), g(), f(), n = [];
2124
+ }
2125
+
2126
+ // packages/modal/modal-main.js
2127
+ var NO_BACKDROP_CLICKS = "ignore-backdrop-clicks";
2128
+ var CONTENT_ID = "content-id";
2129
+ var ModalMain = class extends ProvidesCanCloseToSlotsMixin(WarpElement3) {
2130
+ constructor() {
2131
+ super();
2132
+ __publicField(this, "dialogEl", createRef2());
2133
+ __publicField(this, "dialogInnerEl", createRef2());
2134
+ __publicField(this, "contentEl", createRef2());
2135
+ this.interceptEscape = this.interceptEscape.bind(this);
2136
+ this.closeOnBackdropClick = this.closeOnBackdropClick.bind(this);
2137
+ this.eventPreventer = this.eventPreventer.bind(this);
2138
+ this.modifyBorderRadius = this.modifyBorderRadius.bind(this);
2139
+ }
2140
+ async open() {
2141
+ this.dialogEl.value.showModal();
2142
+ this.handleListeners();
2143
+ E(this.contentEl.value);
2144
+ await this.updateComplete;
2145
+ this.dispatchEvent(new CustomEvent("shown", { bubbles: true, composed: true }));
2146
+ }
2147
+ close() {
2148
+ this.handleListeners("removeEventListener");
2149
+ this.dialogEl.value.classList.add("close");
2150
+ this.dialogEl.value.addEventListener(
2151
+ "animationend",
2152
+ async () => {
2153
+ this.dialogEl.value.classList.remove("close");
2154
+ this.dialogEl.value.close();
2155
+ T();
2156
+ await this.updateComplete;
2157
+ this.dispatchEvent(new CustomEvent("hidden", { bubbles: true, composed: true }));
2158
+ },
2159
+ { once: true }
2160
+ );
2161
+ }
2162
+ render() {
2163
+ return html5`
2164
+ <dialog ${ref2(this.dialogEl)} class="w-modal ${modalElement.dialogEl}">
2165
+ <div ${ref2(this.dialogInnerEl)} class="${modalElement.dialogInner}">
2166
+ <slot name="header" @slotchange="${this.handleSlotChange}"></slot>
2167
+ <div ${ref2(this.contentEl)} class="${modalElement.contentSlot}" id=${this[CONTENT_ID]}>
2168
+ <slot name="content" @slotchange="${this.handleSlotChange}"></slot>
2169
+ </div>
2170
+ <slot name="footer" @slotchange="${this.handleSlotChange}"></slot>
2171
+ </div>
2172
+ </dialog>
2173
+ `;
2174
+ }
2175
+ willUpdate(changedProperties) {
2176
+ if (changedProperties.has("show"))
2177
+ this[this.show ? "open" : "close"]();
2178
+ }
2179
+ handleListeners(verb = "addEventListener") {
2180
+ document[verb]("keydown", this.interceptEscape);
2181
+ if (!this[NO_BACKDROP_CLICKS])
2182
+ this.dialogEl.value[verb]("mousedown", this.closeOnBackdropClick);
2183
+ this.dialogEl.value[verb]("close", this.eventPreventer);
2184
+ this.dialogEl.value[verb]("cancel", this.eventPreventer);
2185
+ this.dialogInnerEl.value[verb]("transitionend", this.modifyBorderRadius);
2186
+ }
2187
+ /** @param {Event} evt */
2188
+ eventPreventer(evt) {
2189
+ evt.preventDefault();
2190
+ }
2191
+ /** @param {MouseEvent} evt */
2192
+ closeOnBackdropClick(evt) {
2193
+ if (this.dialogEl.value === evt.target)
2194
+ this.close();
2195
+ }
2196
+ /** @param {KeyboardEvent} evt */
2197
+ interceptEscape(evt) {
2198
+ if (evt.key === "Escape") {
2199
+ evt.preventDefault();
2200
+ this.close();
2201
+ }
2202
+ }
2203
+ modifyBorderRadius() {
2204
+ if (this.dialogInnerEl.value.scrollHeight * 1.02 > innerHeight)
2205
+ this.dialogInnerEl.value.style.borderRadius = "0px";
2206
+ else
2207
+ this.dialogInnerEl.value.style.borderRadius = null;
2208
+ }
2209
+ };
2210
+ __publicField(ModalMain, "properties", {
2211
+ show: { type: Boolean },
2212
+ [CONTENT_ID]: { type: String },
2213
+ [NO_BACKDROP_CLICKS]: { type: Boolean }
2214
+ });
2215
+ __publicField(ModalMain, "styles", [
2216
+ WarpElement3.styles,
2217
+ css`
2218
+ .w-modal {
2219
+ --w-modal-translate-distance: 100%;
2220
+ }
2221
+ @media (min-width: 480px) {
2222
+ .w-modal {
2223
+ --w-modal-translate-distance: 50%;
2224
+ }
2225
+ }
2226
+ .w-modal[open] {
2227
+ animation: w-modal-in 0.3s ease-in-out forwards;
2228
+ }
2229
+ .w-modal.close {
2230
+ animation: w-modal-out 0.3s ease-in-out forwards;
2231
+ }
2232
+ .w-modal[open]::backdrop {
2233
+ animation: backdrop-in 0.3s ease-in-out forwards;
2234
+ }
2235
+ .w-modal.close::backdrop {
2236
+ animation: backdrop-out 0.3s ease-in-out forwards;
2237
+ }
2238
+ /* shouldn't need two (in/out) animations declared here, but reversing is being weird */
2239
+ @keyframes w-modal-in {
2240
+ from {
2241
+ transform: translateY(var(--w-modal-translate-distance));
2242
+ opacity: 0;
2243
+ }
2244
+ to {
2245
+ transform: translateY(0);
2246
+ opacity: 1;
2247
+ }
2248
+ }
2249
+ @keyframes w-modal-out {
2250
+ from {
2251
+ transform: translateY(0);
2252
+ opacity: 1;
2253
+ }
2254
+ to {
2255
+ transform: translateY(var(--w-modal-translate-distance));
2256
+ opacity: 0;
2257
+ }
2258
+ }
2259
+ @keyframes backdrop-in {
2260
+ from {
2261
+ background: transparent;
2262
+ }
2263
+ to {
2264
+ background: rgba(0, 0, 0, 0.25);
2265
+ }
2266
+ }
2267
+ @keyframes backdrop-out {
2268
+ from {
2269
+ background: rgba(0, 0, 0, 0.25);
2270
+ }
2271
+ to {
2272
+ background: transparent;
2273
+ }
2274
+ }
2275
+ `
2276
+ ]);
2277
+
2278
+ // packages/modal/index.js
2279
+ if (!customElements.get("w-modal")) {
2280
+ customElements.define("w-modal", ModalMain);
2281
+ customElements.define("w-modal-header", ModalHeader);
2282
+ customElements.define("w-modal-footer", ModalFooter);
2283
+ }
2284
+ export {
2285
+ CanCloseMixin as ModalCanCloseMixin,
2286
+ ProvidesCanCloseToSlotsMixin as ModalProvidesCanCloseToSlotsMixin,
2287
+ ModalMain as WarpModal,
2288
+ ModalFooter as WarpModalFooter,
2289
+ ModalHeader as WarpModalHeader
2290
+ };
2291
+ //# sourceMappingURL=index.js.map