123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159 |
- 'use strict';
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- var styleInject_es = require('./style-inject.es-c7b50579.js');
- require('react');
- require('./test-b52888d6.js');
- var index = require('./index-038f2eaf.js');
- require('antd/es/input/style');
- require('antd/es/input');
- require('antd/es/button/style');
- require('antd/es/button');
-
- /*
- Copyright (c) 2014, Yahoo! Inc. All rights reserved.
- Copyrights licensed under the New BSD License.
- See the accompanying LICENSE file for terms.
- */
- var extend_1 = extend;
- var hop = Object.prototype.hasOwnProperty;
-
- function extend(obj) {
- var sources = Array.prototype.slice.call(arguments, 1),
- i, len, source, key;
-
- for (i = 0, len = sources.length; i < len; i += 1) {
- source = sources[i];
- if (!source) { continue; }
-
- for (key in source) {
- if (hop.call(source, key)) {
- obj[key] = source[key];
- }
- }
- }
-
- return obj;
- }
- var hop_1 = hop;
-
-
-
- var utils = {
- extend: extend_1,
- hop: hop_1
- };
-
- var es5 = styleInject_es.createCommonjsModule(function (module, exports) {
-
-
- // Purposely using the same implementation as the Intl.js `Intl` polyfill.
- // Copyright 2013 Andy Earnshaw, MIT License
-
- var realDefineProp = (function () {
- try { return !!Object.defineProperty({}, 'a', {}); }
- catch (e) { return false; }
- })();
-
- var defineProperty = realDefineProp ? Object.defineProperty :
- function (obj, name, desc) {
-
- if ('get' in desc && obj.__defineGetter__) {
- obj.__defineGetter__(name, desc.get);
- } else if (!utils.hop.call(obj, name) || 'value' in desc) {
- obj[name] = desc.value;
- }
- };
-
- var objCreate = Object.create || function (proto, props) {
- var obj, k;
-
- function F() {}
- F.prototype = proto;
- obj = new F();
-
- for (k in props) {
- if (utils.hop.call(props, k)) {
- defineProperty(obj, k, props[k]);
- }
- }
-
- return obj;
- };
-
- exports.defineProperty = defineProperty, exports.objCreate = objCreate;
-
-
- });
- var es5_1 = es5.defineProperty;
- var es5_2 = es5.objCreate;
-
- var compiler = styleInject_es.createCommonjsModule(function (module, exports) {
- exports["default"] = Compiler;
-
- function Compiler(locales, formats, pluralFn) {
- this.locales = locales;
- this.formats = formats;
- this.pluralFn = pluralFn;
- }
-
- Compiler.prototype.compile = function (ast) {
- this.pluralStack = [];
- this.currentPlural = null;
- this.pluralNumberFormat = null;
-
- return this.compileMessage(ast);
- };
-
- Compiler.prototype.compileMessage = function (ast) {
- if (!(ast && ast.type === 'messageFormatPattern')) {
- throw new Error('Message AST is not of type: "messageFormatPattern"');
- }
-
- var elements = ast.elements,
- pattern = [];
-
- var i, len, element;
-
- for (i = 0, len = elements.length; i < len; i += 1) {
- element = elements[i];
-
- switch (element.type) {
- case 'messageTextElement':
- pattern.push(this.compileMessageText(element));
- break;
-
- case 'argumentElement':
- pattern.push(this.compileArgument(element));
- break;
-
- default:
- throw new Error('Message element does not have a valid type');
- }
- }
-
- return pattern;
- };
-
- Compiler.prototype.compileMessageText = function (element) {
- // When this `element` is part of plural sub-pattern and its value contains
- // an unescaped '#', use a `PluralOffsetString` helper to properly output
- // the number with the correct offset in the string.
- if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) {
- // Create a cache a NumberFormat instance that can be reused for any
- // PluralOffsetString instance in this message.
- if (!this.pluralNumberFormat) {
- this.pluralNumberFormat = new Intl.NumberFormat(this.locales);
- }
-
- return new PluralOffsetString(
- this.currentPlural.id,
- this.currentPlural.format.offset,
- this.pluralNumberFormat,
- element.value);
- }
-
- // Unescape the escaped '#'s in the message text.
- return element.value.replace(/\\#/g, '#');
- };
-
- Compiler.prototype.compileArgument = function (element) {
- var format = element.format;
-
- if (!format) {
- return new StringFormat(element.id);
- }
-
- var formats = this.formats,
- locales = this.locales,
- pluralFn = this.pluralFn,
- options;
-
- switch (format.type) {
- case 'numberFormat':
- options = formats.number[format.style];
- return {
- id : element.id,
- format: new Intl.NumberFormat(locales, options).format
- };
-
- case 'dateFormat':
- options = formats.date[format.style];
- return {
- id : element.id,
- format: new Intl.DateTimeFormat(locales, options).format
- };
-
- case 'timeFormat':
- options = formats.time[format.style];
- return {
- id : element.id,
- format: new Intl.DateTimeFormat(locales, options).format
- };
-
- case 'pluralFormat':
- options = this.compileOptions(element);
- return new PluralFormat(
- element.id, format.ordinal, format.offset, options, pluralFn
- );
-
- case 'selectFormat':
- options = this.compileOptions(element);
- return new SelectFormat(element.id, options);
-
- default:
- throw new Error('Message element does not have a valid format type');
- }
- };
-
- Compiler.prototype.compileOptions = function (element) {
- var format = element.format,
- options = format.options,
- optionsHash = {};
-
- // Save the current plural element, if any, then set it to a new value when
- // compiling the options sub-patterns. This conforms the spec's algorithm
- // for handling `"#"` syntax in message text.
- this.pluralStack.push(this.currentPlural);
- this.currentPlural = format.type === 'pluralFormat' ? element : null;
-
- var i, len, option;
-
- for (i = 0, len = options.length; i < len; i += 1) {
- option = options[i];
-
- // Compile the sub-pattern and save it under the options's selector.
- optionsHash[option.selector] = this.compileMessage(option.value);
- }
-
- // Pop the plural stack to put back the original current plural value.
- this.currentPlural = this.pluralStack.pop();
-
- return optionsHash;
- };
-
- // -- Compiler Helper Classes --------------------------------------------------
-
- function StringFormat(id) {
- this.id = id;
- }
-
- StringFormat.prototype.format = function (value) {
- if (!value && typeof value !== 'number') {
- return '';
- }
-
- return typeof value === 'string' ? value : String(value);
- };
-
- function PluralFormat(id, useOrdinal, offset, options, pluralFn) {
- this.id = id;
- this.useOrdinal = useOrdinal;
- this.offset = offset;
- this.options = options;
- this.pluralFn = pluralFn;
- }
-
- PluralFormat.prototype.getOption = function (value) {
- var options = this.options;
-
- var option = options['=' + value] ||
- options[this.pluralFn(value - this.offset, this.useOrdinal)];
-
- return option || options.other;
- };
-
- function PluralOffsetString(id, offset, numberFormat, string) {
- this.id = id;
- this.offset = offset;
- this.numberFormat = numberFormat;
- this.string = string;
- }
-
- PluralOffsetString.prototype.format = function (value) {
- var number = this.numberFormat.format(value - this.offset);
-
- return this.string
- .replace(/(^|[^\\])#/g, '$1' + number)
- .replace(/\\#/g, '#');
- };
-
- function SelectFormat(id, options) {
- this.id = id;
- this.options = options;
- }
-
- SelectFormat.prototype.getOption = function (value) {
- var options = this.options;
- return options[value] || options.other;
- };
-
-
- });
-
- var parser = styleInject_es.createCommonjsModule(function (module, exports) {
-
- exports["default"] = (function() {
-
- /*
- * Generated by PEG.js 0.9.0.
- *
- * http://pegjs.org/
- */
-
- function peg$subclass(child, parent) {
- function ctor() { this.constructor = child; }
- ctor.prototype = parent.prototype;
- child.prototype = new ctor();
- }
-
- function peg$SyntaxError(message, expected, found, location) {
- this.message = message;
- this.expected = expected;
- this.found = found;
- this.location = location;
- this.name = "SyntaxError";
-
- if (typeof Error.captureStackTrace === "function") {
- Error.captureStackTrace(this, peg$SyntaxError);
- }
- }
-
- peg$subclass(peg$SyntaxError, Error);
-
- function peg$parse(input) {
- var options = arguments.length > 1 ? arguments[1] : {},
- peg$FAILED = {},
-
- peg$startRuleFunctions = { start: peg$parsestart },
- peg$startRuleFunction = peg$parsestart,
-
- peg$c0 = function(elements) {
- return {
- type : 'messageFormatPattern',
- elements: elements,
- location: location()
- };
- },
- peg$c1 = function(text) {
- var string = '',
- i, j, outerLen, inner, innerLen;
-
- for (i = 0, outerLen = text.length; i < outerLen; i += 1) {
- inner = text[i];
-
- for (j = 0, innerLen = inner.length; j < innerLen; j += 1) {
- string += inner[j];
- }
- }
-
- return string;
- },
- peg$c2 = function(messageText) {
- return {
- type : 'messageTextElement',
- value: messageText,
- location: location()
- };
- },
- peg$c3 = /^[^ \t\n\r,.+={}#]/,
- peg$c4 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" },
- peg$c5 = "{",
- peg$c6 = { type: "literal", value: "{", description: "\"{\"" },
- peg$c7 = ",",
- peg$c8 = { type: "literal", value: ",", description: "\",\"" },
- peg$c9 = "}",
- peg$c10 = { type: "literal", value: "}", description: "\"}\"" },
- peg$c11 = function(id, format) {
- return {
- type : 'argumentElement',
- id : id,
- format: format && format[2],
- location: location()
- };
- },
- peg$c12 = "number",
- peg$c13 = { type: "literal", value: "number", description: "\"number\"" },
- peg$c14 = "date",
- peg$c15 = { type: "literal", value: "date", description: "\"date\"" },
- peg$c16 = "time",
- peg$c17 = { type: "literal", value: "time", description: "\"time\"" },
- peg$c18 = function(type, style) {
- return {
- type : type + 'Format',
- style: style && style[2],
- location: location()
- };
- },
- peg$c19 = "plural",
- peg$c20 = { type: "literal", value: "plural", description: "\"plural\"" },
- peg$c21 = function(pluralStyle) {
- return {
- type : pluralStyle.type,
- ordinal: false,
- offset : pluralStyle.offset || 0,
- options: pluralStyle.options,
- location: location()
- };
- },
- peg$c22 = "selectordinal",
- peg$c23 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" },
- peg$c24 = function(pluralStyle) {
- return {
- type : pluralStyle.type,
- ordinal: true,
- offset : pluralStyle.offset || 0,
- options: pluralStyle.options,
- location: location()
- }
- },
- peg$c25 = "select",
- peg$c26 = { type: "literal", value: "select", description: "\"select\"" },
- peg$c27 = function(options) {
- return {
- type : 'selectFormat',
- options: options,
- location: location()
- };
- },
- peg$c28 = "=",
- peg$c29 = { type: "literal", value: "=", description: "\"=\"" },
- peg$c30 = function(selector, pattern) {
- return {
- type : 'optionalFormatPattern',
- selector: selector,
- value : pattern,
- location: location()
- };
- },
- peg$c31 = "offset:",
- peg$c32 = { type: "literal", value: "offset:", description: "\"offset:\"" },
- peg$c33 = function(number) {
- return number;
- },
- peg$c34 = function(offset, options) {
- return {
- type : 'pluralFormat',
- offset : offset,
- options: options,
- location: location()
- };
- },
- peg$c35 = { type: "other", description: "whitespace" },
- peg$c36 = /^[ \t\n\r]/,
- peg$c37 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" },
- peg$c38 = { type: "other", description: "optionalWhitespace" },
- peg$c39 = /^[0-9]/,
- peg$c40 = { type: "class", value: "[0-9]", description: "[0-9]" },
- peg$c41 = /^[0-9a-f]/i,
- peg$c42 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" },
- peg$c43 = "0",
- peg$c44 = { type: "literal", value: "0", description: "\"0\"" },
- peg$c45 = /^[1-9]/,
- peg$c46 = { type: "class", value: "[1-9]", description: "[1-9]" },
- peg$c47 = function(digits) {
- return parseInt(digits, 10);
- },
- peg$c48 = /^[^{}\\\0-\x1F \t\n\r]/,
- peg$c49 = { type: "class", value: "[^{}\\\\\\0-\\x1F\\x7f \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F\\x7f \\t\\n\\r]" },
- peg$c50 = "\\\\",
- peg$c51 = { type: "literal", value: "\\\\", description: "\"\\\\\\\\\"" },
- peg$c52 = function() { return '\\'; },
- peg$c53 = "\\#",
- peg$c54 = { type: "literal", value: "\\#", description: "\"\\\\#\"" },
- peg$c55 = function() { return '\\#'; },
- peg$c56 = "\\{",
- peg$c57 = { type: "literal", value: "\\{", description: "\"\\\\{\"" },
- peg$c58 = function() { return '\u007B'; },
- peg$c59 = "\\}",
- peg$c60 = { type: "literal", value: "\\}", description: "\"\\\\}\"" },
- peg$c61 = function() { return '\u007D'; },
- peg$c62 = "\\u",
- peg$c63 = { type: "literal", value: "\\u", description: "\"\\\\u\"" },
- peg$c64 = function(digits) {
- return String.fromCharCode(parseInt(digits, 16));
- },
- peg$c65 = function(chars) { return chars.join(''); },
-
- peg$currPos = 0,
- peg$savedPos = 0,
- peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }],
- peg$maxFailPos = 0,
- peg$maxFailExpected = [],
- peg$silentFails = 0,
-
- peg$result;
-
- if ("startRule" in options) {
- if (!(options.startRule in peg$startRuleFunctions)) {
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
- }
-
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
- }
-
- function location() {
- return peg$computeLocation(peg$savedPos, peg$currPos);
- }
-
- function peg$computePosDetails(pos) {
- var details = peg$posDetailsCache[pos],
- p, ch;
-
- if (details) {
- return details;
- } else {
- p = pos - 1;
- while (!peg$posDetailsCache[p]) {
- p--;
- }
-
- details = peg$posDetailsCache[p];
- details = {
- line: details.line,
- column: details.column,
- seenCR: details.seenCR
- };
-
- while (p < pos) {
- ch = input.charAt(p);
- if (ch === "\n") {
- if (!details.seenCR) { details.line++; }
- details.column = 1;
- details.seenCR = false;
- } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") {
- details.line++;
- details.column = 1;
- details.seenCR = true;
- } else {
- details.column++;
- details.seenCR = false;
- }
-
- p++;
- }
-
- peg$posDetailsCache[pos] = details;
- return details;
- }
- }
-
- function peg$computeLocation(startPos, endPos) {
- var startPosDetails = peg$computePosDetails(startPos),
- endPosDetails = peg$computePosDetails(endPos);
-
- return {
- start: {
- offset: startPos,
- line: startPosDetails.line,
- column: startPosDetails.column
- },
- end: {
- offset: endPos,
- line: endPosDetails.line,
- column: endPosDetails.column
- }
- };
- }
-
- function peg$fail(expected) {
- if (peg$currPos < peg$maxFailPos) { return; }
-
- if (peg$currPos > peg$maxFailPos) {
- peg$maxFailPos = peg$currPos;
- peg$maxFailExpected = [];
- }
-
- peg$maxFailExpected.push(expected);
- }
-
- function peg$buildException(message, expected, found, location) {
- function cleanupExpected(expected) {
- var i = 1;
-
- expected.sort(function(a, b) {
- if (a.description < b.description) {
- return -1;
- } else if (a.description > b.description) {
- return 1;
- } else {
- return 0;
- }
- });
-
- while (i < expected.length) {
- if (expected[i - 1] === expected[i]) {
- expected.splice(i, 1);
- } else {
- i++;
- }
- }
- }
-
- function buildMessage(expected, found) {
- function stringEscape(s) {
- function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); }
-
- return s
- .replace(/\\/g, '\\\\')
- .replace(/"/g, '\\"')
- .replace(/\x08/g, '\\b')
- .replace(/\t/g, '\\t')
- .replace(/\n/g, '\\n')
- .replace(/\f/g, '\\f')
- .replace(/\r/g, '\\r')
- .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); })
- .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); })
- .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); })
- .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); });
- }
-
- var expectedDescs = new Array(expected.length),
- expectedDesc, foundDesc, i;
-
- for (i = 0; i < expected.length; i++) {
- expectedDescs[i] = expected[i].description;
- }
-
- expectedDesc = expected.length > 1
- ? expectedDescs.slice(0, -1).join(", ")
- + " or "
- + expectedDescs[expected.length - 1]
- : expectedDescs[0];
-
- foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input";
-
- return "Expected " + expectedDesc + " but " + foundDesc + " found.";
- }
-
- if (expected !== null) {
- cleanupExpected(expected);
- }
-
- return new peg$SyntaxError(
- message !== null ? message : buildMessage(expected, found),
- expected,
- found,
- location
- );
- }
-
- function peg$parsestart() {
- var s0;
-
- s0 = peg$parsemessageFormatPattern();
-
- return s0;
- }
-
- function peg$parsemessageFormatPattern() {
- var s0, s1, s2;
-
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parsemessageFormatElement();
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parsemessageFormatElement();
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c0(s1);
- }
- s0 = s1;
-
- return s0;
- }
-
- function peg$parsemessageFormatElement() {
- var s0;
-
- s0 = peg$parsemessageTextElement();
- if (s0 === peg$FAILED) {
- s0 = peg$parseargumentElement();
- }
-
- return s0;
- }
-
- function peg$parsemessageText() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$currPos;
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s4 = peg$parsechars();
- if (s4 !== peg$FAILED) {
- s5 = peg$parse_();
- if (s5 !== peg$FAILED) {
- s3 = [s3, s4, s5];
- s2 = s3;
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$currPos;
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- s4 = peg$parsechars();
- if (s4 !== peg$FAILED) {
- s5 = peg$parse_();
- if (s5 !== peg$FAILED) {
- s3 = [s3, s4, s5];
- s2 = s3;
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- }
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c1(s1);
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parsews();
- if (s1 !== peg$FAILED) {
- s0 = input.substring(s0, peg$currPos);
- } else {
- s0 = s1;
- }
- }
-
- return s0;
- }
-
- function peg$parsemessageTextElement() {
- var s0, s1;
-
- s0 = peg$currPos;
- s1 = peg$parsemessageText();
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c2(s1);
- }
- s0 = s1;
-
- return s0;
- }
-
- function peg$parseargument() {
- var s0, s1, s2;
-
- s0 = peg$parsenumber();
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = [];
- if (peg$c3.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c4); }
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- if (peg$c3.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c4); }
- }
- }
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s0 = input.substring(s0, peg$currPos);
- } else {
- s0 = s1;
- }
- }
-
- return s0;
- }
-
- function peg$parseargumentElement() {
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 123) {
- s1 = peg$c5;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c6); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseargument();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 44) {
- s6 = peg$c7;
- peg$currPos++;
- } else {
- s6 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c8); }
- }
- if (s6 !== peg$FAILED) {
- s7 = peg$parse_();
- if (s7 !== peg$FAILED) {
- s8 = peg$parseelementFormat();
- if (s8 !== peg$FAILED) {
- s6 = [s6, s7, s8];
- s5 = s6;
- } else {
- peg$currPos = s5;
- s5 = peg$FAILED;
- }
- } else {
- peg$currPos = s5;
- s5 = peg$FAILED;
- }
- } else {
- peg$currPos = s5;
- s5 = peg$FAILED;
- }
- if (s5 === peg$FAILED) {
- s5 = null;
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s7 = peg$c9;
- peg$currPos++;
- } else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c10); }
- }
- if (s7 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c11(s3, s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parseelementFormat() {
- var s0;
-
- s0 = peg$parsesimpleFormat();
- if (s0 === peg$FAILED) {
- s0 = peg$parsepluralFormat();
- if (s0 === peg$FAILED) {
- s0 = peg$parseselectOrdinalFormat();
- if (s0 === peg$FAILED) {
- s0 = peg$parseselectFormat();
- }
- }
- }
-
- return s0;
- }
-
- function peg$parsesimpleFormat() {
- var s0, s1, s2, s3, s4, s5, s6;
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 6) === peg$c12) {
- s1 = peg$c12;
- peg$currPos += 6;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c13); }
- }
- if (s1 === peg$FAILED) {
- if (input.substr(peg$currPos, 4) === peg$c14) {
- s1 = peg$c14;
- peg$currPos += 4;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c15); }
- }
- if (s1 === peg$FAILED) {
- if (input.substr(peg$currPos, 4) === peg$c16) {
- s1 = peg$c16;
- peg$currPos += 4;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c17); }
- }
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 44) {
- s4 = peg$c7;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c8); }
- }
- if (s4 !== peg$FAILED) {
- s5 = peg$parse_();
- if (s5 !== peg$FAILED) {
- s6 = peg$parsechars();
- if (s6 !== peg$FAILED) {
- s4 = [s4, s5, s6];
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- if (s3 === peg$FAILED) {
- s3 = null;
- }
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c18(s1, s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parsepluralFormat() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 6) === peg$c19) {
- s1 = peg$c19;
- peg$currPos += 6;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c20); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s3 = peg$c7;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c8); }
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsepluralStyle();
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c21(s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parseselectOrdinalFormat() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 13) === peg$c22) {
- s1 = peg$c22;
- peg$currPos += 13;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c23); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s3 = peg$c7;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c8); }
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsepluralStyle();
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c24(s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parseselectFormat() {
- var s0, s1, s2, s3, s4, s5, s6;
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 6) === peg$c25) {
- s1 = peg$c25;
- peg$currPos += 6;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c26); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s3 = peg$c7;
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c8); }
- }
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- s5 = [];
- s6 = peg$parseoptionalFormatPattern();
- if (s6 !== peg$FAILED) {
- while (s6 !== peg$FAILED) {
- s5.push(s6);
- s6 = peg$parseoptionalFormatPattern();
- }
- } else {
- s5 = peg$FAILED;
- }
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c27(s5);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parseselector() {
- var s0, s1, s2, s3;
-
- s0 = peg$currPos;
- s1 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 61) {
- s2 = peg$c28;
- peg$currPos++;
- } else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c29); }
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$parsenumber();
- if (s3 !== peg$FAILED) {
- s2 = [s2, s3];
- s1 = s2;
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- } else {
- peg$currPos = s1;
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- s0 = input.substring(s0, peg$currPos);
- } else {
- s0 = s1;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$parsechars();
- }
-
- return s0;
- }
-
- function peg$parseoptionalFormatPattern() {
- var s0, s1, s2, s3, s4, s5, s6, s7, s8;
-
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s2 = peg$parseselector();
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 123) {
- s4 = peg$c5;
- peg$currPos++;
- } else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c6); }
- }
- if (s4 !== peg$FAILED) {
- s5 = peg$parse_();
- if (s5 !== peg$FAILED) {
- s6 = peg$parsemessageFormatPattern();
- if (s6 !== peg$FAILED) {
- s7 = peg$parse_();
- if (s7 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s8 = peg$c9;
- peg$currPos++;
- } else {
- s8 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c10); }
- }
- if (s8 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c30(s2, s6);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parseoffset() {
- var s0, s1, s2, s3;
-
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 7) === peg$c31) {
- s1 = peg$c31;
- peg$currPos += 7;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c32); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parsenumber();
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c33(s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parsepluralStyle() {
- var s0, s1, s2, s3, s4;
-
- s0 = peg$currPos;
- s1 = peg$parseoffset();
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = [];
- s4 = peg$parseoptionalFormatPattern();
- if (s4 !== peg$FAILED) {
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- s4 = peg$parseoptionalFormatPattern();
- }
- } else {
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c34(s1, s3);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
-
- return s0;
- }
-
- function peg$parsews() {
- var s0, s1;
-
- peg$silentFails++;
- s0 = [];
- if (peg$c36.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c37); }
- }
- if (s1 !== peg$FAILED) {
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- if (peg$c36.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c37); }
- }
- }
- } else {
- s0 = peg$FAILED;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c35); }
- }
-
- return s0;
- }
-
- function peg$parse_() {
- var s0, s1, s2;
-
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parsews();
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parsews();
- }
- if (s1 !== peg$FAILED) {
- s0 = input.substring(s0, peg$currPos);
- } else {
- s0 = s1;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c38); }
- }
-
- return s0;
- }
-
- function peg$parsedigit() {
- var s0;
-
- if (peg$c39.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c40); }
- }
-
- return s0;
- }
-
- function peg$parsehexDigit() {
- var s0;
-
- if (peg$c41.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c42); }
- }
-
- return s0;
- }
-
- function peg$parsenumber() {
- var s0, s1, s2, s3, s4, s5;
-
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 48) {
- s1 = peg$c43;
- peg$currPos++;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c44); }
- }
- if (s1 === peg$FAILED) {
- s1 = peg$currPos;
- s2 = peg$currPos;
- if (peg$c45.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c46); }
- }
- if (s3 !== peg$FAILED) {
- s4 = [];
- s5 = peg$parsedigit();
- while (s5 !== peg$FAILED) {
- s4.push(s5);
- s5 = peg$parsedigit();
- }
- if (s4 !== peg$FAILED) {
- s3 = [s3, s4];
- s2 = s3;
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- } else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- s1 = input.substring(s1, peg$currPos);
- } else {
- s1 = s2;
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c47(s1);
- }
- s0 = s1;
-
- return s0;
- }
-
- function peg$parsechar() {
- var s0, s1, s2, s3, s4, s5, s6, s7;
-
- if (peg$c48.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- } else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c49); }
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c50) {
- s1 = peg$c50;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c51); }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c52();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c53) {
- s1 = peg$c53;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c54); }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c55();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c56) {
- s1 = peg$c56;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c57); }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c58();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c59) {
- s1 = peg$c59;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c60); }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c61();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c62) {
- s1 = peg$c62;
- peg$currPos += 2;
- } else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) { peg$fail(peg$c63); }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$currPos;
- s3 = peg$currPos;
- s4 = peg$parsehexDigit();
- if (s4 !== peg$FAILED) {
- s5 = peg$parsehexDigit();
- if (s5 !== peg$FAILED) {
- s6 = peg$parsehexDigit();
- if (s6 !== peg$FAILED) {
- s7 = peg$parsehexDigit();
- if (s7 !== peg$FAILED) {
- s4 = [s4, s5, s6, s7];
- s3 = s4;
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- } else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- s2 = input.substring(s2, peg$currPos);
- } else {
- s2 = s3;
- }
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c64(s2);
- s0 = s1;
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- } else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- }
- }
- }
- }
-
- return s0;
- }
-
- function peg$parsechars() {
- var s0, s1, s2;
-
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parsechar();
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parsechar();
- }
- } else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c65(s1);
- }
- s0 = s1;
-
- return s0;
- }
-
- peg$result = peg$startRuleFunction();
-
- if (peg$result !== peg$FAILED && peg$currPos === input.length) {
- return peg$result;
- } else {
- if (peg$result !== peg$FAILED && peg$currPos < input.length) {
- peg$fail({ type: "end", description: "end of input" });
- }
-
- throw peg$buildException(
- null,
- peg$maxFailExpected,
- peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
- peg$maxFailPos < input.length
- ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
- : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
- );
- }
- }
-
- return {
- SyntaxError: peg$SyntaxError,
- parse: peg$parse
- };
- })();
-
-
- });
-
- var intlMessageformatParser = styleInject_es.createCommonjsModule(function (module, exports) {
-
- exports = module.exports = parser['default'];
- exports['default'] = exports;
- });
-
- var core = styleInject_es.createCommonjsModule(function (module, exports) {
-
- exports["default"] = MessageFormat;
-
- // -- MessageFormat --------------------------------------------------------
-
- function MessageFormat(message, locales, formats) {
- // Parse string messages into an AST.
- var ast = typeof message === 'string' ?
- MessageFormat.__parse(message) : message;
-
- if (!(ast && ast.type === 'messageFormatPattern')) {
- throw new TypeError('A message must be provided as a String or AST.');
- }
-
- // Creates a new object with the specified `formats` merged with the default
- // formats.
- formats = this._mergeFormats(MessageFormat.formats, formats);
-
- // Defined first because it's used to build the format pattern.
- es5.defineProperty(this, '_locale', {value: this._resolveLocale(locales)});
-
- // Compile the `ast` to a pattern that is highly optimized for repeated
- // `format()` invocations. **Note:** This passes the `locales` set provided
- // to the constructor instead of just the resolved locale.
- var pluralFn = this._findPluralRuleFunction(this._locale);
- var pattern = this._compilePattern(ast, locales, formats, pluralFn);
-
- // "Bind" `format()` method to `this` so it can be passed by reference like
- // the other `Intl` APIs.
- var messageFormat = this;
- this.format = function (values) {
- try {
- return messageFormat._format(pattern, values);
- } catch (e) {
- if (e.variableId) {
- throw new Error(
- 'The intl string context variable \'' + e.variableId + '\'' +
- ' was not provided to the string \'' + message + '\''
- );
- } else {
- throw e;
- }
- }
- };
- }
-
- // Default format options used as the prototype of the `formats` provided to the
- // constructor. These are used when constructing the internal Intl.NumberFormat
- // and Intl.DateTimeFormat instances.
- es5.defineProperty(MessageFormat, 'formats', {
- enumerable: true,
-
- value: {
- number: {
- 'currency': {
- style: 'currency'
- },
-
- 'percent': {
- style: 'percent'
- }
- },
-
- date: {
- 'short': {
- month: 'numeric',
- day : 'numeric',
- year : '2-digit'
- },
-
- 'medium': {
- month: 'short',
- day : 'numeric',
- year : 'numeric'
- },
-
- 'long': {
- month: 'long',
- day : 'numeric',
- year : 'numeric'
- },
-
- 'full': {
- weekday: 'long',
- month : 'long',
- day : 'numeric',
- year : 'numeric'
- }
- },
-
- time: {
- 'short': {
- hour : 'numeric',
- minute: 'numeric'
- },
-
- 'medium': {
- hour : 'numeric',
- minute: 'numeric',
- second: 'numeric'
- },
-
- 'long': {
- hour : 'numeric',
- minute : 'numeric',
- second : 'numeric',
- timeZoneName: 'short'
- },
-
- 'full': {
- hour : 'numeric',
- minute : 'numeric',
- second : 'numeric',
- timeZoneName: 'short'
- }
- }
- }
- });
-
- // Define internal private properties for dealing with locale data.
- es5.defineProperty(MessageFormat, '__localeData__', {value: es5.objCreate(null)});
- es5.defineProperty(MessageFormat, '__addLocaleData', {value: function (data) {
- if (!(data && data.locale)) {
- throw new Error(
- 'Locale data provided to IntlMessageFormat is missing a ' +
- '`locale` property'
- );
- }
-
- MessageFormat.__localeData__[data.locale.toLowerCase()] = data;
- }});
-
- // Defines `__parse()` static method as an exposed private.
- es5.defineProperty(MessageFormat, '__parse', {value: intlMessageformatParser["default"].parse});
-
- // Define public `defaultLocale` property which defaults to English, but can be
- // set by the developer.
- es5.defineProperty(MessageFormat, 'defaultLocale', {
- enumerable: true,
- writable : true,
- value : undefined
- });
-
- MessageFormat.prototype.resolvedOptions = function () {
- // TODO: Provide anything else?
- return {
- locale: this._locale
- };
- };
-
- MessageFormat.prototype._compilePattern = function (ast, locales, formats, pluralFn) {
- var compiler$1 = new compiler["default"](locales, formats, pluralFn);
- return compiler$1.compile(ast);
- };
-
- MessageFormat.prototype._findPluralRuleFunction = function (locale) {
- var localeData = MessageFormat.__localeData__;
- var data = localeData[locale.toLowerCase()];
-
- // The locale data is de-duplicated, so we have to traverse the locale's
- // hierarchy until we find a `pluralRuleFunction` to return.
- while (data) {
- if (data.pluralRuleFunction) {
- return data.pluralRuleFunction;
- }
-
- data = data.parentLocale && localeData[data.parentLocale.toLowerCase()];
- }
-
- throw new Error(
- 'Locale data added to IntlMessageFormat is missing a ' +
- '`pluralRuleFunction` for :' + locale
- );
- };
-
- MessageFormat.prototype._format = function (pattern, values) {
- var result = '',
- i, len, part, id, value, err;
-
- for (i = 0, len = pattern.length; i < len; i += 1) {
- part = pattern[i];
-
- // Exist early for string parts.
- if (typeof part === 'string') {
- result += part;
- continue;
- }
-
- id = part.id;
-
- // Enforce that all required values are provided by the caller.
- if (!(values && utils.hop.call(values, id))) {
- err = new Error('A value must be provided for: ' + id);
- err.variableId = id;
- throw err;
- }
-
- value = values[id];
-
- // Recursively format plural and select parts' option — which can be a
- // nested pattern structure. The choosing of the option to use is
- // abstracted-by and delegated-to the part helper object.
- if (part.options) {
- result += this._format(part.getOption(value), values);
- } else {
- result += part.format(value);
- }
- }
-
- return result;
- };
-
- MessageFormat.prototype._mergeFormats = function (defaults, formats) {
- var mergedFormats = {},
- type, mergedType;
-
- for (type in defaults) {
- if (!utils.hop.call(defaults, type)) { continue; }
-
- mergedFormats[type] = mergedType = es5.objCreate(defaults[type]);
-
- if (formats && utils.hop.call(formats, type)) {
- utils.extend(mergedType, formats[type]);
- }
- }
-
- return mergedFormats;
- };
-
- MessageFormat.prototype._resolveLocale = function (locales) {
- if (typeof locales === 'string') {
- locales = [locales];
- }
-
- // Create a copy of the array so we can push on the default locale.
- locales = (locales || []).concat(MessageFormat.defaultLocale);
-
- var localeData = MessageFormat.__localeData__;
- var i, len, localeParts, data;
-
- // Using the set of locales + the default locale, we look for the first one
- // which that has been registered. When data does not exist for a locale, we
- // traverse its ancestors to find something that's been registered within
- // its hierarchy of locales. Since we lack the proper `parentLocale` data
- // here, we must take a naive approach to traversal.
- for (i = 0, len = locales.length; i < len; i += 1) {
- localeParts = locales[i].toLowerCase().split('-');
-
- while (localeParts.length) {
- data = localeData[localeParts.join('-')];
- if (data) {
- // Return the normalized locale string; e.g., we return "en-US",
- // instead of "en-us".
- return data.locale;
- }
-
- localeParts.pop();
- }
- }
-
- var defaultLocale = locales.pop();
- throw new Error(
- 'No locale data has been added to IntlMessageFormat for: ' +
- locales.join(', ') + ', or the default locale: ' + defaultLocale
- );
- };
-
-
- });
-
- var en = styleInject_es.createCommonjsModule(function (module, exports) {
- exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}};
-
-
- });
-
- var main = styleInject_es.createCommonjsModule(function (module, exports) {
-
-
- core["default"].__addLocaleData(en["default"]);
- core["default"].defaultLocale = 'en';
-
- exports["default"] = core["default"];
-
-
- });
-
- var _nodeResolve_empty = {};
-
- var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': _nodeResolve_empty
- });
-
- styleInject_es.getCjsExportFromNamespace(_nodeResolve_empty$1);
-
- var intlMessageformat = styleInject_es.createCommonjsModule(function (module, exports) {
-
- var IntlMessageFormat = main['default'];
-
- // Add all locale data to `IntlMessageFormat`. This module will be ignored when
- // bundling for the browser with Browserify/Webpack.
-
-
- // Re-export `IntlMessageFormat` as the CommonJS default exports with all the
- // locale data registered, and with English set as the default locale. Define
- // the `default` prop for use with other compiled ES6 Modules.
- exports = module.exports = IntlMessageFormat;
- exports['default'] = exports;
- });
-
- /**
- * lodash (Custom Build) <https://lodash.com/>
- * Build: `lodash modularize exports="npm" -o ./`
- * Copyright jQuery Foundation and other contributors <https://jquery.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
-
- /** Used as the `TypeError` message for "Functions" methods. */
- var FUNC_ERROR_TEXT = 'Expected a function';
-
- /** Used to stand-in for `undefined` hash values. */
- var HASH_UNDEFINED = '__lodash_hash_undefined__';
-
- /** Used as references for various `Number` constants. */
- var INFINITY = 1 / 0;
-
- /** `Object#toString` result references. */
- var funcTag = '[object Function]',
- genTag = '[object GeneratorFunction]',
- symbolTag = '[object Symbol]';
-
- /** Used to match property names within property paths. */
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
- reIsPlainProp = /^\w*$/,
- reLeadingDot = /^\./,
- rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
-
- /**
- * Used to match `RegExp`
- * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
- */
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
-
- /** Used to match backslashes in property paths. */
- var reEscapeChar = /\\(\\)?/g;
-
- /** Used to detect host constructors (Safari). */
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
-
- /** Detect free variable `global` from Node.js. */
- var freeGlobal = typeof styleInject_es.commonjsGlobal == 'object' && styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.Object === Object && styleInject_es.commonjsGlobal;
-
- /** Detect free variable `self`. */
- var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
-
- /** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
-
- /**
- * Gets the value at `key` of `object`.
- *
- * @private
- * @param {Object} [object] The object to query.
- * @param {string} key The key of the property to get.
- * @returns {*} Returns the property value.
- */
- function getValue(object, key) {
- return object == null ? undefined : object[key];
- }
-
- /**
- * Checks if `value` is a host object in IE < 9.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
- */
- function isHostObject(value) {
- // Many host objects are `Object` objects that can coerce to strings
- // despite having improperly defined `toString` methods.
- var result = false;
- if (value != null && typeof value.toString != 'function') {
- try {
- result = !!(value + '');
- } catch (e) {}
- }
- return result;
- }
-
- /** Used for built-in method references. */
- var arrayProto = Array.prototype,
- funcProto = Function.prototype,
- objectProto = Object.prototype;
-
- /** Used to detect overreaching core-js shims. */
- var coreJsData = root['__core-js_shared__'];
-
- /** Used to detect methods masquerading as native. */
- var maskSrcKey = (function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
- return uid ? ('Symbol(src)_1.' + uid) : '';
- }());
-
- /** Used to resolve the decompiled source of functions. */
- var funcToString = funcProto.toString;
-
- /** Used to check objects for own properties. */
- var hasOwnProperty = objectProto.hasOwnProperty;
-
- /**
- * Used to resolve the
- * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
- * of values.
- */
- var objectToString = objectProto.toString;
-
- /** Used to detect if a method is native. */
- var reIsNative = RegExp('^' +
- funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
- .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
- );
-
- /** Built-in value references. */
- var Symbol = root.Symbol,
- splice = arrayProto.splice;
-
- /* Built-in method references that are verified to be native. */
- var Map = getNative(root, 'Map'),
- nativeCreate = getNative(Object, 'create');
-
- /** Used to convert symbols to primitives and strings. */
- var symbolProto = Symbol ? Symbol.prototype : undefined,
- symbolToString = symbolProto ? symbolProto.toString : undefined;
-
- /**
- * Creates a hash object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function Hash(entries) {
- var index = -1,
- length = entries ? entries.length : 0;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the hash.
- *
- * @private
- * @name clear
- * @memberOf Hash
- */
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- }
-
- /**
- * Removes `key` and its value from the hash.
- *
- * @private
- * @name delete
- * @memberOf Hash
- * @param {Object} hash The hash to modify.
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function hashDelete(key) {
- return this.has(key) && delete this.__data__[key];
- }
-
- /**
- * Gets the hash value for `key`.
- *
- * @private
- * @name get
- * @memberOf Hash
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result = data[key];
- return result === HASH_UNDEFINED ? undefined : result;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined;
- }
-
- /**
- * Checks if a hash value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf Hash
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
- }
-
- /**
- * Sets the hash `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf Hash
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the hash instance.
- */
- function hashSet(key, value) {
- var data = this.__data__;
- data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
- return this;
- }
-
- // Add methods to `Hash`.
- Hash.prototype.clear = hashClear;
- Hash.prototype['delete'] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
-
- /**
- * Creates an list cache object.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function ListCache(entries) {
- var index = -1,
- length = entries ? entries.length : 0;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the list cache.
- *
- * @private
- * @name clear
- * @memberOf ListCache
- */
- function listCacheClear() {
- this.__data__ = [];
- }
-
- /**
- * Removes `key` and its value from the list cache.
- *
- * @private
- * @name delete
- * @memberOf ListCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function listCacheDelete(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- return true;
- }
-
- /**
- * Gets the list cache value for `key`.
- *
- * @private
- * @name get
- * @memberOf ListCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function listCacheGet(key) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- return index < 0 ? undefined : data[index][1];
- }
-
- /**
- * Checks if a list cache value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf ListCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
-
- /**
- * Sets the list cache `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf ListCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the list cache instance.
- */
- function listCacheSet(key, value) {
- var data = this.__data__,
- index = assocIndexOf(data, key);
-
- if (index < 0) {
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
-
- // Add methods to `ListCache`.
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype['delete'] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
-
- /**
- * Creates a map cache object to store key-value pairs.
- *
- * @private
- * @constructor
- * @param {Array} [entries] The key-value pairs to cache.
- */
- function MapCache(entries) {
- var index = -1,
- length = entries ? entries.length : 0;
-
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
-
- /**
- * Removes all key-value entries from the map.
- *
- * @private
- * @name clear
- * @memberOf MapCache
- */
- function mapCacheClear() {
- this.__data__ = {
- 'hash': new Hash,
- 'map': new (Map || ListCache),
- 'string': new Hash
- };
- }
-
- /**
- * Removes `key` and its value from the map.
- *
- * @private
- * @name delete
- * @memberOf MapCache
- * @param {string} key The key of the value to remove.
- * @returns {boolean} Returns `true` if the entry was removed, else `false`.
- */
- function mapCacheDelete(key) {
- return getMapData(this, key)['delete'](key);
- }
-
- /**
- * Gets the map value for `key`.
- *
- * @private
- * @name get
- * @memberOf MapCache
- * @param {string} key The key of the value to get.
- * @returns {*} Returns the entry value.
- */
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
-
- /**
- * Checks if a map value for `key` exists.
- *
- * @private
- * @name has
- * @memberOf MapCache
- * @param {string} key The key of the entry to check.
- * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
- */
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
-
- /**
- * Sets the map `key` to `value`.
- *
- * @private
- * @name set
- * @memberOf MapCache
- * @param {string} key The key of the value to set.
- * @param {*} value The value to set.
- * @returns {Object} Returns the map cache instance.
- */
- function mapCacheSet(key, value) {
- getMapData(this, key).set(key, value);
- return this;
- }
-
- // Add methods to `MapCache`.
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype['delete'] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
-
- /**
- * Gets the index at which the `key` is found in `array` of key-value pairs.
- *
- * @private
- * @param {Array} array The array to inspect.
- * @param {*} key The key to search for.
- * @returns {number} Returns the index of the matched value, else `-1`.
- */
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
-
- /**
- * The base implementation of `_.get` without support for default values.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @returns {*} Returns the resolved value.
- */
- function baseGet(object, path) {
- path = isKey(path, object) ? [path] : castPath(path);
-
- var index = 0,
- length = path.length;
-
- while (object != null && index < length) {
- object = object[toKey(path[index++])];
- }
- return (index && index == length) ? object : undefined;
- }
-
- /**
- * The base implementation of `_.isNative` without bad shim checks.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a native function,
- * else `false`.
- */
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
-
- /**
- * The base implementation of `_.toString` which doesn't convert nullish
- * values to empty strings.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
- function baseToString(value) {
- // Exit early for strings to avoid a performance hit in some environments.
- if (typeof value == 'string') {
- return value;
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : '';
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * Casts `value` to a path array if it's not one.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {Array} Returns the cast property path array.
- */
- function castPath(value) {
- return isArray(value) ? value : stringToPath(value);
- }
-
- /**
- * Gets the data for `map`.
- *
- * @private
- * @param {Object} map The map to query.
- * @param {string} key The reference key.
- * @returns {*} Returns the map data.
- */
- function getMapData(map, key) {
- var data = map.__data__;
- return isKeyable(key)
- ? data[typeof key == 'string' ? 'string' : 'hash']
- : data.map;
- }
-
- /**
- * Gets the native function at `key` of `object`.
- *
- * @private
- * @param {Object} object The object to query.
- * @param {string} key The key of the method to get.
- * @returns {*} Returns the function if it's native, else `undefined`.
- */
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined;
- }
-
- /**
- * Checks if `value` is a property name and not a property path.
- *
- * @private
- * @param {*} value The value to check.
- * @param {Object} [object] The object to query keys on.
- * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
- */
- function isKey(value, object) {
- if (isArray(value)) {
- return false;
- }
- var type = typeof value;
- if (type == 'number' || type == 'symbol' || type == 'boolean' ||
- value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
- (object != null && value in Object(object));
- }
-
- /**
- * Checks if `value` is suitable for use as unique object key.
- *
- * @private
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
- */
- function isKeyable(value) {
- var type = typeof value;
- return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
- ? (value !== '__proto__')
- : (value === null);
- }
-
- /**
- * Checks if `func` has its source masked.
- *
- * @private
- * @param {Function} func The function to check.
- * @returns {boolean} Returns `true` if `func` is masked, else `false`.
- */
- function isMasked(func) {
- return !!maskSrcKey && (maskSrcKey in func);
- }
-
- /**
- * Converts `string` to a property path array.
- *
- * @private
- * @param {string} string The string to convert.
- * @returns {Array} Returns the property path array.
- */
- var stringToPath = memoize(function(string) {
- string = toString(string);
-
- var result = [];
- if (reLeadingDot.test(string)) {
- result.push('');
- }
- string.replace(rePropName, function(match, number, quote, string) {
- result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
- });
- return result;
- });
-
- /**
- * Converts `value` to a string key if it's not a string or symbol.
- *
- * @private
- * @param {*} value The value to inspect.
- * @returns {string|symbol} Returns the key.
- */
- function toKey(value) {
- if (typeof value == 'string' || isSymbol(value)) {
- return value;
- }
- var result = (value + '');
- return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
- }
-
- /**
- * Converts `func` to its source code.
- *
- * @private
- * @param {Function} func The function to process.
- * @returns {string} Returns the source code.
- */
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {}
- try {
- return (func + '');
- } catch (e) {}
- }
- return '';
- }
-
- /**
- * Creates a function that memoizes the result of `func`. If `resolver` is
- * provided, it determines the cache key for storing the result based on the
- * arguments provided to the memoized function. By default, the first argument
- * provided to the memoized function is used as the map cache key. The `func`
- * is invoked with the `this` binding of the memoized function.
- *
- * **Note:** The cache is exposed as the `cache` property on the memoized
- * function. Its creation may be customized by replacing the `_.memoize.Cache`
- * constructor with one whose instances implement the
- * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
- * method interface of `delete`, `get`, `has`, and `set`.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Function
- * @param {Function} func The function to have its output memoized.
- * @param {Function} [resolver] The function to resolve the cache key.
- * @returns {Function} Returns the new memoized function.
- * @example
- *
- * var object = { 'a': 1, 'b': 2 };
- * var other = { 'c': 3, 'd': 4 };
- *
- * var values = _.memoize(_.values);
- * values(object);
- * // => [1, 2]
- *
- * values(other);
- * // => [3, 4]
- *
- * object.a = 2;
- * values(object);
- * // => [1, 2]
- *
- * // Modify the result cache.
- * values.cache.set(object, ['a', 'b']);
- * values(object);
- * // => ['a', 'b']
- *
- * // Replace `_.memoize.Cache`.
- * _.memoize.Cache = WeakMap;
- */
- function memoize(func, resolver) {
- if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
- throw new TypeError(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments,
- key = resolver ? resolver.apply(this, args) : args[0],
- cache = memoized.cache;
-
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result = func.apply(this, args);
- memoized.cache = cache.set(key, result);
- return result;
- };
- memoized.cache = new (memoize.Cache || MapCache);
- return memoized;
- }
-
- // Assign cache to `_.memoize`.
- memoize.Cache = MapCache;
-
- /**
- * Performs a
- * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
- * comparison between two values to determine if they are equivalent.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to compare.
- * @param {*} other The other value to compare.
- * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
- * @example
- *
- * var object = { 'a': 1 };
- * var other = { 'a': 1 };
- *
- * _.eq(object, object);
- * // => true
- *
- * _.eq(object, other);
- * // => false
- *
- * _.eq('a', 'a');
- * // => true
- *
- * _.eq('a', Object('a'));
- * // => false
- *
- * _.eq(NaN, NaN);
- * // => true
- */
- function eq(value, other) {
- return value === other || (value !== value && other !== other);
- }
-
- /**
- * Checks if `value` is classified as an `Array` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an array, else `false`.
- * @example
- *
- * _.isArray([1, 2, 3]);
- * // => true
- *
- * _.isArray(document.body.children);
- * // => false
- *
- * _.isArray('abc');
- * // => false
- *
- * _.isArray(_.noop);
- * // => false
- */
- var isArray = Array.isArray;
-
- /**
- * Checks if `value` is classified as a `Function` object.
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a function, else `false`.
- * @example
- *
- * _.isFunction(_);
- * // => true
- *
- * _.isFunction(/abc/);
- * // => false
- */
- function isFunction(value) {
- // The use of `Object#toString` avoids issues with the `typeof` operator
- // in Safari 8-9 which returns 'object' for typed array and other constructors.
- var tag = isObject(value) ? objectToString.call(value) : '';
- return tag == funcTag || tag == genTag;
- }
-
- /**
- * Checks if `value` is the
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
- *
- * @static
- * @memberOf _
- * @since 0.1.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
- * @example
- *
- * _.isObject({});
- * // => true
- *
- * _.isObject([1, 2, 3]);
- * // => true
- *
- * _.isObject(_.noop);
- * // => true
- *
- * _.isObject(null);
- * // => false
- */
- function isObject(value) {
- var type = typeof value;
- return !!value && (type == 'object' || type == 'function');
- }
-
- /**
- * Checks if `value` is object-like. A value is object-like if it's not `null`
- * and has a `typeof` result of "object".
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
- * @example
- *
- * _.isObjectLike({});
- * // => true
- *
- * _.isObjectLike([1, 2, 3]);
- * // => true
- *
- * _.isObjectLike(_.noop);
- * // => false
- *
- * _.isObjectLike(null);
- * // => false
- */
- function isObjectLike(value) {
- return !!value && typeof value == 'object';
- }
-
- /**
- * Checks if `value` is classified as a `Symbol` primitive or object.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to check.
- * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
- * @example
- *
- * _.isSymbol(Symbol.iterator);
- * // => true
- *
- * _.isSymbol('abc');
- * // => false
- */
- function isSymbol(value) {
- return typeof value == 'symbol' ||
- (isObjectLike(value) && objectToString.call(value) == symbolTag);
- }
-
- /**
- * Converts `value` to a string. An empty string is returned for `null`
- * and `undefined` values. The sign of `-0` is preserved.
- *
- * @static
- * @memberOf _
- * @since 4.0.0
- * @category Lang
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- * @example
- *
- * _.toString(null);
- * // => ''
- *
- * _.toString(-0);
- * // => '-0'
- *
- * _.toString([1, 2, 3]);
- * // => '1,2,3'
- */
- function toString(value) {
- return value == null ? '' : baseToString(value);
- }
-
- /**
- * Gets the value at `path` of `object`. If the resolved value is
- * `undefined`, the `defaultValue` is returned in its place.
- *
- * @static
- * @memberOf _
- * @since 3.7.0
- * @category Object
- * @param {Object} object The object to query.
- * @param {Array|string} path The path of the property to get.
- * @param {*} [defaultValue] The value returned for `undefined` resolved values.
- * @returns {*} Returns the resolved value.
- * @example
- *
- * var object = { 'a': [{ 'b': { 'c': 3 } }] };
- *
- * _.get(object, 'a[0].b.c');
- * // => 3
- *
- * _.get(object, ['a', '0', 'b', 'c']);
- * // => 3
- *
- * _.get(object, 'a.b.c', 'default');
- * // => 'default'
- */
- function get(object, path, defaultValue) {
- var result = object == null ? undefined : baseGet(object, path);
- return result === undefined ? defaultValue : result;
- }
-
- var lodash_get = get;
-
- var Observer_1 = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
- var Observer = function (obj) {
- Object.keys(obj.__data__ || obj).forEach(function (key) {
- defineReactive(obj, key);
- });
- return obj;
- };
- var observe = function (value) {
- if (!value || typeof value !== 'object') {
- return;
- }
- Observer(value);
- };
- var defineReactive = function (obj, key) {
- var childObj = observe(obj[key]);
- Object.defineProperty(obj, key, {
- get: function () {
- if (obj.__data__[key]) {
- return obj.__data__[key];
- }
- else if (obj.__metas__['zh-CN'][key]) {
- return obj.__metas__['zh-CN'][key];
- }
- },
- set: function (newVal) {
- if (obj[key] === newVal) {
- return;
- }
- obj[key] = newVal;
- var cb = obj.callback[key];
- cb.call(obj);
- childObj = observe(newVal);
- }
- });
- };
- exports.default = Observer;
-
- });
-
- styleInject_es.unwrapExports(Observer_1);
-
- var src = styleInject_es.createCommonjsModule(function (module, exports) {
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
- var I18N = (function () {
- function I18N(lang, metas) {
- this.__lang__ = lang;
- this.__metas__ = metas;
- this.__data__ = metas[lang];
- }
- I18N.prototype.setLang = function (lang) {
- this.__lang__ = lang;
- this.__data__ = this.__metas__[lang];
- };
- I18N.prototype.getProp = function (obj, is, value) {
- if (typeof is === 'string') {
- is = is.split('.');
- }
- if (is.length === 1 && value !== undefined) {
- return (obj[is[0]] = value);
- }
- else if (is.length === 0) {
- return obj;
- }
- else {
- var prop = is.shift();
- if (value !== undefined && obj[prop] === undefined) {
- obj[prop] = {};
- }
- return this.getProp(obj[prop], is, value);
- }
- };
- I18N.prototype.template = function (str, args) {
- var _this = this;
- if (!str) {
- return '';
- }
- return str.replace(/\{(.+?)\}/g, function (match, p1) {
- return _this.getProp(__assign({}, _this.__data__, args), p1);
- });
- };
- I18N.prototype.get = function (str, args) {
- var msg = lodash_get(this.__data__, str);
- if (!msg) {
- msg = lodash_get(this.__metas__['zh-CN'], str, str);
- }
- if (args) {
- try {
- msg = new intlMessageformat.default(msg, this.__lang__);
- msg = msg.format(args);
- return msg;
- }
- catch (err) {
- console.warn("kiwi-intl format message failed for key='" + str + "'", err);
- return '';
- }
- }
- else {
- return msg;
- }
- };
- return I18N;
- }());
- var IntlFormat = {
- init: function (lang, metas) {
- var i18n = new I18N(lang, metas);
- return Observer_1.default(i18n);
- }
- };
- exports.IntlFormat = IntlFormat;
- exports.default = IntlFormat;
-
- });
-
- var KiwiIntl = styleInject_es.unwrapExports(src);
- var src_1 = src.IntlFormat;
-
- var priceOptions = {
- "index": {
- "others": "Others"
- }
- };
-
- var payplatformoption = {
- "platform": "支付平台"
- };
-
- var enUsLangs = Object.assign({}, {
- priceOptions: priceOptions,
- payplatformoption: payplatformoption
- });
-
- var priceOptions$1 = {
- index: {
- others: '其他金额'
- }
- };
-
- var payplatformoption$1 = {
- platform: '支付平台'
- };
-
- var zhCNLangs = Object.assign({}, {
- priceOptions: priceOptions$1,
- payplatformoption: payplatformoption$1
- });
-
- // type TransmitImgTxtData = {
- // user_id?: string|number;
- // anonymity?: boolean;
- // avatar?: string;
- // nickname?: string;
- // is_long?: boolean;
- // }
- // interface TransmitCardProps {
- // type: TransmitType;
- // data: TransmitImgTxtData;
- // }
- // export class TransmitCard extends React.PureComponent<TransmitCardProps, {}> {
- // renderVideo() {
- // return <div className={styles.transmitVideoCard}>Video</div>;
- // }
- // renderImgTxt() {
- // const { data } = this.props;
- // const {
- // user_id,
- // anonymity,
- // avatar,
- // nickname,
- // is_long,
- // } = data;
- // return (
- // <div className={styles.transmitImgTxtCard}>
- // <div className={styles.header}>
- // <UserLink user_id={user_id} anonymity={anonymity}>
- // <Avatar
- // id={user_id}
- // image={avatar}
- // follow={false}
- // size="cover"
- // className={styles.ava}
- // anonymity={anonymity}
- // />
- // </UserLink>
- // <div className={styles.nickname}>
- // <UserLink user_id={user_id} anonymity={anonymity}>
- // {nickname}
- // </UserLink>
- // </div>
- // <div className={styles.type}>
- // {is_long
- // ? intl.get('bilingually.imgtxt.article')
- // : intl.get('bilingually.imgtxt')}
- // </div>
- // </div>
- // </div>
- // );
- // }
- // render() {
- // const { type } = this.props;
- // if (type === 'imgTxt') {
- // this.renderImgTxt();
- // }
- // if (type === 'shortVideo' || type === 'microVideo') {
- // this.renderVideo();
- // }
- // return null;
- // }
- // }
-
- var Test = "TestComponent";
-
- var langs = {
- 'en_US': enUsLangs,
- 'zh_CN': zhCNLangs
- };
- var kiwiIntl = KiwiIntl.init('en_US', langs);
-
- exports.ConsumeListView = index.ConsumeListView;
- exports.PayPlatformOptions = index.PayPlatformOptions;
- exports.PriceOptions = index.PriceOptions;
- exports.WaitPayInfoView = index.WaitPayInfoView;
- exports.Test = Test;
- exports.kiwiIntl = kiwiIntl;
- //# sourceMappingURL=index.js.map
|