@learnosity/lib-qti-converter 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/packages/cli/dist/{batchProcessors-BI6C89vy.js → batchProcessors-BGdELwug.js} +12 -12
- package/packages/cli/dist/{batchProcessors-BI6C89vy.js.map → batchProcessors-BGdELwug.js.map} +1 -1
- package/packages/cli/dist/batchWorker.js +1 -1
- package/packages/cli/dist/{configOutput-CJ-ryN3j.js → configOutput-DYPwNQf7.js} +1 -1
- package/packages/cli/dist/{configOutput-CJ-ryN3j.js.map → configOutput-DYPwNQf7.js.map} +1 -1
- package/packages/cli/dist/{create-prompt-m0MC0vT_.js → create-prompt-C3XKo-s3.js} +77 -34
- package/packages/cli/dist/create-prompt-C3XKo-s3.js.map +1 -0
- package/packages/cli/dist/{dist-8MaFD1oj.js → dist-D7b9-VIt.js} +8 -7
- package/packages/cli/dist/dist-D7b9-VIt.js.map +1 -0
- package/packages/cli/dist/{learnosityToQti-BDf_faIV.js → learnosityToQti-CN6KKSmF.js} +4 -4
- package/packages/cli/dist/{learnosityToQti-BDf_faIV.js.map → learnosityToQti-CN6KKSmF.js.map} +1 -1
- package/packages/cli/dist/{learnosityToQtiPackage-w-BXgsLt.js → learnosityToQtiPackage-CMOQRiCV.js} +22 -15
- package/packages/cli/dist/learnosityToQtiPackage-CMOQRiCV.js.map +1 -0
- package/packages/cli/dist/main.js +5 -5
- package/packages/cli/dist/{nodeFileAccess-BBS4FAK7.js → nodeFileAccess-_jRCd340.js} +2 -2
- package/packages/cli/dist/{nodeFileAccess-BBS4FAK7.js.map → nodeFileAccess-_jRCd340.js.map} +1 -1
- package/packages/cli/dist/{pathUtils-BUJJCvvp.js → pathUtils-I2bRHUwu.js} +14 -11
- package/packages/cli/dist/pathUtils-I2bRHUwu.js.map +1 -0
- package/packages/cli/dist/{qtiPackageToLearnosity-C24effmB.js → qtiPackageToLearnosity-JRb3TTyC.js} +6 -6
- package/packages/cli/dist/{qtiPackageToLearnosity-C24effmB.js.map → qtiPackageToLearnosity-JRb3TTyC.js.map} +1 -1
- package/packages/cli/dist/{qtiToLearnosity-BEOaukuf.js → qtiToLearnosity-C-jQYKqR.js} +5 -5
- package/packages/cli/dist/{qtiToLearnosity-BEOaukuf.js.map → qtiToLearnosity-C-jQYKqR.js.map} +1 -1
- package/packages/cli/dist/{resolveOptions-l0Hpn8hY.js → resolveOptions-ikupjaRQ.js} +6 -6
- package/packages/cli/dist/{resolveOptions-l0Hpn8hY.js.map → resolveOptions-ikupjaRQ.js.map} +1 -1
- package/packages/cli/dist/{rolldown-runtime-BVN1G_yT.js → rolldown-runtime-BuRBZLzk.js} +8 -6
- package/packages/cli/dist/{table-BkrwlSAQ.js → table-6SiZD7aK.js} +323 -326
- package/packages/cli/dist/table-6SiZD7aK.js.map +1 -0
- package/packages/core/dist/index.js +325 -332
- package/packages/core/dist/node.js +330 -337
- package/packages/cli/dist/create-prompt-m0MC0vT_.js.map +0 -1
- package/packages/cli/dist/dist-8MaFD1oj.js.map +0 -1
- package/packages/cli/dist/learnosityToQtiPackage-w-BXgsLt.js.map +0 -1
- package/packages/cli/dist/pathUtils-BUJJCvvp.js.map +0 -1
- package/packages/cli/dist/table-BkrwlSAQ.js.map +0 -1
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import { i as __toESM, n as __exportAll,
|
|
1
|
+
import { i as __toESM, n as __exportAll, t as __commonJSMin } from "./rolldown-runtime-BuRBZLzk.js";
|
|
2
2
|
import process$1 from "node:process";
|
|
3
3
|
import { mkdir, writeFile } from "fs/promises";
|
|
4
4
|
import { dirname, join } from "path";
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import tty from "node:tty";
|
|
7
|
+
import { createRequire as __createRequire } from "node:module";
|
|
8
|
+
function __require() {
|
|
9
|
+
const require = __createRequire(import.meta.url);
|
|
10
|
+
__require = () => require;
|
|
11
|
+
return require;
|
|
12
|
+
}
|
|
7
13
|
// ../core/src/types.ts
|
|
8
14
|
/**
|
|
9
15
|
* Common diagnostic codes
|
|
@@ -3123,8 +3129,7 @@ function parseQuestionData(value, type, file, diagnostics) {
|
|
|
3123
3129
|
});
|
|
3124
3130
|
return null;
|
|
3125
3131
|
}
|
|
3126
|
-
|
|
3127
|
-
return parser(data, file, diagnostics);
|
|
3132
|
+
return (0, QUESTION_DATA_PARSER_MAP[type])(data, file, diagnostics);
|
|
3128
3133
|
}
|
|
3129
3134
|
function _extractPaginatedContent(obj, file, diagnostics) {
|
|
3130
3135
|
if (!Array.isArray(obj.pages)) {
|
|
@@ -9453,7 +9458,7 @@ const xmlEncodeRegex = /["&'<>\u0080-\uFFFF]/g;
|
|
|
9453
9458
|
* @param code Code unit to test.
|
|
9454
9459
|
*/
|
|
9455
9460
|
function isXmlEscapable(code) {
|
|
9456
|
-
return code >= 128 || code >= 32 && code < 64 && (
|
|
9461
|
+
return code >= 128 || code >= 32 && code < 64 && (0x500000c4 >>> code & 1) === 1;
|
|
9457
9462
|
}
|
|
9458
9463
|
/**
|
|
9459
9464
|
* Encodes all non-ASCII characters, as well as characters not valid in XML
|
|
@@ -13206,7 +13211,7 @@ var HTMLBodyElement = class extends HTMLElement {
|
|
|
13206
13211
|
super(ownerDocument, localName);
|
|
13207
13212
|
}
|
|
13208
13213
|
};
|
|
13209
|
-
// ../../node_modules/.pnpm/cssomnom@0.1.
|
|
13214
|
+
// ../../node_modules/.pnpm/cssomnom@0.1.12/node_modules/cssomnom/dist/CSSStyleDeclaration-D6HTs6vj.js
|
|
13210
13215
|
/**
|
|
13211
13216
|
* @license
|
|
13212
13217
|
* Copyright 2026 Google LLC
|
|
@@ -15157,7 +15162,11 @@ function tryExpandCssWide(filtered, longhands, extraKeywords) {
|
|
|
15157
15162
|
return null;
|
|
15158
15163
|
}
|
|
15159
15164
|
function checkUniformCssWide(serializedVals, checkVar = false) {
|
|
15160
|
-
if (serializedVals.some((v) => CSS_WIDE_KEYWORDS$2.has(v.toLowerCase()) || checkVar && v.toLowerCase().startsWith("var(")))
|
|
15165
|
+
if (serializedVals.some((v) => CSS_WIDE_KEYWORDS$2.has(v.toLowerCase()) || checkVar && v.toLowerCase().startsWith("var("))) {
|
|
15166
|
+
const firstLower = serializedVals[0].toLowerCase();
|
|
15167
|
+
if (!serializedVals.every((v) => v.toLowerCase() === firstLower)) return null;
|
|
15168
|
+
return CSS_WIDE_KEYWORDS$2.has(firstLower) ? firstLower : serializedVals[0];
|
|
15169
|
+
}
|
|
15161
15170
|
}
|
|
15162
15171
|
function expandFourSides(data) {
|
|
15163
15172
|
const s0 = [data[0]];
|
|
@@ -15470,6 +15479,17 @@ function contractBackground(longhands) {
|
|
|
15470
15479
|
const clip = longhands["background-clip"];
|
|
15471
15480
|
const color = longhands["background-color"];
|
|
15472
15481
|
if (!image || !position || !size || !repeat || !attachment || !origin || !clip || !color) return null;
|
|
15482
|
+
const wide = checkUniformCssWide([
|
|
15483
|
+
image,
|
|
15484
|
+
position,
|
|
15485
|
+
size,
|
|
15486
|
+
repeat,
|
|
15487
|
+
attachment,
|
|
15488
|
+
origin,
|
|
15489
|
+
clip,
|
|
15490
|
+
color
|
|
15491
|
+
].map((v) => serialize(v).trim()));
|
|
15492
|
+
if (wide !== void 0) return wide;
|
|
15473
15493
|
const imageLayers = splitTokensByComma(image);
|
|
15474
15494
|
const positionLayers = splitTokensByComma(position);
|
|
15475
15495
|
const sizeLayers = splitTokensByComma(size);
|
|
@@ -16050,7 +16070,6 @@ const FONT_OTHER_VARIANTS = [
|
|
|
16050
16070
|
];
|
|
16051
16071
|
function contractFont(values) {
|
|
16052
16072
|
for (const lh of FONT_PRIMARY_LONGHANDS) if (!values[lh]) return null;
|
|
16053
|
-
for (const lh of FONT_OTHER_VARIANTS) if (values[lh] && serialize(values[lh]).trim().toLowerCase() !== "normal") return null;
|
|
16054
16073
|
const sStyle = serialize(values["font-style"]).trim();
|
|
16055
16074
|
const sCaps = serialize(values["font-variant-caps"]).trim();
|
|
16056
16075
|
const sWeight = serialize(values["font-weight"]).trim();
|
|
@@ -16065,9 +16084,11 @@ function contractFont(values) {
|
|
|
16065
16084
|
sStretch,
|
|
16066
16085
|
sSize,
|
|
16067
16086
|
sLineHeight,
|
|
16068
|
-
sFamily
|
|
16087
|
+
sFamily,
|
|
16088
|
+
...FONT_OTHER_VARIANTS.map((lh) => values[lh] ? serialize(values[lh]).trim() : sStyle)
|
|
16069
16089
|
]);
|
|
16070
16090
|
if (wide !== void 0) return wide;
|
|
16091
|
+
for (const lh of FONT_OTHER_VARIANTS) if (values[lh] && serialize(values[lh]).trim().toLowerCase() !== "normal") return null;
|
|
16071
16092
|
if (!sSize || !sFamily) return null;
|
|
16072
16093
|
const parts = [];
|
|
16073
16094
|
if (sStyle.toLowerCase() !== "normal") parts.push(sStyle);
|
|
@@ -16303,6 +16324,8 @@ function contractLineClamp(values) {
|
|
|
16303
16324
|
const lines = values["max-lines"];
|
|
16304
16325
|
if (!lines) return null;
|
|
16305
16326
|
const sLines = serialize(lines).trim();
|
|
16327
|
+
const wide = checkUniformCssWide([sLines, ...[values["block-ellipsis"], values["continue"]].filter(Boolean).map((v) => serialize(v).trim())]);
|
|
16328
|
+
if (wide !== void 0) return wide;
|
|
16306
16329
|
return sLines.toLowerCase() === "none" ? "none" : sLines;
|
|
16307
16330
|
}
|
|
16308
16331
|
const BORDER_RADIUS_PHYSICAL = [
|
|
@@ -17681,8 +17704,7 @@ function getFirstToken(node) {
|
|
|
17681
17704
|
function getLastToken(node) {
|
|
17682
17705
|
if (typeof node !== "object" || node === null) return null;
|
|
17683
17706
|
if (node.type === "simple-block") {
|
|
17684
|
-
const
|
|
17685
|
-
const end = getMirrorToken(start);
|
|
17707
|
+
const end = getMirrorToken(node.associatedToken?.value);
|
|
17686
17708
|
return {
|
|
17687
17709
|
type: end || ")",
|
|
17688
17710
|
value: end
|
|
@@ -19513,11 +19535,18 @@ var CSSStyleRule = class CSSStyleRule extends CSSGroupingRule {
|
|
|
19513
19535
|
const defaultNamespacePrefixes = /* @__PURE__ */ new Set();
|
|
19514
19536
|
const sheet = this.parentStyleSheet || (this.parentRule ? findParentStyleSheet(this.parentRule) : null);
|
|
19515
19537
|
if (sheet) {
|
|
19516
|
-
const nsRules =
|
|
19517
|
-
const
|
|
19518
|
-
|
|
19519
|
-
|
|
19520
|
-
|
|
19538
|
+
const nsRules = [];
|
|
19539
|
+
for (const r of sheet._rules) {
|
|
19540
|
+
if (isImportRule(r)) continue;
|
|
19541
|
+
if (isNamespaceRule(r)) nsRules.push(r);
|
|
19542
|
+
else break;
|
|
19543
|
+
}
|
|
19544
|
+
if (nsRules.length > 0) {
|
|
19545
|
+
const defaultNs = nsRules.find((ns) => ns.prefix === "");
|
|
19546
|
+
if (defaultNs) {
|
|
19547
|
+
hasDefaultNamespace = true;
|
|
19548
|
+
for (const ns of nsRules) if (ns.namespaceURI === defaultNs.namespaceURI && ns.prefix !== "") defaultNamespacePrefixes.add(ns.prefix);
|
|
19549
|
+
}
|
|
19521
19550
|
}
|
|
19522
19551
|
}
|
|
19523
19552
|
return {
|
|
@@ -19534,7 +19563,12 @@ var CSSStyleRule = class CSSStyleRule extends CSSGroupingRule {
|
|
|
19534
19563
|
}
|
|
19535
19564
|
set selectorText(value) {
|
|
19536
19565
|
const sheet = this.parentStyleSheet || (this.parentRule ? findParentStyleSheet(this.parentRule) : null);
|
|
19537
|
-
const declaredNamespaces =
|
|
19566
|
+
const declaredNamespaces = /* @__PURE__ */ new Set();
|
|
19567
|
+
if (sheet) for (const r of sheet._rules) {
|
|
19568
|
+
if (isImportRule(r)) continue;
|
|
19569
|
+
if (isNamespaceRule(r)) declaredNamespaces.add(r.prefix);
|
|
19570
|
+
else break;
|
|
19571
|
+
}
|
|
19538
19572
|
const nsContext = this._getNamespaceContext();
|
|
19539
19573
|
let isNested = false;
|
|
19540
19574
|
let allowRelative = false;
|
|
@@ -21931,8 +21965,13 @@ CSSGroupingRule._parser = {
|
|
|
21931
21965
|
*/
|
|
21932
21966
|
const CSS_WIDE_KEYWORDS = /* @__PURE__ */ new Set("inherit,initial,unset,revert,revert-layer".split(","));
|
|
21933
21967
|
const LOGICAL_SHORTHANDS = /* @__PURE__ */ new Set("margin,padding,inset,scroll-margin,scroll-padding,border-width,border-style,border-color".split(","));
|
|
21968
|
+
const proxyToTarget = /* @__PURE__ */ new WeakMap();
|
|
21969
|
+
/** @internal */
|
|
21970
|
+
function unwrapStyle(style) {
|
|
21971
|
+
return proxyToTarget.get(style) ?? style;
|
|
21972
|
+
}
|
|
21934
21973
|
function createStyleProxy(target) {
|
|
21935
|
-
|
|
21974
|
+
const proxy = new Proxy(target, {
|
|
21936
21975
|
get(t, prop) {
|
|
21937
21976
|
if (typeof prop === "string") {
|
|
21938
21977
|
if (!isNaN(Number(prop))) {
|
|
@@ -21942,12 +21981,7 @@ function createStyleProxy(target) {
|
|
|
21942
21981
|
}
|
|
21943
21982
|
if (prop in t && (typeof t[prop] !== "undefined" || prop.startsWith("_"))) return t[prop];
|
|
21944
21983
|
if (prop.startsWith("--")) return t._allowCustomProperties ? t.getPropertyValue(prop) : void 0;
|
|
21945
|
-
const
|
|
21946
|
-
let cssProp = prop;
|
|
21947
|
-
if (!isCustomProp) {
|
|
21948
|
-
if (prop === "cssFloat") cssProp = "float";
|
|
21949
|
-
else cssProp = camelToDashed(prop);
|
|
21950
|
-
}
|
|
21984
|
+
const cssProp = prop === "cssFloat" ? "float" : camelToDashed(prop);
|
|
21951
21985
|
if (t._isPropertySupported(cssProp)) return t.getPropertyValue(cssProp);
|
|
21952
21986
|
}
|
|
21953
21987
|
return t[prop];
|
|
@@ -21985,7 +22019,7 @@ function createStyleProxy(target) {
|
|
|
21985
22019
|
const dashed = camelToDashed(prop);
|
|
21986
22020
|
if (t._isPropertySupported(dashed)) return true;
|
|
21987
22021
|
if (prop in SHORTHANDS) return true;
|
|
21988
|
-
|
|
22022
|
+
if (prop in LONGHAND_TO_SHORTHAND) return true;
|
|
21989
22023
|
}
|
|
21990
22024
|
return Reflect.has(t, prop);
|
|
21991
22025
|
},
|
|
@@ -22007,6 +22041,8 @@ function createStyleProxy(target) {
|
|
|
22007
22041
|
} : void 0;
|
|
22008
22042
|
}
|
|
22009
22043
|
});
|
|
22044
|
+
proxyToTarget.set(proxy, target);
|
|
22045
|
+
return proxy;
|
|
22010
22046
|
}
|
|
22011
22047
|
var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
22012
22048
|
/** @internal */ _declarations;
|
|
@@ -22036,6 +22072,10 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22036
22072
|
get _allowImportant() {
|
|
22037
22073
|
return true;
|
|
22038
22074
|
}
|
|
22075
|
+
/** @internal */
|
|
22076
|
+
get _useDirectDeclMap() {
|
|
22077
|
+
return true;
|
|
22078
|
+
}
|
|
22039
22079
|
constructor(parentRuleOrDeclarations, onChangeOrReadonly) {
|
|
22040
22080
|
super();
|
|
22041
22081
|
this._declarations = [];
|
|
@@ -22051,57 +22091,54 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22051
22091
|
this._readonly = typeof onChangeOrReadonly === "boolean" ? onChangeOrReadonly : false;
|
|
22052
22092
|
if (typeof onChangeOrReadonly === "function") this._onChange = onChangeOrReadonly;
|
|
22053
22093
|
}
|
|
22054
|
-
const
|
|
22055
|
-
|
|
22056
|
-
|
|
22057
|
-
|
|
22058
|
-
|
|
22059
|
-
|
|
22060
|
-
|
|
22061
|
-
|
|
22062
|
-
|
|
22063
|
-
|
|
22064
|
-
|
|
22065
|
-
|
|
22066
|
-
|
|
22067
|
-
|
|
22068
|
-
|
|
22069
|
-
|
|
22070
|
-
|
|
22071
|
-
|
|
22072
|
-
|
|
22073
|
-
|
|
22074
|
-
|
|
22075
|
-
|
|
22094
|
+
for (const d of declarations) this._ingestDeclaration(d, this._filterDeclarationsInConstructor, true);
|
|
22095
|
+
return createStyleProxy(this);
|
|
22096
|
+
}
|
|
22097
|
+
_ingestDeclaration(decl, filterSupported, isTopLevel) {
|
|
22098
|
+
if (decl.name === "--") return;
|
|
22099
|
+
if (decl.important && !this._allowImportant) return;
|
|
22100
|
+
const normalizedName = decl.name.startsWith("--") ? decl.name : decl.name.toLowerCase();
|
|
22101
|
+
if (normalizedName.startsWith("--") && !this._allowCustomProperties) return;
|
|
22102
|
+
if (filterSupported && !normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) return;
|
|
22103
|
+
decl.name = normalizedName;
|
|
22104
|
+
if (isTopLevel) this._rawDeclarations.push(decl);
|
|
22105
|
+
const shorthand = SHORTHANDS[decl.name];
|
|
22106
|
+
if (shorthand) {
|
|
22107
|
+
const ser = serialize(decl.value);
|
|
22108
|
+
if (!(ser.includes("var(") || ser.includes("env("))) {
|
|
22109
|
+
const expanded = shorthand.expand(decl.value);
|
|
22110
|
+
if (expanded) {
|
|
22111
|
+
for (const [lh, val] of Object.entries(expanded)) this._ingestDeclaration({
|
|
22112
|
+
type: "declaration",
|
|
22113
|
+
name: lh,
|
|
22114
|
+
value: val,
|
|
22115
|
+
important: decl.important,
|
|
22116
|
+
fromAll: decl.name === "all" || decl.fromAll
|
|
22117
|
+
}, filterSupported, false);
|
|
22118
|
+
return;
|
|
22076
22119
|
}
|
|
22077
22120
|
}
|
|
22078
|
-
|
|
22079
|
-
|
|
22080
|
-
for (const d of declarations) addDeclarationRecursive(d, true);
|
|
22081
|
-
return createStyleProxy(this);
|
|
22121
|
+
}
|
|
22122
|
+
this._addDeclaration(decl);
|
|
22082
22123
|
}
|
|
22083
22124
|
_addDeclaration(d) {
|
|
22084
22125
|
const shorthand = SHORTHANDS[d.name];
|
|
22085
|
-
if (shorthand) {
|
|
22086
|
-
|
|
22087
|
-
|
|
22088
|
-
if (existing.important && !d.important) continue;
|
|
22126
|
+
if (shorthand) for (const lh of shorthand.longhands) {
|
|
22127
|
+
const existing = this._declMap.get(lh);
|
|
22128
|
+
if (existing && (!existing.important || d.important)) {
|
|
22089
22129
|
const index = this._declarations.indexOf(existing);
|
|
22090
22130
|
if (index !== -1) this._declarations.splice(index, 1);
|
|
22091
22131
|
this._declMap.delete(lh);
|
|
22092
22132
|
}
|
|
22093
22133
|
}
|
|
22094
|
-
|
|
22095
|
-
|
|
22134
|
+
const existing = this._declMap.get(d.name);
|
|
22135
|
+
if (existing) {
|
|
22096
22136
|
if (existing.important && !d.important) return;
|
|
22097
22137
|
const index = this._declarations.indexOf(existing);
|
|
22098
22138
|
if (index !== -1) this._declarations.splice(index, 1);
|
|
22099
|
-
this._declarations.push(d);
|
|
22100
|
-
this._declMap.set(d.name, d);
|
|
22101
|
-
} else {
|
|
22102
|
-
this._declarations.push(d);
|
|
22103
|
-
this._declMap.set(d.name, d);
|
|
22104
22139
|
}
|
|
22140
|
+
this._declarations.push(d);
|
|
22141
|
+
this._declMap.set(d.name, d);
|
|
22105
22142
|
}
|
|
22106
22143
|
get length() {
|
|
22107
22144
|
return this._declarations.length;
|
|
@@ -22111,60 +22148,51 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22111
22148
|
}
|
|
22112
22149
|
/** @internal */
|
|
22113
22150
|
_getLonghandForContraction(lh) {
|
|
22114
|
-
const decl = this._getWinningDeclaration(lh);
|
|
22151
|
+
const decl = unwrapStyle(this)._getWinningDeclaration(lh);
|
|
22115
22152
|
if (decl && decl.value.length > 0) return {
|
|
22116
22153
|
value: decl.value,
|
|
22117
22154
|
important: decl.important
|
|
22118
22155
|
};
|
|
22119
22156
|
return null;
|
|
22120
22157
|
}
|
|
22158
|
+
_serializeDirectShorthand(property, shorthand) {
|
|
22159
|
+
const directDecl = this._getWinningDeclaration(property);
|
|
22160
|
+
if (directDecl) {
|
|
22161
|
+
const directIdx = this._declarations.indexOf(directDecl);
|
|
22162
|
+
const allLonghands = getShorthandAllLonghands(shorthand);
|
|
22163
|
+
if (this._declarations.some((d, idx) => {
|
|
22164
|
+
if (!allLonghands.includes(d.name)) return false;
|
|
22165
|
+
if (d.important && !directDecl.important) return true;
|
|
22166
|
+
if (d.important === directDecl.important && idx > directIdx) return true;
|
|
22167
|
+
return false;
|
|
22168
|
+
})) return "";
|
|
22169
|
+
return serialize(directDecl.value).trim();
|
|
22170
|
+
}
|
|
22171
|
+
return "";
|
|
22172
|
+
}
|
|
22121
22173
|
getPropertyValue(property) {
|
|
22174
|
+
const self = unwrapStyle(this);
|
|
22122
22175
|
if (!property.startsWith("--")) property = property.toLowerCase();
|
|
22123
22176
|
else if (!isValidDashedIdent(property)) return "";
|
|
22124
|
-
const
|
|
22125
|
-
if (shorthandLonghands && shorthandLonghands.length > 0) {
|
|
22126
|
-
let allCssWide = null;
|
|
22127
|
-
let allMatch = true;
|
|
22128
|
-
let firstPrio = null;
|
|
22129
|
-
let allSamePriority = true;
|
|
22130
|
-
for (const lh of shorthandLonghands) {
|
|
22131
|
-
const val = this.getPropertyValue(lh);
|
|
22132
|
-
if (!val) {
|
|
22133
|
-
allMatch = false;
|
|
22134
|
-
break;
|
|
22135
|
-
}
|
|
22136
|
-
const prio = this.getPropertyPriority(lh);
|
|
22137
|
-
if (firstPrio === null) firstPrio = prio;
|
|
22138
|
-
else if (firstPrio !== prio) allSamePriority = false;
|
|
22139
|
-
const trimmed = val.trim().toLowerCase();
|
|
22140
|
-
if ([
|
|
22141
|
-
"initial",
|
|
22142
|
-
"inherit",
|
|
22143
|
-
"unset",
|
|
22144
|
-
"revert",
|
|
22145
|
-
"revert-layer"
|
|
22146
|
-
].includes(trimmed)) {
|
|
22147
|
-
if (allCssWide === null) allCssWide = trimmed;
|
|
22148
|
-
else if (allCssWide !== trimmed) {
|
|
22149
|
-
allMatch = false;
|
|
22150
|
-
break;
|
|
22151
|
-
}
|
|
22152
|
-
} else {
|
|
22153
|
-
allMatch = false;
|
|
22154
|
-
break;
|
|
22155
|
-
}
|
|
22156
|
-
}
|
|
22157
|
-
if (allMatch && allCssWide && allSamePriority) return allCssWide;
|
|
22158
|
-
}
|
|
22177
|
+
const map = self._useDirectDeclMap ? self._declMap : null;
|
|
22159
22178
|
const shorthand = SHORTHANDS[property];
|
|
22160
22179
|
if (shorthand) {
|
|
22180
|
+
if (map && !map.has("all")) {
|
|
22181
|
+
const hasSubLonghands = (lh) => map.has(lh) || lh in SHORTHANDS && SHORTHANDS[lh].longhands.every((sub) => map.has(sub));
|
|
22182
|
+
let canContract = shorthand.longhands.every(hasSubLonghands);
|
|
22183
|
+
if (!canContract && shorthand.logicalLonghands) canContract = shorthand.logicalLonghands.every((lh) => map.has(lh));
|
|
22184
|
+
if (!canContract) {
|
|
22185
|
+
if (!map.has(property)) return "";
|
|
22186
|
+
return self._serializeDirectShorthand(property, shorthand);
|
|
22187
|
+
}
|
|
22188
|
+
}
|
|
22161
22189
|
const longhandValues = {};
|
|
22162
22190
|
let anySet = false;
|
|
22163
22191
|
let important = null;
|
|
22164
22192
|
let consistentImportant = true;
|
|
22165
22193
|
const allLonghandsToCheck = getShorthandAllLonghands(shorthand);
|
|
22166
22194
|
for (const lh of allLonghandsToCheck) {
|
|
22167
|
-
const item =
|
|
22195
|
+
const item = self._getLonghandForContraction(lh);
|
|
22168
22196
|
if (item && item.value.length > 0) {
|
|
22169
22197
|
anySet = true;
|
|
22170
22198
|
longhandValues[lh] = item.value;
|
|
@@ -22174,26 +22202,32 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22174
22202
|
}
|
|
22175
22203
|
}
|
|
22176
22204
|
if (anySet && consistentImportant) {
|
|
22177
|
-
const
|
|
22178
|
-
const
|
|
22179
|
-
|
|
22180
|
-
|
|
22181
|
-
|
|
22182
|
-
|
|
22183
|
-
|
|
22184
|
-
|
|
22185
|
-
|
|
22186
|
-
|
|
22205
|
+
const lhKeys = Object.keys(longhandValues);
|
|
22206
|
+
const hasLogicalKey = lhKeys.some((lh) => lh in LOGICAL_MAPPING);
|
|
22207
|
+
let wm = "horizontal-tb";
|
|
22208
|
+
let dir = "ltr";
|
|
22209
|
+
if (hasLogicalKey) {
|
|
22210
|
+
wm = self.getPropertyValue("writing-mode") || "horizontal-tb";
|
|
22211
|
+
dir = self.getPropertyValue("direction") || "ltr";
|
|
22212
|
+
const physicalToLogicalSet = /* @__PURE__ */ new Map();
|
|
22213
|
+
for (const lh of lhKeys) {
|
|
22214
|
+
const physicalProp = resolveLogicalProperty(lh, wm, dir);
|
|
22215
|
+
const decl = self._getWinningDeclaration(lh);
|
|
22216
|
+
if (physicalToLogicalSet.has(physicalProp)) {
|
|
22217
|
+
const other = physicalToLogicalSet.get(physicalProp);
|
|
22218
|
+
if (!(decl?.name === "all" || decl?.fromAll || other.decl?.name === "all" || other.decl?.fromAll)) {
|
|
22219
|
+
if (serialize(longhandValues[lh]).trim() !== serialize(longhandValues[other.lh]).trim()) return "";
|
|
22220
|
+
}
|
|
22187
22221
|
}
|
|
22222
|
+
if (decl && decl.name !== "all" && !decl.fromAll) physicalToLogicalSet.set(physicalProp, {
|
|
22223
|
+
lh,
|
|
22224
|
+
decl
|
|
22225
|
+
});
|
|
22226
|
+
else if (!physicalToLogicalSet.has(physicalProp)) physicalToLogicalSet.set(physicalProp, {
|
|
22227
|
+
lh,
|
|
22228
|
+
decl
|
|
22229
|
+
});
|
|
22188
22230
|
}
|
|
22189
|
-
if (decl && decl.name !== "all" && !decl.fromAll) physicalToLogicalSet.set(physicalProp, {
|
|
22190
|
-
lh,
|
|
22191
|
-
decl
|
|
22192
|
-
});
|
|
22193
|
-
else if (!physicalToLogicalSet.has(physicalProp)) physicalToLogicalSet.set(physicalProp, {
|
|
22194
|
-
lh,
|
|
22195
|
-
decl
|
|
22196
|
-
});
|
|
22197
22231
|
}
|
|
22198
22232
|
const valuesForContractor = {};
|
|
22199
22233
|
let anyLogical = false;
|
|
@@ -22202,7 +22236,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22202
22236
|
const val = longhandValues[lh];
|
|
22203
22237
|
if (val) {
|
|
22204
22238
|
valuesForContractor[lh] = val;
|
|
22205
|
-
if (resolveLogicalProperty(lh, wm, dir) !== lh) anyLogical = true;
|
|
22239
|
+
if (hasLogicalKey && resolveLogicalProperty(lh, wm, dir) !== lh) anyLogical = true;
|
|
22206
22240
|
if (shorthand.logicalLonghands?.includes(lh)) anyLogical = true;
|
|
22207
22241
|
}
|
|
22208
22242
|
}
|
|
@@ -22218,21 +22252,43 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22218
22252
|
return res || "";
|
|
22219
22253
|
}
|
|
22220
22254
|
}
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22255
|
+
return self._serializeDirectShorthand(property, shorthand);
|
|
22256
|
+
} else if (property in SHORTHANDS_DATA) {
|
|
22257
|
+
const shorthandLonghands = SHORTHANDS_DATA[property];
|
|
22258
|
+
if (shorthandLonghands && shorthandLonghands.length > 0) {
|
|
22259
|
+
let allCssWide = null;
|
|
22260
|
+
let allMatch = true;
|
|
22261
|
+
let firstPrio = null;
|
|
22262
|
+
let allSamePriority = true;
|
|
22263
|
+
for (const lh of shorthandLonghands) {
|
|
22264
|
+
if (map && !map.has("all") && !map.has(lh) && !(lh in SHORTHANDS) && !(lh in SHORTHANDS_DATA)) {
|
|
22265
|
+
allMatch = false;
|
|
22266
|
+
break;
|
|
22267
|
+
}
|
|
22268
|
+
const val = self.getPropertyValue(lh);
|
|
22269
|
+
if (!val) {
|
|
22270
|
+
allMatch = false;
|
|
22271
|
+
break;
|
|
22272
|
+
}
|
|
22273
|
+
const trimmed = val.trim().toLowerCase();
|
|
22274
|
+
if (CSS_WIDE_KEYWORDS.has(trimmed)) {
|
|
22275
|
+
const prio = self.getPropertyPriority(lh);
|
|
22276
|
+
if (firstPrio === null) firstPrio = prio;
|
|
22277
|
+
else if (firstPrio !== prio) allSamePriority = false;
|
|
22278
|
+
if (allCssWide === null) allCssWide = trimmed;
|
|
22279
|
+
else if (allCssWide !== trimmed) {
|
|
22280
|
+
allMatch = false;
|
|
22281
|
+
break;
|
|
22282
|
+
}
|
|
22283
|
+
} else {
|
|
22284
|
+
allMatch = false;
|
|
22285
|
+
break;
|
|
22286
|
+
}
|
|
22287
|
+
}
|
|
22288
|
+
if (allMatch && allCssWide && allSamePriority) return allCssWide;
|
|
22232
22289
|
}
|
|
22233
|
-
return "";
|
|
22234
22290
|
}
|
|
22235
|
-
const winner =
|
|
22291
|
+
const winner = self._getWinningDeclaration(property);
|
|
22236
22292
|
if (winner) {
|
|
22237
22293
|
if (winner.name === "all") return serialize(winner.value);
|
|
22238
22294
|
const isCustom = winner.name.startsWith("--");
|
|
@@ -22250,47 +22306,45 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22250
22306
|
}
|
|
22251
22307
|
/** @internal */
|
|
22252
22308
|
_getExactWinningDeclaration(property) {
|
|
22309
|
+
const self = unwrapStyle(this);
|
|
22253
22310
|
if (!property.startsWith("--")) property = property.toLowerCase();
|
|
22254
|
-
const
|
|
22255
|
-
|
|
22256
|
-
|
|
22257
|
-
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
if (isMatch || isAll) {
|
|
22261
|
-
if (!winner || d.important && !winner.important) {
|
|
22262
|
-
winner = d;
|
|
22263
|
-
if (winner.important) break;
|
|
22264
|
-
}
|
|
22265
|
-
}
|
|
22266
|
-
}
|
|
22267
|
-
return winner;
|
|
22311
|
+
const exact = self._declMap.get(property);
|
|
22312
|
+
const allDecl = !property.startsWith("--") && property !== "direction" && property !== "unicode-bidi" && property !== "all" ? self._declMap.get("all") : void 0;
|
|
22313
|
+
if (!allDecl) return exact ?? null;
|
|
22314
|
+
if (!exact) return allDecl;
|
|
22315
|
+
if (exact.important !== allDecl.important) return exact.important ? exact : allDecl;
|
|
22316
|
+
return self._declarations.indexOf(allDecl) > self._declarations.indexOf(exact) ? allDecl : exact;
|
|
22268
22317
|
}
|
|
22269
22318
|
/** @internal */
|
|
22270
22319
|
_getWinningDeclaration(property) {
|
|
22271
|
-
const
|
|
22320
|
+
const self = unwrapStyle(this);
|
|
22321
|
+
const exact = self._getExactWinningDeclaration(property);
|
|
22322
|
+
if (!exact) return null;
|
|
22272
22323
|
const shorthands = LONGHAND_TO_SHORTHAND[property];
|
|
22273
|
-
if (shorthands
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
|
|
22277
|
-
if (
|
|
22278
|
-
if (
|
|
22324
|
+
if (shorthands && !exact.important) {
|
|
22325
|
+
let exactIdx = -1;
|
|
22326
|
+
for (const sh of shorthands) {
|
|
22327
|
+
const shDecl = self._declMap.get(sh);
|
|
22328
|
+
if (shDecl) {
|
|
22329
|
+
if (shDecl.important) return null;
|
|
22330
|
+
if (exactIdx === -1) exactIdx = self._declarations.indexOf(exact);
|
|
22331
|
+
if (self._declarations.indexOf(shDecl) > exactIdx) return null;
|
|
22279
22332
|
}
|
|
22280
22333
|
}
|
|
22281
22334
|
}
|
|
22282
22335
|
return exact;
|
|
22283
22336
|
}
|
|
22284
22337
|
getPropertyPriority(property) {
|
|
22338
|
+
const self = unwrapStyle(this);
|
|
22285
22339
|
if (!property.startsWith("--")) property = property.toLowerCase();
|
|
22286
22340
|
const shorthand = SHORTHANDS[property];
|
|
22287
22341
|
if (shorthand) {
|
|
22288
|
-
if (
|
|
22342
|
+
if (self.getPropertyValue(property) === "") return "";
|
|
22289
22343
|
const checkSet = (longhands) => {
|
|
22290
22344
|
let importantCount = 0;
|
|
22291
22345
|
const values = {};
|
|
22292
22346
|
for (const lh of longhands) {
|
|
22293
|
-
const item =
|
|
22347
|
+
const item = self._getLonghandForContraction(lh);
|
|
22294
22348
|
if (item && item.value.length > 0) {
|
|
22295
22349
|
values[lh] = item.value;
|
|
22296
22350
|
if (item.important) importantCount++;
|
|
@@ -22301,27 +22355,19 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22301
22355
|
values
|
|
22302
22356
|
};
|
|
22303
22357
|
};
|
|
22304
|
-
const
|
|
22305
|
-
|
|
22306
|
-
|
|
22307
|
-
|
|
22308
|
-
if (
|
|
22309
|
-
const
|
|
22310
|
-
if (
|
|
22311
|
-
|
|
22312
|
-
|
|
22313
|
-
}
|
|
22314
|
-
if (shorthand.physicalLonghands) {
|
|
22315
|
-
const physicalResult = checkSet(shorthand.physicalLonghands);
|
|
22316
|
-
if (physicalResult.importantCount === shorthand.physicalLonghands.length && shorthand.physicalLonghands.length > 0) {
|
|
22317
|
-
if (shorthand.contract(physicalResult.values)) return "important";
|
|
22318
|
-
}
|
|
22319
|
-
}
|
|
22320
|
-
const directDecl = this._getWinningDeclaration(property);
|
|
22358
|
+
for (const set of [
|
|
22359
|
+
shorthand.longhands,
|
|
22360
|
+
shorthand.logicalLonghands,
|
|
22361
|
+
shorthand.physicalLonghands
|
|
22362
|
+
]) if (set && set.length > 0) {
|
|
22363
|
+
const res = checkSet(set);
|
|
22364
|
+
if (res.importantCount === set.length && shorthand.contract(res.values)) return "important";
|
|
22365
|
+
}
|
|
22366
|
+
const directDecl = self._getWinningDeclaration(property);
|
|
22321
22367
|
if (directDecl && directDecl.important) return "important";
|
|
22322
22368
|
return "";
|
|
22323
22369
|
}
|
|
22324
|
-
const winner =
|
|
22370
|
+
const winner = self._getWinningDeclaration(property);
|
|
22325
22371
|
return winner && winner.important ? "important" : "";
|
|
22326
22372
|
}
|
|
22327
22373
|
setProperty(property, value, priority = "") {
|
|
@@ -22344,23 +22390,19 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22344
22390
|
}
|
|
22345
22391
|
if (value === void 0 && !property.startsWith("--") && !CUSTOM_IDENT_PROPERTIES.has(property)) return;
|
|
22346
22392
|
const valueStr = typeof value === "string" ? value : String(value);
|
|
22347
|
-
if (property.startsWith("--")) {
|
|
22348
|
-
if (!isValidDashedIdent(property)) return;
|
|
22349
|
-
const tokens = tokenize(valueStr);
|
|
22350
|
-
if (tokens.some((t) => t.type === "bad-string" || t.type === "bad-url")) return;
|
|
22351
|
-
if (!validateCustomPropertyValue(parseComponentValues(tokens))) return;
|
|
22352
|
-
}
|
|
22353
22393
|
const tokens = tokenize(valueStr, property === "unicode-range");
|
|
22354
22394
|
if (tokens.some((t) => t.type === "bad-string" || t.type === "bad-url")) return;
|
|
22355
|
-
if (property === "all") {
|
|
22356
|
-
this._declarations = this._declarations.filter((d) => d.name !== "all");
|
|
22357
|
-
this._declMap.delete("all");
|
|
22358
|
-
}
|
|
22359
22395
|
const compVals = parseComponentValues(tokens);
|
|
22360
|
-
if (
|
|
22396
|
+
if (property.startsWith("--")) {
|
|
22397
|
+
if (!isValidDashedIdent(property) || !validateCustomPropertyValue(compVals)) return;
|
|
22398
|
+
} else {
|
|
22361
22399
|
if (!validateDeclarationValue(compVals)) return;
|
|
22362
22400
|
if (ParseHooks.validatePropertyValue && !ParseHooks.validatePropertyValue(property, valueStr, value)) return;
|
|
22363
22401
|
}
|
|
22402
|
+
if (property === "all") {
|
|
22403
|
+
this._declarations = this._declarations.filter((d) => d.name !== "all");
|
|
22404
|
+
this._declMap.delete("all");
|
|
22405
|
+
}
|
|
22364
22406
|
const shorthand = SHORTHANDS[property];
|
|
22365
22407
|
if (shorthand) {
|
|
22366
22408
|
const hasVar = valueStr.includes("var(") || valueStr.includes("env(");
|
|
@@ -22389,14 +22431,13 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22389
22431
|
else if (!shorthand.stub) return;
|
|
22390
22432
|
}
|
|
22391
22433
|
const existing = this._declMap.get(property);
|
|
22392
|
-
const componentValues = parseComponentValues(tokens);
|
|
22393
22434
|
if (property === "unicode-range") {
|
|
22394
|
-
const assembled = assembleUnicodeRanges(
|
|
22435
|
+
const assembled = assembleUnicodeRanges(compVals);
|
|
22395
22436
|
if (!assembled) return;
|
|
22396
|
-
|
|
22437
|
+
compVals.splice(0, compVals.length, ...assembled);
|
|
22397
22438
|
}
|
|
22398
22439
|
if (existing) {
|
|
22399
|
-
existing.value =
|
|
22440
|
+
existing.value = compVals;
|
|
22400
22441
|
existing.important = isImportant;
|
|
22401
22442
|
existing.fromAll = fromAll;
|
|
22402
22443
|
if (property.startsWith("--")) existing.raw = valueStr ?? void 0;
|
|
@@ -22417,7 +22458,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22417
22458
|
const decl = {
|
|
22418
22459
|
type: "declaration",
|
|
22419
22460
|
name: property,
|
|
22420
|
-
value:
|
|
22461
|
+
value: compVals,
|
|
22421
22462
|
important: isImportant,
|
|
22422
22463
|
fromAll: fromAll || void 0,
|
|
22423
22464
|
raw: property.startsWith("--") ? valueStr ?? void 0 : void 0
|
|
@@ -22430,7 +22471,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22430
22471
|
this._rawDeclarations.push({
|
|
22431
22472
|
type: "declaration",
|
|
22432
22473
|
name: property,
|
|
22433
|
-
value:
|
|
22474
|
+
value: compVals,
|
|
22434
22475
|
important: isImportant,
|
|
22435
22476
|
raw: property.startsWith("--") ? valueStr ?? void 0 : void 0
|
|
22436
22477
|
});
|
|
@@ -22442,52 +22483,40 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22442
22483
|
if (!property.startsWith("--")) property = property.toLowerCase();
|
|
22443
22484
|
if (property === "all") {
|
|
22444
22485
|
const value = this.getPropertyValue("all");
|
|
22445
|
-
|
|
22446
|
-
|
|
22447
|
-
|
|
22448
|
-
|
|
22449
|
-
if (
|
|
22450
|
-
this._declarations.splice(i, 1);
|
|
22486
|
+
const isRetained = (name) => name === "direction" || name === "unicode-bidi" || name.startsWith("--");
|
|
22487
|
+
const prevLen = this._declarations.length;
|
|
22488
|
+
this._rawDeclarations = this._rawDeclarations.filter((d) => isRetained(d.name));
|
|
22489
|
+
this._declarations = this._declarations.filter((d) => {
|
|
22490
|
+
if (!isRetained(d.name)) {
|
|
22451
22491
|
this._declMap.delete(d.name);
|
|
22452
|
-
|
|
22492
|
+
return false;
|
|
22453
22493
|
}
|
|
22454
|
-
|
|
22455
|
-
|
|
22494
|
+
return true;
|
|
22495
|
+
});
|
|
22496
|
+
if (this._declarations.length !== prevLen) this._onChange?.();
|
|
22456
22497
|
return value;
|
|
22457
22498
|
}
|
|
22458
22499
|
const shorthand = SHORTHANDS[property];
|
|
22459
|
-
|
|
22460
|
-
|
|
22461
|
-
|
|
22462
|
-
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22472
|
-
|
|
22473
|
-
|
|
22474
|
-
this._declarations.splice(index, 1);
|
|
22475
|
-
this._declMap.delete(property);
|
|
22500
|
+
const propsToRemove = shorthand ? [
|
|
22501
|
+
property,
|
|
22502
|
+
...shorthand.longhands,
|
|
22503
|
+
...shorthand.logicalLonghands ?? []
|
|
22504
|
+
] : [property];
|
|
22505
|
+
const value = this.getPropertyValue(property);
|
|
22506
|
+
const removeSet = new Set(propsToRemove);
|
|
22507
|
+
this._rawDeclarations = this._rawDeclarations.filter((d) => !removeSet.has(d.name));
|
|
22508
|
+
let changed = false;
|
|
22509
|
+
for (const p of propsToRemove) {
|
|
22510
|
+
const decl = this._declMap.get(p);
|
|
22511
|
+
if (decl) {
|
|
22512
|
+
const idx = this._declarations.indexOf(decl);
|
|
22513
|
+
if (idx !== -1) this._declarations.splice(idx, 1);
|
|
22514
|
+
this._declMap.delete(p);
|
|
22476
22515
|
changed = true;
|
|
22477
22516
|
}
|
|
22478
|
-
if (changed) this._onChange?.();
|
|
22479
|
-
return value;
|
|
22480
22517
|
}
|
|
22481
|
-
|
|
22482
|
-
|
|
22483
|
-
const index = this._declarations.findIndex((d) => d.name === property);
|
|
22484
|
-
if (index !== -1) {
|
|
22485
|
-
this._declarations.splice(index, 1);
|
|
22486
|
-
this._declMap.delete(property);
|
|
22487
|
-
this._onChange?.();
|
|
22488
|
-
return value;
|
|
22489
|
-
}
|
|
22490
|
-
return "";
|
|
22518
|
+
if (changed) this._onChange?.();
|
|
22519
|
+
return value;
|
|
22491
22520
|
}
|
|
22492
22521
|
get cssText() {
|
|
22493
22522
|
if (this._declarations.length === 0) return "";
|
|
@@ -22509,31 +22538,7 @@ var CSSStyleDeclaration = class extends CSSStyleProperties {
|
|
|
22509
22538
|
return this._isPropertySupported(d.name.toLowerCase());
|
|
22510
22539
|
});
|
|
22511
22540
|
this._declMap.clear();
|
|
22512
|
-
for (const d of newStyle._declarations)
|
|
22513
|
-
if (d.name === "--") continue;
|
|
22514
|
-
if (d.important && !this._allowImportant) continue;
|
|
22515
|
-
const normalizedName = d.name.startsWith("--") ? d.name : d.name.toLowerCase();
|
|
22516
|
-
if (normalizedName.startsWith("--") && !this._allowCustomProperties) continue;
|
|
22517
|
-
if (!normalizedName.startsWith("--") && !this._isPropertySupported(normalizedName)) continue;
|
|
22518
|
-
d.name = normalizedName;
|
|
22519
|
-
const shorthand = SHORTHANDS[d.name];
|
|
22520
|
-
if (shorthand) {
|
|
22521
|
-
if (!(serialize(d.value).includes("var(") || serialize(d.value).includes("env("))) {
|
|
22522
|
-
const expanded = shorthand.expand(d.value);
|
|
22523
|
-
if (expanded) {
|
|
22524
|
-
for (const [lh, val] of Object.entries(expanded)) this._addDeclaration({
|
|
22525
|
-
type: "declaration",
|
|
22526
|
-
name: lh,
|
|
22527
|
-
value: val,
|
|
22528
|
-
important: d.important,
|
|
22529
|
-
fromAll: d.name === "all" || d.fromAll
|
|
22530
|
-
});
|
|
22531
|
-
continue;
|
|
22532
|
-
}
|
|
22533
|
-
}
|
|
22534
|
-
}
|
|
22535
|
-
this._addDeclaration(d);
|
|
22536
|
-
}
|
|
22541
|
+
for (const d of newStyle._declarations) this._ingestDeclaration(d, true, false);
|
|
22537
22542
|
return true;
|
|
22538
22543
|
}
|
|
22539
22544
|
set cssText(value) {
|
|
@@ -22594,10 +22599,7 @@ function defineDescriptorProperties(proto, dashedProps, skip) {
|
|
|
22594
22599
|
configurable: true
|
|
22595
22600
|
};
|
|
22596
22601
|
Object.defineProperty(proto, cssProp, desc);
|
|
22597
|
-
if (cssProp.includes("-"))
|
|
22598
|
-
const camelProp = cssProp.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
22599
|
-
Object.defineProperty(proto, camelProp, desc);
|
|
22600
|
-
}
|
|
22602
|
+
if (cssProp.includes("-")) Object.defineProperty(proto, cssProp.replace(/-([a-z])/g, (_, c) => c.toUpperCase()), desc);
|
|
22601
22603
|
}
|
|
22602
22604
|
}
|
|
22603
22605
|
defineDescriptorProperties(CSSPageDescriptors.prototype, PAGE_DESCRIPTOR_PROPERTIES);
|
|
@@ -22906,7 +22908,7 @@ var require_canvas_shim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
22906
22908
|
const { createCanvas } = (/* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
22907
22909
|
/* c8 ignore start */
|
|
22908
22910
|
try {
|
|
22909
|
-
module.exports = __require("canvas");
|
|
22911
|
+
module.exports = (/* @__PURE__ */ __require())("canvas");
|
|
22910
22912
|
} catch (fallback) {
|
|
22911
22913
|
module.exports = require_canvas_shim();
|
|
22912
22914
|
}
|
|
@@ -28307,7 +28309,7 @@ function mapImageclozeassociationV2ToGraphicGapMatch(question, questionRef, diag
|
|
|
28307
28309
|
* question's folder distinct while staying deterministic.
|
|
28308
28310
|
*/
|
|
28309
28311
|
function gapTileFolder(questionRef) {
|
|
28310
|
-
let hash =
|
|
28312
|
+
let hash = 0x811c9dc5;
|
|
28311
28313
|
for (let i = 0; i < questionRef.length; i++) {
|
|
28312
28314
|
hash ^= questionRef.charCodeAt(i);
|
|
28313
28315
|
hash = Math.imul(hash, 16777619) >>> 0;
|
|
@@ -28947,11 +28949,7 @@ function mapMultiWidgetItem(model, diagnostics) {
|
|
|
28947
28949
|
});
|
|
28948
28950
|
}
|
|
28949
28951
|
let responseProcessing;
|
|
28950
|
-
if (model.questions.length === 1 && interactions.length === 1)
|
|
28951
|
-
const question = model.questions[0];
|
|
28952
|
-
const interaction = interactions[0];
|
|
28953
|
-
responseProcessing = determineResponseProcessingStrategy(question, hasInteractionCorrectResponse(interaction));
|
|
28954
|
-
}
|
|
28952
|
+
if (model.questions.length === 1 && interactions.length === 1) responseProcessing = determineResponseProcessingStrategy(model.questions[0], hasInteractionCorrectResponse(interactions[0]));
|
|
28955
28953
|
let instructorStimulus;
|
|
28956
28954
|
if (model.questions.length === 1) {
|
|
28957
28955
|
const question = model.questions[0];
|
|
@@ -29037,8 +29035,7 @@ function mapChoicematrixToMultipleChoiceInteractions(question, questionRef, diag
|
|
|
29037
29035
|
}
|
|
29038
29036
|
const interactions = [];
|
|
29039
29037
|
for (let stemIndex = 0; stemIndex < data.stems.length; stemIndex++) {
|
|
29040
|
-
const
|
|
29041
|
-
const stemResult = sanitizeHtmlContent(stem, `questions[].data.stems[${stemIndex}]`);
|
|
29038
|
+
const stemResult = sanitizeHtmlContent(data.stems[stemIndex], `questions[].data.stems[${stemIndex}]`);
|
|
29042
29039
|
diagnostics.push(...stemResult.diagnostics);
|
|
29043
29040
|
diagnostics.push(...optionDiagnostics);
|
|
29044
29041
|
const choices = optionContents.map((content, i) => ({
|
|
@@ -33450,70 +33447,70 @@ const S = [
|
|
|
33450
33447
|
];
|
|
33451
33448
|
/** Binary-integer parts of the sines of integers (constants) — the MD5 K table. */
|
|
33452
33449
|
const K = [
|
|
33453
|
-
|
|
33454
|
-
|
|
33450
|
+
0xd76aa478,
|
|
33451
|
+
0xe8c7b756,
|
|
33455
33452
|
606105819,
|
|
33456
|
-
|
|
33457
|
-
|
|
33458
|
-
|
|
33459
|
-
|
|
33460
|
-
|
|
33461
|
-
|
|
33462
|
-
|
|
33463
|
-
|
|
33464
|
-
|
|
33465
|
-
|
|
33466
|
-
|
|
33467
|
-
|
|
33468
|
-
|
|
33469
|
-
|
|
33470
|
-
|
|
33453
|
+
0xc1bdceee,
|
|
33454
|
+
0xf57c0faf,
|
|
33455
|
+
0x4787c62a,
|
|
33456
|
+
0xa8304613,
|
|
33457
|
+
0xfd469501,
|
|
33458
|
+
0x698098d8,
|
|
33459
|
+
0x8b44f7af,
|
|
33460
|
+
0xffff5bb1,
|
|
33461
|
+
0x895cd7be,
|
|
33462
|
+
0x6b901122,
|
|
33463
|
+
0xfd987193,
|
|
33464
|
+
0xa679438e,
|
|
33465
|
+
0x49b40821,
|
|
33466
|
+
0xf61e2562,
|
|
33467
|
+
0xc040b340,
|
|
33471
33468
|
643717713,
|
|
33472
|
-
|
|
33473
|
-
|
|
33469
|
+
0xe9b6c7aa,
|
|
33470
|
+
0xd62f105d,
|
|
33474
33471
|
38016083,
|
|
33475
|
-
|
|
33476
|
-
|
|
33472
|
+
0xd8a1e681,
|
|
33473
|
+
0xe7d3fbc8,
|
|
33477
33474
|
568446438,
|
|
33478
|
-
|
|
33479
|
-
|
|
33480
|
-
|
|
33481
|
-
|
|
33482
|
-
|
|
33483
|
-
|
|
33484
|
-
|
|
33485
|
-
|
|
33486
|
-
|
|
33487
|
-
|
|
33488
|
-
|
|
33489
|
-
|
|
33490
|
-
|
|
33491
|
-
|
|
33492
|
-
|
|
33475
|
+
0xc33707d6,
|
|
33476
|
+
0xf4d50d87,
|
|
33477
|
+
0x455a14ed,
|
|
33478
|
+
0xa9e3e905,
|
|
33479
|
+
0xfcefa3f8,
|
|
33480
|
+
0x676f02d9,
|
|
33481
|
+
0x8d2a4c8a,
|
|
33482
|
+
0xfffa3942,
|
|
33483
|
+
0x8771f681,
|
|
33484
|
+
0x6d9d6122,
|
|
33485
|
+
0xfde5380c,
|
|
33486
|
+
0xa4beea44,
|
|
33487
|
+
0x4bdecfa9,
|
|
33488
|
+
0xf6bb4b60,
|
|
33489
|
+
0xbebfbc70,
|
|
33493
33490
|
681279174,
|
|
33494
|
-
|
|
33495
|
-
|
|
33491
|
+
0xeaa127fa,
|
|
33492
|
+
0xd4ef3085,
|
|
33496
33493
|
76029189,
|
|
33497
|
-
|
|
33498
|
-
|
|
33494
|
+
0xd9d4d039,
|
|
33495
|
+
0xe6db99e5,
|
|
33499
33496
|
530742520,
|
|
33500
|
-
|
|
33501
|
-
|
|
33502
|
-
|
|
33503
|
-
|
|
33504
|
-
|
|
33505
|
-
|
|
33506
|
-
|
|
33507
|
-
|
|
33508
|
-
|
|
33509
|
-
|
|
33510
|
-
|
|
33511
|
-
|
|
33512
|
-
|
|
33513
|
-
|
|
33514
|
-
|
|
33497
|
+
0xc4ac5665,
|
|
33498
|
+
0xf4292244,
|
|
33499
|
+
0x432aff97,
|
|
33500
|
+
0xab9423a7,
|
|
33501
|
+
0xfc93a039,
|
|
33502
|
+
0x655b59c3,
|
|
33503
|
+
0x8f0ccc92,
|
|
33504
|
+
0xffeff47d,
|
|
33505
|
+
0x85845dd1,
|
|
33506
|
+
0x6fa87e4f,
|
|
33507
|
+
0xfe2ce6e0,
|
|
33508
|
+
0xa3014314,
|
|
33509
|
+
0x4e0811a1,
|
|
33510
|
+
0xf7537e82,
|
|
33511
|
+
0xbd3af235,
|
|
33515
33512
|
718787259,
|
|
33516
|
-
|
|
33513
|
+
0xeb86d391
|
|
33517
33514
|
];
|
|
33518
33515
|
const HEX = Array.from({ length: 256 }, (_, i) => (i + 256).toString(16).slice(1));
|
|
33519
33516
|
function leftRotate(x, c) {
|
|
@@ -33538,9 +33535,9 @@ function md5Bytes(msg) {
|
|
|
33538
33535
|
buf[totalLen - 3] = hi >>> 8 & 255;
|
|
33539
33536
|
buf[totalLen - 2] = hi >>> 16 & 255;
|
|
33540
33537
|
buf[totalLen - 1] = hi >>> 24 & 255;
|
|
33541
|
-
let a0 =
|
|
33542
|
-
let b0 =
|
|
33543
|
-
let c0 =
|
|
33538
|
+
let a0 = 0x67452301;
|
|
33539
|
+
let b0 = 0xefcdab89;
|
|
33540
|
+
let c0 = 0x98badcfe;
|
|
33544
33541
|
let d0 = 271733878;
|
|
33545
33542
|
const M = /* @__PURE__ */ new Uint32Array(16);
|
|
33546
33543
|
for (let chunk = 0; chunk < totalLen; chunk += 64) {
|
|
@@ -40661,7 +40658,7 @@ var require_has_flag = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
40661
40658
|
}));
|
|
40662
40659
|
// ../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js
|
|
40663
40660
|
var require_supports_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
40664
|
-
var os = __require("os");
|
|
40661
|
+
var os = (/* @__PURE__ */ __require())("os");
|
|
40665
40662
|
var hasFlag = require_has_flag();
|
|
40666
40663
|
var env = process.env;
|
|
40667
40664
|
var forceColor = void 0;
|
|
@@ -41121,7 +41118,7 @@ var require_colors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
41121
41118
|
var colors = {};
|
|
41122
41119
|
module["exports"] = colors;
|
|
41123
41120
|
colors.themes = {};
|
|
41124
|
-
var util = __require("util");
|
|
41121
|
+
var util = (/* @__PURE__ */ __require())("util");
|
|
41125
41122
|
var ansiStyles = colors.styles = require_styles();
|
|
41126
41123
|
var defineProps = Object.defineProperties;
|
|
41127
41124
|
var newLineRegex = /* @__PURE__ */ new RegExp(/[\r\n]+/g);
|
|
@@ -42416,4 +42413,4 @@ function formatDiagnosticsSummaryTable(diagnostics) {
|
|
|
42416
42413
|
}
|
|
42417
42414
|
export { escapeXml as C, DiagnosticCode as D, parseLearnosityItem as E, buildGapImageSvgFromText as S, normalizeXhtmlVoidElements as T, getAttr$3 as _, require_cli_table3 as a, downgradeAssessmentTestToQti21 as b, convertQtiAssessmentItemToLearnosity as c, generateItemReference as d, canonicalizeQtiAssetHref as f, md5hex as g, serializeQtiAssetIdentity as h, chalk as i, parseMetadataTags as l, selectQtiAssetFilename as m, formatDiagnosticsSummaryTable as n, writeDiagnostics as o, isSupportedQtiAssetPath as p, formatDiagnosticsTable as r, transformForwardAssetUrlsInXml as s, countErrors as t, getAllPassageDataPaths as u, require_saxes as v, sanitizeHtmlContent as w, mapLearnosityToAst as x, serializeAssessmentItem as y };
|
|
42418
42415
|
|
|
42419
|
-
//# sourceMappingURL=table-
|
|
42416
|
+
//# sourceMappingURL=table-6SiZD7aK.js.map
|