@qti-components/portable-custom-interaction 1.2.1-next.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,195 @@
1
+ import { inferRecordFieldBaseType, isRecordValue } from '@qti-components/base';
2
+ /**
3
+ * Conversions between a record response as the item stores it and the QTI Appendix C JSON a PCI
4
+ * speaks.
5
+ *
6
+ * The item stores a record as a field map of QTI string literals, the same way it stores every
7
+ * other response value: `{ time: '4.12', point: '455 250' }`. A PCI hands back and receives
8
+ * `{ record: [{ name: 'time', base: { float: 4.12 } }, { name: 'point', base: { point: [455, 250] } }] }`.
9
+ */
10
+ /** Base types whose Appendix C value is a two-element array, stored as `"a b"`. */
11
+ const PAIR_BASE_TYPES = new Set(['point', 'pair', 'directedPair']);
12
+ /**
13
+ * Coerce a scalar value to the expected base-type when possible
14
+ */
15
+ export const coerceBaseValue = (value, baseType) => {
16
+ if (value === null || value === undefined)
17
+ return value;
18
+ switch (baseType) {
19
+ case 'integer': {
20
+ if (typeof value === 'number')
21
+ return value;
22
+ const parsed = parseInt(String(value), 10);
23
+ return Number.isNaN(parsed) ? value : parsed;
24
+ }
25
+ case 'float':
26
+ case 'duration': {
27
+ if (typeof value === 'number')
28
+ return value;
29
+ const parsed = parseFloat(String(value));
30
+ return Number.isNaN(parsed) ? value : parsed;
31
+ }
32
+ case 'boolean': {
33
+ if (typeof value === 'boolean')
34
+ return value;
35
+ if (typeof value === 'string') {
36
+ const lowered = value.toLowerCase();
37
+ if (lowered === 'true')
38
+ return true;
39
+ if (lowered === 'false')
40
+ return false;
41
+ }
42
+ return value;
43
+ }
44
+ case 'point': {
45
+ const parts = Array.isArray(value)
46
+ ? value
47
+ : String(value)
48
+ .trim()
49
+ .split(/[\s,]+/);
50
+ const numbers = parts.map(part => (typeof part === 'number' ? part : parseFloat(String(part))));
51
+ return numbers.length === 2 && numbers.every(Number.isFinite) ? numbers : value;
52
+ }
53
+ case 'pair':
54
+ case 'directedPair': {
55
+ const parts = Array.isArray(value) ? value : String(value).trim().split(/\s+/);
56
+ return parts.length === 2 ? parts.map(String) : value;
57
+ }
58
+ case 'string':
59
+ case 'identifier':
60
+ default:
61
+ return String(value);
62
+ }
63
+ };
64
+ /**
65
+ * Build a record entry from an arbitrary value.
66
+ *
67
+ * With a `baseType` the value is coerced to it, which is how a stored record (all strings) goes
68
+ * out with its declared field types. Without one the type is read off the JS value, which suits
69
+ * values that are typed already, like the QTI_CONTEXT defaults.
70
+ */
71
+ export const recordEntryFromValue = (name, entryValue, baseType) => {
72
+ if (baseType) {
73
+ if (Array.isArray(entryValue) && !PAIR_BASE_TYPES.has(baseType)) {
74
+ return { name, list: { [baseType]: entryValue.map(v => coerceBaseValue(v, baseType)) } };
75
+ }
76
+ if (entryValue === null || entryValue === undefined) {
77
+ return { name, base: null };
78
+ }
79
+ return { name, base: { [baseType]: coerceBaseValue(entryValue, baseType) } };
80
+ }
81
+ if (Array.isArray(entryValue)) {
82
+ const filtered = entryValue.filter(v => v !== null && v !== undefined);
83
+ if (filtered.length && filtered.every(v => typeof v === 'boolean')) {
84
+ return { name, list: { boolean: filtered } };
85
+ }
86
+ if (filtered.length && filtered.every(v => typeof v === 'number')) {
87
+ const numbers = filtered;
88
+ const isIntegers = numbers.every(n => Number.isInteger(n));
89
+ return { name, list: { [isIntegers ? 'integer' : 'float']: numbers } };
90
+ }
91
+ return { name, list: { string: entryValue.map(v => (v === null || v === undefined ? '' : String(v))) } };
92
+ }
93
+ if (typeof entryValue === 'boolean') {
94
+ return { name, base: { boolean: entryValue } };
95
+ }
96
+ if (typeof entryValue === 'number') {
97
+ if (Number.isInteger(entryValue))
98
+ return { name, base: { integer: entryValue } };
99
+ return { name, base: { float: entryValue } };
100
+ }
101
+ if (entryValue === null || entryValue === undefined) {
102
+ return { name, base: { string: '' } };
103
+ }
104
+ if (typeof entryValue === 'object') {
105
+ try {
106
+ return { name, base: { string: JSON.stringify(entryValue) } };
107
+ }
108
+ catch {
109
+ return { name, base: { string: String(entryValue) } };
110
+ }
111
+ }
112
+ return { name, base: { string: String(entryValue) } };
113
+ };
114
+ /**
115
+ * Convert a record object into QtiVariableJSON.
116
+ *
117
+ * `fieldBaseTypes` gives the base type per field; fields it does not name are typed by their JS
118
+ * value (see {@link recordEntryFromValue}).
119
+ */
120
+ export const recordToQtiVariableJSON = (value, fieldBaseTypes = {}) => {
121
+ if (!isRecordValue(value)) {
122
+ return { record: [] };
123
+ }
124
+ const recordEntries = [];
125
+ for (const [name, entryValue] of Object.entries(value)) {
126
+ recordEntries.push(recordEntryFromValue(name, entryValue, fieldBaseTypes[name]));
127
+ }
128
+ return { record: recordEntries };
129
+ };
130
+ /**
131
+ * The base type of every field of a stored record response: as declared where the declaration
132
+ * says, and otherwise read off the stored string (`"4.1"` is a float, `"455 250"` a point).
133
+ */
134
+ export const recordFieldBaseTypes = (value, declared = {}) => {
135
+ if (!isRecordValue(value))
136
+ return { ...declared };
137
+ const baseTypes = {};
138
+ for (const [name, entryValue] of Object.entries(value)) {
139
+ baseTypes[name] =
140
+ declared[name] ?? inferRecordFieldBaseType(Array.isArray(entryValue) ? entryValue[0] : entryValue);
141
+ }
142
+ return baseTypes;
143
+ };
144
+ /** A stored record response as the Appendix C JSON a PCI receives in `boundTo`. */
145
+ export const recordResponseToQtiVariableJSON = (value, declared = {}) => recordToQtiVariableJSON(value, recordFieldBaseTypes(value, declared));
146
+ /** One Appendix C scalar as the QTI string literal the item stores. */
147
+ const toQtiLiteral = (value) => {
148
+ if (value === null || value === undefined)
149
+ return null;
150
+ if (Array.isArray(value))
151
+ return value.map(String).join(' ');
152
+ if (typeof value === 'object') {
153
+ try {
154
+ return JSON.stringify(value);
155
+ }
156
+ catch {
157
+ return String(value);
158
+ }
159
+ }
160
+ return String(value);
161
+ };
162
+ /** The one value of an Appendix C `base` or `list` object, whatever its base-type key is. */
163
+ const firstTypedValue = (typed) => {
164
+ if (!typed)
165
+ return undefined;
166
+ for (const key of Object.keys(typed)) {
167
+ const value = typed[key];
168
+ if (value !== undefined && value !== null)
169
+ return value;
170
+ }
171
+ return undefined;
172
+ };
173
+ /**
174
+ * Appendix C `record` entries as the field map the item stores.
175
+ *
176
+ * Every value becomes its QTI string literal: `{ float: 4.12 }` is `"4.12"`, `{ point: [455, 250] }`
177
+ * is `"455 250"`, and a `list` field becomes an array of them. A field with a NULL value is kept as
178
+ * `null`, so `qti-is-null` over `qti-field-value` sees it.
179
+ */
180
+ export const recordFromQtiVariableJSON = (record) => {
181
+ const value = {};
182
+ for (const entry of record) {
183
+ if (!entry || typeof entry.name !== 'string' || !entry.name)
184
+ continue;
185
+ if (entry.list) {
186
+ const items = firstTypedValue(entry.list);
187
+ value[entry.name] = Array.isArray(items) ? items.map(toQtiLiteral).filter((v) => v !== null) : [];
188
+ }
189
+ else {
190
+ value[entry.name] = toQtiLiteral(firstTypedValue(entry.base));
191
+ }
192
+ }
193
+ return value;
194
+ };
195
+ //# sourceMappingURL=record-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-response.js","sourceRoot":"","sources":["../src/record-response.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAK/E;;;;;;;GAOG;AAEH,mFAAmF;AACnF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC;AAE3E;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAc,EAAE,QAAkB,EAAW,EAAE;IAC7E,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAExD,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,OAAO,KAAK,KAAK,QAAQ;gBAAE,OAAO,KAAK,CAAC;YAC5C,MAAM,MAAM,GAAG,QAAQ,CAAC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CAAC,IAAiC,CAAC,CAAC;YACvE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjH,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,eAAe,CAAC,KAAK,CAAC,IAA+B,CAAC,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["import { inferRecordFieldBaseType, isRecordValue } from '@qti-components/base';\n\nimport type { BaseType, RecordValue } from '@qti-components/base';\nimport type { QtiBaseTypeJSON, QtiListTypeJSON, QtiRecordItem, QtiVariableJSON } from './interface';\n\n/**\n * Conversions between a record response as the item stores it and the QTI Appendix C JSON a PCI\n * speaks.\n *\n * The item stores a record as a field map of QTI string literals, the same way it stores every\n * other response value: `{ time: '4.12', point: '455 250' }`. A PCI hands back and receives\n * `{ record: [{ name: 'time', base: { float: 4.12 } }, { name: 'point', base: { point: [455, 250] } }] }`.\n */\n\n/** Base types whose Appendix C value is a two-element array, stored as `\"a b\"`. */\nconst PAIR_BASE_TYPES = new Set<string>(['point', 'pair', 'directedPair']);\n\n/**\n * Coerce a scalar value to the expected base-type when possible\n */\nexport const coerceBaseValue = (value: unknown, baseType: BaseType): unknown => {\n if (value === null || value === undefined) return value;\n\n switch (baseType) {\n case 'integer': {\n if (typeof value === 'number') return value;\n const parsed = parseInt(String(value), 10);\n return Number.isNaN(parsed) ? value : parsed;\n }\n case 'float':\n case 'duration': {\n if (typeof value === 'number') return value;\n const parsed = parseFloat(String(value));\n return Number.isNaN(parsed) ? value : parsed;\n }\n case 'boolean': {\n if (typeof value === 'boolean') return value;\n if (typeof value === 'string') {\n const lowered = value.toLowerCase();\n if (lowered === 'true') return true;\n if (lowered === 'false') return false;\n }\n return value;\n }\n case 'point': {\n const parts = Array.isArray(value)\n ? value\n : String(value)\n .trim()\n .split(/[\\s,]+/);\n const numbers = parts.map(part => (typeof part === 'number' ? part : parseFloat(String(part))));\n return numbers.length === 2 && numbers.every(Number.isFinite) ? numbers : value;\n }\n case 'pair':\n case 'directedPair': {\n const parts = Array.isArray(value) ? value : String(value).trim().split(/\\s+/);\n return parts.length === 2 ? parts.map(String) : value;\n }\n case 'string':\n case 'identifier':\n default:\n return String(value);\n }\n};\n\n/**\n * Build a record entry from an arbitrary value.\n *\n * With a `baseType` the value is coerced to it, which is how a stored record (all strings) goes\n * out with its declared field types. Without one the type is read off the JS value, which suits\n * values that are typed already, like the QTI_CONTEXT defaults.\n */\nexport const recordEntryFromValue = (name: string, entryValue: unknown, baseType?: BaseType): QtiRecordItem => {\n if (baseType) {\n if (Array.isArray(entryValue) && !PAIR_BASE_TYPES.has(baseType)) {\n return { name, list: { [baseType]: entryValue.map(v => coerceBaseValue(v, baseType)) } as QtiListTypeJSON };\n }\n if (entryValue === null || entryValue === undefined) {\n return { name, base: null };\n }\n return { name, base: { [baseType]: coerceBaseValue(entryValue, baseType) } as QtiBaseTypeJSON };\n }\n\n if (Array.isArray(entryValue)) {\n const filtered = entryValue.filter(v => v !== null && v !== undefined);\n\n if (filtered.length && filtered.every(v => typeof v === 'boolean')) {\n return { name, list: { boolean: filtered as boolean[] } };\n }\n\n if (filtered.length && filtered.every(v => typeof v === 'number')) {\n const numbers = filtered as number[];\n const isIntegers = numbers.every(n => Number.isInteger(n));\n return { name, list: { [isIntegers ? 'integer' : 'float']: numbers } };\n }\n\n return { name, list: { string: entryValue.map(v => (v === null || v === undefined ? '' : String(v))) } };\n }\n\n if (typeof entryValue === 'boolean') {\n return { name, base: { boolean: entryValue } };\n }\n\n if (typeof entryValue === 'number') {\n if (Number.isInteger(entryValue)) return { name, base: { integer: entryValue } };\n return { name, base: { float: entryValue } };\n }\n\n if (entryValue === null || entryValue === undefined) {\n return { name, base: { string: '' } };\n }\n\n if (typeof entryValue === 'object') {\n try {\n return { name, base: { string: JSON.stringify(entryValue) } };\n } catch {\n return { name, base: { string: String(entryValue) } };\n }\n }\n\n return { name, base: { string: String(entryValue) } };\n};\n\n/**\n * Convert a record object into QtiVariableJSON.\n *\n * `fieldBaseTypes` gives the base type per field; fields it does not name are typed by their JS\n * value (see {@link recordEntryFromValue}).\n */\nexport const recordToQtiVariableJSON = (\n value: unknown,\n fieldBaseTypes: Record<string, BaseType> = {}\n): QtiVariableJSON => {\n if (!isRecordValue(value)) {\n return { record: [] };\n }\n\n const recordEntries: QtiRecordItem[] = [];\n for (const [name, entryValue] of Object.entries(value as Record<string, unknown>)) {\n recordEntries.push(recordEntryFromValue(name, entryValue, fieldBaseTypes[name]));\n }\n\n return { record: recordEntries };\n};\n\n/**\n * The base type of every field of a stored record response: as declared where the declaration\n * says, and otherwise read off the stored string (`\"4.1\"` is a float, `\"455 250\"` a point).\n */\nexport const recordFieldBaseTypes = (\n value: unknown,\n declared: Record<string, BaseType> = {}\n): Record<string, BaseType> => {\n if (!isRecordValue(value)) return { ...declared };\n const baseTypes: Record<string, BaseType> = {};\n for (const [name, entryValue] of Object.entries(value)) {\n baseTypes[name] =\n declared[name] ?? inferRecordFieldBaseType(Array.isArray(entryValue) ? entryValue[0] : entryValue);\n }\n return baseTypes;\n};\n\n/** A stored record response as the Appendix C JSON a PCI receives in `boundTo`. */\nexport const recordResponseToQtiVariableJSON = (\n value: unknown,\n declared: Record<string, BaseType> = {}\n): QtiVariableJSON => recordToQtiVariableJSON(value, recordFieldBaseTypes(value, declared));\n\n/** One Appendix C scalar as the QTI string literal the item stores. */\nconst toQtiLiteral = (value: unknown): string | null => {\n if (value === null || value === undefined) return null;\n if (Array.isArray(value)) return value.map(String).join(' ');\n if (typeof value === 'object') {\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n }\n return String(value);\n};\n\n/** The one value of an Appendix C `base` or `list` object, whatever its base-type key is. */\nconst firstTypedValue = <T>(typed: Record<string, T> | null | undefined): T | undefined => {\n if (!typed) return undefined;\n for (const key of Object.keys(typed)) {\n const value = typed[key];\n if (value !== undefined && value !== null) return value;\n }\n return undefined;\n};\n\n/**\n * Appendix C `record` entries as the field map the item stores.\n *\n * Every value becomes its QTI string literal: `{ float: 4.12 }` is `\"4.12\"`, `{ point: [455, 250] }`\n * is `\"455 250\"`, and a `list` field becomes an array of them. A field with a NULL value is kept as\n * `null`, so `qti-is-null` over `qti-field-value` sees it.\n */\nexport const recordFromQtiVariableJSON = (record: readonly QtiRecordItem[]): RecordValue => {\n const value: RecordValue = {};\n for (const entry of record) {\n if (!entry || typeof entry.name !== 'string' || !entry.name) continue;\n if (entry.list) {\n const items = firstTypedValue(entry.list as Record<string, unknown[]>);\n value[entry.name] = Array.isArray(items) ? items.map(toQtiLiteral).filter((v): v is string => v !== null) : [];\n } else {\n value[entry.name] = toQtiLiteral(firstTypedValue(entry.base as Record<string, unknown>));\n }\n }\n return value;\n};\n"]}
@@ -0,0 +1,3 @@
1
+ export declare const requireJsVersion = "2.3.8";
2
+ declare const _default: "/** vim: et:ts=4:sw=4:sts=4\n * @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.\n * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE\n */var requirejs,require,define;(function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version=\"2.3.8\",commentRegExp=/\\/\\*[\\s\\S]*?\\*\\/|([^:\"'=]|^)\\/\\/.*$/mg,cjsRequireRegExp=/[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,jsSuffixRegExp=/\\.js$/,currDirRegExp=/^\\.\\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!!(typeof window<\"u\"&&typeof navigator<\"u\"&&window.document),isWebWorker=!isBrowser&&typeof importScripts<\"u\",readyRegExp=isBrowser&&navigator.platform===\"PLAYSTATION 3\"?/^complete$/:/^(complete|loaded)$/,defContextName=\"_\",isOpera=typeof opera<\"u\"&&opera.toString()===\"[object Opera]\",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(r,a){return a||\"\"}function isFunction(r){return ostring.call(r)===\"[object Function]\"}function isArray(r){return ostring.call(r)===\"[object Array]\"}function each(r,a){if(r){var c;for(c=0;c<r.length&&!(r[c]&&a(r[c],c,r));c+=1);}}function eachReverse(r,a){if(r){var c;for(c=r.length-1;c>-1&&!(r[c]&&a(r[c],c,r));c-=1);}}function hasProp(r,a){return hasOwn.call(r,a)}function getOwn(r,a){return hasProp(r,a)&&r[a]}function eachProp(r,a){var c;for(c in r)if(hasProp(r,c)&&c!==\"__proto__\"&&c!==\"constructor\"&&a(r[c],c))break}function mixin(r,a,c,u){return a&&eachProp(a,function(h,q){(c||!hasProp(r,q))&&(u&&typeof h==\"object\"&&h&&!isArray(h)&&!isFunction(h)&&!(h instanceof RegExp)?(r[q]||(r[q]={}),mixin(r[q],h,c,u)):r[q]=h)}),r}function bind(r,a){return function(){return a.apply(r,arguments)}}function scripts(){return document.getElementsByTagName(\"script\")}function defaultOnError(r){throw r}function getGlobal(r){if(!r)return r;var a=global;return each(r.split(\".\"),function(c){a=a[c]}),a}function makeError(r,a,c,u){var h=new Error(a+`\nhttps://requirejs.org/docs/errors.html#`+r);return h.requireType=r,h.requireModules=u,c&&(h.originalError=c),h}if(typeof define<\"u\")return;if(typeof requirejs<\"u\"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}typeof require<\"u\"&&!isFunction(require)&&(cfg=require,require=void 0);function newContext(r){var a,c,u,h,q,g={waitSeconds:7,baseUrl:\"./\",paths:{},bundles:{},pkgs:{},shim:{},config:{}},v={},B={},I={},M=[],w={},D={},L={},H=1,K=1;function X(e){var i,n;for(i=0;i<e.length;i++)if(n=e[i],n===\".\")e.splice(i,1),i-=1;else if(n===\"..\"){if(i===0||i===1&&e[2]===\"..\"||e[i-1]===\"..\")continue;i>0&&(e.splice(i-1,2),i-=2)}}function P(e,i,n){var o,t,f,d,l,p,b,E,m,x,R,A,O=i&&i.split(\"/\"),k=g.map,j=k&&k[\"*\"];if(e&&(e=e.split(\"/\"),b=e.length-1,g.nodeIdCompat&&jsSuffixRegExp.test(e[b])&&(e[b]=e[b].replace(jsSuffixRegExp,\"\")),e[0].charAt(0)===\".\"&&O&&(A=O.slice(0,O.length-1),e=A.concat(e)),X(e),e=e.join(\"/\")),n&&k&&(O||j)){f=e.split(\"/\");e:for(d=f.length;d>0;d-=1){if(p=f.slice(0,d).join(\"/\"),O){for(l=O.length;l>0;l-=1)if(t=getOwn(k,O.slice(0,l).join(\"/\")),t&&(t=getOwn(t,p),t)){E=t,m=d;break e}}!x&&j&&getOwn(j,p)&&(x=getOwn(j,p),R=d)}!E&&x&&(E=x,m=R),E&&(f.splice(0,m,E),e=f.join(\"/\"))}return o=getOwn(g.pkgs,e),o||e}function W(e){isBrowser&&each(scripts(),function(i){if(i.getAttribute(\"data-requiremodule\")===e&&i.getAttribute(\"data-requirecontext\")===u.contextName)return i.parentNode.removeChild(i),!0})}function Q(e){var i=getOwn(g.paths,e);if(i&&isArray(i)&&i.length>1)return i.shift(),u.require.undef(e),u.makeRequire(null,{skipMap:!0})([e]),!0}function G(e){var i,n=e?e.indexOf(\"!\"):-1;return n>-1&&(i=e.substring(0,n),e=e.substring(n+1,e.length)),[i,e]}function S(e,i,n,o){var t,f,d,l,p=null,b=i?i.name:null,E=e,m=!0,x=\"\";return e||(m=!1,e=\"_@r\"+(H+=1)),l=G(e),p=l[0],e=l[1],p&&(p=P(p,b,o),f=getOwn(w,p)),e&&(p?n?x=e:f&&f.normalize?x=f.normalize(e,function(R){return P(R,b,o)}):x=e.indexOf(\"!\")===-1?P(e,b,o):e:(x=P(e,b,o),l=G(x),p=l[0],x=l[1],n=!0,t=u.nameToUrl(x))),d=p&&!f&&!n?\"_unnormalized\"+(K+=1):\"\",{prefix:p,name:x,parentMap:i,unnormalized:!!d,url:t,originalName:E,isDefine:m,id:(p?p+\"!\"+x:x)+d}}function T(e){var i=e.id,n=getOwn(v,i);return n||(n=v[i]=new u.Module(e)),n}function C(e,i,n){var o=e.id,t=getOwn(v,o);hasProp(w,o)&&(!t||t.defineEmitComplete)?i===\"defined\"&&n(w[o]):(t=T(e),t.error&&i===\"error\"?n(t.error):t.on(i,n))}function y(e,i){var n=e.requireModules,o=!1;i?i(e):(each(n,function(t){var f=getOwn(v,t);f&&(f.error=e,f.events.error&&(o=!0,f.emit(\"error\",e)))}),o||req.onError(e))}function F(){globalDefQueue.length&&(each(globalDefQueue,function(e){var i=e[0];typeof i==\"string\"&&(u.defQueueMap[i]=!0),M.push(e)}),globalDefQueue=[])}h={require:function(e){return e.require?e.require:e.require=u.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?w[e.map.id]=e.exports:e.exports=w[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(g.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}};function U(e){delete v[e],delete B[e]}function $(e,i,n){var o=e.map.id;e.error?e.emit(\"error\",e.error):(i[o]=!0,each(e.depMaps,function(t,f){var d=t.id,l=getOwn(v,d);l&&!e.depMatched[f]&&!n[d]&&(getOwn(i,d)?(e.defineDep(f,w[d]),e.check()):$(l,i,n))}),n[o]=!0)}function z(){var e,i,n=g.waitSeconds*1e3,o=n&&u.startTime+n<new Date().getTime(),t=[],f=[],d=!1,l=!0;if(!a){if(a=!0,eachProp(B,function(p){var b=p.map,E=b.id;if(p.enabled&&(b.isDefine||f.push(p),!p.error)){if(!p.inited&&o)Q(E)?(i=!0,d=!0):(t.push(E),W(E));else if(!p.inited&&p.fetched&&b.isDefine&&(d=!0,!b.prefix))return l=!1}}),o&&t.length)return e=makeError(\"timeout\",\"Load timeout for modules: \"+t,null,t),e.contextName=u.contextName,y(e);l&&each(f,function(p){$(p,{},{})}),(!o||i)&&d&&(isBrowser||isWebWorker)&&!q&&(q=setTimeout(function(){q=0,z()},50)),a=!1}}c=function(e){this.events=getOwn(I,e.id)||{},this.map=e,this.shim=getOwn(g.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},c.prototype={init:function(e,i,n,o){o=o||{},!this.inited&&(this.factory=i,n?this.on(\"error\",n):this.events.error&&(n=bind(this,function(t){this.emit(\"error\",t)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=o.ignore,o.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,i){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=i)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=new Date().getTime();var e=this.map;if(this.shim)u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}));else return e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,u.load(this.map.id,e))},check:function(){if(!(!this.enabled||this.enabling)){var e,i,n=this.map.id,o=this.depExports,t=this.exports,f=this.factory;if(!this.inited)hasProp(u.defQueueMap,n)||this.fetch();else if(this.error)this.emit(\"error\",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{t=u.execCb(n,f,o,t)}catch(l){e=l}else t=u.execCb(n,f,o,t);if(this.map.isDefine&&t===void 0&&(i=this.module,i?t=i.exports:this.usingExports&&(t=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?\"define\":\"require\",y(this.error=e)}else t=f;if(this.exports=t,this.map.isDefine&&!this.ignore&&(w[n]=t,req.onResourceLoad)){var d=[];each(this.depMaps,function(l){d.push(l.normalizedMap||l)}),req.onResourceLoad(u,this.map,d)}U(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit(\"defined\",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var e=this.map,i=e.id,n=S(e.prefix);this.depMaps.push(n),C(n,\"defined\",bind(this,function(o){var t,f,d,l=getOwn(L,this.map.id),p=this.map.name,b=this.map.parentMap?this.map.parentMap.name:null,E=u.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){o.normalize&&(p=o.normalize(p,function(m){return P(m,b,!0)})||\"\"),f=S(e.prefix+\"!\"+p,this.map.parentMap,!0),C(f,\"defined\",bind(this,function(m){this.map.normalizedMap=f,this.init([],function(){return m},null,{enabled:!0,ignore:!0})})),d=getOwn(v,f.id),d&&(this.depMaps.push(f),this.events.error&&d.on(\"error\",bind(this,function(m){this.emit(\"error\",m)})),d.enable());return}if(l){this.map.url=u.nameToUrl(l),this.load();return}t=bind(this,function(m){this.init([],function(){return m},null,{enabled:!0})}),t.error=bind(this,function(m){this.inited=!0,this.error=m,m.requireModules=[i],eachProp(v,function(x){x.map.id.indexOf(i+\"_unnormalized\")===0&&U(x.map.id)}),y(m)}),t.fromText=bind(this,function(m,x){var R=e.name,A=S(R),O=useInteractive;x&&(m=x),O&&(useInteractive=!1),T(A),hasProp(g.config,i)&&(g.config[R]=g.config[i]);try{req.exec(m)}catch(k){return y(makeError(\"fromtexteval\",\"fromText eval for \"+i+\" failed: \"+k,k,[i]))}O&&(useInteractive=!0),this.depMaps.push(A),u.completeLoad(R),E([R],t)}),o.load(e.name,E,t,g)})),u.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){B[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,i){var n,o,t;if(typeof e==\"string\"){if(e=S(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=e,t=getOwn(h,e.id),t){this.depExports[i]=t(this);return}this.depCount+=1,C(e,\"defined\",bind(this,function(f){this.undefed||(this.defineDep(i,f),this.check())})),this.errback?C(e,\"error\",bind(this,this.errback)):this.events.error&&C(e,\"error\",bind(this,function(f){this.emit(\"error\",f)}))}n=e.id,o=v[n],!hasProp(h,n)&&o&&!o.enabled&&u.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var i=getOwn(v,e.id);i&&!i.enabled&&u.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,i){var n=this.events[e];n||(n=this.events[e]=[]),n.push(i)},emit:function(e,i){each(this.events[e],function(n){n(i)}),e===\"error\"&&delete this.events[e]}};function _(e){hasProp(w,e[0])||T(S(e[0],null,!0)).init(e[1],e[2])}function J(e,i,n,o){e.detachEvent&&!isOpera?o&&e.detachEvent(o,i):e.removeEventListener(n,i,!1)}function V(e){var i=e.currentTarget||e.srcElement;return J(i,u.onScriptLoad,\"load\",\"onreadystatechange\"),J(i,u.onScriptError,\"error\"),{node:i,id:i&&i.getAttribute(\"data-requiremodule\")}}function Y(){var e;for(F();M.length;){if(e=M.shift(),e[0]===null)return y(makeError(\"mismatch\",\"Mismatched anonymous define() module: \"+e[e.length-1]));_(e)}u.defQueueMap={}}return u={config:g,contextName:r,registry:v,defined:w,urlFetched:D,defQueue:M,defQueueMap:{},Module:c,makeModuleMap:S,nextTick:req.nextTick,onError:y,configure:function(e){if(e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!==\"/\"&&(e.baseUrl+=\"/\"),typeof e.urlArgs==\"string\"){var i=e.urlArgs;e.urlArgs=function(t,f){return(f.indexOf(\"?\")===-1?\"?\":\"&\")+i}}var n=g.shim,o={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(t,f){o[f]?(g[f]||(g[f]={}),mixin(g[f],t,!0,!0)):g[f]=t}),e.bundles&&eachProp(e.bundles,function(t,f){each(t,function(d){d!==f&&(L[d]=f)})}),e.shim&&(eachProp(e.shim,function(t,f){isArray(t)&&(t={deps:t}),(t.exports||t.init)&&!t.exportsFn&&(t.exportsFn=u.makeShimExports(t)),n[f]=t}),g.shim=n),e.packages&&each(e.packages,function(t){var f,d;t=typeof t==\"string\"?{name:t}:t,d=t.name,f=t.location,f&&(g.paths[d]=t.location),g.pkgs[d]=t.name+\"/\"+(t.main||\"main\").replace(currDirRegExp,\"\").replace(jsSuffixRegExp,\"\")}),eachProp(v,function(t,f){!t.inited&&!t.map.unnormalized&&(t.map=S(f,null,!0))}),(e.deps||e.callback)&&u.require(e.deps||[],e.callback)},makeShimExports:function(e){function i(){var n;return e.init&&(n=e.init.apply(global,arguments)),n||e.exports&&getGlobal(e.exports)}return i},makeRequire:function(e,i){i=i||{};function n(o,t,f){var d,l,p;return i.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),typeof o==\"string\"?isFunction(t)?y(makeError(\"requireargs\",\"Invalid require call\"),f):e&&hasProp(h,o)?h[o](v[e.id]):req.get?req.get(u,o,e,n):(l=S(o,e,!1,!0),d=l.id,hasProp(w,d)?w[d]:y(makeError(\"notloaded\",'Module name \"'+d+'\" has not been loaded yet for context: '+r+(e?\"\":\". Use require([])\")))):(Y(),u.nextTick(function(){Y(),p=T(S(null,e)),p.skipMap=i.skipMap,p.init(o,t,f,{enabled:!0}),z()}),n)}return mixin(n,{isBrowser,toUrl:function(o){var t,f=o.lastIndexOf(\".\"),d=o.split(\"/\")[0],l=d===\".\"||d===\"..\";return f!==-1&&(!l||f>1)&&(t=o.substring(f,o.length),o=o.substring(0,f)),u.nameToUrl(P(o,e&&e.id,!0),t,!0)},defined:function(o){return hasProp(w,S(o,e,!1,!0).id)},specified:function(o){return o=S(o,e,!1,!0).id,hasProp(w,o)||hasProp(v,o)}}),e||(n.undef=function(o){F();var t=S(o,e,!0),f=getOwn(v,o);f.undefed=!0,W(o),delete w[o],delete D[t.url],delete I[o],eachReverse(M,function(d,l){d[0]===o&&M.splice(l,1)}),delete u.defQueueMap[o],f&&(f.events.defined&&(I[o]=f.events),U(o))}),n},enable:function(e){var i=getOwn(v,e.id);i&&T(e).enable()},completeLoad:function(e){var i,n,o,t=getOwn(g.shim,e)||{},f=t.exports;for(F();M.length;){if(n=M.shift(),n[0]===null){if(n[0]=e,i)break;i=!0}else n[0]===e&&(i=!0);_(n)}if(u.defQueueMap={},o=getOwn(v,e),!i&&!hasProp(w,e)&&o&&!o.inited){if(g.enforceDefine&&(!f||!getGlobal(f)))return Q(e)?void 0:y(makeError(\"nodefine\",\"No define call for \"+e,null,[e]));_([e,t.deps||[],t.exportsFn])}z()},nameToUrl:function(e,i,n){var o,t,f,d,l,p,b,E=getOwn(g.pkgs,e);if(E&&(e=E),b=getOwn(L,e),b)return u.nameToUrl(b,i,n);if(req.jsExtRegExp.test(e))l=e+(i||\"\");else{for(o=g.paths,t=e.split(\"/\"),f=t.length;f>0;f-=1)if(d=t.slice(0,f).join(\"/\"),p=getOwn(o,d),p){isArray(p)&&(p=p[0]),t.splice(0,f,p);break}l=t.join(\"/\"),l+=i||(/^data\\:|^blob\\:|\\?/.test(l)||n?\"\":\".js\"),l=(l.charAt(0)===\"/\"||l.match(/^[\\w\\+\\.\\-]+:/)?\"\":g.baseUrl)+l}return g.urlArgs&&!/^blob\\:/.test(l)?l+g.urlArgs(e,l):l},load:function(e,i){req.load(u,e,i)},execCb:function(e,i,n,o){return i.apply(o,n)},onScriptLoad:function(e){if(e.type===\"load\"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var i=V(e);u.completeLoad(i.id)}},onScriptError:function(e){var i=V(e);if(!Q(i.id)){var n=[];return eachProp(v,function(o,t){t.indexOf(\"_@r\")!==0&&each(o.depMaps,function(f){if(f.id===i.id)return n.push(t),!0})}),y(makeError(\"scripterror\",'Script error for \"'+i.id+(n.length?'\", needed by: '+n.join(\", \"):'\"'),e,[i.id]))}}},u.require=u.makeRequire(),u}req=requirejs=function(r,a,c,u){var h,q,g=defContextName;return!isArray(r)&&typeof r!=\"string\"&&(q=r,isArray(a)?(r=a,a=c,c=u):r=[]),q&&q.context&&(g=q.context),h=getOwn(contexts,g),h||(h=contexts[g]=req.s.newContext(g)),q&&h.configure(q),h.require(r,a,c)},req.config=function(r){return req(r)},req.nextTick=typeof setTimeout<\"u\"?function(r){setTimeout(r,4)}:function(r){r()},require||(require=req),req.version=version,req.jsExtRegExp=/^\\/|:|\\?|\\.js$/,req.isBrowser=isBrowser,s=req.s={contexts,newContext},req({}),each([\"toUrl\",\"undef\",\"defined\",\"specified\"],function(r){req[r]=function(){var a=contexts[defContextName];return a.require[r].apply(a,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName(\"head\")[0],baseElement=document.getElementsByTagName(\"base\")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(r,a,c){var u=r.xhtml?document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"html:script\"):document.createElement(\"script\");return u.type=r.scriptType||\"text/javascript\",u.charset=\"utf-8\",u.async=!0,u},req.load=function(r,a,c){var u=r&&r.config||{},h;if(isBrowser)return h=req.createNode(u,a,c),h.setAttribute(\"data-requirecontext\",r.contextName),h.setAttribute(\"data-requiremodule\",a),h.attachEvent&&!(h.attachEvent.toString&&h.attachEvent.toString().indexOf(\"[native code\")<0)&&!isOpera?(useInteractive=!0,h.attachEvent(\"onreadystatechange\",r.onScriptLoad)):(h.addEventListener(\"load\",r.onScriptLoad,!1),h.addEventListener(\"error\",r.onScriptError,!1)),h.src=c,u.onNodeCreated&&u.onNodeCreated(h,u,a,c),currentlyAddingScript=h,baseElement?head.insertBefore(h,baseElement):head.appendChild(h),currentlyAddingScript=null,h;if(isWebWorker)try{setTimeout(function(){},0),importScripts(c),r.completeLoad(a)}catch(q){r.onError(makeError(\"importscripts\",\"importScripts failed for \"+a+\" at \"+c,q,[a]))}};function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState===\"interactive\"||eachReverse(scripts(),function(r){if(r.readyState===\"interactive\")return interactiveScript=r}),interactiveScript}isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(r){if(head||(head=r.parentNode),dataMain=r.getAttribute(\"data-main\"),dataMain)return mainScript=dataMain,!cfg.baseUrl&&mainScript.indexOf(\"!\")===-1&&(src=mainScript.split(\"/\"),mainScript=src.pop(),subPath=src.length?src.join(\"/\")+\"/\":\"./\",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,\"\"),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(r,a,c){var u,h;typeof r!=\"string\"&&(c=a,a=r,r=null),isArray(a)||(c=a,a=null),!a&&isFunction(c)&&(a=[],c.length&&(c.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(q,g){a.push(g)}),a=(c.length===1?[\"require\"]:[\"require\",\"exports\",\"module\"]).concat(a))),useInteractive&&(u=currentlyAddingScript||getInteractiveScript(),u&&(r||(r=u.getAttribute(\"data-requiremodule\")),h=contexts[u.getAttribute(\"data-requirecontext\")])),h?(h.defQueue.push([r,a,c]),h.defQueueMap[r]=!0):globalDefQueue.push([r,a,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this,typeof setTimeout>\"u\"?void 0:setTimeout);";
3
+ export default _default;
@@ -0,0 +1,4 @@
1
+ // Generated by tools/build/vendor-requirejs.mjs from requirejs 2.3.8 (MIT, https://requirejs.org) - do not edit.
2
+ export const requireJsVersion = "2.3.8";
3
+ export default "/** vim: et:ts=4:sw=4:sts=4\n * @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.\n * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE\n */var requirejs,require,define;(function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version=\"2.3.8\",commentRegExp=/\\/\\*[\\s\\S]*?\\*\\/|([^:\"'=]|^)\\/\\/.*$/mg,cjsRequireRegExp=/[^.]\\s*require\\s*\\(\\s*[\"']([^'\"\\s]+)[\"']\\s*\\)/g,jsSuffixRegExp=/\\.js$/,currDirRegExp=/^\\.\\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!!(typeof window<\"u\"&&typeof navigator<\"u\"&&window.document),isWebWorker=!isBrowser&&typeof importScripts<\"u\",readyRegExp=isBrowser&&navigator.platform===\"PLAYSTATION 3\"?/^complete$/:/^(complete|loaded)$/,defContextName=\"_\",isOpera=typeof opera<\"u\"&&opera.toString()===\"[object Opera]\",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(r,a){return a||\"\"}function isFunction(r){return ostring.call(r)===\"[object Function]\"}function isArray(r){return ostring.call(r)===\"[object Array]\"}function each(r,a){if(r){var c;for(c=0;c<r.length&&!(r[c]&&a(r[c],c,r));c+=1);}}function eachReverse(r,a){if(r){var c;for(c=r.length-1;c>-1&&!(r[c]&&a(r[c],c,r));c-=1);}}function hasProp(r,a){return hasOwn.call(r,a)}function getOwn(r,a){return hasProp(r,a)&&r[a]}function eachProp(r,a){var c;for(c in r)if(hasProp(r,c)&&c!==\"__proto__\"&&c!==\"constructor\"&&a(r[c],c))break}function mixin(r,a,c,u){return a&&eachProp(a,function(h,q){(c||!hasProp(r,q))&&(u&&typeof h==\"object\"&&h&&!isArray(h)&&!isFunction(h)&&!(h instanceof RegExp)?(r[q]||(r[q]={}),mixin(r[q],h,c,u)):r[q]=h)}),r}function bind(r,a){return function(){return a.apply(r,arguments)}}function scripts(){return document.getElementsByTagName(\"script\")}function defaultOnError(r){throw r}function getGlobal(r){if(!r)return r;var a=global;return each(r.split(\".\"),function(c){a=a[c]}),a}function makeError(r,a,c,u){var h=new Error(a+`\nhttps://requirejs.org/docs/errors.html#`+r);return h.requireType=r,h.requireModules=u,c&&(h.originalError=c),h}if(typeof define<\"u\")return;if(typeof requirejs<\"u\"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}typeof require<\"u\"&&!isFunction(require)&&(cfg=require,require=void 0);function newContext(r){var a,c,u,h,q,g={waitSeconds:7,baseUrl:\"./\",paths:{},bundles:{},pkgs:{},shim:{},config:{}},v={},B={},I={},M=[],w={},D={},L={},H=1,K=1;function X(e){var i,n;for(i=0;i<e.length;i++)if(n=e[i],n===\".\")e.splice(i,1),i-=1;else if(n===\"..\"){if(i===0||i===1&&e[2]===\"..\"||e[i-1]===\"..\")continue;i>0&&(e.splice(i-1,2),i-=2)}}function P(e,i,n){var o,t,f,d,l,p,b,E,m,x,R,A,O=i&&i.split(\"/\"),k=g.map,j=k&&k[\"*\"];if(e&&(e=e.split(\"/\"),b=e.length-1,g.nodeIdCompat&&jsSuffixRegExp.test(e[b])&&(e[b]=e[b].replace(jsSuffixRegExp,\"\")),e[0].charAt(0)===\".\"&&O&&(A=O.slice(0,O.length-1),e=A.concat(e)),X(e),e=e.join(\"/\")),n&&k&&(O||j)){f=e.split(\"/\");e:for(d=f.length;d>0;d-=1){if(p=f.slice(0,d).join(\"/\"),O){for(l=O.length;l>0;l-=1)if(t=getOwn(k,O.slice(0,l).join(\"/\")),t&&(t=getOwn(t,p),t)){E=t,m=d;break e}}!x&&j&&getOwn(j,p)&&(x=getOwn(j,p),R=d)}!E&&x&&(E=x,m=R),E&&(f.splice(0,m,E),e=f.join(\"/\"))}return o=getOwn(g.pkgs,e),o||e}function W(e){isBrowser&&each(scripts(),function(i){if(i.getAttribute(\"data-requiremodule\")===e&&i.getAttribute(\"data-requirecontext\")===u.contextName)return i.parentNode.removeChild(i),!0})}function Q(e){var i=getOwn(g.paths,e);if(i&&isArray(i)&&i.length>1)return i.shift(),u.require.undef(e),u.makeRequire(null,{skipMap:!0})([e]),!0}function G(e){var i,n=e?e.indexOf(\"!\"):-1;return n>-1&&(i=e.substring(0,n),e=e.substring(n+1,e.length)),[i,e]}function S(e,i,n,o){var t,f,d,l,p=null,b=i?i.name:null,E=e,m=!0,x=\"\";return e||(m=!1,e=\"_@r\"+(H+=1)),l=G(e),p=l[0],e=l[1],p&&(p=P(p,b,o),f=getOwn(w,p)),e&&(p?n?x=e:f&&f.normalize?x=f.normalize(e,function(R){return P(R,b,o)}):x=e.indexOf(\"!\")===-1?P(e,b,o):e:(x=P(e,b,o),l=G(x),p=l[0],x=l[1],n=!0,t=u.nameToUrl(x))),d=p&&!f&&!n?\"_unnormalized\"+(K+=1):\"\",{prefix:p,name:x,parentMap:i,unnormalized:!!d,url:t,originalName:E,isDefine:m,id:(p?p+\"!\"+x:x)+d}}function T(e){var i=e.id,n=getOwn(v,i);return n||(n=v[i]=new u.Module(e)),n}function C(e,i,n){var o=e.id,t=getOwn(v,o);hasProp(w,o)&&(!t||t.defineEmitComplete)?i===\"defined\"&&n(w[o]):(t=T(e),t.error&&i===\"error\"?n(t.error):t.on(i,n))}function y(e,i){var n=e.requireModules,o=!1;i?i(e):(each(n,function(t){var f=getOwn(v,t);f&&(f.error=e,f.events.error&&(o=!0,f.emit(\"error\",e)))}),o||req.onError(e))}function F(){globalDefQueue.length&&(each(globalDefQueue,function(e){var i=e[0];typeof i==\"string\"&&(u.defQueueMap[i]=!0),M.push(e)}),globalDefQueue=[])}h={require:function(e){return e.require?e.require:e.require=u.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?w[e.map.id]=e.exports:e.exports=w[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(g.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}};function U(e){delete v[e],delete B[e]}function $(e,i,n){var o=e.map.id;e.error?e.emit(\"error\",e.error):(i[o]=!0,each(e.depMaps,function(t,f){var d=t.id,l=getOwn(v,d);l&&!e.depMatched[f]&&!n[d]&&(getOwn(i,d)?(e.defineDep(f,w[d]),e.check()):$(l,i,n))}),n[o]=!0)}function z(){var e,i,n=g.waitSeconds*1e3,o=n&&u.startTime+n<new Date().getTime(),t=[],f=[],d=!1,l=!0;if(!a){if(a=!0,eachProp(B,function(p){var b=p.map,E=b.id;if(p.enabled&&(b.isDefine||f.push(p),!p.error)){if(!p.inited&&o)Q(E)?(i=!0,d=!0):(t.push(E),W(E));else if(!p.inited&&p.fetched&&b.isDefine&&(d=!0,!b.prefix))return l=!1}}),o&&t.length)return e=makeError(\"timeout\",\"Load timeout for modules: \"+t,null,t),e.contextName=u.contextName,y(e);l&&each(f,function(p){$(p,{},{})}),(!o||i)&&d&&(isBrowser||isWebWorker)&&!q&&(q=setTimeout(function(){q=0,z()},50)),a=!1}}c=function(e){this.events=getOwn(I,e.id)||{},this.map=e,this.shim=getOwn(g.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},c.prototype={init:function(e,i,n,o){o=o||{},!this.inited&&(this.factory=i,n?this.on(\"error\",n):this.events.error&&(n=bind(this,function(t){this.emit(\"error\",t)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=o.ignore,o.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,i){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=i)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=new Date().getTime();var e=this.map;if(this.shim)u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}));else return e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,u.load(this.map.id,e))},check:function(){if(!(!this.enabled||this.enabling)){var e,i,n=this.map.id,o=this.depExports,t=this.exports,f=this.factory;if(!this.inited)hasProp(u.defQueueMap,n)||this.fetch();else if(this.error)this.emit(\"error\",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{t=u.execCb(n,f,o,t)}catch(l){e=l}else t=u.execCb(n,f,o,t);if(this.map.isDefine&&t===void 0&&(i=this.module,i?t=i.exports:this.usingExports&&(t=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?\"define\":\"require\",y(this.error=e)}else t=f;if(this.exports=t,this.map.isDefine&&!this.ignore&&(w[n]=t,req.onResourceLoad)){var d=[];each(this.depMaps,function(l){d.push(l.normalizedMap||l)}),req.onResourceLoad(u,this.map,d)}U(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit(\"defined\",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var e=this.map,i=e.id,n=S(e.prefix);this.depMaps.push(n),C(n,\"defined\",bind(this,function(o){var t,f,d,l=getOwn(L,this.map.id),p=this.map.name,b=this.map.parentMap?this.map.parentMap.name:null,E=u.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){o.normalize&&(p=o.normalize(p,function(m){return P(m,b,!0)})||\"\"),f=S(e.prefix+\"!\"+p,this.map.parentMap,!0),C(f,\"defined\",bind(this,function(m){this.map.normalizedMap=f,this.init([],function(){return m},null,{enabled:!0,ignore:!0})})),d=getOwn(v,f.id),d&&(this.depMaps.push(f),this.events.error&&d.on(\"error\",bind(this,function(m){this.emit(\"error\",m)})),d.enable());return}if(l){this.map.url=u.nameToUrl(l),this.load();return}t=bind(this,function(m){this.init([],function(){return m},null,{enabled:!0})}),t.error=bind(this,function(m){this.inited=!0,this.error=m,m.requireModules=[i],eachProp(v,function(x){x.map.id.indexOf(i+\"_unnormalized\")===0&&U(x.map.id)}),y(m)}),t.fromText=bind(this,function(m,x){var R=e.name,A=S(R),O=useInteractive;x&&(m=x),O&&(useInteractive=!1),T(A),hasProp(g.config,i)&&(g.config[R]=g.config[i]);try{req.exec(m)}catch(k){return y(makeError(\"fromtexteval\",\"fromText eval for \"+i+\" failed: \"+k,k,[i]))}O&&(useInteractive=!0),this.depMaps.push(A),u.completeLoad(R),E([R],t)}),o.load(e.name,E,t,g)})),u.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){B[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,i){var n,o,t;if(typeof e==\"string\"){if(e=S(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=e,t=getOwn(h,e.id),t){this.depExports[i]=t(this);return}this.depCount+=1,C(e,\"defined\",bind(this,function(f){this.undefed||(this.defineDep(i,f),this.check())})),this.errback?C(e,\"error\",bind(this,this.errback)):this.events.error&&C(e,\"error\",bind(this,function(f){this.emit(\"error\",f)}))}n=e.id,o=v[n],!hasProp(h,n)&&o&&!o.enabled&&u.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var i=getOwn(v,e.id);i&&!i.enabled&&u.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,i){var n=this.events[e];n||(n=this.events[e]=[]),n.push(i)},emit:function(e,i){each(this.events[e],function(n){n(i)}),e===\"error\"&&delete this.events[e]}};function _(e){hasProp(w,e[0])||T(S(e[0],null,!0)).init(e[1],e[2])}function J(e,i,n,o){e.detachEvent&&!isOpera?o&&e.detachEvent(o,i):e.removeEventListener(n,i,!1)}function V(e){var i=e.currentTarget||e.srcElement;return J(i,u.onScriptLoad,\"load\",\"onreadystatechange\"),J(i,u.onScriptError,\"error\"),{node:i,id:i&&i.getAttribute(\"data-requiremodule\")}}function Y(){var e;for(F();M.length;){if(e=M.shift(),e[0]===null)return y(makeError(\"mismatch\",\"Mismatched anonymous define() module: \"+e[e.length-1]));_(e)}u.defQueueMap={}}return u={config:g,contextName:r,registry:v,defined:w,urlFetched:D,defQueue:M,defQueueMap:{},Module:c,makeModuleMap:S,nextTick:req.nextTick,onError:y,configure:function(e){if(e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!==\"/\"&&(e.baseUrl+=\"/\"),typeof e.urlArgs==\"string\"){var i=e.urlArgs;e.urlArgs=function(t,f){return(f.indexOf(\"?\")===-1?\"?\":\"&\")+i}}var n=g.shim,o={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(t,f){o[f]?(g[f]||(g[f]={}),mixin(g[f],t,!0,!0)):g[f]=t}),e.bundles&&eachProp(e.bundles,function(t,f){each(t,function(d){d!==f&&(L[d]=f)})}),e.shim&&(eachProp(e.shim,function(t,f){isArray(t)&&(t={deps:t}),(t.exports||t.init)&&!t.exportsFn&&(t.exportsFn=u.makeShimExports(t)),n[f]=t}),g.shim=n),e.packages&&each(e.packages,function(t){var f,d;t=typeof t==\"string\"?{name:t}:t,d=t.name,f=t.location,f&&(g.paths[d]=t.location),g.pkgs[d]=t.name+\"/\"+(t.main||\"main\").replace(currDirRegExp,\"\").replace(jsSuffixRegExp,\"\")}),eachProp(v,function(t,f){!t.inited&&!t.map.unnormalized&&(t.map=S(f,null,!0))}),(e.deps||e.callback)&&u.require(e.deps||[],e.callback)},makeShimExports:function(e){function i(){var n;return e.init&&(n=e.init.apply(global,arguments)),n||e.exports&&getGlobal(e.exports)}return i},makeRequire:function(e,i){i=i||{};function n(o,t,f){var d,l,p;return i.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),typeof o==\"string\"?isFunction(t)?y(makeError(\"requireargs\",\"Invalid require call\"),f):e&&hasProp(h,o)?h[o](v[e.id]):req.get?req.get(u,o,e,n):(l=S(o,e,!1,!0),d=l.id,hasProp(w,d)?w[d]:y(makeError(\"notloaded\",'Module name \"'+d+'\" has not been loaded yet for context: '+r+(e?\"\":\". Use require([])\")))):(Y(),u.nextTick(function(){Y(),p=T(S(null,e)),p.skipMap=i.skipMap,p.init(o,t,f,{enabled:!0}),z()}),n)}return mixin(n,{isBrowser,toUrl:function(o){var t,f=o.lastIndexOf(\".\"),d=o.split(\"/\")[0],l=d===\".\"||d===\"..\";return f!==-1&&(!l||f>1)&&(t=o.substring(f,o.length),o=o.substring(0,f)),u.nameToUrl(P(o,e&&e.id,!0),t,!0)},defined:function(o){return hasProp(w,S(o,e,!1,!0).id)},specified:function(o){return o=S(o,e,!1,!0).id,hasProp(w,o)||hasProp(v,o)}}),e||(n.undef=function(o){F();var t=S(o,e,!0),f=getOwn(v,o);f.undefed=!0,W(o),delete w[o],delete D[t.url],delete I[o],eachReverse(M,function(d,l){d[0]===o&&M.splice(l,1)}),delete u.defQueueMap[o],f&&(f.events.defined&&(I[o]=f.events),U(o))}),n},enable:function(e){var i=getOwn(v,e.id);i&&T(e).enable()},completeLoad:function(e){var i,n,o,t=getOwn(g.shim,e)||{},f=t.exports;for(F();M.length;){if(n=M.shift(),n[0]===null){if(n[0]=e,i)break;i=!0}else n[0]===e&&(i=!0);_(n)}if(u.defQueueMap={},o=getOwn(v,e),!i&&!hasProp(w,e)&&o&&!o.inited){if(g.enforceDefine&&(!f||!getGlobal(f)))return Q(e)?void 0:y(makeError(\"nodefine\",\"No define call for \"+e,null,[e]));_([e,t.deps||[],t.exportsFn])}z()},nameToUrl:function(e,i,n){var o,t,f,d,l,p,b,E=getOwn(g.pkgs,e);if(E&&(e=E),b=getOwn(L,e),b)return u.nameToUrl(b,i,n);if(req.jsExtRegExp.test(e))l=e+(i||\"\");else{for(o=g.paths,t=e.split(\"/\"),f=t.length;f>0;f-=1)if(d=t.slice(0,f).join(\"/\"),p=getOwn(o,d),p){isArray(p)&&(p=p[0]),t.splice(0,f,p);break}l=t.join(\"/\"),l+=i||(/^data\\:|^blob\\:|\\?/.test(l)||n?\"\":\".js\"),l=(l.charAt(0)===\"/\"||l.match(/^[\\w\\+\\.\\-]+:/)?\"\":g.baseUrl)+l}return g.urlArgs&&!/^blob\\:/.test(l)?l+g.urlArgs(e,l):l},load:function(e,i){req.load(u,e,i)},execCb:function(e,i,n,o){return i.apply(o,n)},onScriptLoad:function(e){if(e.type===\"load\"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var i=V(e);u.completeLoad(i.id)}},onScriptError:function(e){var i=V(e);if(!Q(i.id)){var n=[];return eachProp(v,function(o,t){t.indexOf(\"_@r\")!==0&&each(o.depMaps,function(f){if(f.id===i.id)return n.push(t),!0})}),y(makeError(\"scripterror\",'Script error for \"'+i.id+(n.length?'\", needed by: '+n.join(\", \"):'\"'),e,[i.id]))}}},u.require=u.makeRequire(),u}req=requirejs=function(r,a,c,u){var h,q,g=defContextName;return!isArray(r)&&typeof r!=\"string\"&&(q=r,isArray(a)?(r=a,a=c,c=u):r=[]),q&&q.context&&(g=q.context),h=getOwn(contexts,g),h||(h=contexts[g]=req.s.newContext(g)),q&&h.configure(q),h.require(r,a,c)},req.config=function(r){return req(r)},req.nextTick=typeof setTimeout<\"u\"?function(r){setTimeout(r,4)}:function(r){r()},require||(require=req),req.version=version,req.jsExtRegExp=/^\\/|:|\\?|\\.js$/,req.isBrowser=isBrowser,s=req.s={contexts,newContext},req({}),each([\"toUrl\",\"undef\",\"defined\",\"specified\"],function(r){req[r]=function(){var a=contexts[defContextName];return a.require[r].apply(a,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName(\"head\")[0],baseElement=document.getElementsByTagName(\"base\")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(r,a,c){var u=r.xhtml?document.createElementNS(\"http://www.w3.org/1999/xhtml\",\"html:script\"):document.createElement(\"script\");return u.type=r.scriptType||\"text/javascript\",u.charset=\"utf-8\",u.async=!0,u},req.load=function(r,a,c){var u=r&&r.config||{},h;if(isBrowser)return h=req.createNode(u,a,c),h.setAttribute(\"data-requirecontext\",r.contextName),h.setAttribute(\"data-requiremodule\",a),h.attachEvent&&!(h.attachEvent.toString&&h.attachEvent.toString().indexOf(\"[native code\")<0)&&!isOpera?(useInteractive=!0,h.attachEvent(\"onreadystatechange\",r.onScriptLoad)):(h.addEventListener(\"load\",r.onScriptLoad,!1),h.addEventListener(\"error\",r.onScriptError,!1)),h.src=c,u.onNodeCreated&&u.onNodeCreated(h,u,a,c),currentlyAddingScript=h,baseElement?head.insertBefore(h,baseElement):head.appendChild(h),currentlyAddingScript=null,h;if(isWebWorker)try{setTimeout(function(){},0),importScripts(c),r.completeLoad(a)}catch(q){r.onError(makeError(\"importscripts\",\"importScripts failed for \"+a+\" at \"+c,q,[a]))}};function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState===\"interactive\"||eachReverse(scripts(),function(r){if(r.readyState===\"interactive\")return interactiveScript=r}),interactiveScript}isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(r){if(head||(head=r.parentNode),dataMain=r.getAttribute(\"data-main\"),dataMain)return mainScript=dataMain,!cfg.baseUrl&&mainScript.indexOf(\"!\")===-1&&(src=mainScript.split(\"/\"),mainScript=src.pop(),subPath=src.length?src.join(\"/\")+\"/\":\"./\",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,\"\"),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(r,a,c){var u,h;typeof r!=\"string\"&&(c=a,a=r,r=null),isArray(a)||(c=a,a=null),!a&&isFunction(c)&&(a=[],c.length&&(c.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(q,g){a.push(g)}),a=(c.length===1?[\"require\"]:[\"require\",\"exports\",\"module\"]).concat(a))),useInteractive&&(u=currentlyAddingScript||getInteractiveScript(),u&&(r||(r=u.getAttribute(\"data-requiremodule\")),h=contexts[u.getAttribute(\"data-requirecontext\")])),h?(h.defQueue.push([r,a,c]),h.defQueueMap[r]=!0):globalDefQueue.push([r,a,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this,typeof setTimeout>\"u\"?void 0:setTimeout);";
4
+ //# sourceMappingURL=require-js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"require-js.js","sourceRoot":"","sources":["../../src/vendor/require-js.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AACxC,eAAe,gtjBAAgtjB,CAAC","sourcesContent":["// Generated by tools/build/vendor-requirejs.mjs from requirejs 2.3.8 (MIT, https://requirejs.org) - do not edit.\nexport const requireJsVersion = \"2.3.8\";\nexport default \"/** vim: et:ts=4:sw=4:sts=4\\n * @license RequireJS 2.3.8 Copyright jQuery Foundation and other contributors.\\n * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE\\n */var requirejs,require,define;(function(global,setTimeout){var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version=\\\"2.3.8\\\",commentRegExp=/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\/|([^:\\\"'=]|^)\\\\/\\\\/.*$/mg,cjsRequireRegExp=/[^.]\\\\s*require\\\\s*\\\\(\\\\s*[\\\"']([^'\\\"\\\\s]+)[\\\"']\\\\s*\\\\)/g,jsSuffixRegExp=/\\\\.js$/,currDirRegExp=/^\\\\.\\\\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!!(typeof window<\\\"u\\\"&&typeof navigator<\\\"u\\\"&&window.document),isWebWorker=!isBrowser&&typeof importScripts<\\\"u\\\",readyRegExp=isBrowser&&navigator.platform===\\\"PLAYSTATION 3\\\"?/^complete$/:/^(complete|loaded)$/,defContextName=\\\"_\\\",isOpera=typeof opera<\\\"u\\\"&&opera.toString()===\\\"[object Opera]\\\",contexts={},cfg={},globalDefQueue=[],useInteractive=!1;function commentReplace(r,a){return a||\\\"\\\"}function isFunction(r){return ostring.call(r)===\\\"[object Function]\\\"}function isArray(r){return ostring.call(r)===\\\"[object Array]\\\"}function each(r,a){if(r){var c;for(c=0;c<r.length&&!(r[c]&&a(r[c],c,r));c+=1);}}function eachReverse(r,a){if(r){var c;for(c=r.length-1;c>-1&&!(r[c]&&a(r[c],c,r));c-=1);}}function hasProp(r,a){return hasOwn.call(r,a)}function getOwn(r,a){return hasProp(r,a)&&r[a]}function eachProp(r,a){var c;for(c in r)if(hasProp(r,c)&&c!==\\\"__proto__\\\"&&c!==\\\"constructor\\\"&&a(r[c],c))break}function mixin(r,a,c,u){return a&&eachProp(a,function(h,q){(c||!hasProp(r,q))&&(u&&typeof h==\\\"object\\\"&&h&&!isArray(h)&&!isFunction(h)&&!(h instanceof RegExp)?(r[q]||(r[q]={}),mixin(r[q],h,c,u)):r[q]=h)}),r}function bind(r,a){return function(){return a.apply(r,arguments)}}function scripts(){return document.getElementsByTagName(\\\"script\\\")}function defaultOnError(r){throw r}function getGlobal(r){if(!r)return r;var a=global;return each(r.split(\\\".\\\"),function(c){a=a[c]}),a}function makeError(r,a,c,u){var h=new Error(a+`\\nhttps://requirejs.org/docs/errors.html#`+r);return h.requireType=r,h.requireModules=u,c&&(h.originalError=c),h}if(typeof define<\\\"u\\\")return;if(typeof requirejs<\\\"u\\\"){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}typeof require<\\\"u\\\"&&!isFunction(require)&&(cfg=require,require=void 0);function newContext(r){var a,c,u,h,q,g={waitSeconds:7,baseUrl:\\\"./\\\",paths:{},bundles:{},pkgs:{},shim:{},config:{}},v={},B={},I={},M=[],w={},D={},L={},H=1,K=1;function X(e){var i,n;for(i=0;i<e.length;i++)if(n=e[i],n===\\\".\\\")e.splice(i,1),i-=1;else if(n===\\\"..\\\"){if(i===0||i===1&&e[2]===\\\"..\\\"||e[i-1]===\\\"..\\\")continue;i>0&&(e.splice(i-1,2),i-=2)}}function P(e,i,n){var o,t,f,d,l,p,b,E,m,x,R,A,O=i&&i.split(\\\"/\\\"),k=g.map,j=k&&k[\\\"*\\\"];if(e&&(e=e.split(\\\"/\\\"),b=e.length-1,g.nodeIdCompat&&jsSuffixRegExp.test(e[b])&&(e[b]=e[b].replace(jsSuffixRegExp,\\\"\\\")),e[0].charAt(0)===\\\".\\\"&&O&&(A=O.slice(0,O.length-1),e=A.concat(e)),X(e),e=e.join(\\\"/\\\")),n&&k&&(O||j)){f=e.split(\\\"/\\\");e:for(d=f.length;d>0;d-=1){if(p=f.slice(0,d).join(\\\"/\\\"),O){for(l=O.length;l>0;l-=1)if(t=getOwn(k,O.slice(0,l).join(\\\"/\\\")),t&&(t=getOwn(t,p),t)){E=t,m=d;break e}}!x&&j&&getOwn(j,p)&&(x=getOwn(j,p),R=d)}!E&&x&&(E=x,m=R),E&&(f.splice(0,m,E),e=f.join(\\\"/\\\"))}return o=getOwn(g.pkgs,e),o||e}function W(e){isBrowser&&each(scripts(),function(i){if(i.getAttribute(\\\"data-requiremodule\\\")===e&&i.getAttribute(\\\"data-requirecontext\\\")===u.contextName)return i.parentNode.removeChild(i),!0})}function Q(e){var i=getOwn(g.paths,e);if(i&&isArray(i)&&i.length>1)return i.shift(),u.require.undef(e),u.makeRequire(null,{skipMap:!0})([e]),!0}function G(e){var i,n=e?e.indexOf(\\\"!\\\"):-1;return n>-1&&(i=e.substring(0,n),e=e.substring(n+1,e.length)),[i,e]}function S(e,i,n,o){var t,f,d,l,p=null,b=i?i.name:null,E=e,m=!0,x=\\\"\\\";return e||(m=!1,e=\\\"_@r\\\"+(H+=1)),l=G(e),p=l[0],e=l[1],p&&(p=P(p,b,o),f=getOwn(w,p)),e&&(p?n?x=e:f&&f.normalize?x=f.normalize(e,function(R){return P(R,b,o)}):x=e.indexOf(\\\"!\\\")===-1?P(e,b,o):e:(x=P(e,b,o),l=G(x),p=l[0],x=l[1],n=!0,t=u.nameToUrl(x))),d=p&&!f&&!n?\\\"_unnormalized\\\"+(K+=1):\\\"\\\",{prefix:p,name:x,parentMap:i,unnormalized:!!d,url:t,originalName:E,isDefine:m,id:(p?p+\\\"!\\\"+x:x)+d}}function T(e){var i=e.id,n=getOwn(v,i);return n||(n=v[i]=new u.Module(e)),n}function C(e,i,n){var o=e.id,t=getOwn(v,o);hasProp(w,o)&&(!t||t.defineEmitComplete)?i===\\\"defined\\\"&&n(w[o]):(t=T(e),t.error&&i===\\\"error\\\"?n(t.error):t.on(i,n))}function y(e,i){var n=e.requireModules,o=!1;i?i(e):(each(n,function(t){var f=getOwn(v,t);f&&(f.error=e,f.events.error&&(o=!0,f.emit(\\\"error\\\",e)))}),o||req.onError(e))}function F(){globalDefQueue.length&&(each(globalDefQueue,function(e){var i=e[0];typeof i==\\\"string\\\"&&(u.defQueueMap[i]=!0),M.push(e)}),globalDefQueue=[])}h={require:function(e){return e.require?e.require:e.require=u.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?w[e.map.id]=e.exports:e.exports=w[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(g.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}};function U(e){delete v[e],delete B[e]}function $(e,i,n){var o=e.map.id;e.error?e.emit(\\\"error\\\",e.error):(i[o]=!0,each(e.depMaps,function(t,f){var d=t.id,l=getOwn(v,d);l&&!e.depMatched[f]&&!n[d]&&(getOwn(i,d)?(e.defineDep(f,w[d]),e.check()):$(l,i,n))}),n[o]=!0)}function z(){var e,i,n=g.waitSeconds*1e3,o=n&&u.startTime+n<new Date().getTime(),t=[],f=[],d=!1,l=!0;if(!a){if(a=!0,eachProp(B,function(p){var b=p.map,E=b.id;if(p.enabled&&(b.isDefine||f.push(p),!p.error)){if(!p.inited&&o)Q(E)?(i=!0,d=!0):(t.push(E),W(E));else if(!p.inited&&p.fetched&&b.isDefine&&(d=!0,!b.prefix))return l=!1}}),o&&t.length)return e=makeError(\\\"timeout\\\",\\\"Load timeout for modules: \\\"+t,null,t),e.contextName=u.contextName,y(e);l&&each(f,function(p){$(p,{},{})}),(!o||i)&&d&&(isBrowser||isWebWorker)&&!q&&(q=setTimeout(function(){q=0,z()},50)),a=!1}}c=function(e){this.events=getOwn(I,e.id)||{},this.map=e,this.shim=getOwn(g.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},c.prototype={init:function(e,i,n,o){o=o||{},!this.inited&&(this.factory=i,n?this.on(\\\"error\\\",n):this.events.error&&(n=bind(this,function(t){this.emit(\\\"error\\\",t)})),this.depMaps=e&&e.slice(0),this.errback=n,this.inited=!0,this.ignore=o.ignore,o.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,i){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=i)},fetch:function(){if(!this.fetched){this.fetched=!0,u.startTime=new Date().getTime();var e=this.map;if(this.shim)u.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}));else return e.prefix?this.callPlugin():this.load()}},load:function(){var e=this.map.url;D[e]||(D[e]=!0,u.load(this.map.id,e))},check:function(){if(!(!this.enabled||this.enabling)){var e,i,n=this.map.id,o=this.depExports,t=this.exports,f=this.factory;if(!this.inited)hasProp(u.defQueueMap,n)||this.fetch();else if(this.error)this.emit(\\\"error\\\",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(f)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{t=u.execCb(n,f,o,t)}catch(l){e=l}else t=u.execCb(n,f,o,t);if(this.map.isDefine&&t===void 0&&(i=this.module,i?t=i.exports:this.usingExports&&(t=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?\\\"define\\\":\\\"require\\\",y(this.error=e)}else t=f;if(this.exports=t,this.map.isDefine&&!this.ignore&&(w[n]=t,req.onResourceLoad)){var d=[];each(this.depMaps,function(l){d.push(l.normalizedMap||l)}),req.onResourceLoad(u,this.map,d)}U(n),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit(\\\"defined\\\",this.exports),this.defineEmitComplete=!0)}}},callPlugin:function(){var e=this.map,i=e.id,n=S(e.prefix);this.depMaps.push(n),C(n,\\\"defined\\\",bind(this,function(o){var t,f,d,l=getOwn(L,this.map.id),p=this.map.name,b=this.map.parentMap?this.map.parentMap.name:null,E=u.makeRequire(e.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){o.normalize&&(p=o.normalize(p,function(m){return P(m,b,!0)})||\\\"\\\"),f=S(e.prefix+\\\"!\\\"+p,this.map.parentMap,!0),C(f,\\\"defined\\\",bind(this,function(m){this.map.normalizedMap=f,this.init([],function(){return m},null,{enabled:!0,ignore:!0})})),d=getOwn(v,f.id),d&&(this.depMaps.push(f),this.events.error&&d.on(\\\"error\\\",bind(this,function(m){this.emit(\\\"error\\\",m)})),d.enable());return}if(l){this.map.url=u.nameToUrl(l),this.load();return}t=bind(this,function(m){this.init([],function(){return m},null,{enabled:!0})}),t.error=bind(this,function(m){this.inited=!0,this.error=m,m.requireModules=[i],eachProp(v,function(x){x.map.id.indexOf(i+\\\"_unnormalized\\\")===0&&U(x.map.id)}),y(m)}),t.fromText=bind(this,function(m,x){var R=e.name,A=S(R),O=useInteractive;x&&(m=x),O&&(useInteractive=!1),T(A),hasProp(g.config,i)&&(g.config[R]=g.config[i]);try{req.exec(m)}catch(k){return y(makeError(\\\"fromtexteval\\\",\\\"fromText eval for \\\"+i+\\\" failed: \\\"+k,k,[i]))}O&&(useInteractive=!0),this.depMaps.push(A),u.completeLoad(R),E([R],t)}),o.load(e.name,E,t,g)})),u.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){B[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,i){var n,o,t;if(typeof e==\\\"string\\\"){if(e=S(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[i]=e,t=getOwn(h,e.id),t){this.depExports[i]=t(this);return}this.depCount+=1,C(e,\\\"defined\\\",bind(this,function(f){this.undefed||(this.defineDep(i,f),this.check())})),this.errback?C(e,\\\"error\\\",bind(this,this.errback)):this.events.error&&C(e,\\\"error\\\",bind(this,function(f){this.emit(\\\"error\\\",f)}))}n=e.id,o=v[n],!hasProp(h,n)&&o&&!o.enabled&&u.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var i=getOwn(v,e.id);i&&!i.enabled&&u.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,i){var n=this.events[e];n||(n=this.events[e]=[]),n.push(i)},emit:function(e,i){each(this.events[e],function(n){n(i)}),e===\\\"error\\\"&&delete this.events[e]}};function _(e){hasProp(w,e[0])||T(S(e[0],null,!0)).init(e[1],e[2])}function J(e,i,n,o){e.detachEvent&&!isOpera?o&&e.detachEvent(o,i):e.removeEventListener(n,i,!1)}function V(e){var i=e.currentTarget||e.srcElement;return J(i,u.onScriptLoad,\\\"load\\\",\\\"onreadystatechange\\\"),J(i,u.onScriptError,\\\"error\\\"),{node:i,id:i&&i.getAttribute(\\\"data-requiremodule\\\")}}function Y(){var e;for(F();M.length;){if(e=M.shift(),e[0]===null)return y(makeError(\\\"mismatch\\\",\\\"Mismatched anonymous define() module: \\\"+e[e.length-1]));_(e)}u.defQueueMap={}}return u={config:g,contextName:r,registry:v,defined:w,urlFetched:D,defQueue:M,defQueueMap:{},Module:c,makeModuleMap:S,nextTick:req.nextTick,onError:y,configure:function(e){if(e.baseUrl&&e.baseUrl.charAt(e.baseUrl.length-1)!==\\\"/\\\"&&(e.baseUrl+=\\\"/\\\"),typeof e.urlArgs==\\\"string\\\"){var i=e.urlArgs;e.urlArgs=function(t,f){return(f.indexOf(\\\"?\\\")===-1?\\\"?\\\":\\\"&\\\")+i}}var n=g.shim,o={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(t,f){o[f]?(g[f]||(g[f]={}),mixin(g[f],t,!0,!0)):g[f]=t}),e.bundles&&eachProp(e.bundles,function(t,f){each(t,function(d){d!==f&&(L[d]=f)})}),e.shim&&(eachProp(e.shim,function(t,f){isArray(t)&&(t={deps:t}),(t.exports||t.init)&&!t.exportsFn&&(t.exportsFn=u.makeShimExports(t)),n[f]=t}),g.shim=n),e.packages&&each(e.packages,function(t){var f,d;t=typeof t==\\\"string\\\"?{name:t}:t,d=t.name,f=t.location,f&&(g.paths[d]=t.location),g.pkgs[d]=t.name+\\\"/\\\"+(t.main||\\\"main\\\").replace(currDirRegExp,\\\"\\\").replace(jsSuffixRegExp,\\\"\\\")}),eachProp(v,function(t,f){!t.inited&&!t.map.unnormalized&&(t.map=S(f,null,!0))}),(e.deps||e.callback)&&u.require(e.deps||[],e.callback)},makeShimExports:function(e){function i(){var n;return e.init&&(n=e.init.apply(global,arguments)),n||e.exports&&getGlobal(e.exports)}return i},makeRequire:function(e,i){i=i||{};function n(o,t,f){var d,l,p;return i.enableBuildCallback&&t&&isFunction(t)&&(t.__requireJsBuild=!0),typeof o==\\\"string\\\"?isFunction(t)?y(makeError(\\\"requireargs\\\",\\\"Invalid require call\\\"),f):e&&hasProp(h,o)?h[o](v[e.id]):req.get?req.get(u,o,e,n):(l=S(o,e,!1,!0),d=l.id,hasProp(w,d)?w[d]:y(makeError(\\\"notloaded\\\",'Module name \\\"'+d+'\\\" has not been loaded yet for context: '+r+(e?\\\"\\\":\\\". Use require([])\\\")))):(Y(),u.nextTick(function(){Y(),p=T(S(null,e)),p.skipMap=i.skipMap,p.init(o,t,f,{enabled:!0}),z()}),n)}return mixin(n,{isBrowser,toUrl:function(o){var t,f=o.lastIndexOf(\\\".\\\"),d=o.split(\\\"/\\\")[0],l=d===\\\".\\\"||d===\\\"..\\\";return f!==-1&&(!l||f>1)&&(t=o.substring(f,o.length),o=o.substring(0,f)),u.nameToUrl(P(o,e&&e.id,!0),t,!0)},defined:function(o){return hasProp(w,S(o,e,!1,!0).id)},specified:function(o){return o=S(o,e,!1,!0).id,hasProp(w,o)||hasProp(v,o)}}),e||(n.undef=function(o){F();var t=S(o,e,!0),f=getOwn(v,o);f.undefed=!0,W(o),delete w[o],delete D[t.url],delete I[o],eachReverse(M,function(d,l){d[0]===o&&M.splice(l,1)}),delete u.defQueueMap[o],f&&(f.events.defined&&(I[o]=f.events),U(o))}),n},enable:function(e){var i=getOwn(v,e.id);i&&T(e).enable()},completeLoad:function(e){var i,n,o,t=getOwn(g.shim,e)||{},f=t.exports;for(F();M.length;){if(n=M.shift(),n[0]===null){if(n[0]=e,i)break;i=!0}else n[0]===e&&(i=!0);_(n)}if(u.defQueueMap={},o=getOwn(v,e),!i&&!hasProp(w,e)&&o&&!o.inited){if(g.enforceDefine&&(!f||!getGlobal(f)))return Q(e)?void 0:y(makeError(\\\"nodefine\\\",\\\"No define call for \\\"+e,null,[e]));_([e,t.deps||[],t.exportsFn])}z()},nameToUrl:function(e,i,n){var o,t,f,d,l,p,b,E=getOwn(g.pkgs,e);if(E&&(e=E),b=getOwn(L,e),b)return u.nameToUrl(b,i,n);if(req.jsExtRegExp.test(e))l=e+(i||\\\"\\\");else{for(o=g.paths,t=e.split(\\\"/\\\"),f=t.length;f>0;f-=1)if(d=t.slice(0,f).join(\\\"/\\\"),p=getOwn(o,d),p){isArray(p)&&(p=p[0]),t.splice(0,f,p);break}l=t.join(\\\"/\\\"),l+=i||(/^data\\\\:|^blob\\\\:|\\\\?/.test(l)||n?\\\"\\\":\\\".js\\\"),l=(l.charAt(0)===\\\"/\\\"||l.match(/^[\\\\w\\\\+\\\\.\\\\-]+:/)?\\\"\\\":g.baseUrl)+l}return g.urlArgs&&!/^blob\\\\:/.test(l)?l+g.urlArgs(e,l):l},load:function(e,i){req.load(u,e,i)},execCb:function(e,i,n,o){return i.apply(o,n)},onScriptLoad:function(e){if(e.type===\\\"load\\\"||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var i=V(e);u.completeLoad(i.id)}},onScriptError:function(e){var i=V(e);if(!Q(i.id)){var n=[];return eachProp(v,function(o,t){t.indexOf(\\\"_@r\\\")!==0&&each(o.depMaps,function(f){if(f.id===i.id)return n.push(t),!0})}),y(makeError(\\\"scripterror\\\",'Script error for \\\"'+i.id+(n.length?'\\\", needed by: '+n.join(\\\", \\\"):'\\\"'),e,[i.id]))}}},u.require=u.makeRequire(),u}req=requirejs=function(r,a,c,u){var h,q,g=defContextName;return!isArray(r)&&typeof r!=\\\"string\\\"&&(q=r,isArray(a)?(r=a,a=c,c=u):r=[]),q&&q.context&&(g=q.context),h=getOwn(contexts,g),h||(h=contexts[g]=req.s.newContext(g)),q&&h.configure(q),h.require(r,a,c)},req.config=function(r){return req(r)},req.nextTick=typeof setTimeout<\\\"u\\\"?function(r){setTimeout(r,4)}:function(r){r()},require||(require=req),req.version=version,req.jsExtRegExp=/^\\\\/|:|\\\\?|\\\\.js$/,req.isBrowser=isBrowser,s=req.s={contexts,newContext},req({}),each([\\\"toUrl\\\",\\\"undef\\\",\\\"defined\\\",\\\"specified\\\"],function(r){req[r]=function(){var a=contexts[defContextName];return a.require[r].apply(a,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName(\\\"head\\\")[0],baseElement=document.getElementsByTagName(\\\"base\\\")[0],baseElement&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(r,a,c){var u=r.xhtml?document.createElementNS(\\\"http://www.w3.org/1999/xhtml\\\",\\\"html:script\\\"):document.createElement(\\\"script\\\");return u.type=r.scriptType||\\\"text/javascript\\\",u.charset=\\\"utf-8\\\",u.async=!0,u},req.load=function(r,a,c){var u=r&&r.config||{},h;if(isBrowser)return h=req.createNode(u,a,c),h.setAttribute(\\\"data-requirecontext\\\",r.contextName),h.setAttribute(\\\"data-requiremodule\\\",a),h.attachEvent&&!(h.attachEvent.toString&&h.attachEvent.toString().indexOf(\\\"[native code\\\")<0)&&!isOpera?(useInteractive=!0,h.attachEvent(\\\"onreadystatechange\\\",r.onScriptLoad)):(h.addEventListener(\\\"load\\\",r.onScriptLoad,!1),h.addEventListener(\\\"error\\\",r.onScriptError,!1)),h.src=c,u.onNodeCreated&&u.onNodeCreated(h,u,a,c),currentlyAddingScript=h,baseElement?head.insertBefore(h,baseElement):head.appendChild(h),currentlyAddingScript=null,h;if(isWebWorker)try{setTimeout(function(){},0),importScripts(c),r.completeLoad(a)}catch(q){r.onError(makeError(\\\"importscripts\\\",\\\"importScripts failed for \\\"+a+\\\" at \\\"+c,q,[a]))}};function getInteractiveScript(){return interactiveScript&&interactiveScript.readyState===\\\"interactive\\\"||eachReverse(scripts(),function(r){if(r.readyState===\\\"interactive\\\")return interactiveScript=r}),interactiveScript}isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(r){if(head||(head=r.parentNode),dataMain=r.getAttribute(\\\"data-main\\\"),dataMain)return mainScript=dataMain,!cfg.baseUrl&&mainScript.indexOf(\\\"!\\\")===-1&&(src=mainScript.split(\\\"/\\\"),mainScript=src.pop(),subPath=src.length?src.join(\\\"/\\\")+\\\"/\\\":\\\"./\\\",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,\\\"\\\"),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(r,a,c){var u,h;typeof r!=\\\"string\\\"&&(c=a,a=r,r=null),isArray(a)||(c=a,a=null),!a&&isFunction(c)&&(a=[],c.length&&(c.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(q,g){a.push(g)}),a=(c.length===1?[\\\"require\\\"]:[\\\"require\\\",\\\"exports\\\",\\\"module\\\"]).concat(a))),useInteractive&&(u=currentlyAddingScript||getInteractiveScript(),u&&(r||(r=u.getAttribute(\\\"data-requiremodule\\\")),h=contexts[u.getAttribute(\\\"data-requirecontext\\\")])),h?(h.defQueue.push([r,a,c]),h.defQueueMap[r]=!0):globalDefQueue.push([r,a,c])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)})(this,typeof setTimeout>\\\"u\\\"?void 0:setTimeout);\";\n"]}
package/package.json CHANGED
@@ -1,16 +1,18 @@
1
1
  {
2
2
  "name": "@qti-components/portable-custom-interaction",
3
3
  "description": "QTI portable-custom-interaction interaction",
4
- "version": "1.2.1-next.1",
4
+ "version": "1.3.0",
5
5
  "author": "",
6
6
  "dependencies": {
7
- "@qti-components/base": "^2.5.0-next.1",
8
- "@qti-components/interactions-core": "^2.1.4-next.1",
7
+ "@qti-components/base": "^2.5.0",
8
+ "@qti-components/interactions-core": "^2.1.4",
9
+ "@qti-components/theme": "^2.3.0",
9
10
  "@qti-components/utilities": "^1.3.3"
10
11
  },
11
12
  "devDependencies": {
12
13
  "@lit/context": "^1.1.6",
13
- "lit": "^3.3.1"
14
+ "lit": "^3.3.1",
15
+ "requirejs": "2.3.8"
14
16
  },
15
17
  "keywords": [
16
18
  "interactions",
@@ -60,6 +62,7 @@
60
62
  "attw": "attw --profile esm-only --pack",
61
63
  "build": "pnpm run clean && tsc --paths null",
62
64
  "clean": "rm -rf dist",
65
+ "vendor:requirejs": "node ../../../tools/build/vendor-requirejs.mjs",
63
66
  "yalc": "yalc publish",
64
67
  "yalc:push": "yalc push"
65
68
  }