1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773 |
- 'use strict';
-
- function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
-
- var styleInject_es = require('./style-inject.es-c386372b.js');
- var React = require('react');
- var React__default = _interopDefault(React);
- require('antd/es/input/style');
- var _Input = _interopDefault(require('antd/es/input'));
- require('antd/es/button/style');
- var _Button = _interopDefault(require('antd/es/button'));
-
- var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
- var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
- var IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';
- function addImageProcess(url) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
- width: '36px',
- height: '36px'
- };
-
- // 防止重复添加导致的url不正确
- if (url && url.indexOf('x-oss-process') > -1) {
- return url;
- }
-
- if (options.small) {
- return url + IMAGE_PROCESS_SMALL;
- }
-
- if (options.large) {
- return url + IMAGE_PROCESS_LARGE;
- }
-
- if (options.custom) {
- return "".concat(url, "?x-oss-process=image/resize,limit_0,m_fill,w_").concat(options.width, ",h_").concat(options.height);
- }
-
- return url + IMAGE_PROCESS;
- }
- function formatMoney(input) {
- var fuzz = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
-
- if (isNaN(+input)) {
- return input;
- }
-
- return (+input).toFixed(fuzz);
- }
-
- const img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAABvklEQVQ4T62UTygEcRTHv29MIsqfk6OL5CYH5aKd9WfjwqxEnBzExYWTCEWJJGove5H8OTA1uwdCrOWAi83ZwUXJiSj5u+Z5s0msmd2SX81h+r33ee/7fW+G8E+H/srhqEcFCjphve1RzcaVK4j3mmoB5YxqQzdOxTji1wE2QZglb2jAEcT7/g4wr0rQugS1OYJ26nOg5nYDr4ZrR7yrl0FBAKBlqjEX3eRLwSXAmidvOJbSI47oF9LVKaCOkNc4/w7kSPOoFBqDwjpp4XA60LUkF8nzbsuERQt4ejtGdsYwiAYTYIV6STOD6UB3EpqXJC0u7zKxz0Mk3Zrj7lOLerJg5T9K+2lWhALiYx8xS9NbDZnUuPXy0wN/hYw3lnbPiNfE7HaSfTAloRqKWkya8WAnMrdmIBqfBqM/BehJAo+gKHMibdMGzUhqKUiZAHGVXJYLwPdpshPnRDRM4fl5+7uKL/0c1WXdOSie5Dh3wZcyoR7SQttO9z+M5MOWEsStFQmsTAoOwVK7qM64d5P6ayKJj9EqHBa5Q4kx2/ujqR1Exnsq493HH2muFN98oNtJ0g7s3Ul5/vwbSab+G+gDqFybE11pYkYAAAAASUVORK5CYII=';
-
- var css = ".ConsumeListView_wrapper__la1cB {\n display: flex;\n justify-content: center;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b {\n padding: 0;\n margin: 0;\n display: flex;\n flex-wrap: wrap;\n padding-top: 10px;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b li {\n list-style: none;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc {\n margin: 0 6px 10px;\n text-align: center;\n position: relative;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc .ConsumeListView_kingdomIcon__YPzT9 {\n position: absolute;\n width: 24px;\n height: 22px;\n left: -6px;\n top: -12px;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc .ConsumeListView_avatar__AXZJE {\n margin: 0 auto 4px;\n width: 36px;\n height: 36px;\n background-size: cover;\n border-radius: 50%;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc .ConsumeListView_gray__3h-Ue {\n color: #9b9b9b;\n font-size: 12px;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_toggle__31sUD {\n margin: 0 6px 10px;\n width: 36px;\n height: 36px;\n line-height: 36px;\n background-color: #ececec;\n border-radius: 50%;\n color: #a8adb6;\n cursor: pointer;\n background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACv0lEQVRIS8WXTW8SURSGzzAYNSYCA7SCUEqBioLtohvjD9CN7ozG36AmXfsRafxYN9b+BqNx50r3GjddqEVRRgSRVr4GWmOsERjfOwEzVYa5lAokEwJzznnOe865d+4IxPFRVXVPrVY73Wq1TgmCMIffYbjZ2q4b+E/GfysWi+WZw+F4it+/zMIKvQwAszcajXnYXEIwl1kwdh8JVPC1bLVaF5FE3cjHEFytVs8hyH04jvMAu9gUkexlp9P5uJv/P2DABCi9hbJehUPPinAkpKL8d6H8BpJQ9fbbAjOooigP8H2BIyi3CaAPJUm6qIdvAwN6G0qvcUfswxDK7wB+vePyB9zu6aNdKK9ROioUn+/0XAOz6W02m6kBBolXe1EUxSibdg0MtQn09Sav9yB2UL0A1QmBbQ6VSmWNd50OAu2sc5fL5WVTfAYD9WTQgP34Y9DOClB7D05X+nHcBdslAf19jnKfNAr2cmWVDuzfR7HoFCFTUyaqR8lUhr7/2KITc/Gu9mjrC6a4iLtjRhHfvv9Ea1/L5JLsNBML94Qz6OukTBWlTt5Dbjp2JGgUtsTAW7i713DxqSql0jkqrJfIKdloNhbpCmfQV8k0VZUNOuwZo2gkQFBmFPanKVibRFxpOUefC0VyOmw0E4+QqCt7s8mgH0ipbdKEb5wiIUB7N0UD9yy13l/O5CmbXyfJfpBm49MkihbSoKuA1jdpcsJD4aDfdA5gUDIdrr+jZLIFyuQK5AD8+NEQvXknU63+jUKTPgoGvDxQ1gJtuPpeTkw1U8+mnPU2MuWngN/DBW0bLe14A8mj3x+zX7TS+ryGi6JrMtoGMrItk6VULpcTqPtQHhIQuuB2uxOjfSwy1SM5CHQmYCRHn/azcjSHvQ586Mdb/aIb+oFeD2eHQOxM87j6eoXBBrGMa2evMPoE/sdL22+mI4T0ou1LqAAAAABJRU5ErkJggg==);\n background-position: center;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_toggle__31sUD.ConsumeListView_expand__XSb0z {\n transform: rotate(180deg);\n}\n";
- var styles = {"wrapper":"ConsumeListView_wrapper__la1cB","consumelist":"ConsumeListView_consumelist__sAA2b","consumeItem":"ConsumeListView_consumeItem__2M0dc","kingdomIcon":"ConsumeListView_kingdomIcon__YPzT9","avatar":"ConsumeListView_avatar__AXZJE","gray":"ConsumeListView_gray__3h-Ue","toggle":"ConsumeListView_toggle__31sUD","expand":"ConsumeListView_expand__XSb0z"};
- styleInject_es.styleInject(css);
-
- var DEFAULT_AVATAR = '//links-comment.oss-cn-beijing.aliyuncs.com/comment/20180820/Kgka4_oU1.jpeg';
-
- var ConsumeListView =
- /*#__PURE__*/
- function (_Component) {
- styleInject_es._inherits(ConsumeListView, _Component);
-
- function ConsumeListView() {
- styleInject_es._classCallCheck(this, ConsumeListView);
-
- return styleInject_es._possibleConstructorReturn(this, styleInject_es._getPrototypeOf(ConsumeListView).apply(this, arguments));
- }
-
- styleInject_es._createClass(ConsumeListView, [{
- key: "renderConsumeItem",
- value: function renderConsumeItem() {
- var _this$props = this.props,
- dataSource = _this$props.dataSource,
- isToggle = _this$props.isToggle,
- showLength = _this$props.showLength,
- listLength = _this$props.listLength,
- options = _this$props.options;
- var kingdomWidth = options.kingdomWidth,
- kingdomHeight = options.kingdomHeight,
- kingdomPosition = options.kingdomPosition,
- avatarSize = options.avatarSize,
- avatarMarginLeftAndRight = options.avatarMarginLeftAndRight;
- var renderData = dataSource;
-
- if (!isToggle && listLength > showLength) {
- renderData = dataSource.slice(0, showLength - 1);
- }
-
- return renderData.map(function (v, i) {
- var kingdom = null;
-
- if (i === 0) {
- kingdom = React__default.createElement("img", {
- className: styles.kingdomIcon,
- src: img,
- alt: "reward top user",
- style: {
- width: "".concat(kingdomWidth, "px"),
- height: "".concat(kingdomHeight, "px"),
- left: "".concat(kingdomPosition[0], "px"),
- top: "".concat(kingdomPosition[1], "px")
- }
- });
- }
-
- return React__default.createElement("li", {
- key: v.id,
- className: styles.consumeItem,
- style: {
- margin: "0 ".concat(avatarMarginLeftAndRight, "px 10px")
- }
- }, kingdom, React__default.createElement("div", {
- className: styles.avatar,
- style: {
- backgroundImage: "url(".concat(addImageProcess(v.user_avatar || DEFAULT_AVATAR, {
- small: true
- }), ")"),
- width: "".concat(avatarSize, "px"),
- height: "".concat(avatarSize, "px")
- }
- }), React__default.createElement("span", {
- className: styles.gray
- }));
- });
- }
- }, {
- key: "renderToggleButton",
- value: function renderToggleButton() {
- var _this$props2 = this.props,
- isToggle = _this$props2.isToggle,
- onToggleChange = _this$props2.onToggleChange,
- listLength = _this$props2.listLength,
- showLength = _this$props2.showLength,
- options = _this$props2.options;
- var avatarSize = options.avatarSize,
- avatarMarginLeftAndRight = options.avatarMarginLeftAndRight;
-
- if (listLength <= showLength) {
- return null;
- }
-
- return React__default.createElement("li", {
- onClick: function onClick() {
- return onToggleChange();
- },
- className: styleInject_es.classnames(styles.toggle, styleInject_es._defineProperty({}, styles.expand, isToggle)),
- style: {
- width: "".concat(avatarSize, "px"),
- height: "".concat(avatarSize, "px"),
- lineHeight: "".concat(avatarSize, "px"),
- margin: "0 ".concat(avatarMarginLeftAndRight, "px 10px")
- }
- });
- }
- }, {
- key: "render",
- value: function render() {
- var _this$props3 = this.props,
- showLength = _this$props3.showLength,
- options = _this$props3.options;
- var avatarSize = options.avatarSize,
- avatarMarginLeftAndRight = options.avatarMarginLeftAndRight;
- return React__default.createElement("div", {
- className: styles.wrapper
- }, React__default.createElement("ul", {
- className: styles.consumelist,
- style: {
- width: "calc(".concat(avatarMarginLeftAndRight * 2 + avatarSize, "px * ").concat(showLength, ")")
- }
- }, this.renderConsumeItem(), this.renderToggleButton()));
- }
- }]);
-
- return ConsumeListView;
- }(React.Component);
-
- styleInject_es._defineProperty(ConsumeListView, "defaultProps", {
- isToggle: false,
- onToggleChange: function onToggleChange() {},
- dataSource: [],
- listLength: 0,
- showLength: 6,
- options: {
- avatarSize: 36,
- avatarMarginLeftAndRight: 6,
- kingdomWidth: 24,
- kingdomHeight: 22,
- kingdomPosition: [-6, -12]
- }
- });
-
- var dist = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
- function _(msg) {
- return msg;
- }
- exports._ = _;
- function defineMessages(msgs) {
- return msgs;
- }
- exports.defineMessages = defineMessages;
-
- });
-
- styleInject_es.unwrapExports(dist);
- var dist_1 = dist._;
- var dist_2 = dist.defineMessages;
-
- var types = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
- var TYPE;
- (function (TYPE) {
- /**
- * Raw text
- */
- TYPE[TYPE["literal"] = 0] = "literal";
- /**
- * Variable w/o any format, e.g `var` in `this is a {var}`
- */
- TYPE[TYPE["argument"] = 1] = "argument";
- /**
- * Variable w/ number format
- */
- TYPE[TYPE["number"] = 2] = "number";
- /**
- * Variable w/ date format
- */
- TYPE[TYPE["date"] = 3] = "date";
- /**
- * Variable w/ time format
- */
- TYPE[TYPE["time"] = 4] = "time";
- /**
- * Variable w/ select format
- */
- TYPE[TYPE["select"] = 5] = "select";
- /**
- * Variable w/ plural format
- */
- TYPE[TYPE["plural"] = 6] = "plural";
- })(TYPE = exports.TYPE || (exports.TYPE = {}));
- /**
- * Type Guards
- */
- function isLiteralElement(el) {
- return el.type === TYPE.literal;
- }
- exports.isLiteralElement = isLiteralElement;
- function isArgumentElement(el) {
- return el.type === TYPE.argument;
- }
- exports.isArgumentElement = isArgumentElement;
- function isNumberElement(el) {
- return el.type === TYPE.number;
- }
- exports.isNumberElement = isNumberElement;
- function isDateElement(el) {
- return el.type === TYPE.date;
- }
- exports.isDateElement = isDateElement;
- function isTimeElement(el) {
- return el.type === TYPE.time;
- }
- exports.isTimeElement = isTimeElement;
- function isSelectElement(el) {
- return el.type === TYPE.select;
- }
- exports.isSelectElement = isSelectElement;
- function isPluralElement(el) {
- return el.type === TYPE.plural;
- }
- exports.isPluralElement = isPluralElement;
- function isNumberSkeleton(el) {
- return !!(el && typeof el === 'object' && el.type === 0 /* number */);
- }
- exports.isNumberSkeleton = isNumberSkeleton;
- function isDateTimeSkeleton(el) {
- return !!(el && typeof el === 'object' && el.type === 1 /* dateTime */);
- }
- exports.isDateTimeSkeleton = isDateTimeSkeleton;
- function createLiteralElement(value) {
- return {
- type: TYPE.literal,
- value: value,
- };
- }
- exports.createLiteralElement = createLiteralElement;
- function createNumberElement(value, style) {
- return {
- type: TYPE.number,
- value: value,
- style: style,
- };
- }
- exports.createNumberElement = createNumberElement;
- });
-
- styleInject_es.unwrapExports(types);
- var types_1 = types.TYPE;
- var types_2 = types.isLiteralElement;
- var types_3 = types.isArgumentElement;
- var types_4 = types.isNumberElement;
- var types_5 = types.isDateElement;
- var types_6 = types.isTimeElement;
- var types_7 = types.isSelectElement;
- var types_8 = types.isPluralElement;
- var types_9 = types.isNumberSkeleton;
- var types_10 = types.isDateTimeSkeleton;
- var types_11 = types.createLiteralElement;
- var types_12 = types.createNumberElement;
-
- var parser = styleInject_es.createCommonjsModule(function (module, exports) {
- // tslint:disable:only-arrow-functions
- // tslint:disable:object-literal-shorthand
- // tslint:disable:trailing-comma
- // tslint:disable:object-literal-sort-keys
- // tslint:disable:one-variable-per-declaration
- // tslint:disable:max-line-length
- // tslint:disable:no-consecutive-blank-lines
- // tslint:disable:align
- var __extends = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- // Generated by PEG.js v. 0.10.0 (ts-pegjs plugin v. 0.2.6 )
- //
- // https://pegjs.org/ https://github.com/metadevpro/ts-pegjs
-
- var SyntaxError = /** @class */ (function (_super) {
- __extends(SyntaxError, _super);
- function SyntaxError(message, expected, found, location) {
- var _this = _super.call(this) || this;
- _this.message = message;
- _this.expected = expected;
- _this.found = found;
- _this.location = location;
- _this.name = "SyntaxError";
- if (typeof Error.captureStackTrace === "function") {
- Error.captureStackTrace(_this, SyntaxError);
- }
- return _this;
- }
- SyntaxError.buildMessage = function (expected, found) {
- function hex(ch) {
- return ch.charCodeAt(0).toString(16).toUpperCase();
- }
- function literalEscape(s) {
- return s
- .replace(/\\/g, "\\\\")
- .replace(/"/g, "\\\"")
- .replace(/\0/g, "\\0")
- .replace(/\t/g, "\\t")
- .replace(/\n/g, "\\n")
- .replace(/\r/g, "\\r")
- .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
- }
- function classEscape(s) {
- return s
- .replace(/\\/g, "\\\\")
- .replace(/\]/g, "\\]")
- .replace(/\^/g, "\\^")
- .replace(/-/g, "\\-")
- .replace(/\0/g, "\\0")
- .replace(/\t/g, "\\t")
- .replace(/\n/g, "\\n")
- .replace(/\r/g, "\\r")
- .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
- .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
- }
- function describeExpectation(expectation) {
- switch (expectation.type) {
- case "literal":
- return "\"" + literalEscape(expectation.text) + "\"";
- case "class":
- var escapedParts = expectation.parts.map(function (part) {
- return Array.isArray(part)
- ? classEscape(part[0]) + "-" + classEscape(part[1])
- : classEscape(part);
- });
- return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
- case "any":
- return "any character";
- case "end":
- return "end of input";
- case "other":
- return expectation.description;
- }
- }
- function describeExpected(expected1) {
- var descriptions = expected1.map(describeExpectation);
- var i;
- var j;
- descriptions.sort();
- if (descriptions.length > 0) {
- for (i = 1, j = 1; i < descriptions.length; i++) {
- if (descriptions[i - 1] !== descriptions[i]) {
- descriptions[j] = descriptions[i];
- j++;
- }
- }
- descriptions.length = j;
- }
- switch (descriptions.length) {
- case 1:
- return descriptions[0];
- case 2:
- return descriptions[0] + " or " + descriptions[1];
- default:
- return descriptions.slice(0, -1).join(", ")
- + ", or "
- + descriptions[descriptions.length - 1];
- }
- }
- function describeFound(found1) {
- return found1 ? "\"" + literalEscape(found1) + "\"" : "end of input";
- }
- return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
- };
- return SyntaxError;
- }(Error));
- exports.SyntaxError = SyntaxError;
- function peg$parse(input, options) {
- options = options !== undefined ? options : {};
- var peg$FAILED = {};
- var peg$startRuleFunctions = { start: peg$parsestart };
- var peg$startRuleFunction = peg$parsestart;
- var peg$c0 = function (parts) {
- return parts.join('');
- };
- var peg$c1 = function (messageText) {
- return __assign({ type: types.TYPE.literal, value: messageText }, insertLocation());
- };
- var peg$c2 = peg$otherExpectation("argumentElement");
- var peg$c3 = "{";
- var peg$c4 = peg$literalExpectation("{", false);
- var peg$c5 = "}";
- var peg$c6 = peg$literalExpectation("}", false);
- var peg$c7 = function (value) {
- return __assign({ type: types.TYPE.argument, value: value }, insertLocation());
- };
- var peg$c8 = peg$otherExpectation("numberSkeletonId");
- var peg$c9 = /^['\/{}]/;
- var peg$c10 = peg$classExpectation(["'", "/", "{", "}"], false, false);
- var peg$c11 = peg$anyExpectation();
- var peg$c12 = peg$otherExpectation("numberSkeletonTokenOption");
- var peg$c13 = "/";
- var peg$c14 = peg$literalExpectation("/", false);
- var peg$c15 = function (option) { return option; };
- var peg$c16 = peg$otherExpectation("numberSkeletonToken");
- var peg$c17 = function (stem, options) {
- return { stem: stem, options: options };
- };
- var peg$c18 = function (tokens) {
- return __assign({ type: 0 /* number */, tokens: tokens }, insertLocation());
- };
- var peg$c19 = "::";
- var peg$c20 = peg$literalExpectation("::", false);
- var peg$c21 = function (skeleton) { return skeleton; };
- var peg$c22 = function (style) { return style.replace(/\s*$/, ''); };
- var peg$c23 = ",";
- var peg$c24 = peg$literalExpectation(",", false);
- var peg$c25 = "number";
- var peg$c26 = peg$literalExpectation("number", false);
- var peg$c27 = function (value, type, style) {
- return __assign({ type: type === 'number' ? types.TYPE.number : type === 'date' ? types.TYPE.date : types.TYPE.time, style: style && style[2], value: value }, insertLocation());
- };
- var peg$c28 = "'";
- var peg$c29 = peg$literalExpectation("'", false);
- var peg$c30 = /^[^']/;
- var peg$c31 = peg$classExpectation(["'"], true, false);
- var peg$c32 = /^[^a-zA-Z'{}]/;
- var peg$c33 = peg$classExpectation([["a", "z"], ["A", "Z"], "'", "{", "}"], true, false);
- var peg$c34 = /^[a-zA-Z]/;
- var peg$c35 = peg$classExpectation([["a", "z"], ["A", "Z"]], false, false);
- var peg$c36 = function (pattern) {
- return __assign({ type: 1 /* dateTime */, pattern: pattern }, insertLocation());
- };
- var peg$c37 = "date";
- var peg$c38 = peg$literalExpectation("date", false);
- var peg$c39 = "time";
- var peg$c40 = peg$literalExpectation("time", false);
- var peg$c41 = "plural";
- var peg$c42 = peg$literalExpectation("plural", false);
- var peg$c43 = "selectordinal";
- var peg$c44 = peg$literalExpectation("selectordinal", false);
- var peg$c45 = "offset:";
- var peg$c46 = peg$literalExpectation("offset:", false);
- var peg$c47 = function (value, pluralType, offset, options) {
- return __assign({ type: types.TYPE.plural, pluralType: pluralType === 'plural' ? 'cardinal' : 'ordinal', value: value, offset: offset ? offset[2] : 0, options: options.reduce(function (all, _a) {
- var id = _a.id, value = _a.value, optionLocation = _a.location;
- if (id in all) {
- error("Duplicate option \"" + id + "\" in plural element: \"" + text() + "\"", location());
- }
- all[id] = {
- value: value,
- location: optionLocation
- };
- return all;
- }, {}) }, insertLocation());
- };
- var peg$c48 = "select";
- var peg$c49 = peg$literalExpectation("select", false);
- var peg$c50 = function (value, options) {
- return __assign({ type: types.TYPE.select, value: value, options: options.reduce(function (all, _a) {
- var id = _a.id, value = _a.value, optionLocation = _a.location;
- if (id in all) {
- error("Duplicate option \"" + id + "\" in select element: \"" + text() + "\"", location());
- }
- all[id] = {
- value: value,
- location: optionLocation
- };
- return all;
- }, {}) }, insertLocation());
- };
- var peg$c51 = "=";
- var peg$c52 = peg$literalExpectation("=", false);
- var peg$c53 = function (id, value) {
- return __assign({ id: id,
- value: value }, insertLocation());
- };
- var peg$c54 = function (id, value) {
- return __assign({ id: id,
- value: value }, insertLocation());
- };
- var peg$c55 = peg$otherExpectation("whitespace pattern");
- var peg$c56 = /^[\t-\r \x85\u200E\u200F\u2028\u2029]/;
- var peg$c57 = peg$classExpectation([["\t", "\r"], " ", "\x85", "\u200E", "\u200F", "\u2028", "\u2029"], false, false);
- var peg$c58 = peg$otherExpectation("syntax pattern");
- var peg$c59 = /^[!-\/:-@[-\^`{-~\xA1-\xA7\xA9\xAB\xAC\xAE\xB0\xB1\xB6\xBB\xBF\xD7\xF7\u2010-\u2027\u2030-\u203E\u2041-\u2053\u2055-\u205E\u2190-\u245F\u2500-\u2775\u2794-\u2BFF\u2E00-\u2E7F\u3001-\u3003\u3008-\u3020\u3030\uFD3E\uFD3F\uFE45\uFE46]/;
- var peg$c60 = peg$classExpectation([["!", "/"], [":", "@"], ["[", "^"], "`", ["{", "~"], ["\xA1", "\xA7"], "\xA9", "\xAB", "\xAC", "\xAE", "\xB0", "\xB1", "\xB6", "\xBB", "\xBF", "\xD7", "\xF7", ["\u2010", "\u2027"], ["\u2030", "\u203E"], ["\u2041", "\u2053"], ["\u2055", "\u205E"], ["\u2190", "\u245F"], ["\u2500", "\u2775"], ["\u2794", "\u2BFF"], ["\u2E00", "\u2E7F"], ["\u3001", "\u3003"], ["\u3008", "\u3020"], "\u3030", "\uFD3E", "\uFD3F", "\uFE45", "\uFE46"], false, false);
- var peg$c61 = peg$otherExpectation("optional whitespace");
- var peg$c62 = peg$otherExpectation("number");
- var peg$c63 = "-";
- var peg$c64 = peg$literalExpectation("-", false);
- var peg$c65 = function (negative, num) {
- return num
- ? negative
- ? -num
- : num
- : 0;
- };
- var peg$c67 = peg$otherExpectation("double apostrophes");
- var peg$c68 = "''";
- var peg$c69 = peg$literalExpectation("''", false);
- var peg$c70 = function () { return "'"; };
- var peg$c71 = /^[{}]/;
- var peg$c72 = peg$classExpectation(["{", "}"], false, false);
- var peg$c73 = function (escapedChar, quotedChars) {
- return escapedChar + quotedChars.replace("''", "'");
- };
- var peg$c74 = /^[^{}]/;
- var peg$c75 = peg$classExpectation(["{", "}"], true, false);
- var peg$c76 = peg$otherExpectation("argNameOrNumber");
- var peg$c77 = peg$otherExpectation("argNumber");
- var peg$c78 = "0";
- var peg$c79 = peg$literalExpectation("0", false);
- var peg$c80 = function () { return 0; };
- var peg$c81 = /^[1-9]/;
- var peg$c82 = peg$classExpectation([["1", "9"]], false, false);
- var peg$c83 = /^[0-9]/;
- var peg$c84 = peg$classExpectation([["0", "9"]], false, false);
- var peg$c85 = function (digits) {
- return parseInt(digits.join(''), 10);
- };
- var peg$c86 = peg$otherExpectation("argName");
- var peg$currPos = 0;
- var peg$savedPos = 0;
- var peg$posDetailsCache = [{ line: 1, column: 1 }];
- var peg$maxFailPos = 0;
- var peg$maxFailExpected = [];
- var peg$silentFails = 0;
- var peg$result;
- if (options.startRule !== undefined) {
- if (!(options.startRule in peg$startRuleFunctions)) {
- throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
- }
- peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
- }
- function text() {
- return input.substring(peg$savedPos, peg$currPos);
- }
- function location() {
- return peg$computeLocation(peg$savedPos, peg$currPos);
- }
- function error(message, location1) {
- location1 = location1 !== undefined
- ? location1
- : peg$computeLocation(peg$savedPos, peg$currPos);
- throw peg$buildSimpleError(message, location1);
- }
- function peg$literalExpectation(text1, ignoreCase) {
- return { type: "literal", text: text1, ignoreCase: ignoreCase };
- }
- function peg$classExpectation(parts, inverted, ignoreCase) {
- return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
- }
- function peg$anyExpectation() {
- return { type: "any" };
- }
- function peg$endExpectation() {
- return { type: "end" };
- }
- function peg$otherExpectation(description) {
- return { type: "other", description: description };
- }
- function peg$computePosDetails(pos) {
- var details = peg$posDetailsCache[pos];
- var p;
- if (details) {
- return details;
- }
- else {
- p = pos - 1;
- while (!peg$posDetailsCache[p]) {
- p--;
- }
- details = peg$posDetailsCache[p];
- details = {
- line: details.line,
- column: details.column
- };
- while (p < pos) {
- if (input.charCodeAt(p) === 10) {
- details.line++;
- details.column = 1;
- }
- else {
- details.column++;
- }
- p++;
- }
- peg$posDetailsCache[pos] = details;
- return details;
- }
- }
- function peg$computeLocation(startPos, endPos) {
- var startPosDetails = peg$computePosDetails(startPos);
- var 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(expected1) {
- if (peg$currPos < peg$maxFailPos) {
- return;
- }
- if (peg$currPos > peg$maxFailPos) {
- peg$maxFailPos = peg$currPos;
- peg$maxFailExpected = [];
- }
- peg$maxFailExpected.push(expected1);
- }
- function peg$buildSimpleError(message, location1) {
- return new SyntaxError(message, [], "", location1);
- }
- function peg$buildStructuredError(expected1, found, location1) {
- return new SyntaxError(SyntaxError.buildMessage(expected1, found), expected1, found, location1);
- }
- function peg$parsestart() {
- var s0;
- s0 = peg$parsemessage();
- return s0;
- }
- function peg$parsemessage() {
- var s0, s1;
- s0 = [];
- s1 = peg$parsemessageElement();
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- s1 = peg$parsemessageElement();
- }
- return s0;
- }
- function peg$parsemessageElement() {
- var s0;
- s0 = peg$parseliteralElement();
- if (s0 === peg$FAILED) {
- s0 = peg$parseargumentElement();
- if (s0 === peg$FAILED) {
- s0 = peg$parsesimpleFormatElement();
- if (s0 === peg$FAILED) {
- s0 = peg$parsepluralElement();
- if (s0 === peg$FAILED) {
- s0 = peg$parseselectElement();
- }
- }
- }
- }
- return s0;
- }
- function peg$parsemessageText() {
- var s0, s1, s2;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parsedoubleApostrophes();
- if (s2 === peg$FAILED) {
- s2 = peg$parsequotedString();
- if (s2 === peg$FAILED) {
- s2 = peg$parseunquotedString();
- }
- }
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parsedoubleApostrophes();
- if (s2 === peg$FAILED) {
- s2 = peg$parsequotedString();
- if (s2 === peg$FAILED) {
- s2 = peg$parseunquotedString();
- }
- }
- }
- }
- else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c0(s1);
- }
- s0 = s1;
- return s0;
- }
- function peg$parseliteralElement() {
- var s0, s1;
- s0 = peg$currPos;
- s1 = peg$parsemessageText();
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c1(s1);
- }
- s0 = s1;
- return s0;
- }
- function peg$parseargumentElement() {
- var s0, s1, s2, s3, s4, s5;
- peg$silentFails++;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 123) {
- s1 = peg$c3;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseargNameOrNumber();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s5 = peg$c5;
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s5 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c7(s3);
- 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;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c2);
- }
- }
- return s0;
- }
- function peg$parsenumberSkeletonId() {
- var s0, s1, s2, s3, s4;
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$currPos;
- s3 = peg$currPos;
- peg$silentFails++;
- s4 = peg$parsepatternWhiteSpace();
- if (s4 === peg$FAILED) {
- if (peg$c9.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c10);
- }
- }
- }
- peg$silentFails--;
- if (s4 === peg$FAILED) {
- s3 = undefined;
- }
- else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c11);
- }
- }
- 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) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$currPos;
- s3 = peg$currPos;
- peg$silentFails++;
- s4 = peg$parsepatternWhiteSpace();
- if (s4 === peg$FAILED) {
- if (peg$c9.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c10);
- }
- }
- }
- peg$silentFails--;
- if (s4 === peg$FAILED) {
- s3 = undefined;
- }
- else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c11);
- }
- }
- if (s4 !== peg$FAILED) {
- s3 = [s3, s4];
- s2 = s3;
- }
- else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- }
- }
- else {
- s1 = peg$FAILED;
- }
- 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$c8);
- }
- }
- return s0;
- }
- function peg$parsenumberSkeletonTokenOption() {
- var s0, s1, s2;
- peg$silentFails++;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 47) {
- s1 = peg$c13;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c14);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parsenumberSkeletonId();
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c15(s2);
- s0 = s1;
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c12);
- }
- }
- return s0;
- }
- function peg$parsenumberSkeletonToken() {
- var s0, s1, s2, s3, s4;
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s2 = peg$parsenumberSkeletonId();
- if (s2 !== peg$FAILED) {
- s3 = [];
- s4 = peg$parsenumberSkeletonTokenOption();
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- s4 = peg$parsenumberSkeletonTokenOption();
- }
- if (s3 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c17(s2, s3);
- s0 = s1;
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c16);
- }
- }
- return s0;
- }
- function peg$parsenumberSkeleton() {
- var s0, s1, s2;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parsenumberSkeletonToken();
- if (s2 !== peg$FAILED) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parsenumberSkeletonToken();
- }
- }
- else {
- s1 = peg$FAILED;
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c18(s1);
- }
- s0 = s1;
- return s0;
- }
- function peg$parsenumberArgStyle() {
- var s0, s1, s2;
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c19) {
- s1 = peg$c19;
- peg$currPos += 2;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c20);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parsenumberSkeleton();
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c21(s2);
- s0 = s1;
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parsemessageText();
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c22(s1);
- }
- s0 = s1;
- }
- return s0;
- }
- function peg$parsenumberFormatElement() {
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 123) {
- s1 = peg$c3;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseargNameOrNumber();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c23;
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- if (input.substr(peg$currPos, 6) === peg$c25) {
- s7 = peg$c25;
- peg$currPos += 6;
- }
- else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c26);
- }
- }
- if (s7 !== peg$FAILED) {
- s8 = peg$parse_();
- if (s8 !== peg$FAILED) {
- s9 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 44) {
- s10 = peg$c23;
- peg$currPos++;
- }
- else {
- s10 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s10 !== peg$FAILED) {
- s11 = peg$parse_();
- if (s11 !== peg$FAILED) {
- s12 = peg$parsenumberArgStyle();
- if (s12 !== peg$FAILED) {
- s10 = [s10, s11, s12];
- s9 = s10;
- }
- else {
- peg$currPos = s9;
- s9 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s9;
- s9 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s9;
- s9 = peg$FAILED;
- }
- if (s9 === peg$FAILED) {
- s9 = null;
- }
- if (s9 !== peg$FAILED) {
- s10 = peg$parse_();
- if (s10 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s11 = peg$c5;
- peg$currPos++;
- }
- else {
- s11 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s11 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c27(s3, s7, s9);
- 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;
- }
- }
- 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$parsedateTimeSkeletonLiteral() {
- var s0, s1, s2, s3;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 39) {
- s1 = peg$c28;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c29);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = [];
- s3 = peg$parsedoubleApostrophes();
- if (s3 === peg$FAILED) {
- if (peg$c30.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c31);
- }
- }
- }
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsedoubleApostrophes();
- if (s3 === peg$FAILED) {
- if (peg$c30.test(input.charAt(peg$currPos))) {
- s3 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c31);
- }
- }
- }
- }
- }
- else {
- s2 = peg$FAILED;
- }
- if (s2 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 39) {
- s3 = peg$c28;
- peg$currPos++;
- }
- else {
- s3 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c29);
- }
- }
- if (s3 !== peg$FAILED) {
- s1 = [s1, s2, s3];
- s0 = s1;
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = [];
- s1 = peg$parsedoubleApostrophes();
- if (s1 === peg$FAILED) {
- if (peg$c32.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c33);
- }
- }
- }
- if (s1 !== peg$FAILED) {
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- s1 = peg$parsedoubleApostrophes();
- if (s1 === peg$FAILED) {
- if (peg$c32.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c33);
- }
- }
- }
- }
- }
- else {
- s0 = peg$FAILED;
- }
- }
- return s0;
- }
- function peg$parsedateTimeSkeletonPattern() {
- var s0, s1;
- s0 = [];
- if (peg$c34.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c35);
- }
- }
- if (s1 !== peg$FAILED) {
- while (s1 !== peg$FAILED) {
- s0.push(s1);
- if (peg$c34.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c35);
- }
- }
- }
- }
- else {
- s0 = peg$FAILED;
- }
- return s0;
- }
- function peg$parsedateTimeSkeleton() {
- var s0, s1, s2, s3;
- s0 = peg$currPos;
- s1 = peg$currPos;
- s2 = [];
- s3 = peg$parsedateTimeSkeletonLiteral();
- if (s3 === peg$FAILED) {
- s3 = peg$parsedateTimeSkeletonPattern();
- }
- if (s3 !== peg$FAILED) {
- while (s3 !== peg$FAILED) {
- s2.push(s3);
- s3 = peg$parsedateTimeSkeletonLiteral();
- if (s3 === peg$FAILED) {
- s3 = peg$parsedateTimeSkeletonPattern();
- }
- }
- }
- else {
- 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$c36(s1);
- }
- s0 = s1;
- return s0;
- }
- function peg$parsedateOrTimeArgStyle() {
- var s0, s1, s2;
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c19) {
- s1 = peg$c19;
- peg$currPos += 2;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c20);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parsedateTimeSkeleton();
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c21(s2);
- s0 = s1;
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$parsemessageText();
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c22(s1);
- }
- s0 = s1;
- }
- return s0;
- }
- function peg$parsedateOrTimeFormatElement() {
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 123) {
- s1 = peg$c3;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseargNameOrNumber();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c23;
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- if (input.substr(peg$currPos, 4) === peg$c37) {
- s7 = peg$c37;
- peg$currPos += 4;
- }
- else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c38);
- }
- }
- if (s7 === peg$FAILED) {
- if (input.substr(peg$currPos, 4) === peg$c39) {
- s7 = peg$c39;
- peg$currPos += 4;
- }
- else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c40);
- }
- }
- }
- if (s7 !== peg$FAILED) {
- s8 = peg$parse_();
- if (s8 !== peg$FAILED) {
- s9 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 44) {
- s10 = peg$c23;
- peg$currPos++;
- }
- else {
- s10 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s10 !== peg$FAILED) {
- s11 = peg$parse_();
- if (s11 !== peg$FAILED) {
- s12 = peg$parsedateOrTimeArgStyle();
- if (s12 !== peg$FAILED) {
- s10 = [s10, s11, s12];
- s9 = s10;
- }
- else {
- peg$currPos = s9;
- s9 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s9;
- s9 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s9;
- s9 = peg$FAILED;
- }
- if (s9 === peg$FAILED) {
- s9 = null;
- }
- if (s9 !== peg$FAILED) {
- s10 = peg$parse_();
- if (s10 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s11 = peg$c5;
- peg$currPos++;
- }
- else {
- s11 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s11 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c27(s3, s7, s9);
- 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;
- }
- }
- 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$parsesimpleFormatElement() {
- var s0;
- s0 = peg$parsenumberFormatElement();
- if (s0 === peg$FAILED) {
- s0 = peg$parsedateOrTimeFormatElement();
- }
- return s0;
- }
- function peg$parsepluralElement() {
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 123) {
- s1 = peg$c3;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseargNameOrNumber();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c23;
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- if (input.substr(peg$currPos, 6) === peg$c41) {
- s7 = peg$c41;
- peg$currPos += 6;
- }
- else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c42);
- }
- }
- if (s7 === peg$FAILED) {
- if (input.substr(peg$currPos, 13) === peg$c43) {
- s7 = peg$c43;
- peg$currPos += 13;
- }
- else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c44);
- }
- }
- }
- if (s7 !== peg$FAILED) {
- s8 = peg$parse_();
- if (s8 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s9 = peg$c23;
- peg$currPos++;
- }
- else {
- s9 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s9 !== peg$FAILED) {
- s10 = peg$parse_();
- if (s10 !== peg$FAILED) {
- s11 = peg$currPos;
- if (input.substr(peg$currPos, 7) === peg$c45) {
- s12 = peg$c45;
- peg$currPos += 7;
- }
- else {
- s12 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c46);
- }
- }
- if (s12 !== peg$FAILED) {
- s13 = peg$parse_();
- if (s13 !== peg$FAILED) {
- s14 = peg$parsenumber();
- if (s14 !== peg$FAILED) {
- s12 = [s12, s13, s14];
- s11 = s12;
- }
- else {
- peg$currPos = s11;
- s11 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s11;
- s11 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s11;
- s11 = peg$FAILED;
- }
- if (s11 === peg$FAILED) {
- s11 = null;
- }
- if (s11 !== peg$FAILED) {
- s12 = peg$parse_();
- if (s12 !== peg$FAILED) {
- s13 = [];
- s14 = peg$parsepluralOption();
- if (s14 !== peg$FAILED) {
- while (s14 !== peg$FAILED) {
- s13.push(s14);
- s14 = peg$parsepluralOption();
- }
- }
- else {
- s13 = peg$FAILED;
- }
- if (s13 !== peg$FAILED) {
- s14 = peg$parse_();
- if (s14 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s15 = peg$c5;
- peg$currPos++;
- }
- else {
- s15 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s15 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c47(s3, s7, s11, s13);
- 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;
- }
- }
- 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$parseselectElement() {
- var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 123) {
- s1 = peg$c3;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parse_();
- if (s2 !== peg$FAILED) {
- s3 = peg$parseargNameOrNumber();
- if (s3 !== peg$FAILED) {
- s4 = peg$parse_();
- if (s4 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s5 = peg$c23;
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s5 !== peg$FAILED) {
- s6 = peg$parse_();
- if (s6 !== peg$FAILED) {
- if (input.substr(peg$currPos, 6) === peg$c48) {
- s7 = peg$c48;
- peg$currPos += 6;
- }
- else {
- s7 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c49);
- }
- }
- if (s7 !== peg$FAILED) {
- s8 = peg$parse_();
- if (s8 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 44) {
- s9 = peg$c23;
- peg$currPos++;
- }
- else {
- s9 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c24);
- }
- }
- if (s9 !== peg$FAILED) {
- s10 = peg$parse_();
- if (s10 !== peg$FAILED) {
- s11 = [];
- s12 = peg$parseselectOption();
- if (s12 !== peg$FAILED) {
- while (s12 !== peg$FAILED) {
- s11.push(s12);
- s12 = peg$parseselectOption();
- }
- }
- else {
- s11 = peg$FAILED;
- }
- if (s11 !== peg$FAILED) {
- s12 = peg$parse_();
- if (s12 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s13 = peg$c5;
- peg$currPos++;
- }
- else {
- s13 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s13 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c50(s3, s11);
- 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;
- }
- }
- 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$parsepluralRuleSelectValue() {
- var s0, s1, s2, s3;
- s0 = peg$currPos;
- s1 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 61) {
- s2 = peg$c51;
- peg$currPos++;
- }
- else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c52);
- }
- }
- 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$parseargName();
- }
- return s0;
- }
- function peg$parseselectOption() {
- var s0, s1, s2, s3, s4, s5, s6;
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s2 = peg$parseargName();
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 123) {
- s4 = peg$c3;
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s4 !== peg$FAILED) {
- s5 = peg$parsemessage();
- if (s5 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s6 = peg$c5;
- peg$currPos++;
- }
- else {
- s6 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s6 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c53(s2, 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;
- }
- return s0;
- }
- function peg$parsepluralOption() {
- var s0, s1, s2, s3, s4, s5, s6;
- s0 = peg$currPos;
- s1 = peg$parse_();
- if (s1 !== peg$FAILED) {
- s2 = peg$parsepluralRuleSelectValue();
- if (s2 !== peg$FAILED) {
- s3 = peg$parse_();
- if (s3 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 123) {
- s4 = peg$c3;
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c4);
- }
- }
- if (s4 !== peg$FAILED) {
- s5 = peg$parsemessage();
- if (s5 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 125) {
- s6 = peg$c5;
- peg$currPos++;
- }
- else {
- s6 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c6);
- }
- }
- if (s6 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c54(s2, 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;
- }
- return s0;
- }
- function peg$parsepatternWhiteSpace() {
- var s0;
- peg$silentFails++;
- if (peg$c56.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c57);
- }
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- if (peg$silentFails === 0) {
- peg$fail(peg$c55);
- }
- }
- return s0;
- }
- function peg$parsepatternSyntax() {
- var s0;
- peg$silentFails++;
- if (peg$c59.test(input.charAt(peg$currPos))) {
- s0 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s0 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c60);
- }
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- if (peg$silentFails === 0) {
- peg$fail(peg$c58);
- }
- }
- return s0;
- }
- function peg$parse_() {
- var s0, s1, s2;
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$parsepatternWhiteSpace();
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$parsepatternWhiteSpace();
- }
- 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$c61);
- }
- }
- return s0;
- }
- function peg$parsenumber() {
- var s0, s1, s2;
- peg$silentFails++;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 45) {
- s1 = peg$c63;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c64);
- }
- }
- if (s1 === peg$FAILED) {
- s1 = null;
- }
- if (s1 !== peg$FAILED) {
- s2 = peg$parseargNumber();
- if (s2 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c65(s1, s2);
- s0 = s1;
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s0;
- s0 = peg$FAILED;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c62);
- }
- }
- return s0;
- }
- function peg$parsedoubleApostrophes() {
- var s0, s1;
- peg$silentFails++;
- s0 = peg$currPos;
- if (input.substr(peg$currPos, 2) === peg$c68) {
- s1 = peg$c68;
- peg$currPos += 2;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c69);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c70();
- }
- s0 = s1;
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c67);
- }
- }
- return s0;
- }
- function peg$parsequotedString() {
- var s0, s1, s2, s3, s4, s5;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 39) {
- s1 = peg$c28;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c29);
- }
- }
- if (s1 !== peg$FAILED) {
- if (peg$c71.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c72);
- }
- }
- if (s2 !== peg$FAILED) {
- s3 = peg$currPos;
- s4 = [];
- if (input.substr(peg$currPos, 2) === peg$c68) {
- s5 = peg$c68;
- peg$currPos += 2;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c69);
- }
- }
- if (s5 === peg$FAILED) {
- if (peg$c30.test(input.charAt(peg$currPos))) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c31);
- }
- }
- }
- while (s5 !== peg$FAILED) {
- s4.push(s5);
- if (input.substr(peg$currPos, 2) === peg$c68) {
- s5 = peg$c68;
- peg$currPos += 2;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c69);
- }
- }
- if (s5 === peg$FAILED) {
- if (peg$c30.test(input.charAt(peg$currPos))) {
- s5 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s5 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c31);
- }
- }
- }
- }
- if (s4 !== peg$FAILED) {
- s3 = input.substring(s3, peg$currPos);
- }
- else {
- s3 = s4;
- }
- if (s3 !== peg$FAILED) {
- if (input.charCodeAt(peg$currPos) === 39) {
- s4 = peg$c28;
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c29);
- }
- }
- if (s4 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c73(s2, s3);
- 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;
- }
- return s0;
- }
- function peg$parseunquotedString() {
- var s0, s1;
- s0 = peg$currPos;
- if (peg$c74.test(input.charAt(peg$currPos))) {
- s1 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c75);
- }
- }
- if (s1 !== peg$FAILED) {
- s0 = input.substring(s0, peg$currPos);
- }
- else {
- s0 = s1;
- }
- return s0;
- }
- function peg$parseargNameOrNumber() {
- var s0, s1;
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = peg$parseargNumber();
- if (s1 === peg$FAILED) {
- s1 = peg$parseargName();
- }
- 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$c76);
- }
- }
- return s0;
- }
- function peg$parseargNumber() {
- var s0, s1, s2, s3, s4;
- peg$silentFails++;
- s0 = peg$currPos;
- if (input.charCodeAt(peg$currPos) === 48) {
- s1 = peg$c78;
- peg$currPos++;
- }
- else {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c79);
- }
- }
- if (s1 !== peg$FAILED) {
- peg$savedPos = s0;
- s1 = peg$c80();
- }
- s0 = s1;
- if (s0 === peg$FAILED) {
- s0 = peg$currPos;
- s1 = peg$currPos;
- if (peg$c81.test(input.charAt(peg$currPos))) {
- s2 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s2 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c82);
- }
- }
- if (s2 !== peg$FAILED) {
- s3 = [];
- if (peg$c83.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c84);
- }
- }
- while (s4 !== peg$FAILED) {
- s3.push(s4);
- if (peg$c83.test(input.charAt(peg$currPos))) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c84);
- }
- }
- }
- 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) {
- peg$savedPos = s0;
- s1 = peg$c85(s1);
- }
- s0 = s1;
- }
- peg$silentFails--;
- if (s0 === peg$FAILED) {
- s1 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c77);
- }
- }
- return s0;
- }
- function peg$parseargName() {
- var s0, s1, s2, s3, s4;
- peg$silentFails++;
- s0 = peg$currPos;
- s1 = [];
- s2 = peg$currPos;
- s3 = peg$currPos;
- peg$silentFails++;
- s4 = peg$parsepatternWhiteSpace();
- if (s4 === peg$FAILED) {
- s4 = peg$parsepatternSyntax();
- }
- peg$silentFails--;
- if (s4 === peg$FAILED) {
- s3 = undefined;
- }
- else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c11);
- }
- }
- 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) {
- while (s2 !== peg$FAILED) {
- s1.push(s2);
- s2 = peg$currPos;
- s3 = peg$currPos;
- peg$silentFails++;
- s4 = peg$parsepatternWhiteSpace();
- if (s4 === peg$FAILED) {
- s4 = peg$parsepatternSyntax();
- }
- peg$silentFails--;
- if (s4 === peg$FAILED) {
- s3 = undefined;
- }
- else {
- peg$currPos = s3;
- s3 = peg$FAILED;
- }
- if (s3 !== peg$FAILED) {
- if (input.length > peg$currPos) {
- s4 = input.charAt(peg$currPos);
- peg$currPos++;
- }
- else {
- s4 = peg$FAILED;
- if (peg$silentFails === 0) {
- peg$fail(peg$c11);
- }
- }
- if (s4 !== peg$FAILED) {
- s3 = [s3, s4];
- s2 = s3;
- }
- else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- }
- else {
- peg$currPos = s2;
- s2 = peg$FAILED;
- }
- }
- }
- else {
- s1 = peg$FAILED;
- }
- 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$c86);
- }
- }
- return s0;
- }
- function insertLocation() {
- return options && options.captureLocation ? {
- location: location()
- } : {};
- }
- 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(peg$endExpectation());
- }
- throw peg$buildStructuredError(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));
- }
- }
- exports.pegParse = peg$parse;
- });
-
- styleInject_es.unwrapExports(parser);
- var parser_1 = parser.SyntaxError;
- var parser_2 = parser.pegParse;
-
- var normalize = styleInject_es.createCommonjsModule(function (module, exports) {
- var __spreadArrays = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__spreadArrays) || function () {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
- var PLURAL_HASHTAG_REGEX = /(^|[^\\])#/g;
- /**
- * Whether to convert `#` in plural rule options
- * to `{var, number}`
- * @param el AST Element
- * @param pluralStack current plural stack
- */
- function normalizeHashtagInPlural(els) {
- els.forEach(function (el) {
- // If we're encountering a plural el
- if (!types.isPluralElement(el) && !types.isSelectElement(el)) {
- return;
- }
- // Go down the options and search for # in any literal element
- Object.keys(el.options).forEach(function (id) {
- var _a;
- var opt = el.options[id];
- // If we got a match, we have to split this
- // and inject a NumberElement in the middle
- var matchingLiteralElIndex = -1;
- var literalEl = undefined;
- for (var i = 0; i < opt.value.length; i++) {
- var el_1 = opt.value[i];
- if (types.isLiteralElement(el_1) && PLURAL_HASHTAG_REGEX.test(el_1.value)) {
- matchingLiteralElIndex = i;
- literalEl = el_1;
- break;
- }
- }
- if (literalEl) {
- var newValue = literalEl.value.replace(PLURAL_HASHTAG_REGEX, "$1{" + el.value + ", number}");
- var newEls = parser.pegParse(newValue);
- (_a = opt.value).splice.apply(_a, __spreadArrays([matchingLiteralElIndex, 1], newEls));
- }
- normalizeHashtagInPlural(opt.value);
- });
- });
- }
- exports.normalizeHashtagInPlural = normalizeHashtagInPlural;
- });
-
- styleInject_es.unwrapExports(normalize);
- var normalize_1 = normalize.normalizeHashtagInPlural;
-
- var skeleton = styleInject_es.createCommonjsModule(function (module, exports) {
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
- * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js
- * with some tweaks
- */
- var DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;
- /**
- * Parse Date time skeleton into Intl.DateTimeFormatOptions
- * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
- * @public
- * @param skeleton skeleton string
- */
- function parseDateTimeSkeleton(skeleton) {
- var result = {};
- skeleton.replace(DATE_TIME_REGEX, function (match) {
- var len = match.length;
- switch (match[0]) {
- // Era
- case 'G':
- result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';
- break;
- // Year
- case 'y':
- result.year = len === 2 ? '2-digit' : 'numeric';
- break;
- case 'Y':
- case 'u':
- case 'U':
- case 'r':
- throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');
- // Quarter
- case 'q':
- case 'Q':
- throw new RangeError('`q/Q` (quarter) patterns are not supported');
- // Month
- case 'M':
- case 'L':
- result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];
- break;
- // Week
- case 'w':
- case 'W':
- throw new RangeError('`w/W` (week) patterns are not supported');
- case 'd':
- result.day = ['numeric', '2-digit'][len - 1];
- break;
- case 'D':
- case 'F':
- case 'g':
- throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');
- // Weekday
- case 'E':
- result.weekday = len === 4 ? 'short' : len === 5 ? 'narrow' : 'short';
- break;
- case 'e':
- if (len < 4) {
- throw new RangeError('`e..eee` (weekday) patterns are not supported');
- }
- result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];
- break;
- case 'c':
- if (len < 4) {
- throw new RangeError('`c..ccc` (weekday) patterns are not supported');
- }
- result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];
- break;
- // Period
- case 'a': // AM, PM
- result.hour12 = true;
- break;
- case 'b': // am, pm, noon, midnight
- case 'B': // flexible day periods
- throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');
- // Hour
- case 'h':
- result.hourCycle = 'h12';
- result.hour = ['numeric', '2-digit'][len - 1];
- break;
- case 'H':
- result.hourCycle = 'h23';
- result.hour = ['numeric', '2-digit'][len - 1];
- break;
- case 'K':
- result.hourCycle = 'h11';
- result.hour = ['numeric', '2-digit'][len - 1];
- break;
- case 'k':
- result.hourCycle = 'h24';
- result.hour = ['numeric', '2-digit'][len - 1];
- break;
- case 'j':
- case 'J':
- case 'C':
- throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');
- // Minute
- case 'm':
- result.minute = ['numeric', '2-digit'][len - 1];
- break;
- // Second
- case 's':
- result.second = ['numeric', '2-digit'][len - 1];
- break;
- case 'S':
- case 'A':
- throw new RangeError('`S/A` (second) pattenrs are not supported, use `s` instead');
- // Zone
- case 'z': // 1..3, 4: specific non-location format
- result.timeZoneName = len < 4 ? 'short' : 'long';
- break;
- case 'Z': // 1..3, 4, 5: The ISO8601 varios formats
- case 'O': // 1, 4: miliseconds in day short, long
- case 'v': // 1, 4: generic non-location format
- case 'V': // 1, 2, 3, 4: time zone ID or city
- case 'X': // 1, 2, 3, 4: The ISO8601 varios formats
- case 'x': // 1, 2, 3, 4: The ISO8601 varios formats
- throw new RangeError('`Z/O/v/V/X/x` (timeZone) pattenrs are not supported, use `z` instead');
- }
- return '';
- });
- return result;
- }
- exports.parseDateTimeSkeleton = parseDateTimeSkeleton;
- function icuUnitToEcma(unit) {
- return unit.replace(/^(.*?)-/, '');
- }
- var FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\+|#+)?)?$/g;
- var SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?$/g;
- function parseSignificantPrecision(str) {
- var result = {};
- str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {
- // @@@ case
- if (typeof g2 !== 'string') {
- result.minimumSignificantDigits = g1.length;
- result.maximumSignificantDigits = g1.length;
- }
- // @@@+ case
- else if (g2 === '+') {
- result.minimumSignificantDigits = g1.length;
- }
- // .### case
- else if (g1[0] === '#') {
- result.maximumSignificantDigits = g1.length;
- }
- // .@@## or .@@@ case
- else {
- result.minimumSignificantDigits = g1.length;
- result.maximumSignificantDigits =
- g1.length + (typeof g2 === 'string' ? g2.length : 0);
- }
- return '';
- });
- return result;
- }
- function parseSign(str) {
- switch (str) {
- case 'sign-auto':
- return {
- signDisplay: 'auto',
- };
- case 'sign-accounting':
- return {
- currencySign: 'accounting',
- };
- case 'sign-always':
- return {
- signDisplay: 'always',
- };
- case 'sign-accounting-always':
- return {
- signDisplay: 'always',
- currencySign: 'accounting',
- };
- case 'sign-except-zero':
- return {
- signDisplay: 'exceptZero',
- };
- case 'sign-accounting-except-zero':
- return {
- signDisplay: 'exceptZero',
- currencySign: 'accounting',
- };
- case 'sign-never':
- return {
- signDisplay: 'never',
- };
- }
- }
- function parseNotationOptions(opt) {
- var result = {};
- var signOpts = parseSign(opt);
- if (signOpts) {
- return signOpts;
- }
- return result;
- }
- /**
- * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options
- */
- function convertNumberSkeletonToNumberFormatOptions(tokens) {
- var result = {};
- for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {
- var token = tokens_1[_i];
- switch (token.stem) {
- case 'percent':
- result.style = 'percent';
- continue;
- case 'currency':
- result.style = 'currency';
- result.currency = token.options[0];
- continue;
- case 'group-off':
- result.useGrouping = false;
- continue;
- case 'precision-integer':
- result.maximumFractionDigits = 0;
- continue;
- case 'measure-unit':
- result.style = 'unit';
- result.unit = icuUnitToEcma(token.options[0]);
- continue;
- case 'compact-short':
- result.notation = 'compact';
- result.compactDisplay = 'short';
- continue;
- case 'compact-long':
- result.notation = 'compact';
- result.compactDisplay = 'long';
- continue;
- case 'scientific':
- result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));
- continue;
- case 'engineering':
- result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));
- continue;
- case 'notation-simple':
- result.notation = 'standard';
- continue;
- // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h
- case 'unit-width-narrow':
- result.currencyDisplay = 'narrowSymbol';
- result.unitDisplay = 'narrow';
- continue;
- case 'unit-width-short':
- result.currencyDisplay = 'code';
- result.unitDisplay = 'short';
- continue;
- case 'unit-width-full-name':
- result.currencyDisplay = 'name';
- result.unitDisplay = 'long';
- continue;
- case 'unit-width-iso-code':
- result.currencyDisplay = 'symbol';
- continue;
- }
- // Precision
- // https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#fraction-precision
- if (FRACTION_PRECISION_REGEX.test(token.stem)) {
- if (token.options.length > 1) {
- throw new RangeError('Fraction-precision stems only accept a single optional option');
- }
- token.stem.replace(FRACTION_PRECISION_REGEX, function (match, g1, g2) {
- // precision-integer case
- if (match === '.') {
- result.maximumFractionDigits = 0;
- }
- // .000+ case
- else if (g2 === '+') {
- result.minimumFractionDigits = g2.length;
- }
- // .### case
- else if (g1[0] === '#') {
- result.maximumFractionDigits = g1.length;
- }
- // .00## or .000 case
- else {
- result.minimumFractionDigits = g1.length;
- result.maximumFractionDigits =
- g1.length + (typeof g2 === 'string' ? g2.length : 0);
- }
- return '';
- });
- if (token.options.length) {
- result = __assign(__assign({}, result), parseSignificantPrecision(token.options[0]));
- }
- continue;
- }
- if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {
- result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));
- continue;
- }
- var signOpts = parseSign(token.stem);
- if (signOpts) {
- result = __assign(__assign({}, result), signOpts);
- }
- }
- return result;
- }
- exports.convertNumberSkeletonToNumberFormatOptions = convertNumberSkeletonToNumberFormatOptions;
- });
-
- styleInject_es.unwrapExports(skeleton);
- var skeleton_1 = skeleton.parseDateTimeSkeleton;
- var skeleton_2 = skeleton.convertNumberSkeletonToNumberFormatOptions;
-
- var dist$1 = styleInject_es.createCommonjsModule(function (module, exports) {
- function __export(m) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
- __export(types);
- __export(parser);
- __export(skeleton);
- function parse(input, opts) {
- var els = parser.pegParse(input, opts);
- if (!opts || opts.normalizeHashtagInPlural !== false) {
- normalize.normalizeHashtagInPlural(els);
- }
- return els;
- }
- exports.parse = parse;
- });
-
- styleInject_es.unwrapExports(dist$1);
- var dist_1$1 = dist$1.parse;
-
- var dist$2 = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- Copyright (c) 2014, Yahoo! Inc. All rights reserved.
- Copyrights licensed under the New BSD License.
- See the accompanying LICENSE file for terms.
- */
- var __spreadArrays = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__spreadArrays) || function () {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- // -- Utilities ----------------------------------------------------------------
- function getCacheId(inputs) {
- return JSON.stringify(inputs.map(function (input) {
- return input && typeof input === 'object' ? orderedProps(input) : input;
- }));
- }
- function orderedProps(obj) {
- return Object.keys(obj)
- .sort()
- .map(function (k) {
- var _a;
- return (_a = {}, _a[k] = obj[k], _a);
- });
- }
- var memoizeFormatConstructor = function (FormatConstructor, cache) {
- if (cache === void 0) { cache = {}; }
- return function () {
- var _a;
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- var cacheId = getCacheId(args);
- var format = cacheId && cache[cacheId];
- if (!format) {
- format = new ((_a = FormatConstructor).bind.apply(_a, __spreadArrays([void 0], args)))();
- if (cacheId) {
- cache[cacheId] = format;
- }
- }
- return format;
- };
- };
- exports.default = memoizeFormatConstructor;
- });
-
- styleInject_es.unwrapExports(dist$2);
-
- var formatters = styleInject_es.createCommonjsModule(function (module, exports) {
- var __extends = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __spreadArrays = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__spreadArrays) || function () {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
- var ESCAPE_HASH_REGEX = /\\#/g;
- var PLURAL_HASH = /(^|[^\\])#/g;
- var FormatError = /** @class */ (function (_super) {
- __extends(FormatError, _super);
- function FormatError(msg, variableId) {
- var _this = _super.call(this, msg) || this;
- _this.variableId = variableId;
- return _this;
- }
- return FormatError;
- }(Error));
- function mergeLiteral(parts) {
- if (parts.length < 2) {
- return parts;
- }
- return parts.reduce(function (all, part) {
- var lastPart = all[all.length - 1];
- if (!lastPart ||
- lastPart.type !== 0 /* literal */ ||
- part.type !== 0 /* literal */) {
- all.push(part);
- }
- else {
- lastPart.value += part.value;
- }
- return all;
- }, []);
- }
- // TODO(skeleton): add skeleton support
- function formatToParts(els, locales, formatters, formats, values, currentPluralValue,
- // For debugging
- originalMessage) {
- // Hot path for straight simple msg translations
- if (els.length === 1 && dist$1.isLiteralElement(els[0])) {
- var value = els[0].value;
- if (typeof currentPluralValue === 'number') {
- value = value.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
- }
- return [
- {
- type: 0 /* literal */,
- value: value.replace(ESCAPE_HASH_REGEX, '#'),
- },
- ];
- }
- var result = [];
- for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {
- var el = els_1[_i];
- // Exit early for string parts.
- if (dist$1.isLiteralElement(el)) {
- var value_1 = el.value;
- if (typeof currentPluralValue === 'number') {
- value_1 = value_1.replace(PLURAL_HASH, '$1' + formatters.getNumberFormat(locales).format(currentPluralValue));
- }
- result.push({
- type: 0 /* literal */,
- value: value_1.replace(ESCAPE_HASH_REGEX, '#'),
- });
- continue;
- }
- var varName = el.value;
- // Enforce that all required values are provided by the caller.
- if (!(values && varName in values)) {
- throw new FormatError("The intl string context variable \"" + varName + "\" was not provided to the string \"" + originalMessage + "\"");
- }
- var value = values[varName];
- if (dist$1.isArgumentElement(el)) {
- if (!value || typeof value === 'string' || typeof value === 'number') {
- value =
- typeof value === 'string' || typeof value === 'number'
- ? String(value)
- : '';
- }
- result.push({
- type: 1 /* argument */,
- value: value,
- });
- continue;
- }
- // 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 (dist$1.isDateElement(el)) {
- var style = typeof el.style === 'string' ? formats.date[el.style] : undefined;
- result.push({
- type: 0 /* literal */,
- value: formatters
- .getDateTimeFormat(locales, style)
- .format(value),
- });
- continue;
- }
- if (dist$1.isTimeElement(el)) {
- var style = typeof el.style === 'string'
- ? formats.time[el.style]
- : dist$1.isDateTimeSkeleton(el.style)
- ? dist$1.parseDateTimeSkeleton(el.style.pattern)
- : undefined;
- result.push({
- type: 0 /* literal */,
- value: formatters
- .getDateTimeFormat(locales, style)
- .format(value),
- });
- continue;
- }
- if (dist$1.isNumberElement(el)) {
- var style = typeof el.style === 'string'
- ? formats.number[el.style]
- : dist$1.isNumberSkeleton(el.style)
- ? dist$1.convertNumberSkeletonToNumberFormatOptions(el.style.tokens)
- : undefined;
- result.push({
- type: 0 /* literal */,
- value: formatters
- .getNumberFormat(locales, style)
- .format(value),
- });
- continue;
- }
- if (dist$1.isSelectElement(el)) {
- var opt = el.options[value] || el.options.other;
- if (!opt) {
- throw new RangeError("Invalid values for \"" + el.value + "\": \"" + value + "\". Options are \"" + Object.keys(el.options).join('", "') + "\"");
- }
- result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));
- continue;
- }
- if (dist$1.isPluralElement(el)) {
- var opt = el.options["=" + value];
- if (!opt) {
- if (!Intl.PluralRules) {
- throw new FormatError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n");
- }
- var rule = formatters
- .getPluralRules(locales, { type: el.pluralType })
- .select(value - (el.offset || 0));
- opt = el.options[rule] || el.options.other;
- }
- if (!opt) {
- throw new RangeError("Invalid values for \"" + el.value + "\": \"" + value + "\". Options are \"" + Object.keys(el.options).join('", "') + "\"");
- }
- result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));
- continue;
- }
- }
- return mergeLiteral(result);
- }
- exports.formatToParts = formatToParts;
- function formatToString(els, locales, formatters, formats, values,
- // For debugging
- originalMessage) {
- var parts = formatToParts(els, locales, formatters, formats, values, undefined, originalMessage);
- // Hot path for straight simple msg translations
- if (parts.length === 1) {
- return parts[0].value;
- }
- return parts.reduce(function (all, part) { return (all += part.value); }, '');
- }
- exports.formatToString = formatToString;
- // Singleton
- var domParser;
- var TOKEN_DELIMITER = '@@';
- var TOKEN_REGEX = /@@(\d+_\d+)@@/g;
- var counter = 0;
- function generateId() {
- return Date.now() + "_" + ++counter;
- }
- function restoreRichPlaceholderMessage(text, objectParts) {
- return text
- .split(TOKEN_REGEX)
- .filter(Boolean)
- .map(function (c) { return (objectParts[c] != null ? objectParts[c] : c); })
- .reduce(function (all, c) {
- if (!all.length) {
- all.push(c);
- }
- else if (typeof c === 'string' &&
- typeof all[all.length - 1] === 'string') {
- all[all.length - 1] += c;
- }
- else {
- all.push(c);
- }
- return all;
- }, []);
- }
- /**
- * Not exhaustive, just for sanity check
- */
- var SIMPLE_XML_REGEX = /(<([0-9a-zA-Z-_]*?)>(.*?)<\/([0-9a-zA-Z-_]*?)>)|(<[0-9a-zA-Z-_]*?\/>)/;
- var TEMPLATE_ID = Date.now() + '@@';
- var VOID_ELEMENTS = [
- 'area',
- 'base',
- 'br',
- 'col',
- 'embed',
- 'hr',
- 'img',
- 'input',
- 'link',
- 'meta',
- 'param',
- 'source',
- 'track',
- 'wbr',
- ];
- function formatHTMLElement(el, objectParts, values) {
- var tagName = el.tagName;
- var outerHTML = el.outerHTML, textContent = el.textContent, childNodes = el.childNodes;
- // Regular text
- if (!tagName) {
- return restoreRichPlaceholderMessage(textContent || '', objectParts);
- }
- tagName = tagName.toLowerCase();
- var isVoidElement = ~VOID_ELEMENTS.indexOf(tagName);
- var formatFnOrValue = values[tagName];
- if (formatFnOrValue && isVoidElement) {
- throw new FormatError(tagName + " is a self-closing tag and can not be used, please use another tag name.");
- }
- if (!childNodes.length) {
- return [outerHTML];
- }
- var chunks = Array.prototype.slice.call(childNodes).reduce(function (all, child) {
- return all.concat(formatHTMLElement(child, objectParts, values));
- }, []);
- // Legacy HTML
- if (!formatFnOrValue) {
- return __spreadArrays(["<" + tagName + ">"], chunks, ["</" + tagName + ">"]);
- }
- // HTML Tag replacement
- if (typeof formatFnOrValue === 'function') {
- return [formatFnOrValue.apply(void 0, chunks)];
- }
- return [formatFnOrValue];
- }
- function formatHTMLMessage(els, locales, formatters, formats, values,
- // For debugging
- originalMessage) {
- var parts = formatToParts(els, locales, formatters, formats, values, undefined, originalMessage);
- var objectParts = {};
- var formattedMessage = parts.reduce(function (all, part) {
- if (part.type === 0 /* literal */) {
- return (all += part.value);
- }
- var id = generateId();
- objectParts[id] = part.value;
- return (all += "" + TOKEN_DELIMITER + id + TOKEN_DELIMITER);
- }, '');
- // Not designed to filter out aggressively
- if (!SIMPLE_XML_REGEX.test(formattedMessage)) {
- return restoreRichPlaceholderMessage(formattedMessage, objectParts);
- }
- if (!values) {
- throw new FormatError('Message has placeholders but no values was given');
- }
- if (typeof DOMParser === 'undefined') {
- throw new FormatError('Cannot format XML message without DOMParser');
- }
- if (!domParser) {
- domParser = new DOMParser();
- }
- var content = domParser
- .parseFromString("<formatted-message id=\"" + TEMPLATE_ID + "\">" + formattedMessage + "</formatted-message>", 'text/html')
- .getElementById(TEMPLATE_ID);
- if (!content) {
- throw new FormatError("Malformed HTML message " + formattedMessage);
- }
- var tagsToFormat = Object.keys(values).filter(function (varName) { return !!content.getElementsByTagName(varName).length; });
- // No tags to format
- if (!tagsToFormat.length) {
- return restoreRichPlaceholderMessage(formattedMessage, objectParts);
- }
- var caseSensitiveTags = tagsToFormat.filter(function (tagName) { return tagName !== tagName.toLowerCase(); });
- if (caseSensitiveTags.length) {
- throw new FormatError("HTML tag must be lowercased but the following tags are not: " + caseSensitiveTags.join(', '));
- }
- // We're doing this since top node is `<formatted-message/>` which does not have a formatter
- return Array.prototype.slice
- .call(content.childNodes)
- .reduce(function (all, child) { return all.concat(formatHTMLElement(child, objectParts, values)); }, []);
- }
- exports.formatHTMLMessage = formatHTMLMessage;
- });
-
- styleInject_es.unwrapExports(formatters);
- var formatters_1 = formatters.formatToParts;
- var formatters_2 = formatters.formatToString;
- var formatters_3 = formatters.formatHTMLMessage;
-
- var core = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- Copyright (c) 2014, Yahoo! Inc. All rights reserved.
- Copyrights licensed under the New BSD License.
- See the accompanying LICENSE file for terms.
- */
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
- // -- MessageFormat --------------------------------------------------------
- function mergeConfig(c1, c2) {
- if (!c2) {
- return c1;
- }
- return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {
- all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));
- return all;
- }, {}));
- }
- function mergeConfigs(defaultConfig, configs) {
- if (!configs) {
- return defaultConfig;
- }
- return Object.keys(defaultConfig).reduce(function (all, k) {
- all[k] = mergeConfig(defaultConfig[k], configs[k]);
- return all;
- }, __assign({}, defaultConfig));
- }
- function createDefaultFormatters(cache) {
- if (cache === void 0) { cache = {
- number: {},
- dateTime: {},
- pluralRules: {},
- }; }
- return {
- getNumberFormat: dist$2.default(Intl.NumberFormat, cache.number),
- getDateTimeFormat: dist$2.default(Intl.DateTimeFormat, cache.dateTime),
- getPluralRules: dist$2.default(Intl.PluralRules, cache.pluralRules),
- };
- }
- exports.createDefaultFormatters = createDefaultFormatters;
- var IntlMessageFormat = /** @class */ (function () {
- function IntlMessageFormat(message, locales, overrideFormats, opts) {
- var _this = this;
- if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }
- this.formatterCache = {
- number: {},
- dateTime: {},
- pluralRules: {},
- };
- this.format = function (values) {
- return formatters.formatToString(_this.ast, _this.locales, _this.formatters, _this.formats, values, _this.message);
- };
- this.formatToParts = function (values) {
- return formatters.formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);
- };
- this.formatHTMLMessage = function (values) {
- return formatters.formatHTMLMessage(_this.ast, _this.locales, _this.formatters, _this.formats, values, _this.message);
- };
- this.resolvedOptions = function () { return ({
- locale: Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],
- }); };
- this.getAst = function () { return _this.ast; };
- if (typeof message === 'string') {
- this.message = message;
- if (!IntlMessageFormat.__parse) {
- throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');
- }
- // Parse string messages into an AST.
- this.ast = IntlMessageFormat.__parse(message, {
- normalizeHashtagInPlural: false,
- });
- }
- else {
- this.ast = message;
- }
- if (!Array.isArray(this.ast)) {
- 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.
- this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);
- // Defined first because it's used to build the format pattern.
- this.locales = locales;
- this.formatters =
- (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);
- }
- IntlMessageFormat.defaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
- IntlMessageFormat.__parse = dist$1.parse;
- // 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.
- IntlMessageFormat.formats = {
- 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',
- },
- },
- };
- return IntlMessageFormat;
- }());
- exports.IntlMessageFormat = IntlMessageFormat;
- exports.default = IntlMessageFormat;
- });
-
- styleInject_es.unwrapExports(core);
- var core_1 = core.createDefaultFormatters;
- var core_2 = core.IntlMessageFormat;
-
- var dist$3 = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- Copyright (c) 2014, Yahoo! Inc. All rights reserved.
- Copyrights licensed under the New BSD License.
- See the accompanying LICENSE file for terms.
- */
- function __export(m) {
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- Object.defineProperty(exports, "__esModule", { value: true });
-
- __export(formatters);
- __export(core);
- exports.default = core.default;
- });
-
- styleInject_es.unwrapExports(dist$3);
-
- /**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
- /**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
- var invariant = function(condition, format, a, b, c, d, e, f) {
- if (process.env.NODE_ENV !== 'production') {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error(
- 'Minified exception occurred; use the non-minified dev environment ' +
- 'for the full error message and additional helpful warnings.'
- );
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(
- format.replace(/%s/g, function() { return args[argIndex++]; })
- );
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
- };
-
- var browser = invariant;
-
- var utils = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- HTML escaping is the same as React's
- (on purpose.) Therefore, it has the following Copyright and Licensing:
-
- Copyright 2013-2014, Facebook, Inc.
- All rights reserved.
-
- This source code is licensed under the BSD-style license found in the LICENSE
- file in the root directory of React's source tree.
- */
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
- // Since rollup cannot deal with namespace being a function,
- // this is to interop with TypeScript since `invariant`
- // does not export a default
- // https://github.com/rollup/rollup/issues/1267
-
- var invariant = browser.default || browser;
- var ESCAPED_CHARS = {
- 38: '&',
- 62: '>',
- 60: '<',
- 34: '"',
- 39: ''',
- };
- var UNSAFE_CHARS_REGEX = /[&><"']/g;
- function escape(str) {
- return ('' + str).replace(UNSAFE_CHARS_REGEX, function (match) { return ESCAPED_CHARS[match.charCodeAt(0)]; });
- }
- exports.escape = escape;
- function filterProps(props, whitelist, defaults) {
- if (defaults === void 0) { defaults = {}; }
- return whitelist.reduce(function (filtered, name) {
- if (name in props) {
- filtered[name] = props[name];
- }
- else if (name in defaults) {
- filtered[name] = defaults[name];
- }
- return filtered;
- }, {});
- }
- exports.filterProps = filterProps;
- function invariantIntlContext(intl) {
- invariant(intl, '[React Intl] Could not find required `intl` object. ' +
- '<IntlProvider> needs to exist in the component ancestry.');
- }
- exports.invariantIntlContext = invariantIntlContext;
- function createError(message, exception) {
- var eMsg = exception ? "\n" + exception.stack : '';
- return "[React Intl] " + message + eMsg;
- }
- exports.createError = createError;
- function defaultErrorHandler(error) {
- if (process.env.NODE_ENV !== 'production') {
- console.error(error);
- }
- }
- exports.defaultErrorHandler = defaultErrorHandler;
- exports.DEFAULT_INTL_CONFIG = {
- formats: {},
- messages: {},
- timeZone: undefined,
- textComponent: React__default.Fragment,
- defaultLocale: 'en',
- defaultFormats: {},
- onError: defaultErrorHandler,
- };
- function createIntlCache() {
- return {
- dateTime: {},
- number: {},
- message: {},
- relativeTime: {},
- pluralRules: {},
- list: {},
- };
- }
- exports.createIntlCache = createIntlCache;
- /**
- * Create intl formatters and populate cache
- * @param cache explicit cache to prevent leaking memory
- */
- function createFormatters(cache) {
- if (cache === void 0) { cache = createIntlCache(); }
- var RelativeTimeFormat = Intl.RelativeTimeFormat;
- var ListFormat = Intl.ListFormat;
- return {
- getDateTimeFormat: dist$2.default(Intl.DateTimeFormat, cache.dateTime),
- getNumberFormat: dist$2.default(Intl.NumberFormat, cache.number),
- getMessageFormat: dist$2.default(dist$3.default, cache.message),
- getRelativeTimeFormat: dist$2.default(RelativeTimeFormat, cache.relativeTime),
- getPluralRules: dist$2.default(Intl.PluralRules, cache.pluralRules),
- getListFormat: dist$2.default(ListFormat, cache.list),
- };
- }
- exports.createFormatters = createFormatters;
- function getNamedFormat(formats, type, name, onError) {
- var formatType = formats && formats[type];
- var format;
- if (formatType) {
- format = formatType[name];
- }
- if (format) {
- return format;
- }
- onError(createError("No " + type + " format named: " + name));
- }
- exports.getNamedFormat = getNamedFormat;
- });
-
- styleInject_es.unwrapExports(utils);
- var utils_1 = utils.escape;
- var utils_2 = utils.filterProps;
- var utils_3 = utils.invariantIntlContext;
- var utils_4 = utils.createError;
- var utils_5 = utils.defaultErrorHandler;
- var utils_6 = utils.DEFAULT_INTL_CONFIG;
- var utils_7 = utils.createIntlCache;
- var utils_8 = utils.createFormatters;
- var utils_9 = utils.getNamedFormat;
-
- var reactIs_production_min = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports,"__esModule",{value:!0});
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?Symbol.for("react.suspense_list"):
- 60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.fundamental"):60117,w=b?Symbol.for("react.responder"):60118,x=b?Symbol.for("react.scope"):60119;function y(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function z(a){return y(a)===m}
- exports.typeOf=y;exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;exports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;
- exports.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===v||a.$$typeof===w||a.$$typeof===x)};exports.isAsyncMode=function(a){return z(a)||y(a)===l};exports.isConcurrentMode=z;exports.isContextConsumer=function(a){return y(a)===k};exports.isContextProvider=function(a){return y(a)===h};
- exports.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return y(a)===n};exports.isFragment=function(a){return y(a)===e};exports.isLazy=function(a){return y(a)===t};exports.isMemo=function(a){return y(a)===r};exports.isPortal=function(a){return y(a)===d};exports.isProfiler=function(a){return y(a)===g};exports.isStrictMode=function(a){return y(a)===f};exports.isSuspense=function(a){return y(a)===p};
- });
-
- styleInject_es.unwrapExports(reactIs_production_min);
- var reactIs_production_min_1 = reactIs_production_min.typeOf;
- var reactIs_production_min_2 = reactIs_production_min.AsyncMode;
- var reactIs_production_min_3 = reactIs_production_min.ConcurrentMode;
- var reactIs_production_min_4 = reactIs_production_min.ContextConsumer;
- var reactIs_production_min_5 = reactIs_production_min.ContextProvider;
- var reactIs_production_min_6 = reactIs_production_min.Element;
- var reactIs_production_min_7 = reactIs_production_min.ForwardRef;
- var reactIs_production_min_8 = reactIs_production_min.Fragment;
- var reactIs_production_min_9 = reactIs_production_min.Lazy;
- var reactIs_production_min_10 = reactIs_production_min.Memo;
- var reactIs_production_min_11 = reactIs_production_min.Portal;
- var reactIs_production_min_12 = reactIs_production_min.Profiler;
- var reactIs_production_min_13 = reactIs_production_min.StrictMode;
- var reactIs_production_min_14 = reactIs_production_min.Suspense;
- var reactIs_production_min_15 = reactIs_production_min.isValidElementType;
- var reactIs_production_min_16 = reactIs_production_min.isAsyncMode;
- var reactIs_production_min_17 = reactIs_production_min.isConcurrentMode;
- var reactIs_production_min_18 = reactIs_production_min.isContextConsumer;
- var reactIs_production_min_19 = reactIs_production_min.isContextProvider;
- var reactIs_production_min_20 = reactIs_production_min.isElement;
- var reactIs_production_min_21 = reactIs_production_min.isForwardRef;
- var reactIs_production_min_22 = reactIs_production_min.isFragment;
- var reactIs_production_min_23 = reactIs_production_min.isLazy;
- var reactIs_production_min_24 = reactIs_production_min.isMemo;
- var reactIs_production_min_25 = reactIs_production_min.isPortal;
- var reactIs_production_min_26 = reactIs_production_min.isProfiler;
- var reactIs_production_min_27 = reactIs_production_min.isStrictMode;
- var reactIs_production_min_28 = reactIs_production_min.isSuspense;
-
- var reactIs_development = styleInject_es.createCommonjsModule(function (module, exports) {
-
-
-
- if (process.env.NODE_ENV !== "production") {
- (function() {
-
- Object.defineProperty(exports, '__esModule', { value: true });
-
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
- // nor polyfill, then a plain number is used for performance.
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
- // (unstable) APIs that have been removed. Can we remove the symbols?
-
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
-
- function isValidElementType(type) {
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
- }
-
- /**
- * Forked from fbjs/warning:
- * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
- *
- * Only change is we use console.warn instead of console.error,
- * and do nothing when 'console' is not supported.
- * This really simplifies the code.
- * ---
- * Similar to invariant but only logs a warning if the condition is not met.
- * This can be used to log issues in development environments in critical
- * paths. Removing the logging code for production environments will keep the
- * same logic and follow the same code paths.
- */
- var lowPriorityWarningWithoutStack = function () {};
-
- {
- var printWarning = function (format) {
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
- args[_key - 1] = arguments[_key];
- }
-
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, function () {
- return args[argIndex++];
- });
-
- if (typeof console !== 'undefined') {
- console.warn(message);
- }
-
- try {
- // --- Welcome to debugging React ---
- // This error was thrown as a convenience so that you can use this stack
- // to find the callsite that caused this warning to fire.
- throw new Error(message);
- } catch (x) {}
- };
-
- lowPriorityWarningWithoutStack = function (condition, format) {
- if (format === undefined) {
- throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
- }
-
- if (!condition) {
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
- args[_key2 - 2] = arguments[_key2];
- }
-
- printWarning.apply(void 0, [format].concat(args));
- }
- };
- }
-
- var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
-
- function typeOf(object) {
- if (typeof object === 'object' && object !== null) {
- var $$typeof = object.$$typeof;
-
- switch ($$typeof) {
- case REACT_ELEMENT_TYPE:
- var type = object.type;
-
- switch (type) {
- case REACT_ASYNC_MODE_TYPE:
- case REACT_CONCURRENT_MODE_TYPE:
- case REACT_FRAGMENT_TYPE:
- case REACT_PROFILER_TYPE:
- case REACT_STRICT_MODE_TYPE:
- case REACT_SUSPENSE_TYPE:
- return type;
-
- default:
- var $$typeofType = type && type.$$typeof;
-
- switch ($$typeofType) {
- case REACT_CONTEXT_TYPE:
- case REACT_FORWARD_REF_TYPE:
- case REACT_LAZY_TYPE:
- case REACT_MEMO_TYPE:
- case REACT_PROVIDER_TYPE:
- return $$typeofType;
-
- default:
- return $$typeof;
- }
-
- }
-
- case REACT_PORTAL_TYPE:
- return $$typeof;
- }
- }
-
- return undefined;
- } // AsyncMode is deprecated along with isAsyncMode
-
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
- var ContextConsumer = REACT_CONTEXT_TYPE;
- var ContextProvider = REACT_PROVIDER_TYPE;
- var Element = REACT_ELEMENT_TYPE;
- var ForwardRef = REACT_FORWARD_REF_TYPE;
- var Fragment = REACT_FRAGMENT_TYPE;
- var Lazy = REACT_LAZY_TYPE;
- var Memo = REACT_MEMO_TYPE;
- var Portal = REACT_PORTAL_TYPE;
- var Profiler = REACT_PROFILER_TYPE;
- var StrictMode = REACT_STRICT_MODE_TYPE;
- var Suspense = REACT_SUSPENSE_TYPE;
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
-
- function isAsyncMode(object) {
- {
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
- hasWarnedAboutDeprecatedIsAsyncMode = true;
- lowPriorityWarningWithoutStack$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
- }
- }
-
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
- }
- function isConcurrentMode(object) {
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
- }
- function isContextConsumer(object) {
- return typeOf(object) === REACT_CONTEXT_TYPE;
- }
- function isContextProvider(object) {
- return typeOf(object) === REACT_PROVIDER_TYPE;
- }
- function isElement(object) {
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
- }
- function isForwardRef(object) {
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
- }
- function isFragment(object) {
- return typeOf(object) === REACT_FRAGMENT_TYPE;
- }
- function isLazy(object) {
- return typeOf(object) === REACT_LAZY_TYPE;
- }
- function isMemo(object) {
- return typeOf(object) === REACT_MEMO_TYPE;
- }
- function isPortal(object) {
- return typeOf(object) === REACT_PORTAL_TYPE;
- }
- function isProfiler(object) {
- return typeOf(object) === REACT_PROFILER_TYPE;
- }
- function isStrictMode(object) {
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
- }
- function isSuspense(object) {
- return typeOf(object) === REACT_SUSPENSE_TYPE;
- }
-
- exports.typeOf = typeOf;
- exports.AsyncMode = AsyncMode;
- exports.ConcurrentMode = ConcurrentMode;
- exports.ContextConsumer = ContextConsumer;
- exports.ContextProvider = ContextProvider;
- exports.Element = Element;
- exports.ForwardRef = ForwardRef;
- exports.Fragment = Fragment;
- exports.Lazy = Lazy;
- exports.Memo = Memo;
- exports.Portal = Portal;
- exports.Profiler = Profiler;
- exports.StrictMode = StrictMode;
- exports.Suspense = Suspense;
- exports.isValidElementType = isValidElementType;
- exports.isAsyncMode = isAsyncMode;
- exports.isConcurrentMode = isConcurrentMode;
- exports.isContextConsumer = isContextConsumer;
- exports.isContextProvider = isContextProvider;
- exports.isElement = isElement;
- exports.isForwardRef = isForwardRef;
- exports.isFragment = isFragment;
- exports.isLazy = isLazy;
- exports.isMemo = isMemo;
- exports.isPortal = isPortal;
- exports.isProfiler = isProfiler;
- exports.isStrictMode = isStrictMode;
- exports.isSuspense = isSuspense;
- })();
- }
- });
-
- styleInject_es.unwrapExports(reactIs_development);
- var reactIs_development_1 = reactIs_development.typeOf;
- var reactIs_development_2 = reactIs_development.AsyncMode;
- var reactIs_development_3 = reactIs_development.ConcurrentMode;
- var reactIs_development_4 = reactIs_development.ContextConsumer;
- var reactIs_development_5 = reactIs_development.ContextProvider;
- var reactIs_development_6 = reactIs_development.Element;
- var reactIs_development_7 = reactIs_development.ForwardRef;
- var reactIs_development_8 = reactIs_development.Fragment;
- var reactIs_development_9 = reactIs_development.Lazy;
- var reactIs_development_10 = reactIs_development.Memo;
- var reactIs_development_11 = reactIs_development.Portal;
- var reactIs_development_12 = reactIs_development.Profiler;
- var reactIs_development_13 = reactIs_development.StrictMode;
- var reactIs_development_14 = reactIs_development.Suspense;
- var reactIs_development_15 = reactIs_development.isValidElementType;
- var reactIs_development_16 = reactIs_development.isAsyncMode;
- var reactIs_development_17 = reactIs_development.isConcurrentMode;
- var reactIs_development_18 = reactIs_development.isContextConsumer;
- var reactIs_development_19 = reactIs_development.isContextProvider;
- var reactIs_development_20 = reactIs_development.isElement;
- var reactIs_development_21 = reactIs_development.isForwardRef;
- var reactIs_development_22 = reactIs_development.isFragment;
- var reactIs_development_23 = reactIs_development.isLazy;
- var reactIs_development_24 = reactIs_development.isMemo;
- var reactIs_development_25 = reactIs_development.isPortal;
- var reactIs_development_26 = reactIs_development.isProfiler;
- var reactIs_development_27 = reactIs_development.isStrictMode;
- var reactIs_development_28 = reactIs_development.isSuspense;
-
- var reactIs = styleInject_es.createCommonjsModule(function (module) {
-
- if (process.env.NODE_ENV === 'production') {
- module.exports = reactIs_production_min;
- } else {
- module.exports = reactIs_development;
- }
- });
-
- /**
- * Copyright 2015, Yahoo! Inc.
- * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
- */
- var REACT_STATICS = {
- childContextTypes: true,
- contextType: true,
- contextTypes: true,
- defaultProps: true,
- displayName: true,
- getDefaultProps: true,
- getDerivedStateFromError: true,
- getDerivedStateFromProps: true,
- mixins: true,
- propTypes: true,
- type: true
- };
- var KNOWN_STATICS = {
- name: true,
- length: true,
- prototype: true,
- caller: true,
- callee: true,
- arguments: true,
- arity: true
- };
- var FORWARD_REF_STATICS = {
- '$$typeof': true,
- render: true,
- defaultProps: true,
- displayName: true,
- propTypes: true
- };
- var MEMO_STATICS = {
- '$$typeof': true,
- compare: true,
- defaultProps: true,
- displayName: true,
- propTypes: true,
- type: true
- };
- var TYPE_STATICS = {};
- TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
-
- function getStatics(component) {
- if (reactIs.isMemo(component)) {
- return MEMO_STATICS;
- }
-
- return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
- }
-
- var defineProperty = Object.defineProperty;
- var getOwnPropertyNames = Object.getOwnPropertyNames;
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
- var getPrototypeOf = Object.getPrototypeOf;
- var objectPrototype = Object.prototype;
- function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
- if (typeof sourceComponent !== 'string') {
- // don't hoist over string (html) components
- if (objectPrototype) {
- var inheritedComponent = getPrototypeOf(sourceComponent);
-
- if (inheritedComponent && inheritedComponent !== objectPrototype) {
- hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
- }
- }
-
- var keys = getOwnPropertyNames(sourceComponent);
-
- if (getOwnPropertySymbols) {
- keys = keys.concat(getOwnPropertySymbols(sourceComponent));
- }
-
- var targetStatics = getStatics(targetComponent);
- var sourceStatics = getStatics(sourceComponent);
-
- for (var i = 0; i < keys.length; ++i) {
- var key = keys[i];
-
- if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
- var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
-
- try {
- // Avoid failures from read-only properties
- defineProperty(targetComponent, key, descriptor);
- } catch (e) {}
- }
- }
- }
-
- return targetComponent;
- }
-
- var hoistNonReactStatics_cjs = hoistNonReactStatics;
-
- var injectIntl_1 = styleInject_es.createCommonjsModule(function (module, exports) {
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
- // Since rollup cannot deal with namespace being a function,
- // this is to interop with TypeScript since `invariant`
- // does not export a default
- // https://github.com/rollup/rollup/issues/1267
- var hoistNonReactStatics = hoistNonReactStatics_cjs.default || hoistNonReactStatics_cjs;
-
- function getDisplayName(Component) {
- return Component.displayName || Component.name || 'Component';
- }
- // TODO: We should provide initial value here
- var IntlContext = React__default.createContext(null);
- var IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider;
- exports.Provider = IntlProvider;
- exports.Context = IntlContext;
- function injectIntl(WrappedComponent, options) {
- var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === void 0 ? 'intl' : _b, _c = _a.forwardRef, forwardRef = _c === void 0 ? false : _c, _d = _a.enforceContext, enforceContext = _d === void 0 ? true : _d;
- var WithIntl = function (props) { return (React__default.createElement(IntlConsumer, null, function (intl) {
- var _a;
- if (enforceContext) {
- utils.invariantIntlContext(intl);
- }
- return (React__default.createElement(WrappedComponent, __assign({}, props, (_a = {},
- _a[intlPropName] = intl,
- _a), { ref: forwardRef ? props.forwardedRef : null })));
- })); };
- WithIntl.displayName = "injectIntl(" + getDisplayName(WrappedComponent) + ")";
- WithIntl.WrappedComponent = WrappedComponent;
- if (forwardRef) {
- return hoistNonReactStatics(React__default.forwardRef(function (props, ref) { return (React__default.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);
- }
- return hoistNonReactStatics(WithIntl, WrappedComponent);
- }
- exports.default = injectIntl;
- });
-
- styleInject_es.unwrapExports(injectIntl_1);
- var injectIntl_2 = injectIntl_1.Provider;
- var injectIntl_3 = injectIntl_1.Context;
-
- var createFormattedComponent_1 = styleInject_es.createCommonjsModule(function (module, exports) {
- var __rest = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__rest) || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
- t[p[i]] = s[p[i]];
- return t;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
- var DisplayName;
- (function (DisplayName) {
- DisplayName["formatDate"] = "FormattedDate";
- DisplayName["formatTime"] = "FormattedTime";
- DisplayName["formatNumber"] = "FormattedNumber";
- DisplayName["formatList"] = "FormattedList";
- })(DisplayName || (DisplayName = {}));
- var DisplayNameParts;
- (function (DisplayNameParts) {
- DisplayNameParts["formatDate"] = "FormattedDateParts";
- DisplayNameParts["formatTime"] = "FormattedTimeParts";
- DisplayNameParts["formatNumber"] = "FormattedNumberParts";
- DisplayNameParts["formatList"] = "FormattedListParts";
- })(DisplayNameParts || (DisplayNameParts = {}));
- exports.FormattedNumberParts = function (props) { return (React__default.createElement(injectIntl_1.Context.Consumer, null, function (intl) {
- utils.invariantIntlContext(intl);
- var value = props.value, children = props.children, formatProps = __rest(props, ["value", "children"]);
- return children(intl.formatNumberToParts(value, formatProps));
- })); };
- exports.FormattedNumberParts.displayName = 'FormattedNumberParts';
- function createFormattedDateTimePartsComponent(name) {
- var ComponentParts = function (props) { return (React__default.createElement(injectIntl_1.Context.Consumer, null, function (intl) {
- utils.invariantIntlContext(intl);
- var value = props.value, children = props.children, formatProps = __rest(props, ["value", "children"]);
- var date = typeof value === 'string' ? new Date(value || 0) : value;
- var formattedParts = name === 'formatDate'
- ? intl.formatDateToParts(date, formatProps)
- : intl.formatTimeToParts(date, formatProps);
- return children(formattedParts);
- })); };
- ComponentParts.displayName = DisplayNameParts[name];
- return ComponentParts;
- }
- exports.createFormattedDateTimePartsComponent = createFormattedDateTimePartsComponent;
- function createFormattedComponent(name) {
- var Component = function (props) { return (React__default.createElement(injectIntl_1.Context.Consumer, null, function (intl) {
- utils.invariantIntlContext(intl);
- var value = props.value, children = props.children, formatProps = __rest(props, ["value", "children"]);
- // TODO: fix TS type definition for localeMatcher upstream
- var formattedValue = intl[name](value, formatProps);
- if (typeof children === 'function') {
- return children(formattedValue);
- }
- var Text = intl.textComponent || React__default.Fragment;
- return React__default.createElement(Text, null, formattedValue);
- })); };
- Component.displayName = DisplayName[name];
- return Component;
- }
- exports.createFormattedComponent = createFormattedComponent;
- });
-
- styleInject_es.unwrapExports(createFormattedComponent_1);
- var createFormattedComponent_2 = createFormattedComponent_1.FormattedNumberParts;
- var createFormattedComponent_3 = createFormattedComponent_1.createFormattedDateTimePartsComponent;
- var createFormattedComponent_4 = createFormattedComponent_1.createFormattedComponent;
-
- var useIntl_1 = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
- function useIntl() {
- var intl = React__default.useContext(injectIntl_1.Context);
- utils.invariantIntlContext(intl);
- return intl;
- }
- exports.default = useIntl;
- });
-
- styleInject_es.unwrapExports(useIntl_1);
-
- var dist$4 = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- Object.defineProperty(exports, "__esModule", { value: true });
- function areIntlLocalesSupported(locales, constructorsToCheck) {
- if (typeof Intl === 'undefined') {
- return false;
- }
- if (!locales) {
- throw new Error('locales must be supplied.');
- }
- if (!Array.isArray(locales)) {
- locales = [locales];
- }
- var intlConstructors = constructorsToCheck || [
- Intl.DateTimeFormat,
- Intl.NumberFormat,
- Intl.PluralRules,
- ];
- intlConstructors = intlConstructors.filter(Boolean);
- if (intlConstructors.length === 0 ||
- (constructorsToCheck &&
- intlConstructors.length !== constructorsToCheck.length)) {
- return false;
- }
- return intlConstructors.every(function (intlConstructor) {
- return intlConstructor.supportedLocalesOf(locales).length === locales.length;
- });
- }
- exports.default = areIntlLocalesSupported;
- });
-
- styleInject_es.unwrapExports(dist$4);
-
- var number = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
-
- var NUMBER_FORMAT_OPTIONS = [
- 'localeMatcher',
- 'style',
- 'currency',
- 'currencyDisplay',
- 'unit',
- 'unitDisplay',
- 'useGrouping',
- 'minimumIntegerDigits',
- 'minimumFractionDigits',
- 'maximumFractionDigits',
- 'minimumSignificantDigits',
- 'maximumSignificantDigits',
- // Unified NumberFormat (Stage 3 as of 10/22/19)
- 'compactDisplay',
- 'currencyDisplay',
- 'currencySign',
- 'notation',
- 'signDisplay',
- 'unit',
- 'unitDisplay',
- ];
- function getFormatter(_a, getNumberFormat, options) {
- var locale = _a.locale, formats = _a.formats, onError = _a.onError;
- if (options === void 0) { options = {}; }
- var format = options.format;
- var defaults = ((format &&
- utils.getNamedFormat(formats, 'number', format, onError)) ||
- {});
- var filteredOptions = utils.filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);
- return getNumberFormat(locale, filteredOptions);
- }
- exports.getFormatter = getFormatter;
- function formatNumber(config, getNumberFormat, value, options) {
- if (options === void 0) { options = {}; }
- try {
- return getFormatter(config, getNumberFormat, options).format(value);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting number.', e));
- }
- return String(value);
- }
- exports.formatNumber = formatNumber;
- function formatNumberToParts(config, getNumberFormat, value, options) {
- if (options === void 0) { options = {}; }
- try {
- return getFormatter(config, getNumberFormat, options).formatToParts(value);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting number.', e));
- }
- return [];
- }
- exports.formatNumberToParts = formatNumberToParts;
- });
-
- styleInject_es.unwrapExports(number);
- var number_1 = number.getFormatter;
- var number_2 = number.formatNumber;
- var number_3 = number.formatNumberToParts;
-
- var relativeTime = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
-
- var RELATIVE_TIME_FORMAT_OPTIONS = [
- 'numeric',
- 'style',
- ];
- function getFormatter(_a, getRelativeTimeFormat, options) {
- var locale = _a.locale, formats = _a.formats, onError = _a.onError;
- if (options === void 0) { options = {}; }
- var format = options.format;
- var defaults = (!!format && utils.getNamedFormat(formats, 'relative', format, onError)) || {};
- var filteredOptions = utils.filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);
- return getRelativeTimeFormat(locale, filteredOptions);
- }
- function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {
- if (options === void 0) { options = {}; }
- if (!unit) {
- unit = 'second';
- }
- var RelativeTimeFormat = Intl.RelativeTimeFormat;
- if (!RelativeTimeFormat) {
- config.onError(utils.createError("Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-relativetimeformat\"\n"));
- }
- try {
- return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting relative time.', e));
- }
- return String(value);
- }
- exports.formatRelativeTime = formatRelativeTime;
- });
-
- styleInject_es.unwrapExports(relativeTime);
- var relativeTime_1 = relativeTime.formatRelativeTime;
-
- var dateTime = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
- var DATE_TIME_FORMAT_OPTIONS = [
- 'localeMatcher',
- 'formatMatcher',
- 'timeZone',
- 'hour12',
- 'weekday',
- 'era',
- 'year',
- 'month',
- 'day',
- 'hour',
- 'minute',
- 'second',
- 'timeZoneName',
- ];
- function getFormatter(_a, type, getDateTimeFormat, options) {
- var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;
- if (options === void 0) { options = {}; }
- var format = options.format;
- var defaults = __assign({}, (timeZone && { timeZone: timeZone }), (format && utils.getNamedFormat(formats, type, format, onError)));
- var filteredOptions = utils.filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);
- if (type === 'time' &&
- !filteredOptions.hour &&
- !filteredOptions.minute &&
- !filteredOptions.second) {
- // Add default formatting options if hour, minute, or second isn't defined.
- filteredOptions = __assign({}, filteredOptions, { hour: 'numeric', minute: 'numeric' });
- }
- return getDateTimeFormat(locale, filteredOptions);
- }
- exports.getFormatter = getFormatter;
- function formatDate(config, getDateTimeFormat, value, options) {
- if (options === void 0) { options = {}; }
- var date = typeof value === 'string' ? new Date(value || 0) : value;
- try {
- return getFormatter(config, 'date', getDateTimeFormat, options).format(date);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting date.', e));
- }
- return String(date);
- }
- exports.formatDate = formatDate;
- function formatTime(config, getDateTimeFormat, value, options) {
- if (options === void 0) { options = {}; }
- var date = typeof value === 'string' ? new Date(value || 0) : value;
- try {
- return getFormatter(config, 'time', getDateTimeFormat, options).format(date);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting time.', e));
- }
- return String(date);
- }
- exports.formatTime = formatTime;
- function formatDateToParts(config, getDateTimeFormat, value, options) {
- if (options === void 0) { options = {}; }
- var date = typeof value === 'string' ? new Date(value || 0) : value;
- try {
- return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting date.', e));
- }
- return [];
- }
- exports.formatDateToParts = formatDateToParts;
- function formatTimeToParts(config, getDateTimeFormat, value, options) {
- if (options === void 0) { options = {}; }
- var date = typeof value === 'string' ? new Date(value || 0) : value;
- try {
- return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date);
- }
- catch (e) {
- config.onError(utils.createError('Error formatting time.', e));
- }
- return [];
- }
- exports.formatTimeToParts = formatTimeToParts;
- });
-
- styleInject_es.unwrapExports(dateTime);
- var dateTime_1 = dateTime.getFormatter;
- var dateTime_2 = dateTime.formatDate;
- var dateTime_3 = dateTime.formatTime;
- var dateTime_4 = dateTime.formatDateToParts;
- var dateTime_5 = dateTime.formatTimeToParts;
-
- var plural = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
-
- var PLURAL_FORMAT_OPTIONS = [
- 'localeMatcher',
- 'type',
- ];
- function formatPlural(_a, getPluralRules, value, options) {
- var locale = _a.locale, onError = _a.onError;
- if (options === void 0) { options = {}; }
- if (!Intl.PluralRules) {
- onError(utils.createError("Intl.PluralRules is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-pluralrules\"\n"));
- }
- var filteredOptions = utils.filterProps(options, PLURAL_FORMAT_OPTIONS);
- try {
- return getPluralRules(locale, filteredOptions).select(value);
- }
- catch (e) {
- onError(utils.createError('Error formatting plural.', e));
- }
- return 'other';
- }
- exports.formatPlural = formatPlural;
- });
-
- styleInject_es.unwrapExports(plural);
- var plural_1 = plural.formatPlural;
-
- var message = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- // Since rollup cannot deal with namespace being a function,
- // this is to interop with TypeScript since `invariant`
- // does not export a default
- // https://github.com/rollup/rollup/issues/1267
-
- var invariant = browser.default || browser;
-
-
- function setTimeZoneInOptions(opts, timeZone) {
- return Object.keys(opts).reduce(function (all, k) {
- all[k] = __assign({ timeZone: timeZone }, opts[k]);
- return all;
- }, {});
- }
- function deepMergeOptions(opts1, opts2) {
- var keys = Object.keys(__assign({}, opts1, opts2));
- return keys.reduce(function (all, k) {
- all[k] = __assign({}, (opts1[k] || {}), (opts2[k] || {}));
- return all;
- }, {});
- }
- function deepMergeFormatsAndSetTimeZone(f1, timeZone) {
- if (!timeZone) {
- return f1;
- }
- var mfFormats = dist$3.default.formats;
- return __assign({}, mfFormats, f1, { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });
- }
- function formatMessage(_a, state, messageDescriptor, values) {
- var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, onError = _a.onError, timeZone = _a.timeZone;
- if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
- if (values === void 0) { values = {}; }
- var id = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;
- // `id` is a required field of a Message Descriptor.
- invariant(id, '[React Intl] An `id` must be provided to format a message.');
- if (!id) {
- throw new Error('[React Intl] An `id` must be provided to format a message.');
- }
- var message = messages && messages[id];
- formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);
- defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);
- var formattedMessageParts = [];
- if (message) {
- try {
- var formatter = state.getMessageFormat(message, locale, formats, {
- formatters: state,
- });
- formattedMessageParts = formatter.formatHTMLMessage(values);
- }
- catch (e) {
- onError(utils.createError("Error formatting message: \"" + id + "\" for locale: \"" + locale + "\"" +
- (defaultMessage ? ', using default message as fallback.' : ''), e));
- }
- }
- else {
- // This prevents warnings from littering the console in development
- // when no `messages` are passed into the <IntlProvider> for the
- // default locale, and a default message is in the source.
- if (!defaultMessage ||
- (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {
- onError(utils.createError("Missing message: \"" + id + "\" for locale: \"" + locale + "\"" +
- (defaultMessage ? ', using default message as fallback.' : '')));
- }
- }
- if (!formattedMessageParts.length && defaultMessage) {
- try {
- var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats);
- formattedMessageParts = formatter.formatHTMLMessage(values);
- }
- catch (e) {
- onError(utils.createError("Error formatting the default message for: \"" + id + "\"", e));
- }
- }
- if (!formattedMessageParts.length) {
- onError(utils.createError("Cannot format message: \"" + id + "\", " +
- ("using message " + (message || defaultMessage ? 'source' : 'id') + " as fallback.")));
- if (typeof message === 'string') {
- return message || defaultMessage || id;
- }
- return defaultMessage || id;
- }
- if (formattedMessageParts.length === 1 &&
- typeof formattedMessageParts[0] === 'string') {
- return formattedMessageParts[0] || defaultMessage || id;
- }
- return formattedMessageParts;
- }
- exports.formatMessage = formatMessage;
- function formatHTMLMessage(config, state, messageDescriptor, rawValues) {
- if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }
- if (rawValues === void 0) { rawValues = {}; }
- // Process all the values before they are used when formatting the ICU
- // Message string. Since the formatted message might be injected via
- // `innerHTML`, all String-based values need to be HTML-escaped.
- var escapedValues = Object.keys(rawValues).reduce(function (escaped, name) {
- var value = rawValues[name];
- escaped[name] = typeof value === 'string' ? utils.escape(value) : value;
- return escaped;
- }, {});
- return formatMessage(config, state, messageDescriptor, escapedValues);
- }
- exports.formatHTMLMessage = formatHTMLMessage;
- });
-
- styleInject_es.unwrapExports(message);
- var message_1 = message.formatMessage;
- var message_2 = message.formatHTMLMessage;
-
- function shallowEqualObjects(objA, objB) {
- if (objA === objB) {
- return true;
- }
-
- if (!objA || !objB) {
- return false;
- }
-
- var aKeys = Object.keys(objA);
- var bKeys = Object.keys(objB);
- var len = aKeys.length;
-
- if (bKeys.length !== len) {
- return false;
- }
-
- for (var i = 0; i < len; i++) {
- var key = aKeys[i];
-
- if (objA[key] !== objB[key] || !Object.prototype.hasOwnProperty.call(objB, key)) {
- return false;
- }
- }
-
- return true;
- }
-
- var objects = shallowEqualObjects;
-
- var list = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
-
- var LIST_FORMAT_OPTIONS = [
- 'localeMatcher',
- 'type',
- 'style',
- ];
- var now = Date.now();
- function generateToken(i) {
- return now + "_" + i + "_" + now;
- }
- function formatList(_a, getListFormat, values, options) {
- var locale = _a.locale, onError = _a.onError;
- if (options === void 0) { options = {}; }
- var ListFormat = Intl.ListFormat;
- if (!ListFormat) {
- onError(utils.createError("Intl.ListFormat is not available in this environment.\nTry polyfilling it using \"@formatjs/intl-listformat\"\n"));
- }
- var filteredOptions = utils.filterProps(options, LIST_FORMAT_OPTIONS);
- try {
- var richValues_1 = {};
- var serializedValues = values.map(function (v, i) {
- if (typeof v === 'object') {
- var id = generateToken(i);
- richValues_1[id] = v;
- return id;
- }
- return String(v);
- });
- if (!Object.keys(richValues_1).length) {
- return getListFormat(locale, filteredOptions).format(serializedValues);
- }
- var parts = getListFormat(locale, filteredOptions).formatToParts(serializedValues);
- return parts.reduce(function (all, el) {
- var val = el.value;
- if (richValues_1[val]) {
- all.push(richValues_1[val]);
- }
- else if (typeof all[all.length - 1] === 'string') {
- all[all.length - 1] += val;
- }
- else {
- all.push(val);
- }
- return all;
- }, []);
- }
- catch (e) {
- onError(utils.createError('Error formatting list.', e));
- }
- return values;
- }
- exports.formatList = formatList;
- });
-
- styleInject_es.unwrapExports(list);
- var list_1 = list.formatList;
-
- var provider = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- var __extends = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
-
-
-
-
-
-
-
-
- var shallowEquals = objects.default || objects;
- function processIntlConfig(config) {
- return {
- locale: config.locale,
- timeZone: config.timeZone,
- formats: config.formats,
- textComponent: config.textComponent,
- messages: config.messages,
- defaultLocale: config.defaultLocale,
- defaultFormats: config.defaultFormats,
- onError: config.onError,
- };
- }
- /**
- * Create intl object
- * @param config intl config
- * @param cache cache for formatter instances to prevent memory leak
- */
- function createIntl(config, cache) {
- var formatters = utils.createFormatters(cache);
- var resolvedConfig = __assign({}, utils.DEFAULT_INTL_CONFIG, config);
- if (!resolvedConfig.locale ||
- !dist$4.default(resolvedConfig.locale)) {
- var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;
- if (typeof onError === 'function') {
- onError(utils.createError("Missing locale data for locale: \"" + locale + "\". " +
- ("Using default locale: \"" + defaultLocale + "\" as fallback.")));
- }
- // Since there's no registered locale data for `locale`, this will
- // fallback to the `defaultLocale` to make sure things can render.
- // The `messages` are overridden to the `defaultProps` empty object
- // to maintain referential equality across re-renders. It's assumed
- // each <FormattedMessage> contains a `defaultMessage` prop.
- resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';
- }
- return __assign({}, resolvedConfig, { formatters: formatters, formatNumber: number.formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: number.formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: relativeTime.formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: dateTime.formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: dateTime.formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: dateTime.formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: dateTime.formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: plural.formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), formatMessage: message.formatMessage.bind(null, resolvedConfig, formatters), formatHTMLMessage: message.formatHTMLMessage.bind(null, resolvedConfig, formatters), formatList: list.formatList.bind(null, resolvedConfig, formatters.getListFormat) });
- }
- exports.createIntl = createIntl;
- var IntlProvider = /** @class */ (function (_super) {
- __extends(IntlProvider, _super);
- function IntlProvider() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.cache = utils.createIntlCache();
- _this.state = {
- cache: _this.cache,
- intl: createIntl(processIntlConfig(_this.props), _this.cache),
- prevConfig: processIntlConfig(_this.props),
- };
- return _this;
- }
- IntlProvider.getDerivedStateFromProps = function (props, _a) {
- var prevConfig = _a.prevConfig, cache = _a.cache;
- var config = processIntlConfig(props);
- if (!shallowEquals(prevConfig, config)) {
- return {
- intl: createIntl(config, cache),
- prevConfig: config,
- };
- }
- return null;
- };
- IntlProvider.prototype.render = function () {
- utils.invariantIntlContext(this.state.intl);
- return React__default.createElement(injectIntl_1.Provider, { value: this.state.intl }, this.props.children);
- };
- IntlProvider.displayName = 'IntlProvider';
- IntlProvider.defaultProps = utils.DEFAULT_INTL_CONFIG;
- return IntlProvider;
- }(React__default.PureComponent));
- exports.default = IntlProvider;
- });
-
- styleInject_es.unwrapExports(provider);
- var provider_1 = provider.createIntl;
-
- var relative = styleInject_es.createCommonjsModule(function (module, exports) {
- var __extends = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
-
-
-
- // Since rollup cannot deal with namespace being a function,
- // this is to interop with TypeScript since `invariant`
- // does not export a default
- // https://github.com/rollup/rollup/issues/1267
-
- var invariant = browser.default || browser;
- var MINUTE = 60;
- var HOUR = 60 * 60;
- var DAY = 60 * 60 * 24;
- function selectUnit(seconds) {
- var absValue = Math.abs(seconds);
- if (absValue < MINUTE) {
- return 'second';
- }
- if (absValue < HOUR) {
- return 'minute';
- }
- if (absValue < DAY) {
- return 'hour';
- }
- return 'day';
- }
- function getDurationInSeconds(unit) {
- switch (unit) {
- case 'second':
- return 1;
- case 'minute':
- return MINUTE;
- case 'hour':
- return HOUR;
- default:
- return DAY;
- }
- }
- function valueToSeconds(value, unit) {
- if (!value) {
- return 0;
- }
- switch (unit) {
- case 'second':
- return value;
- case 'minute':
- return value * MINUTE;
- default:
- return value * HOUR;
- }
- }
- var INCREMENTABLE_UNITS = ['second', 'minute', 'hour'];
- function canIncrement(unit) {
- if (unit === void 0) { unit = 'second'; }
- return INCREMENTABLE_UNITS.includes(unit);
- }
- function verifyProps(updateIntervalInSeconds, unit) {
- invariant(!updateIntervalInSeconds || (updateIntervalInSeconds && canIncrement(unit)), 'Cannot schedule update with unit longer than hour');
- }
- var FormattedRelativeTime = /** @class */ (function (_super) {
- __extends(FormattedRelativeTime, _super);
- function FormattedRelativeTime(props) {
- var _this = _super.call(this, props) || this;
- // Public for testing
- _this._updateTimer = null;
- _this.state = {
- prevUnit: _this.props.unit,
- prevValue: _this.props.value,
- currentValueInSeconds: canIncrement(_this.props.unit)
- ? valueToSeconds(_this.props.value, _this.props.unit)
- : 0,
- };
- verifyProps(props.updateIntervalInSeconds, props.unit);
- return _this;
- }
- FormattedRelativeTime.prototype.scheduleNextUpdate = function (_a, _b) {
- var _this = this;
- var updateIntervalInSeconds = _a.updateIntervalInSeconds, unit = _a.unit;
- var currentValueInSeconds = _b.currentValueInSeconds;
- clearTimeout(this._updateTimer);
- this._updateTimer = null;
- // If there's no interval and we cannot increment this unit, do nothing
- if (!updateIntervalInSeconds || !canIncrement(unit)) {
- return;
- }
- // Figure out the next interesting time
- var nextValueInSeconds = currentValueInSeconds - updateIntervalInSeconds;
- var nextUnit = selectUnit(nextValueInSeconds);
- // We've reached the max auto incrementable unit, don't schedule another update
- if (nextUnit === 'day') {
- return;
- }
- var unitDuration = getDurationInSeconds(nextUnit);
- var remainder = nextValueInSeconds % unitDuration;
- var prevInterestingValueInSeconds = nextValueInSeconds - remainder;
- var nextInterestingValueInSeconds = prevInterestingValueInSeconds >= currentValueInSeconds
- ? prevInterestingValueInSeconds - unitDuration
- : prevInterestingValueInSeconds;
- var delayInSeconds = Math.abs(nextInterestingValueInSeconds - currentValueInSeconds);
- this._updateTimer = setTimeout(function () {
- return _this.setState({
- currentValueInSeconds: nextInterestingValueInSeconds,
- });
- }, delayInSeconds * 1e3);
- };
- FormattedRelativeTime.prototype.componentDidMount = function () {
- this.scheduleNextUpdate(this.props, this.state);
- };
- FormattedRelativeTime.prototype.componentDidUpdate = function () {
- this.scheduleNextUpdate(this.props, this.state);
- };
- FormattedRelativeTime.prototype.componentWillUnmount = function () {
- clearTimeout(this._updateTimer);
- this._updateTimer = null;
- };
- FormattedRelativeTime.getDerivedStateFromProps = function (props, state) {
- if (props.unit !== state.prevUnit || props.value !== state.prevValue) {
- return {
- prevValue: props.value,
- prevUnit: props.unit,
- currentValueInSeconds: canIncrement(props.unit)
- ? valueToSeconds(props.value, props.unit)
- : 0,
- };
- }
- return null;
- };
- FormattedRelativeTime.prototype.render = function () {
- var _this = this;
- return (React__default.createElement(injectIntl_1.Context.Consumer, null, function (intl) {
- utils.invariantIntlContext(intl);
- var formatRelativeTime = intl.formatRelativeTime, Text = intl.textComponent;
- var _a = _this.props, children = _a.children, value = _a.value, unit = _a.unit, updateIntervalInSeconds = _a.updateIntervalInSeconds;
- var currentValueInSeconds = _this.state.currentValueInSeconds;
- var currentValue = value || 0;
- var currentUnit = unit;
- if (canIncrement(unit) &&
- typeof currentValueInSeconds === 'number' &&
- updateIntervalInSeconds) {
- currentUnit = selectUnit(currentValueInSeconds);
- var unitDuration = getDurationInSeconds(currentUnit);
- currentValue = Math.round(currentValueInSeconds / unitDuration);
- }
- var formattedRelativeTime = formatRelativeTime(currentValue, currentUnit, __assign({}, _this.props));
- if (typeof children === 'function') {
- return children(formattedRelativeTime);
- }
- if (Text) {
- return React__default.createElement(Text, null, formattedRelativeTime);
- }
- return formattedRelativeTime;
- }));
- };
- FormattedRelativeTime.displayName = 'FormattedRelativeTime';
- FormattedRelativeTime.defaultProps = {
- value: 0,
- unit: 'second',
- };
- return FormattedRelativeTime;
- }(React__default.PureComponent));
- exports.FormattedRelativeTime = FormattedRelativeTime;
- exports.default = FormattedRelativeTime;
- });
-
- styleInject_es.unwrapExports(relative);
- var relative_1 = relative.FormattedRelativeTime;
-
- var plural$1 = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
- var FormattedPlural = function (props) {
- var value = props.value, other = props.other, children = props.children, _a = props.intl, formatPlural = _a.formatPlural, Text = _a.textComponent;
- var pluralCategory = formatPlural(value, props);
- var formattedPlural = props[pluralCategory] || other;
- if (typeof children === 'function') {
- return children(formattedPlural);
- }
- if (Text) {
- return React__default.createElement(Text, null, formattedPlural);
- }
- // Work around @types/react where React.FC cannot return string
- return formattedPlural;
- };
- FormattedPlural.defaultProps = {
- type: 'cardinal',
- };
- FormattedPlural.displayName = 'FormattedPlural';
- exports.default = injectIntl_1.default(FormattedPlural);
- });
-
- styleInject_es.unwrapExports(plural$1);
-
- var message$1 = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- var __extends = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- var __rest = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__rest) || function (s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
- t[p[i]] = s[p[i]];
- return t;
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
-
-
- var shallowEquals = objects.default || objects;
- var defaultFormatMessage = function (descriptor, values) {
- if (process.env.NODE_ENV !== 'production') {
- console.error('[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry. Using default message as fallback.');
- }
- return message.formatMessage(__assign({}, utils.DEFAULT_INTL_CONFIG, { locale: 'en' }), utils.createFormatters(), descriptor, values);
- };
- var FormattedMessage = /** @class */ (function (_super) {
- __extends(FormattedMessage, _super);
- function FormattedMessage() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- FormattedMessage.prototype.shouldComponentUpdate = function (nextProps) {
- var _a = this.props, values = _a.values, otherProps = __rest(_a, ["values"]);
- var nextValues = nextProps.values, nextOtherProps = __rest(nextProps, ["values"]);
- return (!shallowEquals(nextValues, values) ||
- !shallowEquals(otherProps, nextOtherProps));
- };
- FormattedMessage.prototype.render = function () {
- var _this = this;
- return (React__default.createElement(injectIntl_1.Context.Consumer, null, function (intl) {
- if (!_this.props.defaultMessage) {
- utils.invariantIntlContext(intl);
- }
- var _a = intl || {}, _b = _a.formatMessage, formatMessage = _b === void 0 ? defaultFormatMessage : _b, _c = _a.textComponent, Text = _c === void 0 ? React__default.Fragment : _c;
- var _d = _this.props, id = _d.id, description = _d.description, defaultMessage = _d.defaultMessage, values = _d.values, children = _d.children, _e = _d.tagName, Component = _e === void 0 ? Text : _e;
- var descriptor = { id: id, description: description, defaultMessage: defaultMessage };
- var nodes = formatMessage(descriptor, values);
- if (!Array.isArray(nodes)) {
- nodes = [nodes];
- }
- if (typeof children === 'function') {
- return children.apply(void 0, nodes);
- }
- if (Component) {
- // Needs to use `createElement()` instead of JSX, otherwise React will
- // warn about a missing `key` prop with rich-text message formatting.
- return React__default.createElement.apply(React__default, [Component, null].concat(nodes));
- }
- return nodes;
- }));
- };
- FormattedMessage.displayName = 'FormattedMessage';
- FormattedMessage.defaultProps = {
- values: {},
- };
- return FormattedMessage;
- }(React__default.Component));
- exports.default = FormattedMessage;
- });
-
- styleInject_es.unwrapExports(message$1);
-
- var htmlMessage = styleInject_es.createCommonjsModule(function (module, exports) {
- /*
- * Copyright 2015, Yahoo Inc.
- * Copyrights licensed under the New BSD License.
- * See the accompanying LICENSE file for terms.
- */
- var __extends = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__extends) || (function () {
- var extendStatics = function (d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- return function (d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- };
- })();
- var __assign = (styleInject_es.commonjsGlobal && styleInject_es.commonjsGlobal.__assign) || function () {
- __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;
- };
- return __assign.apply(this, arguments);
- };
- Object.defineProperty(exports, "__esModule", { value: true });
-
-
-
-
- var FormattedHTMLMessage = /** @class */ (function (_super) {
- __extends(FormattedHTMLMessage, _super);
- function FormattedHTMLMessage() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- FormattedHTMLMessage.prototype.render = function () {
- var _this = this;
- return (React__default.createElement(injectIntl_1.Context.Consumer, null, function (intl) {
- if (!_this.props.defaultMessage) {
- utils.invariantIntlContext(intl);
- }
- var formatHTMLMessage = intl.formatHTMLMessage, textComponent = intl.textComponent;
- var _a = _this.props, id = _a.id, description = _a.description, defaultMessage = _a.defaultMessage, rawValues = _a.values, children = _a.children;
- var Component = _this.props.tagName;
- // This is bc of TS3.3 doesn't recognize `defaultProps`
- if (!Component) {
- Component = textComponent || 'span';
- }
- var descriptor = { id: id, description: description, defaultMessage: defaultMessage };
- var formattedHTMLMessage = formatHTMLMessage(descriptor, rawValues);
- if (typeof children === 'function') {
- return children(formattedHTMLMessage);
- }
- // Since the message presumably has HTML in it, we need to set
- // `innerHTML` in order for it to be rendered and not escaped by React.
- // To be safe, all string prop values were escaped when formatting the
- // message. It is assumed that the message is not UGC, and came from the
- // developer making it more like a template.
- //
- // Note: There's a perf impact of using this component since there's no
- // way for React to do its virtual DOM diffing.
- var html = { __html: formattedHTMLMessage };
- return React__default.createElement(Component, { dangerouslySetInnerHTML: html });
- }));
- };
- FormattedHTMLMessage.displayName = 'FormattedHTMLMessage';
- FormattedHTMLMessage.defaultProps = __assign({}, message$1.default.defaultProps, { tagName: 'span' });
- return FormattedHTMLMessage;
- }(message$1.default));
- exports.default = FormattedHTMLMessage;
- });
-
- styleInject_es.unwrapExports(htmlMessage);
-
- var dist$5 = styleInject_es.createCommonjsModule(function (module, exports) {
- Object.defineProperty(exports, "__esModule", { value: true });
-
- exports.defineMessages = dist.defineMessages;
-
-
- exports.injectIntl = injectIntl_1.default;
- exports.RawIntlProvider = injectIntl_1.Provider;
- exports.IntlContext = injectIntl_1.Context;
-
- exports.useIntl = useIntl_1.default;
-
- exports.IntlProvider = provider.default;
- exports.createIntl = provider.createIntl;
- // IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./types').CustomFormatConfig`
- exports.FormattedDate = createFormattedComponent_1.createFormattedComponent('formatDate');
- exports.FormattedTime = createFormattedComponent_1.createFormattedComponent('formatTime');
- exports.FormattedNumber = createFormattedComponent_1.createFormattedComponent('formatNumber');
- exports.FormattedList = createFormattedComponent_1.createFormattedComponent('formatList');
- exports.FormattedDateParts = createFormattedComponent_1.createFormattedDateTimePartsComponent('formatDate');
- exports.FormattedTimeParts = createFormattedComponent_1.createFormattedDateTimePartsComponent('formatTime');
- var createFormattedComponent_2 = createFormattedComponent_1;
- exports.FormattedNumberParts = createFormattedComponent_2.FormattedNumberParts;
-
- exports.FormattedRelativeTime = relative.default;
-
- exports.FormattedPlural = plural$1.default;
-
- exports.FormattedMessage = message$1.default;
-
- exports.FormattedHTMLMessage = htmlMessage.default;
-
- exports.createIntlCache = utils.createIntlCache;
- });
-
- styleInject_es.unwrapExports(dist$5);
- var dist_1$2 = dist$5.defineMessages;
- var dist_2$1 = dist$5.injectIntl;
- var dist_3 = dist$5.RawIntlProvider;
- var dist_4 = dist$5.IntlContext;
- var dist_5 = dist$5.useIntl;
- var dist_6 = dist$5.IntlProvider;
- var dist_7 = dist$5.createIntl;
- var dist_8 = dist$5.FormattedDate;
- var dist_9 = dist$5.FormattedTime;
- var dist_10 = dist$5.FormattedNumber;
- var dist_11 = dist$5.FormattedList;
- var dist_12 = dist$5.FormattedDateParts;
- var dist_13 = dist$5.FormattedTimeParts;
- var dist_14 = dist$5.FormattedNumberParts;
- var dist_15 = dist$5.FormattedRelativeTime;
- var dist_16 = dist$5.FormattedPlural;
- var dist_17 = dist$5.FormattedMessage;
- var dist_18 = dist$5.FormattedHTMLMessage;
- var dist_19 = dist$5.createIntlCache;
-
- const img$1 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAABECAYAAAAGGj65AAAXgklEQVR4Xu1deXwc1ZH+qufSjbFlbHwbX4C57QDTPZJakg8MxECICQSShUCcDfAjLOQAFoiBEEgWNtmwAcIZJwQI5ohtgk9pRpa6RSAQwCaAuWxsZGMZbEvWNUfX/l7L48z0jGa6RzKyvOr/pK5Xr169b+q9V1WvmjD4DGqgHzVA/dj3YNeDGsAgAAdB0K8aGARgv6p/sPNBAA5ioF81MAjAflX/YOdpASjXtFb5XLjlk/bYzOYuFLREDOmgVBURl3rJGJlHrZOLXfX5bs+NT53qe/uglHVQqLQaSAbg8pbSk3xY+8bu6IkDUV8+F3HVEZ7VK7YVnoULKDYQx/D/Teb9AJy8snX63kjsb9s7jMKBroQZQ93bDx9SfPTambRnoI/lUJe/G4Av7Boy0k2bt3cYJYfKgJVS90daVcmkAzUeVVVLARQJ/l7DMPXoYt67or6++UD1eTDxnRUIHBVlPiJFJo9nUygU2m5XVlNxJ65pqX1zV7TSbqOBQnfJBO//PHFq0bV9LW+lLJ9jgJ8HkLw3JjxZpzVe3Nv+5s2b52tv2f0OgQ5P5EXgh4Na44+d8K8qKzvFMGI3JbfhnSGt8d+d8LHSVsryYwb4shQeJF1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OqOG81UjEmgGmUFz1KIZFLBYgWfQDwtu8Az65rAF/msOYgYbWu6gjPNg33IHHRh1fdsddGC/F8mgJbPDHXEHkWbLCTrPIDkj4rukFGHVwNMPrEUEySN14YO1KAFceZQi2uwdxfq02ZIsvKXNFiQMMshMzY5DEl4wuyDhnF6LloSzFWaDtTDA7NhzgN3MBobl0pIYtq8keZPv9HECNQA+usBHPGB5qgDsu8Chy1pAiemUxQrYzWyviN8l6I/T+wU2HDmgaaHs/gAAAABJRU5ErkJggg==';
-
- var css$1 = ".PayPlatformOptions_flexContainer__1-MCg {\n display: flex;\n justify-content: space-around;\n align-items: center;\n}\n.PayPlatformOptions_label__1E4pz {\n font-size: 14px;\n font-weight: 400;\n color: #616A79;\n}\n.PayPlatformOptions_payment-method-box__Iiao- {\n padding: 20px 10px 10px 10px;\n text-align: center;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payment-method__3fVWP {\n display: inline-block;\n margin: 0;\n width: 60%;\n vertical-align: middle;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payment-method-before__2Lu24 {\n display: inline-block;\n height: 100%;\n vertical-align: middle;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n border: 1px solid transparent;\n height: 66px;\n line-height: 66px;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS .PayPlatformOptions_platformName__2VrlA {\n text-align: center;\n white-space: nowrap;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_small__kkYKV {\n width: 88px;\n height: 36px;\n line-height: 36px;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_small__kkYKV .PayPlatformOptions_payment-method__3fVWP {\n margin: 0;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_active__3uZ7L {\n border-radius: 5px;\n border-color: #1790FF;\n box-shadow: 0px 2px 6px 0px rgba(163, 163, 163, 0.3);\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_en__2udua {\n font-size: 12px;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G {\n padding: 8px 10px 10px 8px;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G .PayPlatformOptions_payitem__2o3qS {\n display: inline-block;\n width: 78px;\n height: 80px;\n border: 1px solid transparent;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_active__3uZ7L {\n border-radius: 4px;\n border-color: #1790FF;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G .PayPlatformOptions_payitem__2o3qS .PayPlatformOptions_payment-method__3fVWP {\n display: inline-block;\n width: 34px;\n height: 34px;\n}\n@media (max-width: 768px) {\n .PayPlatformOptions_payitem__2o3qS {\n cursor: pointer;\n border: 1px solid transparent;\n }\n .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_active__3uZ7L {\n border-radius: 5px;\n border-color: #1790FF;\n }\n}\n";
- var styles$1 = {"flexContainer":"PayPlatformOptions_flexContainer__1-MCg","label":"PayPlatformOptions_label__1E4pz","payment-method-box":"PayPlatformOptions_payment-method-box__Iiao-","payment-method":"PayPlatformOptions_payment-method__3fVWP","payment-method-before":"PayPlatformOptions_payment-method-before__2Lu24","payitem":"PayPlatformOptions_payitem__2o3qS","platformName":"PayPlatformOptions_platformName__2VrlA","small":"PayPlatformOptions_small__kkYKV","active":"PayPlatformOptions_active__3uZ7L","en":"PayPlatformOptions_en__2udua","mobile":"PayPlatformOptions_mobile__XZq_G","paymentMethodBox":"PayPlatformOptions_payment-method-box__Iiao-","paymentMethod":"PayPlatformOptions_payment-method__3fVWP","paymentMethodBefore":"PayPlatformOptions_payment-method-before__2Lu24"};
- styleInject_es.styleInject(css$1);
-
- var PAY_CHANNEL = {
- PAYPAL: "PAYPAL_PAYPAL",
- // PAYPAL_LIVE
- ALI_WEB: "ALI_WEB",
- ALI_WAP: "ALI_WAP",
- WX_WAP: "WX_WAP",
- WX_NATIVE: "WX_NATIVE"
- };
-
- var PayPlatformOptions =
- /*#__PURE__*/
- function (_PureComponent) {
- styleInject_es._inherits(PayPlatformOptions, _PureComponent);
-
- function PayPlatformOptions() {
- styleInject_es._classCallCheck(this, PayPlatformOptions);
-
- return styleInject_es._possibleConstructorReturn(this, styleInject_es._getPrototypeOf(PayPlatformOptions).apply(this, arguments));
- }
-
- styleInject_es._createClass(PayPlatformOptions, [{
- key: "render",
- value: function render() {
- var _classnames5, _classnames6, _classnames7;
-
- var _this$props = this.props,
- payitem = _this$props.payitem,
- onPayItemChange = _this$props.onPayItemChange,
- _this$props$isMobile = _this$props.isMobile,
- isMobile = _this$props$isMobile === void 0 ? false : _this$props$isMobile,
- _this$props$size = _this$props.size,
- size = _this$props$size === void 0 ? "normal" : _this$props$size,
- _this$props$withTitle = _this$props.withTitle,
- withTitle = _this$props$withTitle === void 0 ? true : _this$props$withTitle,
- _this$props$locale = _this$props.locale,
- locale = _this$props$locale === void 0 ? "zh" : _this$props$locale;
- var titleDOM = null;
-
- if (withTitle) {
- titleDOM = React__default.createElement("div", {
- className: styles$1.label
- }, React__default.createElement(dist_17, {
- id: "pay.channel.select.text"
- }));
- }
-
- if (isMobile) {
- var _classnames2, _classnames3, _classnames4;
-
- return React__default.createElement("div", null, titleDOM, React__default.createElement("div", {
- className: styleInject_es.classnames(styles$1["payment-method-box"], styleInject_es._defineProperty({}, styles$1.mobile, isMobile))
- }, React__default.createElement("div", {
- className: styles$1.flexContainer
- }, React__default.createElement("div", {
- className: styles$1.flexItem
- }, React__default.createElement("div", {
- className: styleInject_es.classnames((_classnames2 = {}, styleInject_es._defineProperty(_classnames2, styles$1.payitem, true), styleInject_es._defineProperty(_classnames2, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), styleInject_es._defineProperty(_classnames2, styles$1.small, size === "small"), _classnames2), styles$1[locale]),
- onClick: function onClick() {
- onPayItemChange(PAY_CHANNEL.ALI_WEB);
- }
- }, React__default.createElement("img", {
- src: img$4,
- alt: "alipay",
- className: styles$1["payment-method"]
- }), React__default.createElement("div", {
- className: styles$1.platformName
- }, React__default.createElement(dist_17, {
- id: "pay.channel.ali"
- })))), React__default.createElement("div", {
- className: styles$1.flexItem
- }, React__default.createElement("div", {
- className: styleInject_es.classnames((_classnames3 = {}, styleInject_es._defineProperty(_classnames3, styles$1.payitem, true), styleInject_es._defineProperty(_classnames3, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), styleInject_es._defineProperty(_classnames3, styles$1.small, size === "small"), _classnames3), styles$1[locale]),
- onClick: function onClick() {
- onPayItemChange(PAY_CHANNEL.WX_NATIVE);
- }
- }, React__default.createElement("img", {
- src: img$5,
- alt: "wechatpay",
- className: styles$1["payment-method"]
- }), React__default.createElement("div", {
- className: styles$1.platformName
- }, React__default.createElement(dist_17, {
- id: "pay.channel.wechat"
- })))), React__default.createElement("div", {
- className: styles$1.flexItem
- }, React__default.createElement("div", {
- className: styleInject_es.classnames((_classnames4 = {}, styleInject_es._defineProperty(_classnames4, styles$1.payitem, true), styleInject_es._defineProperty(_classnames4, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), styleInject_es._defineProperty(_classnames4, styles$1.small, size === "small"), _classnames4), styles$1[locale]),
- onClick: function onClick() {
- onPayItemChange(PAY_CHANNEL.PAYPAL);
- }
- }, React__default.createElement("img", {
- src: img$6,
- alt: "paypal",
- className: styles$1["payment-method"]
- }), React__default.createElement("div", {
- className: styles$1.platformName
- }, React__default.createElement(dist_17, {
- id: "pay.channel.paypal"
- })))))));
- }
-
- return React__default.createElement("div", null, titleDOM, React__default.createElement("div", {
- className: styles$1["payment-method-box"]
- }, React__default.createElement("div", {
- className: styles$1.flexContainer
- }, React__default.createElement("div", {
- className: styles$1.flexItem
- }, React__default.createElement("div", {
- className: styleInject_es.classnames((_classnames5 = {}, styleInject_es._defineProperty(_classnames5, styles$1.payitem, true), styleInject_es._defineProperty(_classnames5, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), styleInject_es._defineProperty(_classnames5, styles$1.small, size === "small"), _classnames5), styles$1[locale]),
- onClick: function onClick() {
- onPayItemChange(PAY_CHANNEL.ALI_WEB);
- }
- }, React__default.createElement("span", {
- className: styles$1["payment-method-before"]
- }), React__default.createElement("img", {
- src: img$1,
- alt: "alipay",
- className: styles$1["payment-method"]
- }))), React__default.createElement("div", {
- className: styles$1.flexItem
- }, React__default.createElement("div", {
- className: styleInject_es.classnames((_classnames6 = {}, styleInject_es._defineProperty(_classnames6, styles$1.payitem, true), styleInject_es._defineProperty(_classnames6, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), styleInject_es._defineProperty(_classnames6, styles$1.small, size === "small"), _classnames6), styles$1[locale]),
- onClick: function onClick() {
- onPayItemChange(PAY_CHANNEL.WX_NATIVE);
- }
- }, React__default.createElement("span", {
- className: styles$1["payment-method-before"]
- }), React__default.createElement("img", {
- src: img$2,
- alt: "wechatpay",
- className: styles$1["payment-method"]
- }))), React__default.createElement("div", {
- className: styles$1.flexItem
- }, React__default.createElement("div", {
- className: styleInject_es.classnames((_classnames7 = {}, styleInject_es._defineProperty(_classnames7, styles$1.payitem, true), styleInject_es._defineProperty(_classnames7, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), styleInject_es._defineProperty(_classnames7, styles$1.small, size === "small"), _classnames7), styles$1[locale]),
- onClick: function onClick() {
- onPayItemChange(PAY_CHANNEL.PAYPAL);
- }
- }, React__default.createElement("span", {
- className: styles$1["payment-method-before"]
- }), React__default.createElement("img", {
- src: img$3,
- alt: "paypal",
- className: styles$1["payment-method"]
- }))))));
- }
- }]);
-
- return PayPlatformOptions;
- }(React.PureComponent);
-
- var css$2 = ".PriceOptions_options__iSN_S {\n padding: 20px 50px;\n border-bottom: 1px dashed #00000017;\n}\n.PriceOptions_options__iSN_S p {\n font-size: 14px;\n font-weight: 400;\n color: #616a79;\n margin-bottom: 20px;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD {\n padding-right: 0;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ {\n background: rgba(243, 243, 243, 0.14);\n border-radius: 4px;\n border: 1px solid #cfcfcf;\n font-size: 14px;\n font-weight: 600;\n color: #616a79;\n display: inline-block;\n text-align: center;\n vertical-align: top;\n height: 30px;\n width: 70px;\n line-height: 30px;\n cursor: pointer;\n margin: 6px;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ.PriceOptions_active__3cl1G {\n background: rgba(255, 50, 102, 0.1);\n border-radius: 4px;\n border: 1px solid #ff3266;\n color: #616a79;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceInput__2GSDh {\n display: inline-block;\n min-width: 70px;\n width: auto;\n margin: 6px;\n text-align: center;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD button {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n height: 30px;\n width: 50px;\n vertical-align: top;\n padding: 0 5px;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_rate__FJSKL {\n margin-left: 10px;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_rate__FJSKL i {\n margin-right: 5px;\n color: #1790FF;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i {\n padding: 0 0 12px 0;\n border-bottom: none;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i p {\n margin-bottom: 8px;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD {\n text-align: center;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ {\n border-radius: 6px;\n height: 32px;\n width: 72px;\n margin: 0 0 12px 19px;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ:first-child {\n margin: 0 0 12px 0px;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD .PriceOptions_priceInput__2GSDh {\n display: block;\n width: 254px;\n border-radius: 6px;\n height: 32px;\n}\n@media (max-width: 768px) {\n .PriceOptions_options__iSN_S {\n padding: 20px 20px;\n }\n .PriceOptions_options__iSN_S p {\n font-size: 14px;\n font-weight: 400;\n color: #616a79;\n }\n .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD {\n padding-right: 0;\n display: flex;\n flex-direction: column;\n justify-content: center;\n }\n .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceBtn__2vdWf {\n display: flex;\n justify-content: space-between;\n }\n .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ {\n display: inline-block;\n background-color: #fff;\n width: 74px;\n height: 36px;\n line-height: 36px;\n border-radius: 6px;\n border: 1px solid #cfcfcf;\n }\n .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ.PriceOptions_active__3cl1G {\n background-color: #fff;\n color: #FF3266FF;\n border-radius: 4px;\n border: 1px solid #ff3266;\n }\n .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceInput__2GSDh {\n border-radius: 6px;\n height: 36px;\n width: auto;\n }\n}\n";
- var styles$2 = {"options":"PriceOptions_options__iSN_S","infoItem":"PriceOptions_infoItem__p5iwD","priceItem":"PriceOptions_priceItem__3ahwJ","active":"PriceOptions_active__3cl1G","priceInput":"PriceOptions_priceInput__2GSDh","rate":"PriceOptions_rate__FJSKL","small":"PriceOptions_small__3O05i","priceBtn":"PriceOptions_priceBtn__2vdWf"};
- styleInject_es.styleInject(css$2);
-
- var PriceOptions = function PriceOptions(_ref) {
- var price = _ref.price,
- onPriceChange = _ref.onPriceChange,
- _ref$size = _ref.size,
- size = _ref$size === void 0 ? 'normal' : _ref$size,
- _ref$focusScroll = _ref.focusScroll,
- focusScroll = _ref$focusScroll === void 0 ? true : _ref$focusScroll,
- _ref$withTitle = _ref.withTitle,
- withTitle = _ref$withTitle === void 0 ? true : _ref$withTitle,
- inputRef = _ref.inputRef;
- var intl = dist_5();
- var defaultOptions = [100, 600, 800]; // 控制是否为其他金额输入情况
-
- var _useState = React.useState(false),
- _useState2 = styleInject_es._slicedToArray(_useState, 2),
- inputStatus = _useState2[0],
- setInputStatus = _useState2[1];
-
- return React__default.createElement("div", {
- className: styleInject_es.classnames(styles$2.options, styleInject_es._defineProperty({}, styles$2[size], true))
- }, withTitle ? React__default.createElement("p", null, React__default.createElement(dist_17, {
- id: "pay.price.select.text"
- })) : null, React__default.createElement("div", {
- className: styles$2.infoItem,
- style: {
- marginBottom: '-12px'
- }
- }, React__default.createElement("span", {
- className: styles$2.priceBtn
- }, defaultOptions.map(function (item) {
- var _classnames2;
-
- return React__default.createElement("span", {
- className: styleInject_es.classnames((_classnames2 = {}, styleInject_es._defineProperty(_classnames2, styles$2.priceItem, true), styleInject_es._defineProperty(_classnames2, styles$2.active, price === item && !inputStatus), _classnames2)),
- key: item,
- onClick: function onClick() {
- onPriceChange(item);
- setInputStatus(false);
- }
- }, React__default.createElement(dist_17, {
- id: "pay.price.money.text",
- values: {
- value: formatMoney(item / 100, 0)
- }
- }));
- })), React__default.createElement(_Input, {
- ref: inputRef,
- onMouseEnter: function onMouseEnter() {
- if (inputStatus && inputRef && inputRef.current) {
- inputRef.current.focus();
- inputRef.current.select();
- }
- },
- suffix: "\xA5",
- className: styles$2.priceInput,
- value: inputStatus ? price / 100 || '' : '',
- placeholder: intl.formatMessage({
- id: 'pay.price.money.others'
- }),
- onChange: function onChange(e) {
- var n = +e.target.value;
-
- if (Number.isNaN(n)) {
- return;
- } // 测试暂时改成1分
-
-
- onPriceChange(n * 100);
- },
- onClick: function onClick(e) {
- onPriceChange(0);
- setInputStatus(true);
- },
- onFocus: function onFocus(e) {
- if (focusScroll) {
- e.target.scrollIntoView();
- }
- }
- })));
- };
-
- var css$3 = ".WaitPayInfoView_waitingContainer__3wZ0a {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n";
- var styles$3 = {"waitingContainer":"WaitPayInfoView_waitingContainer__3wZ0a"};
- styleInject_es.styleInject(css$3);
-
- const img$7 = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDhweCIgaGVpZ2h0PSI0M3B4IiB2aWV3Qm94PSIwIDAgNDggNDMiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1MDQ3KSAtIGh0dHA6Ly93d3cuYm9oZW1pYW5jb2RpbmcuY29tL3NrZXRjaCAtLT4KICAgIDx0aXRsZT5rY3hxX3BvcG92ZXJzX2ljb25fdGFuaGFvPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGRlZnM+PC9kZWZzPgogICAgPGcgaWQ9IlBhZ2UtMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IuWPpuWuoue9kV/nm7Tmkq3or75f6K++56iL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4LCA4LjE5MzQxNikiIGZpbGw9IiNGRkZGRkYiPgogICAgICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMi41LDI3LjQ5NzEwOTggQzEuMTMyMzUyOTQsMjcuNDk3MTA5OCAwLDI2LjM3OTQ2MjggMCwyNC45OTcxMDk4IEMwLDIzLjYxNDc1NjkgMS4xMzIzNTI5NCwyMi40OTcxMDk4IDIuNSwyMi40OTcxMDk4IEMzLjg2NzY0NzA2LDIyLjQ5NzEwOTggNSwyMy42MTQ3NTY5IDUsMjQuOTk3MTA5OCBDNSwyNi4zNzk0NjI4IDMuODY3NjQ3MDYsMjcuNDk3MTA5OCAyLjUsMjcuNDk3MTA5OCBaIE0yLjUsMTkuNDIxOTY1MyBDMS4xMzIzNTI5NCwxOS40MjE5NjUzIDAsMTguMTkxOTA3NSAwLDE2LjY3MDUyMDIgTDAsMi43NTE0NDUwOSBDMCwxLjI0NjI0Mjc3IDEuMTMyMzUyOTQsMCAyLjUsMCBDMy44Njc2NDcwNiwwIDUsMS4yMzAwNTc4IDUsMi43NTE0NDUwOSBMNSwxNi42NzA1MjAyIEM1LDE4LjE5MTkwNzUgMy44Njc2NDcwNiwxOS40MjE5NjUzIDIuNSwxOS40MjE5NjUzIFoiIGlkPSJTaGFwZSI+PC9wYXRoPgogICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';
-
- var WaitPayInfoView =
- /*#__PURE__*/
- function (_Component) {
- styleInject_es._inherits(WaitPayInfoView, _Component);
-
- function WaitPayInfoView() {
- styleInject_es._classCallCheck(this, WaitPayInfoView);
-
- return styleInject_es._possibleConstructorReturn(this, styleInject_es._getPrototypeOf(WaitPayInfoView).apply(this, arguments));
- }
-
- styleInject_es._createClass(WaitPayInfoView, [{
- key: "render",
- value: function render() {
- var _this$props = this.props,
- onClickPayed = _this$props.onClickPayed,
- onClickProblem = _this$props.onClickProblem;
- return React__default.createElement("div", {
- className: styles$3.waitingContainer
- }, React__default.createElement("div", {
- className: styles$3.infoIconImgContainer
- }, React__default.createElement("img", {
- src: img$7,
- alt: "info label icon"
- })), React__default.createElement("div", null, React__default.createElement("div", {
- className: styles$3.pay_text
- }, "live.course_info.pay.notification"), React__default.createElement("div", {
- className: styles$3.btn_row
- }, React__default.createElement(_Button, {
- className: styleInject_es.classnames(styles$3.pay_btn, styles$3.btn_default),
- size: "small",
- onClick: function onClick() {
- onClickPayed && onClickPayed();
- }
- }, "live.course_info.pay.payed"), React__default.createElement(_Button, {
- className: styles$3.btn_default,
- size: "small",
- style: {
- marginLeft: '16px'
- },
- onClick: function onClick() {
- onClickProblem && onClickProblem();
- }
- }, "live.course_info.pay.help"))));
- }
- }]);
-
- return WaitPayInfoView;
- }(React.Component);
-
- styleInject_es._defineProperty(WaitPayInfoView, "defaultProps", {
- onClickPayed: function onClickPayed() {
- console.log("onClickPayed");
- },
- onClickProblem: function onClickProblem() {
- console.log("onClickProblem");
- }
- });
-
- exports.ConsumeListView = ConsumeListView;
- exports.PayPlatformOptions = PayPlatformOptions;
- exports.PriceOptions = PriceOptions;
- exports.WaitPayInfoView = WaitPayInfoView;
- //# sourceMappingURL=index-c6999c10.js.map
|