create-astrale-domain 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1137 -0
  2. package/package.json +44 -0
package/dist/index.js ADDED
@@ -0,0 +1,1137 @@
1
+ #!/usr/bin/env node
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+
28
+ // ../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
29
+ var require_src = __commonJS({
30
+ "../../node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js"(exports, module) {
31
+ "use strict";
32
+ var ESC = "\x1B";
33
+ var CSI = `${ESC}[`;
34
+ var beep = "\x07";
35
+ var cursor = {
36
+ to(x2, y3) {
37
+ if (!y3) return `${CSI}${x2 + 1}G`;
38
+ return `${CSI}${y3 + 1};${x2 + 1}H`;
39
+ },
40
+ move(x2, y3) {
41
+ let ret = "";
42
+ if (x2 < 0) ret += `${CSI}${-x2}D`;
43
+ else if (x2 > 0) ret += `${CSI}${x2}C`;
44
+ if (y3 < 0) ret += `${CSI}${-y3}A`;
45
+ else if (y3 > 0) ret += `${CSI}${y3}B`;
46
+ return ret;
47
+ },
48
+ up: (count = 1) => `${CSI}${count}A`,
49
+ down: (count = 1) => `${CSI}${count}B`,
50
+ forward: (count = 1) => `${CSI}${count}C`,
51
+ backward: (count = 1) => `${CSI}${count}D`,
52
+ nextLine: (count = 1) => `${CSI}E`.repeat(count),
53
+ prevLine: (count = 1) => `${CSI}F`.repeat(count),
54
+ left: `${CSI}G`,
55
+ hide: `${CSI}?25l`,
56
+ show: `${CSI}?25h`,
57
+ save: `${ESC}7`,
58
+ restore: `${ESC}8`
59
+ };
60
+ var scroll = {
61
+ up: (count = 1) => `${CSI}S`.repeat(count),
62
+ down: (count = 1) => `${CSI}T`.repeat(count)
63
+ };
64
+ var erase = {
65
+ screen: `${CSI}2J`,
66
+ up: (count = 1) => `${CSI}1J`.repeat(count),
67
+ down: (count = 1) => `${CSI}J`.repeat(count),
68
+ line: `${CSI}2K`,
69
+ lineEnd: `${CSI}K`,
70
+ lineStart: `${CSI}1K`,
71
+ lines(count) {
72
+ let clear = "";
73
+ for (let i = 0; i < count; i++)
74
+ clear += this.line + (i < count - 1 ? cursor.up() : "");
75
+ if (count)
76
+ clear += cursor.left;
77
+ return clear;
78
+ }
79
+ };
80
+ module.exports = { cursor, scroll, erase, beep };
81
+ }
82
+ });
83
+
84
+ // ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
85
+ var require_picocolors = __commonJS({
86
+ "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(exports, module) {
87
+ var p2 = process || {};
88
+ var argv = p2.argv || [];
89
+ var env = p2.env || {};
90
+ var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p2.platform === "win32" || (p2.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
91
+ var formatter = (open, close, replace = open) => (input) => {
92
+ let string = "" + input, index = string.indexOf(close, open.length);
93
+ return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
94
+ };
95
+ var replaceClose = (string, close, replace, index) => {
96
+ let result = "", cursor = 0;
97
+ do {
98
+ result += string.substring(cursor, index) + replace;
99
+ cursor = index + close.length;
100
+ index = string.indexOf(close, cursor);
101
+ } while (~index);
102
+ return result + string.substring(cursor);
103
+ };
104
+ var createColors = (enabled = isColorSupported) => {
105
+ let f = enabled ? formatter : () => String;
106
+ return {
107
+ isColorSupported: enabled,
108
+ reset: f("\x1B[0m", "\x1B[0m"),
109
+ bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
110
+ dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
111
+ italic: f("\x1B[3m", "\x1B[23m"),
112
+ underline: f("\x1B[4m", "\x1B[24m"),
113
+ inverse: f("\x1B[7m", "\x1B[27m"),
114
+ hidden: f("\x1B[8m", "\x1B[28m"),
115
+ strikethrough: f("\x1B[9m", "\x1B[29m"),
116
+ black: f("\x1B[30m", "\x1B[39m"),
117
+ red: f("\x1B[31m", "\x1B[39m"),
118
+ green: f("\x1B[32m", "\x1B[39m"),
119
+ yellow: f("\x1B[33m", "\x1B[39m"),
120
+ blue: f("\x1B[34m", "\x1B[39m"),
121
+ magenta: f("\x1B[35m", "\x1B[39m"),
122
+ cyan: f("\x1B[36m", "\x1B[39m"),
123
+ white: f("\x1B[37m", "\x1B[39m"),
124
+ gray: f("\x1B[90m", "\x1B[39m"),
125
+ bgBlack: f("\x1B[40m", "\x1B[49m"),
126
+ bgRed: f("\x1B[41m", "\x1B[49m"),
127
+ bgGreen: f("\x1B[42m", "\x1B[49m"),
128
+ bgYellow: f("\x1B[43m", "\x1B[49m"),
129
+ bgBlue: f("\x1B[44m", "\x1B[49m"),
130
+ bgMagenta: f("\x1B[45m", "\x1B[49m"),
131
+ bgCyan: f("\x1B[46m", "\x1B[49m"),
132
+ bgWhite: f("\x1B[47m", "\x1B[49m"),
133
+ blackBright: f("\x1B[90m", "\x1B[39m"),
134
+ redBright: f("\x1B[91m", "\x1B[39m"),
135
+ greenBright: f("\x1B[92m", "\x1B[39m"),
136
+ yellowBright: f("\x1B[93m", "\x1B[39m"),
137
+ blueBright: f("\x1B[94m", "\x1B[39m"),
138
+ magentaBright: f("\x1B[95m", "\x1B[39m"),
139
+ cyanBright: f("\x1B[96m", "\x1B[39m"),
140
+ whiteBright: f("\x1B[97m", "\x1B[39m"),
141
+ bgBlackBright: f("\x1B[100m", "\x1B[49m"),
142
+ bgRedBright: f("\x1B[101m", "\x1B[49m"),
143
+ bgGreenBright: f("\x1B[102m", "\x1B[49m"),
144
+ bgYellowBright: f("\x1B[103m", "\x1B[49m"),
145
+ bgBlueBright: f("\x1B[104m", "\x1B[49m"),
146
+ bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
147
+ bgCyanBright: f("\x1B[106m", "\x1B[49m"),
148
+ bgWhiteBright: f("\x1B[107m", "\x1B[49m")
149
+ };
150
+ };
151
+ module.exports = createColors();
152
+ module.exports.createColors = createColors;
153
+ }
154
+ });
155
+
156
+ // ../../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
157
+ import { stripVTControlCharacters as S2 } from "node:util";
158
+
159
+ // ../../node_modules/.pnpm/@clack+core@0.5.0/node_modules/@clack/core/dist/index.mjs
160
+ var import_sisteransi = __toESM(require_src(), 1);
161
+ var import_picocolors = __toESM(require_picocolors(), 1);
162
+ import { stdin as j, stdout as M } from "node:process";
163
+ import * as g from "node:readline";
164
+ import O from "node:readline";
165
+ import { Writable as X } from "node:stream";
166
+ function DD({ onlyFirst: e2 = false } = {}) {
167
+ const t = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
168
+ return new RegExp(t, e2 ? void 0 : "g");
169
+ }
170
+ var uD = DD();
171
+ function P(e2) {
172
+ if (typeof e2 != "string") throw new TypeError(`Expected a \`string\`, got \`${typeof e2}\``);
173
+ return e2.replace(uD, "");
174
+ }
175
+ function L(e2) {
176
+ return e2 && e2.__esModule && Object.prototype.hasOwnProperty.call(e2, "default") ? e2.default : e2;
177
+ }
178
+ var W = { exports: {} };
179
+ (function(e2) {
180
+ var u2 = {};
181
+ e2.exports = u2, u2.eastAsianWidth = function(F2) {
182
+ var s = F2.charCodeAt(0), i = F2.length == 2 ? F2.charCodeAt(1) : 0, D2 = s;
183
+ return 55296 <= s && s <= 56319 && 56320 <= i && i <= 57343 && (s &= 1023, i &= 1023, D2 = s << 10 | i, D2 += 65536), D2 == 12288 || 65281 <= D2 && D2 <= 65376 || 65504 <= D2 && D2 <= 65510 ? "F" : D2 == 8361 || 65377 <= D2 && D2 <= 65470 || 65474 <= D2 && D2 <= 65479 || 65482 <= D2 && D2 <= 65487 || 65490 <= D2 && D2 <= 65495 || 65498 <= D2 && D2 <= 65500 || 65512 <= D2 && D2 <= 65518 ? "H" : 4352 <= D2 && D2 <= 4447 || 4515 <= D2 && D2 <= 4519 || 4602 <= D2 && D2 <= 4607 || 9001 <= D2 && D2 <= 9002 || 11904 <= D2 && D2 <= 11929 || 11931 <= D2 && D2 <= 12019 || 12032 <= D2 && D2 <= 12245 || 12272 <= D2 && D2 <= 12283 || 12289 <= D2 && D2 <= 12350 || 12353 <= D2 && D2 <= 12438 || 12441 <= D2 && D2 <= 12543 || 12549 <= D2 && D2 <= 12589 || 12593 <= D2 && D2 <= 12686 || 12688 <= D2 && D2 <= 12730 || 12736 <= D2 && D2 <= 12771 || 12784 <= D2 && D2 <= 12830 || 12832 <= D2 && D2 <= 12871 || 12880 <= D2 && D2 <= 13054 || 13056 <= D2 && D2 <= 19903 || 19968 <= D2 && D2 <= 42124 || 42128 <= D2 && D2 <= 42182 || 43360 <= D2 && D2 <= 43388 || 44032 <= D2 && D2 <= 55203 || 55216 <= D2 && D2 <= 55238 || 55243 <= D2 && D2 <= 55291 || 63744 <= D2 && D2 <= 64255 || 65040 <= D2 && D2 <= 65049 || 65072 <= D2 && D2 <= 65106 || 65108 <= D2 && D2 <= 65126 || 65128 <= D2 && D2 <= 65131 || 110592 <= D2 && D2 <= 110593 || 127488 <= D2 && D2 <= 127490 || 127504 <= D2 && D2 <= 127546 || 127552 <= D2 && D2 <= 127560 || 127568 <= D2 && D2 <= 127569 || 131072 <= D2 && D2 <= 194367 || 177984 <= D2 && D2 <= 196605 || 196608 <= D2 && D2 <= 262141 ? "W" : 32 <= D2 && D2 <= 126 || 162 <= D2 && D2 <= 163 || 165 <= D2 && D2 <= 166 || D2 == 172 || D2 == 175 || 10214 <= D2 && D2 <= 10221 || 10629 <= D2 && D2 <= 10630 ? "Na" : D2 == 161 || D2 == 164 || 167 <= D2 && D2 <= 168 || D2 == 170 || 173 <= D2 && D2 <= 174 || 176 <= D2 && D2 <= 180 || 182 <= D2 && D2 <= 186 || 188 <= D2 && D2 <= 191 || D2 == 198 || D2 == 208 || 215 <= D2 && D2 <= 216 || 222 <= D2 && D2 <= 225 || D2 == 230 || 232 <= D2 && D2 <= 234 || 236 <= D2 && D2 <= 237 || D2 == 240 || 242 <= D2 && D2 <= 243 || 247 <= D2 && D2 <= 250 || D2 == 252 || D2 == 254 || D2 == 257 || D2 == 273 || D2 == 275 || D2 == 283 || 294 <= D2 && D2 <= 295 || D2 == 299 || 305 <= D2 && D2 <= 307 || D2 == 312 || 319 <= D2 && D2 <= 322 || D2 == 324 || 328 <= D2 && D2 <= 331 || D2 == 333 || 338 <= D2 && D2 <= 339 || 358 <= D2 && D2 <= 359 || D2 == 363 || D2 == 462 || D2 == 464 || D2 == 466 || D2 == 468 || D2 == 470 || D2 == 472 || D2 == 474 || D2 == 476 || D2 == 593 || D2 == 609 || D2 == 708 || D2 == 711 || 713 <= D2 && D2 <= 715 || D2 == 717 || D2 == 720 || 728 <= D2 && D2 <= 731 || D2 == 733 || D2 == 735 || 768 <= D2 && D2 <= 879 || 913 <= D2 && D2 <= 929 || 931 <= D2 && D2 <= 937 || 945 <= D2 && D2 <= 961 || 963 <= D2 && D2 <= 969 || D2 == 1025 || 1040 <= D2 && D2 <= 1103 || D2 == 1105 || D2 == 8208 || 8211 <= D2 && D2 <= 8214 || 8216 <= D2 && D2 <= 8217 || 8220 <= D2 && D2 <= 8221 || 8224 <= D2 && D2 <= 8226 || 8228 <= D2 && D2 <= 8231 || D2 == 8240 || 8242 <= D2 && D2 <= 8243 || D2 == 8245 || D2 == 8251 || D2 == 8254 || D2 == 8308 || D2 == 8319 || 8321 <= D2 && D2 <= 8324 || D2 == 8364 || D2 == 8451 || D2 == 8453 || D2 == 8457 || D2 == 8467 || D2 == 8470 || 8481 <= D2 && D2 <= 8482 || D2 == 8486 || D2 == 8491 || 8531 <= D2 && D2 <= 8532 || 8539 <= D2 && D2 <= 8542 || 8544 <= D2 && D2 <= 8555 || 8560 <= D2 && D2 <= 8569 || D2 == 8585 || 8592 <= D2 && D2 <= 8601 || 8632 <= D2 && D2 <= 8633 || D2 == 8658 || D2 == 8660 || D2 == 8679 || D2 == 8704 || 8706 <= D2 && D2 <= 8707 || 8711 <= D2 && D2 <= 8712 || D2 == 8715 || D2 == 8719 || D2 == 8721 || D2 == 8725 || D2 == 8730 || 8733 <= D2 && D2 <= 8736 || D2 == 8739 || D2 == 8741 || 8743 <= D2 && D2 <= 8748 || D2 == 8750 || 8756 <= D2 && D2 <= 8759 || 8764 <= D2 && D2 <= 8765 || D2 == 8776 || D2 == 8780 || D2 == 8786 || 8800 <= D2 && D2 <= 8801 || 8804 <= D2 && D2 <= 8807 || 8810 <= D2 && D2 <= 8811 || 8814 <= D2 && D2 <= 8815 || 8834 <= D2 && D2 <= 8835 || 8838 <= D2 && D2 <= 8839 || D2 == 8853 || D2 == 8857 || D2 == 8869 || D2 == 8895 || D2 == 8978 || 9312 <= D2 && D2 <= 9449 || 9451 <= D2 && D2 <= 9547 || 9552 <= D2 && D2 <= 9587 || 9600 <= D2 && D2 <= 9615 || 9618 <= D2 && D2 <= 9621 || 9632 <= D2 && D2 <= 9633 || 9635 <= D2 && D2 <= 9641 || 9650 <= D2 && D2 <= 9651 || 9654 <= D2 && D2 <= 9655 || 9660 <= D2 && D2 <= 9661 || 9664 <= D2 && D2 <= 9665 || 9670 <= D2 && D2 <= 9672 || D2 == 9675 || 9678 <= D2 && D2 <= 9681 || 9698 <= D2 && D2 <= 9701 || D2 == 9711 || 9733 <= D2 && D2 <= 9734 || D2 == 9737 || 9742 <= D2 && D2 <= 9743 || 9748 <= D2 && D2 <= 9749 || D2 == 9756 || D2 == 9758 || D2 == 9792 || D2 == 9794 || 9824 <= D2 && D2 <= 9825 || 9827 <= D2 && D2 <= 9829 || 9831 <= D2 && D2 <= 9834 || 9836 <= D2 && D2 <= 9837 || D2 == 9839 || 9886 <= D2 && D2 <= 9887 || 9918 <= D2 && D2 <= 9919 || 9924 <= D2 && D2 <= 9933 || 9935 <= D2 && D2 <= 9953 || D2 == 9955 || 9960 <= D2 && D2 <= 9983 || D2 == 10045 || D2 == 10071 || 10102 <= D2 && D2 <= 10111 || 11093 <= D2 && D2 <= 11097 || 12872 <= D2 && D2 <= 12879 || 57344 <= D2 && D2 <= 63743 || 65024 <= D2 && D2 <= 65039 || D2 == 65533 || 127232 <= D2 && D2 <= 127242 || 127248 <= D2 && D2 <= 127277 || 127280 <= D2 && D2 <= 127337 || 127344 <= D2 && D2 <= 127386 || 917760 <= D2 && D2 <= 917999 || 983040 <= D2 && D2 <= 1048573 || 1048576 <= D2 && D2 <= 1114109 ? "A" : "N";
184
+ }, u2.characterLength = function(F2) {
185
+ var s = this.eastAsianWidth(F2);
186
+ return s == "F" || s == "W" || s == "A" ? 2 : 1;
187
+ };
188
+ function t(F2) {
189
+ return F2.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
190
+ }
191
+ u2.length = function(F2) {
192
+ for (var s = t(F2), i = 0, D2 = 0; D2 < s.length; D2++) i = i + this.characterLength(s[D2]);
193
+ return i;
194
+ }, u2.slice = function(F2, s, i) {
195
+ textLen = u2.length(F2), s = s || 0, i = i || 1, s < 0 && (s = textLen + s), i < 0 && (i = textLen + i);
196
+ for (var D2 = "", C2 = 0, n = t(F2), E = 0; E < n.length; E++) {
197
+ var a = n[E], o2 = u2.length(a);
198
+ if (C2 >= s - (o2 == 2 ? 1 : 0)) if (C2 + o2 <= i) D2 += a;
199
+ else break;
200
+ C2 += o2;
201
+ }
202
+ return D2;
203
+ };
204
+ })(W);
205
+ var tD = W.exports;
206
+ var eD = L(tD);
207
+ var FD = function() {
208
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
209
+ };
210
+ var sD = L(FD);
211
+ function p(e2, u2 = {}) {
212
+ if (typeof e2 != "string" || e2.length === 0 || (u2 = { ambiguousIsNarrow: true, ...u2 }, e2 = P(e2), e2.length === 0)) return 0;
213
+ e2 = e2.replace(sD(), " ");
214
+ const t = u2.ambiguousIsNarrow ? 1 : 2;
215
+ let F2 = 0;
216
+ for (const s of e2) {
217
+ const i = s.codePointAt(0);
218
+ if (i <= 31 || i >= 127 && i <= 159 || i >= 768 && i <= 879) continue;
219
+ switch (eD.eastAsianWidth(s)) {
220
+ case "F":
221
+ case "W":
222
+ F2 += 2;
223
+ break;
224
+ case "A":
225
+ F2 += t;
226
+ break;
227
+ default:
228
+ F2 += 1;
229
+ }
230
+ }
231
+ return F2;
232
+ }
233
+ var w = 10;
234
+ var N = (e2 = 0) => (u2) => `\x1B[${u2 + e2}m`;
235
+ var I = (e2 = 0) => (u2) => `\x1B[${38 + e2};5;${u2}m`;
236
+ var R = (e2 = 0) => (u2, t, F2) => `\x1B[${38 + e2};2;${u2};${t};${F2}m`;
237
+ var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], inverse: [7, 27], hidden: [8, 28], strikethrough: [9, 29] }, color: { black: [30, 39], red: [31, 39], green: [32, 39], yellow: [33, 39], blue: [34, 39], magenta: [35, 39], cyan: [36, 39], white: [37, 39], blackBright: [90, 39], gray: [90, 39], grey: [90, 39], redBright: [91, 39], greenBright: [92, 39], yellowBright: [93, 39], blueBright: [94, 39], magentaBright: [95, 39], cyanBright: [96, 39], whiteBright: [97, 39] }, bgColor: { bgBlack: [40, 49], bgRed: [41, 49], bgGreen: [42, 49], bgYellow: [43, 49], bgBlue: [44, 49], bgMagenta: [45, 49], bgCyan: [46, 49], bgWhite: [47, 49], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } };
238
+ Object.keys(r.modifier);
239
+ var iD = Object.keys(r.color);
240
+ var CD = Object.keys(r.bgColor);
241
+ [...iD, ...CD];
242
+ function rD() {
243
+ const e2 = /* @__PURE__ */ new Map();
244
+ for (const [u2, t] of Object.entries(r)) {
245
+ for (const [F2, s] of Object.entries(t)) r[F2] = { open: `\x1B[${s[0]}m`, close: `\x1B[${s[1]}m` }, t[F2] = r[F2], e2.set(s[0], s[1]);
246
+ Object.defineProperty(r, u2, { value: t, enumerable: false });
247
+ }
248
+ return Object.defineProperty(r, "codes", { value: e2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = N(), r.color.ansi256 = I(), r.color.ansi16m = R(), r.bgColor.ansi = N(w), r.bgColor.ansi256 = I(w), r.bgColor.ansi16m = R(w), Object.defineProperties(r, { rgbToAnsi256: { value: (u2, t, F2) => u2 === t && t === F2 ? u2 < 8 ? 16 : u2 > 248 ? 231 : Math.round((u2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u2 / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(F2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u2) => {
249
+ const t = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u2.toString(16));
250
+ if (!t) return [0, 0, 0];
251
+ let [F2] = t;
252
+ F2.length === 3 && (F2 = [...F2].map((i) => i + i).join(""));
253
+ const s = Number.parseInt(F2, 16);
254
+ return [s >> 16 & 255, s >> 8 & 255, s & 255];
255
+ }, enumerable: false }, hexToAnsi256: { value: (u2) => r.rgbToAnsi256(...r.hexToRgb(u2)), enumerable: false }, ansi256ToAnsi: { value: (u2) => {
256
+ if (u2 < 8) return 30 + u2;
257
+ if (u2 < 16) return 90 + (u2 - 8);
258
+ let t, F2, s;
259
+ if (u2 >= 232) t = ((u2 - 232) * 10 + 8) / 255, F2 = t, s = t;
260
+ else {
261
+ u2 -= 16;
262
+ const C2 = u2 % 36;
263
+ t = Math.floor(u2 / 36) / 5, F2 = Math.floor(C2 / 6) / 5, s = C2 % 6 / 5;
264
+ }
265
+ const i = Math.max(t, F2, s) * 2;
266
+ if (i === 0) return 30;
267
+ let D2 = 30 + (Math.round(s) << 2 | Math.round(F2) << 1 | Math.round(t));
268
+ return i === 2 && (D2 += 60), D2;
269
+ }, enumerable: false }, rgbToAnsi: { value: (u2, t, F2) => r.ansi256ToAnsi(r.rgbToAnsi256(u2, t, F2)), enumerable: false }, hexToAnsi: { value: (u2) => r.ansi256ToAnsi(r.hexToAnsi256(u2)), enumerable: false } }), r;
270
+ }
271
+ var ED = rD();
272
+ var d = /* @__PURE__ */ new Set(["\x1B", "\x9B"]);
273
+ var oD = 39;
274
+ var y = "\x07";
275
+ var V = "[";
276
+ var nD = "]";
277
+ var G = "m";
278
+ var _ = `${nD}8;;`;
279
+ var z = (e2) => `${d.values().next().value}${V}${e2}${G}`;
280
+ var K = (e2) => `${d.values().next().value}${_}${e2}${y}`;
281
+ var aD = (e2) => e2.split(" ").map((u2) => p(u2));
282
+ var k = (e2, u2, t) => {
283
+ const F2 = [...u2];
284
+ let s = false, i = false, D2 = p(P(e2[e2.length - 1]));
285
+ for (const [C2, n] of F2.entries()) {
286
+ const E = p(n);
287
+ if (D2 + E <= t ? e2[e2.length - 1] += n : (e2.push(n), D2 = 0), d.has(n) && (s = true, i = F2.slice(C2 + 1).join("").startsWith(_)), s) {
288
+ i ? n === y && (s = false, i = false) : n === G && (s = false);
289
+ continue;
290
+ }
291
+ D2 += E, D2 === t && C2 < F2.length - 1 && (e2.push(""), D2 = 0);
292
+ }
293
+ !D2 && e2[e2.length - 1].length > 0 && e2.length > 1 && (e2[e2.length - 2] += e2.pop());
294
+ };
295
+ var hD = (e2) => {
296
+ const u2 = e2.split(" ");
297
+ let t = u2.length;
298
+ for (; t > 0 && !(p(u2[t - 1]) > 0); ) t--;
299
+ return t === u2.length ? e2 : u2.slice(0, t).join(" ") + u2.slice(t).join("");
300
+ };
301
+ var lD = (e2, u2, t = {}) => {
302
+ if (t.trim !== false && e2.trim() === "") return "";
303
+ let F2 = "", s, i;
304
+ const D2 = aD(e2);
305
+ let C2 = [""];
306
+ for (const [E, a] of e2.split(" ").entries()) {
307
+ t.trim !== false && (C2[C2.length - 1] = C2[C2.length - 1].trimStart());
308
+ let o2 = p(C2[C2.length - 1]);
309
+ if (E !== 0 && (o2 >= u2 && (t.wordWrap === false || t.trim === false) && (C2.push(""), o2 = 0), (o2 > 0 || t.trim === false) && (C2[C2.length - 1] += " ", o2++)), t.hard && D2[E] > u2) {
310
+ const c = u2 - o2, f = 1 + Math.floor((D2[E] - c - 1) / u2);
311
+ Math.floor((D2[E] - 1) / u2) < f && C2.push(""), k(C2, a, u2);
312
+ continue;
313
+ }
314
+ if (o2 + D2[E] > u2 && o2 > 0 && D2[E] > 0) {
315
+ if (t.wordWrap === false && o2 < u2) {
316
+ k(C2, a, u2);
317
+ continue;
318
+ }
319
+ C2.push("");
320
+ }
321
+ if (o2 + D2[E] > u2 && t.wordWrap === false) {
322
+ k(C2, a, u2);
323
+ continue;
324
+ }
325
+ C2[C2.length - 1] += a;
326
+ }
327
+ t.trim !== false && (C2 = C2.map((E) => hD(E)));
328
+ const n = [...C2.join(`
329
+ `)];
330
+ for (const [E, a] of n.entries()) {
331
+ if (F2 += a, d.has(a)) {
332
+ const { groups: c } = new RegExp(`(?:\\${V}(?<code>\\d+)m|\\${_}(?<uri>.*)${y})`).exec(n.slice(E).join("")) || { groups: {} };
333
+ if (c.code !== void 0) {
334
+ const f = Number.parseFloat(c.code);
335
+ s = f === oD ? void 0 : f;
336
+ } else c.uri !== void 0 && (i = c.uri.length === 0 ? void 0 : c.uri);
337
+ }
338
+ const o2 = ED.codes.get(Number(s));
339
+ n[E + 1] === `
340
+ ` ? (i && (F2 += K("")), s && o2 && (F2 += z(o2))) : a === `
341
+ ` && (s && o2 && (F2 += z(s)), i && (F2 += K(i)));
342
+ }
343
+ return F2;
344
+ };
345
+ function Y(e2, u2, t) {
346
+ return String(e2).normalize().replace(/\r\n/g, `
347
+ `).split(`
348
+ `).map((F2) => lD(F2, u2, t)).join(`
349
+ `);
350
+ }
351
+ var xD = ["up", "down", "left", "right", "space", "enter", "cancel"];
352
+ var B = { actions: new Set(xD), aliases: /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"], ["", "cancel"], ["escape", "cancel"]]) };
353
+ function $(e2, u2) {
354
+ if (typeof e2 == "string") return B.aliases.get(e2) === u2;
355
+ for (const t of e2) if (t !== void 0 && $(t, u2)) return true;
356
+ return false;
357
+ }
358
+ function BD(e2, u2) {
359
+ if (e2 === u2) return;
360
+ const t = e2.split(`
361
+ `), F2 = u2.split(`
362
+ `), s = [];
363
+ for (let i = 0; i < Math.max(t.length, F2.length); i++) t[i] !== F2[i] && s.push(i);
364
+ return s;
365
+ }
366
+ var AD = globalThis.process.platform.startsWith("win");
367
+ var S = Symbol("clack:cancel");
368
+ function pD(e2) {
369
+ return e2 === S;
370
+ }
371
+ function m(e2, u2) {
372
+ const t = e2;
373
+ t.isTTY && t.setRawMode(u2);
374
+ }
375
+ function fD({ input: e2 = j, output: u2 = M, overwrite: t = true, hideCursor: F2 = true } = {}) {
376
+ const s = g.createInterface({ input: e2, output: u2, prompt: "", tabSize: 1 });
377
+ g.emitKeypressEvents(e2, s), e2.isTTY && e2.setRawMode(true);
378
+ const i = (D2, { name: C2, sequence: n }) => {
379
+ const E = String(D2);
380
+ if ($([E, C2, n], "cancel")) {
381
+ F2 && u2.write(import_sisteransi.cursor.show), process.exit(0);
382
+ return;
383
+ }
384
+ if (!t) return;
385
+ const a = C2 === "return" ? 0 : -1, o2 = C2 === "return" ? -1 : 0;
386
+ g.moveCursor(u2, a, o2, () => {
387
+ g.clearLine(u2, 1, () => {
388
+ e2.once("keypress", i);
389
+ });
390
+ });
391
+ };
392
+ return F2 && u2.write(import_sisteransi.cursor.hide), e2.once("keypress", i), () => {
393
+ e2.off("keypress", i), F2 && u2.write(import_sisteransi.cursor.show), e2.isTTY && !AD && e2.setRawMode(false), s.terminal = false, s.close();
394
+ };
395
+ }
396
+ var gD = Object.defineProperty;
397
+ var vD = (e2, u2, t) => u2 in e2 ? gD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
398
+ var h = (e2, u2, t) => (vD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
399
+ var x = class {
400
+ constructor(u2, t = true) {
401
+ h(this, "input"), h(this, "output"), h(this, "_abortSignal"), h(this, "rl"), h(this, "opts"), h(this, "_render"), h(this, "_track", false), h(this, "_prevFrame", ""), h(this, "_subscribers", /* @__PURE__ */ new Map()), h(this, "_cursor", 0), h(this, "state", "initial"), h(this, "error", ""), h(this, "value");
402
+ const { input: F2 = j, output: s = M, render: i, signal: D2, ...C2 } = u2;
403
+ this.opts = C2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = i.bind(this), this._track = t, this._abortSignal = D2, this.input = F2, this.output = s;
404
+ }
405
+ unsubscribe() {
406
+ this._subscribers.clear();
407
+ }
408
+ setSubscriber(u2, t) {
409
+ const F2 = this._subscribers.get(u2) ?? [];
410
+ F2.push(t), this._subscribers.set(u2, F2);
411
+ }
412
+ on(u2, t) {
413
+ this.setSubscriber(u2, { cb: t });
414
+ }
415
+ once(u2, t) {
416
+ this.setSubscriber(u2, { cb: t, once: true });
417
+ }
418
+ emit(u2, ...t) {
419
+ const F2 = this._subscribers.get(u2) ?? [], s = [];
420
+ for (const i of F2) i.cb(...t), i.once && s.push(() => F2.splice(F2.indexOf(i), 1));
421
+ for (const i of s) i();
422
+ }
423
+ prompt() {
424
+ return new Promise((u2, t) => {
425
+ if (this._abortSignal) {
426
+ if (this._abortSignal.aborted) return this.state = "cancel", this.close(), u2(S);
427
+ this._abortSignal.addEventListener("abort", () => {
428
+ this.state = "cancel", this.close();
429
+ }, { once: true });
430
+ }
431
+ const F2 = new X();
432
+ F2._write = (s, i, D2) => {
433
+ this._track && (this.value = this.rl?.line.replace(/\t/g, ""), this._cursor = this.rl?.cursor ?? 0, this.emit("value", this.value)), D2();
434
+ }, this.input.pipe(F2), this.rl = O.createInterface({ input: this.input, output: F2, tabSize: 2, prompt: "", escapeCodeTimeout: 50, terminal: true }), O.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), m(this.input, true), this.output.on("resize", this.render), this.render(), this.once("submit", () => {
435
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(this.value);
436
+ }), this.once("cancel", () => {
437
+ this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), m(this.input, false), u2(S);
438
+ });
439
+ });
440
+ }
441
+ onKeypress(u2, t) {
442
+ if (this.state === "error" && (this.state = "active"), t?.name && (!this._track && B.aliases.has(t.name) && this.emit("cursor", B.aliases.get(t.name)), B.actions.has(t.name) && this.emit("cursor", t.name)), u2 && (u2.toLowerCase() === "y" || u2.toLowerCase() === "n") && this.emit("confirm", u2.toLowerCase() === "y"), u2 === " " && this.opts.placeholder && (this.value || (this.rl?.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u2 && this.emit("key", u2.toLowerCase()), t?.name === "return") {
443
+ if (this.opts.validate) {
444
+ const F2 = this.opts.validate(this.value);
445
+ F2 && (this.error = F2 instanceof Error ? F2.message : F2, this.state = "error", this.rl?.write(this.value));
446
+ }
447
+ this.state !== "error" && (this.state = "submit");
448
+ }
449
+ $([u2, t?.name, t?.sequence], "cancel") && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close();
450
+ }
451
+ close() {
452
+ this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(`
453
+ `), m(this.input, false), this.rl?.close(), this.rl = void 0, this.emit(`${this.state}`, this.value), this.unsubscribe();
454
+ }
455
+ restoreCursor() {
456
+ const u2 = Y(this._prevFrame, process.stdout.columns, { hard: true }).split(`
457
+ `).length - 1;
458
+ this.output.write(import_sisteransi.cursor.move(-999, u2 * -1));
459
+ }
460
+ render() {
461
+ const u2 = Y(this._render(this) ?? "", process.stdout.columns, { hard: true });
462
+ if (u2 !== this._prevFrame) {
463
+ if (this.state === "initial") this.output.write(import_sisteransi.cursor.hide);
464
+ else {
465
+ const t = BD(this._prevFrame, u2);
466
+ if (this.restoreCursor(), t && t?.length === 1) {
467
+ const F2 = t[0];
468
+ this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.lines(1));
469
+ const s = u2.split(`
470
+ `);
471
+ this.output.write(s[F2]), this._prevFrame = u2, this.output.write(import_sisteransi.cursor.move(0, s.length - F2 - 1));
472
+ return;
473
+ }
474
+ if (t && t?.length > 1) {
475
+ const F2 = t[0];
476
+ this.output.write(import_sisteransi.cursor.move(0, F2)), this.output.write(import_sisteransi.erase.down());
477
+ const s = u2.split(`
478
+ `).slice(F2);
479
+ this.output.write(s.join(`
480
+ `)), this._prevFrame = u2;
481
+ return;
482
+ }
483
+ this.output.write(import_sisteransi.erase.down());
484
+ }
485
+ this.output.write(u2), this.state === "initial" && (this.state = "active"), this._prevFrame = u2;
486
+ }
487
+ }
488
+ };
489
+ var dD = class extends x {
490
+ get cursor() {
491
+ return this.value ? 0 : 1;
492
+ }
493
+ get _value() {
494
+ return this.cursor === 0;
495
+ }
496
+ constructor(u2) {
497
+ super(u2, false), this.value = !!u2.initialValue, this.on("value", () => {
498
+ this.value = this._value;
499
+ }), this.on("confirm", (t) => {
500
+ this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
501
+ }), this.on("cursor", () => {
502
+ this.value = !this.value;
503
+ });
504
+ }
505
+ };
506
+ var A;
507
+ A = /* @__PURE__ */ new WeakMap();
508
+ var OD = Object.defineProperty;
509
+ var PD = (e2, u2, t) => u2 in e2 ? OD(e2, u2, { enumerable: true, configurable: true, writable: true, value: t }) : e2[u2] = t;
510
+ var J = (e2, u2, t) => (PD(e2, typeof u2 != "symbol" ? u2 + "" : u2, t), t);
511
+ var LD = class extends x {
512
+ constructor(u2) {
513
+ super(u2, false), J(this, "options"), J(this, "cursor", 0), this.options = u2.options, this.cursor = this.options.findIndex(({ value: t }) => t === u2.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
514
+ switch (t) {
515
+ case "left":
516
+ case "up":
517
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
518
+ break;
519
+ case "down":
520
+ case "right":
521
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
522
+ break;
523
+ }
524
+ this.changeValue();
525
+ });
526
+ }
527
+ get _value() {
528
+ return this.options[this.cursor];
529
+ }
530
+ changeValue() {
531
+ this.value = this._value.value;
532
+ }
533
+ };
534
+ var RD = class extends x {
535
+ get valueWithCursor() {
536
+ if (this.state === "submit") return this.value;
537
+ if (this.cursor >= this.value.length) return `${this.value}\u2588`;
538
+ const u2 = this.value.slice(0, this.cursor), [t, ...F2] = this.value.slice(this.cursor);
539
+ return `${u2}${import_picocolors.default.inverse(t)}${F2.join("")}`;
540
+ }
541
+ get cursor() {
542
+ return this._cursor;
543
+ }
544
+ constructor(u2) {
545
+ super(u2), this.on("finalize", () => {
546
+ this.value || (this.value = u2.defaultValue);
547
+ });
548
+ }
549
+ };
550
+
551
+ // ../../node_modules/.pnpm/@clack+prompts@0.11.0/node_modules/@clack/prompts/dist/index.mjs
552
+ var import_picocolors2 = __toESM(require_picocolors(), 1);
553
+ var import_sisteransi2 = __toESM(require_src(), 1);
554
+ import y2 from "node:process";
555
+ function ce() {
556
+ return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
557
+ }
558
+ var V2 = ce();
559
+ var u = (t, n) => V2 ? t : n;
560
+ var le = u("\u25C6", "*");
561
+ var L2 = u("\u25A0", "x");
562
+ var W2 = u("\u25B2", "x");
563
+ var C = u("\u25C7", "o");
564
+ var ue = u("\u250C", "T");
565
+ var o = u("\u2502", "|");
566
+ var d2 = u("\u2514", "\u2014");
567
+ var k2 = u("\u25CF", ">");
568
+ var P2 = u("\u25CB", " ");
569
+ var A2 = u("\u25FB", "[\u2022]");
570
+ var T = u("\u25FC", "[+]");
571
+ var F = u("\u25FB", "[ ]");
572
+ var $e = u("\u25AA", "\u2022");
573
+ var _2 = u("\u2500", "-");
574
+ var me = u("\u256E", "+");
575
+ var de = u("\u251C", "+");
576
+ var pe = u("\u256F", "+");
577
+ var q = u("\u25CF", "\u2022");
578
+ var D = u("\u25C6", "*");
579
+ var U = u("\u25B2", "!");
580
+ var K2 = u("\u25A0", "x");
581
+ var b2 = (t) => {
582
+ switch (t) {
583
+ case "initial":
584
+ case "active":
585
+ return import_picocolors2.default.cyan(le);
586
+ case "cancel":
587
+ return import_picocolors2.default.red(L2);
588
+ case "error":
589
+ return import_picocolors2.default.yellow(W2);
590
+ case "submit":
591
+ return import_picocolors2.default.green(C);
592
+ }
593
+ };
594
+ var G2 = (t) => {
595
+ const { cursor: n, options: r2, style: i } = t, s = t.maxItems ?? Number.POSITIVE_INFINITY, c = Math.max(process.stdout.rows - 4, 0), a = Math.min(c, Math.max(s, 5));
596
+ let l2 = 0;
597
+ n >= l2 + a - 3 ? l2 = Math.max(Math.min(n - a + 3, r2.length - a), 0) : n < l2 + 2 && (l2 = Math.max(n - 2, 0));
598
+ const $2 = a < r2.length && l2 > 0, g2 = a < r2.length && l2 + a < r2.length;
599
+ return r2.slice(l2, l2 + a).map((p2, v2, f) => {
600
+ const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
601
+ return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
602
+ });
603
+ };
604
+ var he = (t) => new RD({ validate: t.validate, placeholder: t.placeholder, defaultValue: t.defaultValue, initialValue: t.initialValue, render() {
605
+ const n = `${import_picocolors2.default.gray(o)}
606
+ ${b2(this.state)} ${t.message}
607
+ `, r2 = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
608
+ switch (this.state) {
609
+ case "error":
610
+ return `${n.trim()}
611
+ ${import_picocolors2.default.yellow(o)} ${i}
612
+ ${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
613
+ `;
614
+ case "submit":
615
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
616
+ case "cancel":
617
+ return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
618
+ ${import_picocolors2.default.gray(o)}` : ""}`;
619
+ default:
620
+ return `${n}${import_picocolors2.default.cyan(o)} ${i}
621
+ ${import_picocolors2.default.cyan(d2)}
622
+ `;
623
+ }
624
+ } }).prompt();
625
+ var ye = (t) => {
626
+ const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
627
+ return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
628
+ const i = `${import_picocolors2.default.gray(o)}
629
+ ${b2(this.state)} ${t.message}
630
+ `, s = this.value ? n : r2;
631
+ switch (this.state) {
632
+ case "submit":
633
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
634
+ case "cancel":
635
+ return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
636
+ ${import_picocolors2.default.gray(o)}`;
637
+ default:
638
+ return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.green(k2)} ${r2}`}
639
+ ${import_picocolors2.default.cyan(d2)}
640
+ `;
641
+ }
642
+ } }).prompt();
643
+ };
644
+ var ve = (t) => {
645
+ const n = (r2, i) => {
646
+ const s = r2.label ?? String(r2.value);
647
+ switch (i) {
648
+ case "selected":
649
+ return `${import_picocolors2.default.dim(s)}`;
650
+ case "active":
651
+ return `${import_picocolors2.default.green(k2)} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}`;
652
+ case "cancelled":
653
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
654
+ default:
655
+ return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
656
+ }
657
+ };
658
+ return new LD({ options: t.options, initialValue: t.initialValue, render() {
659
+ const r2 = `${import_picocolors2.default.gray(o)}
660
+ ${b2(this.state)} ${t.message}
661
+ `;
662
+ switch (this.state) {
663
+ case "submit":
664
+ return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
665
+ case "cancel":
666
+ return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
667
+ ${import_picocolors2.default.gray(o)}`;
668
+ default:
669
+ return `${r2}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
670
+ ${import_picocolors2.default.cyan(o)} `)}
671
+ ${import_picocolors2.default.cyan(d2)}
672
+ `;
673
+ }
674
+ } }).prompt();
675
+ };
676
+ var Me = (t = "", n = "") => {
677
+ const r2 = `
678
+ ${t}
679
+ `.split(`
680
+ `), i = S2(n).length, s = Math.max(r2.reduce((a, l2) => {
681
+ const $2 = S2(l2);
682
+ return $2.length > a ? $2.length : a;
683
+ }, 0), i) + 2, c = r2.map((a) => `${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(a)}${" ".repeat(s - S2(a).length)}${import_picocolors2.default.gray(o)}`).join(`
684
+ `);
685
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
686
+ ${import_picocolors2.default.green(C)} ${import_picocolors2.default.reset(n)} ${import_picocolors2.default.gray(_2.repeat(Math.max(s - i - 1, 1)) + me)}
687
+ ${c}
688
+ ${import_picocolors2.default.gray(de + _2.repeat(s + 2) + pe)}
689
+ `);
690
+ };
691
+ var xe = (t = "") => {
692
+ process.stdout.write(`${import_picocolors2.default.gray(d2)} ${import_picocolors2.default.red(t)}
693
+
694
+ `);
695
+ };
696
+ var Ie = (t = "") => {
697
+ process.stdout.write(`${import_picocolors2.default.gray(ue)} ${t}
698
+ `);
699
+ };
700
+ var Se = (t = "") => {
701
+ process.stdout.write(`${import_picocolors2.default.gray(o)}
702
+ ${import_picocolors2.default.gray(d2)} ${t}
703
+
704
+ `);
705
+ };
706
+ var M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
707
+ const r2 = [`${import_picocolors2.default.gray(o)}`];
708
+ if (t) {
709
+ const [i, ...s] = t.split(`
710
+ `);
711
+ r2.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
712
+ }
713
+ process.stdout.write(`${r2.join(`
714
+ `)}
715
+ `);
716
+ }, info: (t) => {
717
+ M2.message(t, { symbol: import_picocolors2.default.blue(q) });
718
+ }, success: (t) => {
719
+ M2.message(t, { symbol: import_picocolors2.default.green(D) });
720
+ }, step: (t) => {
721
+ M2.message(t, { symbol: import_picocolors2.default.green(C) });
722
+ }, warn: (t) => {
723
+ M2.message(t, { symbol: import_picocolors2.default.yellow(U) });
724
+ }, warning: (t) => {
725
+ M2.warn(t);
726
+ }, error: (t) => {
727
+ M2.message(t, { symbol: import_picocolors2.default.red(K2) });
728
+ } };
729
+ var J2 = `${import_picocolors2.default.gray(o)} `;
730
+ var Y2 = ({ indicator: t = "dots" } = {}) => {
731
+ const n = V2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
732
+ let s, c, a = false, l2 = "", $2, g2 = performance.now();
733
+ const p2 = (m2) => {
734
+ const h2 = m2 > 1 ? "Something went wrong" : "Canceled";
735
+ a && N2(h2, m2);
736
+ }, v2 = () => p2(2), f = () => p2(1), j2 = () => {
737
+ process.on("uncaughtExceptionMonitor", v2), process.on("unhandledRejection", v2), process.on("SIGINT", f), process.on("SIGTERM", f), process.on("exit", p2);
738
+ }, E = () => {
739
+ process.removeListener("uncaughtExceptionMonitor", v2), process.removeListener("unhandledRejection", v2), process.removeListener("SIGINT", f), process.removeListener("SIGTERM", f), process.removeListener("exit", p2);
740
+ }, B2 = () => {
741
+ if ($2 === void 0) return;
742
+ i && process.stdout.write(`
743
+ `);
744
+ const m2 = $2.split(`
745
+ `);
746
+ process.stdout.write(import_sisteransi2.cursor.move(-999, m2.length - 1)), process.stdout.write(import_sisteransi2.erase.down(m2.length));
747
+ }, R2 = (m2) => m2.replace(/\.+$/, ""), O2 = (m2) => {
748
+ const h2 = (performance.now() - m2) / 1e3, w2 = Math.floor(h2 / 60), I2 = Math.floor(h2 % 60);
749
+ return w2 > 0 ? `[${w2}m ${I2}s]` : `[${I2}s]`;
750
+ }, H = (m2 = "") => {
751
+ a = true, s = fD(), l2 = R2(m2), g2 = performance.now(), process.stdout.write(`${import_picocolors2.default.gray(o)}
752
+ `);
753
+ let h2 = 0, w2 = 0;
754
+ j2(), c = setInterval(() => {
755
+ if (i && l2 === $2) return;
756
+ B2(), $2 = l2;
757
+ const I2 = import_picocolors2.default.magenta(n[h2]);
758
+ if (i) process.stdout.write(`${I2} ${l2}...`);
759
+ else if (t === "timer") process.stdout.write(`${I2} ${l2} ${O2(g2)}`);
760
+ else {
761
+ const z2 = ".".repeat(Math.floor(w2)).slice(0, 3);
762
+ process.stdout.write(`${I2} ${l2}${z2}`);
763
+ }
764
+ h2 = h2 + 1 < n.length ? h2 + 1 : 0, w2 = w2 < n.length ? w2 + 0.125 : 0;
765
+ }, r2);
766
+ }, N2 = (m2 = "", h2 = 0) => {
767
+ a = false, clearInterval(c), B2();
768
+ const w2 = h2 === 0 ? import_picocolors2.default.green(C) : h2 === 1 ? import_picocolors2.default.red(L2) : import_picocolors2.default.red(W2);
769
+ l2 = R2(m2 ?? l2), t === "timer" ? process.stdout.write(`${w2} ${l2} ${O2(g2)}
770
+ `) : process.stdout.write(`${w2} ${l2}
771
+ `), E(), s();
772
+ };
773
+ return { start: H, stop: N2, message: (m2 = "") => {
774
+ l2 = R2(m2 ?? l2);
775
+ } };
776
+ };
777
+
778
+ // src/index.ts
779
+ import { existsSync as existsSync2 } from "node:fs";
780
+ import { delimiter, join as join2, relative as relative2, resolve as resolve2 } from "node:path";
781
+
782
+ // src/scaffold.ts
783
+ import { existsSync } from "node:fs";
784
+ import { cp, readFile, rm, writeFile } from "node:fs/promises";
785
+ import { createRequire } from "node:module";
786
+ import { dirname, isAbsolute, join, relative, resolve } from "node:path";
787
+ import { fileURLToPath } from "node:url";
788
+ var require2 = createRequire(import.meta.url);
789
+ var HERE = dirname(fileURLToPath(import.meta.url));
790
+ var WORKSPACE_ROOT = join(HERE, "..", "..", "..");
791
+ var ORIGIN_PLACEHOLDER = "astrale-domain.example.dev";
792
+ var LINK_TARGETS = {
793
+ "@astrale-os/sdk": "sdk",
794
+ "@astrale-os/devkit": "sdk/devkit",
795
+ "@astrale-os/adapter-cloudflare": "sdk/adapter-cloudflare",
796
+ "@astrale-os/kernel-core": "kernel/core",
797
+ "@astrale-os/kernel-dsl": "kernel/dsl"
798
+ };
799
+ var ADAPTER_PACKAGES = {
800
+ cloudflare: "@astrale-os/adapter-cloudflare"
801
+ };
802
+ function templateDir(adapter) {
803
+ const pkg = ADAPTER_PACKAGES[adapter];
804
+ if (!pkg) throw new Error(`No template package registered for adapter "${adapter}".`);
805
+ return join(dirname(require2.resolve(`${pkg}/package.json`)), "template");
806
+ }
807
+ async function scaffold(opts) {
808
+ const src = templateDir(opts.adapter);
809
+ if (!existsSync(src)) {
810
+ throw new Error(`Template not found at ${src}.`);
811
+ }
812
+ if (existsSync(opts.dir)) {
813
+ assertSafeToDelete(opts.dir);
814
+ await rm(opts.dir, { recursive: true, force: true });
815
+ }
816
+ await cp(src, opts.dir, {
817
+ recursive: true,
818
+ filter: (s) => !/\/(node_modules|\.astrale|dist-client|\.wrangler)(\/|$)/.test(s)
819
+ });
820
+ await stampOrigin(opts.dir, opts.origin);
821
+ await rewritePackageJson(opts.dir, opts.name, opts.link);
822
+ if (opts.template === "blank") await blankOut(opts.dir, opts.origin);
823
+ }
824
+ function assertSafeToDelete(dir) {
825
+ const target = resolve(dir);
826
+ const rel = relative(target, resolve(process.cwd()));
827
+ if (rel === "" || !rel.startsWith("..") && !isAbsolute(rel)) {
828
+ throw new Error(
829
+ `Refusing to delete ${target}: it is the current working directory or an ancestor of it. Pick a fresh --dir (e.g. a new subfolder), not "." or an existing parent.`
830
+ );
831
+ }
832
+ }
833
+ async function stampOrigin(dir, origin) {
834
+ const schemaIndex = join(dir, "schema", "index.ts");
835
+ await replaceInFile(schemaIndex, ORIGIN_PLACEHOLDER, origin);
836
+ const config = join(dir, "astrale.config.ts");
837
+ await replaceInFile(config, ORIGIN_PLACEHOLDER, origin);
838
+ }
839
+ async function rewritePackageJson(dir, name, link) {
840
+ const path = join(dir, "package.json");
841
+ const pkg = JSON.parse(await readFile(path, "utf-8"));
842
+ pkg.name = name;
843
+ if (link && pkg.dependencies) {
844
+ for (const [dep, rel] of Object.entries(LINK_TARGETS)) {
845
+ if (dep in pkg.dependencies) {
846
+ pkg.dependencies[dep] = `link:${join(WORKSPACE_ROOT, rel)}`;
847
+ }
848
+ }
849
+ pkg.pnpm = {
850
+ ...pkg.pnpm,
851
+ overrides: {
852
+ ...pkg.pnpm?.overrides,
853
+ zod: `link:${join(WORKSPACE_ROOT, "sdk", "node_modules", "zod")}`
854
+ }
855
+ };
856
+ }
857
+ await writeFile(path, JSON.stringify(pkg, null, 2) + "\n");
858
+ }
859
+ async function blankOut(dir, origin) {
860
+ await writeFile(
861
+ join(dir, "schema", "note.ts"),
862
+ `// Author your classes/interfaces here, then register them in schema/index.ts.
863
+ export {}
864
+ `
865
+ );
866
+ await writeFile(
867
+ join(dir, "schema", "index.ts"),
868
+ `import { defineSchema, KernelSchema } from '@astrale-os/kernel-core'
869
+
870
+ export const schema = defineSchema('${origin}', {
871
+ imports: [KernelSchema],
872
+ })
873
+ `
874
+ );
875
+ await writeFile(
876
+ join(dir, "methods", "index.ts"),
877
+ `import type { SchemaMethodsImpl } from '@astrale-os/sdk'
878
+
879
+ import type { Env } from '../env'
880
+ import { schema } from '../schema'
881
+
882
+ export const methods: SchemaMethodsImpl<typeof schema, Env> = {}
883
+ `
884
+ );
885
+ await writeFile(join(dir, "functions", "index.ts"), `export const functions = {}
886
+ `);
887
+ await writeFile(join(dir, "views", "index.ts"), `export const views = {}
888
+ `);
889
+ await rm(join(dir, "schema", "compiled.ts"), { force: true });
890
+ await rm(join(dir, "methods", "note.ts"), { force: true });
891
+ await rm(join(dir, "functions", "seed.ts"), { force: true });
892
+ await rm(join(dir, "views", "welcome.ts"), { force: true });
893
+ await rm(join(dir, "views", "note.ts"), { force: true });
894
+ await replaceInFile(
895
+ join(dir, "astrale.config.ts"),
896
+ /\n\s*postInstall: `\/:\$\{schema\.domain\}:class\.Note:seed`,/,
897
+ ""
898
+ );
899
+ }
900
+ async function replaceInFile(path, from, to) {
901
+ if (!existsSync(path)) return;
902
+ const text = await readFile(path, "utf-8");
903
+ const next = typeof from === "string" ? text.split(from).join(to) : text.replace(from, to);
904
+ if (next !== text) await writeFile(path, next);
905
+ }
906
+ function workspaceAvailable() {
907
+ return existsSync(join(WORKSPACE_ROOT, "sdk", "devkit", "package.json"));
908
+ }
909
+
910
+ // src/index.ts
911
+ var PMS = ["pnpm", "npm", "yarn", "bun"];
912
+ var DLX = {
913
+ pnpm: "pnpm dlx",
914
+ npm: "npx",
915
+ yarn: "yarn dlx",
916
+ bun: "bunx"
917
+ };
918
+ var ADAPTERS = [
919
+ {
920
+ value: "astrale-host",
921
+ label: "Astrale Worker",
922
+ hint: "deployed under /service on an Astrale host (soon)",
923
+ enabled: false
924
+ },
925
+ {
926
+ value: "cloudflare",
927
+ label: "Cloudflare Worker",
928
+ hint: "standalone worker (*.workers.dev / custom domain)",
929
+ enabled: true
930
+ },
931
+ { value: "custom", label: "Custom", hint: "bring your own adapter (soon)", enabled: false }
932
+ ];
933
+ async function main() {
934
+ const argv = process.argv.slice(2);
935
+ const flags = parseFlags(argv);
936
+ if (flags.help) {
937
+ printHelp();
938
+ return 0;
939
+ }
940
+ const headless = flags.yes || !process.stdin.isTTY;
941
+ Ie("Astrale \u2014 new domain");
942
+ let slug = flags.positional[0];
943
+ if (!slug) {
944
+ if (headless) {
945
+ xe("A domain slug is required in non-interactive mode (pass it as the first argument).");
946
+ return 1;
947
+ }
948
+ const answer = await he({
949
+ message: "Domain name (slug)",
950
+ placeholder: "crm",
951
+ validate: (v2) => isValidSlug(v2) ? void 0 : "Use lowercase letters, digits, dots and dashes."
952
+ });
953
+ if (pD(answer)) return bail();
954
+ slug = answer;
955
+ }
956
+ if (!isValidSlug(slug)) {
957
+ xe(`Invalid slug "${slug}". Use lowercase letters, digits, dots and dashes.`);
958
+ return 1;
959
+ }
960
+ let adapter = flags.adapter;
961
+ if (!adapter) {
962
+ if (headless) adapter = "cloudflare";
963
+ else {
964
+ const answer = await ve({
965
+ message: "Where will it run? (deployment adapter)",
966
+ initialValue: "cloudflare",
967
+ options: ADAPTERS.map((a) => ({
968
+ value: a.value,
969
+ label: a.enabled ? a.label : `${a.label} (soon)`,
970
+ hint: a.hint
971
+ }))
972
+ });
973
+ if (pD(answer)) return bail();
974
+ adapter = answer;
975
+ }
976
+ }
977
+ if (adapter !== "cloudflare") {
978
+ xe(`The "${adapter}" adapter is not available yet \u2014 only "cloudflare" is wired today.`);
979
+ return 1;
980
+ }
981
+ let template = flags.template;
982
+ if (!template) {
983
+ if (headless) template = "template";
984
+ else {
985
+ const answer = await ve({
986
+ message: "Start from?",
987
+ initialValue: "template",
988
+ options: [
989
+ {
990
+ value: "template",
991
+ label: "Template",
992
+ hint: 'a working "Note" class + a view + a seed'
993
+ },
994
+ { value: "blank", label: "Blank" }
995
+ ]
996
+ });
997
+ if (pD(answer)) return bail();
998
+ template = answer;
999
+ }
1000
+ }
1001
+ let pm = flags.pm;
1002
+ if (!pm) {
1003
+ const detected = detectPm();
1004
+ if (headless) pm = detected ?? "pnpm";
1005
+ else {
1006
+ const answer = await ve({
1007
+ message: "Package manager",
1008
+ initialValue: detected ?? "pnpm",
1009
+ options: PMS.map((v2) => ({ value: v2, label: v2 }))
1010
+ });
1011
+ if (pD(answer)) return bail();
1012
+ pm = answer;
1013
+ }
1014
+ }
1015
+ const dir = resolve2(flags.dir ?? slug);
1016
+ if (existsSync2(dir) && !flags.force) {
1017
+ if (headless) {
1018
+ xe(`Directory ${dir} already exists \u2014 pass --force to overwrite (non-interactive mode).`);
1019
+ return 1;
1020
+ }
1021
+ const go = await ye({ message: `${dir} exists \u2014 overwrite?`, initialValue: false });
1022
+ if (pD(go) || !go) return bail();
1023
+ }
1024
+ const link = flags.link ?? workspaceAvailable();
1025
+ if (flags.origin !== void 0 && !isValidSlug(flags.origin)) {
1026
+ xe(`Invalid --origin "${flags.origin}". Use lowercase letters, digits, dots and dashes.`);
1027
+ return 1;
1028
+ }
1029
+ const origin = flags.origin ?? (slug.includes(".") ? slug : `${slug}.example.dev`);
1030
+ const s = Y2();
1031
+ s.start(`Creating ./${slug}`);
1032
+ try {
1033
+ await scaffold({
1034
+ dir,
1035
+ name: slug,
1036
+ origin,
1037
+ adapter: "cloudflare",
1038
+ template,
1039
+ link
1040
+ });
1041
+ s.stop(`Created ${dir}`);
1042
+ } catch (err) {
1043
+ s.stop("Scaffold failed");
1044
+ xe(err.message);
1045
+ return 1;
1046
+ }
1047
+ if (link) {
1048
+ M2.info("Linked @astrale-os/* to the workspace source (dev mode \u2014 no publish needed).");
1049
+ }
1050
+ const rel = relative2(process.cwd(), dir);
1051
+ const cdTarget = rel && !rel.startsWith("..") ? rel : dir;
1052
+ Me(
1053
+ [`cd ${cdTarget}`, `${pm} install`, devStep(pm), installStep(pm), prodStep(pm)].join("\n"),
1054
+ "Next"
1055
+ );
1056
+ Se(`\u2713 ${slug} ready`);
1057
+ return 0;
1058
+ }
1059
+ var devStep = (pm) => `${pm === "npm" ? "npm run dev" : `${pm} dev`} # wrangler dev \u2192 prints a local URL`;
1060
+ var prodStep = (pm) => `${pm === "npm" ? "npm run prod" : `${pm} prod`} # deploy prod \u2192 prints a URL`;
1061
+ function installStep(pm) {
1062
+ if (astraleOnPath()) return "astrale instance install <url> # mount it on an instance";
1063
+ return [
1064
+ "# astrale CLI not found on PATH \u2014 run it on demand (no install):",
1065
+ `${DLX[pm]} @astrale-os/astrale instance install <url>`,
1066
+ "# or install it globally: npm i -g @astrale-os/astrale"
1067
+ ].join("\n");
1068
+ }
1069
+ function astraleOnPath() {
1070
+ const path = process.env.PATH;
1071
+ if (!path) return false;
1072
+ const names = process.platform === "win32" ? ["astrale.cmd", "astrale.exe", "astrale.bat", "astrale"] : ["astrale"];
1073
+ return path.split(delimiter).some((d3) => d3.length > 0 && names.some((n) => existsSync2(join2(d3, n))));
1074
+ }
1075
+ function detectPm() {
1076
+ const name = process.env.npm_config_user_agent?.split("/")[0];
1077
+ return PMS.find((p2) => p2 === name);
1078
+ }
1079
+ function parseFlags(argv) {
1080
+ const flags = { positional: [], force: false, yes: false, help: false };
1081
+ for (let i = 0; i < argv.length; i++) {
1082
+ const a = argv[i];
1083
+ if (a === "--help" || a === "-h") flags.help = true;
1084
+ else if (a === "--yes" || a === "-y") flags.yes = true;
1085
+ else if (a === "--force") flags.force = true;
1086
+ else if (a === "--link") flags.link = true;
1087
+ else if (a === "--no-link") flags.link = false;
1088
+ else if (a === "--adapter") flags.adapter = argv[++i];
1089
+ else if (a === "--template") flags.template = argv[++i];
1090
+ else if (a === "--pm") flags.pm = argv[++i];
1091
+ else if (a === "--dir") flags.dir = argv[++i];
1092
+ else if (a === "--origin") flags.origin = argv[++i];
1093
+ else if (!a.startsWith("-")) flags.positional.push(a);
1094
+ }
1095
+ return flags;
1096
+ }
1097
+ function printHelp() {
1098
+ process.stdout.write(
1099
+ `
1100
+ create-astrale-domain \u2014 scaffold a standalone Astrale domain
1101
+
1102
+ Usage:
1103
+ npm create astrale-domain <slug> [options]
1104
+ pnpm create astrale-domain <slug> [options]
1105
+
1106
+ Arguments:
1107
+ <slug> domain name (lowercase letters, digits, dots, dashes)
1108
+
1109
+ Options:
1110
+ --adapter <id> deployment adapter \u2014 cloudflare (default; others soon)
1111
+ --template <kind> template | blank (default: template)
1112
+ --pm <pm> pnpm | npm | yarn | bun (default: detected, else pnpm)
1113
+ --dir <path> target directory (default: ./<slug>)
1114
+ --origin <fqdn> domain identity origin (default: <slug>.example.dev)
1115
+ --link, --no-link link @astrale-os/* to the workspace source (dev)
1116
+ --force overwrite the target directory if it exists
1117
+ -y, --yes non-interactive: accept defaults for omitted fields
1118
+ -h, --help show this help
1119
+
1120
+ Non-interactive (also auto-enabled without a TTY, e.g. CI):
1121
+ npm create astrale-domain crm --yes
1122
+
1123
+ `
1124
+ );
1125
+ }
1126
+ function isValidSlug(v2) {
1127
+ return /^[a-z][a-z0-9.-]*$/.test(v2);
1128
+ }
1129
+ function bail() {
1130
+ xe("Cancelled.");
1131
+ return 1;
1132
+ }
1133
+ main().then((code) => process.exit(code)).catch((err) => {
1134
+ process.stderr.write(`\x1B[31m\u2717\x1B[0m ${err?.message ?? String(err)}
1135
+ `);
1136
+ process.exit(1);
1137
+ });
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "create-astrale-domain",
3
+ "version": "0.1.0",
4
+ "description": "Scaffold a standalone Astrale domain — npm create astrale-domain",
5
+ "keywords": [
6
+ "astrale",
7
+ "create",
8
+ "domain",
9
+ "scaffold"
10
+ ],
11
+ "license": "MIT",
12
+ "author": "Astrale",
13
+ "bin": {
14
+ "create-astrale-domain": "./dist/index.js"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "type": "module",
20
+ "dependencies": {
21
+ "@clack/prompts": "^0.11.0",
22
+ "@astrale-os/adapter-cloudflare": "0.1.0"
23
+ },
24
+ "devDependencies": {
25
+ "@astrale-os/ox": ">=0.1.0 <1.0.0",
26
+ "@types/node": "^22.0.0",
27
+ "@typescript/native-preview": "latest",
28
+ "esbuild": "^0.25.4",
29
+ "oxfmt": "latest",
30
+ "oxlint": "latest",
31
+ "typescript": "~6.0.1-rc",
32
+ "vitest": "^3.0.0"
33
+ },
34
+ "engines": {
35
+ "node": ">=22"
36
+ },
37
+ "scripts": {
38
+ "build": "node scripts/build.mjs",
39
+ "typecheck": "tsgo --noEmit",
40
+ "test": "vitest run",
41
+ "lint": "oxlint .",
42
+ "format": "pnpm exec oxfmt --write ."
43
+ }
44
+ }