You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
24 KiB
1 lines
24 KiB
{"ast":null,"code":"\"use strict\";\n\nrequire(\"core-js/modules/es.regexp.exec.js\");\n\nrequire(\"core-js/modules/es.object.to-string.js\");\n\nrequire(\"core-js/modules/es.regexp.to-string.js\");\n\nvar __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar named_references_1 = require(\"./named-references\");\n\nvar numeric_unicode_map_1 = require(\"./numeric-unicode-map\");\n\nvar surrogate_pairs_1 = require(\"./surrogate-pairs\");\n\nvar allNamedReferences = __assign(__assign({}, named_references_1.namedReferences), {\n all: named_references_1.namedReferences.html5\n});\n\nvar encodeRegExps = {\n specialChars: /[<>'\"&]/g,\n nonAscii: /(?:[<>'\"&\\u0080-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g,\n nonAsciiPrintable: /(?:[<>'\"&\\x01-\\x08\\x11-\\x15\\x17-\\x1F\\x7f-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g,\n extensive: /(?:[\\x01-\\x0c\\x0e-\\x1f\\x21-\\x2c\\x2e-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7d\\x7f-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g\n};\nvar defaultEncodeOptions = {\n mode: 'specialChars',\n level: 'all',\n numeric: 'decimal'\n};\n/** Encodes all the necessary (specified by `level`) characters in the text */\n\nfunction encode(text, _a) {\n var _b = _a === void 0 ? defaultEncodeOptions : _a,\n _c = _b.mode,\n mode = _c === void 0 ? 'specialChars' : _c,\n _d = _b.numeric,\n numeric = _d === void 0 ? 'decimal' : _d,\n _e = _b.level,\n level = _e === void 0 ? 'all' : _e;\n\n if (!text) {\n return '';\n }\n\n var encodeRegExp = encodeRegExps[mode];\n var references = allNamedReferences[level].characters;\n var isHex = numeric === 'hexadecimal';\n encodeRegExp.lastIndex = 0;\n\n var _b = encodeRegExp.exec(text);\n\n var _c;\n\n if (_b) {\n _c = '';\n var _d = 0;\n\n do {\n if (_d !== _b.index) {\n _c += text.substring(_d, _b.index);\n }\n\n var _e = _b[0];\n var result_1 = references[_e];\n\n if (!result_1) {\n var code_1 = _e.length > 1 ? surrogate_pairs_1.getCodePoint(_e, 0) : _e.charCodeAt(0);\n result_1 = (isHex ? '&#x' + code_1.toString(16) : '&#' + code_1) + ';';\n }\n\n _c += result_1;\n _d = _b.index + _e.length;\n } while (_b = encodeRegExp.exec(text));\n\n if (_d !== text.length) {\n _c += text.substring(_d);\n }\n } else {\n _c = text;\n }\n\n return _c;\n}\n\nexports.encode = encode;\nvar defaultDecodeOptions = {\n scope: 'body',\n level: 'all'\n};\nvar strict = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+);/g;\nvar attribute = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g;\nvar baseDecodeRegExps = {\n xml: {\n strict: strict,\n attribute: attribute,\n body: named_references_1.bodyRegExps.xml\n },\n html4: {\n strict: strict,\n attribute: attribute,\n body: named_references_1.bodyRegExps.html4\n },\n html5: {\n strict: strict,\n attribute: attribute,\n body: named_references_1.bodyRegExps.html5\n }\n};\n\nvar decodeRegExps = __assign(__assign({}, baseDecodeRegExps), {\n all: baseDecodeRegExps.html5\n});\n\nvar fromCharCode = String.fromCharCode;\nvar outOfBoundsChar = fromCharCode(65533);\nvar defaultDecodeEntityOptions = {\n level: 'all'\n};\n/** Decodes a single entity */\n\nfunction decodeEntity(entity, _a) {\n var _b = (_a === void 0 ? defaultDecodeEntityOptions : _a).level,\n level = _b === void 0 ? 'all' : _b;\n\n if (!entity) {\n return '';\n }\n\n var _b = entity;\n var decodeEntityLastChar_1 = entity[entity.length - 1];\n\n if (false && decodeEntityLastChar_1 === '=') {\n _b = entity;\n } else if (false && decodeEntityLastChar_1 !== ';') {\n _b = entity;\n } else {\n var decodeResultByReference_1 = allNamedReferences[level].entities[entity];\n\n if (decodeResultByReference_1) {\n _b = decodeResultByReference_1;\n } else if (entity[0] === '&' && entity[1] === '#') {\n var decodeSecondChar_1 = entity[2];\n var decodeCode_1 = decodeSecondChar_1 == 'x' || decodeSecondChar_1 == 'X' ? parseInt(entity.substr(3), 16) : parseInt(entity.substr(2));\n _b = decodeCode_1 >= 0x10ffff ? outOfBoundsChar : decodeCode_1 > 65535 ? surrogate_pairs_1.fromCodePoint(decodeCode_1) : fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode_1] || decodeCode_1);\n }\n }\n\n return _b;\n}\n\nexports.decodeEntity = decodeEntity;\n/** Decodes all entities in the text */\n\nfunction decode(text, _a) {\n var decodeSecondChar_1 = _a === void 0 ? defaultDecodeOptions : _a,\n decodeCode_1 = decodeSecondChar_1.level,\n level = decodeCode_1 === void 0 ? 'all' : decodeCode_1,\n _b = decodeSecondChar_1.scope,\n scope = _b === void 0 ? level === 'xml' ? 'strict' : 'body' : _b;\n\n if (!text) {\n return '';\n }\n\n var decodeRegExp = decodeRegExps[level][scope];\n var references = allNamedReferences[level].entities;\n var isAttribute = scope === 'attribute';\n var isStrict = scope === 'strict';\n decodeRegExp.lastIndex = 0;\n var replaceMatch_1 = decodeRegExp.exec(text);\n var replaceResult_1;\n\n if (replaceMatch_1) {\n replaceResult_1 = '';\n var replaceLastIndex_1 = 0;\n\n do {\n if (replaceLastIndex_1 !== replaceMatch_1.index) {\n replaceResult_1 += text.substring(replaceLastIndex_1, replaceMatch_1.index);\n }\n\n var replaceInput_1 = replaceMatch_1[0];\n var decodeResult_1 = replaceInput_1;\n var decodeEntityLastChar_2 = replaceInput_1[replaceInput_1.length - 1];\n\n if (isAttribute && decodeEntityLastChar_2 === '=') {\n decodeResult_1 = replaceInput_1;\n } else if (isStrict && decodeEntityLastChar_2 !== ';') {\n decodeResult_1 = replaceInput_1;\n } else {\n var decodeResultByReference_2 = references[replaceInput_1];\n\n if (decodeResultByReference_2) {\n decodeResult_1 = decodeResultByReference_2;\n } else if (replaceInput_1[0] === '&' && replaceInput_1[1] === '#') {\n var decodeSecondChar_2 = replaceInput_1[2];\n var decodeCode_2 = decodeSecondChar_2 == 'x' || decodeSecondChar_2 == 'X' ? parseInt(replaceInput_1.substr(3), 16) : parseInt(replaceInput_1.substr(2));\n decodeResult_1 = decodeCode_2 >= 0x10ffff ? outOfBoundsChar : decodeCode_2 > 65535 ? surrogate_pairs_1.fromCodePoint(decodeCode_2) : fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode_2] || decodeCode_2);\n }\n }\n\n replaceResult_1 += decodeResult_1;\n replaceLastIndex_1 = replaceMatch_1.index + replaceInput_1.length;\n } while (replaceMatch_1 = decodeRegExp.exec(text));\n\n if (replaceLastIndex_1 !== text.length) {\n replaceResult_1 += text.substring(replaceLastIndex_1);\n }\n } else {\n replaceResult_1 = text;\n }\n\n return replaceResult_1;\n}\n\nexports.decode = decode;","map":{"version":3,"sources":["/tmp/vue-hello/node_modules/html-entities/lib/index.js"],"names":["__assign","Object","assign","t","s","i","n","arguments","length","p","prototype","hasOwnProperty","call","apply","defineProperty","exports","value","named_references_1","require","numeric_unicode_map_1","surrogate_pairs_1","allNamedReferences","namedReferences","all","html5","encodeRegExps","specialChars","nonAscii","nonAsciiPrintable","extensive","defaultEncodeOptions","mode","level","numeric","encode","text","_a","_b","_c","_d","_e","encodeRegExp","references","characters","isHex","lastIndex","exec","index","substring","result_1","code_1","getCodePoint","charCodeAt","toString","defaultDecodeOptions","scope","strict","attribute","baseDecodeRegExps","xml","body","bodyRegExps","html4","decodeRegExps","fromCharCode","String","outOfBoundsChar","defaultDecodeEntityOptions","decodeEntity","entity","decodeEntityLastChar_1","decodeResultByReference_1","entities","decodeSecondChar_1","decodeCode_1","parseInt","substr","fromCodePoint","numericUnicodeMap","decode","decodeRegExp","isAttribute","isStrict","replaceMatch_1","replaceResult_1","replaceLastIndex_1","replaceInput_1","decodeResult_1","decodeEntityLastChar_2","decodeResultByReference_2","decodeSecondChar_2","decodeCode_2"],"mappings":"AAAA;;;;;;;;AACA,IAAIA,QAAQ,GAAI,QAAQ,KAAKA,QAAd,IAA2B,YAAY;AAClDA,EAAAA,QAAQ,GAAGC,MAAM,CAACC,MAAP,IAAiB,UAASC,CAAT,EAAY;AACpC,SAAK,IAAIC,CAAJ,EAAOC,CAAC,GAAG,CAAX,EAAcC,CAAC,GAAGC,SAAS,CAACC,MAAjC,EAAyCH,CAAC,GAAGC,CAA7C,EAAgDD,CAAC,EAAjD,EAAqD;AACjDD,MAAAA,CAAC,GAAGG,SAAS,CAACF,CAAD,CAAb;;AACA,WAAK,IAAII,CAAT,IAAcL,CAAd;AAAiB,YAAIH,MAAM,CAACS,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCR,CAArC,EAAwCK,CAAxC,CAAJ,EACbN,CAAC,CAACM,CAAD,CAAD,GAAOL,CAAC,CAACK,CAAD,CAAR;AADJ;AAEH;;AACD,WAAON,CAAP;AACH,GAPD;;AAQA,SAAOH,QAAQ,CAACa,KAAT,CAAe,IAAf,EAAqBN,SAArB,CAAP;AACH,CAVD;;AAWAN,MAAM,CAACa,cAAP,CAAsBC,OA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,CAAgCc,YAAhC,CADJ,GAEI3B,YAAY,CAAC7C,qBAAqB,CAAC2D,iBAAtB,CAAwCa,YAAxC,KAAyDA,YAA1D,CAL1B;AAMH;AACJ;;AACDP,MAAAA,eAAe,IAAIG,cAAnB;AACAF,MAAAA,kBAAkB,GAAGF,cAAc,CAACpC,KAAf,GAAuBuC,cAAc,CAAC9E,MAA3D;AACH,KAnCD,QAmCU2E,cAAc,GAAGH,YAAY,CAAClC,IAAb,CAAkBX,IAAlB,CAnC3B;;AAoCA,QAAIkD,kBAAkB,KAAKlD,IAAI,CAAC3B,MAAhC,EAAwC;AACpC4E,MAAAA,eAAe,IAAIjD,IAAI,CAACa,SAAL,CAAeqC,kBAAf,CAAnB;AACH;AACJ,GA1CD,MA2CK;AACDD,IAAAA,eAAe,GACXjD,IADJ;AAEH;;AACD,SAAOiD,eAAP;AACH;;AACDrE,OAAO,CAACgE,MAAR,GAAiBA,MAAjB","sourcesContent":["\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar named_references_1 = require(\"./named-references\");\nvar numeric_unicode_map_1 = require(\"./numeric-unicode-map\");\nvar surrogate_pairs_1 = require(\"./surrogate-pairs\");\nvar allNamedReferences = __assign(__assign({}, named_references_1.namedReferences), { all: named_references_1.namedReferences.html5 });\nvar encodeRegExps = {\n specialChars: /[<>'\"&]/g,\n nonAscii: /(?:[<>'\"&\\u0080-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g,\n nonAsciiPrintable: /(?:[<>'\"&\\x01-\\x08\\x11-\\x15\\x17-\\x1F\\x7f-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g,\n extensive: /(?:[\\x01-\\x0c\\x0e-\\x1f\\x21-\\x2c\\x2e-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7d\\x7f-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])/g\n};\nvar defaultEncodeOptions = {\n mode: 'specialChars',\n level: 'all',\n numeric: 'decimal'\n};\n/** Encodes all the necessary (specified by `level`) characters in the text */\nfunction encode(text, _a) {\n var _b = _a === void 0 ? defaultEncodeOptions : _a, _c = _b.mode, mode = _c === void 0 ? 'specialChars' : _c, _d = _b.numeric, numeric = _d === void 0 ? 'decimal' : _d, _e = _b.level, level = _e === void 0 ? 'all' : _e;\n if (!text) {\n return '';\n }\n var encodeRegExp = encodeRegExps[mode];\n var references = allNamedReferences[level].characters;\n var isHex = numeric === 'hexadecimal';\n encodeRegExp.lastIndex = 0;\n var _b = encodeRegExp.exec(text);\n var _c;\n if (_b) {\n _c = '';\n var _d = 0;\n do {\n if (_d !== _b.index) {\n _c += text.substring(_d, _b.index);\n }\n var _e = _b[0];\n var result_1 = references[_e];\n if (!result_1) {\n var code_1 = _e.length > 1 ? surrogate_pairs_1.getCodePoint(_e, 0) : _e.charCodeAt(0);\n result_1 = (isHex ? '&#x' + code_1.toString(16) : '&#' + code_1) + ';';\n }\n _c += result_1;\n _d = _b.index + _e.length;\n } while ((_b = encodeRegExp.exec(text)));\n if (_d !== text.length) {\n _c += text.substring(_d);\n }\n }\n else {\n _c =\n text;\n }\n return _c;\n}\nexports.encode = encode;\nvar defaultDecodeOptions = {\n scope: 'body',\n level: 'all'\n};\nvar strict = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+);/g;\nvar attribute = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g;\nvar baseDecodeRegExps = {\n xml: {\n strict: strict,\n attribute: attribute,\n body: named_references_1.bodyRegExps.xml\n },\n html4: {\n strict: strict,\n attribute: attribute,\n body: named_references_1.bodyRegExps.html4\n },\n html5: {\n strict: strict,\n attribute: attribute,\n body: named_references_1.bodyRegExps.html5\n }\n};\nvar decodeRegExps = __assign(__assign({}, baseDecodeRegExps), { all: baseDecodeRegExps.html5 });\nvar fromCharCode = String.fromCharCode;\nvar outOfBoundsChar = fromCharCode(65533);\nvar defaultDecodeEntityOptions = {\n level: 'all'\n};\n/** Decodes a single entity */\nfunction decodeEntity(entity, _a) {\n var _b = (_a === void 0 ? defaultDecodeEntityOptions : _a).level, level = _b === void 0 ? 'all' : _b;\n if (!entity) {\n return '';\n }\n var _b = entity;\n var decodeEntityLastChar_1 = entity[entity.length - 1];\n if (false\n && decodeEntityLastChar_1 === '=') {\n _b =\n entity;\n }\n else if (false\n && decodeEntityLastChar_1 !== ';') {\n _b =\n entity;\n }\n else {\n var decodeResultByReference_1 = allNamedReferences[level].entities[entity];\n if (decodeResultByReference_1) {\n _b = decodeResultByReference_1;\n }\n else if (entity[0] === '&' && entity[1] === '#') {\n var decodeSecondChar_1 = entity[2];\n var decodeCode_1 = decodeSecondChar_1 == 'x' || decodeSecondChar_1 == 'X'\n ? parseInt(entity.substr(3), 16)\n : parseInt(entity.substr(2));\n _b =\n decodeCode_1 >= 0x10ffff\n ? outOfBoundsChar\n : decodeCode_1 > 65535\n ? surrogate_pairs_1.fromCodePoint(decodeCode_1)\n : fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode_1] || decodeCode_1);\n }\n }\n return _b;\n}\nexports.decodeEntity = decodeEntity;\n/** Decodes all entities in the text */\nfunction decode(text, _a) {\n var decodeSecondChar_1 = _a === void 0 ? defaultDecodeOptions : _a, decodeCode_1 = decodeSecondChar_1.level, level = decodeCode_1 === void 0 ? 'all' : decodeCode_1, _b = decodeSecondChar_1.scope, scope = _b === void 0 ? level === 'xml' ? 'strict' : 'body' : _b;\n if (!text) {\n return '';\n }\n var decodeRegExp = decodeRegExps[level][scope];\n var references = allNamedReferences[level].entities;\n var isAttribute = scope === 'attribute';\n var isStrict = scope === 'strict';\n decodeRegExp.lastIndex = 0;\n var replaceMatch_1 = decodeRegExp.exec(text);\n var replaceResult_1;\n if (replaceMatch_1) {\n replaceResult_1 = '';\n var replaceLastIndex_1 = 0;\n do {\n if (replaceLastIndex_1 !== replaceMatch_1.index) {\n replaceResult_1 += text.substring(replaceLastIndex_1, replaceMatch_1.index);\n }\n var replaceInput_1 = replaceMatch_1[0];\n var decodeResult_1 = replaceInput_1;\n var decodeEntityLastChar_2 = replaceInput_1[replaceInput_1.length - 1];\n if (isAttribute\n && decodeEntityLastChar_2 === '=') {\n decodeResult_1 = replaceInput_1;\n }\n else if (isStrict\n && decodeEntityLastChar_2 !== ';') {\n decodeResult_1 = replaceInput_1;\n }\n else {\n var decodeResultByReference_2 = references[replaceInput_1];\n if (decodeResultByReference_2) {\n decodeResult_1 = decodeResultByReference_2;\n }\n else if (replaceInput_1[0] === '&' && replaceInput_1[1] === '#') {\n var decodeSecondChar_2 = replaceInput_1[2];\n var decodeCode_2 = decodeSecondChar_2 == 'x' || decodeSecondChar_2 == 'X'\n ? parseInt(replaceInput_1.substr(3), 16)\n : parseInt(replaceInput_1.substr(2));\n decodeResult_1 =\n decodeCode_2 >= 0x10ffff\n ? outOfBoundsChar\n : decodeCode_2 > 65535\n ? surrogate_pairs_1.fromCodePoint(decodeCode_2)\n : fromCharCode(numeric_unicode_map_1.numericUnicodeMap[decodeCode_2] || decodeCode_2);\n }\n }\n replaceResult_1 += decodeResult_1;\n replaceLastIndex_1 = replaceMatch_1.index + replaceInput_1.length;\n } while ((replaceMatch_1 = decodeRegExp.exec(text)));\n if (replaceLastIndex_1 !== text.length) {\n replaceResult_1 += text.substring(replaceLastIndex_1);\n }\n }\n else {\n replaceResult_1 =\n text;\n }\n return replaceResult_1;\n}\nexports.decode = decode;\n"]},"metadata":{},"sourceType":"script"} |