inferred-types 0.55.2 → 0.55.4

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.
@@ -263,6 +263,7 @@ __export(index_exports, {
263
263
  defineObject: () => defineObject,
264
264
  defineObjectApi: () => defineObjectApi,
265
265
  defineTuple: () => defineTuple,
266
+ doesExtend: () => doesExtend,
266
267
  endsWith: () => endsWith,
267
268
  ensureLeading: () => ensureLeading,
268
269
  ensureSurround: () => ensureSurround,
@@ -273,6 +274,7 @@ __export(index_exports, {
273
274
  find: () => find,
274
275
  fnMeta: () => fnMeta,
275
276
  fromDefineObject: () => fromDefineObject,
277
+ fromKeyValue: () => fromKeyValue,
276
278
  get: () => get,
277
279
  getDaysBetween: () => getDaysBetween,
278
280
  getEach: () => getEach,
@@ -555,6 +557,7 @@ __export(index_exports, {
555
557
  isVoltageUom: () => isVoltageUom,
556
558
  isVolumeMetric: () => isVolumeMetric,
557
559
  isVolumeUom: () => isVolumeUom,
560
+ isVueRef: () => isVueRef,
558
561
  isWalgreensUrl: () => isWalgreensUrl,
559
562
  isWalmartUrl: () => isWalmartUrl,
560
563
  isWayfairUrl: () => isWayfairUrl,
@@ -648,6 +651,7 @@ __export(index_exports, {
648
651
  takeProp: () => takeProp,
649
652
  toCamelCase: () => toCamelCase,
650
653
  toKebabCase: () => toKebabCase,
654
+ toKeyValue: () => toKeyValue,
651
655
  toNumber: () => toNumber,
652
656
  toNumericArray: () => toNumericArray,
653
657
  toPascalCase: () => toPascalCase,
@@ -664,7 +668,7 @@ __export(index_exports, {
664
668
  twColor: () => twColor,
665
669
  unbox: () => unbox,
666
670
  uncapitalize: () => uncapitalize,
667
- union: () => union,
671
+ union: () => union3,
668
672
  unionize: () => unionize,
669
673
  unique: () => unique,
670
674
  uniqueKeys: () => uniqueKeys,
@@ -3297,54 +3301,6 @@ function asApi(api2) {
3297
3301
  function handleDoneFn(val, call_bare_fn = false) {
3298
3302
  return isObject(val) || isFunction(val) ? isDoneFn(val) ? val.done() : isFunction(val) ? call_bare_fn ? val() : val : val : isFunction(val) ? call_bare_fn ? val() : val : val;
3299
3303
  }
3300
- function addPropsToFn(fn2, clone_fn) {
3301
- const localFn = clone_fn ? (...args) => fn2(args) : fn2;
3302
- return (obj) => {
3303
- for (const k in obj) {
3304
- localFn[k] = obj[k];
3305
- }
3306
- return localFn;
3307
- };
3308
- }
3309
- function addFnToProps(props, _clone_fn) {
3310
- return (fn2) => {
3311
- const localFn = (...args) => fn2(args);
3312
- for (const k in props) {
3313
- localFn[k] = props[k];
3314
- }
3315
- return localFn;
3316
- };
3317
- }
3318
- function createCssSelector(_opt) {
3319
- return (...selectors) => {
3320
- return selectors.join(" ");
3321
- };
3322
- }
3323
- function createFnWithProps(fn2, props, narrowing = false) {
3324
- const fnWithProps = fn2;
3325
- for (const prop of Object.keys(props)) {
3326
- fnWithProps[prop] = props[prop];
3327
- }
3328
- return isTrue(narrowing) ? fnWithProps : fnWithProps;
3329
- }
3330
- function createFnWithPropsExplicit(fn2, props) {
3331
- const fnWithProps = fn2;
3332
- for (const prop of Object.keys(props)) {
3333
- fnWithProps[prop] = props[prop];
3334
- }
3335
- return fnWithProps;
3336
- }
3337
- function defineObj(literal2 = {}) {
3338
- return (wide22 = {}) => {
3339
- const obj = literal2 ? { ...literal2, ...wide22 } : wide22;
3340
- return obj;
3341
- };
3342
- }
3343
- function defineTuple(...values) {
3344
- return values.map(
3345
- (i) => isFunction(i) ? handleDoneFn(i(ShapeApiImplementation)) : i
3346
- );
3347
- }
3348
3304
  function objectToApi(obj, def = null) {
3349
3305
  const transformed = Object.keys(obj).reduce(
3350
3306
  (acc, key) => {
@@ -5157,21 +5113,6 @@ function ifSameType(value, comparator, same, notSame) {
5157
5113
  typeof value === typeof comparator ? same(value) : notSame(value)
5158
5114
  );
5159
5115
  }
5160
- function isNull(value) {
5161
- return value === null;
5162
- }
5163
- function isString(value) {
5164
- return typeof value === "string";
5165
- }
5166
- function isSymbol(value) {
5167
- return typeof value === "symbol";
5168
- }
5169
- function isNumber(value) {
5170
- return typeof value === "number";
5171
- }
5172
- function isScalar(value) {
5173
- return isString(value) || isNumber(value) || isSymbol(value) || isNull(value);
5174
- }
5175
5116
  function ifScalar(value, ifCallback, notCallback) {
5176
5117
  const result2 = isScalar(value) ? ifCallback(
5177
5118
  value
@@ -5394,7 +5335,7 @@ function get(value, dotPath, options = {
5394
5335
  return outcome;
5395
5336
  }
5396
5337
  function keysOf(container) {
5397
- const keys = Array.isArray(container) ? Object.keys(container).map((i) => Number(i)) : isObject(container) ? isRef(container) ? ["value"] : Object.keys(container) : [];
5338
+ const keys = isVueRef(container) ? ["value"] : Array.isArray(container) ? Object.keys(container).map((i) => Number(i)) : isObject(container) ? Object.keys(container) : [];
5398
5339
  return keys;
5399
5340
  }
5400
5341
  function callback() {
@@ -5482,88 +5423,6 @@ function withKeys(dict, ...keys) {
5482
5423
  function withoutKeys(dict, ...exclude) {
5483
5424
  return omit(dict, ...exclude);
5484
5425
  }
5485
- function doesExtend(type) {
5486
- return (val) => {
5487
- let response = false;
5488
- if (isString(val)) {
5489
- if (type === "string") {
5490
- response = true;
5491
- }
5492
- if (type.startsWith("string(")) {
5493
- const literals = stripAfter(
5494
- stripBefore(type, "string("),
5495
- ")"
5496
- ).split(/,\s*/);
5497
- if (literals.includes(val)) {
5498
- response = true;
5499
- }
5500
- }
5501
- }
5502
- if (isNumber(val)) {
5503
- if (type === "number") {
5504
- response = true;
5505
- }
5506
- if (type.startsWith("number(")) {
5507
- const literals = stripAfter(
5508
- stripBefore(type, "number("),
5509
- ")"
5510
- ).split(/,\s*/).map(Number);
5511
- if (literals.includes(val)) {
5512
- response = true;
5513
- }
5514
- }
5515
- }
5516
- if (isNull(val) && (type === "null" || type === "Opt<null>")) {
5517
- response = true;
5518
- }
5519
- if (isUndefined(val) && (type === "undefined" || type.startsWith("Opt<"))) {
5520
- response = true;
5521
- }
5522
- if (isBoolean(val)) {
5523
- if (type === "boolean") {
5524
- response = true;
5525
- }
5526
- if (type === "true" && val === true || type === "false" && val === false) {
5527
- response = true;
5528
- }
5529
- }
5530
- if (isNarrowableObject(val)) {
5531
- if (type === "Dict" || type === "Dict<string, unknown>") {
5532
- response = true;
5533
- }
5534
- if (startsWith("Dict<")(type)) {
5535
- const match = infer("Dict<{{infer key}}, {{infer value}}>")(type);
5536
- if (match) {
5537
- const { value } = match;
5538
- const isOpt = value.includes(`Opt<`);
5539
- const values = objectValues(val);
5540
- if (values.every((i) => isOpt ? isString(i) || isUndefined(i) : isString(i)) && type === "Dict<string, string>" || values.every((i) => isOpt ? isUndefined(i) || isNumber(i) : isNumber(i)) && type === "Dict<string, number>" || values.every((i) => isOpt ? isUndefined(i) || isBoolean(i) : isBoolean(i)) && type === "Dict<string, boolean>") {
5541
- response = true;
5542
- }
5543
- }
5544
- }
5545
- }
5546
- if (isArray(val)) {
5547
- if (type === "Array" || type === "Array<unknown>") {
5548
- return true;
5549
- }
5550
- if (type === "Array<Dict>" && val.every(isObject) || type === "Array<boolean>" && val.every(isBoolean) || type === "Array<string>" && val.every(isString) || type === "Array<number>" && val.every(isNumber) || type === "Array<Map>" && val.every(isMap) || type === "Array<Set>" && val.every(isSetContainer)) {
5551
- response = true;
5552
- }
5553
- }
5554
- if (isMap(val)) {
5555
- if (type === "Map" || type === "Map<Dict, Array>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isArray) || type === "Map<Dict, Dict>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isObject) || type === "Map<Dict, boolean>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isBoolean) || type === "Map<Dict, number>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isNumber) || type === "Map<Dict, string>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isString) || type === "Map<Dict, unknown>" && Array.from(val.keys()).every(isObject) || type === "Map<string, string>" && Array.from(val.keys()).every(isString) && Array.from(val.values()).every(isString) || type === "Map<string, number>" && Array.from(val.keys()).every(isString) && Array.from(val.values()).every(isNumber) || type === "Map<string, boolean>" && Array.from(val.keys()).every(isString) && Array.from(val.values()).every(isBoolean) || type === "Map<string, unknown>" && Array.from(val.keys()).every(isString) || type === "Map<number, string>" && Array.from(val.keys()).every(isNumber) && Array.from(val.values()).every(isString) || type === "Map<number, number>" && Array.from(val.keys()).every(isNumber) && Array.from(val.values()).every(isNumber) || type === "Map<number, boolean>" && Array.from(val.keys()).every(isNumber) && Array.from(val.values()).every(isBoolean) || type === "Map<number, unknown>" && Array.from(val.keys()).every(isNumber)) {
5556
- response = true;
5557
- }
5558
- }
5559
- if (isSetContainer(val)) {
5560
- if (type === "Set" || type === "Set<unknown>" || type === "Set<boolean>" && Array.from(val).every(isBoolean) || type === "Set<string>" && Array.from(val).every(isString) || type === "Set<number>" && Array.from(val).every(isNumber) || type === "Set<Opt<boolean>>" && Array.from(val).every((i) => isBoolean(i) || isUndefined(i)) || type === "Set<Opt<string>>" && Array.from(val).every((i) => isString(i) || isUndefined(i)) || type === "Set<Opt<number>>" && Array.from(val).every((i) => isNumber(i) || isUndefined(i))) {
5561
- response = true;
5562
- }
5563
- }
5564
- return response;
5565
- };
5566
- }
5567
5426
  function withoutValue(wo) {
5568
5427
  return (obj) => {
5569
5428
  const output = {};
@@ -5616,6 +5475,54 @@ function fnMeta(func) {
5616
5475
  };
5617
5476
  }
5618
5477
  var wrapFn = "NOT IMPLEMENTED";
5478
+ function addPropsToFn(fn2, clone_fn) {
5479
+ const localFn = clone_fn ? (...args) => fn2(args) : fn2;
5480
+ return (obj) => {
5481
+ for (const k in obj) {
5482
+ localFn[k] = obj[k];
5483
+ }
5484
+ return localFn;
5485
+ };
5486
+ }
5487
+ function addFnToProps(props, _clone_fn) {
5488
+ return (fn2) => {
5489
+ const localFn = (...args) => fn2(args);
5490
+ for (const k in props) {
5491
+ localFn[k] = props[k];
5492
+ }
5493
+ return localFn;
5494
+ };
5495
+ }
5496
+ function createCssSelector(_opt) {
5497
+ return (...selectors) => {
5498
+ return selectors.join(" ");
5499
+ };
5500
+ }
5501
+ function createFnWithProps(fn2, props, narrowing = false) {
5502
+ const fnWithProps = fn2;
5503
+ for (const prop of Object.keys(props)) {
5504
+ fnWithProps[prop] = props[prop];
5505
+ }
5506
+ return isTrue(narrowing) ? fnWithProps : fnWithProps;
5507
+ }
5508
+ function createFnWithPropsExplicit(fn2, props) {
5509
+ const fnWithProps = fn2;
5510
+ for (const prop of Object.keys(props)) {
5511
+ fnWithProps[prop] = props[prop];
5512
+ }
5513
+ return fnWithProps;
5514
+ }
5515
+ function defineObj(literal2 = {}) {
5516
+ return (wide22 = {}) => {
5517
+ const obj = literal2 ? { ...literal2, ...wide22 } : wide22;
5518
+ return obj;
5519
+ };
5520
+ }
5521
+ function defineTuple(...values) {
5522
+ return values.map(
5523
+ (i) => isFunction(i) ? handleDoneFn(i(ShapeApiImplementation)) : i
5524
+ );
5525
+ }
5619
5526
  function asArray(thing) {
5620
5527
  return Array.isArray(thing) === true ? thing : typeof thing === "undefined" ? [] : [thing];
5621
5528
  }
@@ -5798,311 +5705,266 @@ function ensureTrailing(content, ensure) {
5798
5705
  content.endsWith(ensure) ? content : `${content}${ensure}`
5799
5706
  );
5800
5707
  }
5801
- function isFunction(value) {
5802
- return typeof value === "function";
5803
- }
5804
- function isObject(value) {
5805
- return typeof value === "object" && value !== null && Array.isArray(value) === false;
5708
+ function getTypeSubtype(str) {
5709
+ if (isTypeSubtype(str)) {
5710
+ const [t, st] = str.split("/");
5711
+ return [t, st];
5712
+ } else {
5713
+ const err = new Error(`An invalid Type/Subtype was passed into getTypeSubtype(${str})`);
5714
+ err.name = "InvalidTypeSubtype";
5715
+ throw err;
5716
+ }
5806
5717
  }
5807
- function isNarrowableObject(value) {
5808
- return isObject(value) && Object.keys(value).every((key) => ["string", "number", "boolean", "symbol", "object", "undefined", "void", "null"].includes(typeof value[key]));
5718
+ function identity(...values) {
5719
+ return values.length === 1 ? values[0] : values.length === 0 ? void 0 : values;
5809
5720
  }
5810
- function isEscapeFunction(val) {
5811
- return isFunction(val) && "escape" in val && val.escape === true;
5721
+ function ifLowercaseChar(ch, callbackForMatch, callbackForNoMatch) {
5722
+ if (ch.length !== 1) {
5723
+ throw new Error(`call to ifUppercaseChar received ${ch.length} characters but is only valid when one character is passed in!`);
5724
+ }
5725
+ return LOWER_ALPHA_CHARS2.includes(ch) ? callbackForMatch(ch) : callbackForNoMatch(ch);
5812
5726
  }
5813
- function isOptionalParamFunction(val) {
5814
- return isFunction(val) && "optionalParams" in val && val.optionalParams === true;
5727
+ function ifUppercaseChar(ch, callbackForMatch, callbackForNoMatch) {
5728
+ if (ch.length !== 1) {
5729
+ throw new Error(`Invalid string length passed to ifUppercaseChar(ch); this function requires a single character but ${ch.length} were received`);
5730
+ }
5731
+ return LOWER_ALPHA_CHARS2.includes(ch) ? callbackForMatch(ch) : callbackForNoMatch(ch);
5815
5732
  }
5816
- function isApi(api2) {
5817
- return isObject(api2) && "surface" in api2 && "_kind" in api2 && api2._kind === "api";
5733
+ function parseTemplate(template) {
5734
+ const pattern = /\{\{\s*infer\s+([A-Za-z_]\w*)\s*(?:(?:extends|as)\s+(string|number|boolean)\s*)?\}\}/g;
5735
+ let lastIndex = 0;
5736
+ let match;
5737
+ const segments = [];
5738
+ while (match = pattern.exec(template)) {
5739
+ const [fullMatch, varName, asType2] = match;
5740
+ const staticPart = template.slice(lastIndex, match.index);
5741
+ if (staticPart) {
5742
+ segments.push({ dynamic: false, text: staticPart });
5743
+ }
5744
+ segments.push({
5745
+ dynamic: true,
5746
+ varName,
5747
+ type: asType2 ? asType2 : "string"
5748
+ });
5749
+ lastIndex = match.index + fullMatch.length;
5750
+ }
5751
+ const remainder = template.slice(lastIndex);
5752
+ if (remainder) {
5753
+ segments.push({ dynamic: false, text: remainder });
5754
+ }
5755
+ return segments;
5818
5756
  }
5819
- function isApiSurface(val) {
5820
- return isObject(val) && Object.keys(val).some((k) => isEscapeFunction(val[k]));
5757
+ function escapeRegex(str) {
5758
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
5821
5759
  }
5822
- function isDate(val) {
5823
- return val instanceof Date;
5824
- }
5825
- function isIsoDateTime(val) {
5826
- if (!isString(val)) {
5827
- return false;
5828
- }
5829
- const ISO_DATETIME_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
5830
- if (!ISO_DATETIME_REGEX.test(val)) {
5831
- return false;
5832
- }
5833
- const [_, ...matches] = val.match(ISO_DATETIME_REGEX) || [];
5834
- const [year, month, day, hours, minutes, seconds] = matches.map(Number);
5835
- if (hours >= 24 || minutes >= 60 || seconds != null && seconds >= 60) {
5836
- return false;
5837
- }
5838
- if (month < 1 || month > 12) {
5839
- return false;
5840
- }
5841
- ;
5842
- const daysInMonth = new Date(year, month, 0).getDate();
5843
- if (day < 1 || day > daysInMonth) {
5844
- return false;
5845
- }
5846
- ;
5847
- const tzMatch = val.match(/([+-])(\d{2}):(\d{2})$/);
5848
- if (tzMatch) {
5849
- const [_2, _sign, tzHours, tzMinutes] = tzMatch;
5850
- const numHours = Number.parseInt(tzHours, 10);
5851
- const numMinutes = Number.parseInt(tzMinutes, 10);
5852
- if (numHours > 14 || numMinutes > 59) {
5853
- return false;
5854
- }
5855
- if (numHours === 14 && numMinutes > 0) {
5856
- return false;
5760
+ function buildRegexPattern(segments) {
5761
+ let regexStr = "^";
5762
+ for (const seg of segments) {
5763
+ if (!seg.dynamic) {
5764
+ regexStr += escapeRegex(seg.text);
5765
+ } else {
5766
+ switch (seg.type) {
5767
+ case "string":
5768
+ regexStr += "(.*?)";
5769
+ break;
5770
+ case "number":
5771
+ regexStr += "(\\d+)";
5772
+ break;
5773
+ case "boolean":
5774
+ regexStr += "(true|false)";
5775
+ break;
5776
+ }
5857
5777
  }
5858
5778
  }
5859
- return true;
5779
+ regexStr += "$";
5780
+ return new RegExp(regexStr);
5860
5781
  }
5861
- function isIsoExplicitDate(val) {
5862
- if (isString(val)) {
5863
- const parts = val.split("-").map((i) => Number(i));
5864
- return val.includes("-") ? val.split("-").every((i) => isNumberLike(i)) ? parts[0] >= 0 && parts[0] <= 9999 && parts[1] >= 1 && parts[1] <= 12 && parts[2] >= 1 && parts[2] <= 31 : false : false;
5865
- } else {
5866
- return false;
5782
+ function convertValue(type, value) {
5783
+ switch (type) {
5784
+ case "string":
5785
+ return value;
5786
+ case "number":
5787
+ return Number(value);
5788
+ case "boolean":
5789
+ return value === "true";
5867
5790
  }
5868
5791
  }
5869
- function isIsoImplicitDate(val) {
5870
- if (isString(val) && val.length === 8 && isNumberLike(val)) {
5871
- const year = Number(val.slice(0, 4));
5872
- const month = Number(val.slice(4, 6));
5873
- const date = Number(val.slice(6, 8));
5874
- return year >= 0 && year <= 9999 && month >= 1 && month <= 12 && date >= 1 && date <= 31;
5875
- } else {
5792
+ function matchTemplate(template, test) {
5793
+ const segments = parseTemplate(template);
5794
+ const regex = buildRegexPattern(segments);
5795
+ const match = regex.exec(test);
5796
+ if (!match)
5876
5797
  return false;
5798
+ let captureIndex = 1;
5799
+ const result2 = {};
5800
+ for (const seg of segments) {
5801
+ if (seg.dynamic) {
5802
+ const rawVal = match[captureIndex++];
5803
+ if (rawVal === void 0)
5804
+ return false;
5805
+ result2[seg.varName] = convertValue(seg.type, rawVal);
5806
+ }
5877
5807
  }
5808
+ return result2;
5878
5809
  }
5879
- function isIsoDate(val) {
5880
- if (isString(val)) {
5881
- return val.includes("-") ? isIsoExplicitDate(val) : isIsoImplicitDate(val);
5882
- } else {
5883
- return false;
5884
- }
5810
+ function infer(inference) {
5811
+ return (test) => {
5812
+ return matchTemplate(inference, test);
5813
+ };
5885
5814
  }
5886
- function isIsoExplicitTime(val) {
5887
- if (isString(val)) {
5888
- const parts = stripLeading(stripAfter(val, "Z"), "T").split(/[:.]/).map((i) => Number(i));
5889
- return val.startsWith("T") && val.includes(":") && val.split(":").length === 3 && parts[0] >= 0 && parts[0] <= 23 && parts[1] >= 0 && parts[1] <= 59;
5890
- } else {
5891
- return false;
5892
- }
5815
+ function idLiteral(o) {
5816
+ return { ...o, id: o.id };
5893
5817
  }
5894
- function isIsoImplicitTime(val) {
5895
- if (isString(val)) {
5896
- const parts = stripAfter(val, "Z").split(/[:.]/).map((i) => Number(i));
5897
- return val.includes(":") && val.split(":").length === 3 && parts[0] >= 0 && parts[0] <= 23 && parts[1] >= 0 && parts[1] <= 59;
5898
- } else {
5899
- return false;
5900
- }
5818
+ function nameLiteral(o) {
5819
+ return o;
5901
5820
  }
5902
- function isIsoTime(val) {
5903
- return isIsoExplicitTime(val) || isIsoImplicitTime(val);
5821
+ function kindLiteral(o) {
5822
+ return o;
5904
5823
  }
5905
- function isIsoYear(val) {
5906
- return !!(isString(val) && val.length === 4 && isNumber(Number(val)) && Number(val) >= 0 && Number(val) <= 9999);
5824
+ function idTypeGuard(_o) {
5825
+ return true;
5907
5826
  }
5908
- function isLuxonDateTime(val) {
5909
- return isObject(val) && typeof val === "object" && val !== null && "isValid" in val && "invalidReason" in val && "invalidExplanation" in val && "toISO" in val && "toFormat" in val && "toMillis" in val && "year" in val && "month" in val && "day" in val && "hour" in val && "minute" in val && "second" in val && "millisecond" in val && typeof val.isValid === "boolean" && typeof val.toISO === "function";
5827
+ function literal(obj) {
5828
+ return obj;
5910
5829
  }
5911
- function isMoment(val) {
5912
- if (val instanceof Date) {
5913
- return false;
5914
- }
5915
- return isObject(val) && typeof val.format === "function" && typeof val.year === "function" && typeof val.month === "function" && typeof val.date === "function" && "_isAMomentObject" in val && "_isValid" in val && typeof val.add === "function" && typeof val.subtract === "function" && typeof val.toISOString === "function" && typeof val.isValid === "function";
5830
+ function lowercase(str) {
5831
+ return str.toLowerCase();
5916
5832
  }
5917
- function isThisMonth(val) {
5918
- const now = /* @__PURE__ */ new Date();
5919
- const currentYear = now.getFullYear();
5920
- const currentMonth = now.getMonth() + 1;
5921
- if (val instanceof Date) {
5922
- return val.getFullYear() === currentYear && val.getMonth() + 1 === currentMonth;
5923
- }
5924
- if (isMoment(val)) {
5925
- const monthValue = val.month();
5926
- return val.year() === currentYear && (typeof monthValue === "number" ? monthValue + 1 : monthValue) === currentMonth;
5927
- }
5928
- if (isLuxonDateTime(val)) {
5929
- return val.year === currentYear && val.month === currentMonth;
5833
+ function narrow(...values) {
5834
+ return values.length === 1 ? values[0] : values;
5835
+ }
5836
+ function pathJoin(...segments) {
5837
+ const clean_path = segments.map((i) => stripTrailing(stripLeading(i, "/"), "/")).join("/");
5838
+ const original_path = segments.join("/");
5839
+ const pre = original_path.startsWith("/") ? "/" : "";
5840
+ const post = original_path.endsWith("/") ? "/" : "";
5841
+ return `${pre}${clean_path}${post}`;
5842
+ }
5843
+ var asPhoneFormat = () => `NOT IMPLEMENTED`;
5844
+ function getPhoneCountryCode(phone) {
5845
+ return phone.trim().startsWith("+") || phone.trim().startsWith("00") ? retainWhile(
5846
+ stripLeading(stripLeading(phone.trim(), "+"), "00"),
5847
+ ...NUMERIC_CHAR2
5848
+ ) : "";
5849
+ }
5850
+ function removePhoneCountryCode(phone) {
5851
+ const countryCode = getPhoneCountryCode(phone);
5852
+ return countryCode !== "" ? stripLeading(stripLeading(
5853
+ phone.trim(),
5854
+ "+",
5855
+ "00"
5856
+ ), countryCode).trim() : phone.trim();
5857
+ }
5858
+ var isException = (word) => Object.keys(PLURAL_EXCEPTIONS2).includes(word);
5859
+ function endingIn(word, postfix) {
5860
+ switch (postfix) {
5861
+ case "is":
5862
+ return word.endsWith(postfix) ? `${word}es` : void 0;
5863
+ case "singular-noun":
5864
+ return SINGULAR_NOUN_ENDINGS2.some((i) => word.endsWith(i)) ? split(word).every((i) => [...ALPHA_CHARS2].includes(i)) ? `${word}es` : void 0 : void 0;
5865
+ case "f":
5866
+ return word.endsWith("f") ? `${stripTrailing(word, "f")}ves` : word.endsWith("fe") ? `${stripTrailing(word, "fe")}ves` : void 0;
5867
+ case "y":
5868
+ return word.endsWith("y") ? `${stripTrailing(word, "y")}ies` : void 0;
5869
+ default:
5870
+ throw new Error(`endingIn received "${postfix}" as a postfix but this ending is not known!`);
5930
5871
  }
5931
- if (typeof val === "string") {
5932
- const isoDateRegex = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])(?:T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[-+][01]\d:[0-5]\d))?$/;
5933
- if (!isoDateRegex.test(val)) {
5934
- return false;
5935
- }
5936
- const dateMatch = val.match(/^(\d{4})-(\d{2})/);
5937
- if (dateMatch) {
5938
- const year = Number.parseInt(dateMatch[1], 10);
5939
- const month = Number.parseInt(dateMatch[2], 10);
5940
- return year === currentYear && month === currentMonth;
5872
+ }
5873
+ function pluralize(word) {
5874
+ const right = rightWhitespace(word);
5875
+ const w = word.trimEnd();
5876
+ const result2 = isException(w) ? PLURAL_EXCEPTIONS2[w] : endingIn(w, "is") || endingIn(w, "singular-noun") || endingIn(w, "f") || endingIn(w, "y") || `${w}s`;
5877
+ return `${result2}${right}`;
5878
+ }
5879
+ function retainAfter(content, ...find2) {
5880
+ const idx = Math.min(
5881
+ ...find2.map((i) => content.indexOf(i)).filter((i) => i > -1)
5882
+ );
5883
+ const min = Math.min(...find2.map((i) => i.length));
5884
+ let len = Math.max(...find2.map((i) => i.length));
5885
+ if (min !== len) {
5886
+ if (!find2.includes(content.slice(idx, len))) {
5887
+ len = min;
5941
5888
  }
5942
5889
  }
5943
- return false;
5890
+ return idx && idx > 0 ? content.slice(idx + len) : "";
5944
5891
  }
5945
- function isThisWeek(date) {
5946
- const targetDate = asDate(date);
5947
- if (!targetDate) {
5948
- return false;
5892
+ function retainAfterInclusive(content, ...find2) {
5893
+ const minFound = Math.min(
5894
+ ...find2.map((i) => content.indexOf(i)).filter((i) => i > -1)
5895
+ );
5896
+ return minFound > 0 ? content.slice(minFound) : "";
5897
+ }
5898
+ function retainChars(content, ...retain2) {
5899
+ const chars = asChars(content);
5900
+ return chars.filter((c) => retain2.includes(c)).join("");
5901
+ }
5902
+ function retainUntil(content, ...find2) {
5903
+ const chars = asChars(content);
5904
+ let idx = 0;
5905
+ while (!find2.includes(chars[idx]) && idx <= chars.length) {
5906
+ idx = idx + 1;
5949
5907
  }
5950
- const currentWeek = getWeekNumber();
5951
- const targetWeek = getWeekNumber(targetDate);
5952
- return currentWeek === targetWeek;
5908
+ return idx === 0 ? "" : content.slice(0, idx);
5953
5909
  }
5954
- function isThisYear(val) {
5955
- const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
5956
- if (isObject(val) || isNumber(val) || isString(val)) {
5957
- const date = asDate(val);
5958
- if (date) {
5959
- return date.getFullYear() === currentYear;
5960
- } else {
5961
- return false;
5962
- }
5910
+ function retainUntilInclusive(content, ...find2) {
5911
+ const chars = asChars(content);
5912
+ let idx = 0;
5913
+ while (!find2.includes(chars[idx]) && idx <= chars.length) {
5914
+ idx = idx + 1;
5963
5915
  }
5964
- return false;
5916
+ return idx === 0 ? content.slice(0, 1) : content.slice(0, idx + 1);
5965
5917
  }
5966
- function isToday(test) {
5967
- if (isString(test)) {
5968
- const justDate = stripAfter(test, "T");
5969
- return isIsoExplicitDate(justDate) && justDate === getToday();
5970
- } else if (isMoment(test) || isDate(test)) {
5971
- return stripAfter(test.toISOString(), "T") === getToday();
5972
- } else if (isLuxonDateTime(test)) {
5973
- return stripAfter(test.toISO(), "T") === getToday();
5974
- }
5975
- return false;
5976
- }
5977
- function isTomorrow(test) {
5978
- if (isString(test)) {
5979
- const justDate = stripAfter(test, "T");
5980
- return isIsoExplicitDate(justDate) && justDate === getTomorrow();
5981
- } else if (isMoment(test) || isDate(test)) {
5982
- return stripAfter(test.toISOString(), "T") === getTomorrow();
5983
- } else if (isLuxonDateTime(test)) {
5984
- return stripAfter(test.toISO(), "T") === getTomorrow();
5985
- }
5986
- return false;
5987
- }
5988
- function isYesterday(test) {
5989
- if (isString(test)) {
5990
- const justDate = stripAfter(test, "T");
5991
- return isIsoExplicitDate(justDate) && justDate === getYesterday();
5992
- } else if (isMoment(test) || isDate(test)) {
5993
- return stripAfter(test.toISOString(), "T") === getYesterday();
5994
- } else if (isLuxonDateTime(test)) {
5995
- return stripAfter(test.toISO(), "T") === getYesterday();
5996
- }
5997
- return false;
5998
- }
5999
- function isIso3166Alpha2(val) {
6000
- const codes = ISO3166_12.map((i) => i.alpha2);
6001
- return isString(val) && codes.includes(val);
6002
- }
6003
- function isCountryCode2(val) {
6004
- const codes = ISO3166_12.map((i) => i.alpha2);
6005
- return isString(val) && codes.includes(val);
6006
- }
6007
- function isIso3166Alpha3(val) {
6008
- const codes = ISO3166_12.map((i) => i.alpha3);
6009
- return isString(val) && codes.includes(val);
6010
- }
6011
- function isCountryCode3(val) {
6012
- const codes = ISO3166_12.map((i) => i.alpha3);
6013
- return isString(val) && codes.includes(val);
6014
- }
6015
- function isIso3166CountryCode(val) {
6016
- const codes = ISO3166_12.map((i) => i.countryCode);
6017
- return isString(val) && codes.includes(val);
6018
- }
6019
- function isCountryAbbrev(val) {
6020
- return isCountryCode2(val) || isCountryCode3(val);
6021
- }
6022
- function isIso3166CountryName(val) {
6023
- const codes = ISO3166_12.map((i) => i.name);
6024
- return isString(val) && codes.includes(val);
6025
- }
6026
- function isCountryName(val) {
6027
- const codes = ISO3166_12.map((i) => i.name);
6028
- return isString(val) && codes.includes(val);
6029
- }
6030
- var ABBREV = US_STATE_LOOKUP2.map((i) => i.abbrev);
6031
- var NAME = US_STATE_LOOKUP2.map((i) => i.name);
6032
- function isUsStateAbbreviation(val) {
6033
- return isString(val) && ABBREV.includes(val);
5918
+ function retainWhile(content, ...retain2) {
5919
+ const stopIdx = asChars(content).findIndex((c) => !retain2.includes(c));
5920
+ return content.slice(0, stopIdx);
6034
5921
  }
6035
- function isUsStateName(val) {
6036
- return isString(val) && NAME.includes(val);
5922
+ function rightWhitespace(content) {
5923
+ const trimmed = content.trimStart();
5924
+ return retainAfterInclusive(
5925
+ trimmed,
5926
+ ...WHITESPACE_CHARS2
5927
+ );
6037
5928
  }
6038
5929
  function split(str, sep = "") {
6039
5930
  return str.split(sep);
6040
5931
  }
6041
- function isNumericString(value) {
6042
- const numericChars = [...NUMERIC_CHAR2];
6043
- return typeof value === "string" && split(value).every((i) => numericChars.includes(i));
5932
+ function stripAfter(content, find2) {
5933
+ return content.split(find2).shift();
6044
5934
  }
6045
- function isNumberLike(value) {
6046
- const numericChars = [...NUMERIC_CHAR2];
6047
- return typeof value === "string" && split(value).every((i) => numericChars.includes(i)) ? true : typeof value === "number";
5935
+ function stripBefore(content, find2) {
5936
+ return content.split(find2).slice(1).join(find2);
6048
5937
  }
6049
- function isZipCode5(val) {
6050
- if (isNumber(val)) {
6051
- return isZipCode5(`${val}`);
6052
- }
6053
- return isString(val) && val.trim().length === 5 && isNumberLike(val.trim());
5938
+ function stripChars(content, ...strip2) {
5939
+ const chars = asChars(content);
5940
+ return chars.filter((c) => !strip2.includes(c)).join("");
6054
5941
  }
6055
- function isZipPlus4(val) {
6056
- if (isString(val)) {
6057
- const first = retainWhile(val.trim(), ...NUMERIC_CHAR2);
6058
- const next = stripChars(val.trim().replace(first, "").trim(), "-");
6059
- return first.length === 5 && next.length === 4 && isNumberLike(next);
5942
+ function stripLeading(content, ...strip2) {
5943
+ if (isUndefined(content)) {
5944
+ return void 0;
6060
5945
  }
6061
- return false;
6062
- }
6063
- function isZipCode(val) {
6064
- return isZipCode5(val) || isZipPlus4(val);
6065
- }
6066
- function isSpecificConstant(kind) {
6067
- return (value) => {
6068
- return !!(isConstant(value) && value.kind === kind);
6069
- };
6070
- }
6071
- function hasDefaultValue(value) {
6072
- const noDefault = isSpecificConstant("no-default-value");
6073
- return !noDefault(value);
6074
- }
6075
- function hasIndexOf(value, idx) {
6076
- const result2 = isObject(value) ? String(idx) in value : Array.isArray(value) ? Number(idx) in value : false;
6077
- return isErrorCondition(result2, "invalid-index") ? false : result2;
5946
+ let output = String(content);
5947
+ for (const s of strip2) {
5948
+ if (output.startsWith(String(s))) {
5949
+ output = output.slice(String(s).length);
5950
+ }
5951
+ }
5952
+ return isNumber(content) ? Number(output) : output;
6078
5953
  }
6079
- function hasKeys(...props) {
6080
- return (val) => {
6081
- const keys = Array.isArray(props) ? props : Object.keys(props).filter((i) => typeof i === "string");
6082
- return !!((isFunction(val) || isObject(val)) && keys.every((k) => k in val));
5954
+ function stripSurround(...chars) {
5955
+ return (input) => {
5956
+ let output = String(input);
5957
+ for (const s of chars) {
5958
+ if (output.startsWith(String(s))) {
5959
+ output = output.slice(String(s).length);
5960
+ }
5961
+ if (output.endsWith(String(s))) {
5962
+ output = output.slice(0, -1 * String(s).length);
5963
+ }
5964
+ }
5965
+ return isNumber(input) ? Number(output) : output;
6083
5966
  };
6084
5967
  }
6085
- function asChars(str) {
6086
- return str.split("");
6087
- }
6088
- function asRecord(obj) {
6089
- return obj;
6090
- }
6091
- function asString(value) {
6092
- return isString(value) ? value : isNumber(value) ? `${value}` : isBoolean(value) ? `${value}` : isArray(value) ? value.join("") : String(value);
6093
- }
6094
- function csv(csv2, format = `string-numeric-tuple`) {
6095
- const tuple3 = [];
6096
- csv2.split(/,\s?/).forEach((v) => {
6097
- tuple3.push(
6098
- format === "string-numeric-tuple" ? isNumberLike(v) ? Number(v) : v : format === "json-tuple" ? isNumberLike(v) ? Number(v) : v === "true" ? true : v === "false" ? false : `"${v}"` : format === "string-tuple" ? `${v}` : Never2
6099
- );
6100
- });
6101
- return tuple3;
6102
- }
6103
- function intersect(value, _intersectedWith) {
6104
- return value;
6105
- }
6106
5968
  function stripTrailing(content, ...strip2) {
6107
5969
  if (isUndefined(content)) {
6108
5970
  return void 0;
@@ -6115,1815 +5977,2000 @@ function stripTrailing(content, ...strip2) {
6115
5977
  }
6116
5978
  return isNumber(content) ? Number(output) : output;
6117
5979
  }
6118
- function ip6GroupExpansion(ip) {
6119
- return stripTrailing(ip.replaceAll("::", ":0000:"), ":");
5980
+ function stripUntil(content, ...until) {
5981
+ const stopIdx = asChars(content).findIndex((c) => until.includes(c));
5982
+ return content.slice(stopIdx);
6120
5983
  }
6121
- function jsonValue(val) {
6122
- return isNumberLike(val) ? Number(val) : val === "true" ? true : val === "false" ? false : `"${val}"`;
5984
+ function stripWhile(content, ...match) {
5985
+ const stopIdx = asChars(content).findIndex((c) => !match.includes(c));
5986
+ return content.slice(stopIdx);
6123
5987
  }
6124
- function jsonValues(...val) {
6125
- return val.map((i) => jsonValue(i));
5988
+ function surround(prefix, postfix) {
5989
+ return (input) => `${prefix}${input}${postfix}`;
6126
5990
  }
6127
- function lookupAlpha2Code(code, prop) {
6128
- const found = ISO3166_12.find((i) => i.alpha2 === code);
6129
- return found ? found[prop] : void 0;
5991
+ function takeNumericCharacters(content) {
5992
+ const nonNumericIdx = asChars(content).findIndex((i) => !NUMERIC_CHAR2.includes(i));
5993
+ return content.slice(0, nonNumericIdx);
6130
5994
  }
6131
- function lookupAlpha3Code(code, prop) {
6132
- const found = ISO3166_12.find((i) => i.alpha3 === code);
6133
- return found ? found[prop] : void 0;
5995
+ function toCamelCase(input, preserveWhitespace) {
5996
+ const pascal = preserveWhitespace ? toPascalCase(input, preserveWhitespace) : toPascalCase(input);
5997
+ const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(
5998
+ pascal
5999
+ );
6000
+ const camel = (preserveWhitespace ? preWhite : "") + focus.replace(/^.*?(\d*[a-z|])/is, (_2, p1) => p1.toLowerCase()) + (preserveWhitespace ? postWhite : "");
6001
+ return camel;
6134
6002
  }
6135
- function lookupName(name, prop) {
6136
- const found = ISO3166_12.find((i) => i.name === name);
6137
- return found ? found[prop] : void 0;
6003
+ function toKebabCase(input, _preserveWhitespace = false) {
6004
+ const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
6005
+ const replaceWhitespace = (i) => i.replace(/\s/g, "-");
6006
+ const replaceUppercase = (i) => i.replace(/[A-Z]/g, (c) => `-${c[0].toLowerCase()}`);
6007
+ const replaceLeadingDash = (i) => i.replace(/^-/, "");
6008
+ const replaceTrailingDash = (i) => i.replace(/-$/, "");
6009
+ const replaceUnderscore = (i) => i.replace(/_/g, "-");
6010
+ const removeDupDashes = (i) => i.replace(/-+/g, "-");
6011
+ return removeDupDashes(`${preWhite}${replaceUnderscore(
6012
+ replaceTrailingDash(
6013
+ replaceLeadingDash(removeDupDashes(replaceWhitespace(replaceUppercase(focus))))
6014
+ )
6015
+ )}${postWhite}`);
6138
6016
  }
6139
- function lookupNumericCode(code, prop) {
6140
- let num = isNumber(code) ? `${code}` : code;
6141
- if (num.length === 1) {
6142
- num = `00${num}`;
6143
- } else if (num.length === 2) {
6144
- num = `0${num}`;
6145
- }
6146
- const found = ISO3166_12.find((i) => i.countryCode === num);
6147
- return found ? found[prop] : void 0;
6017
+ function toNumericArray(arr) {
6018
+ return arr.map((i) => Number(i));
6148
6019
  }
6149
- function lookupCountryName(code) {
6150
- const uc = uppercase(code);
6151
- return isNumberLike(code) ? lookupNumericCode(code, "name") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "name") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "name") : void 0;
6020
+ function toPascalCase(input, preserveWhitespace = void 0) {
6021
+ const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(
6022
+ input
6023
+ );
6024
+ const convertInteriorToCap = (i) => i.replace(/[ |_\-]+(\d*[a-z|])/gi, (_2, p1) => p1.toUpperCase());
6025
+ const startingToCap = (i) => i.replace(/^[_|-]*(\d*[a-z])/g, (_2, p1) => p1.toUpperCase());
6026
+ const replaceLeadingTrash = (i) => i.replace(/^[-_]/, "");
6027
+ const replaceTrailingTrash = (i) => i.replace(/[-_]$/, "");
6028
+ const pascal = `${preserveWhitespace ? preWhite : ""}${capitalize(
6029
+ replaceTrailingTrash(replaceLeadingTrash(convertInteriorToCap(startingToCap(focus))))
6030
+ )}${preserveWhitespace ? postWhite : ""}`;
6031
+ return pascal;
6152
6032
  }
6153
- function lookupCountryAlpha2(code) {
6154
- const uc = uppercase(code);
6155
- return isNumberLike(code) ? lookupNumericCode(code, "alpha2") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "alpha2") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "alpha2") : isIso3166CountryName(code) ? lookupName(code, "alpha2") : void 0;
6033
+ function toSnakeCase(input, preserveWhitespace = false) {
6034
+ const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
6035
+ const convertInteriorSpace = (input2) => input2.replace(/\s+/g, "_");
6036
+ const convertDashes = (input2) => input2.replace(/-/g, "_");
6037
+ const injectUnderscoreBeforeCaps = (input2) => input2.replace(/([A-Z])/g, "_$1");
6038
+ const removeLeadingUnderscore = (input2) => input2.startsWith("_") ? input2.slice(1) : input2;
6039
+ return ((preserveWhitespace ? preWhite : "") + removeLeadingUnderscore(
6040
+ injectUnderscoreBeforeCaps(convertDashes(convertInteriorSpace(focus)))
6041
+ ).toLowerCase() + (preserveWhitespace ? postWhite : "")).replace(/__/g, "_");
6156
6042
  }
6157
- function lookupCountryAlpha3(token) {
6158
- const uc = uppercase(token);
6159
- return isNumberLike(token) ? lookupNumericCode(token, "alpha3") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "alpha3") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "alpha3") : isIso3166CountryName(token) ? lookupName(token, "alpha3") : void 0;
6043
+ function toString(val) {
6044
+ return String(val);
6160
6045
  }
6161
- function lookupCountryCode(token) {
6162
- const uc = uppercase(token);
6163
- return isNumberLike(token) ? lookupNumericCode(token, "countryCode") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "countryCode") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "countryCode") : isIso3166CountryName(token) ? lookupName(token, "countryCode") : void 0;
6046
+ function toUppercase(str) {
6047
+ return str.split("").map((i) => ifLowercaseChar(i, (v) => capitalize(v), (v) => v)).join("");
6164
6048
  }
6165
- function asMapper(fn2) {
6166
- const props = {
6167
- kind: "Mapper",
6168
- map: (from) => {
6169
- return from.map(fn2);
6170
- }
6171
- };
6172
- return createFnWithPropsExplicit(fn2, props);
6049
+ function trim(input) {
6050
+ return input.trim();
6173
6051
  }
6174
- function createObjectMap() {
6175
- return (map2) => {
6176
- const fn2 = (input) => {
6177
- return Object.keys(map2).reduce(
6178
- (acc, key) => {
6179
- const val = map2[key];
6180
- return {
6181
- ...acc,
6182
- [key]: isFunction(val) ? val(input) : val
6183
- };
6184
- },
6185
- {}
6186
- );
6187
- };
6188
- return fn2;
6189
- };
6052
+ function trimLeft(input) {
6053
+ return input.trimStart();
6190
6054
  }
6191
- function createMapper() {
6192
- return (fn2) => {
6193
- return asMapper(fn2);
6194
- };
6055
+ function trimStart(input) {
6056
+ return input.trimStart();
6195
6057
  }
6196
- function mergeObjects(defVal, override) {
6197
- const intersectingKeys = sharedKeys(defVal, override);
6198
- const defUnique = withoutKeys(defVal, ...intersectingKeys);
6199
- const overrideUnique = withoutKeys(defVal, ...intersectingKeys);
6200
- const merged = {
6201
- ...intersectingKeys.reduce(
6202
- (acc, key) => typeof override[key] === "undefined" ? { ...acc, [key]: defVal[key] } : { ...acc, [key]: override[key] },
6203
- {}
6204
- ),
6205
- ...defUnique,
6206
- ...overrideUnique
6207
- };
6208
- return merged;
6058
+ function trimRight(input) {
6059
+ return input.trimEnd();
6209
6060
  }
6210
- function isUndefined(value) {
6211
- return typeof value === "undefined";
6061
+ function trimEnd(input) {
6062
+ return input.trimEnd();
6212
6063
  }
6213
- function mergeScalars(a, b) {
6214
- return isUndefined(b) ? a : b;
6064
+ function truncate(content, maxLength, ellipsis = false) {
6065
+ const overLimit = content.length > maxLength;
6066
+ return overLimit ? ellipsis ? `${content.slice(0, maxLength)}${typeof ellipsis === "string" ? ellipsis : "..."}` : content.slice(0, maxLength) : content;
6215
6067
  }
6216
- function mergeTuples(a, b) {
6217
- return b.length > a.length ? b.map((v, idx) => v !== void 0 ? v : a[idx]) : [...b, ...a.slice(b.length)].map((v, idx) => v !== void 0 ? v : a[idx]);
6068
+ function tuple(...values) {
6069
+ const arr = values.length === 1 ? values[0] : values;
6070
+ return asArray(arr);
6218
6071
  }
6219
- function never(val) {
6220
- return val;
6072
+ function uncapitalize(str) {
6073
+ return `${str?.slice(0, 1).toLowerCase()}${str?.slice(1)}`;
6221
6074
  }
6222
- function optional(value) {
6223
- return value;
6075
+ var unset = "<<unset>>";
6076
+ function uppercase(str) {
6077
+ return str.toUpperCase();
6224
6078
  }
6225
- function orNull(value) {
6079
+ function widen(value) {
6226
6080
  return value;
6227
6081
  }
6228
- function optionalOrNull(value) {
6229
- return value;
6082
+ var PROTOCOLS = Object.values(NETWORK_PROTOCOL_LOOKUP2).flat().filter((i) => i !== "");
6083
+ function getUrlProtocol(url) {
6084
+ const proto = PROTOCOLS.find((p) => url.startsWith(`${p}://`));
6085
+ return proto;
6230
6086
  }
6231
- function stripParenthesis(val) {
6232
- return stripTrailing(stripLeading(val.trim(), "("), ")").trim();
6087
+ function removeUrlProtocol(url) {
6088
+ return stripBefore(url, "://");
6233
6089
  }
6234
- function convertScalar(val) {
6235
- switch (typeof val) {
6236
- case "number":
6237
- return val;
6238
- case "string":
6239
- return Number(val);
6240
- case "boolean":
6241
- return val ? 1 : 0;
6242
- default:
6243
- throw new Error(`${typeof val} is an invalid scalar type to convert to a number!`);
6244
- }
6090
+ function ensurePath(val) {
6091
+ const val2 = ensureLeading(val, "/");
6092
+ return val === "" ? "" : stripTrailing(val2, "/");
6245
6093
  }
6246
- var convertList = (val) => val.map((i) => convertScalar(i));
6247
- function toNumber(value) {
6248
- return Array.isArray(value) ? convertList(value) : convertScalar(value);
6094
+ function getUrlPath(url) {
6095
+ return isUrl(url) ? ensurePath(
6096
+ stripAfter(stripBefore(removeUrlProtocol(url), "/"), "?")
6097
+ ) : Never2;
6249
6098
  }
6250
- var MODS = TW_MODIFIERS2.map((i) => `${i}:`);
6251
- function removeTailwindModifiers(val) {
6252
- return MODS.some((i) => val.startsWith(i)) ? removeTailwindModifiers(val.replace(MODS.find((i) => val.startsWith(i)), "")) : val;
6099
+ function getUrlQueryParams(url, specific = void 0) {
6100
+ const qp = stripBefore(url, "?");
6101
+ if (specific) {
6102
+ return qp.includes(`${specific}=`) ? decodeURIComponent(
6103
+ stripAfter(
6104
+ stripBefore(qp, `${specific}=`),
6105
+ "&"
6106
+ ).replace(/\+/g, "%20")
6107
+ ) : void 0;
6108
+ }
6109
+ return qp === "" ? qp : `?${qp}`;
6253
6110
  }
6254
- function getTailwindModifiers(val) {
6255
- return val.split(":").filter((i) => isTailwindModifier(i));
6111
+ function getUrlDefaultPort(url) {
6112
+ const proto = getUrlProtocol(url);
6113
+ return proto in PROTOCOL_DEFAULT_PORTS2 ? PROTOCOL_DEFAULT_PORTS2[proto] : null;
6256
6114
  }
6257
- function union(..._options) {
6258
- return (value) => value;
6115
+ function getUrlPort(url, resolve = false) {
6116
+ const re = /.*:(\d{2,3})/;
6117
+ const match = url.match(re);
6118
+ return re.test(url) && match && isNumberLike(Array.from(match)[1]) ? Number(Array.from(match)[1]) : resolve ? getUrlDefaultPort(url) : hasProtocol(url) ? `default` : null;
6259
6119
  }
6260
- function unionize(value, _inUnionWith) {
6261
- return value;
6120
+ function getUrlSource(url) {
6121
+ const candidate = stripAfter(stripAfter(stripAfter(removeUrlProtocol(url), "/"), "?"), ":");
6122
+ return isIpAddress(candidate) || isDomainName(candidate) ? candidate : Never2;
6262
6123
  }
6263
- function hasWhiteSpace(val) {
6264
- return isString(val) && asChars(val).some((c) => WHITESPACE_CHARS2.includes(c));
6124
+ function getUrlBase(url) {
6125
+ const path = getUrlPath(url);
6126
+ const remaining = stripAfter(url, path);
6127
+ return remaining;
6265
6128
  }
6266
- function endsWith(endingIn2) {
6267
- return (val) => {
6268
- return isString(val) ? !!val.endsWith(endingIn2) : isNumber(val) ? !!String(val).endsWith(endingIn2) : false;
6129
+ function getUrlDynamics(url) {
6130
+ const path = getUrlPath(url);
6131
+ const qp = getUrlQueryParams(url);
6132
+ const pathParts = path.startsWith("<") ? path.split("<").map((i) => ensureLeading(i, "<")) : path.split("<").map((i) => ensureLeading(i, "<")).slice(1);
6133
+ const segmentTypes = [
6134
+ "string",
6135
+ "number",
6136
+ "boolean",
6137
+ "Opt<string>",
6138
+ "Opt<number>",
6139
+ "Opt<boolean>"
6140
+ ];
6141
+ const pathVars = {};
6142
+ const findPathTyped = infer(`<{{infer name}} as {{infer type}}>`);
6143
+ const findPathUnion = infer(`<{{infer name}} as string({{infer union}})>`);
6144
+ const findPathNamed = infer(`<{{infer name}}>`);
6145
+ for (const part of pathParts) {
6146
+ const union4 = findPathUnion(part);
6147
+ const typed = findPathTyped(part);
6148
+ const named = findPathNamed(part);
6149
+ if (union4) {
6150
+ if (isVariable(union4.name) && isCsv(union4.union)) {
6151
+ pathVars[union4.name] = `string(${union4.union})`;
6152
+ }
6153
+ } else if (typed && segmentTypes.includes(typed.type) && isVariable(typed.name)) {
6154
+ pathVars[typed.name] = typed.type;
6155
+ } else if (named && isVariable(named.name)) {
6156
+ pathVars[named.name] = "string";
6157
+ }
6158
+ }
6159
+ const qpVars = {};
6160
+ const qpParts = stripLeading(qp, "?").split("&");
6161
+ for (const p of qpParts) {
6162
+ const union4 = infer(`{{infer var}}=<string({{infer params}})>`)(p);
6163
+ const dynamic = infer(`{{infer var}}=<{{infer val}}>`)(p);
6164
+ const fixed = infer(`{{infer var}}={{infer val}}`)(p);
6165
+ if (union4 && isVariable(union4.var) && isCsv(union4.params)) {
6166
+ qpVars[union4.var] = `string(${union4.params})`;
6167
+ } else if (dynamic && isVariable(dynamic.var) && segmentTypes.includes(dynamic.val)) {
6168
+ qpVars[dynamic.var] = dynamic.val;
6169
+ } else if (fixed && isVariable(fixed.var)) {
6170
+ qpVars[fixed.var] = fixed.val;
6171
+ }
6172
+ }
6173
+ return {
6174
+ pathVars,
6175
+ qpVars,
6176
+ allVars: hasOverlappingKeys(pathVars, qpVars) ? null : {
6177
+ ...pathVars,
6178
+ ...qpVars
6179
+ }
6269
6180
  };
6270
6181
  }
6271
- function isEqual(base) {
6272
- return (value) => isSameTypeOf(base)(value) ? value === base : false;
6273
- }
6274
- function isLength(value, len) {
6275
- return isArray(value) ? !!isEqual(value.length)(len) : isString(value) ? !!isEqual(value.length)(len) : isObject(value) ? !!isEqual(keysOf(value))(len) : false;
6276
- }
6277
- function isSameTypeOf(base) {
6278
- return (compare) => {
6279
- return typeof base === typeof compare;
6182
+ function urlMeta(url) {
6183
+ return {
6184
+ url,
6185
+ isUrl: isUrl(url),
6186
+ protocol: getUrlProtocol(url),
6187
+ path: getUrlPath(url),
6188
+ queryParameters: getUrlQueryParams(url),
6189
+ params: getUrlDynamics,
6190
+ port: getUrlPort(url),
6191
+ source: getUrlSource(url),
6192
+ isIpAddress: isIpAddress(getUrlSource(url)),
6193
+ isIp4Address: isIp4Address(getUrlSource(url)),
6194
+ isIp6Address: isIp6Address(getUrlSource(url))
6280
6195
  };
6281
6196
  }
6282
- function isTuple(...tuple3) {
6283
- const results = tuple3.map((i) => i(ShapeApiImplementation)).map((i) => isDoneFn(i) ? i.done() : i);
6284
- return (v) => {
6285
- return isArray(v) && v.length === results.length && results.every(isShape) && v.every((item, idx) => isSameTypeOf(results[idx])(item));
6286
- };
6197
+ function getYouTubePageType(url) {
6198
+ return isYouTubeUrl(url) ? isYouTubeVideoUrl(url) && (hasUrlQueryParameter(url, "v") || isYouTubeShareUrl(url)) ? hasUrlQueryParameter(url, "list") ? isYouTubeShareUrl(url) ? hasUrlQueryParameter(url, "t") ? `play::video::in-list::share-link::with-timestamp` : `play::video::in-list::share-link` : `play::video::in-list` : isYouTubeShareUrl(url) ? hasUrlQueryParameter(url, "t") ? `play::video::solo::share-link::with-timestamp` : `play::video::solo::share-link` : `play::video::solo` : isYouTubeCreatorUrl(url) ? getUrlPath(url).includes("/videos") ? "creator::videos" : getUrlPath(url).includes("/playlists") ? "creator::playlists" : last(getUrlPath(url).split("/")).startsWith("@") || getUrlPath(url).includes("/featured") ? "creator::featured" : "creator::other" : isYouTubeFeedUrl(url) ? isYouTubeFeedUrl(url, "history") ? "feed::history" : isYouTubeFeedUrl(url, "playlists") ? "feed::playlists" : isYouTubeFeedUrl(url, "liked") ? "feed::liked" : isYouTubeFeedUrl(url, "subscriptions") ? "feed::subscriptions" : isYouTubeFeedUrl(url, "trending") ? "feed::trending" : "feed::other" : isYouTubeVideosInPlaylist(url) ? "playlist::show" : "other" : Never2;
6287
6199
  }
6288
- function isTypeOf(type) {
6289
- return (value) => {
6290
- return typeof value === type;
6291
- };
6200
+ function youtubeEmbed(url) {
6201
+ if (hasUrlQueryParameter(url, "v")) {
6202
+ const id = getUrlQueryParams(url, "v");
6203
+ return `https://www.youtube.com/embed/${id}`;
6204
+ } else if (isYouTubeShareUrl(url)) {
6205
+ const id = url.split("/").pop();
6206
+ if (id) {
6207
+ return `https://www.youtube.com/embed/${id}`;
6208
+ } else {
6209
+ throw new Error(`Unexpected problem parsing share URL -- "${url}" -- into a YouTube embed URL`);
6210
+ }
6211
+ } else {
6212
+ throw new Error(`Unexpected URL structure; unable to convert "${url}" to a YouTube embed URL`);
6213
+ }
6292
6214
  }
6293
- function startsWith(startingWith) {
6294
- return (val) => {
6295
- return isString(val) ? !!val.startsWith(startingWith) : isNumber(val) ? !!String(val).startsWith(startingWith) : false;
6215
+ function youtubeMeta(url) {
6216
+ return isYouTubeUrl(url) ? {
6217
+ url,
6218
+ isYouTubeUrl: true,
6219
+ isShareUrl: isYouTubeShareUrl(url),
6220
+ pageType: getYouTubePageType(url)
6221
+ } : {
6222
+ url,
6223
+ isYouTubeUrl: false
6296
6224
  };
6297
6225
  }
6298
- function isHtmlElement(val) {
6299
- return isObject(val) && "attributes" in val && "firstElementChild" in val && "innerHTML" in val;
6226
+ function queue(state) {
6227
+ return {
6228
+ queue: state,
6229
+ size: state.length,
6230
+ isEmpty() {
6231
+ return state.length === 0;
6232
+ },
6233
+ clear() {
6234
+ state.slice(0, 0);
6235
+ },
6236
+ drain() {
6237
+ const old_state = [...state];
6238
+ state.slice(0, 0);
6239
+ return old_state;
6240
+ },
6241
+ push(...add) {
6242
+ state.push(...add);
6243
+ },
6244
+ drop(quantity) {
6245
+ if (quantity && quantity > state.length) {
6246
+ throw new Error("Cannot drop more elements than present in the queue");
6247
+ }
6248
+ state.splice(0, quantity || 1);
6249
+ },
6250
+ take(quantity) {
6251
+ if (quantity && quantity > state.length) {
6252
+ throw new Error("Cannot take more elements than present in the queue");
6253
+ }
6254
+ const result2 = state.slice(0, quantity || 1);
6255
+ state.splice(0, quantity || 1);
6256
+ return result2;
6257
+ },
6258
+ *[Symbol.iterator]() {
6259
+ for (let i = 0; i < state.length; i++) {
6260
+ yield state[i];
6261
+ }
6262
+ }
6263
+ };
6300
6264
  }
6301
- function isAlpha(value) {
6302
- return isString(value) && split(value).every((v) => ALPHA_CHARS2.includes(v));
6265
+ function createFifoQueue(...list2) {
6266
+ return queue([...list2]);
6303
6267
  }
6304
- function isArray(value) {
6305
- return Array.isArray(value) === true;
6268
+ function queue2(state) {
6269
+ return {
6270
+ queue: state,
6271
+ size: state.length,
6272
+ isEmpty() {
6273
+ return state.length === 0;
6274
+ },
6275
+ push(...add) {
6276
+ state.push(...add);
6277
+ },
6278
+ drop(quantity) {
6279
+ state.splice(-quantity);
6280
+ },
6281
+ clear() {
6282
+ state.slice(0, 0);
6283
+ },
6284
+ drain() {
6285
+ const old_state = [...state];
6286
+ state.slice(0, 0);
6287
+ return old_state;
6288
+ },
6289
+ take(quantity) {
6290
+ const result2 = state.slice(-quantity);
6291
+ state.splice(-quantity);
6292
+ return result2;
6293
+ },
6294
+ *[Symbol.iterator]() {
6295
+ for (let i = state.length - 1; i >= 0; i--) {
6296
+ yield state[i];
6297
+ }
6298
+ }
6299
+ };
6306
6300
  }
6307
- function isBoolean(value) {
6308
- return typeof value === "boolean";
6301
+ function createLifoQueue(...list2) {
6302
+ return queue2([...list2]);
6309
6303
  }
6310
- function isBooleanLike(val) {
6311
- return isBoolean(val) || isString(val) && ["true", "false", "boolean"].includes(val);
6304
+ var scalarToToken = identity({
6305
+ string: "<<string>>",
6306
+ number: "<<number>>",
6307
+ boolean: "<<boolean>>",
6308
+ true: "<<true>>",
6309
+ false: "<<false>>",
6310
+ null: "<<null>>",
6311
+ undefined: "<<undefined>>",
6312
+ unknown: "<<unknown>>",
6313
+ any: "<<any>>",
6314
+ never: "<<never>>"
6315
+ });
6316
+ function stringLiteral(str) {
6317
+ return stripAfter(stripBefore(str, "string("), ")");
6318
+ }
6319
+ function numericLiteral(str) {
6320
+ return stripAfter(stripBefore(str, "number("), ")");
6321
+ }
6322
+ function handleOptional(token) {
6323
+ const bare = stripTrailing(stripLeading(token, "Opt<"), ">");
6324
+ return bare.startsWith("string") ? `<<union::[ <<string>>, <<undefined>> ]>>` : bare.startsWith("number") ? `<<union::[ <<number>>, <<undefined>> ]>>` : bare.startsWith("boolean") ? `<<union::[ <<boolean>>, <<undefined>> ]>>` : bare.startsWith("unknown") ? `<<union::[ <<unknown>>, <<undefined>> ]>>` : `<<never>>`;
6325
+ }
6326
+ function simpleScalarTokenToTypeToken(val) {
6327
+ return val in scalarToToken ? scalarToToken[val] : val.startsWith("string(") ? stringLiteral(val).includes(",") ? `<<union::[ ${stringLiteral(val).split(/,\s?/).map((i) => `"${i}"`).join(", ")} ]>>` : `<<string::${stringLiteral(val)}>>` : val.startsWith("number(") ? numericLiteral(val).includes(",") ? `<<union::[ ${numericLiteral(val).split(/,\s?/).join(", ")} ]>>` : `<<number::${numericLiteral(val)}>>` : val.startsWith("Opt<") ? handleOptional(val) : `<<never>>`;
6328
+ }
6329
+ function unionNode(node) {
6330
+ return isNumberLike(node) ? `<<number::${node}>>` : isBooleanLike(node) ? `<<${node}>>` : isSimpleContainerToken(node) ? simpleContainerTokenToTypeToken(node) : isSimpleScalarToken(node) ? simpleScalarToken(node) : `<<string::${node}>>`;
6331
+ }
6332
+ function union(nodes) {
6333
+ return Array.isArray(nodes) ? nodes.map((n) => unionNode(n)) : nodes.includes(",") ? nodes.split(/,\s?/).map((n) => unionNode(n)).join(", ") : unionNode(nodes);
6334
+ }
6335
+ var stripUnion = stripSurround("Union(", ")");
6336
+ function simpleUnionTokenToTypeToken(val) {
6337
+ return val.startsWith(`Union(`) && val.endsWith(`)`) ? `<<union::[ ${union(stripUnion(val))} ]>>` : Never2;
6338
+ }
6339
+ function simpleContainerTokenToTypeToken(_val) {
6340
+ }
6341
+ function asTypeToken(_val) {
6342
+ return "not ready";
6343
+ }
6344
+ function addToken(token, ...params) {
6345
+ return `<<${token}${params.length > 0 ? `::${params.join("::")}` : ""}>>`;
6346
+ }
6347
+ function boolean(literal2) {
6348
+ return isDefined(literal2) ? isTrue(literal2) ? addToken("true") : isFalse(literal2) ? addToken("false") : addToken("boolean") : addToken("boolean");
6349
+ }
6350
+ var unknown = () => "<<unknown>>";
6351
+ var undefinedType = () => "<<undefined>>";
6352
+ var nullType = () => "<<null>>";
6353
+ function fn(..._args) {
6354
+ return {
6355
+ returns: (_rtn) => ({
6356
+ addProperties: (_kv) => {
6357
+ return null;
6358
+ },
6359
+ done: () => {
6360
+ return null;
6361
+ }
6362
+ }),
6363
+ done: () => {
6364
+ const result2 = null;
6365
+ return result2;
6366
+ }
6367
+ };
6368
+ }
6369
+ function dictionary(_obj) {
6370
+ return null;
6371
+ }
6372
+ function tuple2(..._elements) {
6373
+ return null;
6374
+ }
6375
+ function regexToken(re, ...rep) {
6376
+ let exp = "";
6377
+ if (isString(re)) {
6378
+ try {
6379
+ const test = new RegExp(re);
6380
+ if (!isRegExp(test)) {
6381
+ const err = new Error(`Invalid RegEx passed into regexToken(${re}, ${JSON.stringify(rep)})!`);
6382
+ err.name = "InvalidRegEx";
6383
+ throw err;
6384
+ } else {
6385
+ exp = re;
6386
+ }
6387
+ } catch {
6388
+ const err = new Error(`Invalid RegEx passed into regexToken(${re}, ${JSON.stringify(rep)})!`);
6389
+ err.name = "InvalidRegEx";
6390
+ throw err;
6391
+ }
6392
+ } else if (isRegExp(re)) {
6393
+ exp = re.toString();
6394
+ }
6395
+ const token = `<<string-set::regexp::${encodeURIComponent(exp)}>>`;
6396
+ return token;
6397
+ }
6398
+ function addSingleton(token, api2) {
6399
+ return (...literals) => {
6400
+ return literals.length === 0 ? api2 || addToken(token) : literals.length === 1 ? addToken(token, literals[0]) : addToken(
6401
+ "union",
6402
+ literals.map((l) => addToken(token, `${l}`)).join(",")
6403
+ );
6404
+ };
6405
+ }
6406
+ var stringApi = {
6407
+ startsWith: (startsWith2) => addToken(`string-set`, `startsWith::${startsWith2}`),
6408
+ endsWith: (endsWith2) => addToken(`string-set`, `endsWith::${endsWith2}`),
6409
+ zip: () => addToken("string-set", "Zip5"),
6410
+ zipPlus4: () => addToken("string-set", "Zip5_4"),
6411
+ zipCode: () => addToken("string-set", "ZipCode"),
6412
+ militaryTime: (resolution) => {
6413
+ return addToken(
6414
+ "string-set",
6415
+ "militaryTime",
6416
+ resolution || "HH:MM"
6417
+ );
6418
+ },
6419
+ civilianTime: (resolution) => {
6420
+ return addToken(
6421
+ "string-set",
6422
+ "militaryTime",
6423
+ resolution || "HH:MM"
6424
+ );
6425
+ },
6426
+ numericString: () => addToken("string-set", "numeric"),
6427
+ ipv4Address: () => addToken("string-set", "ipv4Address"),
6428
+ ipv6Address: () => addToken("string-set", "ipv6Address"),
6429
+ regex: (exp, ...literalRepresentation) => {
6430
+ const token = regexToken(exp, ...literalRepresentation);
6431
+ return token;
6432
+ },
6433
+ done: () => addToken("string")
6434
+ };
6435
+ var string22 = addSingleton("string", stringApi);
6436
+ var number = addSingleton("number");
6437
+ function union2(...elements) {
6438
+ const result2 = elements.map((_el) => {
6439
+ });
6440
+ return result2;
6441
+ }
6442
+ function record(_key, _value) {
6443
+ return null;
6444
+ }
6445
+ function array(_type) {
6446
+ return null;
6447
+ }
6448
+ function set(_type) {
6449
+ return null;
6450
+ }
6451
+ function map(_key, _value) {
6452
+ return null;
6453
+ }
6454
+ function weakMap(_key, _value) {
6455
+ return null;
6456
+ }
6457
+ function isAddOrDone(val) {
6458
+ return isObject(val) && hasKeys("add", "done") && typeof val.done === "function" && typeof val.add === "function";
6459
+ }
6460
+ var ShapeApiImplementation = {
6461
+ string: string22,
6462
+ number,
6463
+ boolean,
6464
+ unknown,
6465
+ undefined: undefinedType,
6466
+ null: nullType,
6467
+ union: union2,
6468
+ fn,
6469
+ record,
6470
+ array,
6471
+ set,
6472
+ map,
6473
+ weakMap,
6474
+ dictionary,
6475
+ tuple: tuple2
6476
+ };
6477
+ function shape(cb) {
6478
+ const rtn = cb(ShapeApiImplementation);
6479
+ return handleDoneFn(
6480
+ isAddOrDone(rtn) ? rtn.done() : rtn
6481
+ );
6482
+ }
6483
+ function isShape(v) {
6484
+ return !!(isString(v) && v.startsWith("<<") && v.endsWith(">>") && SHAPE_PREFIXES2.some((i) => v.startsWith(`<<${i}`)));
6485
+ }
6486
+ function asDefineObject(defn) {
6487
+ const result2 = Object.keys(defn).reduce(
6488
+ (acc, i) => isSimpleToken(defn[i]) ? { ...acc, [i]: asType(defn[i]) } : isDoneFn(defn[i]) ? {
6489
+ ...acc,
6490
+ [i]: handleDoneFn(defn[i](ShapeApiImplementation))
6491
+ } : isFunction(defn[i]) ? {
6492
+ ...acc,
6493
+ [i]: handleDoneFn(defn[i](ShapeApiImplementation))
6494
+ } : Never2,
6495
+ {}
6496
+ );
6497
+ return result2;
6498
+ }
6499
+ function asType(...token) {
6500
+ return isFunction(token) ? token(ShapeApiImplementation) : token.length === 1 ? isFunction(token[0]) ? handleDoneFn(token[0](ShapeApiImplementation)) : isDefineObject(token[0]) ? asDefineObject(token[0]) : token[0] : token.map((i) => isFunction(i) ? handleDoneFn(i(ShapeApiImplementation)) : i);
6501
+ }
6502
+ function asStringLiteral(...values) {
6503
+ return values.map((i) => i);
6504
+ }
6505
+ var choices = "NOT READY";
6506
+ function doesExtend(type) {
6507
+ return (val) => {
6508
+ let response = false;
6509
+ if (isString(val)) {
6510
+ if (type === "string") {
6511
+ response = true;
6512
+ }
6513
+ if (type.startsWith("string(")) {
6514
+ const literals = stripAfter(
6515
+ stripBefore(type, "string("),
6516
+ ")"
6517
+ ).split(/,\s*/);
6518
+ if (literals.includes(val)) {
6519
+ response = true;
6520
+ }
6521
+ }
6522
+ }
6523
+ if (isNumber(val)) {
6524
+ if (type === "number") {
6525
+ response = true;
6526
+ }
6527
+ if (type.startsWith("number(")) {
6528
+ const literals = stripAfter(
6529
+ stripBefore(type, "number("),
6530
+ ")"
6531
+ ).split(/,\s*/).map(Number);
6532
+ if (literals.includes(val)) {
6533
+ response = true;
6534
+ }
6535
+ }
6536
+ }
6537
+ if (isNull(val) && (type === "null" || type === "Opt<null>")) {
6538
+ response = true;
6539
+ }
6540
+ if (isUndefined(val) && (type === "undefined" || type.startsWith("Opt<"))) {
6541
+ response = true;
6542
+ }
6543
+ if (isBoolean(val)) {
6544
+ if (type === "boolean") {
6545
+ response = true;
6546
+ }
6547
+ if (type === "true" && val === true || type === "false" && val === false) {
6548
+ response = true;
6549
+ }
6550
+ }
6551
+ if (isNarrowableObject(val)) {
6552
+ if (type === "Dict" || type === "Dict<string, unknown>") {
6553
+ response = true;
6554
+ }
6555
+ if (startsWith("Dict<")(type)) {
6556
+ const match = infer("Dict<{{infer key}}, {{infer value}}>")(type);
6557
+ if (match) {
6558
+ const { value } = match;
6559
+ const isOpt = value.includes(`Opt<`);
6560
+ const values = objectValues(val);
6561
+ if (values.every((i) => isOpt ? isString(i) || isUndefined(i) : isString(i)) && type === "Dict<string, string>" || values.every((i) => isOpt ? isUndefined(i) || isNumber(i) : isNumber(i)) && type === "Dict<string, number>" || values.every((i) => isOpt ? isUndefined(i) || isBoolean(i) : isBoolean(i)) && type === "Dict<string, boolean>") {
6562
+ response = true;
6563
+ }
6564
+ }
6565
+ }
6566
+ }
6567
+ if (isArray(val)) {
6568
+ if (type === "Array" || type === "Array<unknown>") {
6569
+ return true;
6570
+ }
6571
+ if (type === "Array<Dict>" && val.every(isObject) || type === "Array<boolean>" && val.every(isBoolean) || type === "Array<string>" && val.every(isString) || type === "Array<number>" && val.every(isNumber) || type === "Array<Map>" && val.every(isMap) || type === "Array<Set>" && val.every(isSetContainer)) {
6572
+ response = true;
6573
+ }
6574
+ }
6575
+ if (isMap(val)) {
6576
+ if (type === "Map" || type === "Map<Dict, Array>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isArray) || type === "Map<Dict, Dict>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isObject) || type === "Map<Dict, boolean>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isBoolean) || type === "Map<Dict, number>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isNumber) || type === "Map<Dict, string>" && Array.from(val.keys()).every(isObject) && Array.from(val.values()).every(isString) || type === "Map<Dict, unknown>" && Array.from(val.keys()).every(isObject) || type === "Map<string, string>" && Array.from(val.keys()).every(isString) && Array.from(val.values()).every(isString) || type === "Map<string, number>" && Array.from(val.keys()).every(isString) && Array.from(val.values()).every(isNumber) || type === "Map<string, boolean>" && Array.from(val.keys()).every(isString) && Array.from(val.values()).every(isBoolean) || type === "Map<string, unknown>" && Array.from(val.keys()).every(isString) || type === "Map<number, string>" && Array.from(val.keys()).every(isNumber) && Array.from(val.values()).every(isString) || type === "Map<number, number>" && Array.from(val.keys()).every(isNumber) && Array.from(val.values()).every(isNumber) || type === "Map<number, boolean>" && Array.from(val.keys()).every(isNumber) && Array.from(val.values()).every(isBoolean) || type === "Map<number, unknown>" && Array.from(val.keys()).every(isNumber)) {
6577
+ response = true;
6578
+ }
6579
+ }
6580
+ if (isSetContainer(val)) {
6581
+ if (type === "Set" || type === "Set<unknown>" || type === "Set<boolean>" && Array.from(val).every(isBoolean) || type === "Set<string>" && Array.from(val).every(isString) || type === "Set<number>" && Array.from(val).every(isNumber) || type === "Set<Opt<boolean>>" && Array.from(val).every((i) => isBoolean(i) || isUndefined(i)) || type === "Set<Opt<string>>" && Array.from(val).every((i) => isString(i) || isUndefined(i)) || type === "Set<Opt<number>>" && Array.from(val).every((i) => isNumber(i) || isUndefined(i))) {
6582
+ response = true;
6583
+ }
6584
+ }
6585
+ return response;
6586
+ };
6587
+ }
6588
+ function ip6Prefix(...groups) {
6589
+ const empty = addToken("string");
6590
+ const count = 4 - groups.length;
6591
+ const fillIn = [];
6592
+ for (let index = 0; index < count; index++) {
6593
+ fillIn.push(empty);
6594
+ }
6595
+ return [
6596
+ "<<string::",
6597
+ [
6598
+ groups.join(":"),
6599
+ fillIn.join(":")
6600
+ ].join(":"),
6601
+ ">>"
6602
+ ].join("");
6603
+ }
6604
+ function createProxy(...initialize) {
6605
+ const state = initialize;
6606
+ state.id = null;
6607
+ const proxy = new Proxy(state, {});
6608
+ Object.defineProperty(proxy, "id", {
6609
+ enumerable: false
6610
+ });
6611
+ return proxy;
6612
+ }
6613
+ function list(...init) {
6614
+ return init.length === 1 && isArray(init[0]) ? createProxy(...init[0]) : createProxy(...init);
6615
+ }
6616
+ function singletonApi(kind) {
6617
+ return {
6618
+ wide: () => `<<${kind}>>`,
6619
+ literal: (val) => `<<${kind}::${val}>>`
6620
+ };
6621
+ }
6622
+ function setApi(_variant) {
6623
+ return null;
6312
6624
  }
6313
- function isConstant(value) {
6314
- return !!(isObject(value) && "_type" in value && "kind" in value && value._type === "Constant");
6625
+ function fnReturnsApi(variant, _params, returns) {
6626
+ return isSet(returns) ? null : (_rtn) => {
6627
+ return isSet(returns) ? `<<${variant}::>>` : null;
6628
+ };
6315
6629
  }
6316
- function isContainer(value) {
6317
- return !!(Array.isArray(value) || isObject(value));
6630
+ function fnParamsApi(variant, params, _returns) {
6631
+ return isSet(params) ? null : (params2) => {
6632
+ return isSet(params2) ? `<<${variant}::>>` : null;
6633
+ };
6318
6634
  }
6319
- var tokens = [
6320
- "1",
6321
- "inherit",
6322
- "initial",
6323
- "revert",
6324
- "revert-layer",
6325
- "unset",
6326
- "auto"
6327
- ];
6328
- var isRatio = (val) => /\d{1,4}\s*\/\s*\d{1,4}/.test(val);
6329
- function isCssAspectRatio(val) {
6330
- return isString(val) && val.split(/\s+/).every((i) => tokens.includes(i) || isRatio(i));
6635
+ function fnDoneApi(variant, params, returns) {
6636
+ return isUnset(params) && isUnset(returns) ? `<<` : ``;
6331
6637
  }
6332
- function isCsv(val) {
6333
- return isString(val) && val.includes(",") && !val.startsWith(",");
6638
+ function fnTokenClosure(kind, params, returns) {
6639
+ return {
6640
+ done: fnDoneApi(kind, params, returns),
6641
+ params: fnParamsApi(kind, params, returns),
6642
+ returns: fnReturnsApi(kind, params, returns)
6643
+ };
6334
6644
  }
6335
- function isDefined(value) {
6336
- return typeof value !== "undefined";
6645
+ function createTypeToken(kind) {
6646
+ return isAtomicKind(kind) ? `<<${kind}>>` : isSingletonKind(kind) ? singletonApi(kind) : isSetBasedKind(kind) ? setApi(kind) : isFnBasedKind(kind) ? handleDoneFn(fnTokenClosure(kind, unset, unset)) : "<<never>>";
6337
6647
  }
6338
- function isDoneFn(val) {
6339
- return hasKeys("done")(val) && typeof val.done === "function";
6648
+ function fromDefineObject(defn) {
6649
+ return defn;
6340
6650
  }
6341
- function isEmail(val) {
6342
- if (!isString(val)) {
6343
- return false;
6344
- }
6345
- const parts = val?.split("@");
6346
- const domain = parts[1]?.split(".");
6347
- const tld = domain ? domain.pop() : "";
6348
- const firstChar = val[0].toLowerCase();
6349
- return isString(val) && (LOWER_ALPHA_CHARS2.includes(firstChar) && parts.length === 2 && domain.length >= 1 && tld.length >= 2);
6651
+ function getTokenKind(token) {
6652
+ const bare = stripSurround("<<", ">>")(token);
6653
+ const parts = bare.split("::");
6654
+ const kind = parts.pop();
6655
+ return kind;
6350
6656
  }
6351
- function isEmpty(val) {
6352
- return isUndefined(val) || isNull(val) || isString(val) && val.length === 0 || isObject(val) && Object.keys(val).length === 0 || isArray(val) && val.length === 0;
6657
+ var simpleToken = (token) => token;
6658
+ var simpleScalarToken = (token) => token;
6659
+ var simpleContainerToken = (token) => token;
6660
+ function simpleScalarType(token) {
6661
+ const value = simpleScalarToken(token);
6662
+ return value;
6353
6663
  }
6354
- function isErrorCondition(value, kind = null) {
6355
- return isObject(value) && "__kind" in value && value.__kind === "ErrorCondition" && "kind" in value ? kind !== null ? value.kind === kind : true : false;
6664
+ function simpleContainerType(token) {
6665
+ const value = simpleContainerToken(token);
6666
+ return value;
6356
6667
  }
6357
- function isFalse(i) {
6358
- return typeof i === "boolean" && !i;
6668
+ function simpleType(token) {
6669
+ const value = isSimpleScalarToken(token) ? simpleScalarType(token) : isSimpleContainerToken(token) ? simpleContainerToken(token) : Never2;
6670
+ return value;
6359
6671
  }
6360
- function isFalsy(val) {
6361
- return FALSY_VALUES2.includes(val);
6672
+ function hasOverlappingKeys(a, b) {
6673
+ const keys = Object.keys(a);
6674
+ for (const k of keys) {
6675
+ if (k in b) {
6676
+ return true;
6677
+ }
6678
+ }
6679
+ return false;
6362
6680
  }
6363
- function isFnWithParams(input, ...params) {
6364
- return params.length === 0 ? typeof input === "function" && input?.length > 0 : typeof input === "function" && input?.length === params.length;
6681
+ function uniqueKeys(left, right) {
6682
+ const isNumeric = !!(isArray(left) && isArray(right));
6683
+ if (isArray(left) && !isArray(right) || isArray(right) && !isArray(left)) {
6684
+ throw new Error("uniqueKeys(l,r) given invalid comparison; both left and right values should be an object or an array but not one of each!");
6685
+ }
6686
+ const l = isNumeric ? Object.keys(left).map((i) => Number(i)) : Object.keys(left);
6687
+ const r = isNumeric ? Object.keys(right).map((i) => Number(i)) : Object.keys(right);
6688
+ if (isNumeric) {
6689
+ throw new Error("uniqueKeys does not yet work with tuples");
6690
+ }
6691
+ const leftKeys = l.filter((i) => !r.includes(i));
6692
+ const rightKeys = r.filter((i) => !l.includes(i));
6693
+ return [
6694
+ "LeftRight",
6695
+ leftKeys,
6696
+ rightKeys
6697
+ ];
6365
6698
  }
6366
- function isHexadecimal(val) {
6367
- return isString(val) && asChars(val).every((i) => isNumericString(i) || ["a", "b", "c", "d", "e", "f"].includes(i.toLowerCase()));
6699
+ function asChars(str) {
6700
+ return str.split("");
6368
6701
  }
6369
- function isIndexable(value) {
6370
- return !!(Array.isArray(value) || typeof value === "object" && keysOf(value).length > 0);
6702
+ function asRecord(obj) {
6703
+ return obj;
6371
6704
  }
6372
- function isInlineSvg(v) {
6373
- return isString(v) && v.trim().startsWith(`<svg`) && v.trim().endsWith(`</svg>`);
6705
+ function asString(value) {
6706
+ return isString(value) ? value : isNumber(value) ? `${value}` : isBoolean(value) ? `${value}` : isArray(value) ? value.join("") : String(value);
6374
6707
  }
6375
- function isMap(val) {
6376
- return val instanceof Map;
6708
+ function isFunction(value) {
6709
+ return typeof value === "function";
6377
6710
  }
6378
- function isNever(val) {
6379
- return isConstant(val) && val.kind === "never";
6711
+ function isObject(value) {
6712
+ return typeof value === "object" && value !== null && Array.isArray(value) === false;
6380
6713
  }
6381
- function isNothing(val) {
6382
- return !!(val === null || val === void 0);
6714
+ function isNarrowableObject(value) {
6715
+ return isObject(value) && Object.keys(value).every((key) => ["string", "number", "boolean", "symbol", "object", "undefined", "void", "null"].includes(typeof value[key]));
6383
6716
  }
6384
- function isNotNull(value) {
6385
- return value === null;
6717
+ function isEscapeFunction(val) {
6718
+ return isFunction(val) && "escape" in val && val.escape === true;
6386
6719
  }
6387
- function isPhoneNumber(val) {
6388
- const svelte = String(val).trim();
6389
- const chars = svelte.split("");
6390
- const numeric = retainChars(svelte, ...NUMERIC_CHAR2);
6391
- const valid2 = ["+", "(", ...NUMERIC_CHAR2];
6392
- const nothing = stripChars(svelte, ...[
6393
- ...NUMERIC_CHAR2,
6394
- ...WHITESPACE_CHARS2,
6395
- "(",
6396
- ")",
6397
- "+",
6398
- ".",
6399
- "-"
6400
- ]);
6401
- return chars.every((i) => valid2.includes(i)) && svelte.startsWith(`+`) ? numeric.length >= 8 : svelte.startsWith(`00`) ? numeric.length >= 10 : numeric.length >= 7 && nothing === "";
6720
+ function isOptionalParamFunction(val) {
6721
+ return isFunction(val) && "optionalParams" in val && val.optionalParams === true;
6402
6722
  }
6403
- function isReadonlyArray(value) {
6404
- return Array.isArray(value) === true;
6723
+ function isApi(api2) {
6724
+ return isObject(api2) && "surface" in api2 && "_kind" in api2 && api2._kind === "api";
6405
6725
  }
6406
- function isRef(value) {
6407
- return isObject(value) && "value" in value && Array.from(Object.keys(value)).includes("_value");
6726
+ function isApiSurface(val) {
6727
+ return isObject(val) && Object.keys(val).some((k) => isEscapeFunction(val[k]));
6408
6728
  }
6409
- function isRegExp(val) {
6410
- return val instanceof RegExp;
6729
+ function isDate(val) {
6730
+ return val instanceof Date;
6411
6731
  }
6412
- function isLikeRegExp(val) {
6413
- if (isRegExp(val)) {
6414
- return true;
6732
+ function isIsoDateTime(val) {
6733
+ if (!isString(val)) {
6734
+ return false;
6415
6735
  }
6416
- if (isString(val)) {
6417
- try {
6418
- const _re = new RegExp(val);
6419
- return true;
6420
- } catch {
6736
+ const ISO_DATETIME_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2})?$/;
6737
+ if (!ISO_DATETIME_REGEX.test(val)) {
6738
+ return false;
6739
+ }
6740
+ const [_, ...matches] = val.match(ISO_DATETIME_REGEX) || [];
6741
+ const [year, month, day, hours, minutes, seconds] = matches.map(Number);
6742
+ if (hours >= 24 || minutes >= 60 || seconds != null && seconds >= 60) {
6743
+ return false;
6744
+ }
6745
+ if (month < 1 || month > 12) {
6746
+ return false;
6747
+ }
6748
+ ;
6749
+ const daysInMonth = new Date(year, month, 0).getDate();
6750
+ if (day < 1 || day > daysInMonth) {
6751
+ return false;
6752
+ }
6753
+ ;
6754
+ const tzMatch = val.match(/([+-])(\d{2}):(\d{2})$/);
6755
+ if (tzMatch) {
6756
+ const [_2, _sign, tzHours, tzMinutes] = tzMatch;
6757
+ const numHours = Number.parseInt(tzHours, 10);
6758
+ const numMinutes = Number.parseInt(tzMinutes, 10);
6759
+ if (numHours > 14 || numMinutes > 59) {
6760
+ return false;
6761
+ }
6762
+ if (numHours === 14 && numMinutes > 0) {
6421
6763
  return false;
6422
6764
  }
6423
6765
  }
6424
- return false;
6425
- }
6426
- function isSet(val) {
6427
- return isObject(val) ? val.kind !== "Unset" : true;
6428
- }
6429
- function isSetContainer(val) {
6430
- return val instanceof Set;
6431
- }
6432
- function isStringArray(val) {
6433
- return Array.isArray(val) && val.every((i) => isString(i));
6434
- }
6435
- function isThenable(val) {
6436
- return isObject(val) && "then" in val && "catch" in val && typeof val.then === "function";
6437
- }
6438
- function isTrimable(val) {
6439
- return isString(val) && val !== val.trim();
6440
- }
6441
- function isTrue(value) {
6442
- return value === true;
6443
- }
6444
- function isTruthy(val) {
6445
- return !FALSY_VALUES2.includes(val);
6766
+ return true;
6446
6767
  }
6447
- function isTypeSubtype(val) {
6448
- return isString(val) && val.split("/").length === 2;
6768
+ function isIsoExplicitDate(val) {
6769
+ if (isString(val)) {
6770
+ const parts = val.split("-").map((i) => Number(i));
6771
+ return val.includes("-") ? val.split("-").every((i) => isNumberLike(i)) ? parts[0] >= 0 && parts[0] <= 9999 && parts[1] >= 1 && parts[1] <= 12 && parts[2] >= 1 && parts[2] <= 31 : false : false;
6772
+ } else {
6773
+ return false;
6774
+ }
6449
6775
  }
6450
- function isTypeTuple(value) {
6451
- return Array.isArray(value) && value.length === 3 && typeof value[1] === "function";
6776
+ function isIsoImplicitDate(val) {
6777
+ if (isString(val) && val.length === 8 && isNumberLike(val)) {
6778
+ const year = Number(val.slice(0, 4));
6779
+ const month = Number(val.slice(4, 6));
6780
+ const date = Number(val.slice(6, 8));
6781
+ return year >= 0 && year <= 9999 && month >= 1 && month <= 12 && date >= 1 && date <= 31;
6782
+ } else {
6783
+ return false;
6784
+ }
6452
6785
  }
6453
- function isUnset(val) {
6454
- return isObject(val) && val.kind === "Unset";
6786
+ function isIsoDate(val) {
6787
+ if (isString(val)) {
6788
+ return val.includes("-") ? isIsoExplicitDate(val) : isIsoImplicitDate(val);
6789
+ } else {
6790
+ return false;
6791
+ }
6455
6792
  }
6456
- function isUri(val, ...protocols) {
6457
- const p = protocols.length === 0 ? valuesOf(NETWORK_PROTOCOL_LOOKUP2).flat().filter((i) => i) : protocols;
6458
- return isString(val) && p.some((i) => val.startsWith(`${i}://`));
6793
+ function isIsoExplicitTime(val) {
6794
+ if (isString(val)) {
6795
+ const parts = stripLeading(stripAfter(val, "Z"), "T").split(/[:.]/).map((i) => Number(i));
6796
+ return val.startsWith("T") && val.includes(":") && val.split(":").length === 3 && parts[0] >= 0 && parts[0] <= 23 && parts[1] >= 0 && parts[1] <= 59;
6797
+ } else {
6798
+ return false;
6799
+ }
6459
6800
  }
6460
- function isUrl(val, ...protocols) {
6461
- const p = protocols.length === 0 ? ["http", "https"] : protocols;
6462
- return isString(val) && p.some((i) => val.startsWith(`${i}://`));
6801
+ function isIsoImplicitTime(val) {
6802
+ if (isString(val)) {
6803
+ const parts = stripAfter(val, "Z").split(/[:.]/).map((i) => Number(i));
6804
+ return val.includes(":") && val.split(":").length === 3 && parts[0] >= 0 && parts[0] <= 23 && parts[1] >= 0 && parts[1] <= 59;
6805
+ } else {
6806
+ return false;
6807
+ }
6463
6808
  }
6464
- var VALID = [
6465
- ...ALPHA_CHARS2,
6466
- ...NUMERIC_CHAR2,
6467
- "_",
6468
- "."
6469
- ];
6470
- var alpha = null;
6471
- function valid(chars) {
6472
- return chars.every((i) => VALID.includes(i));
6809
+ function isIsoTime(val) {
6810
+ return isIsoExplicitTime(val) || isIsoImplicitTime(val);
6473
6811
  }
6474
- function isVariable(val) {
6475
- return isString(val) && startsWith(alpha)(val) && valid(asChars(val));
6812
+ function isIsoYear(val) {
6813
+ return !!(isString(val) && val.length === 4 && isNumber(Number(val)) && Number(val) >= 0 && Number(val) <= 9999);
6476
6814
  }
6477
- function separate(s) {
6478
- return stripWhile(s.toLowerCase(), ...NUMERIC_CHAR2).trim();
6815
+ function isLuxonDateTime(val) {
6816
+ return isObject(val) && typeof val === "object" && val !== null && "isValid" in val && "invalidReason" in val && "invalidExplanation" in val && "toISO" in val && "toFormat" in val && "toMillis" in val && "year" in val && "month" in val && "day" in val && "hour" in val && "minute" in val && "second" in val && "millisecond" in val && typeof val.isValid === "boolean" && typeof val.toISO === "function";
6479
6817
  }
6480
- function isAreaMetric(val) {
6481
- return isString(val) && AREA_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6818
+ function isMoment(val) {
6819
+ if (val instanceof Date) {
6820
+ return false;
6821
+ }
6822
+ return isObject(val) && typeof val.format === "function" && typeof val.year === "function" && typeof val.month === "function" && typeof val.date === "function" && "_isAMomentObject" in val && "_isValid" in val && typeof val.add === "function" && typeof val.subtract === "function" && typeof val.toISOString === "function" && typeof val.isValid === "function";
6482
6823
  }
6483
- function isLuminosityMetric(val) {
6484
- return isString(val) && LUMINOSITY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6824
+ function isThisMonth(val) {
6825
+ const now = /* @__PURE__ */ new Date();
6826
+ const currentYear = now.getFullYear();
6827
+ const currentMonth = now.getMonth() + 1;
6828
+ if (val instanceof Date) {
6829
+ return val.getFullYear() === currentYear && val.getMonth() + 1 === currentMonth;
6830
+ }
6831
+ if (isMoment(val)) {
6832
+ const monthValue = val.month();
6833
+ return val.year() === currentYear && (typeof monthValue === "number" ? monthValue + 1 : monthValue) === currentMonth;
6834
+ }
6835
+ if (isLuxonDateTime(val)) {
6836
+ return val.year === currentYear && val.month === currentMonth;
6837
+ }
6838
+ if (typeof val === "string") {
6839
+ const isoDateRegex = /^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])(?:T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[-+][01]\d:[0-5]\d))?$/;
6840
+ if (!isoDateRegex.test(val)) {
6841
+ return false;
6842
+ }
6843
+ const dateMatch = val.match(/^(\d{4})-(\d{2})/);
6844
+ if (dateMatch) {
6845
+ const year = Number.parseInt(dateMatch[1], 10);
6846
+ const month = Number.parseInt(dateMatch[2], 10);
6847
+ return year === currentYear && month === currentMonth;
6848
+ }
6849
+ }
6850
+ return false;
6485
6851
  }
6486
- function isResistance(val) {
6487
- return isString(val) && RESISTANCE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6852
+ function isThisWeek(date) {
6853
+ const targetDate = asDate(date);
6854
+ if (!targetDate) {
6855
+ return false;
6856
+ }
6857
+ const currentWeek = getWeekNumber();
6858
+ const targetWeek = getWeekNumber(targetDate);
6859
+ return currentWeek === targetWeek;
6488
6860
  }
6489
- function isCurrentMetric(val) {
6490
- return isString(val) && CURRENT_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6861
+ function isThisYear(val) {
6862
+ const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
6863
+ if (isObject(val) || isNumber(val) || isString(val)) {
6864
+ const date = asDate(val);
6865
+ if (date) {
6866
+ return date.getFullYear() === currentYear;
6867
+ } else {
6868
+ return false;
6869
+ }
6870
+ }
6871
+ return false;
6491
6872
  }
6492
- function isVoltageMetric(val) {
6493
- return isString(val) && VOLTAGE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6873
+ function isToday(test) {
6874
+ if (isString(test)) {
6875
+ const justDate = stripAfter(test, "T");
6876
+ return isIsoExplicitDate(justDate) && justDate === getToday();
6877
+ } else if (isMoment(test) || isDate(test)) {
6878
+ return stripAfter(test.toISOString(), "T") === getToday();
6879
+ } else if (isLuxonDateTime(test)) {
6880
+ return stripAfter(test.toISO(), "T") === getToday();
6881
+ }
6882
+ return false;
6494
6883
  }
6495
- function isFrequencyMetric(val) {
6496
- return isString(val) && FREQUENCY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6884
+ function isTomorrow(test) {
6885
+ if (isString(test)) {
6886
+ const justDate = stripAfter(test, "T");
6887
+ return isIsoExplicitDate(justDate) && justDate === getTomorrow();
6888
+ } else if (isMoment(test) || isDate(test)) {
6889
+ return stripAfter(test.toISOString(), "T") === getTomorrow();
6890
+ } else if (isLuxonDateTime(test)) {
6891
+ return stripAfter(test.toISO(), "T") === getTomorrow();
6892
+ }
6893
+ return false;
6497
6894
  }
6498
- function isPowerMetric(val) {
6499
- return isString(val) && POWER_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6895
+ function isYesterday(test) {
6896
+ if (isString(test)) {
6897
+ const justDate = stripAfter(test, "T");
6898
+ return isIsoExplicitDate(justDate) && justDate === getYesterday();
6899
+ } else if (isMoment(test) || isDate(test)) {
6900
+ return stripAfter(test.toISOString(), "T") === getYesterday();
6901
+ } else if (isLuxonDateTime(test)) {
6902
+ return stripAfter(test.toISO(), "T") === getYesterday();
6903
+ }
6904
+ return false;
6500
6905
  }
6501
- function isTimeMetric(val) {
6502
- return isString(val) && TIME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6906
+ function isString(value) {
6907
+ return typeof value === "string";
6503
6908
  }
6504
- function isEnergyMetric(val) {
6505
- return isString(val) && ENERGY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6909
+ function isIso3166Alpha2(val) {
6910
+ const codes = ISO3166_12.map((i) => i.alpha2);
6911
+ return isString(val) && codes.includes(val);
6506
6912
  }
6507
- function isPressureMetric(val) {
6508
- return isString(val) && PRESSURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6913
+ function isCountryCode2(val) {
6914
+ const codes = ISO3166_12.map((i) => i.alpha2);
6915
+ return isString(val) && codes.includes(val);
6509
6916
  }
6510
- function isTemperatureMetric(val) {
6511
- return isString(val) && TEMPERATURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6917
+ function isIso3166Alpha3(val) {
6918
+ const codes = ISO3166_12.map((i) => i.alpha3);
6919
+ return isString(val) && codes.includes(val);
6512
6920
  }
6513
- function isVolumeMetric(val) {
6514
- return isString(val) && VOLUME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6921
+ function isCountryCode3(val) {
6922
+ const codes = ISO3166_12.map((i) => i.alpha3);
6923
+ return isString(val) && codes.includes(val);
6515
6924
  }
6516
- function isAccelerationMetric(val) {
6517
- return isString(val) && ACCELERATION_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6925
+ function isIso3166CountryCode(val) {
6926
+ const codes = ISO3166_12.map((i) => i.countryCode);
6927
+ return isString(val) && codes.includes(val);
6518
6928
  }
6519
- function isSpeedMetric(val) {
6520
- const speed = SPEED_METRICS_LOOKUP2.map((i) => i.abbrev);
6521
- return isString(val) && speed.includes(separate(val));
6929
+ function isCountryAbbrev(val) {
6930
+ return isCountryCode2(val) || isCountryCode3(val);
6522
6931
  }
6523
- function isMassMetric(val) {
6524
- return isString(val) && MASS_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6932
+ function isIso3166CountryName(val) {
6933
+ const codes = ISO3166_12.map((i) => i.name);
6934
+ return isString(val) && codes.includes(val);
6525
6935
  }
6526
- function isDistanceMetric(val) {
6527
- return isString(val) && DISTANCE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6936
+ function isCountryName(val) {
6937
+ const codes = ISO3166_12.map((i) => i.name);
6938
+ return isString(val) && codes.includes(val);
6528
6939
  }
6529
- function isMetric(val) {
6530
- return isDistanceMetric(val) || isMassMetric(val) || isSpeedMetric(val) || isAccelerationMetric(val) || isVoltageMetric(val) || isTemperatureMetric(val) || isPressureMetric(val) || isEnergyMetric(val) || isTimeMetric(val) || isPowerMetric(val) || isFrequencyMetric(val) || isVoltageMetric(val) || isCurrentMetric(val) || isLuminosityMetric(val) || isAreaMetric(val);
6940
+ var ABBREV = US_STATE_LOOKUP2.map((i) => i.abbrev);
6941
+ var NAME = US_STATE_LOOKUP2.map((i) => i.name);
6942
+ function isUsStateAbbreviation(val) {
6943
+ return isString(val) && ABBREV.includes(val);
6531
6944
  }
6532
- function isAreaUom(val) {
6533
- return isString(val) && AREA_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6945
+ function isUsStateName(val) {
6946
+ return isString(val) && NAME.includes(val);
6534
6947
  }
6535
- function isLuminosityUom(val) {
6536
- return isString(val) && LUMINOSITY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6948
+ function isNumericString(value) {
6949
+ const numericChars = [...NUMERIC_CHAR2];
6950
+ return typeof value === "string" && split(value).every((i) => numericChars.includes(i));
6537
6951
  }
6538
- function isResistanceUom(val) {
6539
- return isString(val) && RESISTANCE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6952
+ function isNumberLike(value) {
6953
+ const numericChars = [...NUMERIC_CHAR2];
6954
+ return typeof value === "string" && split(value).every((i) => numericChars.includes(i)) ? true : typeof value === "number";
6540
6955
  }
6541
- function isCurrentUom(val) {
6542
- return isString(val) && CURRENT_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6956
+ function isNumber(value) {
6957
+ return typeof value === "number";
6543
6958
  }
6544
- function isVoltageUom(val) {
6545
- return isString(val) && VOLTAGE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6959
+ function isZipCode5(val) {
6960
+ if (isNumber(val)) {
6961
+ return isZipCode5(`${val}`);
6962
+ }
6963
+ return isString(val) && val.trim().length === 5 && isNumberLike(val.trim());
6546
6964
  }
6547
- function isFrequencyUom(val) {
6548
- return isString(val) && FREQUENCY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6965
+ function isZipPlus4(val) {
6966
+ if (isString(val)) {
6967
+ const first = retainWhile(val.trim(), ...NUMERIC_CHAR2);
6968
+ const next = stripChars(val.trim().replace(first, "").trim(), "-");
6969
+ return first.length === 5 && next.length === 4 && isNumberLike(next);
6970
+ }
6971
+ return false;
6549
6972
  }
6550
- function isPowerUom(val) {
6551
- return isString(val) && POWER_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6973
+ function isZipCode(val) {
6974
+ return isZipCode5(val) || isZipPlus4(val);
6552
6975
  }
6553
- function isTimeUom(val) {
6554
- return isString(val) && TIME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6976
+ function isSpecificConstant(kind) {
6977
+ return (value) => {
6978
+ return !!(isConstant(value) && value.kind === kind);
6979
+ };
6555
6980
  }
6556
- function isEnergyUom(val) {
6557
- return isString(val) && ENERGY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6981
+ function hasDefaultValue(value) {
6982
+ const noDefault = isSpecificConstant("no-default-value");
6983
+ return !noDefault(value);
6558
6984
  }
6559
- function isPressureUom(val) {
6560
- return isString(val) && PRESSURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6985
+ function hasIndexOf(value, idx) {
6986
+ const result2 = isObject(value) ? String(idx) in value : Array.isArray(value) ? Number(idx) in value : false;
6987
+ return isErrorCondition(result2, "invalid-index") ? false : result2;
6561
6988
  }
6562
- function isTemperatureUom(val) {
6563
- return isString(val) && TEMPERATURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6989
+ function hasKeys(...props) {
6990
+ return (val) => {
6991
+ const keys = Array.isArray(props) ? props : Object.keys(props).filter((i) => typeof i === "string");
6992
+ return !!((isFunction(val) || isObject(val)) && keys.every((k) => k in val));
6993
+ };
6564
6994
  }
6565
- function isVolumeUom(val) {
6566
- return isString(val) && VOLUME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6995
+ function hasWhiteSpace(val) {
6996
+ return isString(val) && asChars(val).some((c) => WHITESPACE_CHARS2.includes(c));
6567
6997
  }
6568
- function isAccelerationUom(val) {
6569
- return isString(val) && ACCELERATION_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6998
+ function endsWith(endingIn2) {
6999
+ return (val) => {
7000
+ return isString(val) ? !!val.endsWith(endingIn2) : isNumber(val) ? !!String(val).endsWith(endingIn2) : false;
7001
+ };
6570
7002
  }
6571
- function isSpeedUom(val) {
6572
- return isString(val) && SPEED_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
7003
+ function isEqual(base) {
7004
+ return (value) => isSameTypeOf(base)(value) ? value === base : false;
6573
7005
  }
6574
- function isMassUom(val) {
6575
- return isString(val) && MASS_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
7006
+ function isLength(value, len) {
7007
+ return isArray(value) ? !!isEqual(value.length)(len) : isString(value) ? !!isEqual(value.length)(len) : isObject(value) ? !!isEqual(keysOf(value))(len) : false;
6576
7008
  }
6577
- function isDistanceUom(val) {
6578
- return isString(val) && ENERGY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
7009
+ function isSameTypeOf(base) {
7010
+ return (compare) => {
7011
+ return typeof base === typeof compare;
7012
+ };
6579
7013
  }
6580
- function isUom(val) {
6581
- return isDistanceUom(val) || isMassUom(val) || isSpeedUom(val) || isAccelerationUom(val) || isVoltageUom(val) || isTemperatureUom(val) || isPressureUom(val) || isEnergyUom(val) || isTimeUom(val) || isPowerUom(val) || isFrequencyUom(val) || isVoltageUom(val) || isCurrentUom(val) || isLuminosityUom(val) || isAreaUom(val);
7014
+ function isTuple(...tuple3) {
7015
+ const results = tuple3.map((i) => i(ShapeApiImplementation)).map((i) => isDoneFn(i) ? i.done() : i);
7016
+ return (v) => {
7017
+ return isArray(v) && v.length === results.length && results.every(isShape) && v.every((item, idx) => isSameTypeOf(results[idx])(item));
7018
+ };
6582
7019
  }
6583
- function isIp4Address(val) {
6584
- return isString(val) && val.split(".").length === 4 && val.split(".").every((i) => isNumberLike(i)) && val.split(".").every((i) => Number(i) >= 0 && Number(i) <= 255);
7020
+ function isTypeOf(type) {
7021
+ return (value) => {
7022
+ return typeof value === type;
7023
+ };
6585
7024
  }
6586
- function isIp6Address(val) {
6587
- const expanded = isString(val) ? ip6GroupExpansion(val) : "";
6588
- return isString(val) && isString(expanded) && expanded.split(":").every((i) => asChars(i).length >= 1 && asChars(i).length <= 4) && expanded.split(":").every((i) => isHexadecimal(i));
7025
+ function startsWith(startingWith) {
7026
+ return (val) => {
7027
+ return isString(val) ? !!val.startsWith(startingWith) : isNumber(val) ? !!String(val).startsWith(startingWith) : false;
7028
+ };
6589
7029
  }
6590
- function isIpAddress(val) {
6591
- return isIp4Address(val) || isIp6Address(val);
7030
+ function isHtmlElement(val) {
7031
+ return isObject(val) && "attributes" in val && "firstElementChild" in val && "innerHTML" in val;
6592
7032
  }
6593
- function hasUrlPort(val) {
6594
- return isString(val) && asChars(removeUrlProtocol(val)).includes(":");
7033
+ function isAlpha(value) {
7034
+ return isString(value) && split(value).every((v) => ALPHA_CHARS2.includes(v));
6595
7035
  }
6596
- function isUrlPath(val) {
6597
- return isString(val) && (val === "" || val.startsWith("/")) && asChars(val).every(
6598
- (c) => isAlpha(c) || isNumberLike(c) || c === "_" || c === "@" || c === "." || c === "-"
6599
- );
7036
+ function isArray(value) {
7037
+ return Array.isArray(value) === true;
6600
7038
  }
6601
- function isDomainName(val) {
6602
- return isString(val) && val.split(".").filter((i) => i).length > 1 && isString(val.split(".").filter((i) => i).pop()) && asChars(val.split(".").filter((i) => i).pop()).length > 1 && val.split(".").filter((i) => i).every(
6603
- (i) => isAlpha(i) || isNumberLike(i) || i === "-" || i === "_"
6604
- );
7039
+ function isBoolean(value) {
7040
+ return typeof value === "boolean";
6605
7041
  }
6606
- function isUrlSource(val) {
6607
- return isDomainName(val) || isIpAddress(val);
7042
+ function isBooleanLike(val) {
7043
+ return isBoolean(val) || isString(val) && ["true", "false", "boolean"].includes(val);
6608
7044
  }
6609
- function hasUrlQueryParameter(val, prop) {
6610
- return isString(getUrlQueryParams(val, prop));
7045
+ function isConstant(value) {
7046
+ return !!(isObject(value) && "_type" in value && "kind" in value && value._type === "Constant");
6611
7047
  }
6612
- function isNumericArray(val) {
6613
- return Array.isArray(val) && val.every((i) => isNumber(i));
7048
+ function isContainer(value) {
7049
+ return !!(Array.isArray(value) || isObject(value));
6614
7050
  }
6615
- function hasProtocol(val, ...protocols) {
6616
- return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.some((i) => val.startsWith(i)) : protocols.some((i) => val.startsWith(i));
7051
+ var tokens = [
7052
+ "1",
7053
+ "inherit",
7054
+ "initial",
7055
+ "revert",
7056
+ "revert-layer",
7057
+ "unset",
7058
+ "auto"
7059
+ ];
7060
+ var isRatio = (val) => /\d{1,4}\s*\/\s*\d{1,4}/.test(val);
7061
+ function isCssAspectRatio(val) {
7062
+ return isString(val) && val.split(/\s+/).every((i) => tokens.includes(i) || isRatio(i));
6617
7063
  }
6618
- function isProtocol(val, ...protocols) {
6619
- return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.includes(val) : protocols.includes(val);
7064
+ function isCsv(val) {
7065
+ return isString(val) && val.includes(",") && !val.startsWith(",");
6620
7066
  }
6621
- function hasProtocolPrefix(val, ...protocols) {
6622
- return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.map((i) => `${i}://`).some((i) => val.startsWith(i)) : protocols.map((i) => `${i}://`).some((i) => val.startsWith(i));
7067
+ function isDefined(value) {
7068
+ return typeof value !== "undefined";
6623
7069
  }
6624
- function isProtocolPrefix(val, ...protocols) {
6625
- return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.map((i) => `${i}://`).includes(val) : protocols.map((i) => `${i}://`).includes(val);
7070
+ function isDoneFn(val) {
7071
+ return hasKeys("done")(val) && typeof val.done === "function";
6626
7072
  }
6627
- function isTypeToken(val, kind) {
6628
- if (isString(val) && val.startsWith("<<") && val.endsWith(">>")) {
6629
- const stripped = stripSurround("<<", ">>")(val);
6630
- if (TT_KIND_VARIANTS2.some((k) => stripped.startsWith(k))) {
6631
- if (kind) {
6632
- if (isAtomicKind(kind)) {
6633
- return val === `<<${kind}>>`;
6634
- } else if (isSetBasedKind(kind)) {
6635
- return val.startsWith(`<<${kind}::`);
6636
- } else {
6637
- return val === `<<${kind}>>` || val.startsWith(`<<${kind}::`);
6638
- }
6639
- } else {
6640
- return true;
6641
- }
6642
- }
7073
+ function isEmail(val) {
7074
+ if (!isString(val)) {
6643
7075
  return false;
6644
7076
  }
6645
- return false;
6646
- }
6647
- function isTypeTokenKind(val) {
6648
- return !!(isString(val) && TT_KIND_VARIANTS2.includes(val));
6649
- }
6650
- function isAtomicToken(val) {
6651
- return isString(val) && TT_ATOMICS2.some((i) => val.startsWith(`<<${i}`));
6652
- }
6653
- function isAtomicKind(val) {
6654
- return isString(val) && TT_ATOMICS2.includes(val);
7077
+ const parts = val?.split("@");
7078
+ const domain = parts[1]?.split(".");
7079
+ const tld = domain ? domain.pop() : "";
7080
+ const firstChar = val[0].toLowerCase();
7081
+ return isString(val) && (LOWER_ALPHA_CHARS2.includes(firstChar) && parts.length === 2 && domain.length >= 1 && tld.length >= 2);
6655
7082
  }
6656
- function isObjectToken(val) {
6657
- return isTypeToken(val, "obj");
7083
+ function isEmpty(val) {
7084
+ return isUndefined(val) || isNull(val) || isString(val) && val.length === 0 || isObject(val) && Object.keys(val).length === 0 || isArray(val) && val.length === 0;
6658
7085
  }
6659
- function isRecordToken(val) {
6660
- return isTypeToken(val, "rec");
7086
+ function isErrorCondition(value, kind = null) {
7087
+ return isObject(value) && "__kind" in value && value.__kind === "ErrorCondition" && "kind" in value ? kind !== null ? value.kind === kind : true : false;
6661
7088
  }
6662
- function isTupleToken(val) {
6663
- return isTypeToken(val, "tuple");
7089
+ function isFalse(i) {
7090
+ return typeof i === "boolean" && !i;
6664
7091
  }
6665
- function isArrayToken(val) {
6666
- return isTypeToken(val, "arr");
7092
+ function isFalsy(val) {
7093
+ return FALSY_VALUES2.includes(val);
6667
7094
  }
6668
- function isMapToken(val) {
6669
- return isTypeToken(val, "map");
7095
+ function isFnWithParams(input, ...params) {
7096
+ return params.length === 0 ? typeof input === "function" && input?.length > 0 : typeof input === "function" && input?.length === params.length;
6670
7097
  }
6671
- function isSetToken(val) {
6672
- return isTypeToken(val, "set");
7098
+ function isHexadecimal(val) {
7099
+ return isString(val) && asChars(val).every((i) => isNumericString(i) || ["a", "b", "c", "d", "e", "f"].includes(i.toLowerCase()));
6673
7100
  }
6674
- function isContainerToken(val) {
6675
- return isObjectToken(val) || isRecordToken(val) || isTupleToken(val) || isArrayToken(val) || isMapToken(val) || isSetToken(val);
7101
+ function isIndexable(value) {
7102
+ return !!(Array.isArray(value) || typeof value === "object" && keysOf(value).length > 0);
6676
7103
  }
6677
- function isShapeCallback(val) {
6678
- return isFunction(val) && val.kind === "shape";
7104
+ function isInlineSvg(v) {
7105
+ return isString(v) && v.trim().startsWith(`<svg`) && v.trim().endsWith(`</svg>`);
6679
7106
  }
6680
- var token_types = [
6681
- ...TT_ATOMICS2,
6682
- ...TT_CONTAINERS2,
6683
- ...TT_FUNCTIONS2,
6684
- ...TT_SETS2,
6685
- ...TT_SINGLETONS2
6686
- ];
6687
- function isShapeToken(val) {
6688
- return isString(val) && val.startsWith("<<") && val.endsWith(">>") && token_types.some((t) => val.startsWith(`<<${t}`));
7107
+ function isMap(val) {
7108
+ return val instanceof Map;
6689
7109
  }
6690
- var split_tokens = SIMPLE_TOKENS2.map((i) => i.split("TOKEN"));
6691
- var scalar_split_tokens = SIMPLE_SCALAR_TOKENS2.map((i) => i.split("TOKEN"));
6692
- function isSimpleToken(val) {
6693
- return isString(val) && split_tokens.some(
6694
- (i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
6695
- );
7110
+ function isNever(val) {
7111
+ return isConstant(val) && val.kind === "never";
6696
7112
  }
6697
- function isSimpleScalarToken(val) {
6698
- return isString(val) && scalar_split_tokens.some(
6699
- (i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
6700
- );
7113
+ function isNothing(val) {
7114
+ return !!(val === null || val === void 0);
6701
7115
  }
6702
- function isSimpleContainerToken(val) {
6703
- return isString(val) && scalar_split_tokens.some(
6704
- (i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
6705
- );
7116
+ function isNotNull(value) {
7117
+ return value === null;
6706
7118
  }
6707
- function isSimpleTokenTuple(val) {
6708
- return isArray(val) && val.length !== 0 && val.every(isSimpleToken);
7119
+ function isNull(value) {
7120
+ return value === null;
6709
7121
  }
6710
- function isSimpleScalarTokenTuple(val) {
6711
- return isArray(val) && val.length !== 0 && val.every(isSimpleScalarToken);
7122
+ function isPhoneNumber(val) {
7123
+ const svelte = String(val).trim();
7124
+ const chars = svelte.split("");
7125
+ const numeric = retainChars(svelte, ...NUMERIC_CHAR2);
7126
+ const valid2 = ["+", "(", ...NUMERIC_CHAR2];
7127
+ const nothing = stripChars(svelte, ...[
7128
+ ...NUMERIC_CHAR2,
7129
+ ...WHITESPACE_CHARS2,
7130
+ "(",
7131
+ ")",
7132
+ "+",
7133
+ ".",
7134
+ "-"
7135
+ ]);
7136
+ return chars.every((i) => valid2.includes(i)) && svelte.startsWith(`+`) ? numeric.length >= 8 : svelte.startsWith(`00`) ? numeric.length >= 10 : numeric.length >= 7 && nothing === "";
6712
7137
  }
6713
- function isSimpleContainerTokenTuple(val) {
6714
- return isArray(val) && val.length !== 0 && val.every(isSimpleContainerToken);
7138
+ function isReadonlyArray(value) {
7139
+ return Array.isArray(value) === true;
6715
7140
  }
6716
- function isDefineObject(val) {
6717
- return isObject(val) && Object.keys(val).some(
6718
- (key) => isSimpleToken(val[key]) || isShapeToken(val) || isShapeCallback(val)
6719
- );
7141
+ function isRef(value) {
7142
+ return isObject(value) && "value" in value && Array.from(Object.keys(value)).includes("_value");
6720
7143
  }
6721
- function isFnBasedToken(val) {
6722
- if (isString(val) && val.startsWith(TT_START2) && val.endsWith(TT_STOP2)) {
6723
- const stripped = stripSurround(TT_START2, TT_STOP2)(val);
6724
- return TT_FUNCTIONS2.some((i) => stripped.startsWith(i));
6725
- }
7144
+ function isRegExp(val) {
7145
+ return val instanceof RegExp;
6726
7146
  }
6727
- function isFnBasedKind(val) {
6728
- if (isString(val) && isTypeTokenKind(val)) {
6729
- const stripped = stripSurround(TT_START2, TT_STOP2)(val);
6730
- return TT_FUNCTIONS2.some((i) => stripped.startsWith(i));
7147
+ function isLikeRegExp(val) {
7148
+ if (isRegExp(val)) {
7149
+ return true;
6731
7150
  }
6732
- return false;
6733
- }
6734
- function isSetBasedToken(val) {
6735
- if (isTypeToken(val)) {
6736
- const kind = getTokenKind(val);
6737
- return kind.endsWith(`-set`);
7151
+ if (isString(val)) {
7152
+ try {
7153
+ const _re = new RegExp(val);
7154
+ return true;
7155
+ } catch {
7156
+ return false;
7157
+ }
6738
7158
  }
6739
7159
  return false;
6740
7160
  }
6741
- function isSetBasedKind(val) {
6742
- return isString(val) && val.endsWith(`-set`);
6743
- }
6744
- function isSingletonKind(val) {
6745
- return isString(val) && TT_SINGLETONS2.some((i) => val.startsWith(`<<${i}`));
6746
- }
6747
- function isSingletonToken(val) {
6748
- return isString(val) && TT_SINGLETONS2.some((i) => val.startsWith(`<<${i}`));
6749
- }
6750
- function isTailwindColorName(val) {
6751
- return isString(val) && Object.keys(TW_HUE2).includes(val);
6752
- }
6753
- function isTailwindColorWithLuminosity(val) {
6754
- return isString(val) && isTailwindColorName(val.split("-")[0]) && (!["white", "black"].includes(val.split("-")[0]) || val.split("-").length === 1) && (!val.includes("-") || Object.keys(TW_LUMINOSITY2).includes(retainAfter(val, "-")));
6755
- }
6756
- function isTailwindColorWithLuminosityAndOpacity(val) {
6757
- return isString(val) && val.includes("/") && isTailwindColorWithLuminosity(val.split("/")[0]) && isNumberLike(val.split("/")[1]) && ([1, 2].includes(val.split("/")[1].length) || val.split("/")[1] === "100");
6758
- }
6759
- function isTailwindColor(val) {
6760
- return isTailwindColorWithLuminosity(val) || isTailwindColorWithLuminosityAndOpacity(val);
7161
+ function isSymbol(value) {
7162
+ return typeof value === "symbol";
6761
7163
  }
6762
- function isTailwindModifier(val) {
6763
- return isString(val) && TW_MODIFIERS2.includes(val);
7164
+ function isScalar(value) {
7165
+ return isString(value) || isNumber(value) || isSymbol(value) || isNull(value);
6764
7166
  }
6765
- function isTailwindColorTarget(val) {
6766
- return isString(val) && TW_COLOR_TARGETS2.includes(val);
7167
+ function isSet(val) {
7168
+ return isObject(val) ? val.kind !== "Unset" : true;
6767
7169
  }
6768
- function isTailwindColorClass(val, ...allowedModifiers) {
6769
- if (isString(val)) {
6770
- const mods = getTailwindModifiers(val);
6771
- const targetted = removeTailwindModifiers(val);
6772
- const target = targetted.split("-")[0];
6773
- const color = targetted.split("-").slice(1).join("-");
6774
- return isTailwindColorTarget(target) && isTailwindColor(color) && (allowedModifiers[0] === true || mods.every((i) => allowedModifiers.includes(i)));
6775
- }
6776
- return false;
7170
+ function isSetContainer(val) {
7171
+ return val instanceof Set;
6777
7172
  }
6778
- var URL = AUSTRALIAN_NEWS2.flatMap((i) => i.baseUrls);
6779
- function isAustralianNewsUrl(val) {
6780
- return isString(val) && val.startsWith("https://") && (URL.includes(val) || URL.some((i) => i.startsWith(`${i}/`)));
7173
+ function isStringArray(val) {
7174
+ return Array.isArray(val) && val.every((i) => isString(i));
6781
7175
  }
6782
- var URL2 = BELGIUM_NEWS2.flatMap((i) => i.baseUrls);
6783
- function isBelgiumNewsUrl(val) {
6784
- return isString(val) && val.startsWith("https://") && (URL2.includes(val) || URL2.some((i) => i.startsWith(`${i}/`)));
7176
+ function isThenable(val) {
7177
+ return isObject(val) && "then" in val && "catch" in val && typeof val.then === "function";
6785
7178
  }
6786
- var URL3 = CANADIAN_NEWS2.flatMap((i) => i.baseUrls);
6787
- function isCanadianNewsUrl(val) {
6788
- return isString(val) && val.startsWith("https://") && (URL3.includes(val) || URL3.some((i) => i.startsWith(`${i}/`)));
7179
+ function isTrimable(val) {
7180
+ return isString(val) && val !== val.trim();
6789
7181
  }
6790
- var URL4 = DANISH_NEWS2.flatMap((i) => i.baseUrls);
6791
- function isDanishNewsUrl(val) {
6792
- return isString(val) && val.startsWith("https://") && (URL4.includes(val) || URL4.some((i) => i.startsWith(`${i}/`)));
7182
+ function isTrue(value) {
7183
+ return value === true;
6793
7184
  }
6794
- var URL5 = DUTCH_NEWS2.flatMap((i) => i.baseUrls);
6795
- function isDutchNewsUrl(val) {
6796
- return isString(val) && val.startsWith("https://") && (URL5.includes(val) || URL5.some((i) => i.startsWith(`${i}/`)));
7185
+ function isTruthy(val) {
7186
+ return !FALSY_VALUES2.includes(val);
6797
7187
  }
6798
- var URL6 = FRENCH_NEWS2.flatMap((i) => i.baseUrls);
6799
- function isFrenchNewsUrl(val) {
6800
- return isString(val) && val.startsWith("https://") && (URL6.includes(val) || URL6.some((i) => i.startsWith(`${i}/`)));
7188
+ function isTypeSubtype(val) {
7189
+ return isString(val) && val.split("/").length === 2;
6801
7190
  }
6802
- var URL7 = GERMAN_NEWS2.flatMap((i) => i.baseUrls);
6803
- function isGermanNewsUrl(val) {
6804
- return isString(val) && val.startsWith("https://") && (URL7.includes(val) || URL7.some((i) => i.startsWith(`${i}/`)));
7191
+ function isTypeTuple(value) {
7192
+ return Array.isArray(value) && value.length === 3 && typeof value[1] === "function";
6805
7193
  }
6806
- var URL8 = INDIAN_NEWS2.flatMap((i) => i.baseUrls);
6807
- function isIndianNewsUrl(val) {
6808
- return isString(val) && val.startsWith("https://") && (URL8.includes(val) || URL8.some((i) => i.startsWith(`${i}/`)));
7194
+ function isUndefined(value) {
7195
+ return typeof value === "undefined";
6809
7196
  }
6810
- var URL9 = ITALIAN_NEWS2.flatMap((i) => i.baseUrls);
6811
- function isItalianNewsUrl(val) {
6812
- return isString(val) && val.startsWith("https://") && (URL9.includes(val) || URL9.some((i) => i.startsWith(`${i}/`)));
7197
+ function isUnset(val) {
7198
+ return isObject(val) && val.kind === "Unset";
6813
7199
  }
6814
- var URL10 = JAPANESE_NEWS2.flatMap((i) => i.baseUrls);
6815
- function isJapaneseNewsUrl(val) {
6816
- return isString(val) && val.startsWith("https://") && (URL10.includes(val) || URL10.some((i) => i.startsWith(`${i}/`)));
7200
+ function isUri(val, ...protocols) {
7201
+ const p = protocols.length === 0 ? valuesOf(NETWORK_PROTOCOL_LOOKUP2).flat().filter((i) => i) : protocols;
7202
+ return isString(val) && p.some((i) => val.startsWith(`${i}://`));
6817
7203
  }
6818
- var URL11 = MEXICAN_NEWS2.flatMap((i) => i.baseUrls);
6819
- function isMexicanNewsUrl(val) {
6820
- return isString(val) && val.startsWith("https://") && (URL11.includes(val) || URL11.some((i) => i.startsWith(`${i}/`)));
7204
+ function isUrl(val, ...protocols) {
7205
+ const p = protocols.length === 0 ? ["http", "https"] : protocols;
7206
+ return isString(val) && p.some((i) => val.startsWith(`${i}://`));
6821
7207
  }
6822
- var URL12 = NORWEGIAN_NEWS2.flatMap((i) => i.baseUrls);
6823
- function isNorwegianNewsUrl(val) {
6824
- return isString(val) && val.startsWith("https://") && (URL12.includes(val) || URL12.some((i) => i.startsWith(`${i}/`)));
7208
+ var VALID = [
7209
+ ...ALPHA_CHARS2,
7210
+ ...NUMERIC_CHAR2,
7211
+ "_",
7212
+ "."
7213
+ ];
7214
+ var alpha = null;
7215
+ function valid(chars) {
7216
+ return chars.every((i) => VALID.includes(i));
6825
7217
  }
6826
- var URL13 = SOUTH_KOREAN_NEWS2.flatMap((i) => i.baseUrls);
6827
- function isSouthKoreanNewsUrl(val) {
6828
- return isString(val) && val.startsWith("https://") && (URL13.includes(val) || URL13.some((i) => i.startsWith(`${i}/`)));
7218
+ function isVariable(val) {
7219
+ return isString(val) && startsWith(alpha)(val) && valid(asChars(val));
6829
7220
  }
6830
- var URL14 = SPANISH_NEWS2.flatMap((i) => i.baseUrls);
6831
- function isSpanishNewsUrl(val) {
6832
- return isString(val) && val.startsWith("https://") && (URL14.includes(val) || URL14.some((i) => i.startsWith(`${i}/`)));
7221
+ function separate(s) {
7222
+ return stripWhile(s.toLowerCase(), ...NUMERIC_CHAR2).trim();
6833
7223
  }
6834
- var URL15 = SWISS_NEWS2.flatMap((i) => i.baseUrls);
6835
- function isSwissNewsUrl(val) {
6836
- return isString(val) && val.startsWith("https://") && (URL15.includes(val) || URL15.some((i) => i.startsWith(`${i}/`)));
7224
+ function isAreaMetric(val) {
7225
+ return isString(val) && AREA_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6837
7226
  }
6838
- var URL16 = TURKISH_NEWS2.flatMap((i) => i.baseUrls);
6839
- function isTurkishNewsUrl(val) {
6840
- return isString(val) && val.startsWith("https://") && (URL16.includes(val) || URL16.some((i) => i.startsWith(`${i}/`)));
7227
+ function isLuminosityMetric(val) {
7228
+ return isString(val) && LUMINOSITY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6841
7229
  }
6842
- var URL17 = UK_NEWS2.flatMap((i) => i.baseUrls);
6843
- function isUkNewsUrl(val) {
6844
- return isString(val) && val.startsWith("https://") && (URL17.includes(val) || URL17.some((i) => i.startsWith(`${i}/`)));
7230
+ function isResistance(val) {
7231
+ return isString(val) && RESISTANCE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6845
7232
  }
6846
- var URL18 = US_NEWS2.flatMap((i) => i.baseUrls);
6847
- function isUsNewsUrl(val) {
6848
- return isString(val) && val.startsWith("https://") && (URL18.includes(val) || URL18.some((i) => i.startsWith(`${i}/`)));
7233
+ function isCurrentMetric(val) {
7234
+ return isString(val) && CURRENT_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6849
7235
  }
6850
- var URL19 = CHINESE_NEWS2.flatMap((i) => i.baseUrls);
6851
- function isChineseNewsUrl(val) {
6852
- return isString(val) && val.startsWith("https://") && (URL19.includes(val) || URL19.some((i) => i.startsWith(`${i}/`)));
7236
+ function isVoltageMetric(val) {
7237
+ return isString(val) && VOLTAGE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6853
7238
  }
6854
- function isNewsUrl(val) {
6855
- return isAustralianNewsUrl(val) || isBelgiumNewsUrl(val) || isCanadianNewsUrl(val) || isDanishNewsUrl(val) || isDutchNewsUrl(val) || isFrenchNewsUrl(val) || isGermanNewsUrl(val) || isIndianNewsUrl(val) || isItalianNewsUrl(val) || isJapaneseNewsUrl(val) || isMexicanNewsUrl(val) || isNorwegianNewsUrl(val) || isSouthKoreanNewsUrl(val) || isSpanishNewsUrl(val) || isSwissNewsUrl(val) || isTurkishNewsUrl(val) || isUkNewsUrl(val) || isUsNewsUrl(val);
7239
+ function isFrequencyMetric(val) {
7240
+ return isString(val) && FREQUENCY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6856
7241
  }
6857
- function isBitbucketUrl(val) {
6858
- const valid2 = REPO_SOURCE_LOOKUP2.bitbucket;
6859
- return isString(val) && valid2.some(
6860
- (i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
6861
- );
7242
+ function isPowerMetric(val) {
7243
+ return isString(val) && POWER_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6862
7244
  }
6863
- function isCodeCommitUrl(val) {
6864
- const valid2 = REPO_SOURCE_LOOKUP2.codecommit;
6865
- return isString(val) && valid2.some(
6866
- (i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
6867
- );
7245
+ function isTimeMetric(val) {
7246
+ return isString(val) && TIME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6868
7247
  }
6869
- function isGithubUrl(val) {
6870
- const valid2 = [
6871
- "https://github.com",
6872
- "https://www.github.com",
6873
- "https://github.io"
6874
- ];
6875
- return isString(val) && valid2.some(
6876
- (i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
6877
- );
7248
+ function isEnergyMetric(val) {
7249
+ return isString(val) && ENERGY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6878
7250
  }
6879
- function isGithubOrgUrl(val) {
6880
- return isString(val) && (val.startsWith("https://github.com/") && stripper(val).length === 2);
7251
+ function isPressureMetric(val) {
7252
+ return isString(val) && PRESSURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6881
7253
  }
6882
- function stripper(s) {
6883
- return stripTrailing(
6884
- stripLeading(s, "https://github.com/"),
6885
- "/"
6886
- );
7254
+ function isTemperatureMetric(val) {
7255
+ return isString(val) && TEMPERATURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6887
7256
  }
6888
- function isGithubRepoUrl(val) {
6889
- return !!(isString(val) && (val.startsWith("https://github.com/") && stripper(val).split("/").length === 2));
7257
+ function isVolumeMetric(val) {
7258
+ return isString(val) && VOLUME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6890
7259
  }
6891
- function isGithubRepoReleasesUrl(val) {
6892
- return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases") && stripper(val).split("/").length === 3);
7260
+ function isAccelerationMetric(val) {
7261
+ return isString(val) && ACCELERATION_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6893
7262
  }
6894
- function isGithubRepoReleaseTagUrl(val) {
6895
- return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases/tag/") && stripper(val).length === 4);
7263
+ function isSpeedMetric(val) {
7264
+ const speed = SPEED_METRICS_LOOKUP2.map((i) => i.abbrev);
7265
+ return isString(val) && speed.includes(separate(val));
6896
7266
  }
6897
- function isGithubIssuesListUrl(val) {
6898
- return isString(val) && val.startsWith("https://github.com/") && val.includes("/issues");
7267
+ function isMassMetric(val) {
7268
+ return isString(val) && MASS_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6899
7269
  }
6900
- function isGithubIssueUrl(val) {
6901
- return isString(val) && (val.startsWith("https://github.com/") && val.includes("/issues/"));
7270
+ function isDistanceMetric(val) {
7271
+ return isString(val) && DISTANCE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(separate(val));
6902
7272
  }
6903
- function isGithubProjectsListUrl(val) {
6904
- return isString(val) && (val.startsWith("https://github.com/") && (val.includes("/projects?") || val.trim().endsWith("/projects")) && stripper(val).split("/").length === 3);
7273
+ function isMetric(val) {
7274
+ return isDistanceMetric(val) || isMassMetric(val) || isSpeedMetric(val) || isAccelerationMetric(val) || isVoltageMetric(val) || isTemperatureMetric(val) || isPressureMetric(val) || isEnergyMetric(val) || isTimeMetric(val) || isPowerMetric(val) || isFrequencyMetric(val) || isVoltageMetric(val) || isCurrentMetric(val) || isLuminosityMetric(val) || isAreaMetric(val);
6905
7275
  }
6906
- function isGithubProjectUrl(val) {
6907
- return isString(val) && (val.startsWith("https://github.com/") && val.includes("/projects/") && stripper(val).split("/").length === 4);
7276
+ function isAreaUom(val) {
7277
+ return isString(val) && AREA_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6908
7278
  }
6909
- function isGithubReleasesListUrl(val) {
6910
- return isString(val) && (val.startsWith("https://github.com/") && (val.includes("/releases?") || val.trim().endsWith("/releases")) && stripper(val).split("/").length === 3);
7279
+ function isLuminosityUom(val) {
7280
+ return isString(val) && LUMINOSITY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6911
7281
  }
6912
- function isGithubReleaseTagUrl(val) {
6913
- return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases/tag/") && stripper(val).split("/").length === 5);
7282
+ function isResistanceUom(val) {
7283
+ return isString(val) && RESISTANCE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6914
7284
  }
6915
- function isRepoSource(v) {
6916
- return isString(v) && REPO_SOURCES2.includes(v);
7285
+ function isCurrentUom(val) {
7286
+ return isString(val) && CURRENT_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6917
7287
  }
6918
- function isSemanticVersion(v, allowPrefix = false) {
6919
- return isString(v) && v.split(".").length === 3 && !Number.isNaN(Number(v.split(".")[1])) && !Number.isNaN(Number(v.split(".")[2])) && (!Number.isNaN(Number(v.split(".")[0])) || allowPrefix && !Number.isNaN(Number(stripLeading(v.split(".")[0], "v").trim())));
7288
+ function isVoltageUom(val) {
7289
+ return isString(val) && VOLTAGE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6920
7290
  }
6921
- function isRepoUrl(val) {
6922
- return isGithubUrl(val) || isBitbucketUrl(val) || isCodeCommitUrl(val);
7291
+ function isFrequencyUom(val) {
7292
+ return isString(val) && FREQUENCY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6923
7293
  }
6924
- function isWholeFoodsUrl(val) {
6925
- return isString(val) && WHOLE_FOODS_DNS2.some((i) => val.startsWith(`https://${i}`));
7294
+ function isPowerUom(val) {
7295
+ return isString(val) && POWER_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6926
7296
  }
6927
- function isCvsUrl(val) {
6928
- return isString(val) && CVS_DNS2.some((i) => val.startsWith(`https://${i}`));
7297
+ function isTimeUom(val) {
7298
+ return isString(val) && TIME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6929
7299
  }
6930
- function isWalgreensUrl(val) {
6931
- return isString(val) && WALGREENS_DNS2.some((i) => val.startsWith(`https://${i}`));
7300
+ function isEnergyUom(val) {
7301
+ return isString(val) && ENERGY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6932
7302
  }
6933
- function isKrogersUrl(val) {
6934
- return isString(val) && KROGER_DNS2.some((i) => val.startsWith(`https://${i}`));
7303
+ function isPressureUom(val) {
7304
+ return isString(val) && PRESSURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6935
7305
  }
6936
- function isZaraUrl(val) {
6937
- return isString(val) && ZARA_DNS2.some((i) => val.startsWith(`https://${i}`));
7306
+ function isTemperatureUom(val) {
7307
+ return isString(val) && TEMPERATURE_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6938
7308
  }
6939
- function isHmUrl(val) {
6940
- return isString(val) && HM_DNS2.some((i) => val.startsWith(`https://${i}`));
7309
+ function isVolumeUom(val) {
7310
+ return isString(val) && VOLUME_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6941
7311
  }
6942
- function isDellUrl(val) {
6943
- return isString(val) && DELL_DNS2.some((i) => val.startsWith(`https://${i}`));
7312
+ function isAccelerationUom(val) {
7313
+ return isString(val) && ACCELERATION_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6944
7314
  }
6945
- function isIkeaUrl(val) {
6946
- return isString(val) && KROGER_DNS2.some((i) => val.startsWith(`https://${i}`));
7315
+ function isSpeedUom(val) {
7316
+ return isString(val) && SPEED_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6947
7317
  }
6948
- function isLowesUrl(val) {
6949
- return isString(val) && KROGER_DNS2.some((i) => val.startsWith(`https://${i}`));
7318
+ function isMassUom(val) {
7319
+ return isString(val) && MASS_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6950
7320
  }
6951
- function isNikeUrl(val) {
6952
- return isString(val) && NIKE_DNS2.some((i) => val.startsWith(`https://${i}`));
7321
+ function isDistanceUom(val) {
7322
+ return isString(val) && ENERGY_METRICS_LOOKUP2.map((i) => i.abbrev).includes(val);
6953
7323
  }
6954
- function isWayfairUrl(val) {
6955
- return isString(val) && WAYFAIR_DNS2.some((i) => val.startsWith(`https://${i}`));
7324
+ function isUom(val) {
7325
+ return isDistanceUom(val) || isMassUom(val) || isSpeedUom(val) || isAccelerationUom(val) || isVoltageUom(val) || isTemperatureUom(val) || isPressureUom(val) || isEnergyUom(val) || isTimeUom(val) || isPowerUom(val) || isFrequencyUom(val) || isVoltageUom(val) || isCurrentUom(val) || isLuminosityUom(val) || isAreaUom(val);
6956
7326
  }
6957
- function isBestBuyUrl(val) {
6958
- return isString(val) && BEST_BUY_DNS2.some((i) => val.startsWith(`https://${i}`));
7327
+ function isIp4Address(val) {
7328
+ return isString(val) && val.split(".").length === 4 && val.split(".").every((i) => isNumberLike(i)) && val.split(".").every((i) => Number(i) >= 0 && Number(i) <= 255);
6959
7329
  }
6960
- function isCostCoUrl(val) {
6961
- return isString(val) && COSTCO_DNS2.some((i) => val.startsWith(`https://${i}`));
7330
+ function isIp6Address(val) {
7331
+ const expanded = isString(val) ? ip6GroupExpansion(val) : "";
7332
+ return isString(val) && isString(expanded) && expanded.split(":").every((i) => asChars(i).length >= 1 && asChars(i).length <= 4) && expanded.split(":").every((i) => isHexadecimal(i));
6962
7333
  }
6963
- function isEtsyUrl(val) {
6964
- return isString(val) && ETSY_DNS2.some((i) => val.startsWith(`https://${i}`));
7334
+ function isIpAddress(val) {
7335
+ return isIp4Address(val) || isIp6Address(val);
6965
7336
  }
6966
- function isTargetUrl(val) {
6967
- return isString(val) && TARGET_DNS2.some((i) => val.startsWith(`https://${i}`));
7337
+ function hasUrlPort(val) {
7338
+ return isString(val) && asChars(removeUrlProtocol(val)).includes(":");
6968
7339
  }
6969
- function isEbayUrl(val) {
6970
- return isString(val) && EBAY_DNS2.some((i) => val.startsWith(`https://${i}`));
7340
+ function isUrlPath(val) {
7341
+ return isString(val) && (val === "" || val.startsWith("/")) && asChars(val).every(
7342
+ (c) => isAlpha(c) || isNumberLike(c) || c === "_" || c === "@" || c === "." || c === "-"
7343
+ );
6971
7344
  }
6972
- function isHomeDepotUrl(val) {
6973
- return isString(val) && HOME_DEPOT_DNS2.some((i) => val.startsWith(`https://${i}`));
7345
+ function isDomainName(val) {
7346
+ return isString(val) && val.split(".").filter((i) => i).length > 1 && isString(val.split(".").filter((i) => i).pop()) && asChars(val.split(".").filter((i) => i).pop()).length > 1 && val.split(".").filter((i) => i).every(
7347
+ (i) => isAlpha(i) || isNumberLike(i) || i === "-" || i === "_"
7348
+ );
6974
7349
  }
6975
- function isMacysUrl(val) {
6976
- return isString(val) && MACYS_DNS2.some((i) => val.startsWith(`https://${i}`));
7350
+ function isUrlSource(val) {
7351
+ return isDomainName(val) || isIpAddress(val);
6977
7352
  }
6978
- function isAppleUrl(val) {
6979
- return isString(val) && APPLE_DNS2.some((i) => val.startsWith(`https://${i}`));
7353
+ function hasUrlQueryParameter(val, prop) {
7354
+ return isString(getUrlQueryParams(val, prop));
6980
7355
  }
6981
- function isWalmartUrl(val) {
6982
- return isString(val) && WALMART_DNS2.some((i) => val.startsWith(`https://${i}`));
7356
+ function isNumericArray(val) {
7357
+ return Array.isArray(val) && val.every((i) => isNumber(i));
6983
7358
  }
6984
- function isAmazonUrl(val) {
6985
- return isString(val) && AMAZON_DNS2.some((i) => val.startsWith(`https://${i}`));
7359
+ function hasProtocol(val, ...protocols) {
7360
+ return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.some((i) => val.startsWith(i)) : protocols.some((i) => val.startsWith(i));
6986
7361
  }
6987
- function isRetailUrl(val) {
6988
- return isAmazonUrl(val) || isWalgreensUrl(val) || isAppleUrl(val) || isMacysUrl(val) || isEbayUrl(val) || isHomeDepotUrl(val) || isTargetUrl(val) || isEtsyUrl(val) || isCostCoUrl(val) || isBestBuyUrl(val) || isWayfairUrl(val) || isNikeUrl(val) || isLowesUrl(val) || isIkeaUrl(val) || isDellUrl(val) || isHmUrl(val) || isZaraUrl(val) || isKrogersUrl(val) || isWalgreensUrl(val) || isCvsUrl(val) || isWholeFoodsUrl(val);
7362
+ function isProtocol(val, ...protocols) {
7363
+ return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.includes(val) : protocols.includes(val);
6989
7364
  }
6990
- var URL20 = SOCIAL_MEDIA2.flatMap((i) => i.baseUrls);
6991
- var PROFILE = SOCIAL_MEDIA2.map((i) => i.profileUrl);
6992
- function isSocialMediaUrl(val) {
6993
- return isString(val) && URL20.some((i) => val.startsWith(i));
7365
+ function hasProtocolPrefix(val, ...protocols) {
7366
+ return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.map((i) => `${i}://`).some((i) => val.startsWith(i)) : protocols.map((i) => `${i}://`).some((i) => val.startsWith(i));
6994
7367
  }
6995
- function isSocialMediaProfileUrl(val) {
6996
- return isString(val) && PROFILE.some((i) => i.startsWith(`${i}`));
7368
+ function isProtocolPrefix(val, ...protocols) {
7369
+ return isString(val) && protocols.length === 0 ? NETWORK_PROTOCOL2.map((i) => `${i}://`).includes(val) : protocols.map((i) => `${i}://`).includes(val);
6997
7370
  }
6998
- function isYouTubeUrl(val) {
6999
- return isString(val) && (val.startsWith("https://www.youtube.com") || val.startsWith("https://youtube.com") || val.startsWith("https://youtu.be"));
7371
+ function isTypeToken(val, kind) {
7372
+ if (isString(val) && val.startsWith("<<") && val.endsWith(">>")) {
7373
+ const stripped = stripSurround("<<", ">>")(val);
7374
+ if (TT_KIND_VARIANTS2.some((k) => stripped.startsWith(k))) {
7375
+ if (kind) {
7376
+ if (isAtomicKind(kind)) {
7377
+ return val === `<<${kind}>>`;
7378
+ } else if (isSetBasedKind(kind)) {
7379
+ return val.startsWith(`<<${kind}::`);
7380
+ } else {
7381
+ return val === `<<${kind}>>` || val.startsWith(`<<${kind}::`);
7382
+ }
7383
+ } else {
7384
+ return true;
7385
+ }
7386
+ }
7387
+ return false;
7388
+ }
7389
+ return false;
7000
7390
  }
7001
- function isYouTubeShareUrl(val) {
7002
- return isString(val) && val.startsWith(`https://youtu.be`);
7391
+ function isTypeTokenKind(val) {
7392
+ return !!(isString(val) && TT_KIND_VARIANTS2.includes(val));
7003
7393
  }
7004
- function isYouTubeVideoUrl(val) {
7005
- return isString(val) && (val.startsWith("https://www.youtube.com") || val.startsWith("https://youtube.com") || val.startsWith("https://youtu.be"));
7394
+ function isAtomicToken(val) {
7395
+ return isString(val) && TT_ATOMICS2.some((i) => val.startsWith(`<<${i}`));
7006
7396
  }
7007
- function isYouTubePlaylistUrl(val) {
7008
- return isString(val) && (val === `https://www.youtube.com/feed/playlists` || val === `https://youtube.com/feed/playlists` || val === `https://www.youtube.com/channel/playlists` || val === `https://youtube.com/channel/playlists` || val.startsWith(`https://www.youtube.com/@`) && val.endsWith(`/playlists`) || val.startsWith(`https://youtube.com/@`) && val.endsWith(`/playlists`));
7397
+ function isAtomicKind(val) {
7398
+ return isString(val) && TT_ATOMICS2.includes(val);
7009
7399
  }
7010
- function feed_map(type) {
7011
- return isUndefined(type) ? `/feed` : type === "liked" ? `/playlist?list=LL` : ["history", "playlists", "trending", "subscriptions"].includes(type) ? `/feed/${type}` : `/feed/`;
7400
+ function isObjectToken(val) {
7401
+ return isTypeToken(val, "obj");
7012
7402
  }
7013
- function isYouTubeFeedUrl(val, type) {
7014
- return isString(val) && (val.startsWith(`https://www.youtube.com${feed_map(type)}`) || val.startsWith(`https://youtube.com${feed_map(type)}`));
7403
+ function isRecordToken(val) {
7404
+ return isTypeToken(val, "rec");
7015
7405
  }
7016
- function isYouTubeFeedHistoryUrl(val) {
7017
- return isString(val) && (val.startsWith(`https://www.youtube.com/feed/history`) || val.startsWith(`https://youtube.com/feed/history`));
7406
+ function isTupleToken(val) {
7407
+ return isTypeToken(val, "tuple");
7018
7408
  }
7019
- function isYouTubePlaylistsUrl(val) {
7020
- return isString(val) && (val.startsWith(`https://www.youtube.com/feed/playlists`) || val.startsWith(`https://youtube.com/feed/playlists`));
7409
+ function isArrayToken(val) {
7410
+ return isTypeToken(val, "arr");
7021
7411
  }
7022
- function isYouTubeTrendingUrl(val) {
7023
- return isString(val) && (val.startsWith(`https://www.youtube.com/feed/trending`) || val.startsWith(`https://youtube.com/feed/trending`));
7412
+ function isMapToken(val) {
7413
+ return isTypeToken(val, "map");
7024
7414
  }
7025
- function isYouTubeSubscriptionsUrl(val) {
7026
- return isString(val) && (val.startsWith(`https://www.youtube.com/feed/subscriptions`) || val.startsWith(`https://youtube.com/feed/subscriptions`));
7415
+ function isSetToken(val) {
7416
+ return isTypeToken(val, "set");
7027
7417
  }
7028
- function isYouTubeCreatorUrl(url) {
7029
- return isString(url) && (url.startsWith(`https://www.youtube.com/@`) || url.startsWith(`https://youtube.com/@`) || url.startsWith(`https://www.youtube.com/channel/`));
7418
+ function isContainerToken(val) {
7419
+ return isObjectToken(val) || isRecordToken(val) || isTupleToken(val) || isArrayToken(val) || isMapToken(val) || isSetToken(val);
7030
7420
  }
7031
- function isYouTubeVideosInPlaylist(val) {
7032
- return isString(val) && (val.startsWith(`https://www.youtube.com/playlist?`) || val.startsWith(`https://youtube.com/playlist?`)) && hasUrlQueryParameter(val, "list");
7421
+ function isShapeCallback(val) {
7422
+ return isFunction(val) && val.kind === "shape";
7033
7423
  }
7034
- function getTypeSubtype(str) {
7035
- if (isTypeSubtype(str)) {
7036
- const [t, st] = str.split("/");
7037
- return [t, st];
7038
- } else {
7039
- const err = new Error(`An invalid Type/Subtype was passed into getTypeSubtype(${str})`);
7040
- err.name = "InvalidTypeSubtype";
7041
- throw err;
7042
- }
7424
+ var token_types = [
7425
+ ...TT_ATOMICS2,
7426
+ ...TT_CONTAINERS2,
7427
+ ...TT_FUNCTIONS2,
7428
+ ...TT_SETS2,
7429
+ ...TT_SINGLETONS2
7430
+ ];
7431
+ function isShapeToken(val) {
7432
+ return isString(val) && val.startsWith("<<") && val.endsWith(">>") && token_types.some((t) => val.startsWith(`<<${t}`));
7043
7433
  }
7044
- function identity(...values) {
7045
- return values.length === 1 ? values[0] : values.length === 0 ? void 0 : values;
7434
+ var split_tokens = SIMPLE_TOKENS2.map((i) => i.split("TOKEN"));
7435
+ var scalar_split_tokens = SIMPLE_SCALAR_TOKENS2.map((i) => i.split("TOKEN"));
7436
+ function isSimpleToken(val) {
7437
+ return isString(val) && split_tokens.some(
7438
+ (i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
7439
+ );
7046
7440
  }
7047
- function ifLowercaseChar(ch, callbackForMatch, callbackForNoMatch) {
7048
- if (ch.length !== 1) {
7049
- throw new Error(`call to ifUppercaseChar received ${ch.length} characters but is only valid when one character is passed in!`);
7050
- }
7051
- return LOWER_ALPHA_CHARS2.includes(ch) ? callbackForMatch(ch) : callbackForNoMatch(ch);
7441
+ function isSimpleScalarToken(val) {
7442
+ return isString(val) && scalar_split_tokens.some(
7443
+ (i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
7444
+ );
7052
7445
  }
7053
- function ifUppercaseChar(ch, callbackForMatch, callbackForNoMatch) {
7054
- if (ch.length !== 1) {
7055
- throw new Error(`Invalid string length passed to ifUppercaseChar(ch); this function requires a single character but ${ch.length} were received`);
7056
- }
7057
- return LOWER_ALPHA_CHARS2.includes(ch) ? callbackForMatch(ch) : callbackForNoMatch(ch);
7446
+ function isSimpleContainerToken(val) {
7447
+ return isString(val) && scalar_split_tokens.some(
7448
+ (i) => i.length === 1 && val === i[0] || val.startsWith(i[0]) && val.endsWith(i.slice(-1)[0]) && i.every((p) => val.includes(p))
7449
+ );
7058
7450
  }
7059
- function parseTemplate(template) {
7060
- const pattern = /\{\{\s*infer\s+([A-Za-z_]\w*)\s*(?:(?:extends|as)\s+(string|number|boolean)\s*)?\}\}/g;
7061
- let lastIndex = 0;
7062
- let match;
7063
- const segments = [];
7064
- while (match = pattern.exec(template)) {
7065
- const [fullMatch, varName, asType2] = match;
7066
- const staticPart = template.slice(lastIndex, match.index);
7067
- if (staticPart) {
7068
- segments.push({ dynamic: false, text: staticPart });
7069
- }
7070
- segments.push({
7071
- dynamic: true,
7072
- varName,
7073
- type: asType2 ? asType2 : "string"
7074
- });
7075
- lastIndex = match.index + fullMatch.length;
7076
- }
7077
- const remainder = template.slice(lastIndex);
7078
- if (remainder) {
7079
- segments.push({ dynamic: false, text: remainder });
7080
- }
7081
- return segments;
7451
+ function isSimpleTokenTuple(val) {
7452
+ return isArray(val) && val.length !== 0 && val.every(isSimpleToken);
7082
7453
  }
7083
- function escapeRegex(str) {
7084
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7454
+ function isSimpleScalarTokenTuple(val) {
7455
+ return isArray(val) && val.length !== 0 && val.every(isSimpleScalarToken);
7085
7456
  }
7086
- function buildRegexPattern(segments) {
7087
- let regexStr = "^";
7088
- for (const seg of segments) {
7089
- if (!seg.dynamic) {
7090
- regexStr += escapeRegex(seg.text);
7091
- } else {
7092
- switch (seg.type) {
7093
- case "string":
7094
- regexStr += "(.*?)";
7095
- break;
7096
- case "number":
7097
- regexStr += "(\\d+)";
7098
- break;
7099
- case "boolean":
7100
- regexStr += "(true|false)";
7101
- break;
7102
- }
7103
- }
7104
- }
7105
- regexStr += "$";
7106
- return new RegExp(regexStr);
7457
+ function isSimpleContainerTokenTuple(val) {
7458
+ return isArray(val) && val.length !== 0 && val.every(isSimpleContainerToken);
7107
7459
  }
7108
- function convertValue(type, value) {
7109
- switch (type) {
7110
- case "string":
7111
- return value;
7112
- case "number":
7113
- return Number(value);
7114
- case "boolean":
7115
- return value === "true";
7116
- }
7460
+ function isDefineObject(val) {
7461
+ return isObject(val) && Object.keys(val).some(
7462
+ (key) => isSimpleToken(val[key]) || isShapeToken(val) || isShapeCallback(val)
7463
+ );
7117
7464
  }
7118
- function matchTemplate(template, test) {
7119
- const segments = parseTemplate(template);
7120
- const regex = buildRegexPattern(segments);
7121
- const match = regex.exec(test);
7122
- if (!match)
7123
- return false;
7124
- let captureIndex = 1;
7125
- const result2 = {};
7126
- for (const seg of segments) {
7127
- if (seg.dynamic) {
7128
- const rawVal = match[captureIndex++];
7129
- if (rawVal === void 0)
7130
- return false;
7131
- result2[seg.varName] = convertValue(seg.type, rawVal);
7132
- }
7465
+ function isFnBasedToken(val) {
7466
+ if (isString(val) && val.startsWith(TT_START2) && val.endsWith(TT_STOP2)) {
7467
+ const stripped = stripSurround(TT_START2, TT_STOP2)(val);
7468
+ return TT_FUNCTIONS2.some((i) => stripped.startsWith(i));
7133
7469
  }
7134
- return result2;
7135
7470
  }
7136
- function infer(inference) {
7137
- return (test) => {
7138
- return matchTemplate(inference, test);
7139
- };
7471
+ function isFnBasedKind(val) {
7472
+ if (isString(val) && isTypeTokenKind(val)) {
7473
+ const stripped = stripSurround(TT_START2, TT_STOP2)(val);
7474
+ return TT_FUNCTIONS2.some((i) => stripped.startsWith(i));
7475
+ }
7476
+ return false;
7140
7477
  }
7141
- function idLiteral(o) {
7142
- return { ...o, id: o.id };
7478
+ function isSetBasedToken(val) {
7479
+ if (isTypeToken(val)) {
7480
+ const kind = getTokenKind(val);
7481
+ return kind.endsWith(`-set`);
7482
+ }
7483
+ return false;
7143
7484
  }
7144
- function nameLiteral(o) {
7145
- return o;
7485
+ function isSetBasedKind(val) {
7486
+ return isString(val) && val.endsWith(`-set`);
7146
7487
  }
7147
- function kindLiteral(o) {
7148
- return o;
7488
+ function isSingletonKind(val) {
7489
+ return isString(val) && TT_SINGLETONS2.some((i) => val.startsWith(`<<${i}`));
7149
7490
  }
7150
- function idTypeGuard(_o) {
7151
- return true;
7491
+ function isSingletonToken(val) {
7492
+ return isString(val) && TT_SINGLETONS2.some((i) => val.startsWith(`<<${i}`));
7152
7493
  }
7153
- function literal(obj) {
7154
- return obj;
7494
+ function isTailwindColorName(val) {
7495
+ return isString(val) && Object.keys(TW_HUE2).includes(val);
7155
7496
  }
7156
- function lowercase(str) {
7157
- return str.toLowerCase();
7497
+ function isTailwindColorWithLuminosity(val) {
7498
+ return isString(val) && isTailwindColorName(val.split("-")[0]) && (!["white", "black"].includes(val.split("-")[0]) || val.split("-").length === 1) && (!val.includes("-") || Object.keys(TW_LUMINOSITY2).includes(retainAfter(val, "-")));
7158
7499
  }
7159
- function narrow(...values) {
7160
- return values.length === 1 ? values[0] : values;
7500
+ function isTailwindColorWithLuminosityAndOpacity(val) {
7501
+ return isString(val) && val.includes("/") && isTailwindColorWithLuminosity(val.split("/")[0]) && isNumberLike(val.split("/")[1]) && ([1, 2].includes(val.split("/")[1].length) || val.split("/")[1] === "100");
7161
7502
  }
7162
- function pathJoin(...segments) {
7163
- const clean_path = segments.map((i) => stripTrailing(stripLeading(i, "/"), "/")).join("/");
7164
- const original_path = segments.join("/");
7165
- const pre = original_path.startsWith("/") ? "/" : "";
7166
- const post = original_path.endsWith("/") ? "/" : "";
7167
- return `${pre}${clean_path}${post}`;
7503
+ function isTailwindColor(val) {
7504
+ return isTailwindColorWithLuminosity(val) || isTailwindColorWithLuminosityAndOpacity(val);
7168
7505
  }
7169
- var asPhoneFormat = () => `NOT IMPLEMENTED`;
7170
- function getPhoneCountryCode(phone) {
7171
- return phone.trim().startsWith("+") || phone.trim().startsWith("00") ? retainWhile(
7172
- stripLeading(stripLeading(phone.trim(), "+"), "00"),
7173
- ...NUMERIC_CHAR2
7174
- ) : "";
7506
+ function isTailwindModifier(val) {
7507
+ return isString(val) && TW_MODIFIERS2.includes(val);
7175
7508
  }
7176
- function removePhoneCountryCode(phone) {
7177
- const countryCode = getPhoneCountryCode(phone);
7178
- return countryCode !== "" ? stripLeading(stripLeading(
7179
- phone.trim(),
7180
- "+",
7181
- "00"
7182
- ), countryCode).trim() : phone.trim();
7509
+ function isTailwindColorTarget(val) {
7510
+ return isString(val) && TW_COLOR_TARGETS2.includes(val);
7183
7511
  }
7184
- var isException = (word) => Object.keys(PLURAL_EXCEPTIONS2).includes(word);
7185
- function endingIn(word, postfix) {
7186
- switch (postfix) {
7187
- case "is":
7188
- return word.endsWith(postfix) ? `${word}es` : void 0;
7189
- case "singular-noun":
7190
- return SINGULAR_NOUN_ENDINGS2.some((i) => word.endsWith(i)) ? split(word).every((i) => [...ALPHA_CHARS2].includes(i)) ? `${word}es` : void 0 : void 0;
7191
- case "f":
7192
- return word.endsWith("f") ? `${stripTrailing(word, "f")}ves` : word.endsWith("fe") ? `${stripTrailing(word, "fe")}ves` : void 0;
7193
- case "y":
7194
- return word.endsWith("y") ? `${stripTrailing(word, "y")}ies` : void 0;
7195
- default:
7196
- throw new Error(`endingIn received "${postfix}" as a postfix but this ending is not known!`);
7512
+ function isTailwindColorClass(val, ...allowedModifiers) {
7513
+ if (isString(val)) {
7514
+ const mods = getTailwindModifiers(val);
7515
+ const targetted = removeTailwindModifiers(val);
7516
+ const target = targetted.split("-")[0];
7517
+ const color = targetted.split("-").slice(1).join("-");
7518
+ return isTailwindColorTarget(target) && isTailwindColor(color) && (allowedModifiers[0] === true || mods.every((i) => allowedModifiers.includes(i)));
7197
7519
  }
7520
+ return false;
7198
7521
  }
7199
- function pluralize(word) {
7200
- const right = rightWhitespace(word);
7201
- const w = word.trimEnd();
7202
- const result2 = isException(w) ? PLURAL_EXCEPTIONS2[w] : endingIn(w, "is") || endingIn(w, "singular-noun") || endingIn(w, "f") || endingIn(w, "y") || `${w}s`;
7203
- return `${result2}${right}`;
7522
+ var URL = AUSTRALIAN_NEWS2.flatMap((i) => i.baseUrls);
7523
+ function isAustralianNewsUrl(val) {
7524
+ return isString(val) && val.startsWith("https://") && (URL.includes(val) || URL.some((i) => i.startsWith(`${i}/`)));
7204
7525
  }
7205
- function retainAfter(content, ...find2) {
7206
- const idx = Math.min(
7207
- ...find2.map((i) => content.indexOf(i)).filter((i) => i > -1)
7208
- );
7209
- const min = Math.min(...find2.map((i) => i.length));
7210
- let len = Math.max(...find2.map((i) => i.length));
7211
- if (min !== len) {
7212
- if (!find2.includes(content.slice(idx, len))) {
7213
- len = min;
7214
- }
7215
- }
7216
- return idx && idx > 0 ? content.slice(idx + len) : "";
7526
+ var URL2 = BELGIUM_NEWS2.flatMap((i) => i.baseUrls);
7527
+ function isBelgiumNewsUrl(val) {
7528
+ return isString(val) && val.startsWith("https://") && (URL2.includes(val) || URL2.some((i) => i.startsWith(`${i}/`)));
7217
7529
  }
7218
- function retainAfterInclusive(content, ...find2) {
7219
- const minFound = Math.min(
7220
- ...find2.map((i) => content.indexOf(i)).filter((i) => i > -1)
7221
- );
7222
- return minFound > 0 ? content.slice(minFound) : "";
7530
+ var URL3 = CANADIAN_NEWS2.flatMap((i) => i.baseUrls);
7531
+ function isCanadianNewsUrl(val) {
7532
+ return isString(val) && val.startsWith("https://") && (URL3.includes(val) || URL3.some((i) => i.startsWith(`${i}/`)));
7223
7533
  }
7224
- function retainChars(content, ...retain2) {
7225
- const chars = asChars(content);
7226
- return chars.filter((c) => retain2.includes(c)).join("");
7534
+ var URL4 = DANISH_NEWS2.flatMap((i) => i.baseUrls);
7535
+ function isDanishNewsUrl(val) {
7536
+ return isString(val) && val.startsWith("https://") && (URL4.includes(val) || URL4.some((i) => i.startsWith(`${i}/`)));
7227
7537
  }
7228
- function retainUntil(content, ...find2) {
7229
- const chars = asChars(content);
7230
- let idx = 0;
7231
- while (!find2.includes(chars[idx]) && idx <= chars.length) {
7232
- idx = idx + 1;
7233
- }
7234
- return idx === 0 ? "" : content.slice(0, idx);
7538
+ var URL5 = DUTCH_NEWS2.flatMap((i) => i.baseUrls);
7539
+ function isDutchNewsUrl(val) {
7540
+ return isString(val) && val.startsWith("https://") && (URL5.includes(val) || URL5.some((i) => i.startsWith(`${i}/`)));
7235
7541
  }
7236
- function retainUntilInclusive(content, ...find2) {
7237
- const chars = asChars(content);
7238
- let idx = 0;
7239
- while (!find2.includes(chars[idx]) && idx <= chars.length) {
7240
- idx = idx + 1;
7241
- }
7242
- return idx === 0 ? content.slice(0, 1) : content.slice(0, idx + 1);
7542
+ var URL6 = FRENCH_NEWS2.flatMap((i) => i.baseUrls);
7543
+ function isFrenchNewsUrl(val) {
7544
+ return isString(val) && val.startsWith("https://") && (URL6.includes(val) || URL6.some((i) => i.startsWith(`${i}/`)));
7243
7545
  }
7244
- function retainWhile(content, ...retain2) {
7245
- const stopIdx = asChars(content).findIndex((c) => !retain2.includes(c));
7246
- return content.slice(0, stopIdx);
7546
+ var URL7 = GERMAN_NEWS2.flatMap((i) => i.baseUrls);
7547
+ function isGermanNewsUrl(val) {
7548
+ return isString(val) && val.startsWith("https://") && (URL7.includes(val) || URL7.some((i) => i.startsWith(`${i}/`)));
7247
7549
  }
7248
- function rightWhitespace(content) {
7249
- const trimmed = content.trimStart();
7250
- return retainAfterInclusive(
7251
- trimmed,
7252
- ...WHITESPACE_CHARS2
7253
- );
7550
+ var URL8 = INDIAN_NEWS2.flatMap((i) => i.baseUrls);
7551
+ function isIndianNewsUrl(val) {
7552
+ return isString(val) && val.startsWith("https://") && (URL8.includes(val) || URL8.some((i) => i.startsWith(`${i}/`)));
7254
7553
  }
7255
- function stripAfter(content, find2) {
7256
- return content.split(find2).shift();
7554
+ var URL9 = ITALIAN_NEWS2.flatMap((i) => i.baseUrls);
7555
+ function isItalianNewsUrl(val) {
7556
+ return isString(val) && val.startsWith("https://") && (URL9.includes(val) || URL9.some((i) => i.startsWith(`${i}/`)));
7257
7557
  }
7258
- function stripBefore(content, find2) {
7259
- return content.split(find2).slice(1).join(find2);
7558
+ var URL10 = JAPANESE_NEWS2.flatMap((i) => i.baseUrls);
7559
+ function isJapaneseNewsUrl(val) {
7560
+ return isString(val) && val.startsWith("https://") && (URL10.includes(val) || URL10.some((i) => i.startsWith(`${i}/`)));
7260
7561
  }
7261
- function stripChars(content, ...strip2) {
7262
- const chars = asChars(content);
7263
- return chars.filter((c) => !strip2.includes(c)).join("");
7562
+ var URL11 = MEXICAN_NEWS2.flatMap((i) => i.baseUrls);
7563
+ function isMexicanNewsUrl(val) {
7564
+ return isString(val) && val.startsWith("https://") && (URL11.includes(val) || URL11.some((i) => i.startsWith(`${i}/`)));
7264
7565
  }
7265
- function stripLeading(content, ...strip2) {
7266
- if (isUndefined(content)) {
7267
- return void 0;
7268
- }
7269
- let output = String(content);
7270
- for (const s of strip2) {
7271
- if (output.startsWith(String(s))) {
7272
- output = output.slice(String(s).length);
7273
- }
7274
- }
7275
- return isNumber(content) ? Number(output) : output;
7566
+ var URL12 = NORWEGIAN_NEWS2.flatMap((i) => i.baseUrls);
7567
+ function isNorwegianNewsUrl(val) {
7568
+ return isString(val) && val.startsWith("https://") && (URL12.includes(val) || URL12.some((i) => i.startsWith(`${i}/`)));
7276
7569
  }
7277
- function stripSurround(...chars) {
7278
- return (input) => {
7279
- let output = String(input);
7280
- for (const s of chars) {
7281
- if (output.startsWith(String(s))) {
7282
- output = output.slice(String(s).length);
7283
- }
7284
- if (output.endsWith(String(s))) {
7285
- output = output.slice(0, -1 * String(s).length);
7286
- }
7287
- }
7288
- return isNumber(input) ? Number(output) : output;
7289
- };
7570
+ var URL13 = SOUTH_KOREAN_NEWS2.flatMap((i) => i.baseUrls);
7571
+ function isSouthKoreanNewsUrl(val) {
7572
+ return isString(val) && val.startsWith("https://") && (URL13.includes(val) || URL13.some((i) => i.startsWith(`${i}/`)));
7290
7573
  }
7291
- function stripUntil(content, ...until) {
7292
- const stopIdx = asChars(content).findIndex((c) => until.includes(c));
7293
- return content.slice(stopIdx);
7574
+ var URL14 = SPANISH_NEWS2.flatMap((i) => i.baseUrls);
7575
+ function isSpanishNewsUrl(val) {
7576
+ return isString(val) && val.startsWith("https://") && (URL14.includes(val) || URL14.some((i) => i.startsWith(`${i}/`)));
7294
7577
  }
7295
- function stripWhile(content, ...match) {
7296
- const stopIdx = asChars(content).findIndex((c) => !match.includes(c));
7297
- return content.slice(stopIdx);
7578
+ var URL15 = SWISS_NEWS2.flatMap((i) => i.baseUrls);
7579
+ function isSwissNewsUrl(val) {
7580
+ return isString(val) && val.startsWith("https://") && (URL15.includes(val) || URL15.some((i) => i.startsWith(`${i}/`)));
7298
7581
  }
7299
- function surround(prefix, postfix) {
7300
- return (input) => `${prefix}${input}${postfix}`;
7582
+ var URL16 = TURKISH_NEWS2.flatMap((i) => i.baseUrls);
7583
+ function isTurkishNewsUrl(val) {
7584
+ return isString(val) && val.startsWith("https://") && (URL16.includes(val) || URL16.some((i) => i.startsWith(`${i}/`)));
7301
7585
  }
7302
- function takeNumericCharacters(content) {
7303
- const nonNumericIdx = asChars(content).findIndex((i) => !NUMERIC_CHAR2.includes(i));
7304
- return content.slice(0, nonNumericIdx);
7586
+ var URL17 = UK_NEWS2.flatMap((i) => i.baseUrls);
7587
+ function isUkNewsUrl(val) {
7588
+ return isString(val) && val.startsWith("https://") && (URL17.includes(val) || URL17.some((i) => i.startsWith(`${i}/`)));
7305
7589
  }
7306
- function toCamelCase(input, preserveWhitespace) {
7307
- const pascal = preserveWhitespace ? toPascalCase(input, preserveWhitespace) : toPascalCase(input);
7308
- const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(
7309
- pascal
7310
- );
7311
- const camel = (preserveWhitespace ? preWhite : "") + focus.replace(/^.*?(\d*[a-z|])/is, (_2, p1) => p1.toLowerCase()) + (preserveWhitespace ? postWhite : "");
7312
- return camel;
7590
+ var URL18 = US_NEWS2.flatMap((i) => i.baseUrls);
7591
+ function isUsNewsUrl(val) {
7592
+ return isString(val) && val.startsWith("https://") && (URL18.includes(val) || URL18.some((i) => i.startsWith(`${i}/`)));
7313
7593
  }
7314
- function toKebabCase(input, _preserveWhitespace = false) {
7315
- const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
7316
- const replaceWhitespace = (i) => i.replace(/\s/g, "-");
7317
- const replaceUppercase = (i) => i.replace(/[A-Z]/g, (c) => `-${c[0].toLowerCase()}`);
7318
- const replaceLeadingDash = (i) => i.replace(/^-/, "");
7319
- const replaceTrailingDash = (i) => i.replace(/-$/, "");
7320
- const replaceUnderscore = (i) => i.replace(/_/g, "-");
7321
- const removeDupDashes = (i) => i.replace(/-+/g, "-");
7322
- return removeDupDashes(`${preWhite}${replaceUnderscore(
7323
- replaceTrailingDash(
7324
- replaceLeadingDash(removeDupDashes(replaceWhitespace(replaceUppercase(focus))))
7325
- )
7326
- )}${postWhite}`);
7594
+ var URL19 = CHINESE_NEWS2.flatMap((i) => i.baseUrls);
7595
+ function isChineseNewsUrl(val) {
7596
+ return isString(val) && val.startsWith("https://") && (URL19.includes(val) || URL19.some((i) => i.startsWith(`${i}/`)));
7327
7597
  }
7328
- function toNumericArray(arr) {
7329
- return arr.map((i) => Number(i));
7598
+ function isNewsUrl(val) {
7599
+ return isAustralianNewsUrl(val) || isBelgiumNewsUrl(val) || isCanadianNewsUrl(val) || isDanishNewsUrl(val) || isDutchNewsUrl(val) || isFrenchNewsUrl(val) || isGermanNewsUrl(val) || isIndianNewsUrl(val) || isItalianNewsUrl(val) || isJapaneseNewsUrl(val) || isMexicanNewsUrl(val) || isNorwegianNewsUrl(val) || isSouthKoreanNewsUrl(val) || isSpanishNewsUrl(val) || isSwissNewsUrl(val) || isTurkishNewsUrl(val) || isUkNewsUrl(val) || isUsNewsUrl(val);
7330
7600
  }
7331
- function toPascalCase(input, preserveWhitespace = void 0) {
7332
- const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(
7333
- input
7601
+ function isBitbucketUrl(val) {
7602
+ const valid2 = REPO_SOURCE_LOOKUP2.bitbucket;
7603
+ return isString(val) && valid2.some(
7604
+ (i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
7334
7605
  );
7335
- const convertInteriorToCap = (i) => i.replace(/[ |_\-]+(\d*[a-z|])/gi, (_2, p1) => p1.toUpperCase());
7336
- const startingToCap = (i) => i.replace(/^[_|-]*(\d*[a-z])/g, (_2, p1) => p1.toUpperCase());
7337
- const replaceLeadingTrash = (i) => i.replace(/^[-_]/, "");
7338
- const replaceTrailingTrash = (i) => i.replace(/[-_]$/, "");
7339
- const pascal = `${preserveWhitespace ? preWhite : ""}${capitalize(
7340
- replaceTrailingTrash(replaceLeadingTrash(convertInteriorToCap(startingToCap(focus))))
7341
- )}${preserveWhitespace ? postWhite : ""}`;
7342
- return pascal;
7343
7606
  }
7344
- function toSnakeCase(input, preserveWhitespace = false) {
7345
- const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
7346
- const convertInteriorSpace = (input2) => input2.replace(/\s+/g, "_");
7347
- const convertDashes = (input2) => input2.replace(/-/g, "_");
7348
- const injectUnderscoreBeforeCaps = (input2) => input2.replace(/([A-Z])/g, "_$1");
7349
- const removeLeadingUnderscore = (input2) => input2.startsWith("_") ? input2.slice(1) : input2;
7350
- return ((preserveWhitespace ? preWhite : "") + removeLeadingUnderscore(
7351
- injectUnderscoreBeforeCaps(convertDashes(convertInteriorSpace(focus)))
7352
- ).toLowerCase() + (preserveWhitespace ? postWhite : "")).replace(/__/g, "_");
7607
+ function isCodeCommitUrl(val) {
7608
+ const valid2 = REPO_SOURCE_LOOKUP2.codecommit;
7609
+ return isString(val) && valid2.some(
7610
+ (i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
7611
+ );
7353
7612
  }
7354
- function toString(val) {
7355
- return String(val);
7613
+ function isGithubUrl(val) {
7614
+ const valid2 = [
7615
+ "https://github.com",
7616
+ "https://www.github.com",
7617
+ "https://github.io"
7618
+ ];
7619
+ return isString(val) && valid2.some(
7620
+ (i) => val === i || val.startsWith(`${i}/`) || val.startsWith(`${i}?`)
7621
+ );
7356
7622
  }
7357
- function toUppercase(str) {
7358
- return str.split("").map((i) => ifLowercaseChar(i, (v) => capitalize(v), (v) => v)).join("");
7623
+ function isGithubOrgUrl(val) {
7624
+ return isString(val) && (val.startsWith("https://github.com/") && stripper(val).length === 2);
7359
7625
  }
7360
- function trim(input) {
7361
- return input.trim();
7626
+ function stripper(s) {
7627
+ return stripTrailing(
7628
+ stripLeading(s, "https://github.com/"),
7629
+ "/"
7630
+ );
7362
7631
  }
7363
- function trimLeft(input) {
7364
- return input.trimStart();
7632
+ function isGithubRepoUrl(val) {
7633
+ return !!(isString(val) && (val.startsWith("https://github.com/") && stripper(val).split("/").length === 2));
7365
7634
  }
7366
- function trimStart(input) {
7367
- return input.trimStart();
7635
+ function isGithubRepoReleasesUrl(val) {
7636
+ return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases") && stripper(val).split("/").length === 3);
7368
7637
  }
7369
- function trimRight(input) {
7370
- return input.trimEnd();
7638
+ function isGithubRepoReleaseTagUrl(val) {
7639
+ return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases/tag/") && stripper(val).length === 4);
7371
7640
  }
7372
- function trimEnd(input) {
7373
- return input.trimEnd();
7641
+ function isGithubIssuesListUrl(val) {
7642
+ return isString(val) && val.startsWith("https://github.com/") && val.includes("/issues");
7374
7643
  }
7375
- function truncate(content, maxLength, ellipsis = false) {
7376
- const overLimit = content.length > maxLength;
7377
- return overLimit ? ellipsis ? `${content.slice(0, maxLength)}${typeof ellipsis === "string" ? ellipsis : "..."}` : content.slice(0, maxLength) : content;
7644
+ function isGithubIssueUrl(val) {
7645
+ return isString(val) && (val.startsWith("https://github.com/") && val.includes("/issues/"));
7378
7646
  }
7379
- function tuple(...values) {
7380
- const arr = values.length === 1 ? values[0] : values;
7381
- return asArray(arr);
7647
+ function isGithubProjectsListUrl(val) {
7648
+ return isString(val) && (val.startsWith("https://github.com/") && (val.includes("/projects?") || val.trim().endsWith("/projects")) && stripper(val).split("/").length === 3);
7382
7649
  }
7383
- function uncapitalize(str) {
7384
- return `${str?.slice(0, 1).toLowerCase()}${str?.slice(1)}`;
7650
+ function isGithubProjectUrl(val) {
7651
+ return isString(val) && (val.startsWith("https://github.com/") && val.includes("/projects/") && stripper(val).split("/").length === 4);
7385
7652
  }
7386
- var unset = "<<unset>>";
7387
- function uppercase(str) {
7388
- return str.toUpperCase();
7653
+ function isGithubReleasesListUrl(val) {
7654
+ return isString(val) && (val.startsWith("https://github.com/") && (val.includes("/releases?") || val.trim().endsWith("/releases")) && stripper(val).split("/").length === 3);
7389
7655
  }
7390
- function widen(value) {
7391
- return value;
7656
+ function isGithubReleaseTagUrl(val) {
7657
+ return isString(val) && (val.startsWith("https://github.com/") && val.includes("/releases/tag/") && stripper(val).split("/").length === 5);
7392
7658
  }
7393
- var PROTOCOLS = Object.values(NETWORK_PROTOCOL_LOOKUP2).flat().filter((i) => i !== "");
7394
- function getUrlProtocol(url) {
7395
- const proto = PROTOCOLS.find((p) => url.startsWith(`${p}://`));
7396
- return proto;
7659
+ function isRepoSource(v) {
7660
+ return isString(v) && REPO_SOURCES2.includes(v);
7397
7661
  }
7398
- function removeUrlProtocol(url) {
7399
- return stripBefore(url, "://");
7662
+ function isSemanticVersion(v, allowPrefix = false) {
7663
+ return isString(v) && v.split(".").length === 3 && !Number.isNaN(Number(v.split(".")[1])) && !Number.isNaN(Number(v.split(".")[2])) && (!Number.isNaN(Number(v.split(".")[0])) || allowPrefix && !Number.isNaN(Number(stripLeading(v.split(".")[0], "v").trim())));
7400
7664
  }
7401
- function ensurePath(val) {
7402
- const val2 = ensureLeading(val, "/");
7403
- return val === "" ? "" : stripTrailing(val2, "/");
7665
+ function isRepoUrl(val) {
7666
+ return isGithubUrl(val) || isBitbucketUrl(val) || isCodeCommitUrl(val);
7404
7667
  }
7405
- function getUrlPath(url) {
7406
- return isUrl(url) ? ensurePath(
7407
- stripAfter(stripBefore(removeUrlProtocol(url), "/"), "?")
7408
- ) : Never2;
7668
+ function isWholeFoodsUrl(val) {
7669
+ return isString(val) && WHOLE_FOODS_DNS2.some((i) => val.startsWith(`https://${i}`));
7409
7670
  }
7410
- function getUrlQueryParams(url, specific = void 0) {
7411
- const qp = stripBefore(url, "?");
7412
- if (specific) {
7413
- return qp.includes(`${specific}=`) ? decodeURIComponent(
7414
- stripAfter(
7415
- stripBefore(qp, `${specific}=`),
7416
- "&"
7417
- ).replace(/\+/g, "%20")
7418
- ) : void 0;
7419
- }
7420
- return qp === "" ? qp : `?${qp}`;
7671
+ function isCvsUrl(val) {
7672
+ return isString(val) && CVS_DNS2.some((i) => val.startsWith(`https://${i}`));
7421
7673
  }
7422
- function getUrlDefaultPort(url) {
7423
- const proto = getUrlProtocol(url);
7424
- return proto in PROTOCOL_DEFAULT_PORTS2 ? PROTOCOL_DEFAULT_PORTS2[proto] : null;
7674
+ function isWalgreensUrl(val) {
7675
+ return isString(val) && WALGREENS_DNS2.some((i) => val.startsWith(`https://${i}`));
7425
7676
  }
7426
- function getUrlPort(url, resolve = false) {
7427
- const re = /.*:(\d{2,3})/;
7428
- const match = url.match(re);
7429
- return re.test(url) && match && isNumberLike(Array.from(match)[1]) ? Number(Array.from(match)[1]) : resolve ? getUrlDefaultPort(url) : hasProtocol(url) ? `default` : null;
7677
+ function isKrogersUrl(val) {
7678
+ return isString(val) && KROGER_DNS2.some((i) => val.startsWith(`https://${i}`));
7430
7679
  }
7431
- function getUrlSource(url) {
7432
- const candidate = stripAfter(stripAfter(stripAfter(removeUrlProtocol(url), "/"), "?"), ":");
7433
- return isIpAddress(candidate) || isDomainName(candidate) ? candidate : Never2;
7680
+ function isZaraUrl(val) {
7681
+ return isString(val) && ZARA_DNS2.some((i) => val.startsWith(`https://${i}`));
7434
7682
  }
7435
- function getUrlBase(url) {
7436
- const path = getUrlPath(url);
7437
- const remaining = stripAfter(url, path);
7438
- return remaining;
7683
+ function isHmUrl(val) {
7684
+ return isString(val) && HM_DNS2.some((i) => val.startsWith(`https://${i}`));
7439
7685
  }
7440
- function getUrlDynamics(url) {
7441
- const path = getUrlPath(url);
7442
- const qp = getUrlQueryParams(url);
7443
- const pathParts = path.startsWith("<") ? path.split("<").map((i) => ensureLeading(i, "<")) : path.split("<").map((i) => ensureLeading(i, "<")).slice(1);
7444
- const segmentTypes = [
7445
- "string",
7446
- "number",
7447
- "boolean",
7448
- "Opt<string>",
7449
- "Opt<number>",
7450
- "Opt<boolean>"
7451
- ];
7452
- const pathVars = {};
7453
- const findPathTyped = infer(`<{{infer name}} as {{infer type}}>`);
7454
- const findPathUnion = infer(`<{{infer name}} as string({{infer union}})>`);
7455
- const findPathNamed = infer(`<{{infer name}}>`);
7456
- for (const part of pathParts) {
7457
- const union4 = findPathUnion(part);
7458
- const typed = findPathTyped(part);
7459
- const named = findPathNamed(part);
7460
- if (union4) {
7461
- if (isVariable(union4.name) && isCsv(union4.union)) {
7462
- pathVars[union4.name] = `string(${union4.union})`;
7463
- }
7464
- } else if (typed && segmentTypes.includes(typed.type) && isVariable(typed.name)) {
7465
- pathVars[typed.name] = typed.type;
7466
- } else if (named && isVariable(named.name)) {
7467
- pathVars[named.name] = "string";
7468
- }
7469
- }
7470
- const qpVars = {};
7471
- const qpParts = stripLeading(qp, "?").split("&");
7472
- for (const p of qpParts) {
7473
- const union4 = infer(`{{infer var}}=<string({{infer params}})>`)(p);
7474
- const dynamic = infer(`{{infer var}}=<{{infer val}}>`)(p);
7475
- const fixed = infer(`{{infer var}}={{infer val}}`)(p);
7476
- if (union4 && isVariable(union4.var) && isCsv(union4.params)) {
7477
- qpVars[union4.var] = `string(${union4.params})`;
7478
- } else if (dynamic && isVariable(dynamic.var) && segmentTypes.includes(dynamic.val)) {
7479
- qpVars[dynamic.var] = dynamic.val;
7480
- } else if (fixed && isVariable(fixed.var)) {
7481
- qpVars[fixed.var] = fixed.val;
7482
- }
7483
- }
7484
- return {
7485
- pathVars,
7486
- qpVars,
7487
- allVars: hasOverlappingKeys(pathVars, qpVars) ? null : {
7488
- ...pathVars,
7489
- ...qpVars
7490
- }
7491
- };
7686
+ function isDellUrl(val) {
7687
+ return isString(val) && DELL_DNS2.some((i) => val.startsWith(`https://${i}`));
7492
7688
  }
7493
- function urlMeta(url) {
7494
- return {
7495
- url,
7496
- isUrl: isUrl(url),
7497
- protocol: getUrlProtocol(url),
7498
- path: getUrlPath(url),
7499
- queryParameters: getUrlQueryParams(url),
7500
- params: getUrlDynamics,
7501
- port: getUrlPort(url),
7502
- source: getUrlSource(url),
7503
- isIpAddress: isIpAddress(getUrlSource(url)),
7504
- isIp4Address: isIp4Address(getUrlSource(url)),
7505
- isIp6Address: isIp6Address(getUrlSource(url))
7506
- };
7689
+ function isIkeaUrl(val) {
7690
+ return isString(val) && KROGER_DNS2.some((i) => val.startsWith(`https://${i}`));
7507
7691
  }
7508
- function getYouTubePageType(url) {
7509
- return isYouTubeUrl(url) ? isYouTubeVideoUrl(url) && (hasUrlQueryParameter(url, "v") || isYouTubeShareUrl(url)) ? hasUrlQueryParameter(url, "list") ? isYouTubeShareUrl(url) ? hasUrlQueryParameter(url, "t") ? `play::video::in-list::share-link::with-timestamp` : `play::video::in-list::share-link` : `play::video::in-list` : isYouTubeShareUrl(url) ? hasUrlQueryParameter(url, "t") ? `play::video::solo::share-link::with-timestamp` : `play::video::solo::share-link` : `play::video::solo` : isYouTubeCreatorUrl(url) ? getUrlPath(url).includes("/videos") ? "creator::videos" : getUrlPath(url).includes("/playlists") ? "creator::playlists" : last(getUrlPath(url).split("/")).startsWith("@") || getUrlPath(url).includes("/featured") ? "creator::featured" : "creator::other" : isYouTubeFeedUrl(url) ? isYouTubeFeedUrl(url, "history") ? "feed::history" : isYouTubeFeedUrl(url, "playlists") ? "feed::playlists" : isYouTubeFeedUrl(url, "liked") ? "feed::liked" : isYouTubeFeedUrl(url, "subscriptions") ? "feed::subscriptions" : isYouTubeFeedUrl(url, "trending") ? "feed::trending" : "feed::other" : isYouTubeVideosInPlaylist(url) ? "playlist::show" : "other" : Never2;
7692
+ function isLowesUrl(val) {
7693
+ return isString(val) && KROGER_DNS2.some((i) => val.startsWith(`https://${i}`));
7510
7694
  }
7511
- function youtubeEmbed(url) {
7512
- if (hasUrlQueryParameter(url, "v")) {
7513
- const id = getUrlQueryParams(url, "v");
7514
- return `https://www.youtube.com/embed/${id}`;
7515
- } else if (isYouTubeShareUrl(url)) {
7516
- const id = url.split("/").pop();
7517
- if (id) {
7518
- return `https://www.youtube.com/embed/${id}`;
7519
- } else {
7520
- throw new Error(`Unexpected problem parsing share URL -- "${url}" -- into a YouTube embed URL`);
7521
- }
7522
- } else {
7523
- throw new Error(`Unexpected URL structure; unable to convert "${url}" to a YouTube embed URL`);
7524
- }
7695
+ function isNikeUrl(val) {
7696
+ return isString(val) && NIKE_DNS2.some((i) => val.startsWith(`https://${i}`));
7525
7697
  }
7526
- function youtubeMeta(url) {
7527
- return isYouTubeUrl(url) ? {
7528
- url,
7529
- isYouTubeUrl: true,
7530
- isShareUrl: isYouTubeShareUrl(url),
7531
- pageType: getYouTubePageType(url)
7532
- } : {
7533
- url,
7534
- isYouTubeUrl: false
7535
- };
7698
+ function isWayfairUrl(val) {
7699
+ return isString(val) && WAYFAIR_DNS2.some((i) => val.startsWith(`https://${i}`));
7700
+ }
7701
+ function isBestBuyUrl(val) {
7702
+ return isString(val) && BEST_BUY_DNS2.some((i) => val.startsWith(`https://${i}`));
7703
+ }
7704
+ function isCostCoUrl(val) {
7705
+ return isString(val) && COSTCO_DNS2.some((i) => val.startsWith(`https://${i}`));
7536
7706
  }
7537
- function queue(state) {
7538
- return {
7539
- queue: state,
7540
- size: state.length,
7541
- isEmpty() {
7542
- return state.length === 0;
7543
- },
7544
- clear() {
7545
- state.slice(0, 0);
7546
- },
7547
- drain() {
7548
- const old_state = [...state];
7549
- state.slice(0, 0);
7550
- return old_state;
7551
- },
7552
- push(...add) {
7553
- state.push(...add);
7554
- },
7555
- drop(quantity) {
7556
- if (quantity && quantity > state.length) {
7557
- throw new Error("Cannot drop more elements than present in the queue");
7558
- }
7559
- state.splice(0, quantity || 1);
7560
- },
7561
- take(quantity) {
7562
- if (quantity && quantity > state.length) {
7563
- throw new Error("Cannot take more elements than present in the queue");
7564
- }
7565
- const result2 = state.slice(0, quantity || 1);
7566
- state.splice(0, quantity || 1);
7567
- return result2;
7568
- },
7569
- *[Symbol.iterator]() {
7570
- for (let i = 0; i < state.length; i++) {
7571
- yield state[i];
7572
- }
7573
- }
7574
- };
7707
+ function isEtsyUrl(val) {
7708
+ return isString(val) && ETSY_DNS2.some((i) => val.startsWith(`https://${i}`));
7575
7709
  }
7576
- function createFifoQueue(...list2) {
7577
- return queue([...list2]);
7710
+ function isTargetUrl(val) {
7711
+ return isString(val) && TARGET_DNS2.some((i) => val.startsWith(`https://${i}`));
7578
7712
  }
7579
- function queue2(state) {
7580
- return {
7581
- queue: state,
7582
- size: state.length,
7583
- isEmpty() {
7584
- return state.length === 0;
7585
- },
7586
- push(...add) {
7587
- state.push(...add);
7588
- },
7589
- drop(quantity) {
7590
- state.splice(-quantity);
7591
- },
7592
- clear() {
7593
- state.slice(0, 0);
7594
- },
7595
- drain() {
7596
- const old_state = [...state];
7597
- state.slice(0, 0);
7598
- return old_state;
7599
- },
7600
- take(quantity) {
7601
- const result2 = state.slice(-quantity);
7602
- state.splice(-quantity);
7603
- return result2;
7604
- },
7605
- *[Symbol.iterator]() {
7606
- for (let i = state.length - 1; i >= 0; i--) {
7607
- yield state[i];
7608
- }
7609
- }
7610
- };
7713
+ function isEbayUrl(val) {
7714
+ return isString(val) && EBAY_DNS2.some((i) => val.startsWith(`https://${i}`));
7611
7715
  }
7612
- function createLifoQueue(...list2) {
7613
- return queue2([...list2]);
7716
+ function isHomeDepotUrl(val) {
7717
+ return isString(val) && HOME_DEPOT_DNS2.some((i) => val.startsWith(`https://${i}`));
7614
7718
  }
7615
- var scalarToToken = identity({
7616
- string: "<<string>>",
7617
- number: "<<number>>",
7618
- boolean: "<<boolean>>",
7619
- true: "<<true>>",
7620
- false: "<<false>>",
7621
- null: "<<null>>",
7622
- undefined: "<<undefined>>",
7623
- unknown: "<<unknown>>",
7624
- any: "<<any>>",
7625
- never: "<<never>>"
7626
- });
7627
- function stringLiteral(str) {
7628
- return stripAfter(stripBefore(str, "string("), ")");
7719
+ function isMacysUrl(val) {
7720
+ return isString(val) && MACYS_DNS2.some((i) => val.startsWith(`https://${i}`));
7629
7721
  }
7630
- function numericLiteral(str) {
7631
- return stripAfter(stripBefore(str, "number("), ")");
7722
+ function isAppleUrl(val) {
7723
+ return isString(val) && APPLE_DNS2.some((i) => val.startsWith(`https://${i}`));
7632
7724
  }
7633
- function handleOptional(token) {
7634
- const bare = stripTrailing(stripLeading(token, "Opt<"), ">");
7635
- return bare.startsWith("string") ? `<<union::[ <<string>>, <<undefined>> ]>>` : bare.startsWith("number") ? `<<union::[ <<number>>, <<undefined>> ]>>` : bare.startsWith("boolean") ? `<<union::[ <<boolean>>, <<undefined>> ]>>` : bare.startsWith("unknown") ? `<<union::[ <<unknown>>, <<undefined>> ]>>` : `<<never>>`;
7725
+ function isWalmartUrl(val) {
7726
+ return isString(val) && WALMART_DNS2.some((i) => val.startsWith(`https://${i}`));
7636
7727
  }
7637
- function simpleScalarTokenToTypeToken(val) {
7638
- return val in scalarToToken ? scalarToToken[val] : val.startsWith("string(") ? stringLiteral(val).includes(",") ? `<<union::[ ${stringLiteral(val).split(/,\s?/).map((i) => `"${i}"`).join(", ")} ]>>` : `<<string::${stringLiteral(val)}>>` : val.startsWith("number(") ? numericLiteral(val).includes(",") ? `<<union::[ ${numericLiteral(val).split(/,\s?/).join(", ")} ]>>` : `<<number::${numericLiteral(val)}>>` : val.startsWith("Opt<") ? handleOptional(val) : `<<never>>`;
7728
+ function isAmazonUrl(val) {
7729
+ return isString(val) && AMAZON_DNS2.some((i) => val.startsWith(`https://${i}`));
7639
7730
  }
7640
- function unionNode(node) {
7641
- return isNumberLike(node) ? `<<number::${node}>>` : isBooleanLike(node) ? `<<${node}>>` : isSimpleContainerToken(node) ? simpleContainerTokenToTypeToken(node) : isSimpleScalarToken(node) ? simpleScalarToken(node) : `<<string::${node}>>`;
7731
+ function isRetailUrl(val) {
7732
+ return isAmazonUrl(val) || isWalgreensUrl(val) || isAppleUrl(val) || isMacysUrl(val) || isEbayUrl(val) || isHomeDepotUrl(val) || isTargetUrl(val) || isEtsyUrl(val) || isCostCoUrl(val) || isBestBuyUrl(val) || isWayfairUrl(val) || isNikeUrl(val) || isLowesUrl(val) || isIkeaUrl(val) || isDellUrl(val) || isHmUrl(val) || isZaraUrl(val) || isKrogersUrl(val) || isWalgreensUrl(val) || isCvsUrl(val) || isWholeFoodsUrl(val);
7642
7733
  }
7643
- function union2(nodes) {
7644
- return Array.isArray(nodes) ? nodes.map((n) => unionNode(n)) : nodes.includes(",") ? nodes.split(/,\s?/).map((n) => unionNode(n)).join(", ") : unionNode(nodes);
7734
+ var URL20 = SOCIAL_MEDIA2.flatMap((i) => i.baseUrls);
7735
+ var PROFILE = SOCIAL_MEDIA2.map((i) => i.profileUrl);
7736
+ function isSocialMediaUrl(val) {
7737
+ return isString(val) && URL20.some((i) => val.startsWith(i));
7645
7738
  }
7646
- var stripUnion = stripSurround("Union(", ")");
7647
- function simpleUnionTokenToTypeToken(val) {
7648
- return val.startsWith(`Union(`) && val.endsWith(`)`) ? `<<union::[ ${union2(stripUnion(val))} ]>>` : Never2;
7739
+ function isSocialMediaProfileUrl(val) {
7740
+ return isString(val) && PROFILE.some((i) => i.startsWith(`${i}`));
7649
7741
  }
7650
- function simpleContainerTokenToTypeToken(_val) {
7742
+ function isYouTubeUrl(val) {
7743
+ return isString(val) && (val.startsWith("https://www.youtube.com") || val.startsWith("https://youtube.com") || val.startsWith("https://youtu.be"));
7651
7744
  }
7652
- function asTypeToken(_val) {
7653
- return "not ready";
7745
+ function isYouTubeShareUrl(val) {
7746
+ return isString(val) && val.startsWith(`https://youtu.be`);
7654
7747
  }
7655
- function addToken(token, ...params) {
7656
- return `<<${token}${params.length > 0 ? `::${params.join("::")}` : ""}>>`;
7748
+ function isYouTubeVideoUrl(val) {
7749
+ return isString(val) && (val.startsWith("https://www.youtube.com") || val.startsWith("https://youtube.com") || val.startsWith("https://youtu.be"));
7657
7750
  }
7658
- function boolean(literal2) {
7659
- return isDefined(literal2) ? isTrue(literal2) ? addToken("true") : isFalse(literal2) ? addToken("false") : addToken("boolean") : addToken("boolean");
7751
+ function isYouTubePlaylistUrl(val) {
7752
+ return isString(val) && (val === `https://www.youtube.com/feed/playlists` || val === `https://youtube.com/feed/playlists` || val === `https://www.youtube.com/channel/playlists` || val === `https://youtube.com/channel/playlists` || val.startsWith(`https://www.youtube.com/@`) && val.endsWith(`/playlists`) || val.startsWith(`https://youtube.com/@`) && val.endsWith(`/playlists`));
7660
7753
  }
7661
- var unknown = () => "<<unknown>>";
7662
- var undefinedType = () => "<<undefined>>";
7663
- var nullType = () => "<<null>>";
7664
- function fn(..._args) {
7665
- return {
7666
- returns: (_rtn) => ({
7667
- addProperties: (_kv) => {
7668
- return null;
7669
- },
7670
- done: () => {
7671
- return null;
7672
- }
7673
- }),
7674
- done: () => {
7675
- const result2 = null;
7676
- return result2;
7677
- }
7678
- };
7754
+ function feed_map(type) {
7755
+ return isUndefined(type) ? `/feed` : type === "liked" ? `/playlist?list=LL` : ["history", "playlists", "trending", "subscriptions"].includes(type) ? `/feed/${type}` : `/feed/`;
7679
7756
  }
7680
- function dictionary(_obj) {
7681
- return null;
7757
+ function isYouTubeFeedUrl(val, type) {
7758
+ return isString(val) && (val.startsWith(`https://www.youtube.com${feed_map(type)}`) || val.startsWith(`https://youtube.com${feed_map(type)}`));
7682
7759
  }
7683
- function tuple2(..._elements) {
7684
- return null;
7760
+ function isYouTubeFeedHistoryUrl(val) {
7761
+ return isString(val) && (val.startsWith(`https://www.youtube.com/feed/history`) || val.startsWith(`https://youtube.com/feed/history`));
7685
7762
  }
7686
- function regexToken(re, ...rep) {
7687
- let exp = "";
7688
- if (isString(re)) {
7689
- try {
7690
- const test = new RegExp(re);
7691
- if (!isRegExp(test)) {
7692
- const err = new Error(`Invalid RegEx passed into regexToken(${re}, ${JSON.stringify(rep)})!`);
7693
- err.name = "InvalidRegEx";
7694
- throw err;
7695
- } else {
7696
- exp = re;
7697
- }
7698
- } catch {
7699
- const err = new Error(`Invalid RegEx passed into regexToken(${re}, ${JSON.stringify(rep)})!`);
7700
- err.name = "InvalidRegEx";
7701
- throw err;
7702
- }
7703
- } else if (isRegExp(re)) {
7704
- exp = re.toString();
7705
- }
7706
- const token = `<<string-set::regexp::${encodeURIComponent(exp)}>>`;
7707
- return token;
7763
+ function isYouTubePlaylistsUrl(val) {
7764
+ return isString(val) && (val.startsWith(`https://www.youtube.com/feed/playlists`) || val.startsWith(`https://youtube.com/feed/playlists`));
7708
7765
  }
7709
- function addSingleton(token, api2) {
7710
- return (...literals) => {
7711
- return literals.length === 0 ? api2 || addToken(token) : literals.length === 1 ? addToken(token, literals[0]) : addToken(
7712
- "union",
7713
- literals.map((l) => addToken(token, `${l}`)).join(",")
7714
- );
7715
- };
7766
+ function isYouTubeTrendingUrl(val) {
7767
+ return isString(val) && (val.startsWith(`https://www.youtube.com/feed/trending`) || val.startsWith(`https://youtube.com/feed/trending`));
7716
7768
  }
7717
- var stringApi = {
7718
- startsWith: (startsWith2) => addToken(`string-set`, `startsWith::${startsWith2}`),
7719
- endsWith: (endsWith2) => addToken(`string-set`, `endsWith::${endsWith2}`),
7720
- zip: () => addToken("string-set", "Zip5"),
7721
- zipPlus4: () => addToken("string-set", "Zip5_4"),
7722
- zipCode: () => addToken("string-set", "ZipCode"),
7723
- militaryTime: (resolution) => {
7724
- return addToken(
7725
- "string-set",
7726
- "militaryTime",
7727
- resolution || "HH:MM"
7728
- );
7729
- },
7730
- civilianTime: (resolution) => {
7731
- return addToken(
7732
- "string-set",
7733
- "militaryTime",
7734
- resolution || "HH:MM"
7735
- );
7736
- },
7737
- numericString: () => addToken("string-set", "numeric"),
7738
- ipv4Address: () => addToken("string-set", "ipv4Address"),
7739
- ipv6Address: () => addToken("string-set", "ipv6Address"),
7740
- regex: (exp, ...literalRepresentation) => {
7741
- const token = regexToken(exp, ...literalRepresentation);
7742
- return token;
7743
- },
7744
- done: () => addToken("string")
7745
- };
7746
- var string22 = addSingleton("string", stringApi);
7747
- var number = addSingleton("number");
7748
- function union3(...elements) {
7749
- const result2 = elements.map((_el) => {
7750
- });
7751
- return result2;
7769
+ function isYouTubeSubscriptionsUrl(val) {
7770
+ return isString(val) && (val.startsWith(`https://www.youtube.com/feed/subscriptions`) || val.startsWith(`https://youtube.com/feed/subscriptions`));
7752
7771
  }
7753
- function record(_key, _value) {
7754
- return null;
7772
+ function isYouTubeCreatorUrl(url) {
7773
+ return isString(url) && (url.startsWith(`https://www.youtube.com/@`) || url.startsWith(`https://youtube.com/@`) || url.startsWith(`https://www.youtube.com/channel/`));
7755
7774
  }
7756
- function array(_type) {
7757
- return null;
7775
+ function isYouTubeVideosInPlaylist(val) {
7776
+ return isString(val) && (val.startsWith(`https://www.youtube.com/playlist?`) || val.startsWith(`https://youtube.com/playlist?`)) && hasUrlQueryParameter(val, "list");
7758
7777
  }
7759
- function set(_type) {
7760
- return null;
7778
+ function isVueRef(val) {
7779
+ if (isObject(val)) {
7780
+ const keys = Object.keys(val);
7781
+ return !!["dep", "__v_isRef"].every((i) => keys.includes(i));
7782
+ }
7783
+ return false;
7784
+ }
7785
+ function csv(csv2, format = `string-numeric-tuple`) {
7786
+ const tuple3 = [];
7787
+ csv2.split(/,\s?/).forEach((v) => {
7788
+ tuple3.push(
7789
+ format === "string-numeric-tuple" ? isNumberLike(v) ? Number(v) : v : format === "json-tuple" ? isNumberLike(v) ? Number(v) : v === "true" ? true : v === "false" ? false : `"${v}"` : format === "string-tuple" ? `${v}` : Never2
7790
+ );
7791
+ });
7792
+ return tuple3;
7761
7793
  }
7762
- function map(_key, _value) {
7763
- return null;
7794
+ function fromKeyValue(kvs) {
7795
+ const obj = {};
7796
+ for (const kv of kvs) {
7797
+ obj[kv.key] = kv.value;
7798
+ }
7799
+ return obj;
7764
7800
  }
7765
- function weakMap(_key, _value) {
7766
- return null;
7801
+ function intersect(value, _intersectedWith) {
7802
+ return value;
7767
7803
  }
7768
- function isAddOrDone(val) {
7769
- return isObject(val) && hasKeys("add", "done") && typeof val.done === "function" && typeof val.add === "function";
7804
+ function ip6GroupExpansion(ip) {
7805
+ return stripTrailing(ip.replaceAll("::", ":0000:"), ":");
7770
7806
  }
7771
- var ShapeApiImplementation = {
7772
- string: string22,
7773
- number,
7774
- boolean,
7775
- unknown,
7776
- undefined: undefinedType,
7777
- null: nullType,
7778
- union: union3,
7779
- fn,
7780
- record,
7781
- array,
7782
- set,
7783
- map,
7784
- weakMap,
7785
- dictionary,
7786
- tuple: tuple2
7787
- };
7788
- function shape(cb) {
7789
- const rtn = cb(ShapeApiImplementation);
7790
- return handleDoneFn(
7791
- isAddOrDone(rtn) ? rtn.done() : rtn
7792
- );
7807
+ function jsonValue(val) {
7808
+ return isNumberLike(val) ? Number(val) : val === "true" ? true : val === "false" ? false : `"${val}"`;
7793
7809
  }
7794
- function isShape(v) {
7795
- return !!(isString(v) && v.startsWith("<<") && v.endsWith(">>") && SHAPE_PREFIXES2.some((i) => v.startsWith(`<<${i}`)));
7810
+ function jsonValues(...val) {
7811
+ return val.map((i) => jsonValue(i));
7796
7812
  }
7797
- function asDefineObject(defn) {
7798
- const result2 = Object.keys(defn).reduce(
7799
- (acc, i) => isSimpleToken(defn[i]) ? { ...acc, [i]: asType(defn[i]) } : isDoneFn(defn[i]) ? {
7800
- ...acc,
7801
- [i]: handleDoneFn(defn[i](ShapeApiImplementation))
7802
- } : isFunction(defn[i]) ? {
7803
- ...acc,
7804
- [i]: handleDoneFn(defn[i](ShapeApiImplementation))
7805
- } : Never2,
7806
- {}
7807
- );
7808
- return result2;
7813
+ function lookupAlpha2Code(code, prop) {
7814
+ const found = ISO3166_12.find((i) => i.alpha2 === code);
7815
+ return found ? found[prop] : void 0;
7809
7816
  }
7810
- function asType(...token) {
7811
- return isFunction(token) ? token(ShapeApiImplementation) : token.length === 1 ? isFunction(token[0]) ? handleDoneFn(token[0](ShapeApiImplementation)) : isDefineObject(token[0]) ? asDefineObject(token[0]) : token[0] : token.map((i) => isFunction(i) ? handleDoneFn(i(ShapeApiImplementation)) : i);
7817
+ function lookupAlpha3Code(code, prop) {
7818
+ const found = ISO3166_12.find((i) => i.alpha3 === code);
7819
+ return found ? found[prop] : void 0;
7812
7820
  }
7813
- function asStringLiteral(...values) {
7814
- return values.map((i) => i);
7821
+ function lookupName(name, prop) {
7822
+ const found = ISO3166_12.find((i) => i.name === name);
7823
+ return found ? found[prop] : void 0;
7815
7824
  }
7816
- var choices = "NOT READY";
7817
- function ip6Prefix(...groups) {
7818
- const empty = addToken("string");
7819
- const count = 4 - groups.length;
7820
- const fillIn = [];
7821
- for (let index = 0; index < count; index++) {
7822
- fillIn.push(empty);
7825
+ function lookupNumericCode(code, prop) {
7826
+ let num = isNumber(code) ? `${code}` : code;
7827
+ if (num.length === 1) {
7828
+ num = `00${num}`;
7829
+ } else if (num.length === 2) {
7830
+ num = `0${num}`;
7823
7831
  }
7824
- return [
7825
- "<<string::",
7826
- [
7827
- groups.join(":"),
7828
- fillIn.join(":")
7829
- ].join(":"),
7830
- ">>"
7831
- ].join("");
7832
+ const found = ISO3166_12.find((i) => i.countryCode === num);
7833
+ return found ? found[prop] : void 0;
7832
7834
  }
7833
- function createProxy(...initialize) {
7834
- const state = initialize;
7835
- state.id = null;
7836
- const proxy = new Proxy(state, {});
7837
- Object.defineProperty(proxy, "id", {
7838
- enumerable: false
7839
- });
7840
- return proxy;
7835
+ function lookupCountryName(code) {
7836
+ const uc = uppercase(code);
7837
+ return isNumberLike(code) ? lookupNumericCode(code, "name") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "name") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "name") : void 0;
7841
7838
  }
7842
- function list(...init) {
7843
- return init.length === 1 && isArray(init[0]) ? createProxy(...init[0]) : createProxy(...init);
7839
+ function lookupCountryAlpha2(code) {
7840
+ const uc = uppercase(code);
7841
+ return isNumberLike(code) ? lookupNumericCode(code, "alpha2") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "alpha2") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "alpha2") : isIso3166CountryName(code) ? lookupName(code, "alpha2") : void 0;
7844
7842
  }
7845
- function singletonApi(kind) {
7846
- return {
7847
- wide: () => `<<${kind}>>`,
7848
- literal: (val) => `<<${kind}::${val}>>`
7849
- };
7843
+ function lookupCountryAlpha3(token) {
7844
+ const uc = uppercase(token);
7845
+ return isNumberLike(token) ? lookupNumericCode(token, "alpha3") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "alpha3") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "alpha3") : isIso3166CountryName(token) ? lookupName(token, "alpha3") : void 0;
7850
7846
  }
7851
- function setApi(_variant) {
7852
- return null;
7847
+ function lookupCountryCode(token) {
7848
+ const uc = uppercase(token);
7849
+ return isNumberLike(token) ? lookupNumericCode(token, "countryCode") : isIso3166Alpha2(uc) ? lookupAlpha2Code(uc, "countryCode") : isIso3166Alpha3(uc) ? lookupAlpha3Code(uc, "countryCode") : isIso3166CountryName(token) ? lookupName(token, "countryCode") : void 0;
7853
7850
  }
7854
- function fnReturnsApi(variant, _params, returns) {
7855
- return isSet(returns) ? null : (_rtn) => {
7856
- return isSet(returns) ? `<<${variant}::>>` : null;
7851
+ function asMapper(fn2) {
7852
+ const props = {
7853
+ kind: "Mapper",
7854
+ map: (from) => {
7855
+ return from.map(fn2);
7856
+ }
7857
7857
  };
7858
+ return createFnWithPropsExplicit(fn2, props);
7858
7859
  }
7859
- function fnParamsApi(variant, params, _returns) {
7860
- return isSet(params) ? null : (params2) => {
7861
- return isSet(params2) ? `<<${variant}::>>` : null;
7860
+ function createObjectMap() {
7861
+ return (map2) => {
7862
+ const fn2 = (input) => {
7863
+ return Object.keys(map2).reduce(
7864
+ (acc, key) => {
7865
+ const val = map2[key];
7866
+ return {
7867
+ ...acc,
7868
+ [key]: isFunction(val) ? val(input) : val
7869
+ };
7870
+ },
7871
+ {}
7872
+ );
7873
+ };
7874
+ return fn2;
7862
7875
  };
7863
7876
  }
7864
- function fnDoneApi(variant, params, returns) {
7865
- return isUnset(params) && isUnset(returns) ? `<<` : ``;
7877
+ function createMapper() {
7878
+ return (fn2) => {
7879
+ return asMapper(fn2);
7880
+ };
7866
7881
  }
7867
- function fnTokenClosure(kind, params, returns) {
7868
- return {
7869
- done: fnDoneApi(kind, params, returns),
7870
- params: fnParamsApi(kind, params, returns),
7871
- returns: fnReturnsApi(kind, params, returns)
7882
+ function mergeObjects(defVal, override) {
7883
+ const intersectingKeys = sharedKeys(defVal, override);
7884
+ const defUnique = withoutKeys(defVal, ...intersectingKeys);
7885
+ const overrideUnique = withoutKeys(defVal, ...intersectingKeys);
7886
+ const merged = {
7887
+ ...intersectingKeys.reduce(
7888
+ (acc, key) => typeof override[key] === "undefined" ? { ...acc, [key]: defVal[key] } : { ...acc, [key]: override[key] },
7889
+ {}
7890
+ ),
7891
+ ...defUnique,
7892
+ ...overrideUnique
7872
7893
  };
7894
+ return merged;
7873
7895
  }
7874
- function createTypeToken(kind) {
7875
- return isAtomicKind(kind) ? `<<${kind}>>` : isSingletonKind(kind) ? singletonApi(kind) : isSetBasedKind(kind) ? setApi(kind) : isFnBasedKind(kind) ? handleDoneFn(fnTokenClosure(kind, unset, unset)) : "<<never>>";
7896
+ function mergeScalars(a, b) {
7897
+ return isUndefined(b) ? a : b;
7876
7898
  }
7877
- function fromDefineObject(defn) {
7878
- return defn;
7899
+ function mergeTuples(a, b) {
7900
+ return b.length > a.length ? b.map((v, idx) => v !== void 0 ? v : a[idx]) : [...b, ...a.slice(b.length)].map((v, idx) => v !== void 0 ? v : a[idx]);
7879
7901
  }
7880
- function getTokenKind(token) {
7881
- const bare = stripSurround("<<", ">>")(token);
7882
- const parts = bare.split("::");
7883
- const kind = parts.pop();
7884
- return kind;
7902
+ function never(val) {
7903
+ return val;
7885
7904
  }
7886
- var simpleToken = (token) => token;
7887
- var simpleScalarToken = (token) => token;
7888
- var simpleContainerToken = (token) => token;
7889
- function simpleScalarType(token) {
7890
- const value = simpleScalarToken(token);
7905
+ function optional(value) {
7891
7906
  return value;
7892
7907
  }
7893
- function simpleContainerType(token) {
7894
- const value = simpleContainerToken(token);
7908
+ function orNull(value) {
7895
7909
  return value;
7896
7910
  }
7897
- function simpleType(token) {
7898
- const value = isSimpleScalarToken(token) ? simpleScalarType(token) : isSimpleContainerToken(token) ? simpleContainerToken(token) : Never2;
7911
+ function optionalOrNull(value) {
7899
7912
  return value;
7900
7913
  }
7901
- function hasOverlappingKeys(a, b) {
7902
- const keys = Object.keys(a);
7914
+ function stripParenthesis(val) {
7915
+ return stripTrailing(stripLeading(val.trim(), "("), ")").trim();
7916
+ }
7917
+ function sortKeyApi(order) {
7918
+ return {
7919
+ order,
7920
+ toTop: (...keys) => sortKeyApi(
7921
+ [
7922
+ ...keys,
7923
+ ...order.filter((i) => !keys.includes(i))
7924
+ ]
7925
+ ),
7926
+ toBottom: (...keys) => sortKeyApi(
7927
+ [
7928
+ ...order.filter((i) => !keys.includes(i)),
7929
+ ...keys
7930
+ ]
7931
+ ),
7932
+ done: () => order
7933
+ };
7934
+ }
7935
+ function toKeyValue(obj, sort) {
7936
+ let keys = keysOf(obj);
7937
+ const tuple3 = [];
7938
+ if (sort) {
7939
+ keys = handleDoneFn(sort(sortKeyApi(keys)));
7940
+ }
7903
7941
  for (const k of keys) {
7904
- if (k in b) {
7905
- return true;
7906
- }
7942
+ tuple3.push({ key: k, value: obj[k] });
7907
7943
  }
7908
- return false;
7944
+ return tuple3;
7909
7945
  }
7910
- function uniqueKeys(left, right) {
7911
- const isNumeric = !!(isArray(left) && isArray(right));
7912
- if (isArray(left) && !isArray(right) || isArray(right) && !isArray(left)) {
7913
- throw new Error("uniqueKeys(l,r) given invalid comparison; both left and right values should be an object or an array but not one of each!");
7914
- }
7915
- const l = isNumeric ? Object.keys(left).map((i) => Number(i)) : Object.keys(left);
7916
- const r = isNumeric ? Object.keys(right).map((i) => Number(i)) : Object.keys(right);
7917
- if (isNumeric) {
7918
- throw new Error("uniqueKeys does not yet work with tuples");
7946
+ function convertScalar(val) {
7947
+ switch (typeof val) {
7948
+ case "number":
7949
+ return val;
7950
+ case "string":
7951
+ return Number(val);
7952
+ case "boolean":
7953
+ return val ? 1 : 0;
7954
+ default:
7955
+ throw new Error(`${typeof val} is an invalid scalar type to convert to a number!`);
7919
7956
  }
7920
- const leftKeys = l.filter((i) => !r.includes(i));
7921
- const rightKeys = r.filter((i) => !l.includes(i));
7922
- return [
7923
- "LeftRight",
7924
- leftKeys,
7925
- rightKeys
7926
- ];
7957
+ }
7958
+ var convertList = (val) => val.map((i) => convertScalar(i));
7959
+ function toNumber(value) {
7960
+ return Array.isArray(value) ? convertList(value) : convertScalar(value);
7961
+ }
7962
+ var MODS = TW_MODIFIERS2.map((i) => `${i}:`);
7963
+ function removeTailwindModifiers(val) {
7964
+ return MODS.some((i) => val.startsWith(i)) ? removeTailwindModifiers(val.replace(MODS.find((i) => val.startsWith(i)), "")) : val;
7965
+ }
7966
+ function getTailwindModifiers(val) {
7967
+ return val.split(":").filter((i) => isTailwindModifier(i));
7968
+ }
7969
+ function union3(..._options) {
7970
+ return (value) => value;
7971
+ }
7972
+ function unionize(value, _inUnionWith) {
7973
+ return value;
7927
7974
  }
7928
7975
  function asVueRef(value) {
7929
7976
  return {
@@ -8365,6 +8412,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
8365
8412
  defineObject,
8366
8413
  defineObjectApi,
8367
8414
  defineTuple,
8415
+ doesExtend,
8368
8416
  endsWith,
8369
8417
  ensureLeading,
8370
8418
  ensureSurround,
@@ -8375,6 +8423,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
8375
8423
  find,
8376
8424
  fnMeta,
8377
8425
  fromDefineObject,
8426
+ fromKeyValue,
8378
8427
  get,
8379
8428
  getDaysBetween,
8380
8429
  getEach,
@@ -8657,6 +8706,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
8657
8706
  isVoltageUom,
8658
8707
  isVolumeMetric,
8659
8708
  isVolumeUom,
8709
+ isVueRef,
8660
8710
  isWalgreensUrl,
8661
8711
  isWalmartUrl,
8662
8712
  isWayfairUrl,
@@ -8750,6 +8800,7 @@ var ExifSaturation = /* @__PURE__ */ ((ExifSaturation2) => {
8750
8800
  takeProp,
8751
8801
  toCamelCase,
8752
8802
  toKebabCase,
8803
+ toKeyValue,
8753
8804
  toNumber,
8754
8805
  toNumericArray,
8755
8806
  toPascalCase,